diff --git a/BuGS.xcodeproj/project.pbxproj b/BuGS.xcodeproj/project.pbxproj index 30b6cd5..7c3d409 100644 --- a/BuGS.xcodeproj/project.pbxproj +++ b/BuGS.xcodeproj/project.pbxproj @@ -85,6 +85,7 @@ 9D8FFC612491CAF0005C9327 /* game.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = ""; }; 9DB1505024C3801100558B87 /* gameFlea.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameFlea.s; sourceTree = ""; }; 9DB1505124C6875C00558B87 /* gameScorpion.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameScorpion.s; sourceTree = ""; }; + 9DB1505224C7495400558B87 /* globals.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = globals.s; sourceTree = ""; }; 9DC4D7BD24B7652100BACF4B /* ship.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = ship.s; sourceTree = ""; }; 9DC4D7BE24B80C9600BACF4B /* shot.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = shot.s; sourceTree = ""; }; 9DC4D7BF24BE9F7100BACF4B /* tiles.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tiles.h; sourceTree = ""; }; @@ -135,6 +136,7 @@ 9DB1505124C6875C00558B87 /* gameScorpion.s */, 9D62AF3B249871A300348F45 /* colour.s */, 9D2FF6DA24C4C79A000181E5 /* random.s */, + 9DB1505224C7495400558B87 /* globals.s */, 9D3396F324AECACC003222B3 /* sprites */, 9D1716912491C49300C83148 /* main.rez */, 9D1716932491C49300C83148 /* Makefile */, diff --git a/BuGS/game.s b/BuGS/game.s index 2b9c5fe..0c44c8b 100644 --- a/BuGS/game.s +++ b/BuGS/game.s @@ -22,6 +22,8 @@ keep game game start + using globalData + jsl setupScreen lda colourPalette @@ -712,62 +714,7 @@ vblLoop2 anop rtl -backupStack dc i2'0' colourPalette dc i2'0' shouldQuit dc i2'1' -tileJumpTable dc a4'solid0' - dc a4'mushroom4' - dc a4'mushroom3' - dc a4'mushroom2' - dc a4'mushroom1' - dc a4'symbolC' - dc a4'symbolP' - dc a4'symbolDot' - dc a4'symbolColon' - dc a4'poisonedMushroom4' - dc a4'poisonedMushroom3' - dc a4'poisonedMushroom2' - dc a4'poisonedMushroom1' - dc a4'letterA' - dc a4'letterB' - dc a4'letterC' - dc a4'letterD' - dc a4'letterE' - dc a4'letterF' - dc a4'letterG' - dc a4'letterH' - dc a4'letterI' - dc a4'letterJ' - dc a4'letterK' - dc a4'letterL' - dc a4'letterM' - dc a4'letterN' - dc a4'letterO' - dc a4'letterP' - dc a4'letterQ' - dc a4'letterR' - dc a4'letterS' - dc a4'letterT' - dc a4'letterU' - dc a4'letterV' - dc a4'letterW' - dc a4'letterX' - dc a4'letterY' - dc a4'letterZ' - dc a4'number0' - dc a4'number1' - dc a4'number2' - dc a4'number3' - dc a4'number4' - dc a4'number5' - dc a4'number6' - dc a4'number7' - dc a4'number8' - dc a4'number9' - dc a4'solid1' - dc a4'solid2' - dc a4'solid3' - dc a4'drawPlayer' - end diff --git a/BuGS/gameFlea.s b/BuGS/gameFlea.s index 26bfd24..a8840c6 100644 --- a/BuGS/gameFlea.s +++ b/BuGS/gameFlea.s @@ -11,10 +11,16 @@ keep gameFlea gameFlea start + using globalData + +FLEA_STATE_NONE equ 0 +FLEA_STATE_FALLING equ 1 +FLEA_STATE_EXPLODING equ 2 + +FLEA_SCREEN_SPEED equ 2*SCREEN_BYTES_PER_ROW +FLEA_SLOW_UPDATES_PER_TILE equ 3 +FLEA_FAST_UPDATES_PER_TILE equ 1 -fleaState_none equ 0 -fleaState_falling equ 1 -fleaState_exploding equ 2 drawFlea entry lda fleaState @@ -29,7 +35,7 @@ drawFlea entry ldx fleaTileOffsets lda tiles,x bne drawFlea_skipTile1 - lda #$1 + lda #TILE_STATE_DIRTY sta tiles,x txa sta dirtyGameTiles,y @@ -41,7 +47,7 @@ drawFlea_skipTile1 anop ldx fleaTileOffsets+2 lda tiles,x bne drawFlea_skipTile2 - lda #$1 + lda #TILE_STATE_DIRTY sta tiles,x txa sta dirtyGameTiles,y @@ -53,7 +59,7 @@ drawFlea_skipTile2 anop ldx fleaTileOffsets+4 lda tiles,x bne drawFlea_skipTile3 - lda #$1 + lda #TILE_STATE_DIRTY sta tiles,x txa sta dirtyGameTiles,y @@ -65,7 +71,7 @@ drawFlea_skipTile3 anop ldx fleaTileOffsets+6 lda tiles,x bne drawFlea_skipTile4 - lda #$1 + lda #TILE_STATE_DIRTY sta tiles,x txa sta dirtyGameTiles,y @@ -80,7 +86,7 @@ drawFlea_done anop fleaJump entry - cmp #fleaState_falling + cmp #FLEA_STATE_FALLING bne fleaJump_explosion lda fleaJumpTable,x @@ -105,16 +111,14 @@ updateFlea entry bne updateFlea_cont updateFlea_cont anop - cmp #fleaState_falling + cmp #FLEA_STATE_FALLING beq updateFlea_cont2 ; Handle explosion lda fleaSprite - clc - adc #$4 + beq updateFlea_explosionDone + sbc #$4 sta fleaSprite - cmp #$15 - bge updateFlea_explosionDone rtl updateFlea_explosionDone anop @@ -136,15 +140,14 @@ updateFlea_bottomOfTile anop bne updateFlea_nextAction lda fleaSprite - cmp #$c beq updateFlea_resetSprite - clc - adc #$4 + sbc #$4 sta fleaSprite bra updateFlea_nextAction updateFlea_resetSprite anop - stz fleaSprite + lda #FLEA_SPRITE_LAST_OFFSET + sta fleaSprite bra updateFlea_nextAction updateFlea_nextTile anop @@ -154,7 +157,7 @@ updateFlea_nextTile anop ldx fleaTileOffsets stx fleaTileOffsets+4 lda tiles+8,x - cmp #$ffff + cmp #INVALID_TILE_NUM beq updateFlea_bottom sta fleaTileOffsets @@ -170,7 +173,7 @@ updateFlea_nextTile anop jsl rand65535 and #$7 bne updateFlea_nextAction - lda #$10 + lda #TILE_MUSHROOM4 sta tiles+4,x bra updateFlea_nextAction @@ -193,18 +196,19 @@ addFlea entry lda fleaState bne addFlea_done - lda #fleaState_falling + lda #FLEA_STATE_FALLING sta fleaState - lda #$3 + lda #FLEA_SLOW_UPDATES_PER_TILE sta fleaUpdatePerTile sta fleaHeightInTile - lda #$140 + lda #FLEA_SCREEN_SPEED sta fleaSpeed stz fleaSpriteCounter - stz fleaSprite + lda #FLEA_SPRITE_LAST_OFFSET + sta fleaSprite jsl rand25 asl a @@ -221,7 +225,7 @@ addFlea entry lda tiles+2,x sec - sbc #$3c3 + sbc #6*SCREEN_BYTES_PER_ROW+3 sta fleaScreenOffset addFlea_done anop @@ -229,17 +233,18 @@ addFlea_done anop shootFlea entry lda fleaState - cmp #$1 + cmp #FLEA_STATE_FALLING bne shootFlea_done lda fleaSpeed - cmp #$140 + cmp #FLEA_SCREEN_SPEED beq shootFlea_faster - lda #$2 + lda #FLEA_STATE_EXPLODING sta fleaState - stz fleaSprite + lda #EXPLOSION_LAST_OFFSET + sta fleaSprite rtl @@ -247,7 +252,7 @@ shootFlea_faster anop asl a sta fleaSpeed - lda #$1 + lda #FLEA_FAST_UPDATES_PER_TILE sta fleaUpdatePerTile lda fleaHeightInTile @@ -256,14 +261,14 @@ shootFlea_faster anop bcc shootFlea_done lda fleaScreenOffset - sbc #$a0 + sbc #SCREEN_BYTES_PER_ROW sta fleaScreenOffset shootFlea_done anop rtl -fleaState dc i2'fleaState_none' +fleaState dc i2'FLEA_STATE_NONE' fleaScreenOffset dc i2'0' fleaTileOffsets dc i2'0' dc i2'0' @@ -273,19 +278,13 @@ fleaHeightInTile dc i2'0' fleaSpriteCounter dc i2'0' fleaSprite dc i2'0' -fleaJumpTable dc i4'flea1' - dc i4'flea2' +FLEA_SPRITE_LAST_OFFSET gequ 3*4 +fleaJumpTable dc i4'flea4' dc i4'flea3' - dc i4'flea4' + dc i4'flea2' + dc i4'flea1' fleaSpeed dc i2'0' fleaUpdatePerTile dc i2'0' -explosionJumpTable dc i4'explosion1' - dc i4'explosion2' - dc i4'explosion3' - dc i4'explosion4' - dc i4'explosion5' - dc i4'explosion6' - end diff --git a/BuGS/gameScorpion.s b/BuGS/gameScorpion.s index 916a279..5de5c69 100644 --- a/BuGS/gameScorpion.s +++ b/BuGS/gameScorpion.s @@ -11,6 +11,7 @@ keep gameScorpion gameScorpion start + using globalData scorpionState_none equ 0 @@ -20,16 +21,202 @@ scorpionState_exploding equ 3 drawScorpion entry + lda scorpionState + bne drawScorpion_cont + rtl + +drawScorpion_cont anop + ldy scorpionScreenOffset + ldx scorpionSprite + jsl scorpionJump + + ldx scorpionTileOffsets + lda tiles,x + bne drawScorpion_skipTile1 + lda #$1 + sta tiles,x + txa + cmp #RHS_FIRST_TILE_OFFSET + bge drawScorpion_nonGame1 + + ldy numDirtyGameTiles + sta dirtyGameTiles,y + iny + iny + sty numDirtyGameTiles + bra drawScorpion_skipTile1 + +drawScorpion_nonGame1 anop + ldy numDirtyNonGameTiles + sta dirtyNonGameTiles,y + iny + iny + sty numDirtyNonGameTiles + +drawScorpion_skipTile1 anop + + ldx scorpionTileOffsets+2 + lda tiles,x + bne drawScorpion_skipTile2 + lda #$1 + sta tiles,x + txa + cmp #RHS_FIRST_TILE_OFFSET + bge drawScorpion_nonGame2 + + ldy numDirtyGameTiles + sta dirtyGameTiles,y + iny + iny + sty numDirtyGameTiles + bra drawScorpion_skipTile2 + +drawScorpion_nonGame2 anop + ldy numDirtyNonGameTiles + sta dirtyNonGameTiles,y + iny + iny + sty numDirtyNonGameTiles + +drawScorpion_skipTile2 anop + + ldx scorpionTileOffsets+4 + lda tiles,x + bne drawScorpion_done + lda #$1 + sta tiles,x + txa + cmp #RHS_FIRST_TILE_OFFSET + bge drawScorpion_nonGame3 + + ldy numDirtyGameTiles + sta dirtyGameTiles,y + iny + iny + sty numDirtyGameTiles + rtl + +drawScorpion_nonGame3 anop + ldy numDirtyNonGameTiles + sta dirtyNonGameTiles,y + iny + iny + sty numDirtyNonGameTiles + +drawScorpion_done anop rtl +scorpionJump entry + cmp #scorpionState_left + bne scorpionJump_next + + lda scorpionLeftJumpTable,x + sta jumpInst+1 + + lda scorpionLeftJumpTable+2,x + sta jumpInst+3 + bra jumpInst + +scorpionJump_next anop + cmp #scorpionState_right + bne scorpionJump_explosion + + lda scorpionRightJumpTable,x + sta jumpInst+1 + + lda scorpionRightJumpTable+2,x + sta jumpInst+3 + bra jumpInst + +scorpionJump_explosion anop + tya + clc + adc #$4 + tay + + lda explosionJumpTable,x + sta jumpInst+1 + + lda explosionJumpTable+2,x + sta jumpInst+3 + +jumpInst jmp >leftScorpion1 + nop + + updateScorpion entry + lda scorpionState + beq updateScorpion_done + + lda scorpionSprite + cmp #$3c + beq updateScorpionLeft_resetSprite + clc + adc #$4 + sta scorpionSprite + + bra updateScorpionLeft_nextAction + +updateScorpionLeft_resetSprite anop + stz scorpionSprite + +updateScorpionLeft_nextAction anop + lda scorpionShiftInTile + beq updateScorpionLeft_nextTile + dec a + sta scorpionShiftInTile + + and #$1 + beq updateScorpion_done + dec scorpionScreenOffset + bra updateScorpion_done + +updateScorpionLeft_nextTile anop + dec scorpionScreenOffset + lda #$7 + sta scorpionShiftInTile + + ldx scorpionTileOffsets+2 + cpx #LHS_FIRST_TILE_OFFSET + bge updateScorpion_offScreen + + stx scorpionTileOffsets+4 + ldx scorpionTileOffsets + stx scorpionTileOffsets+2 + lda tiles+10,x + sta scorpionTileOffsets + rtl + +updateScorpion_offScreen anop + stz scorpionState + +updateScorpion_done anop rtl addScorpion entry lda scorpionState - beq addScorpion_done + bne addScorpion_done + + lda #scorpionState_left + sta scorpionState + + ldx #24*16 + stx scorpionTileOffsets + lda tiles+2,x + dec a + sta scorpionScreenOffset + + lda tiles+12,x + sta scorpionTileOffsets+2 + + tax + lda tiles+12,x + sta scorpionTileOffsets+4 + + lda #$7 + sta scorpionShiftInTile addScorpion_done anop rtl @@ -44,11 +231,8 @@ scorpionScreenOffset dc i2'0' scorpionTileOffsets dc i2'0' dc i2'0' dc i2'0' - dc i2'0' - dc i2'0' - dc i2'0' -scorpionSpriteCounter dc i2'0' -scorpionSprite dc i2'0' +scorpionShiftInTile dc i2'0' +scorpionSprite dc i2'0' scorpionLeftJumpTable dc i4'leftScorpion1s' dc i4'leftScorpion1' @@ -66,12 +250,23 @@ scorpionLeftJumpTable dc i4'leftScorpion1s' dc i4'leftScorpion4' dc i4'leftScorpion4s' dc i4'leftScorpion4' + +scorpionRightJumpTable dc i4'rightScorpion1s' + dc i4'rightScorpion1' + dc i4'rightScorpion1s' + dc i4'rightScorpion1' + dc i4'rightScorpion2s' + dc i4'rightScorpion2' + dc i4'rightScorpion2s' + dc i4'rightScorpion2' + dc i4'rightScorpion3s' + dc i4'rightScorpion3' + dc i4'rightScorpion3s' + dc i4'rightScorpion3' + dc i4'rightScorpion4s' + dc i4'rightScorpion4' + dc i4'rightScorpion4s' + dc i4'rightScorpion4' -explosionJumpTable dc i4'explosion1' - dc i4'explosion2' - dc i4'explosion3' - dc i4'explosion4' - dc i4'explosion5' - dc i4'explosion6' end diff --git a/BuGS/globals.s b/BuGS/globals.s new file mode 100644 index 0000000..d6ce603 --- /dev/null +++ b/BuGS/globals.s @@ -0,0 +1,177 @@ +; +; globals.s +; BuGS +; +; Created by Jeremy Rand on 2020-07-21. +;Copyright © 2020 Jeremy Rand. All rights reserved. +; + + case on + mcopy globals.macros + keep globals + +globals start + rtl + end + +globalData data + +SCREEN_BYTES_PER_ROW gequ 160 + +SIZEOF_TILE_INFO gequ 16 + +GAME_NUM_TILES_WIDE gequ 25 +GAME_NUM_TILES_TALL gequ 25 + +NUM_GAME_TILES gequ GAME_NUM_TILES_WIDE*GAME_NUM_TILES_TALL + +RHS_NUM_TILES_WIDE gequ 2 +NUM_RHS_NON_GAME_TILES gequ RHS_NUM_TILES_WIDE*GAME_NUM_TILES_TALL +RHS_FIRST_TILE gequ NUM_GAME_TILES +RHS_FIRST_TILE_OFFSET gequ RHS_FIRST_TILE*SIZEOF_TILE_INFO + +LHS_NUM_TILES_WIDE gequ 13 +NUM_LHS_NON_GAME_TILES gequ LHS_NUM_TILES_WIDE*GAME_NUM_TILES_TALL +LHS_FIRST_TILE gequ RHS_FIRST_TILE+NUM_RHS_NON_GAME_TILES +LHS_FIRST_TILE_OFFSET gequ LHS_FIRST_TILE*SIZEOF_TILE_INFO + +NUM_NON_GAME_TILES gequ NUM_RHS_NON_GAME_TILES+NUM_LHS_NON_GAME_TILES + +TOTAL_NUM_TILES gequ NUM_GAME_TILES+NUM_NON_GAME_TILES + +INVALID_TILE_NUM gequ $ffff + +TILE_STATE_CLEAN gequ 0 +TILE_STATE_DIRTY gequ 1 + +TILE_EMPTY gequ 0 +TILE_MUSHROOM1 gequ 1*4 +TILE_MUSHROOM2 gequ 2*4 +TILE_MUSHROOM3 gequ 3*4 +TILE_MUSHROOM4 gequ 4*4 +TILE_POISON_MUSHROOM1 gequ 9*4 +TILE_POISON_MUSHROOM2 gequ 10*4 +TILE_POISON_MUSHROOM3 gequ 11*4 +TILE_POISON_MUSHROOM4 gequ 12*4 + +TILE_SYMBOL_C gequ 5*4 +TILE_SYMBOL_P gequ 6*4 +TILE_SYMBOL_DOT gequ 7*4 +TILE_SYMBOL_COLON gequ 8*4 + +TILE_LETTER_A gequ 13*4 +TILE_LETTER_B gequ 14*4 +TILE_LETTER_C gequ 15*4 +TILE_LETTER_D gequ 16*4 +TILE_LETTER_E gequ 17*4 +TILE_LETTER_F gequ 18*4 +TILE_LETTER_G gequ 19*4 +TILE_LETTER_H gequ 20*4 +TILE_LETTER_I gequ 21*4 +TILE_LETTER_J gequ 22*4 +TILE_LETTER_K gequ 23*4 +TILE_LETTER_L gequ 24*4 +TILE_LETTER_M gequ 25*4 +TILE_LETTER_N gequ 26*4 +TILE_LETTER_O gequ 27*4 +TILE_LETTER_P gequ 28*4 +TILE_LETTER_Q gequ 29*4 +TILE_LETTER_R gequ 30*4 +TILE_LETTER_S gequ 31*4 +TILE_LETTER_T gequ 32*4 +TILE_LETTER_U gequ 33*4 +TILE_LETTER_V gequ 34*4 +TILE_LETTER_W gequ 35*4 +TILE_LETTER_X gequ 36*4 +TILE_LETTER_Y gequ 37*4 +TILE_LETTER_Z gequ 38*4 + +TILE_NUMBER_0 gequ 39*4 +TILE_NUMBER_1 gequ 40*4 +TILE_NUMBER_2 gequ 41*4 +TILE_NUMBER_3 gequ 42*4 +TILE_NUMBER_4 gequ 43*4 +TILE_NUMBER_5 gequ 44*4 +TILE_NUMBER_6 gequ 45*4 +TILE_NUMBER_7 gequ 46*4 +TILE_NUMBER_8 gequ 47*4 +TILE_NUMBER_9 gequ 48*4 + +TILE_SOLID1 gequ 49*4 +TILE_SOLID2 gequ 50*4 +TILE_SOLID3 gequ 51*4 + +TILE_PLAYER gequ 52*4 + + +tileState gequ tiles +tileScreenOffset gequ tileState+2 + + +backupStack dc i2'0' + +tileJumpTable dc a4'solid0' + dc a4'mushroom4' + dc a4'mushroom3' + dc a4'mushroom2' + dc a4'mushroom1' + dc a4'symbolC' + dc a4'symbolP' + dc a4'symbolDot' + dc a4'symbolColon' + dc a4'poisonedMushroom4' + dc a4'poisonedMushroom3' + dc a4'poisonedMushroom2' + dc a4'poisonedMushroom1' + dc a4'letterA' + dc a4'letterB' + dc a4'letterC' + dc a4'letterD' + dc a4'letterE' + dc a4'letterF' + dc a4'letterG' + dc a4'letterH' + dc a4'letterI' + dc a4'letterJ' + dc a4'letterK' + dc a4'letterL' + dc a4'letterM' + dc a4'letterN' + dc a4'letterO' + dc a4'letterP' + dc a4'letterQ' + dc a4'letterR' + dc a4'letterS' + dc a4'letterT' + dc a4'letterU' + dc a4'letterV' + dc a4'letterW' + dc a4'letterX' + dc a4'letterY' + dc a4'letterZ' + dc a4'number0' + dc a4'number1' + dc a4'number2' + dc a4'number3' + dc a4'number4' + dc a4'number5' + dc a4'number6' + dc a4'number7' + dc a4'number8' + dc a4'number9' + dc a4'solid1' + dc a4'solid2' + dc a4'solid3' + dc a4'drawPlayer' + + +EXPLOSION_LAST_OFFSET gequ 20 + +explosionJumpTable dc i4'explosion6' + dc i4'explosion5' + dc i4'explosion4' + dc i4'explosion3' + dc i4'explosion2' + dc i4'explosion1' + + end diff --git a/BuGS/sprites/explosions.s b/BuGS/sprites/explosions.s index 057cf64..8411e8f 100644 --- a/BuGS/sprites/explosions.s +++ b/BuGS/sprites/explosions.s @@ -11,6 +11,7 @@ keep explosions explosions start + using globalData explosion1 entry _spriteHeader @@ -631,7 +632,4 @@ explosion6 entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/fleas.s b/BuGS/sprites/fleas.s index a3e449e..c03ca29 100644 --- a/BuGS/sprites/fleas.s +++ b/BuGS/sprites/fleas.s @@ -11,6 +11,7 @@ keep fleas fleas start + using globalData flea1 entry @@ -443,7 +444,4 @@ flea4 entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/letters.s b/BuGS/sprites/letters.s index 7970c94..7d9835e 100644 --- a/BuGS/sprites/letters.s +++ b/BuGS/sprites/letters.s @@ -11,6 +11,7 @@ keep letters letters start + using globalData letterA entry _spriteHeader @@ -1608,7 +1609,4 @@ letterZ entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/mushrooms.s b/BuGS/sprites/mushrooms.s index bcd873d..ea387d6 100644 --- a/BuGS/sprites/mushrooms.s +++ b/BuGS/sprites/mushrooms.s @@ -11,6 +11,7 @@ keep mushrooms mushrooms start + using globalData mushroom1 entry _spriteHeader @@ -522,8 +523,5 @@ poisonedMushroom4 entry _spriteFooter rtl - - -backupStack dc i2'0' end diff --git a/BuGS/sprites/numbers.s b/BuGS/sprites/numbers.s index 943d1e0..c9bd873 100644 --- a/BuGS/sprites/numbers.s +++ b/BuGS/sprites/numbers.s @@ -11,7 +11,7 @@ keep numbers numbers start - + using globalData number0 entry _spriteHeader @@ -639,7 +639,4 @@ number9 entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/scores.s b/BuGS/sprites/scores.s index e011205..a4fdb4a 100644 --- a/BuGS/sprites/scores.s +++ b/BuGS/sprites/scores.s @@ -11,6 +11,7 @@ keep scores scores start + using globalData score300 entry _spriteHeader @@ -334,8 +335,4 @@ score900 entry _spriteFooter rtl - -backupStack dc i2'0' - - end diff --git a/BuGS/sprites/scorpions.s b/BuGS/sprites/scorpions.s index 0f1f3c1..5cb61d4 100644 --- a/BuGS/sprites/scorpions.s +++ b/BuGS/sprites/scorpions.s @@ -11,6 +11,7 @@ keep scorpions scorpions start + using globalData leftScorpion1 entry iny @@ -2521,7 +2522,4 @@ rightScorpion4s entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/segments.s b/BuGS/sprites/segments.s index 786323c..24b928f 100644 --- a/BuGS/sprites/segments.s +++ b/BuGS/sprites/segments.s @@ -11,6 +11,7 @@ keep segments segments start + using globalData leftHead1 entry _spriteHeader @@ -3462,8 +3463,5 @@ downBody3 entry _spriteFooter rtl - - -backupStack dc i2'0' end diff --git a/BuGS/sprites/ship.s b/BuGS/sprites/ship.s index f929277..1c565af 100644 --- a/BuGS/sprites/ship.s +++ b/BuGS/sprites/ship.s @@ -11,6 +11,7 @@ keep ship ship start + using globalData drawShip entry _spriteHeader @@ -340,7 +341,6 @@ drawPlayer entry rtl -backupStack dc i2'0' collision dc i2'0' end diff --git a/BuGS/sprites/shot.s b/BuGS/sprites/shot.s index 2fcd3fc..2a91045 100644 --- a/BuGS/sprites/shot.s +++ b/BuGS/sprites/shot.s @@ -11,6 +11,7 @@ keep shot shot start + using globalData drawHalfShot entry _spriteHeader @@ -248,7 +249,6 @@ drawShotShift entry rtl -backupStack dc i2'0' collision dc i2'0' end diff --git a/BuGS/sprites/solid.s b/BuGS/sprites/solid.s index 2c75558..c110291 100644 --- a/BuGS/sprites/solid.s +++ b/BuGS/sprites/solid.s @@ -11,7 +11,7 @@ keep solid solid start - + using globalData solid0 entry _spriteHeader @@ -236,7 +236,4 @@ solid3 entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/spiders.s b/BuGS/sprites/spiders.s index 6608087..88ed9a5 100644 --- a/BuGS/sprites/spiders.s +++ b/BuGS/sprites/spiders.s @@ -11,6 +11,7 @@ keep spiders spiders start + using globalData spider1 entry _spriteHeader @@ -2087,7 +2088,4 @@ spider7s entry _spriteFooter rtl - -backupStack dc i2'0' - end diff --git a/BuGS/sprites/symbols.s b/BuGS/sprites/symbols.s index 6b6dddf..c19acab 100644 --- a/BuGS/sprites/symbols.s +++ b/BuGS/sprites/symbols.s @@ -11,6 +11,7 @@ keep symbols symbols start + using globalData symbolC entry _spriteHeader @@ -254,8 +255,5 @@ symbolColon entry _spriteFooter rtl - - -backupStack dc i2'0' end diff --git a/BuGS/tiles.c b/BuGS/tiles.c index 880b7f0..30c8b0d 100644 --- a/BuGS/tiles.c +++ b/BuGS/tiles.c @@ -53,7 +53,7 @@ /* Globals */ -tTile tiles[TOTAL_GAME_TILES]; +tTile tiles[TOTAL_NUM_TILES]; tTileOffset dirtyGameTiles[NUM_GAME_TILES + GAME_NUM_TILES_TALL]; word numDirtyGameTiles; diff --git a/BuGS/tiles.h b/BuGS/tiles.h index 6726051..92826aa 100644 --- a/BuGS/tiles.h +++ b/BuGS/tiles.h @@ -30,7 +30,7 @@ #define NUM_NON_GAME_TILES (NUM_RHS_NON_GAME_TILES + NUM_LHS_NON_GAME_TILES) -#define TOTAL_GAME_TILES (NUM_GAME_TILES + NUM_NON_GAME_TILES) +#define TOTAL_NUM_TILES (NUM_GAME_TILES + NUM_NON_GAME_TILES) #define INVALID_TILE_NUM 0xffff @@ -119,7 +119,7 @@ typedef struct /* Globals */ -extern tTile tiles[TOTAL_GAME_TILES]; +extern tTile tiles[TOTAL_NUM_TILES]; extern tTileOffset dirtyGameTiles[NUM_GAME_TILES + GAME_NUM_TILES_TALL]; extern word numDirtyGameTiles; extern tTileOffset dirtyNonGameTiles[NUM_NON_GAME_TILES];