Jump to content
IGNORED

2600 bank-switched games


johnnywc

Recommended Posts

Hello all,

 

I am a *newbie* Atari 2600 programmer and I have a question regarding bankswitched games; in particular the F8 bankswitch mode used by Atari for 8K games.

 

I have surfed the net and I understand basically how it works (correct me if I'm wrong): Accessing $1FF9 in bank 1 will switch to bank 2, and in that second bank accessing $1FF8 will switch back to bank 1.

 

My question is this:

 

How do you write an 8K game in DASM that will use bankswitch mode F8? I realize that you must have two 4K blocks of code and that only one bank can be used at one time. Is there a quick "shell" that demonstrates how this is done? Can DASM compile and generate an 8K BIN?

 

Any help is greatly appreciated.

 

Thanks,

Link to comment
Share on other sites

There is no problem for DASM, only for the programmer. ;)

 

First, you must provide some valid code in the new bank exactly after the address of the $1ffx access instructions.

 

Second, you need valid code in both banks for each start-vector (the addresses can be different if you want)

 

Third, you have to use ORG and RORG. ORG is then used by the assembler to physically put the code in order, while RORG tells it, at which adresses the banks really are.

 

That's all. ;)

 

Some example code:

 

ORG $1000

RORG $d000

SwitchToBank1:

bit $1ff9

nop ; <- this is the instruction that is executed after bit $1ff8

...

 

ORG $2000

RORG $f000

SwitchToBank0:

bit $1ff8

nop ; <- this is the instruction that is executed after bit $1ff9

...

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...