diff --git a/Atari/textproc.asm b/Atari/textproc.asm index fd92e58..5ddc397 100644 --- a/Atari/textproc.asm +++ b/Atari/textproc.asm @@ -443,6 +443,7 @@ ChoosingItemForPurchase jsr PutLitteChar ; Places pointer at the right position jsr getkey + and #$3f ;CTRL and SHIFT ellimination bit escFlag bpl @+ mva #0 escFlag @@ -1188,6 +1189,7 @@ CheckKeys sta NameScreen2+15 ; display tank shape number jsr CursorDisplay jsr getkey + and #$3f ;CTRL and SHIFT ellimination bit escFlag spl:rts diff --git a/game.asm b/game.asm index c776c85..a33b240 100644 --- a/game.asm +++ b/game.asm @@ -290,35 +290,38 @@ NoEnergy bpl CheckingIfRoundIsFinished cpy #2 ; is it less than 2 tanks have energy >0 ? - bcs DoNotFinishTheRound - -;points for the last living tank + bcc FinishTheRound + bit TeamGame + bvc NoTeams + ; Check if one team is not dead + ; check team 1 + ldx NumberOfPlayers + jsr CheckTeamDead + beq FinishTheRound + ; check team 2 + ldx NumberOfPlayers + dex ; for team 2 + jsr CheckTeamDead + beq FinishTheRound +NoTeams + jmp DoNotFinishTheRound +FinishTheRound +;points for the last living tank(s) ldx NumberOfPlayers dex WhichTankWonLoop lda eXistenZ,x - bne ThisOneWon - dex - bpl WhichTankWonLoop - ;error was here!!! - ; somehow I believed program will be never here - ; but it was a bad assumption - ; god knows when there is such a situation - ; (we've got a SITUATION here, if you know what I mean) - ; there are two tanks left. - ; one of them is killed by the second tank - ; second tank explodes and kills the first one. - ; and code lands here... - ; looks like no one won! - rts - -ThisOneWon + beq CheckNext + ; set winning tanks points lda CurrentResult clc adc ResultsTable,x sta ResultsTable,x - - rts ; this Round is finished + inc CurrentResult ; this is for honesty (in Team game) :) +CheckNext + dex + bpl WhichTankWonLoop + rts DoNotFinishTheRound ; Seppuku here @@ -563,6 +566,24 @@ NotLastPlayerInRound jmp MainRoundLoop .endp +;--------------------------------- +.proc CheckTeamDead +; Optimalisation procedure +; Counts alive in Team +;--------------------------------- + dex + ldy #0 ; in Y - number of tanks with energy greater than zero +CheckingTeam + lda eXistenZ,x + beq NoEnergy + iny +NoEnergy + dex + dex + bpl CheckingTeam + cpy #0 + rts +.endp ;--------------------------------- .proc PlayerXdeath ; this tank should not explode anymore: diff --git a/scorch.xex b/scorch.xex index 3c60494..2d6c879 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/weapons.asm b/weapons.asm index ba0c90d..fe7144a 100644 --- a/weapons.asm +++ b/weapons.asm @@ -1360,11 +1360,12 @@ NoSpyHard mva #0 escFlag jmp ReleaseAndLoop @ -/* cmp #$80|@kbcode._up - jeq CTRLPressedUp - cmp #$80|@kbcode._down - jeq CTRLPressedDown */ - +/* .IF TARGET = 800 + cmp #$80|@kbcode._up ; Ctrl + Up or Down only in A800 + jeq CTRLPressedUp + cmp #$80|@kbcode._down + jeq CTRLPressedDown + .ENDIF */ cmp #$80|@kbcode._tab jeq CTRLPressedTAB