Re: [stella] Baubles; some progress, some problems...

Subject: Re: [stella] Baubles; some progress, some problems...
From: Glenn Saunders <cybpunks2@xxxxxxxxxxxxx>
Date: Tue, 13 Nov 2001 22:19:58 -0800
This is rather minor, I suggest you use the declare space keyword for your RAM variables. It makes working with RAM sooo much simpler. Plus you can split off your constants from your RAM variable address assignments.

By doing this, you won't have to worry about manually assigning addresses to RAM and leaving gaps between them. And if any of your variables are 2-bytes long (ds 2) you should be able to refer to them in your sourcecode with low and high byte syntax (< and >).

If you want two variables to share the same address, you declare the space first, then all the other variables that will have the same start address will

If you did that, it would look something like this:

    processor 6502
    include vcs.h

; CONSTANTS

darkblue                =   $82
black                   =   $00

    SEG.U vars
    org $80
; RAM VARIABLES
Temp                    ds 1
LivesIndicator          ds 1     ; remaining lives.
TimeRemaining1          ds 2    ; high order hex digit of time remaining
TimeRemaining0          ds 2     ; low order hex digit of time remaining
LevelWeAreOn1           ds 1     ; high order hex digit of current level
LevelWeAreOn0           =   $85; low order hex digit of current level

LivesIndicatorBuffer ds 5 ; buffer, five bytes of lives graphic
GamePlayfieldPF0Buffer = GamePlayfieldPF0Buffer; buffer for PF0 byte of the game playfield


TimeRemainingBuffer1 ds 5 ; buffer, five bytes high order time graphic
GamePlayfieldPF1Buffer = TimeRemainingBuffer1; buffer for PF1 byte of the game playfield


TimeRemainingBuffer0 ds 5 ; buffer, five bytes low order time graphic
GamePlayfieldPF2Buffer = TimeRemainingBuffer0; buffer for PF2 byte of the game playfield


LevelWeAreOnBuffer1     ds 5     ; buffer, five bytes high order lvl graphic
BufferPointer           =  LevelWeAreOnBuffer1

NextTableRecord         =   ds 1
LevelWeAreOnBuffer0     ds 5     ; buffer, five bytes low order lvl graphic
PlayfieldY              ds 1



org $F000

Start

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


Current Thread