ROM Hack How to extract image files from NDS games?

IcarusDreams

New Member
OP
Newbie
Joined
Jul 7, 2020
Messages
1
Trophies
0
Age
25
XP
42
Country
United States
I'm specifically trying to extract those little card image files from the poker minigames in New Super Marios Bros for the DS.
I have tried to download extractors and input the NDS file but I can't find any image files or convert any bin files to image files, they all are either tiles or pallettes.
Your help would be greatly appreciated, thank you.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
You can usually use an emulator to pull things if you only want a copy of the image.

Two main approaches
1) You grab a screenshot and slice it out with a conventional image editor. By all means use cheats to get somewhere faster ( https://web.archive.org/web/20080309104350/http://etk.scener.org/?op=tutorial if you need to try making one yourself, it is for the GBA but it is similar enough between all devices really save for some of the super secure stuff). The emulator will also give you the option to disable layers (most things in consoles are built up layer by layer) which can further help with either disabling overlays or making selection easier.


2) You grab the tile data directly from the viewer (or maybe take a savestate and kick it to a tile editor) in the emulator. Various viewers are available depending upon what the graphics are (indeed when teaching people to hack I normally note that NSMB despite appearing like a 2d game is actually a 3d game with models and all that rather than sprites but this minigame might be different).
Desmume should have something, no$gba definitely has stuff. You can try VRAM viewers (might need to adjust the palette), map viewer (you map tiles to a location to create an image), maybe a 3d viewer and the others are also something to look at if you want (RAM viewer and sound channels viewer probably not going to do much for you).


