It is currently Fri Jun 22, 2018 5:56 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu May 10, 2018 2:04 pm 
Offline

Joined: Thu May 10, 2018 12:14 pm
Posts: 5
So I want to disassemble a NES game (Ninja Gaiden) for the heck of it (and to test the little I know about 6502 language). I understand the "disassemble, create labels, reassemble, repeat" process, yet I can't start because this assembler doesn't want to do anything. (I have disassembled the whole thing with DISASM6).

1) It has this "unknown label" error for every "jsr _0000" mistake in the output the disassembler makes. I know disassemblers don't have to tell code from data, but this is not just a warning, it is just stopping the assembler from working. Anyways if I modify the instruction to not to point a wrong label, so the assembly was "succesful"...

2) When assembling the whole code, it only assembles the first 32 KB. I also know assemblers are not aware from banks and stuff, but if I split the banks to compile every 32/16 KB it says "uknown labels" again, but a lot more than usual.

So, how exactly should I use this assembler/disassembler? I also tried CA65 but it throws weird results when used with RENES.


Top
 Profile  
 
PostPosted: Thu May 10, 2018 2:09 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7227
Location: Seattle
Disasm6 only knows how to handle NROM (and other mappers without PRG banking) and UNROM. Ninja Gaiden is MMC1.

Perhaps try starting with nescom's clever-disasm instead?


Top
 Profile  
 
PostPosted: Thu May 10, 2018 2:37 pm 
Offline

Joined: Thu May 10, 2018 12:14 pm
Posts: 5
Image

That's the problem with nescom. It doesn't identify the txt file that clever-disasm made (there's an extra option I should add?) although it produces a 0 KB output file, and neslink simply crashes.


Top
 Profile  
 
PostPosted: Thu May 10, 2018 2:52 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7227
Location: Seattle
You have to clever --asm ORIGINAL.NES [RULES.INI] to get something intended for reassembly.


Top
 Profile  
 
PostPosted: Thu May 10, 2018 3:07 pm 
Offline

Joined: Thu May 10, 2018 12:14 pm
Posts: 5
What would go in rules.ini?


Top
 Profile  
 
PostPosted: Thu May 10, 2018 3:17 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7227
Location: Seattle
There's documentation and many examples in the download (in the "clever" directory)


Top
 Profile  
 
PostPosted: Thu May 10, 2018 3:38 pm 
Offline

Joined: Thu May 10, 2018 12:14 pm
Posts: 5
The file I have downloaded have a readme.txt and a readme.html (https://bisqwit.iki.fi/source/nescom.html#download, I don't have Java so I took dev-win32 file), the latter document seems to tell how stuff inside the output can be managed, but barely anything related to the usage. Did I have downloaded the wrong thing?


Top
 Profile  
 
PostPosted: Thu May 10, 2018 5:26 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7227
Location: Seattle
... java? The other archives are "just" C++ source code...

Apparently bisqwit didn't package the examples and documentation in the binary build of 1.1.6 there. You can download the 1.1.6 source code for some examples, or the newest (1.1.8.1) source code for the documentation also.


Top
 Profile  
 
PostPosted: Thu May 10, 2018 7:08 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2092
Location: DIGDUG
I wrote a disassembler for asm6, by the way. It's a python3 script.

https://github.com/nesdoug/NES-DISASSEMBLER

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


Top
 Profile  
 
PostPosted: Thu May 10, 2018 11:03 pm 
Offline

Joined: Thu May 10, 2018 12:14 pm
Posts: 5
I thought it was Java because of the extensions, sorry about that ^^.

As for that python script,

IT WORKED!

Image
(Made a little palette change to test)

MANY THANKS! Thanks to you both for help me.
Well I think is up to me now to make good use of the code, but I'll try my best.


Top
 Profile  
 
PostPosted: Sat May 12, 2018 8:58 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7227
Location: Seattle
If it's 0kB then clever-disasm is not successfully disassembling anything. At smallest you should expect to see somewhere around 50kB.

I'd strongly recommend running clever-disasm without --asm until you've updated the ini file enough to see it generating correct output.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: gauauu and 4 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