It is currently Tue Nov 21, 2017 10:41 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Mar 06, 2017 11:39 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
I tested a few tools to disassemble and reassemble "Super Mario Bros. (W) [!].nes" but most of them give me strange errors.
Here is the only method which worked for me to some extent :

How to Disassemble :
Disassemble mario.nes with NESrevPlus
Select DASM format and Save "mario.asm"
Open "mario.asm" and find JMP $0006 and change it to JMP ($0006) [it seems to be a bug of disassembler]

How to Reassemble :
Use dasm to generate "mario.prg" : dasm mario.asm -f3 -omario.prg
Seperate "mario.chr" by using famiROM
Take out 16bytes header by using HxD and save it as "mario.hed"
Use cmd to generate "mario.nes" : copy /b mario.hed+mario.prg+mario.chr mario.nes

I would like to know how other people disassemble & reassemble a nes game.


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 11:58 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6447
Location: UK (temporarily)
Bisqwit's clever-disasm.


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 1:16 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1825
Location: DIGDUG
I have a disassembler half done, put it on the 'back burner' to work on some other things.

It separates the PRG and CHR ROMs and writes a file (with header) that can reassemble them. The ASM it generates is not great, lots of assembler errors of labels not found.

I've used frantiks tool and reassembled with asm6.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 1:50 pm 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Thanks for the comments but please give more details


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 2:04 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19238
Location: NE Indiana, USA (NTSC)
About which step of the process would you like more detail?

Otherwise, it becomes more difficult to "explain more please" with "much detail".


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 2:15 pm 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
tepples wrote:
About which step of the process would you like more detail?

Otherwise, it becomes more difficult to "explain more please" with "much detail".


Just use the first post as a template


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 2:53 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5824
Location: Canada
I use cc65's disassembler, code-data logs from FCEUX, and iteratively re-disassemble adding labels to an annotation file as I analyze the code.

Here's how I described this a previous time it was asked:
http://forums.nesdev.com/viewtopic.php?p=158176#p158176


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 4:18 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1825
Location: DIGDUG
More details...

Frantiks DISASM6 tool...

http://www.romhacking.net/forum/index.p ... #msg178059

Sometimes with a CDL file from FCEUX (made by playing the game with CDL logger turned 'on')

Manually type header at top of file. Manually type .incbin "CHR.chr" at the bottom.

Cut and paste CHR ROM in hex editor to a new file (I use an old obsolete one).

Assemble with asm6.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Tue Mar 07, 2017 6:25 am 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 256
I use Regenerator http://csdb.dk/release/?id=149429, I have to pull the ROMs out of the NES first though . It now has a NES mode and outputs in TASS64 format. Its an interactive dissasmbler similar to FCEX et al, but with a lot more features to handle words, lo/hi hi/lo address tables, rts format etc. I did start making a Super Regenerator which might handle NES better, but its SNES LOROM only at the moment, which might or might not work depending upon your Mapper.
Then if I wanted to put it all back together, I would use a batch file to assemble the ROMs then use a asm file to pack them altogether again. Could easily be automated I would think for volume.


Top
 Profile  
 
PostPosted: Tue Mar 07, 2017 10:33 am 
Offline
User avatar

Joined: Wed Apr 07, 2010 1:14 am
Posts: 484
Location: Iran
Ok here is another method by using NESrevPlus and ASM6 :

How to Disassemble :
Disassemble mario.nes with NESrevPlus
Select X816 format and Save "mario.asm"

How to Reassemble :
Take out 16bytes header by using HxD and save it as "mario.hed"
Seperate "mario.chr" by using famiROM
Open "mario.asm" with Notepad++
Add to the first line of the file : .incbin "mario.hed"
Remove : .MEM 8
Remove : .INDEX 8
Add to the last line of the file : .incbin "mario.chr"
Find JMP $0006 and change it to JMP ($0006) [it seems to be a bug of disassembler]
Use ASM6 to generate "mario.nes" : asm6 mario.asm mario.nes


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group