Jump to content
IGNORED

Disassembling 8k+ 2600 games...


vdub_bobby

Recommended Posts

Yeah...Distella :)

The problem is in bankswitching. It confuses the disassembler. So the binary rom must be split into 4k pieces (using a file splitter like HJsplit), and each part disassembled seperately. But then the automatic code detection won't work, so each newly-disassembled half must be opened up and studied in order to create .cfg files (sample below) that will help the disassembly process (so you can feed Distella the proper base address of that portion and list where code starts/ends). This is instructed by using -c in the command line...as in:

distella -pafscmspac1.cfg mspacman.001 > mspac1.asm

distella -pafscmspac2.cfg mspacman.002 > mspac2.asm

 

Once disassembled, the 2 halves can be pasted together into 1 assmembly by using the ORG/RORG combo...

 

ORG $1000

RORG $D000

...for the start of the first section, and...

ORG $2000

RORG $F000

...for the start of the second.

mspaccfg.zip

Link to comment
Share on other sites

Thanks, folks, for the help. :)

 

Once disassembled, the 2 halves can be pasted together into 1 assmembly by using the ORG/RORG combo...

 

ORG $1000

RORG $D000

...for the start of the first section, and...

ORG $2000

RORG $F000

...for the start of the second.

Speaking of bank-switching...has anyone ever written a little tutorial on bank switching? I have tried searching the Stella archives a couple of times, but couldn't find much.

 

I think someone somewhere (T Jentzsch?) referred someone who was asking about bank-switching to A Davie's released source of Fu Kung (http://www.biglist.com/lists/stella/archives/200301/msg00466.html).

 

So I had a look, and it looks something like this:

            SEG

           ORG $2000

           RORG $f000

           include "bank03.asm"



           SEG

           ORG $2800

           RORG $f000

           include "bank04.asm"



           SEG

           ORG $3000

           RORG $f000

           include "bank05.asm"

Everything is RORGed to $F000...but in your example, you RORGed to $D000...?

 

If I can't find a tutorial or a FAQ or a howto I'll eventually just jump in and figure it out through trial and error, but it would be nice to have a guide :)

 

Does one exist?

Link to comment
Share on other sites

The 2600 only uses 13 bits for it's address line...so to the bus, $D000 "looks" the same as $F000 (so do $B000, $9000, etc.). That 13th bit is always set. The only reason that they are different is because that is the addresses that were originally used when it was assembled (take a look at the vectors and JMP/JSR instructions in the code). Use the wrong base address when disassembling, and the tagging will fail.

Link to comment
Share on other sites

Speaking of bank-switching...has anyone ever written a little tutorial on bank switching?  I have tried searching the Stella archives a couple of times, but couldn't find much.

...

Does one exist?

I wouldn't really call it a tutorial, but if you haven't already read it, http://www.qotile.net/minidig/docs/sizes.txt explains things pretty nicely. It doesn't tell how to set up the org/rorg stuff in DASM, but Nukey has outlined that well enough...

Link to comment
Share on other sites

The ORGs and RORGs must differ, otherwise Dasm would assume that an additional 4k of space (or more, depending on what the base addresses are) exists between the banks. So the ORGs just specify that the banks are only 4k apart (opposed to 8k in that example).

 

I gather that Arcadia bankswitching, for example would be divided into 3 portions...2k running from $x000 to $x7FF and two 2k sections running from $x800 to $xFFF. The first 2k is always present, with 2 additional 2k sections that are swapped. So that when merging the two assemblies,

ORG $1000

RORG $x000

 

ORG $1800

RORG $x800

 

ORG $2000

RORG $x800

 

...would be used (where x=the hex digit used in the vectors)?

Link to comment
Share on other sites

  • 2 weeks later...
Hi there!

 

Which game are we actually talking about? You know, chances are good that you're probably just wasting your time on a job that has already been done :)

 

Greetings,

Manuel

Well, I was thinking of having a look at the Elevator Action prototype.

So, before I dive in too deep, has someone done this already?

Link to comment
Share on other sites

Why? :?

Sorry; should have been more clear.

 

First, is that source you posted the source for Elevator Action? Comparing yours to Nukey's, they don't look the same (not the same at locations $F000 or $D000 for starters...).

 

Also, can the source you posted be compiled and run? It compiled right, but won't run in z26 or stella...does it need special parameters? A Ewoks Adventure game sounds like fun!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...