diff --git a/BUGS.md b/BUGS.md index 9a4b26f..e81c21d 100644 --- a/BUGS.md +++ b/BUGS.md @@ -7,6 +7,7 @@ This is a list of the software bugs (as opposed to the bugs in the game that you * Sometimes centipede segments seem to be stacked one on top of another. You think there is just one left but you shoot it and there is one underneath it. This should not happen. * A spider moving left to right went off screen and left garbage on the RHS as it exited. I have only seen this once. I think it coincided with the player dying. * Sometimes when the player dies, the "you can shoot" indicator is left behind as garbage on-screen. +* If you die holding the mouse button down, your next game will start shooting without pressing the mouse button. diff --git a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist index c7870af..2596fb4 100644 --- a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Binary.xcscheme_^#shared#^_ orderHint - 1 + 2 BuGS.xcscheme_^#shared#^_ @@ -17,7 +17,7 @@ DiskImage.xcscheme_^#shared#^_ orderHint - 2 + 1 doNotBuild.xcscheme_^#shared#^_ diff --git a/BuGS/gameMushroom.s b/BuGS/gameMushroom.s index 329e6c6..53c0355 100644 --- a/BuGS/gameMushroom.s +++ b/BuGS/gameMushroom.s @@ -17,6 +17,11 @@ gameMushroom start STARTING_NUM_MUSHROOMS equ 30 + +resetMushrooms entry +; TODO - Write this code... + clc + rtl addRandomMushrooms entry stz numInfieldMushrooms diff --git a/BuGS/gamePlayer.s b/BuGS/gamePlayer.s index 438c39f..d25bacd 100644 --- a/BuGS/gamePlayer.s +++ b/BuGS/gamePlayer.s @@ -114,9 +114,7 @@ updatePlayer_nextExplosion anop sta playerExplosionOffset bra updatePlayer_drawExplosion updatePlayer_doneExplosion anop - lda #PLAYER_RESTART_LEVEL_FRAME_COUNT - sta playerFrameCount - lda #PLAYER_STATE_NONE + lda #PLAYER_STATE_MUSHROOMS sta playerState rtl @@ -160,6 +158,20 @@ jumpInst anop nop updatePlayer_notExploding anop + cmp #PLAYER_STATE_MUSHROOMS + bne updatePlayer_notMushrooms + jsl resetMushrooms + bcc updatePlayer_doneMushrooms + rtl + +updatePlayer_doneMushrooms anop + lda #PLAYER_RESTART_LEVEL_FRAME_COUNT + sta playerFrameCount + lda #PLAYER_STATE_NONE + sta playerState + rtl + +updatePlayer_notMushrooms anop ldx #0 ldy #0 ; This code for reading the mouse data is based on some code which John Brooks helpfully provided, although I did things @@ -193,6 +205,12 @@ updatePlayer_handleDeltas anop bit #$40 bne updatePlayer_negX and #$3f + inc a + lsr a + cmp #9 + blt updatePlayer_posXNoClamp + lda #8 +updatePlayer_posXNoClamp anop clc adc mouseX cmp #MOUSE_MAX_X @@ -201,6 +219,13 @@ updatePlayer_handleDeltas anop bra updatePlayer_doneX updatePlayer_negX anop ora #$ffc0 + dec a + lsr a + ora #$8000 + cmp #$fff8 + bge updatePlayer_negXNoClamp + lda #$fff8 +updatePlayer_negXNoClamp anop clc adc mouseX bpl updatePlayer_doneX @@ -213,6 +238,12 @@ updatePlayer_doneX anop bit #$40 bne updatePlayer_negY and #$3f + inc a + lsr a + cmp #9 + blt updatePlayer_posYNoClamp + lda #8 +updatePlayer_posYNoClamp anop clc adc mouseY cmp #MOUSE_MAX_Y @@ -221,6 +252,13 @@ updatePlayer_doneX anop bra updatePlayer_doneY updatePlayer_negY anop ora #$ffc0 + dec a + lsr a + ora #$8000 + cmp #$fff8 + bge updatePlayer_negYNoClamp + lda #$fff8 +updatePlayer_negYNoClamp anop clc adc mouseY bpl updatePlayer_doneY diff --git a/BuGS/globals.s b/BuGS/globals.s index 6769e98..adba435 100644 --- a/BuGS/globals.s +++ b/BuGS/globals.s @@ -21,7 +21,8 @@ SEGMENT_DIR_RIGHT equ 1 PLAYER_STATE_NONE equ 0 PLAYER_STATE_EXPLODING equ 1 -PLAYER_STATE_ONSCREEN equ 2 +PLAYER_STATE_MUSHROOMS equ 2 +PLAYER_STATE_ONSCREEN equ 3 ; The code uses segmentPixelOffset and the segment speed to figure out whether to draw the shifted sprite ; or the regular sprite. By AND-ing with the speed, if the result is 0, then we want a non-shifted sprite. diff --git a/BuGS/level.s b/BuGS/level.s index ebf86b8..e2359ec 100644 --- a/BuGS/level.s +++ b/BuGS/level.s @@ -71,6 +71,11 @@ levelStart_done anop updateLevel entry lda gameRunning bne updateLevel_done + lda playerState + cmp #PLAYER_STATE_EXPLODING + beq updateLevel_done + cmp #PLAYER_STATE_MUSHROOMS + beq updateLevel_done lda nextLevelFrameCount beq updateLevel_checkSegments dec a @@ -79,6 +84,7 @@ updateLevel entry jsl levelNext jmp levelStart updateLevel_checkSegments anop + bne updateLevel_done lda numSegments bne updateLevel_done lda #NEXT_LEVEL_FRAME_COUNT diff --git a/BuGS/make/config.txt b/BuGS/make/config.txt index 4cf9182..b59a3bd 100644 --- a/BuGS/make/config.txt +++ b/BuGS/make/config.txt @@ -14,8 +14,8 @@ g_limit_speed = 3 bram1[00] = 00 00 00 01 00 00 0d 06 02 01 01 00 01 00 00 00 bram1[10] = 00 00 07 06 02 01 01 00 00 00 0f 06 06 00 05 06 bram1[20] = 01 00 00 00 00 00 00 01 00 00 00 00 03 02 02 02 -bram1[30] = 00 00 00 00 00 00 00 00 08 00 01 02 03 04 05 06 -bram1[40] = 07 0a 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d +bram1[30] = 00 00 00 01 00 00 00 00 00 00 01 02 03 04 05 06 +bram1[40] = 07 00 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d bram1[50] = 0e 0f ff ff ff ff ff ff ff 00 ff ff ff ff ff 81 bram1[60] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff bram1[70] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff @@ -26,7 +26,7 @@ bram1[b0] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff bram1[c0] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff bram1[d0] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff bram1[e0] = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff -bram1[f0] = ff ff ff ff ff ff ff ff ff ff ff ff 52 06 f8 ac +bram1[f0] = ff ff ff ff ff ff ff ff ff ff ff ff 41 f8 eb 52 bram3[00] = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bram3[10] = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/BuGS/make/launchEmulator b/BuGS/make/launchEmulator index 9d26123..d1debe2 100755 --- a/BuGS/make/launchEmulator +++ b/BuGS/make/launchEmulator @@ -27,7 +27,7 @@ sed -i "" "s:^s7d1 *=.*$:s7d1 = $DISKIMAGE:" config.txt # This magic ensure that clicking stop in Xcode results in the emulator terminating. -$EMULATORPATH -fullscreen & +$EMULATORPATH -fullscreen -mem 1572864 & PID=$! trap 'kill $PID' SIGTERM SIGINT SIGHUP EXIT