diff --git a/README.md b/README.md index 9d665a6..408508c 100755 --- a/README.md +++ b/README.md @@ -8,14 +8,15 @@ by Tomasz 'Pecus' Pecko and Pawel 'pirx' Kalinowski Warsaw, Miami 2000, 2001, 2002, 2003, 2009, 2012, 2013, 2022 Contributors: -Kaz - splash screen, ideas -Adam - font, ideas -Emkay - splash screen music -Miker - game sfx, ideas -Bocianu - important ideas, FujiNet implementation +- Kaz - splash screen, ideas +- Miker (@mikerro) - game sfx, ideas, QA +- Adam (@6502adam) - font, ideas, QA +- Bocianu (@bocianu) - important ideas, FujiNet implementation, QA +- Emkay - splash screen music + +QA: Probabilitydragon, KrzysRog, Beeblebrox, EnderDude, lopezpb, Dracon, brad-colbert You can contact us at pecus@poczta.fm or pirx@5oft.pl -home page of this project is https://github.com/pkali/scorch_src This source code was originally compiled under [OMC65 crossassembler](https://github.com/pkali/omc65) and on 2012-06-21 translated to [mads](https://github.com/tebe6502/Mad-Assembler). @@ -31,12 +32,12 @@ Game source code is split into 5+4 parts: - display.asm - display lists and text screen definitions - ai.asm - artificial stupidity of computer opponents - weapons.asm - general arsenal of tankies -- definitions.asm - label definitions, moved to make it work better with Altirra debug. +- definitions.asm - label definitions, moved to make it work better with Altirra debug (it doesn't). -We were trying to use as much macros and pseudo-ops as possible. -They are defined in atari.hea and macro.hea files together with many atari constants. This way it should be relatively easy to port this code to e.g. C64 +We were trying to use macros, pseudo-ops and simple graphics primitives as much as possible. +This way it should be relatively easy to port this code to e.g. C64 -After those N years of working on this piece of code we are sure it would be much wiser to write it in C, Action! or MadPascal but on the other hand it is so much fun to type 150 chars where all you want to have y=ax+b :) +After those N years of working on this piece of code we are sure it would be much wiser to write it in C, Action! or MadPascal but on the other hand it is so much fun to type 150 chars where all you want to have y=a*x+b :) Originally most variables were in Polish, comments were sparse, but we wanted to release this piece of code to public. Because of being always short of time/energy (to finish the game) we decided it must go in 'English' to let other people work on it. @@ -46,6 +47,20 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin ## Changes: +###### Build 141 +2022-05-22 +Debug build. Thanks to all testers for finding numerous bugs. We tried to fix some of them and we have introduced some new for your enjoyment. +- #73 Fast forward. Press [START] to speed up the game where it can be sped up. Not in many places, mind you. +- #72 Screen glitches improved +- #70 AI shoot with more force than their energy allows. We might still have to revise this one +- #69 Explosions wrapping around the screen +- #67 Screen glitches after intro +- #65 Saved ~90 bytes by removing cosinus table +- #62 Empty list of defensive weapons gets corrupted. Plunged it with a new defensive weapon - "White Flag". Honor of the tank crew prohibits them from buying it (yet) +- #61 [SHIFT] was repeating the last key +- #57 Fire too sensitive on a real machine. Switched to shadow registers. First recorded use of Atari OS :O +- #55 Glitches in the status bar. This one was surprisingly tough. + ###### Build 140 2022-05-15 Huge internal changes by @Pecusx. The whole game screen has been inverted - ground is now background color, "sky" and empty areas are in fact pixels. This allowed for introducing better tank colorization, fully devised and lead by Adam. The process started and results are already promising - the colors of tanks and the status bar are closer. We might get even better ones in the next builds. @@ -58,7 +73,7 @@ Other unlisted minor bugs and typos fixed. ###### Build 139 2022-05-09 The post midnight release with great, heavy new features: -- https://github.com/pkali/scorch_src/issues/48, https://github.com/pkali/scorch_src/issues/10 - thanks to Miker we have a bunch of fresh sound effects. Not everything is perfectly implemented, but the game definitely got nicer! Thank you again Miker! +- https://github.com/pkali/scorch_src/issues/48, https://github.com/pkali/scorch_src/issues/10 - thanks to @mikerro we have a bunch of fresh sound effects. Not everything is perfectly implemented, but the game definitely got nicer! Thank you again Miker! - https://github.com/pkali/scorch_src/issues/42 New weapon - Liquid Dirt by Pecus. Try it from directly from the weapon store! - (fix) https://github.com/pkali/scorch_src/issues/53 - non-existing weapons are not displayed. This makes the defense menu empty when you are poor, but it is still better than the old way with "$0" prices - (fix) https://github.com/pkali/scorch_src/issues/49 - seppuku should always kill now @@ -100,7 +115,7 @@ Other small fixes: 2022-04-10 - https://github.com/pkali/scorch_src/issues/34 - plot pointer visible only when missile is out of the screen - https://github.com/pkali/scorch_src/issues/33 - Poor AIs do not purchase non-working weapons -- https://github.com/pkali/scorch_src/issues/32 - Basic is turned off right on the beginning of loading. Dracon reported problems with running the game in Altirra, this was the best idea I had about it. Maybe next will be removing from zero page LZSS routine by @dmsc +- https://github.com/pkali/scorch_src/issues/32 - Basic is turned off right on the beginning of loading. Dracon reported problems with running the game in Altirra, this was the best idea I had about it. Maybe next will be removing LZSS routine by @dmsc from zero page - https://github.com/pkali/scorch_src/issues/31 - STA WSYNC removed from missile flight delay - https://github.com/pkali/scorch_src/issues/30 - player level remembered between rounds, thx @KrzysRog - https://github.com/pkali/scorch_src/issues/5 - funkybomb smoke stays on the edges of the screen @@ -111,7 +126,7 @@ Other small fixes: - enhancement: https://github.com/pkali/scorch_src/issues/15 Add player colors to purchase screen. Still room to improvement! - enhancement: https://github.com/pkali/scorch_src/issues/22 Redesign information panel (top 2 lines of the game screen). Now game might make some sense for a newcomer :) - change: https://github.com/pkali/scorch_src/issues/28 remove white lines around out-of-the-screen point tracker. Now it is visible and looks better! -- enhancement: https://github.com/pkali/scorch_src/issues/25 Missiles are too fast. Thanks @bocianu and @miker for the hint. Speed of the shell is configurable now, 5 speeds available. +- enhancement: https://github.com/pkali/scorch_src/issues/25 Missiles are too fast. Thanks @bocianu and @mikerro for the hint. Speed of the shell is configurable now, 5 speeds available. - enhancement: https://github.com/pkali/scorch_src/issues/27 Remember game settings between games. - enhancement: https://github.com/pkali/scorch_src/issues/24 Remember player names between games. Thanks @bocianu diff --git a/ai.asm b/ai.asm index 1dd7530..1ce7645 100755 --- a/ai.asm +++ b/ai.asm @@ -126,7 +126,7 @@ forceNow jsr RandomizeForce endo - ldx TankNr ;this is possibly not necessary + ;ldx TankNr ;this is possibly not necessary lda NewAngle sta PreviousAngle,x lda EnergyTableL,x @@ -214,6 +214,7 @@ skipThisPlayer forceNow mwa #300 RandBoundaryLow mwa #700 RandBoundaryHigh + ldx TankNr jsr RandomizeForce endo diff --git a/artwork/HIMARS14.asm b/artwork/HIMARS14.asm index 12637ab..c658213 100644 --- a/artwork/HIMARS14.asm +++ b/artwork/HIMARS14.asm @@ -45,11 +45,16 @@ regX .ds 1 regY .ds 1 ; --- MAIN PROGRAM org $2000 -ant dta $F0 +ant dta $80 dta $42,a(scr),$02,$02,$02,$02,$02,$02,$02,$02,$02,$82,$02,$02,$02,$02,$82 - dta $02,$02,$02,$82,$82,$82,$02,$82,$02,$02,$02,$82,$70 + dta $02,$02,$02,$82,$82,$82,$02,$82,$02,$02,$02,$82 + dta $42,a(verline) dta $41,a(ant) +verline + :37 dta d" " + build + scr ins "HIMARS14.scr" .ds 2*40 @@ -202,6 +207,19 @@ main lda:cmp:req $14 ;wait 1 frame + ; copy system font to $a000 + ldx #0 +@ lda $e000,x + sta $a000,x + ;lda $e100,x ; i need digits only :] + ;sta $a100,x + ;lda $e200,x + ;sta $a200,x + ;lda $e300,x + ;sta $a300,x + inx + bne @- + sei ;stop IRQ interrupts mva #$00 nmien ;stop NMI interrupts sta dmactl @@ -249,6 +267,11 @@ stop @ sta POKEY,x dex bpl @- + + ;no glitching please (issue #67) + lda #0 + sta $D400 ;dmactl + sta $022F ;dmactls rts ;return to ... DOS ; --- DLI PROGRAM @@ -339,8 +362,10 @@ dli7 dli11 sta regA - lda #$01 + lda #>$a000 ; system font sta wsync ;line=232 + sta chbase + lda #$01 sta gtictl lda regA diff --git a/constants.asm b/constants.asm index 86aab93..752fecf 100644 --- a/constants.asm +++ b/constants.asm @@ -196,99 +196,6 @@ sintable .by 255 .by 255 ;anti self destruction byte -costable - .by 255 ;anti self destruction byte - .by 255 - .by 255 - .by 255 - .by 255 - .by 255 - .by 254 - .by 254 - .by 253 - .by 252 - .by 252 - .by 251 - .by 250 - .by 249 - .by 248 - .by 247 - .by 246 - .by 244 - .by 243 - .by 242 - .by 240 - .by 238 - .by 237 - .by 235 - .by 233 - .by 232 - .by 230 - .by 228 - .by 226 - .by 223 - .by 221 - .by 219 - .by 217 - .by 214 - .by 212 - .by 209 - .by 207 - .by 204 - .by 201 - .by 198 - .by 196 - .by 193 - .by 190 - .by 187 - .by 184 - .by 181 - .by 177 - .by 174 - .by 171 - .by 167 - .by 164 - .by 161 - .by 157 - .by 154 - .by 150 - .by 146 - .by 143 - .by 139 - .by 135 - .by 131 - .by 128 - .by 124 - .by 120 - .by 116 - .by 112 - .by 108 - .by 104 - .by 100 - .by 95 - .by 91 - .by 87 - .by 83 - .by 79 - .by 74 - .by 70 - .by 66 - .by 61 - .by 57 - .by 53 - .by 48 - .by 44 - .by 40 - .by 35 - .by 31 - .by 26 - .by 22 - .by 17 - .by 13 - .by 8 - .by 4 - .by 0 - linetableL :screenheight+1 .by <(display+screenBytes*#) linetableH @@ -705,7 +612,7 @@ WeaponPriceH ; weapons prices (tables with prices of weapons) .by >price_Auto_Defense___ .by >price_Fuel_Tank______ .by >price_Contact_Trigger - .by >price______________63 + .by >price_White_Flag_____ WeaponPriceL .by Force: 9999 " - dta d" Round: 99 Wind: <99> " + dta d"Energy: Angle: Force: " + dta d" Round: Wind: " textbuffer2 - dta d"Player: ******** Cash: 99990 " + dta d"Player: Cash: " dta d"----------------------------------------" diff --git a/grafproc.asm b/grafproc.asm index 85bce0f..ed75e20 100755 --- a/grafproc.asm +++ b/grafproc.asm @@ -441,7 +441,8 @@ splot8 .proc ;-------------------------------------------------- clearscreen .proc ;-------------------------------------------------- - lda #$ff ; INVERSE + + lda #$ff ldx #0 @ :31 sta display+($100*#),x @@ -629,7 +630,7 @@ DrawTankNrX rorw xbyte ; divide by 2 (carry does not matter) lda xbyte clc - adc #$24 ; P/M to graphics offser + adc #$24 ; P/M to graphics offset cpx #$4 ; 5th tank are joined missiles and offset is defferent bne NoMissile clc @@ -681,8 +682,11 @@ drawmountains .proc drawmountainsloop ldy #0 lda (modify),y + cmp #screenheight + beq NoMountain sta ydraw jsr DrawLine +NoMountain inw modify inw xdraw cpw xdraw #screenwidth @@ -941,14 +945,14 @@ EndDrawing ; **************************************************** ;-------------------------------------------------- calculatemountains0 .proc -; Only for testing - makes ground flat (one pixel) +; Only for testing - makes ground flat (0 pixels) ; and places tanks on it ; remember to remove in final compilation :) ;-------------------------------------------------- mwa #0 xdraw nextPointDrawing adw xdraw #mountaintable modify - lda #screenheight-1 + lda #screenheight ldy #0 sta (modify),y inw xdraw @@ -957,7 +961,7 @@ nextPointDrawing ldx NumberOfPlayers dex SetYofNextTank - lda #screenheight-2 + lda #screenheight-1 sta ytankstable,x dex bpl SetYofNextTank @@ -1021,7 +1025,7 @@ MakeUnPlot lda color - bne ClearUnPlot ; INVERSE + bne ClearUnPlot ;plotting here lda (xbyte),y @@ -1115,7 +1119,7 @@ MakePlot ldx ybit lda color - bne ClearPlot ; INVERSE + bne ClearPlot lda (xbyte),y ora bittable,x @@ -1163,7 +1167,7 @@ point .proc lda (xbyte),y and bittable,x - eor bittable,x ; INVERSE + eor bittable,x rts .endp @@ -1184,8 +1188,7 @@ DrawLine .proc loopdraw lda (xbyte),y - ;ora bittable,x - and bittable2,x ; INVERSE + and bittable2,x sta (xbyte),y IntoDraw adw xbyte #screenBytes @@ -1216,9 +1219,9 @@ TypeChar .proc ldy #7 CopyChar lda (fontind),y - eor #$ff ; INVERSE + eor #$ff sta char1,y - lda #$ff ; INVERSE + lda #$ff sta char2,y dey bpl CopyChar @@ -1227,9 +1230,9 @@ CopyChar ldy #7 CopyMask lda (fontind),y - eor #$ff ; INVERSE + eor #$ff sta mask1,y - lda #$00 ; INVERSE + lda #$00 sta mask2,y dey bpl CopyMask @@ -1261,44 +1264,44 @@ CopyMask ldx ybit beq MaskOK00 MakeMask00 - lsr mask1 ; INVERSE + lsr mask1 ror mask2 - lsr mask1+1 ; INVERSE + lsr mask1+1 ror mask2+1 - lsr mask1+2 ; INVERSE + lsr mask1+2 ror mask2+2 - lsr mask1+3 ; INVERSE + lsr mask1+3 ror mask2+3 - lsr mask1+4 ; INVERSE + lsr mask1+4 ror mask2+4 - lsr mask1+5 ; INVERSE + lsr mask1+5 ror mask2+5 - lsr mask1+6 ; INVERSE + lsr mask1+6 ror mask2+6 - lsr mask1+7 ; INVERSE + lsr mask1+7 ror mask2+7 - sec ; INVERSE + sec ror char1 ror char2 - sec ; INVERSE + sec ror char1+1 ror char2+1 - sec ; INVERSE + sec ror char1+2 ror char2+2 - sec ; INVERSE + sec ror char1+3 ror char2+3 - sec ; INVERSE + sec ror char1+4 ror char2+4 - sec ; INVERSE + sec ror char1+5 ror char2+5 - sec ; INVERSE + sec ror char1+6 ror char2+6 - sec ; INVERSE + sec ror char1+7 ror char2+7 dex @@ -1307,7 +1310,7 @@ MaskOK00 ; here x=0 lda Erase beq CharLoopi ; it works, because x=0 - lda #$ff ; INVERSE + lda #$ff ldx #7 EmptyChar sta char1,x @@ -1317,17 +1320,13 @@ EmptyChar ldx #0 CharLoopi lda (xbyte),y - ;and mask1,x - ;ora char1,x - ora mask1,x ; INVERSE - and char1,x ; INVERSE + ora mask1,x + and char1,x sta (xbyte),y iny lda (xbyte),y - ;and mask2,x - ;ora char2,x - ora mask2,x ; INVERSE - and char2,x ; INVERSE + ora mask2,x + and char2,x sta (xbyte),y dey adw xbyte #screenBytes diff --git a/lib/macro.hea b/lib/macro.hea index 2a73514..6181aa6 100644 --- a/lib/macro.hea +++ b/lib/macro.hea @@ -76,6 +76,9 @@ .MACRO WAIT ; WAIT ; waits one frame (1/50 s(PAL) or 1/60s(NTSC)) + lda CONSOL + cmp #6 ; START KEY + beq ?nowait LDA VCOUNT ldy vcount ?WA cpy VCOUNT @@ -83,6 +86,7 @@ ?wframe cmp vcount bne ?wframe +?nowait .ENDM ;------------------------------------- .macro negw diff --git a/scorch.asm b/scorch.asm index 8d07d88..371e832 100644 --- a/scorch.asm +++ b/scorch.asm @@ -36,7 +36,7 @@ ;we decided it must go in 'English' to let other people work on it .macro build - dta d"140" ; number of this build (3 bytes) + dta d"141" ; number of this build (3 bytes) .endm icl 'definitions.asm' @@ -117,40 +117,13 @@ START ; Startup sequence jsr Initialize - mwa #OptionsDL dlptrs - lda dmactls - and #$fc - ora #$02 ; normal screen width - sta dmactls - - VDLI DLIinterruptText.DLIinterruptNone ; jsr SetDLI for text screen without DLIs + jsr Options ;startup screen + lda escFlag + bne START - ;entering names of players - mwa #NameDL dlptrs - lda dmactls - and #$fc - ora #$01 ; narrow screen (32 chars) - sta dmactls - VDLI DLIinterruptText ; jsr SetDLI for text (names) screen - - mva #0 TankNr -@ tax - lda TankStatusColoursTable,x - sta colpf2s ; set color of player name line - jsr EnterPlayerName - inc TankNr - lda TankNr - cmp NumberOfPlayers - bne @- - - mwa #dl dlptrs - lda dmactls - and #$fc - ora #$02 ; normal screen width - sta dmactls - + jsr EnterPlayerNames jsr RandomizeSequence ; for the round #1 shooting sequence is random @@ -158,18 +131,20 @@ MainGameLoop VDLI DLIinterruptText ; jsr SetDLI for text (purchase) screen jsr CallPurchaseForEveryTank - - VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen - mwa #dl dlptrs + ; issue #72 (glitches when switches) + mva #0 dmactl lda dmactls and #$fc - ora #$02 ; 2=normal, 3 = wide screen width + ;ora #$02 ; 2=normal, 3 = wide screen width, 0 = no screen sta dmactls - + jsr GetRandomWind - jsr Round + jsr RoundInit + + jsr MainRoundLoop + mva #0 TankNr ; jsr SortSequence @@ -186,15 +161,7 @@ MainGameLoop ; Results are number of other deaths ; before the player dies itself - ; add gains and substract losses - ; gain is what player gets for lost energy of opponents - ; energy lost by opponents is added during Round and - ; little below in source, multiplied by 2 to get "dollars". - ; By analogy, loss is energy that given player losses during - ; each Round. - ; Important! If player has 10 energy and gets a central hit - ; from nuke that would take 90 energy points, his loss - ; is 90, not 10 + jsr DisplayResults ;check demo mode @@ -215,6 +182,16 @@ noKey ldx NumberOfPlayers dex CalculateGains + ; add gains and substract losses + ; gain is what player gets for lost energy of opponents + ; energy lost by opponents is added during Round and + ; little below in source, multiplied by 2 to get "dollars". + ; By analogy, loss is energy that given player losses during + ; each Round. + ; Important! If player has 10 energy and gets a central hit + ; from nuke that would take 90 energy points, his loss + ; is 90, not 10 + ; add gain * 2 asl gainL,x rol gainH,x @@ -255,13 +232,14 @@ skipzeroing lda GameIsOver jne START - inc CurrentRoundNr + mva #0 dmactl ; issue #72 + mva #sfx_silencer sfx_effect jmp MainGameLoop ;-------------------------------------------------- -Round .proc ; +.proc RoundInit ;-------------------------------------------------- ; at the beginning of each Round we set energy ; of all players to 99 @@ -270,7 +248,7 @@ Round .proc ; ; the shooting angle is randomized ; of course gains an looses are zeroed - jsr StatusDisplay + ;jsr StatusDisplay lda #0 tax @ @@ -292,20 +270,20 @@ SettingEnergies sta LASTeXistenZ,x ; anything in eXistenZ table means that this tank exist ; in the given round - lda #232 + lda #<1000 sta MaxEnergyTableL,x - lda #3 + lda #>1000 sta MaxEnergyTableH,x - lda #94 + lda #<350 sta EnergyTableL,x - lda #1 + lda #>350 sta EnergyTableH,x + ;lda #(255-45) ;it does not look good when all tanks have ;barrels pointing the same direction ;so it would be nice to have more or less random ;angles - jsr RandomizeAngle sta AngleTable,x @@ -319,18 +297,27 @@ SettingEnergies jsr PMoutofScreen ;let P/M disappear jsr clearscreen ;let the screen be clean jsr placetanks ;let the tanks be evenly placed - jsr calculatemountains ;let mountains be nice for the eye -; jsr calculatemountains0 ;only fort tests - makes mountains flat and one pixel height + jsr calculatemountains ;let mountains be easy for the eye + ;jsr calculatemountains0 ;only for tests - makes mountains flat and 0 height + + VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen + mwa #dl dlptrs ; issue #72 (glitches when switches) + lda dmactls + and #$fc + ora #$02 ; 2=normal, 3 = wide screen width + sta dmactls + + jsr drawmountains ;draw them jsr drawtanks ;finally draw tanks -.endp ; not really end of the procedure, but just for now. TODO: revisit. - -;--------------------round screen is ready--------- - mva #0 TankSequencePointer +;--------------------round screen is ready--------- + rts +.endp -MainRoundLoop +;-------------------------------------------------- +.proc MainRoundLoop ; here we must check if by a chance there is only one ; tank with energy greater than 0 left @@ -500,7 +487,6 @@ SeteXistenZ sta L1 ;DATA L1,L2 - ;RESULT WH*256+L1 ;Multiplication 8bit*8bit, ;result 16bit ;this algiorithm is a little longer than in Ruszczyc 6502 book @@ -514,7 +500,7 @@ LP0 ROR L1 BCC B0 CLC - ADC #10 ; multiplication by 10 + ADC #10 ; multiplication by 10 (L2) B0 DEY BNE LP0 ror @@ -536,10 +522,9 @@ B0 DEY inc:lda TankSequencePointer cmp NumberOfPlayers bne PlayersAgain - ;mva 0 TankNr mva #0 TankSequencePointer -PlayersAgain .proc +PlayersAgain ; In LASTeXistenZ there are values of eXistenZ before shoot ; from the next tank. @@ -570,20 +555,19 @@ NoPlayerNoDeath bpl CheckingPlayersDeath ; if processor is here it means there are no more explosions jmp MainRoundLoop - .endp +.endp ;--------------------------------- .proc Seppuku lda #0 sta FallDown1 sta FallDown2 - lda #1 + lda #1 ; Missile jsr ExplosionDirect - jmp continueMainRoundLoopAfterSeppuku + jmp MainRoundLoop.continueMainRoundLoopAfterSeppuku .endp ;--------------------------------- -PlayerXdeath .proc - +PlayerXdeath ; this tank should not explode anymore: ; there is 0 in A, and Tank Number in X, so... @@ -606,11 +590,9 @@ PlayerXdeath .proc adc ResultsTable,x sta ResultsTable,x inc CurrentResult - .endp mva #sfx_death_begin sfx_effect - ;RandomizeDeffensiveText randomize talk.NumberOfOffensiveTexts (talk.NumberOfDeffensiveTexts+talk.NumberOfOffensiveTexts-1) sta TextNumberOff @@ -664,7 +646,7 @@ MetodOfDeath tay lda weaponsOfDeath,y jsr ExplosionDirect - mva #$15 sfx_effect + mva #sfx_silencer sfx_effect ; jump to after explosion routines (soil fallout, etc.) @@ -673,10 +655,10 @@ MetodOfDeath ; a deadly shot here again. - jmp AfterExplode + jmp MainRoundLoop.AfterExplode ;-------------------------------------------------- -DecreaseEnergyX .proc +.proc DecreaseEnergyX ;Decreases energy of player nr X ;increases his financial loss ;increases gain of tank TankNr @@ -762,7 +744,7 @@ loop05 .endp ;-------------------------------------------------- -Initialize .proc +.proc Initialize ;Initialization sequence ;-------------------------------------------------- deletePtr = temp @@ -771,7 +753,7 @@ deletePtr = temp sta Erase sta tracerflag sta GameIsOver - + sta escFlag ; clean variables tay @@ -803,7 +785,7 @@ SetunPlots sta oldplotH,x lda #0 sta oldply,x - lda #$ff ; INVERSE + lda #$ff sta oldora,x dex bpl SetunPlots @@ -883,7 +865,6 @@ DLIinterruptGraph .proc nop nop nop -; sta WSYNC sta COLPF1 sty COLPF2 inc dliCounter @@ -1042,7 +1023,7 @@ EnergyInRange .endp ;---------------------------------------------- -MoveBarrelToNewPosition .proc +.proc MoveBarrelToNewPosition jsr DrawTankNr ldx TankNr lda AngleTable,x @@ -1077,7 +1058,7 @@ BarrelPositionIsFine .endp ;---------------------------------------------- -SortSequence .proc ; +.proc SortSequence ; ;---------------------------------------------- ; here we try to get a sequence of tanks for two ; purposes: @@ -1165,18 +1146,23 @@ nextishigher .endp ;-------------------------------------------------- -getkey .proc; waits for pressing a key and returns pressed value in A +.proc getkey ; waits for pressing a key and returns pressed value in A ;-------------------------------------------------- jsr WaitForKeyRelease @ lda SKSTAT cmp #$ff beq checkJoyGetKey ; key not pressed, check Joy + cmp #$f7 ; SHIFT + beq checkJoyGetKey - mva #sfx_keyclick sfx_effect lda kbcode and #$3f ;CTRL and SHIFT ellimination - rts + cmp #28 ; ESC + bne getkeyend + mvx #1 escFlag + bne getkeyend + checkJoyGetKey ;------------JOY------------- ;happy happy joy joy @@ -1187,13 +1173,19 @@ checkJoyGetKey beq notpressedJoyGetKey tay lda joyToKeyTable,y - rts + bne getkeyend + notpressedJoyGetKey ;fire lda TRIG0S bne @- lda #$0c ;Return key + +getkeyend + mvx #sfx_keyclick sfx_effect rts + + .endp ;-------------------------------------------------- getkeynowait .proc; diff --git a/scorch.xex b/scorch.xex index 9b982d5..7335a42 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 54f3710..b03107d 100755 --- a/textproc.asm +++ b/textproc.asm @@ -16,13 +16,24 @@ Options .proc ; - money each player has on the beginning of the game (moneyL i moneyH) ; - and I am sure maxwind, gravity, no_of_rounds in a game, speed of shell flight + mwa #OptionsDL dlptrs + lda dmactls + and #$fc + ora #$02 ; normal screen width + sta dmactls + + VDLI DLIinterruptText.DLIinterruptNone ; jsr SetDLI for text screen without DLIs + mva #0 OptionsY OptionsMainLoop jsr OptionsInversion jsr getkey - cmp #$f ;cursor down + ldx escFlag + seq:rts + + cmp #$f ;cursor down bne OptionsNoDown inc:lda OptionsY cmp #maxoptions @@ -190,6 +201,7 @@ OptionsYLoop ;------------------------------------------- ; call of the purchase screens for each tank .proc CallPurchaseForEveryTank + jsr PMoutofScreen mwa #PurchaseDL dlptrs lda dmactls and #$fc @@ -197,21 +209,20 @@ OptionsYLoop sta dmactls mva #0 TankNr -loop03 - ldx TankNr - lda SkillTable,x - beq ManualPurchase - jsr PurchaseAI - jmp AfterManualPurchase +@ + ldx TankNr + lda SkillTable,x + beq ManualPurchase + jsr PurchaseAI + jmp AfterManualPurchase ManualPurchase - jsr Purchase + jsr Purchase AfterManualPurchase - inc TankNr - lda TankNr - cmp NumberOfPlayers - bne loop03 + inc:lda TankNr + cmp NumberOfPlayers + bne @- rts .endp @@ -223,9 +234,7 @@ AfterManualPurchase ; Rest of the data is taken from appropriate tables ; and during the purchase these tables are modified. - mwa #ListOfWeapons WeaponsListDL ;switch to the list of offensive weapons - jsr PMoutofScreen ldx tankNr lda TankStatusColoursTable,x @@ -238,12 +247,9 @@ AfterManualPurchase ; there is a tank (player) number in tanknr ; we are displaying name of the player - - tay ; from 0 to y + tay ; 0 to y lda tanknr - asl - asl - asl ; 8 chars per name + :3 asl ; 8 chars per name tax NextChar03 lda tanksnames,x @@ -553,16 +559,17 @@ ChoosingItemForPurchase cmp #$2c ; Tab jeq ListChange cmp #$0c ; Return - beq EndOfPurchase + sne:rts cmp #$e beq PurchaseKeyUp cmp #$f beq PurchaseKeyDown cmp #$21 ; Space + jeq PurchaseWeaponNow + cmp #$07 ; cursor right + jeq PurchaseWeaponNow bne ChoosingItemForPurchase - jmp PurchaseWeaponNow -EndOfPurchase - rts + PurchaseKeyUp lda WhichList beq GoUp1 @@ -816,6 +823,29 @@ NoArrowDown rts .endp ; ----------------------------------------------------- +.proc EnterPlayerNames + ;entering names of players + mwa #NameDL dlptrs + lda dmactls + and #$fc + ora #$01 ; narrow screen (32 chars) + sta dmactls + VDLI DLIinterruptText ; jsr SetDLI for text (names) screen + + mva #0 TankNr +@ tax + lda TankStatusColoursTable,x + sta colpf2s ; set color of player name line + jsr EnterPlayerName + lda escFlag + jne START + inc TankNr + lda TankNr + cmp NumberOfPlayers + bne @- + rts +.endp +; ----------------------------------------------------- .proc EnterPlayerName ; in: TankNr ; Out: TanksNames, SkillTable @@ -867,6 +897,9 @@ endOfTankName CheckKeys jsr getkey + ldx escFlag + seq:rts + ; is the char to be recorded? ldx #keycodesEnd-keycodes ;table was 38 chars long IsLetter @@ -1583,15 +1616,6 @@ FinishResultDisplay lda WeaponSymbols,y sta TextBuffer+18 - ;--------------------- - ;displaying the energy of a tank - ;--------------------- - - lda Energy,x - - sta decimal - mwa #textbuffer+48 displayposition - jsr displaybyte ;--------------------- ;displaying quantity of the given weapon ;--------------------- @@ -1610,20 +1634,31 @@ FinishResultDisplay sta temp ;get back number of the weapon mva #0 temp+1 ; times 16 (because this is length of weapon name) - ldy #3 ; rotate 4 times -RotateDISP02 - aslw temp - dey - bpl RotateDISP02 + ldy #3 ; shift left 4 times +@ + aslw temp + dey + bpl @- + adw temp #NamesOfWeapons ldy #6 ; from 6th character ldy #15 -loop06 - lda (temp),y - sta textbuffer+23,y - dey - bpl loop06 +@ + lda (temp),y + sta textbuffer+23,y + dey + bpl @- + + ;--------------------- + ;displaying the energy of a tank + ;--------------------- + + lda Energy,x + + sta decimal + mwa #textbuffer+48 displayposition + jsr displaybyte ;========================= ;display Force diff --git a/variables.asm b/variables.asm index e9ae432..2f570b9 100755 --- a/variables.asm +++ b/variables.asm @@ -33,6 +33,7 @@ RoundNrDisplay .byte $ff variablesStart ; zeroing starts here +escFlag .ds 1 ;-------------- sfx_effect .ds 1 ;-------------- diff --git a/weapons.asm b/weapons.asm index 21fedbe..64d7f19 100755 --- a/weapons.asm +++ b/weapons.asm @@ -50,7 +50,7 @@ ExplosionRoutines .word dirtclod-1 .word dirtball-1 .word tonofdirt-1 - .word liquiddirt-1 ;liquiddirt + .word liquiddirt-1 .word dirtcharge-1 .word VOID-1 ;earthdisrupter .word VOID-1 ;plasmablast @@ -753,7 +753,7 @@ UpNotYet beq HowMuchToFallRight2 .nowarn dew xdraw lda xdraw - bne RollinContinues ; like cpw xdraw #0 + jne RollinContinues ; like cpw xdraw #0 lda xdraw+1 jne RollinContinues beq ExplodeNow @@ -1011,7 +1011,7 @@ notpressed lda SKSTAT cmp #$ff beq checkJoy - cmp #$f7 + cmp #$f7 ; SHIFT beq checkJoy lda kbcode @@ -1274,7 +1274,7 @@ AfterStrongShoot ;-------------------------------------------------- -TankFalls .proc; +.proc TankFalls; ;-------------------------------------------------- mva #sfx_shield_off sfx_effect lda #0 @@ -1629,8 +1629,11 @@ DoNotAdd sta Result+1 sta Result+2 ;-- - ldx Angle - lda costable,x + lda #90 + sec + sbc Angle + tax + lda sintable,x sta Multiplee ;cos(Angle)*Force mwa Force Multiplier @@ -1816,17 +1819,19 @@ NoUnPlot Hit mwa XHit xdraw - mwa YHit ydraw + mva YHit ydraw ; one byte now jsr unPlot EndOfFlight - mwa xdraw xcircle ; we must store for a little while - mva ydraw ycircle ; xdraw and ydraw +; mwa xdraw xcircle ; we must store for a little while +; mva ydraw ycircle ; xdraw and ydraw .... but this values are in YHit and XHit !!! mwa #0 xdraw mva #screenheight-1 ydraw jsr unPlot - mwa xcircle xdraw - mva ycircle ydraw +; mwa xcircle xdraw +; mva ycircle ydraw + mwa XHit xdraw + mva YHit ydraw ldy SmokeTracerFlag beq EndOfFlight2 @@ -2375,6 +2380,9 @@ HowManyBullets .proc ;-------------------------------------------------- ShellDelay .proc + lda CONSOL + cmp #6 + beq noShellDelay ldx flyDelay DelayLoop lda VCOUNT @@ -2382,6 +2390,7 @@ DelayLoop beq @- dex bne DelayLoop +noShellDelay rts .endp