What are disassemblers used for? Can extract .asm, .chr, .pal, .etc files from them? What is the best Disasembler out there?
Thanks in Advance,
EL
Disassemblrers turn machine code back into mnemonics. Reading disassembled code is not very easy, since the labels do not have meaningful names, and stuff like that. You have to guess a lot, so I'd say it is not a very effective way of learning how to program.
Disassemblers may also have a hard time telling code apart from data, meaning not always it will all make sense.
To get the CHR out of a ROM file you just need an hex editor, there is no need for a disassembler.
A disassembler is not able to separate the different kinds of data it sees into different files, as it can only tell that a part of the ROM is data, but it doesn't know what the data represents. The resulting file will have a lot of .db statements to represent all the data.
tokumaru wrote:
To get the CHR out of a ROM file you just need an hex editor, there is no need for a disassembler.
Unless the CHR is embedded in PRG, as is the case in CHR RAM boards such as UNROM, SNROM, BNROM, AOROM, etc.
how do i extract the .chr files from a hexeditor. i like using Goldfinger
The first 16 bytes of a ROM file in iNES format tell where everything else is. Find the number of 16384 byte PRG pages and the number of 8192 byte CHR pages. Then skip 16 bytes plus the PRG size and copy the number of bytes that matches the CHR size into a new file.
For example, Super Mario Bros. (U) (PRG 1).nes begins thus:
Code:
4E 45 53 1A 02 01
The 02 means two PRG pages (2 * 16384 = 32768 or $8000 bytes), and the 01 means one CHR page (1 * 8192 = 8192 or $2000 bytes). So skip the first 32784 bytes (the header and PRG), putting you at $8010 in the file. Copy everything from $8010 to $A010 (= $8010 + $2000, the CHR size) into a new file.
tokumaru wrote:
You have to guess a lot, so I'd say it is not a very effective way of learning how to program.
You can still learn how commercial games does things that demoes and examples are doing very differently. I learned a lot by disasembling and understand almost 50% of Final Fantasy 1's code.
However, some games have more exemplary code than other, just like demoes, and the lack of commentaries and proper labels is a big lack, so I'd reccomand learn by dissasembling only after doing your first few test/demoes and want to deal with more serious code. Also, don't watch just your favourite game, but pick up some different games.
Would it be possible to make a program that transribes all the opcodes for you?
Sorry but what to say doesn't mean anthing to me. You mean dissassemble opcode to transcribe them as code ? That's a disasembler. Why are you first asking about disassemblers if you don't know what they are ? I didn't follow you.
A tracing disassembler built into an emulator can transcribe the opcodes that are executed in a gameplay session. I think TuxNES or one of the FCEU mods may have this.
FCEUXD or FCEUXDSP is what you want as far as debugging emulators are concerned. Tracer, debugger with breakpoints, memory viewer/editor, the works.