diff --git a/main.s b/main.s index dfd1dd9..ecc41f6 100644 --- a/main.s +++ b/main.s @@ -160,7 +160,8 @@ over_text .byte "OVER",0 forever jmp forever -init_once jsr init_damage +init_once jsr init_vars + jsr init_damage jsr init_screen_once jsr init_actors_once rts diff --git a/platform-apple2.s b/platform-apple2.s index d4793f9..d17bce1 100644 --- a/platform-apple2.s +++ b/platform-apple2.s @@ -187,6 +187,18 @@ mazerow lda textrows_l,y rts +; clear text page 2 where most of the variables are stored +init_vars ldx #0 + txa +?1 sta $800,x + sta $900,x + sta $a00,x + sta $b00,x + dex + bne ?1 + rts + + ; initialize screen to draw to page 1 (displays page 2) init_screen_once nop lda #0 diff --git a/vars.s b/vars.s index b939489..126a029 100644 --- a/vars.s +++ b/vars.s @@ -2,12 +2,12 @@ actor_col .ds MAX_ACTORS ; # current tile column actor_x .ds MAX_ACTORS ; pixel position (calculated from col & xpixel) -actor_row .ds MAX_ACTORS ; # current tile row -actor_y .ds MAX_ACTORS ; pixel position (calculated from row & ypixel) actor_xpixel .ds MAX_ACTORS ; # current pixel offset in col actor_xfrac .ds MAX_ACTORS ; # current fractional pixel actor_xspeed_l .ds MAX_ACTORS ; # current speed (affects fractional) actor_xspeed_h .ds MAX_ACTORS ; # current speed (affects pixel) +actor_row .ds MAX_ACTORS ; # current tile row +actor_y .ds MAX_ACTORS ; pixel position (calculated from row & ypixel) actor_ypixel .ds MAX_ACTORS ; # current pixel offset in row actor_yfrac .ds MAX_ACTORS ; # current fractional pixel actor_yspeed_l .ds MAX_ACTORS ; # current speed (affects fractional)