diff --git a/README.md b/README.md index 3342a3b..465379c 100755 --- a/README.md +++ b/README.md @@ -32,10 +32,19 @@ where 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 +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 127 +2022-02-19 +- fixed a bug making it harder to select AI level, unfortunately now player names can not include hyphen +- fixed numerous mistakes in handling bytes and words - possibly some of the crashes eliminated +- adw addr #1 --> inw addr. 200 bytes shorter code (and maybe very slightly faster) ###### Build 127 2022-02-14 diff --git a/TODO.txt b/TODO.txt index a623349..577d436 100755 --- a/TODO.txt +++ b/TODO.txt @@ -36,6 +36,10 @@ Known bugs (+ means bug is fixed) -018: MINOR: ydraw, yhit, ybyte variable is sometimes treated as WORD, sometimes as BYTE. Making it consistent would save both time and space (not much) REJECTED: too much work - different routines depend on checking high byte. ++019: AI menu does not recognize keyboard up (prints "-" in tank name) +020: sometimes leftmost or rightmost remains of the funkybomb smoke do not get cleared +021: check MWA, ADW, SBW macros - bad modifications of bytes found!!! +022: shooting funkybomb decreases number of bombs too much! (2 instead of 1?) --------------------------------------------------------- To do +001. Start each round with a)worst tank or b)random tank @@ -65,3 +69,7 @@ To do -017. Wide screen mode (with scroll?) 018. Speed up soil down after soil eating weapons - correctly calculate ranges as now range is very broad even when very little soil is eaten. +019. Purchase impossible with joystick only. Add buy on e.g. joystick right. +020. Not a bug per se, but ydraw variable is word, possibly it can be switched to byte +021. Add player colors to purchase screen +022. Make colors more contrasting diff --git a/display.asm b/display.asm index 47f8b77..acd2ff3 100755 --- a/display.asm +++ b/display.asm @@ -77,7 +77,7 @@ PlotLine = display + screenHeight*screenBytes ; the last line is plot pointer ;Screen displays go first to avoid crossing 4kb barrier ;----------------------------------------------- OptionsScreen - dta d"Welcome to Scorch ver. 127 (un)2000-2022" + dta d"Welcome to Scorch ver. 128 (un)2000-2022" dta d" Please select option with cursor keys " dta d" and press (Return) to proceed " OptionsHere diff --git a/grafproc.asm b/grafproc.asm index 7ebb578..115a4fd 100755 --- a/grafproc.asm +++ b/grafproc.asm @@ -113,7 +113,7 @@ CheckDirectionFactor ; 'a' factor is fire, so we copy parameters ; XK=DX mwa DX XK - ; i kasowanie bitu 2 + ; and clearing bit 2 ; and bit 2 clear ; (is not needed because already cleared) ;lda HowToDraw @@ -168,7 +168,7 @@ DrawLoop ; DI=DI+DD ; YI=YI+1 adw DI DD - adw YI #1 + inw YI jmp drplot DINegative ; ELSE @@ -219,7 +219,7 @@ PutPixelinDraw ; XI=XI+1 ; UNTIL XI=XK - adw XI #1 + inw XI cpw XI XK jne DrawLoop @@ -234,7 +234,7 @@ DrawJumpPad Drawplot jmp plot DrawLen - adw LineLength #1 + inw LineLength rts DrawCheck .proc @@ -729,8 +729,8 @@ drawmountainsloop lda (modify),y sta ydraw jsr DrawLine - adw modify #1 - adw xdraw #1 + inw modify + inw xdraw cpw xdraw #screenwidth bne drawmountainsloop @@ -747,8 +747,8 @@ drawmountainspixelloop lda (modify),y sta ydraw jsr plot - adw modify #1 - adw xdraw #1 + inw modify + inw xdraw cpw xdraw #screenwidth bne drawmountainspixelloop @@ -807,9 +807,9 @@ StillNothing cmp #screenheight bne NextPoint1 FoundPeek1 - adw tempor2 #1 - adw tempor3 #1 - adw xdraw #1 + inw tempor2 + inw tempor3 + inw xdraw ;vcmp xdraw,screenwidth,NextColumn1 cpw xdraw RangeRight bcc NextColumn1 @@ -823,7 +823,7 @@ MainFallout2 adw RangeLeft #mountaintable2 tempor2 adw RangeLeft #mountaintable3 tempor3 - mwa #1 IsEndOfTheFallFlag + mva #1 IsEndOfTheFallFlag FalloutOfLine ldy #0 @@ -860,10 +860,10 @@ FalloutOfLine ThereIsPixelHere ColumnIsReady - adw temp #1 - adw tempor2 #1 - adw tempor3 #1 - adw xdraw #1 + inw temp + inw tempor2 + inw tempor3 + inw xdraw ;vcmp xdraw,screenwidth,FalloutOfLine cpw xdraw RangeRight bcc FalloutOfLine @@ -883,9 +883,9 @@ ColumnIsReady CopyHeights lda (tempor3),y sta (temp),y - adw temp #1 - adw tempor3 #1 - adw xdraw #1 + inw temp + inw tempor3 + inw xdraw ;vcmp xdraw,screenwidth,CopyHeights cpw xdraw RangeRight bcc CopyHeights @@ -981,7 +981,7 @@ ToBottom Skip01 sta ydraw - adw xdraw #1 + inw xdraw cpw xdraw #screenwidth beq EndDrawing @@ -1430,13 +1430,13 @@ EmptyPixel ;anyway we assume the text is being drawn ;over an empty space Loop4x4Continued - adw xdraw #1 + inw xdraw lda StoreA4x4 dec Xcounter4x4 ldx Xcounter4x4 bne uppernibble ; here we have on screen one line of the char - adw ydraw #1 + inw ydraw sbw xdraw #4 sbw y4x4 #32 dec:lda LoopCounter4x4 @@ -1494,13 +1494,13 @@ EmptyPixelFULL ;of course it is slower Loop4x4ContinuedFULL - adw xdraw #1 + inw xdraw lda StoreA4x4 dec Xcounter4x4 ldx Xcounter4x4 bne uppernibbleFULL ; here we have on screen one line of the char - adw ydraw #1 + inw ydraw sbw xdraw #4 sbw y4x4 #32 dec:lda LoopCounter4x4 diff --git a/scorch.asm b/scorch.asm index 10aa046..38accc4 100644 --- a/scorch.asm +++ b/scorch.asm @@ -35,7 +35,7 @@ ;we decided it must go in 'English' to let other people work on it .zpvar xdraw .word = $80 ;variable X for plot - .zpvar ydraw .word;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen) + .zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen) .zpvar xbyte .word .zpvar ybyte .word @@ -46,8 +46,8 @@ .zpvar oldplot .word .zpvar xc .word .zpvar temp .word ;temporary word for the most embeded loops only - .zpvar temp2 .word;same as above - .zpvar tempXROLLER .word;same as above for XROLLER routine + .zpvar temp2 .word ;same as above + .zpvar tempXROLLER .word ;same as above for XROLLER routine ;(used also in result display routine) .zpvar xtempDRAW .word ;same as above for XDRAW routine .zpvar ytempDRAW .word ;same as above for XDRAW routine @@ -84,7 +84,7 @@ MaxPlayers = 6 icl 'artwork/HIMARS14.asm' ;Game loading address - ORG $3010 ;two hex thousands for screen + ORG $3010 ;one hex thousands for screen ;----------------------------------------------- ;Screen displays go first to avoid crossing 4kb barrier ;----------------------------------------------- diff --git a/scorch.xex b/scorch.xex index 13edbb8..2a6b0f4 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 7ae99a3..3e1bd6a 100755 --- a/textproc.asm +++ b/textproc.asm @@ -164,16 +164,18 @@ skip10 ; inversing selected option (cursor) ;-------- OptionsInversion + ;clean options loop + ;TODO: (optionally) - convert to single byte loop if no new options mwa #OptionsHere temp ldy #0 OptionsInversionLoop1 lda (temp),y and #$7F sta (temp),y - adw temp #1 + inw temp cpw temp #OptionsScreenEnd bne OptionsInversionLoop1 -;here all past inversions are gone... + ;here all past inversions are gone... mwa #OptionsHere temp mva #0 temp2 ;option number pointer @@ -202,7 +204,7 @@ OptionSetLoop ;inversing the first few chars of the selected line (OptionsY) mva OptionsY temp - mwa #0 temp+1 + mva #0 temp+1 asl temp rol temp+1 asl temp @@ -215,7 +217,7 @@ OptionSetLoop asl temp rol temp+1 ;here is 32*OptionsY - adw temp temp2 + adw temp temp2 ;in temp is 40*OptionsY adw temp #OptionsHere ;now in temp is adres of the line to be inversed @@ -877,8 +879,8 @@ LoopName01 sta NameAdr CheckKeys jsr getkey - ; is if the char to be recorded? - ldx #37 ; table is 38 chars long + ; is the char to be recorded? + ldx #keycodesEnd-keycodes ;table was 38 chars long IsLetter cmp keycodes,x beq YesLetter @@ -905,7 +907,7 @@ NotFirstLetter jmp CheckKeys CheckFurtherX01 ; here we check Tab, Return and Del cmp #$0c ; Return - beq EndOfNick + jeq EndOfNick cmp #$2c ; Tab beq ChangeOfLevelUp cmp #$7 ;cursor right @@ -914,6 +916,8 @@ CheckFurtherX01 ; here we check Tab, Return and Del beq ChangeOfLevelDown cmp #$f ;cursor down beq ChangeOfLevel3Up + cmp #$e ;cursor up + beq ChangeOfLevel3Down cmp #$34 ; Backspace (del) bne CheckKeys @@ -947,21 +951,25 @@ DoNotLoopLevelDown jmp CheckKeys ;---- ChangeOfLevel3Up - ;adw DifficultyLevel #3 - clc - lda DifficultyLevel - adc #3 - sta DifficultyLevel + adb DifficultyLevel #3 cmp #9 bcc DoNotLoopLevel3Up - sbw DifficultyLevel #9 + sbb DifficultyLevel #9 DoNotLoopLevel3Up jsr SelectLevel jmp CheckKeys ;---- +ChangeOfLevel3Down + sbb DifficultyLevel #3 + bpl @+ + adb DifficultyLevel #9 +@ + jsr SelectLevel + jmp CheckKeys +;---- EndOfNick ; storing name of the player and its level @@ -1185,8 +1193,8 @@ DisplayOffensiveTextNr ; ;now we should check overflows lda temp+1 bpl DOTNnotLessThanZero - ;less than zero, so should be zero - mwa #0 temp + ;less than zero, so should be zero + mwa #0 temp beq DOTNnoOverflow DOTNnotLessThanZero @@ -1350,7 +1358,7 @@ DisplayResults ; mva #1 plot4x4color jsr TypeLine4x4 - adw ResultY #4 ;next line + adb ResultY #4 ;next line ;Header1 ;Displays round number @@ -1378,7 +1386,7 @@ GameOver4x4 mva #1 GameIsOver @ - adw ResultY #4 ;next line + adb ResultY #4 ;next line ;Empty line mwa #LineEmpty LineAddress4x4 @@ -1387,7 +1395,7 @@ GameOver4x4 mva #1 plot4x4color jsr TypeLine4x4 - adw ResultY #2 ;next line + adb ResultY #2 ;next line ;Header2 @@ -1397,7 +1405,7 @@ GameOver4x4 mva #1 plot4x4color jsr TypeLine4x4 - adw ResultY #4 ;next line + adb ResultY #4 ;next line ;Empty line mwa #LineEmpty LineAddress4x4 @@ -1406,7 +1414,7 @@ GameOver4x4 mva #1 plot4x4color jsr TypeLine4x4 - sbw ResultY #2 ;next line (was empty) + sbb ResultY #2 ;next line (was empty) ldx NumberOfPlayers ;we start from the highest (best) tank dex ;and it is the last one @@ -1422,7 +1430,7 @@ ResultOfTheNextPlayer - adw ResultY #4 ;next line + adb ResultY #4 ;next line ;there are at least 2 players, so we can safely ;start displaying the result @@ -1474,7 +1482,7 @@ TankNameCopyLoop mva #1 plot4x4color jsr TypeLine4x4 - adw ResultY #4 ;next line + adb ResultY #4 ;next line ;Empty line mwa #LineEmpty LineAddress4x4 @@ -1489,7 +1497,7 @@ TankNameCopyLoop bmi FinishResultDisplay - sbw ResultY #2 ;distance between lines is smaller + sbb ResultY #2 ;distance between lines is smaller jmp ResultOfTheNextPlayer diff --git a/variables.asm b/variables.asm index 3731b9b..21bfb6d 100755 --- a/variables.asm +++ b/variables.asm @@ -96,18 +96,19 @@ ytankstable ;Y positions of tanks (lower left point) LowResDistances ; coarse stank positions divided by 4 (to be in just one byte) :MaxPlayers .by 0 ;----------------------------------- -keycodes ;tables for calculating KeyCode to Screen Code (38 characters) +keycodes ;tables for calculating KeyCode to Screen Code (38 -1 characters) .byte $3f,$15,$12,$3a,$2a,$38,$3d,$39 .byte $0d,$01,$05,$00,$25,$23,$08,$0a .byte $2f,$28,$3e,$2d,$0b,$10,$2e,$16 .byte $2b,$17,$1f,$1e,$1a,$18,$1d,$1b - .byte $33,$35,$30,$32,$22,$0e + .byte $33,$35,$30,$32,$22 ;,$0e <-- hyphen removed from the table, sorry hyphen lovers +keycodesEnd scrcodes dta d"abcdefgh" dta d"ijklmnop" dta d"qrstuvwx" dta d"yz123456" - dta d"7890.-" + dta d"7890." ; "-" ;----------------------------------- Erase .byte 0 ; if 1 only mask of the character is printed ; on the graphics screen. if 0 character is printed normally diff --git a/weapons.asm b/weapons.asm index fd82058..c126702 100755 --- a/weapons.asm +++ b/weapons.asm @@ -182,7 +182,7 @@ deathshead bcs NoUpperCircle jsr xmissile NoUpperCircle - adw ydraw #70 + adb ydraw #70 ;jsr CalculateExplosionRange cpw ydraw #screenHeight bcs NoLowerCircle @@ -593,7 +593,7 @@ PositiveVelocity adw tempXROLLER xdraw SeekLeft - sbw tempXROLLER #1 + dew tempXROLLER lda (tempXROLLER),y ;fukk! beware of Y value cmp HeightRol bne HowMuchToFallLeft @@ -610,7 +610,7 @@ GoRightNow mwa #mountaintable tempXROLLER adw tempXROLLER xdraw SeekRight - adw tempXROLLER #1 + inw tempXROLLER lda (tempXROLLER),y cmp HeightRol bne HowMuchToFallRight @@ -673,14 +673,14 @@ UpNotYet lda HowMuchToFall cmp #1 beq HowMuchToFallRight2 - sbw xdraw #1 + dew xdraw lda xdraw bne RollinContinues lda xdraw+1 jne RollinContinues beq ExplodeNow HowMuchToFallRight2 - adw xdraw #1 + inw xdraw cpw xdraw screenwidth jne RollinContinues ExplodeNow @@ -717,7 +717,7 @@ NextLine jsr plot ldy magic+1 DoNotPlot - adw xdraw #1 + inw xdraw dey bne NextLine dec ydraw ; 1 line up @@ -1086,7 +1086,7 @@ EmptyPoint2 clc ROLPoint2 rol mask1 - adw xdraw #1 + inw xdraw dec mask2 bne ByteBelowTank ldx mask1