Skip to content

Commit

Permalink
inconsequential variable renaming
Browse files Browse the repository at this point in the history
making sure all the page 0 variables have "z" prefix, while the general variables have the "g" prefix.
not like this is that consistent, either.   Many variables have neither prefix.
  • Loading branch information
kenjennings authored Mar 25, 2023
1 parent c9e8e4b commit c8f27be
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 239 deletions.
24 changes: 12 additions & 12 deletions ata_1nv_game.asm
Original file line number Diff line number Diff line change
Expand Up @@ -648,24 +648,24 @@ b_gc_End

; Flashy color scroll on the Countdown text.

dec zCountdownTimer
dec gCOUNTDOWN_TIMER
bne b_mdv_WaitForCountdownScanline

lda #$06
sta zCountdownTimer
sta gCOUNTDOWN_TIMER

lda zCountdownColor
lda gCOUNTDOWN_COLOR
clc
adc #$04
sta zCountdownColor
sta gCOUNTDOWN_COLOR

b_mdv_WaitForCountdownScanline
ldy VCOUNT
cpy #21
bne b_mdv_WaitForCountdownScanline

ldy #12
lda zCountdownColor
lda gCOUNTDOWN_COLOR

b_mdv_LoopSetCountdownColor
sta WSYNC ; 1
Expand Down Expand Up @@ -707,7 +707,7 @@ GameSetupMain
sta SHPOSM0

; Zero all of this stuff...
sta zGAME_OVER_FLAG
sta gGAME_OVER_FLAG
sta zPLAYER_ONE_BUMP
sta zPLAYER_TWO_BUMP
sta zPLAYER_ONE_CRASH
Expand Down Expand Up @@ -737,7 +737,7 @@ b_gsm_SkipFixMSSpeed
ldx #0
jsr GameSetMotherShipRow ; Convert Row 0 to Y position on screen.
lda #24
sta zMOTHERSHIP_Y ; Force "old" position above the row 0 position.
sta gMOTHERSHIP_Y ; Force "old" position above the row 0 position.

; P L A Y E R S H A R D W A R E

Expand Down Expand Up @@ -854,7 +854,7 @@ GameMain

jsr GameAnalyzeAlienVictory ; 6

lda zGAME_OVER_FLAG ; Did mothership/player motion reach end game?
lda gGAME_OVER_FLAG ; Did mothership/player motion reach end game?
beq b_gm_EndGameLoop ; No. Continue game

; Hacky bit. It turnsout that the lasers could still be visible.
Expand Down Expand Up @@ -903,9 +903,9 @@ GameSetupOver

; Automatic return to title screen
lda #0
sta zGAME_OVER_FRAME ; Frame counter 255 to 0
sta gGAME_OVER_FRAME ; Frame counter 255 to 0
lda #15
sta zGAME_OVER_TICKS ; decrement every GAME_OVER_FRAME=0. Large countdown.
sta gGAME_OVER_TICKS ; decrement every GAME_OVER_FRAME=0. Large countdown.


lda #EVENT_GAMEOVER ; Next game loop event is game over screen
Expand Down Expand Up @@ -941,10 +941,10 @@ GameOver
bmi b_go_SetupForTitle ; -1 means a button a pressed after debounce (0 or 1 means no input yet )
; Check for automatic return to title screen?
dec zGAME_OVER_FRAME ; Frame counter 255 to 0
dec gGAME_OVER_FRAME ; Frame counter 255 to 0
bne b_go_ExitGameOver ; Not 0. Nothing to do.

dec zGAME_OVER_TICKS ; decrement every GAME_OVER_FRAME=0. Large countdown.
dec gGAME_OVER_TICKS ; decrement every GAME_OVER_FRAME=0. Large countdown.
bne b_go_ExitGameOver ; Not 0. Nothing to do.

b_go_SetupForTitle ; Next frame, setup for title.
Expand Down
18 changes: 9 additions & 9 deletions ata_1nv_gfx_code.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Gfx_SetNTSCorPAL
beq b_gsnop_UpdateFlag ; Value %0. Write as-is.
lda #1 ; I want NTSC to be be only %1, not %00001110
b_gsnop_UpdateFlag
sta zNTSCorPAL
sta gNTSCorPAL

tax

lda TABLE_NTSC_OR_PAL_FRAMES,x
sta zMaxNTSCorPALFrames
sta gMaxNTSCorPALFrames

lda zNTSCorPAL
lda gNTSCorPAL
rts


