Jump to content

Photo

Disassembling 8K (or larger) 2600 games.


7 replies to this topic

#1 Rhindle The Red OFFLINE  

Rhindle The Red

    River Patroller

  • 2,841 posts
  • His roar is long and loud.
  • Location:Rochester, NY

Posted Tue Feb 12, 2002 5:53 PM

Is there a means to do this?

DiStella will only handle 2K and 4K ROMs, yet I know it's been done.

How?
Don't tell me anything is "impossible"!  I refuse the word "impossible"!


#2 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 24,078 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Wed Feb 13, 2002 6:44 AM

quote:


Originally posted by Rhindle The Red:
Is there a means to do this?

DiStella will only handle 2K and 4K ROMs, yet I know it's been done.

It is possible, but requires some extra work.

First you have to split your binary into pieces of 4K. (I'm using Windows Commander, but there are lots of other tools that can do so too)

Then you should try to disassemble the first 4K file. There will be large blocks of data, because those blocks are only accessed via the other bank(s) and DiStella fails recognizing them as code. You'll need a configuration file (see DiStella.txt). Start with:
ORG F000
CODE F000 FFF9

In the resulting file, look at the adresses (e.g. JMP, JSR) and you should be able to recognize the real ORG address. Update!

Try to locate blocks, that look not like code (e.g. containing JAM, BRK or illegal opcodes) and adjust the configuration file.

As long as there are unknown labels (e.g. Lf123 = $f123) at the start of the output file, there is something wrong. You have to iterate

Repeat with the other 4K files.

When you are finished doing all that, replace all ORG with RORG and add before new ORGs which must increase in $1000 steps (e.g. $1000, $2000,...). Remove everything before ORG. Now you should copy all files together and add the following lines at the begin of the file:

processor 6502
include vcs.h

This should compile and you should compare the result with the original. There will be most likely some differences:
- different values for TIA registers (e.g. CXCLR.. at $00.. or at $30..), they don't matter, but for perfection you might want to correct them too.
- incorrect word access to zeropage registers (eg. sta $0000 will be compiled as sta $00). This causes the complete code to get out of sync (starting at that point) with the original and you have to fix this (e.g. sta.w $00).

Repeat!

That's all!

BTW: I have made a lot of DiStella configuration files, tell me which game you want to disassemble. Perhaps I can help.

[ 02-13-2002: Message edited by: Thomas Jentzsch ]

#3 Shawn OFFLINE  

Shawn

    As Above

  • 19,071 posts
  • So Below

Posted Sat Oct 15, 2005 7:16 PM

BTW: I have made a lot of DiStella configuration files, tell me which game you want to disassemble. Perhaps I can help.


Do you have a config for Smurfs RIGC Disassembly? It's 8k and I can't seem to figure out how to cut the game in half for use with distella (or how to put it back togther cause when I half the .bin into 2 4k files I get lost form that point :(

#4 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 24,078 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Sun Oct 16, 2005 1:37 AM

:)

Attached Files



#5 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,966 posts
  • Location:The land of Gorch

Posted Sat Apr 1, 2006 3:35 AM

Then you should try to disassemble the first 4K file. There will be large blocks of data, because those blocks are only accessed via the other bank(s) and DiStella fails recognizing them as code. You'll need a configuration file (see DiStella.txt). Start with:
ORG F000
CODE F000 FFF9


Actually, a better method than creating a preliminary .cfg is to use Distella's -d switch (i.e. "dumb" mode, which does the same thing...translates the entire contents as opcodes rather than data).

BTW, the high nybble of the START vector sometimes doesn't apply to the actual addresses in the game code...it just needs to be an odd-numbered value (in which case, all JMP's and absolute addresses would fail to be tagged). This result could happen whether or not a game is 8k). So if you notice a plethora of address equates up top, it could be due to the vector not sharing the same # for it's high nybble. For example, if the source code configured the address range as $B000-$BFFF...a start vector defined as $Fxxx would cause Distella to miss all of the tags (even though the rom itself would function fine). I've run across this problem in a 4k game rom before...but the name escapes me.

So the process should be: disassemble a segment using the -pafsd switches, check the disassembly file for address discrepencies & data ranges, create a .cfg file for the segment based on that, then finally use Distella to create the final version by using -pafscfilename.cfg switches.

Edited by Nukey Shay, Sat Apr 1, 2006 3:37 AM.


#6 Zach OFFLINE  

Zach

    Stargunner

  • 1,620 posts

Posted Thu Oct 26, 2006 4:18 PM

BTW: I have made a lot of DiStella configuration files, tell me which game you want to disassemble. Perhaps I can help.

LOTR?

#7 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 24,078 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany, Europe, Earth

Posted Fri Oct 27, 2006 2:05 AM

LOTR?

That's about the only one I can't share. Sorry.

#8 Uzumaki OFFLINE  

Uzumaki

    River Patroller

  • 2,320 posts

Posted Sun Nov 12, 2006 4:42 AM

How about Asteroid, the one with copyright screen? I tried but I kind of get lost since I don't know enough ASM to correctly decode the entire file. I wanted to poke at the copyright screen and see its code for it. The data for the copyright screen is stored at 0A1 through A9B but I'm not sure where the screen route or the timer loop is.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users