BZK 6502 Disassembler

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
Cyneprepou4uk
Posts: 24
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

BZK 6502 Disassembler

Post by Cyneprepou4uk »

Let's create a quick disassembly of your game! :D

This disassembler is a CDL-based Lua script. Mostly targeted on romhackers who just want to have a better view at the game code with little effort. By editing the config file you can properly disassemble any game on any mapper.

Disassembler features:
- Separate code from data using a CDL file
- Display all 6 CDL flags, ROM File and NES Memory address
- Use several table files to display symbols
- Auto adding labels to RAM addresses
- Additional info about each CPU address

Notepad++ scripts features:
- Convert .byte to instructions
- Convert .byte to .word/.dbyt + labels
- Auto adding labels to Branches, Tables and JMP/JSR instructions
- Other manipulations with bytes

Final output files are compatible with ca65 assembler (after deleting "garbage" text using a single regex). Assembles files into a 1:1 copy of the original ROM.

https://i.imgur.com/04b51RV.png

If you wanna try it, read the manual. Let me know if you have any questions.
Last edited by Cyneprepou4uk on Sun Dec 13, 2020 4:44 pm, edited 3 times in total.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: BZK 6502 Disassembler

Post by Oziphantom »

Instructions really should point out that it needs to be installed in a specific spot on C for it work. Also you have to put the nes file as game.nes and game.cdl in the input folder. Really the tool should work in any location and take the nes and cdl file names and paths as command line arguments.

I gave it a 384K file and got 4 banks out of it, didn't even get the fixed bank.

when you add or change a label how do you get it to update in the file and across the other banks?
User avatar
Cyneprepou4uk
Posts: 24
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

Re: BZK 6502 Disassembler

Post by Cyneprepou4uk »

Please read the manual and change config file before launching the script.

when you add or change a label how do you get it to update in the file and across the other banks?
Not sure I understand the question. Can you provide an example of your label?
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: BZK 6502 Disassembler

Post by Oziphantom »

I was hoping the "It supports all mappers" meant I have the NES header and know how the file will be laied out for you :D

So I find ram_0781 and I work out what it is to be. Now I want everything that has ram_0781 to show my new "label" for an easy starter.
User avatar
Cyneprepou4uk
Posts: 24
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

Re: BZK 6502 Disassembler

Post by Cyneprepou4uk »

Oziphantom wrote: Sat Dec 12, 2020 12:28 am I was hoping the "It supports all mappers" meant I have the NES header and know how the file will be laied out for you :D
I could implement that, but unfortunately not all games follow the same basic standarts, for example Captain Tsubasa 2 maps quite a lot of neighboring banks to the same $A000-$BFFF range. So it is better to leave the decigion to a user, making this tool universal :shock:
Oziphantom wrote: Sat Dec 12, 2020 12:28 am So I find ram_0781 and I work out what it is to be. Now I want everything that has ram_0781 to show my new "label" for an easy starter.
Your ram_0781 label is stored in "bank_ram.inc" by default, this file is included in all asm banks. Open "bank_ram.inc" and all asm files together, and replace this label with another one (ram_buttons for example) in all these files at the same time.

But, if you're going to use my Notepad++ scripts to convert bytes to instructions, you should postpone renaming RAM labels, because this script will also produce "ram_xxxx" labels. So, if this label will not exist inside an include file anymore, you won't be able to assemble your game.
Post Reply