NSMB is a fairly well hacked game as well ( https://nsmbhd.net/ being one such site) so you might find someone has gone there before. That said most are normally more concerned with the main game so maybe not.

Beyond that then yeah you will have to play ROM hacker proper and hunt things down. Do note you can happily eliminate things that you know belong to other things (sound_data.sdat tending to be sound data, as mentioned it is a well hacked game so which files correspond to levels is also known...).

For the multiplayer stuff if it is part of the download play then you might find something called utility.bin (possibly in a directory called dwc) or a file with a .srl extension in the ROM somewhere. This is what is sent to the other DS and will contain what it needs to run, it is in fact another DS ROM within the ROM so pull it out and open it like any other DS ROM. Things will be compressed but generally what is there is what needs to be and not a lot else.
 

BenoitRen

Active Member
Newcomer
Joined
Jul 1, 2015
Messages
40
Trophies
0
Age
38
XP
142
Country
Belgium
Going to piggyback on this as I have the same question, but for a different game, and the answer doesn't help me.

The first thing I've tried is taking screenshots, but the emulators I've used (DeSmuME and melonDS) both have graphical glitches when displaying 2D graphics. DeSmuME's viewer is even worse.

Next were Tinke and CrystalTile2, but those programs are very unintuitive to use, and all the guides I've read were written almost a decade ago and seemed to use a different version. Needless to say, I couldn't find anything using these tools.

Anyone know of a decent guide, or a better tool? Thanks in advance!
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
What game? Someone might have looked at it before or be willing to take a look themselves.

I am surprised emulation is so tricky here. I expect the odd bit of trouble with 3d but 2d should be absolutely fine (it being little more than a slightly jazzed up GBA which has been around for almost 2 decades).
I would look at what is causing that.

Crystaltile2 has not been updated in a long time so most old stuff should go here.
Generally though it has several modes (hex editor, assembly, tile viewer, tile editor and text) plus a load of ancillary tools and things to fiddle with (compression formats, relative search for text, various font handling and generation -- try typing on the tile viewer). Menus change with what mode is selected. In addition there is a little DS icon on the right hand side. This will bring up the breakdown of the DS ROM (it has a filesystem, unlike most things that did not come on a floppy disc or CD before it) where double clicking will set the tile editor/hex editor/assembly viewer to that location. Right clicking will allow you to view the file if it has a format it supports/recognises (has many, tinke has a few more but more revolves around those formats rather than being ROM focused) or handle any compression.
Do note that many DS graphics formats will be split between the graphics, any animation and the palette side of things. This can make handling compression a bit more tricky (I usually make a new ROM with all the uncompressed files plus helper files I want to look at and go from there)

Anyway even if it does not support the format you might still be able to get something done.

The tile viewer is one of the best we have. The configuration options are on the left hand side and should be reasonably obvious. The main options you will be using with the DS are tile sizes (while most old consoles are content with 8x8 and 16x16 or some combo of those, maybe with a narrower one for the odd font the DS can have tiles/graphics going right up to full screen resolution and often does. The graphics viewer, OAM viewer and the like might give you some idea what to be looking for here as well) and graphics format (different devices do it differently, in this case GBA 1bpp (usually more for fonts), GBA 4bpp and GBA 8bpp will be doing most of the lifting for 2d stuff. There have been some cases of 3d acting as 2d (make a simple flat square and put a texture on it) and in that case you do have another graphics format that will want another tool like tinke or maybe tiledggd.
ctrl and arrow keys and maybe shift and arrow keys will do fun things, as well as arrow keys in general.

For palettes then for crystaltile2 if it does not support it in the nds viewer part you get to find it in the ROM, or maybe rip it from a savestate. To convert random data to palettes you will need to go to the hex viewer and there will be an option along the lines of hex 2 pal and pal 2 hex which do much as they say, try not to edit your ROM accidentally as it will indeed dump the palette right where the cursor is if you press the palette to hex option. There are options to bring in windows palettes and export as well, also bring in and export BMP and PNG if you want to edit outside or simply export.

Finding things can be time consuming. https://www.romhacking.net/documents/361/ is for the GBA and for a command line tool where today no$gba's debug version is probably the better bet (might also be an option for your grabbing efforts). Still it, ( http://problemkaputt.de/gbatek.htm#dscartridgeprotocol B7 commands are for the ROM, work backwards to figure out what it reads*) is the best method that will work every time, though it is complicated.
Less complicated but more time consuming is looking at file/directory names, file sizes and extensions (sound_data.sdat tending to be sound and thus of no interest to your graphics finding, also a nice chunk of most DS ROMs eliminated in one shot), arm7.bin usually being a helper file common between DS ROMs (as in you can swap them between ROMs of similar age and have everything work just fine) but ARM9 and overlays being the binary which can house things in some games.
You can also simply load a tile editor and press down a lot.
Corruption is also a thing. Corrupt part of the ROM and see what changed in the game. A lesser version of this might see you copy and paste over the parts of the ROM -- files with similar extensions might be good as one working will usually see another still work for it but maybe have different data (think overwriting a file with the name of the main character with that of the sidekick and seeing the sidekick now appear as the main character), as you know what you changed (or maybe what it was trying to load when it crashed) then you know what goes.

*crystaltile2's hex editor and possibly tile editor will say what file in the DS ROM the cursor's location corresponds to down the bottom if you would rather not go manual with the results of ndstool, ndsts http://www.no-intro.org/tools.htm or similar.

Anyway it seems I am now writing a basic guide to graphics hacking which I already did https://gbatemp.net/threads/gbatemp-rom-hacking-documentation-project-new-2016-edition-out.73394/ (also includes some usage on crystaltile2) so I will cut it off.
 

BenoitRen

Active Member
Newcomer
Joined
Jul 1, 2015
Messages
40
Trophies
0
Age
38
XP
142
Country
Belgium
The game is Phantasy Star 0.

I suspect the emulation bugs are due to software rendering, as this laptop doesn't have a dedicated graphics card.

I've already tried to look at the guide, but download links are dead, and the links to the more detailed subguides like how to make use of CrystalTile2 don't work (they reload the same forum thread).

The strange thing is that the game I'm trying to rip from definitely uses known formats, but they're not recognised by the viewers so I can't open them. I'll give it another try later today.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Hmm might have to look at that. You are getting the PDF version right? Anything on the thread itself other than the contents of the PDF is years out of date.

Most of the links should have been transported back to the download section here (filetrip spun off from the downloads here, and then got merged back into here a little while back https://gbatemp.net/download/ ) or http://www.romhacking.net/ including any google code links that might not be with compiled versions on github or whatever they migrated to. archive.org 's wayback machine will hopefully be able to help too. I do have everything in it on an old hard drive so might go around collecting what needs to be replaced and uploading it.

As far as sub guides there should not be that many as I tried to make it all encompassing.

As for the forum thread it is probably more that the post within the thread was linked in a way that no longer works. Everything should hopefully still be there though so if you can decode what was done then you can scroll down or find the right page.

Reasons for not opening what are apparently known formats can be compression, custom versions of those formats, older versions of those formats (unlikely here) or newer versions of the formats that older stuff might not handle.
 

BenoitRen

Active Member
Newcomer
Joined
Jul 1, 2015
Messages
40
Trophies
0
Age
38
XP
142
Country
Belgium
After posting my previous message I tried the mirror link, and then I got to view the PDF version. :)

The section about CrystalTile2 usage is very sparse. There are no actual usage instructions. Every guide talks about and shows a viewer, but I didn't have it. Then I figured out that it's something I need to activate by using View > Tile Viewer. So now I'm at least seeing something.

I guess now I'm staring at the rabbit hole, because I see no recognisable graphics. There are different possibilities for tile dimensions, form, and who knows what else.

EDIT: I managed to set the tile viewer so it only shows one tile at a time now, and I have no idea how to revert that. Deleting the .ini file doesn't do it, and there's nothing in the registry either. Help!
 
Last edited by BenoitRen,

BenoitRen

Active Member
Newcomer
Joined
Jul 1, 2015
Messages
40
Trophies
0
Age
38
XP
142
Country
Belgium
I think that what I need is under event/character. There are sets of three files there: a palette, tiles, and an unknown file with extension dscse. Using the latter as a map file doesn't work.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Maximumbeans @ Maximumbeans: butte