From f58a831eb93254a85330a6f75c9d509fe66a55cf Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Thu, 5 Nov 2020 01:54:12 -0500 Subject: [PATCH] Fix the bugs related to marking dirty tiles for the player. Everything seems to move smoothly now and works well at 2.8MHz. Next, I need to block the player from going over top of mushrooms. --- BuGS/gamePlayer.s | 12 ++++++++++-- BuGS/make/config.txt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/BuGS/gamePlayer.s b/BuGS/gamePlayer.s index db9cea7..649daeb 100644 --- a/BuGS/gamePlayer.s +++ b/BuGS/gamePlayer.s @@ -117,8 +117,8 @@ updatePlayer_skipDeltas anop updatePlayer_shift anop adc mouseYAddress,y - sta mouseAddress dec a + sta mouseAddress tay jsl drawShipShift bra updatePlayer_dirty @@ -127,19 +127,27 @@ updatePlayer_dirty anop lda mouseAddress sec sbc #SCREEN_ADDRESS - and #$fff8 + and #$fffc tax lda >screenToTileOffset,x tax lda #TILE_STATE_DIRTY + cpx #RHS_FIRST_TILE_OFFSET + bge updatePlayer_tileOffscreen1 sta tileDirty,x +updatePlayer_tileOffscreen1 anop ldy tileRight,x + cpy #RHS_FIRST_TILE_OFFSET + bge updatePlayer_tileOffscreen2 sta tileDirty,y +updatePlayer_tileOffscreen2 anop ldy tileBelow,x cpy #INVALID_TILE_NUM beq updatePlayer_done sta tileDirty,y ldx tileRight,y + cpx #RHS_FIRST_TILE_OFFSET + bge updatePlayer_done sta tileDirty,x updatePlayer_done anop diff --git a/BuGS/make/config.txt b/BuGS/make/config.txt index b9b3a04..4cf9182 100644 --- a/BuGS/make/config.txt +++ b/BuGS/make/config.txt @@ -8,6 +8,7 @@ s6d2 = s7d1 = /Users/jrand/Library/Developer/Xcode/DerivedData/BuGS-bffpexoblaghkzcbtjtzxeulnuto/Build/Products/Debug/BuGS.2mg +g_limit_speed = 3 bram1[00] = 00 00 00 01 00 00 0d 06 02 01 01 00 01 00 00 00