I have been looking for a good decompiler for nes roms.
Is there a reliable decompiler that produces assembler code that can be recompiled without much problems?
My target is to decompile fds games adapt them and recompile them to cartridge roms.
I know this is not as easy as it sounds but I'm interested in having a look at it.
Decompiling/recompiling
Moderator: Moderators
Re: Decompiling/recompiling
I have been reasonably pleased with bisqwit's nescom's clever-disasm.
BUT: It can't load FDS files. And it still requires a fair amount of manual assistance.
BUT: It can't load FDS files. And it still requires a fair amount of manual assistance.
Re: Decompiling/recompiling
It is possible to hack FDS games into cartridge games as long as you get the memory map correct.
FDS games map code at 6000-DFFF, then the FDS BIOS lives at E000-FFFF.
For games that do not need to load, you can copy the 6000-7FFF bank into WRAM at bootup, copy the reset/nmi/irq vectors to FFFF, then jump to the reset vector.
The pirate mapper 42 was designed for this task as it gives a swappable bank at 6000.
FDS games map code at 6000-DFFF, then the FDS BIOS lives at E000-FFFF.
For games that do not need to load, you can copy the 6000-7FFF bank into WRAM at bootup, copy the reset/nmi/irq vectors to FFFF, then jump to the reset vector.
The pirate mapper 42 was designed for this task as it gives a swappable bank at 6000.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Re: Decompiling/recompiling
There have been a whole bunch of different pirate carts made for FDS ports. Not all of them are shaped like mappers 40/42/50.
Per FCEUX's source, iNES mapper 103 and UNIF MAPRs KS7030, KS7031, KS7037, KS7057, LE05, LH01, LH53, and MARIO1-MALEE2 are other shapes that have been used.
Per FCEUX's source, iNES mapper 103 and UNIF MAPRs KS7030, KS7031, KS7037, KS7057, LE05, LH01, LH53, and MARIO1-MALEE2 are other shapes that have been used.
- rainwarrior
- Posts: 8062
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Decompiling/recompiling
At least when disassembling FDS files, there's convenient data in the disk format about where every PRG block should be addressed. 
-
Oziphantom
- Posts: 1163
- Joined: Tue Feb 07, 2017 2:03 am
Re: Decompiling/recompiling
http://csdb.dk/release/?id=149429
IF you want to search for others its Dissasmebly not decompile, the code is not being converted back into a high level language. Although there are decompilers out there.
IF you want to search for others its Dissasmebly not decompile, the code is not being converted back into a high level language. Although there are decompilers out there.
Re: Decompiling/recompiling
Thanks for all the help.
Right now the project is not my priority anymore but I'm probably going to have a look at it in the future.
@Oziphantom:
Thank you for that out to me. Somehow I always mixed those two up.
Right now the project is not my priority anymore but I'm probably going to have a look at it in the future.
@Oziphantom:
Thank you for that out to me. Somehow I always mixed those two up.