[stella] Addressing Problem

Subject: [stella] Addressing Problem
From: "Christian Ammann" <Christian.Ammann@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 Jul 2005 13:52:07 -0400

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,x

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

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 

I would be really happy if somebody has an idea.

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

Current Thread