• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Research: Loading DS rom resources[c++]

Scaryghoul

Hungy
9
Posts
14
Years
Introduction/What I'm using this thread for
Greetings all, I'm Scaryghoul and I'm trying to do something that I can't find a whole lot of information on. I'm overall unsure whether this belongs in Game Development or R&D but I feel as though this is the correct place to be. The way I justify it in my head is I'm doing my own R&D unrelated to a game yet, and it technically fits the three forum rules. I'll probably use this thread as a place to consolidate my findings/information if you guys don't mind.

What I'm trying to do
I'm trying to not exactly extract the resources but more so use load them into my own project(It will be open source, because I hate the level of closed source around here).

Ways not to help me - Apologies if this title comes off slightly snide.
Please don't refer me to closed source tools that will extract the resources because that's not what I'm looking to do exactly. Open sourced tools would still benefit me since I could peek at their code.

What I'm looking to do
The roms I want to work with: Pokemon HG or Pokemon BW
As for what I want to extract/load from them immediately:
  • Tilesets
  • Music
  • Player/pokemon sprites and animations
  • Move animations
  • Pokemon sounds

Places I've already looked/researched
So far I've only read up on the DS Rom and GBA Rom specifications here(I can't post links so remove spaces, also I apologise for circumventing your forum rules.): ht tp: // nocash . emubase . de/ gbatek. htm

I'm not exactly looking to be spoon-fed but more so a community place to get feedback and to consolidate my information.
 

Scaryghoul

Hungy
9
Posts
14
Years
Fantastic, my post was finally approved. Well I started the project originally that morning of the post and spent a good day or so working on it. I would edit this into the original post and it will eventually be added when I merge all data into the original post to share. Although for now I'd like to get to 15 posts so I can start posting links xD Also remember, this is acting as my dev-log(Since most of you probably know the things I'm discovering already)

Anyways, as I said in the original post, I started by finding out how the information on the DS is stored and how the roms are laid out.
So I visited these two places - They have most of the same information, but one is formatted and sectioned, and one has everything in one big link.
htt p :/ / w w w. daftcode. n et/ gbatek/ds
h ttp : / / noca sh. emubase. de/ gbatek. htm

From these I gathered information the header of roms first(Hopefully the spoiler tags will keep the information contained)
Spoiler:


From this we only really needed a few things but it allowed me to load the initial rom information and test what versions of roms we're loading. Not a WHOLE lot of this information is useful or relevant though since we're only aiming at a handful of roms. Anyways I got the initial rom information loaded and now my next goal was understanding the filesystem used.

To understand the filesystem I first set out to figure out what filesystem is actually used in the DS perhaps as a standard but I couldn't actually find one(Which was shocking since almost everyone refers to something called "the DS Filesystem"). In the specifications it says they use NitroROM File system so I started there.

Now my search from there lead me to an old project called PPRE(Project pokemon rom editor).
Their main website is here. h ttp : / / projectpokemon. or g/

I know this forum is familiar with this tool since I saw some threads during my search relating to this here. Anyways, they wanted to make a general purpose rom editor by modifying source code from "Nitro Explorer 2".

So I was interested in whether this project was open source so I immediately started searching around for some source code and found a post on their forums from a few years back linking to a public SVN, so their project was open source at one time. Alas the SVN link was a 404. So I went to IRC talked with some people in the PPRE irc channel and they said the project was abanonded a couple years ago.

So I looked for public forks and I found this gem
htt ps: / / github .co m /magical/ppre
This guy cloned PPRE back in 2010 and started cleaning up their code. It's not the most recent code but it will have to do because there is no more public SVN. I did a lot of code reading to get a general understanding but it's really difficult to follow the spaghetti code that PPRE is. Magical seemed to do a good job at cleaning up some of it, but a lot of it is just a giant mess. So right now I'm working on creating a general purpose rom library in c++ based off of some of the stuff in PPRE(Not going to directly port it because that'd get unnecessarily messy). Having a bit of trouble but hopefully it won't be terrible for too long.

Right now I'm working on creating a filesystem table class that can read the rom's file locations and everything so I can create a virtual filesystem within the library.
Also since I won't know if I'm reading the filetables correctly, I have to write a NARC class since it seems most of the files in pokemon roms are stored in NARC archives. Luckily that's something that is somewhat understandable from the ppre source. I'll upload the project when I get to at least reading NARC files appropriately.
 
Last edited:
3,830
Posts
13
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
You might want to look at "ndstool." If I remember correctly it is open-source, and it would do everything you would need, with a few modifications, of course.
 
Back
Top