[stella] Addressing Problem

Subject: [stella] Addressing Problem
From: christian ammann <christian.ammann@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 Jul 2005 13:58:08 -0400
Hi,

i have at the moment a little Problem with a piece of code for the atari 
2600. I have a game in which each level data has a size of 61 bytes. So, 
when stage one is finished f.e., i have to load the data of the next 
level into memory.

My Problem:

All registers are only 8 bit. So, when my levels begin at the label 
"Levels", i planned to:
...
ldx levels,x ;x=0
stx mem,y ;y=0
inx
iny
...

When i have to load the next level, becoz stage 1 is finished:
...
ldx levels,x ;x=61
stx mem,y ;y=0
inx
iny
...

Lets image i have 10 levels. X is only 8 bit. So it will overflow after 
finishing level 4 and loading level 5. How can i solve this problem? My 
only idea would be creating the the loop for the level-loading dynamicly 
into memory and execute it there (if thats possible, i havent tested it 
yet).

I would be really happy if somebody has an idea.

Christian
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com

Current Thread