Expand Down Expand Up @@ -229,14 +229,14 @@ Gfx_ShowScreen
b_gss_CopyStatsLoop
lda zSTATS_TEXT_COLOR ; Is stats color off? (i.e. 0?)
beq b_gss_WriteStatRow ; Yes, copy 0 to screen (conveniently, blank space)
lda zMOTHERSHIP_ROW_AS_DIGITS,y ; No. Get the actual digit from the score.
lda gMOTHERSHIP_ROW_AS_DIGITS,y ; No. Get the actual digit from the score.
ora #$40 ; Turn on bit to put it in the write char code.
b_gss_WriteStatRow
sta GFX_STAT_ROW,y ; Write to statistics.

lda zSTATS_TEXT_COLOR
beq b_gss_WriteStatHits
lda zSHIP_HITS_AS_DIGITS,y
lda gSHIP_HITS_AS_DIGITS,y
ora #$40
b_gss_WriteStatHits
sta GFX_STAT_HITS,y
Expand All @@ -249,7 +249,7 @@ b_gss_WriteStatHits
b_gss_CopyPointsLoop
lda zSTATS_TEXT_COLOR
beq b_gss_WritePoints
lda zMOTHERSHIP_POINTS_AS_DIGITS+2,y
lda gMOTHERSHIP_POINTS_AS_DIGITS+2,y
ora #$40
b_gss_WritePoints
sta GFX_STAT_POINTS,y
Expand All @@ -262,22 +262,22 @@ b_gss_WritePoints
b_gss_LoopCopyScores
lda zPLAYER_ONE_ON ; If player 1 is on?
beq b_gss_WriteP1Score ; No, write the zero byte (blank space) instead.
lda zPLAYER_ONE_SCORE,y ; Player on, get a digit from the score.
lda gPLAYER_ONE_SCORE,y ; Player on, get a digit from the score.
ora #$40 ; Turn $0 to $9 into $40 to $49
b_gss_WriteP1Score
sta GFX_SCORE_P1,y

lda zPLAYER_TWO_ON ; If player 2 is on?
beq b_gss_WriteP2Score ; No, write the zero byte (blank space) instead.
lda zPLAYER_TWO_SCORE,y ; Player on, get a digit from the score.
lda gPLAYER_TWO_SCORE,y ; Player on, get a digit from the score.
ora #$40 ; Turn $0 to $9 into $40 to $49
b_gss_WriteP2Score
sta GFX_SCORE_P2,y

lda gConfigCheatMode ; Are we in cheat mode?
bne b_gss_SkipHiScore ; Yes. Do not display high score.

lda zHIGH_SCORE,y ; Show high score.
lda gHIGH_SCORE,y ; Show high score.
ora #$40 ; Turn $0 to $9 into $40 to $49
sta GFX_SCORE_HI,y

Expand Down
18 changes: 10 additions & 8 deletions ata_1nv_page0.asm
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,17 @@ zCOUNTDOWN_SECS .byte $00 ; Countdown jiffies per tick tock event. (the 3, 2,



PLAYER_PLAY_Y=212 ; Y position for gun in play
PLAYER_IDLE_Y=220 ; Y position for gun idle on stats line
PLAYER_SQUASH_Y=228 ; Y Position when player not playing.
PLAYER_PLAY_Y = 212 ; Y position for gun in play
PLAYER_IDLE_Y = 220 ; Y position for gun idle on stats line
PLAYER_SQUASH_Y = 228 ; Y Position when player not playing.

PLAYER_MIN_X =52 ; Farthest left next to bumper ( Min screeen X + bumper width)
PLAYER_MAX_X =197 ; Farthest right next to bumper ( Max screen X - bumper width - gun width)
PLAYER_MIN_X = 52 ; Farthest left next to bumper ( Min screeen X + bumper width)
PLAYER_MAX_X = 197 ; Farthest right next to bumper ( Max screen X - bumper width - gun width)

PLAYER_X_SIZE=7 ; Width of guns in color clocks. Needed for collision evaluation.
PLAYER_X_SIZE = 7 ; Width of guns in color clocks. Needed for collision evaluation.

LASER_START=208 ; Player gun Y (PLAYER_PLAY_Y) - 4.
LASER_END_Y=36 ; also MOTHERSHIP_MIN_Y
LASER_START = 208 ; Player gun Y (PLAYER_PLAY_Y) - 4.
LASER_END_Y = 36 ; also MOTHERSHIP_MIN_Y

; Player 1 and player 2 values are interleaved.
; I have a stupid idea of using an index for
Expand Down Expand Up @@ -351,6 +351,8 @@ SOUND_DURATION1 .byte $00
SOUND_DURATION2 .byte $00
SOUND_DURATION3 .byte $00

; ======== V B I ======== END: The world's most inept sound system.


; In the event stupid programming tricks means some things can't be saved on
; the stack, then protect them here....
Expand Down
Loading

0 comments on commit c8f27be

Please sign in to comment.