From a9703609b6140ca8d063a76660c1029704cf255b Mon Sep 17 00:00:00 2001 From: pkali Date: Mon, 6 Jun 2022 00:01:02 -0400 Subject: [PATCH] bad tanksequence fix #47 --- scorch.asm | 73 ++++++++++++++++++++++----------------------------- scorch.xex | Bin 38040 -> 38040 bytes textproc.asm | 22 ++++++---------- 3 files changed, 39 insertions(+), 56 deletions(-) diff --git a/scorch.asm b/scorch.asm index f114474..784ce0d 100644 --- a/scorch.asm +++ b/scorch.asm @@ -126,7 +126,7 @@ START lda escFlag bne START - jsr RandomizeSequence + jsr RandomizeSequence0 ; for the round #1 shooting sequence is random MainGameLoop @@ -354,7 +354,6 @@ WhichTankWonLoop ; second tank explodes and kills the first one. ; and code lands here... ; looks like no one won! - rts ThisOneWon @@ -376,7 +375,6 @@ DoNotFinishTheRound jsr DisplaySeppuku jmp Seppuku - ;ldx TankNr @ ldx TankSequencePointer lda TankSequence,x @@ -447,6 +445,7 @@ continueMainRoundLoopAfterSeppuku AfterExplode + ; TODO: IS IT OK??? possibly a fix here needed for #56 ldy WeaponDepleted bne @+ ldx TankNr @@ -484,11 +483,8 @@ missed jsr DisplayOffensiveTextNr NextPlayerShoots - ;mva #1 Erase - ;jsr drawtanks - - ;before it shoots, the eXistenZ table must be - ;updated accordingly to actual energy (was forgotten, sorry to ourselves) + ;before it shoots, the eXistenZ table must be updated + ;accordingly to actual energy (was forgotten, sorry to ourselves) ldx #(MaxPlayers-1) SeteXistenZ @@ -499,7 +495,7 @@ SeteXistenZ ;DATA L1,L2 ;Multiplication 8bit*8bit, ;result 16bit - ;this algiorithm is a little longer than in Ruszczyc 6502 book + ;this algiorithm is a little longer than one in Ruszczyc 6502 book ;but it is faster LDy #8 @@ -524,13 +520,6 @@ B0 DEY ;was setup of maximum energy for players - ;mva #0 Erase - ;jsr drawtanks - - inc:lda TankSequencePointer - cmp NumberOfPlayers - bne PlayersAgain - mva #0 TankSequencePointer PlayersAgain @@ -562,27 +551,14 @@ NoPlayerNoDeath dex bpl CheckingPlayersDeath ; if processor is here it means there are no more explosions + + inc:lda TankSequencePointer + cmp NumberOfPlayers + sne:mva #0 TankSequencePointer + jmp MainRoundLoop .endp -;--------------------------------- -.proc Seppuku - lda #0 - sta FallDown1 - sta FallDown2 - sta ydraw+1 - ; get position of the tank - ldx TankNr - lda xtankstableL,x - sta xdraw - lda xtankstableH,x - sta xdraw+1 - lda yTanksTable,x - sta ydraw - lda #1 ; Missile - jsr ExplosionDirect - jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku -.endp ;--------------------------------- .proc PlayerXdeath @@ -619,7 +595,7 @@ NoPlayerNoDeath ldy TankTempY mva TankNr temp2 ; not elegant, and probably unnecessary sty TankNr - jsr FlashTank ; blinkink and pausing (like PAUSE 72 - 18x(2+2) ) + jsr FlashTank ; blinking and pausing (like PAUSE 72 - 18x(2+2) ) mva temp2 TankNr ;Deffensive text cleanup @@ -642,7 +618,7 @@ NoPlayerNoDeath sbc #4 sta ydraw lda #0 - sta ydraw+1 ; there is 0 left in A, so... TODO: bad code above. revisit when transitioning ydraw to byte + sta ydraw+1 ; there is 0 left in A, so... TODO: bad code above. revisit ;cleanup of the soil fall down ranges (left and right) sta RangeRight @@ -651,12 +627,9 @@ NoPlayerNoDeath sta FallDown2 mwa #screenwidth RangeLeft - - ; We are randomizing the weapon now. ; jumping into the middle of the explosion ; routine - MetodOfDeath lda random and #%00011111 ; range 0-31 @@ -667,13 +640,10 @@ MetodOfDeath jsr ExplosionDirect mva #sfx_silencer sfx_effect - ; jump to after explosion routines (soil fallout, etc.) ; After going through these routines we are back ; to checking if a tank exploded and maybe we have ; a deadly shot here again. - - jmp MainRoundLoop.AfterExplode .endp @@ -717,6 +687,25 @@ NotNegativeEnergy rts .endp +;--------------------------------- +.proc Seppuku + lda #0 + sta FallDown1 + sta FallDown2 + sta ydraw+1 + ; get position of the tank + ldx TankNr + lda xtankstableL,x + sta xdraw + lda xtankstableH,x + sta xdraw+1 + lda yTanksTable,x + sta ydraw + lda #1 ; Missile + jsr ExplosionDirect + jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku +.endp + ;-------------------------------------------------- GetRandomWind .proc ;in: MaxWind (byte) diff --git a/scorch.xex b/scorch.xex index fa337026a94b4a31108f0759dfd2d7c7aba2427a..c586896a81233cec8ac1cb101154f47fcafe6782 100644 GIT binary patch delta 161 zcmbQSl4-_DrVRmRjG>zY&E_#OWw}oNX#PfZrC9HWDeJyWIki`J>Ic@n>Qg@mpAz`| ztY>M@*)LNru&iWg?eVdgtZI2@GP9-fW=5-YPDZWCna(YYTASZF>#*@^xvo7sRg>)k z>#}YItt6M#A2d%1eD<+$o_x70zdlQW%L7=1UtbJk(w^>tl)cB&@Z z1=eNV3cj1wy_yA?gtI2EiQWaGGGeBJsQ)nqOn)*b7si@_sFktPL6lRR{^X80vB?E- L;+yBi{W1jr^WH`} diff --git a/textproc.asm b/textproc.asm index eb7cd72..f48bd10 100644 --- a/textproc.asm +++ b/textproc.asm @@ -1635,13 +1635,6 @@ FinishResultDisplay jmp TypeLine4x4 ; jsr:rts .endp -.proc TL4x4_empty - ;empty frame - mwa #LineEmpty LineAddress4x4 - mwa #((ScreenWidth/2)-(8*4)) LineXdraw - jmp TypeLine4x4 ; jsr:rts -.endp - .proc TL4x4_top ;bottom of the frame mwa #LineTop LineAddress4x4 @@ -1649,16 +1642,17 @@ FinishResultDisplay jmp TypeLine4x4 ; jsr:rts .endp +.proc TL4x4_empty + ;empty frame + mwa #LineEmpty LineAddress4x4 + mwa #((ScreenWidth/2)-(8*4)) LineXdraw + jmp TypeLine4x4 ; jsr:rts +.endp ;------------------------------------------------- .proc DisplayStatus ;------------------------------------------------- - ;lda noDeathCounter - ;sta decimal - ;mwa #textbuffer+80+37 displayposition - ;jsr displaybyte - ;--------------------- ;displaying symbol of the weapon ;--------------------- @@ -1762,7 +1756,6 @@ AngleDisplay mwa #textbuffer+40+21 displayposition jsr displaybyte - ;========================= ;display Wind ;========================= @@ -1793,8 +1786,9 @@ DisplayWindValue mwa #textbuffer+80+26 displayposition jsr displaybyte - + ;========================= ;display round number + ;========================= lda CurrentRoundNr sta decimal mwa #textbuffer+80+14 displayposition