diff --git a/BuGS/game.s b/BuGS/game.s index 600a206..d3a484f 100644 --- a/BuGS/game.s +++ b/BuGS/game.s @@ -48,12 +48,6 @@ gameLoop anop _drawDirtyGameRow 13 _drawDirtyGameRow 14 - short i,m - lda >BORDER_COLOUR_REGISTER - and #$f7 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl drawScorpion _drawDirtyGameRow 15 @@ -67,44 +61,11 @@ gameLoop anop _drawDirtyGameRow 23 _drawDirtyGameRow 24 - short i,m - lda >BORDER_COLOUR_REGISTER - and #$f3 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl drawSpider - - short i,m - lda >BORDER_COLOUR_REGISTER - and #$f1 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl drawFlea - - short i,m - lda >BORDER_COLOUR_REGISTER - ora #$08 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl drawSegments - - short i,m - lda >BORDER_COLOUR_REGISTER - ora #$04 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl drawDirtyNonGameTiles - short i,m - lda >BORDER_COLOUR_REGISTER - ora #$02 - sta >BORDER_COLOUR_REGISTER - long i,m - jsl updatePlayer jsl updateShot jsl updateScorpion @@ -112,6 +73,7 @@ gameLoop anop jsl updateFlea jsl updateSegments jsl updateLevel + jsl checkKeyboard jsl waitForVbl @@ -178,6 +140,12 @@ setupScreen entry long i,m and #$000f sta borderColour + + short i,m + lda >BORDER_COLOUR_REGISTER + and #$f0 + sta >BORDER_COLOUR_REGISTER + long i,m sei phd @@ -289,6 +257,7 @@ checkKey_loop2 anop beq checkKey_game checkKey_done anop + long i,m rtl checkKey_pause anop @@ -315,11 +284,6 @@ waitForKey_loop anop waitForVbl entry - short i,m - lda >BORDER_COLOUR_REGISTER - and #$f0 - sta >BORDER_COLOUR_REGISTER - long i,m vblLoop anop lda >VERTICAL_COUNTER ; load the counter value and #$80ff ; mask out the VBL bits diff --git a/BuGS/global.macros b/BuGS/global.macros index f246a6b..c528bd6 100644 --- a/BuGS/global.macros +++ b/BuGS/global.macros @@ -9,11 +9,6 @@ macro _drawDirtyGameRow &rowNum - short i,m - lda >BORDER_COLOUR_REGISTER - and #$f0 - sta >BORDER_COLOUR_REGISTER - long i,m _drawDirtyGameRow_wait&rowNum anop ; This code loads into the accumulator the line currently being drawn to the ; screen by HW. It allows code to race just behind the beam and redraw the @@ -41,12 +36,6 @@ _drawDirtyGameRow_wait&rowNum anop cmp #&scanLineNum blt _drawDirtyGameRow_wait&rowNum - short i,m - lda >BORDER_COLOUR_REGISTER - ora #$0f - sta >BORDER_COLOUR_REGISTER - long i,m - lcla &tileOffset &tileOffset seta &rowNum*50 lcla &lastTileOffset diff --git a/BuGS/score.s b/BuGS/score.s index f4fafe1..e15a5a4 100644 --- a/BuGS/score.s +++ b/BuGS/score.s @@ -260,7 +260,36 @@ scoreAddOneThousand_skipZeroHundreds anop checkHighScore entry -; TODO - Write this code + lda gameScore+2 + cmp highScore+2 + blt checkHighScore_done + bne checkHighScore_isHighScore + lda gameScore + cmp highScore + blt checkHighScore_done +checkHighScore_isHighScore anop + sta highScore + lda gameScore+2 + sta highScore+2 + + + ldy #P1_SCORE_ONES_OFFSET + ldx #HIGH_SCORE_ONES_OFFSET + +checkHighScore_loop anop + lda tileType,y + sta tileType,x + phy + _dirtyNonGameTile + ply + dex + dex + dey + dey + cpy #P1_SCORE_FIRST_OFFSET + bne checkHighScore_loop + +checkHighScore_done anop rtl highScore dc i4'0' diff --git a/TODO.md b/TODO.md index 3708391..fcc6745 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,7 @@ TODO ======= -* At the end of the game, the score should be compared to the high score. If larger, store the high score. +* Implement a high score list and save the high scores across restarts * When the player dies, the mushrooms need to be reset and the score incremented for damaged and poisoned mushrooms. * Implement the code to support pausing the game * Implement the code for supporting a two player game