diff --git a/README.md b/README.md index 796b65a..e2ae151 100755 --- a/README.md +++ b/README.md @@ -26,26 +26,26 @@ Game source code is split into 5+3 parts: - weapons.asm - general arsenal of tankies 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 +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 -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=ax+b :) -Originally most variables were in Polish, comments were sparse -but we wanted to release this piece of code to public -and due to being always short of time/energy (to finish the game) -we decided it must go in 'English' to let other people work on it. -It never happened, but we got some encouraging comments and we are still -trying to do something from time to time. +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. +It never happened, but we got some encouraging comments and we are still trying to do something from time to time. With the advent of fujinet (https://fujinet.online/) we are thinking about making the game interplanetary, err, with multiplayer over the net. We'll see. ## Changes: +###### Build 135 +2022-04-17 +Happy Easter! This is a "premature ejacu.." err... "premature optimization" build. I got into an optimization fewer and got the code messed up, having to revert to the base. One important ticket closed: +- https://github.com/pkali/scorch_src/issues/35 Two morons shooting each other for more than 5 minutes. Added a new option "Seppuku". It causes one of the tanks ashamed with their inefficiency to detonate the weapon on itself. This was quite a difficult addition, requiring me to understand large swaths of the code, always a great challenge. Smoother gameplay with AIs guaranteed or money back. +Other small fixes: +- https://github.com/pkali/scorch_src/issues/23 High flying MIRV leaves traces. Not anymore. +- https://github.com/pkali/scorch_src/issues/12 Make soil fall down faster after soil eating weapons. Soil eating range is OK, it is the soil down routine that is slow (but visually attractive). + ###### Build 134 2022-04-10 - https://github.com/pkali/scorch_src/issues/34 - plot pointer visible only when missile is out of the screen @@ -53,6 +53,7 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin - 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/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 ###### Build 133 2022-04-03 @@ -106,12 +107,10 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin - fixed bug 015 (Only first shoot of FunkyBomb is correct - fixed bug 016 (No falling soil after leapfrog) - ##### Build 125 2022-01-23 - included splash screen by KAZ - ##### Build 124 2013-12-21 - removed large chunk of redundant 4x4 print code and table generation code, @@ -162,7 +161,7 @@ MISSING UPDATE INFORMATION... POSSIBLY NOTHING IMPORTANT HAPPENED HERE. - fixed bug 001 (lack of explosions on the empty ground) - fixed bug 003 (wrapping death's head explosions) - fixed plot (faster explosions) -- fukk, just 6 years and we are back!!! This game is pretty addictive :) +- fokk, just 6 years and we are back!!! This game is pretty addictive :) TO DO: - send our wives and kids away much more often :)))) @@ -201,7 +200,6 @@ textproc.s65 SHORTSYS.S65 - new macro PAUSE (waits given number of frames) - ##### Build 112 2003-08-15 @@ -238,4 +236,4 @@ variables.s65 grafproc.s65 - shorter delay during Flight -...older history missing... \ No newline at end of file +...transmission error...former history missing... \ No newline at end of file diff --git a/artwork/TALK1.txt b/artwork/TALK1.txt index 6606cbe..2ca9011 100755 --- a/artwork/TALK1.txt +++ b/artwork/TALK1.txt @@ -45,7 +45,7 @@ THIS IS YOUR BRAIN ON SCORCH. TAKE THIS! THIS SCREEN AIN'T BIG ENOUGH FOR THE BOTH OF US. DIE, ALIEN SWINE! -SAY "ARRGGHHHHH...." +SAY 'ARRGGHHHHH....' I SHALL OIL MY TURRET WITH YOUR BLOOD. DIE, TANK-SCUM! I'M GONNA BREAK YOUR FACE! diff --git a/constants.asm b/constants.asm index bb2308c..eeee2cb 100644 --- a/constants.asm +++ b/constants.asm @@ -13,7 +13,8 @@ CashOptionH GravityTable .by 10,20,25,30,40 MaxWindTable .by 5,20,40,60,80 RoundsTable .by 10,20,30,40,50 -flyDelayTable .by 255,150,75,35,1 +flyDelayTable .by 255,150,75,35,1 +seppukuTable .by 255, 45,25,15,9 ;------------------------------------------------ LevelNameBeginL ; begins of level names @@ -30,9 +31,7 @@ TanksWeaponsTableL TanksWeaponsTableH .by >TanksWeapon1,>TanksWeapon2,>TanksWeapon3,>TanksWeapon4,>TanksWeapon5,>TanksWeapon6 ;-----4x4 texts----- -ResultLineBuffer - dta d" " - .byte $ff + LineTop dta d"(%%%%%%%%%%%%)" .byte $ff @@ -54,6 +53,13 @@ LineHeader2 LineGameOver dta d"# GAME OVER #" .byte $ff +seppukuText + dta d"# SEPPUKU! #" + .byte $ff +lineClear + dta d" " + .byte $ff + ;----------- pmtableL ; addressess of the P/M memory for 5 tanks (6th is without P/M background) @@ -1038,7 +1044,7 @@ joyToKeyTable .by $ff,$ff,$ff,$ff,$ff,$ff,$ff,$07,$ff,$ff,$ff,$06,$ff,$0f,$0e,$ff ;----------------------------------- -keycodes ;tables for calculating KeyCode to Screen Code (38 -1 characters) +keycodes ;tables for converting KeyCode to Screen Code (38 -1 characters) .by $3f,$15,$12,$3a,$2a,$38,$3d,$39 .by $0d,$01,$05,$00,$25,$23,$08,$0a .by $2f,$28,$3e,$2d,$0b,$10,$2e,$16 diff --git a/display.asm b/display.asm index d2244ef..6639b3b 100755 --- a/display.asm +++ b/display.asm @@ -30,7 +30,7 @@ OptionsDL .byte $42 .word OptionsScreen .byte $30,$02,$02,$70 - :maxOptions .by $02,0 + :maxOptions .by $02,$10 .byte $41 .word OptionsDL ;------------------------ @@ -60,24 +60,25 @@ dl ; MAIN game display list .by $0f .by $4f .wo display+$0ff0 - :97 .byte $0f + :100 .byte $0f ;97 .byte $41 .word dl ;----------------------------------------------- ;Screen displays go first to avoid crossing 4kb barrier ;----------------------------------------------- OptionsScreen - dta d"Welcome to Scorch ver. 134 (un)2000-2022" + dta d"Welcome to Scorch ver. 135 (un)2000-2022" dta d" Please select option with cursor keys " dta d" and press (Return) to proceed " OptionsHere ; 0123456789012345678901234567890123456789 - dta d"Players : 2 3 4 5 6 " - dta d"Cash : none 2K 5K 8K 10K " - dta d"Gravity : 0.2G 0.5G 1G 2G 4G " - dta d"Wind : 1B 3B 5B 7B 9B " - dta d"Rounds : 10 20 30 40 50 " - dta d"Shells : slug slow norm fast hare " + dta d"Players : 2 3 4 5 6 " + dta d"Cash : none 2K 5K 8K 10K " + dta d"Gravity : 0.2G 0.5G 1G 2G 4G " + dta d"Wind : 1B 3B 5B 7B 9B " + dta d"Rounds : 10 20 30 40 50 " + dta d"Missiles : slug slow norm fast hare " + dta d"Seppuku : nevr rare norm oftn alws " OptionsScreenEnd ; ------------------------------------------------- NameScreen diff --git a/grafproc.asm b/grafproc.asm index 095e20c..03b7b88 100755 --- a/grafproc.asm +++ b/grafproc.asm @@ -1409,8 +1409,6 @@ PutChar4x4FULL .proc; ;but this time all pixels are being drawn ;(empty and not empty) ;-------------------------------------------------- - lda plot4x4color - sta color ; calculating address of the first byte mva #4 LoopCounter4x4 @@ -1461,7 +1459,7 @@ Loop4x4ContinuedFULL ; here we have on screen one line of the char inw ydraw sbw xdraw #4 - sbw y4x4 #32 + sbw y4x4 #32 ; why? possibly because of width of the 4x4 font dec:lda LoopCounter4x4 bne nextline4x4FULL diff --git a/scorch.asm b/scorch.asm index 8b1aa03..23a1a25 100644 --- a/scorch.asm +++ b/scorch.asm @@ -79,7 +79,7 @@ screenwidth = screenBytes*8 ; Max screenwidth = 512!!! margin = 48 ;mountain drawing Y variable margin display = $1010 ;screen takes $2K due to clearing routine MaxPlayers = 6 -maxOptions = 6 ;number of all options +maxOptions = 7 ;number of all options PMOffset = $23 ; P/M to graphics offset icl 'lib/atari.hea' @@ -247,7 +247,7 @@ Round .proc ; ; the default shooting angle to 45 degrees ; of course gains an looses are zeroed - jsr DisplayingSymbols + jsr StatusDisplay lda #0 tax @ @@ -310,7 +310,7 @@ MainRoundLoop ; here we must check if by a chance there is only one ; tank with energy greater than 0 left - ldy #0 ; number of tanks with energy greater than zero + ldy #0 ; in Y - number of tanks with energy greater than zero ldx NumberOfPlayers dex CheckingIfRoundIsFinished @@ -337,7 +337,7 @@ WhichTankWonLoop ; 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, it you know what I mean) + ; (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. @@ -355,8 +355,22 @@ ThisOneWon rts ; this Round is finished DoNotFinishTheRound - ;ldx TankNr + ; Seppuku here + lda noDeathCounter + cmp seppukuVal + bcc @+ + + mva #0 noDeathCounter + + jsr DisplaySeppuku + + jmp Seppuku + + + + ;ldx TankNr +@ ldx TankSequencePointer lda TankSequence,x sta TankNr @@ -373,10 +387,11 @@ DoNotFinishTheRound lda SkillTable,x beq ManualShooting +RoboTanks ; robotanks shoot here jsr ArtificialIntelligence jsr MoveBarrelToNewPosition - jsr DisplayingSymbols ;all digital values like force, angle, wind, etc. + jsr StatusDisplay ;all digital values like force, angle, wind, etc. jsr PutTankNameOnScreen ; let's move the tank's barrel so it points the right ; direction @@ -388,17 +403,20 @@ ManualShooting jsr BeforeFire AfterManualShooting + inc noDeathCounter + jsr DecreaseWeaponBeforeShoot - jsr DisplayingSymbols + jsr StatusDisplay ldx TankNr dec Energy,x ; lower energy to eventually let tanks commit suicide - lda ActiveWeapon,x +ShootNow jsr Shoot lda HitFlag ;0 if missed beq missed +Seppuku lda #0 sta FallDown1 sta FallDown2 @@ -532,13 +550,18 @@ NoPlayerNoDeath .endp ;--------------------------------- PlayerXdeath .proc - ; first we inform that this tank should not explode anymore: - ; there is 0 in A, and Tank Number in X, so... + + ; this tank should not explode anymore: + ; there is 0 in A, and Tank Number in X, so... sta LASTeXistenZ,x ; save x somewhere stx TankTempY + ;clear NoDeathCounter here + sta noDeathCounter + + ; display defensive text here (well, defensive ; is not the real meaning, it should be pre-death, ; but I am too lazy to change names of variables) @@ -659,10 +682,7 @@ GetRandomWind .proc sta Wind mva #$00 Wind+1 ; multiply Wind by 16 and take it as a decimal part (0.Wind) - aslw Wind - aslw Wind - aslw Wind - aslw Wind + :4 aslw Wind lda random and #$01 sta WindOrientation @@ -673,14 +693,7 @@ GetRandomWind .proc PMoutofScreen .proc ;-------------------------------------------------- lda #$00 ; let all P/M disappear - sta hposp0 - sta hposp0+1 - sta hposp0+2 - sta hposp0+3 - sta hposp0+4 - sta hposp0+5 - sta hposp0+6 - sta hposp0+7 + :8 sta hposp0+# rts .endp diff --git a/scorch.xex b/scorch.xex index 87d5dbc..db52fce 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index c802281..65dd597 100755 --- a/textproc.asm +++ b/textproc.asm @@ -108,6 +108,11 @@ OptionsFinished lda flyDelayTable,y sta flyDelay + ;7th option (Airstrike after how many missess) + ldy OptionsTable+6 + lda seppukuTable,y + sta seppukuVal + rts ;-------- ; inversing selected option (cursor) @@ -136,7 +141,7 @@ OptionsSetMainLoop asl adc OptionsTable,x ;OptionsTable value * 5 tay - ldx #MaxOptions-1 + ldx #6-1 ; width of the highlight bar (6 chars) OptionSetLoop lda (temp),y ora #$80 @@ -170,7 +175,7 @@ OptionSetLoop ;in temp is 40*OptionsY adw temp #OptionsHere ;now in temp is adres of the line to be inversed - ldy #7 ;8 letters to invers + ldy #8 ;9 letters to invers OptionsYLoop lda (temp),y ora #$80 @@ -1324,6 +1329,64 @@ EndOfTypeLine4x4 rts .endp + +;-------------------------------- +.proc DisplaySeppuku +;using 4x4 font + + ;save vars (messed in TypeLine4x4) + mwa Xdraw xk + mva Ydraw yc + + mva #15 fs ; temp, how many times blink the billboard +@ + lda fs + and #$01 + sta plot4x4color + mva #4 ResultY ; where seppuku text starts Y-wise on the screen + + ;top frame + mwa #LineTop LineAddress4x4 + mwa #((ScreenWidth/2)-(8*4)) LineXdraw ; centering + mva ResultY LineYdraw + jsr TypeLine4x4 + adb ResultY #4 ;next line + + ;seppuku + mwa #seppukuText LineAddress4x4 + mwa #((ScreenWidth/2)-(8*4)) LineXdraw ; centering + mva ResultY LineYdraw + jsr TypeLine4x4 + adb ResultY #4 ;next line + + ;bottom frame + mwa #LineBottom LineAddress4x4 + mwa #((ScreenWidth/2)-(8*4)) LineXdraw ; centering + mva ResultY LineYdraw + jsr TypeLine4x4 + + dec fs + bne @- + + ;clean seppuku + mva #3 fs + mva #4 ResultY +@ + mva #1 plot4x4color + mwa #lineClear LineAddress4x4 + mwa #((ScreenWidth/2)-(8*4)) LineXdraw ; centering + mva ResultY LineYdraw + jsr TypeLine4x4 + adb ResultY #4 ;next line + + dec fs + bne @- + + ;restore vars + mva yc Ydraw + mwa xk Xdraw + rts +.endp ;-------------------------------- .proc DisplayResults ; ;displays results of the round @@ -1496,9 +1559,14 @@ FinishResultDisplay .endp ;------------------------------------------------- -.proc DisplayingSymbols +.proc StatusDisplay ;------------------------------------------------- + ;lda noDeathCounter + ;sta decimal + ;mwa #textbuffer+80+37 displayposition + ;jsr displaybyte + ;--------------------- ;displaying symbol of the weapon ;--------------------- @@ -1506,10 +1574,7 @@ FinishResultDisplay ;textbuffer+18 - symbol (1 char) ;textbuffer+20 - quantity left ;textbuffer+23 - name - - - - ;ldx TankNr + ldx TankNr ldy ActiveWeapon,x lda WeaponSymbols,y sta TextBuffer+18 diff --git a/variables.asm b/variables.asm index f4996e9..f324376 100755 --- a/variables.asm +++ b/variables.asm @@ -15,17 +15,24 @@ TanksNames ; DO NOT ZERO - ticket #24 :6 dta d" " ;---------------------------- ;Options DO NOT ZERO - ticket #27 -OptionsTable .by 0,0,2,2,0,1 +OptionsTable .by 0,0,2,2,0,1,4 RoundsInTheGame .by 10 ;how many rounds in the current game +seppukuVal .by 75 ;-------------------------------------------------- skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning, ticket #30) .DS [MaxPlayers] ;----------------------------------- +; 4x4 text buffer +ResultLineBuffer + dta d" " + .byte $ff variablesStart ; zeroing starts here +;-------------- +noDeathCounter .ds 1 ;-------------- -OptionsY .ds 0 ;vertical position of cursor on Options screen +OptionsY .ds 1 ;vertical position of cursor on Options screen flyDelay .ds 1 ;-------------- NumberOfPlayers .DS 1 ;current number of players (counted from 1) @@ -307,7 +314,7 @@ mountaintable2 ;table of mountains (size=screenwidth) .DS 1 ; additional byte for fallout (sometimes 1 pixel) mountaintable3 .ds [screenwidth] - .ds 0 ; additional byte for fallout (sometimes 1 pixel) + .ds 1 ; additional byte for fallout (sometimes 1 pixel) MountaintableEnd ;good for table clearing ;---------------------------------------------- TextPositionX .DS 2 diff --git a/weapons.asm b/weapons.asm index ee989b4..de096dc 100755 --- a/weapons.asm +++ b/weapons.asm @@ -864,7 +864,7 @@ ContinueToCheckMaxForce2 lda MaxEnergyTableL,x sta EnergyTableL,x @ - jsr DisplayingSymbols ;all digital values like force, angle, wind, etc. + jsr StatusDisplay ;all digital values like force, angle, wind, etc. jsr PutTankNameOnScreen jsr DrawTankNr @@ -1130,8 +1130,6 @@ AfterStrongShoot sbc #0 sta ytraj+2 - ldy #100 - jsr Flight mva #1 color rts @@ -1697,8 +1695,7 @@ EndOfFlight sty SmokeTracerFlag jmp SecondFlight EndOfFlight2 - lda #0 ; nie wiem czemu - sta tracerflag ; + mva #0 tracerflag ; don't know why rts .endp @@ -1746,8 +1743,9 @@ SecondFlight .proc sta ytraj+2 ldy #100 - lda #1 ; I do not know (I mean I think I know ;) ) - sta tracerflag ; 10 years later - I do not know!!! + mva #1 tracerflag ; I do not know (I mean I think I know ;) ) + ; 10 years later - I do not know!!! + ; 20 years later - still do not know :] jmp Flight.RepeatIfSmokeTracer .endp