ROM Hack 100 Classic Books - File Formats

Keshire

Well-Known Member
OP
Member
Joined
Sep 8, 2007
Messages
145
Trophies
1
Age
44
Website
Visit site
XP
203
Country
United States
It'd be nice if the homebrew readers had the kind of polish that this commercial rom does. It also supports images which is nice.

Anyways, I decided to take a look at the files to see how difficult it'd be to write a book importer.
The books themselves are located in ./data/eile

Here is the format:
byte 8bits, short 16bits, long 32bits
Code:
typedef struct {
// Header for the file
ubyte    Unknown[16];
ulong     FileTypes; //Maybe??
ulong     FileOffsets[28]; //to Compressed NARCs
ulong     FileSizes[28];// size of compressed NARCs
} BookRecord;

The bulk of the book is in the .BD files. They are plaintext and use a markup language similar to HTML. Like so:
Code:
Alice's Adventures in Wonderland

Lewis Carroll




You can't think how glad I am to see you again, you dear old thing!

but there were three gardeners at it,
with a great crowd assembled about themall sorts of little birds and beasts,

I don't think it'd be all that hard to write a converter. I still need to see if the wifi books are stored the same way though.
 
  • Like
Reactions: 1 person

Sora de Eclaune

All our splendor...
Member
Joined
Feb 15, 2011
Messages
2,850
Trophies
1
Location
Home
Website
www.youtube.com
XP
1,203
Country
United States
It'd be nice if the homebrew readers had the kind of polish that this commercial rom does. It also supports images which is nice.

Interesting that it supports images. This could mean that if we get to importing new books into the ROM, we could import books where images are crucial to the story instead of reading the book through DSReader and not have the images to look at.
 

Vampire Lied

Resident sociopath
Member
Joined
May 27, 2011
Messages
628
Trophies
0
Age
46
Location
somewhere
XP
263
Country
United States
That would be awesome! I actually wondered if inserting your own books was possible.
If a converter/importer gets made, this'll be the best book reading app!
I'd love to rip out most of the default books and insert my own.
 

Keshire

Well-Known Member
OP
Member
Joined
Sep 8, 2007
Messages
145
Trophies
1
Age
44
Website
Visit site
XP
203
Country
United States
Looks like the Wifi books are stored in the same format inside the save. If I knew how I'd try and grab the books before they hit the DS to see if the whole thing could be spoofed. Setting up a local server on the PC to send and receive books would certainly be ideal. :)

File 490
Code:
./FILE (Some type of header/Identifier)
./Alice_s_Adventures_in_Wonderland.cts (Table of contents)
./Alice_s_Adventures_in_Wonderland_00.bd (Book Data)
./Alice_s_Adventures_in_Wonderland_20_01.bin (compressed Narc file containing a picture)
./Alice_s_Adventures_in_Wonderland_footnote_00.bd (Book Data)

./Alice_s_Adventures_in_Wonderland/Alice_s_Adventures_in_Wonderland.NCGR/NCLR/NSCR (Graphic/Palatte/??)
./honzus/book/author/(Contains .bd .npix, .lpix)
/honzus/book/novelist/ (picture of the author)
/honzus/book/outline/(Contains .bd .npix, .lpix)
/honzus/book/footnote/(Contains .npix, .lpix - bd was in root folder...)
/honzus/book/main/(Contains .prf .npix, .lpix)

So not much to it at least.
 

Keshire

Well-Known Member
OP
Member
Joined
Sep 8, 2007
Messages
145
Trophies
1
Age
44
Website
Visit site
XP
203
Country
United States
Table of Contents file (.CST)
Code:
typedef struct Contents_1{
//Not sure why there's two sets here, might have something to do with large/small font.
ulong	unk[2]; //Offsets maybe?
ushort	stringLength[2]; //String Length
}Contents_1;

typedef struct Contents{
//Table of Contents
ulong		Sections;	
Contents_1	IndexSize[Sections];
//Index of strings, string length comes from above array
}Contents;

What I'm assuming is the Identification File. It's the first file in the main archive. It's not a Narc file and it's not compressed.
Code:
typedef struct IdentFile{
ulong        Unk;
//Header
ulong        Size0;    //Size of Header?
ulong        Offset;    //Text Block offset
ulong        Size1;    //Text Block Size
ulong        Offset;    //Offset
ulong        Size2;    //Size
ulong        Offset;    //Offset
ulong        Size3;    //Count

ulong        Unk;
ulong        Offset;
ulong        Offset;
ulong        Unk;

//Data
//ubyte        block[Size1];
//ubyte        block[Size2];
//ulong        block[Size3];

}IdentFile;
 

Keshire

Well-Known Member
OP
Member
Joined
Sep 8, 2007
Messages
145
Trophies
1
Age
44
Website
Visit site
XP
203
Country
United States
how fares the attempt? i'm interested in this progress. i really adored the polish on this thing, so a book injector would be awesome...
Could use someone with some coding experience to help out with this. I'm not much of a coder unfortunately. I'm just decent with a hex editor and figuring out how files work.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=MFuf9avsamQ