diff --git a/game.asm b/game.asm index e73903a..b955ff3 100644 --- a/game.asm +++ b/game.asm @@ -43,8 +43,8 @@ MainGameLoop jsr MainRoundLoop bit escFlag - bmi START jvs GoGameOver + bmi START jsr CalculateGains @@ -369,8 +369,8 @@ RoboTanks cmp #@kbcode._esc ; 28 ; ESC bne @+ jsr AreYouSure -@ lda escFlag - seq:rts ; keys Esc or O +@ bit escFlag + spl:rts ; keys Esc or O jmp AfterManualShooting @@ -382,8 +382,8 @@ ManualShooting lda #%00000000 sta TestFlightFlag ; set "Test Fight" off jsr BeforeFire - lda escFlag - seq:rts ; keys Esc or O + bit escFlag + spl:rts ; keys Esc or O AfterManualShooting mva #$00 plot4x4color @@ -410,8 +410,8 @@ GoFloat jsr TankFlying lda #0 sta ActiveDefenceWeapon,x ; deactivate after use - lda escFlag - beq ManualShooting ; after floating tank can shoot + bit escFlag + bpl ManualShooting ; after floating tank can shoot rts StandardShoot inc noDeathCounter @@ -429,8 +429,8 @@ ShootNow mva #$00 plot4x4color jsr DisplayOffensiveTextNr - lda escFlag - seq:rts ; keys Esc or O + bit escFlag + spl:rts ; keys Esc or O lda HitFlag ;0 if missed beq missed diff --git a/scorch.asm b/scorch.asm index b6d444a..d57ce7b 100644 --- a/scorch.asm +++ b/scorch.asm @@ -126,7 +126,7 @@ FirstZpageVariable = $57 .zpvar RangeLeft .word .zpvar RangeRight .word .zpvar NewAngle .byte - .zpvar escFlag .byte + .zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing .zpvar LineYdraw .byte .zpvar LineXdraw .word .zpvar plot4x4color .byte ; $00 / $ff @@ -585,7 +585,7 @@ MakeDarkScreen bpl nokeys ;---O pressed-quit game to game over screen--- QuitToGameover - mva #$40 escFlag + mva #$C0 escFlag ; bits 7 and 6 set rts CheckEsc cmp #@kbcode._esc ; 28 ; ESC @@ -600,12 +600,6 @@ nokeys ;-------------------------------------------------- .proc ShellDelay ;-------------------------------------------------- - lda CONSOL - and #%00000101 ; Start + Option - bne @+ - mva #$40 escFlag -@ and #%00000001 - beq noShellDelay ldx flyDelay DelayLoop lda VCOUNT diff --git a/scorch.bin b/scorch.bin index 77ed68a..a9d1a3a 100644 Binary files a/scorch.bin and b/scorch.bin differ diff --git a/scorch.xex b/scorch.xex index 560ffa1..2ecc23d 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/scorchC64.asm b/scorchC64.asm index 2ecd979..e639b60 100644 --- a/scorchC64.asm +++ b/scorchC64.asm @@ -128,7 +128,7 @@ FirstZpageVariable = $58 ; $57 .zpvar RangeLeft .word .zpvar RangeRight .word .zpvar NewAngle .byte - .zpvar escFlag .byte + .zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing .zpvar LineYdraw .byte .zpvar LineXdraw .word .zpvar plot4x4color .byte ; $00 / $ff @@ -334,6 +334,9 @@ MakeDarkScreen ldx flyDelay DelayLoop lda $d012 +@ cmp $d012 + beq @- + lda $d012 @ cmp $d012 beq @- dex diff --git a/scorchC64.prg b/scorchC64.prg index a02c5ec..ef75fc4 100644 Binary files a/scorchC64.prg and b/scorchC64.prg differ diff --git a/weapons.asm b/weapons.asm index 8be7345..adffb57 100644 --- a/weapons.asm +++ b/weapons.asm @@ -1100,11 +1100,8 @@ ContinueToCheckMaxForce2 notpressed jsr CheckExitKeys ; Check for O, Esc or Start+Option keys bit escFlag - bmi EscPressed - bvc OnotPressed -EscPressed - rts ; exit if pressed 'Exit keys' -OnotPressed + spl:rts ; exit if pressed 'Exit keys' + ldx TankNr ; for optimize ; Select and Option lda CONSOL @@ -1768,11 +1765,7 @@ nonowait ; jsr CheckExitKeys ; Check for O, Esc or Start+Option keys bit escFlag - bmi EscPressed - bvc OnotPressed -EscPressed - rts ; exit if pressed 'Exit keys' -OnotPressed + spl:rts ; exit if pressed 'Exit keys' ldx TankNr ; nowait @@ -2112,12 +2105,10 @@ mrLoopi phx jsr CheckExitKeys ; Check for O, Esc or Start+Option keys bit escFlag - bmi EscPressed - bvc OnotPressed -EscPressed + bpl ExitnotPressed plx rts ; exit if pressed 'Exit keys' -OnotPressed +ExitnotPressed plx ; @@ -2611,10 +2602,14 @@ KeyboardAndJoyCheck sbc #12 sta LineYdraw jsr TypeLine4x4.variableLength - ldx TankNr LotOfFuel notpressed + jsr CheckExitKeys + bit escFlag + spl:rts ;---Exit key pressed-quit game--- + ldx TankNr + ; let's animate "engine" jsr DrawTankEngine ; enimation ends @@ -2628,14 +2623,6 @@ notpressed lda kbcode and #%00111111 ; CTRL and SHIFT elimination - cmp #@kbcode._esc ; 28 ; ESC - bne @+ - jsr AreYouSure - bit escFlag - bpl notpressed - ;---esc pressed-quit game--- - rts -@ jumpFromStick cmp #@kbcode._left ; $6 jeq pressedLeft