diff --git a/constants.asm b/constants.asm index f6455cb..351fa01 100644 --- a/constants.asm +++ b/constants.asm @@ -4,7 +4,7 @@ ; initial values for some variables initialvaluesStart -I_OptionsTable .by 0,1,2,2,0,1,3,2 +I_OptionsTable .by 0,1,2,2,0,1,3,2,0 I_RoundsInTheGame .by 10 ;how many rounds in the current game I_seppukuVal .by 75 I_mountainDeltaH .by 3 diff --git a/definitions.asm b/definitions.asm index 2508f10..6c8b761 100644 --- a/definitions.asm +++ b/definitions.asm @@ -17,7 +17,7 @@ display = $1010 ;screen takes $2K due to clearing routine margin = 40 ;mountain drawing Y variable margin MaxPlayers = 6 -maxOptions = 8 ;number of all options +maxOptions = 9 ;number of all options PMOffsetX = $2C ; P/M to graphics offset PMOffsetY = $23 ; P/M to graphics offset napalmRadius = 10 diff --git a/display.asm b/display.asm index 5fe33e8..735cf65 100644 --- a/display.asm +++ b/display.asm @@ -17,6 +17,7 @@ OptionsHere dta d"Missiles : slug slow norm fast hare " dta d"Seppuku : nevr rare norm oftn alws " dta d"Mountains: NL BE CZ CH NP " + dta d"Walls : none wrap bump boxy rand " OptionsScreenEnd ;----------------------------------------------- ListOfWeapons diff --git a/scorch.asm b/scorch.asm index 86927a5..089eb80 100644 --- a/scorch.asm +++ b/scorch.asm @@ -219,7 +219,7 @@ FirstSTART START ; Startup sequence jsr Initialize - + ;jsr GameOverScreen ; only for test !!! lda #song_main_menu @@ -242,6 +242,7 @@ START ; for the round #1 shooting sequence is random MainGameLoop + jsr SetWallsType ; first set default barrel lengths (fix for Long Schlong activation :) ) ; we must do it before purchase/activate ldx #(MaxPlayers-1) @@ -1508,7 +1509,24 @@ nextishigher rts .endp - +;-------------------------------------------------- +.proc SetWallsType +;-------------------------------------------------- + mva #0 WallsType + lda OptionsTable+8 + cmp #4 + beq SetRandomWalls + lsr + ror WallsType + lsr + ror WallsType + rts +SetRandomWalls + lda random + and #%11000000 + sta WallsType + rts +.endp ;-------------------------------------------------- .proc GetKey ; waits for pressing a key and returns pressed value in A ; when [ESC] is pressed, escFlag is set to 1 diff --git a/scorch.xex b/scorch.xex index 4f3a190..7d77acd 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 816d289..f80b616 100644 --- a/textproc.asm +++ b/textproc.asm @@ -204,7 +204,7 @@ OptionSetLoop ; next option adw temp #40 ;jump to next line inc:lda temp2 - cmp #maxoptions ;number of options + cmp #maxOptions ;number of options bne OptionsSetMainLoop ;inversing the first few chars of the selected line (OptionsY) @@ -853,7 +853,9 @@ invSelectDef ; if activate battery, we do it differently mva #sfx_battery sfx_effect mva #99 Energy,x + phy jsr MaxForceCalculate + ply jmp DecreaseDefensive ; bypass activation NotBattery cmp #ind_Long_Barrel____ diff --git a/variables.asm b/variables.asm index 5ed36e3..59ef84c 100644 --- a/variables.asm +++ b/variables.asm @@ -29,7 +29,7 @@ skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning ;---------------------------------------------------- variablesToInitialize ;Options DO NOT ZERO ON RESTART GAME - ticket #27 -OptionsTable .by 0,1,2,2,0,1,3,2 +OptionsTable .by 0,1,2,2,0,1,3,2,0 RoundsInTheGame .by 10 ;how many rounds in the current game seppukuVal .by 75 mountainDeltaH .by 3 @@ -138,7 +138,8 @@ MaxWind .ds 1 ; WindOrientation .DS 1 ;(0-right,1-left) ;---------------------------------------------------- ;Counter .DS 1 ;temporary Counter for outside loops -;HitFlag .DS 1 ;$ff when missile hit ground, $00 when no hit, $01-$06 tank index+1 when hit tank +;HitFlag .DS 1 ;$ff when missile hit ground, $00 when no hit, $01-$06 tank index+1 when hit tank +WallsType .ds 1 ; bits 6 and 7: 00 - none, 01 - bump, 10 - wrap, 11 - boxy ;---------------------------------------------------- xtankstableL ;X positions of tanks (lower left point) .DS [MaxPlayers] diff --git a/weapons.asm b/weapons.asm index faa1b4b..7042470 100644 --- a/weapons.asm +++ b/weapons.asm @@ -1798,6 +1798,12 @@ NoWind mwa ytraj+1 ybyte jsr draw ;key + bit LaserFlag + bmi LaserNoWalls + ; Check for walls + jsr MakeWalls + ; +LaserNoWalls mwa xtraj+1 XtrajOld+1 mwa ytraj+1 YtrajOld+1 @@ -2333,7 +2339,49 @@ MIRValreadyAll ;jsr drawtanks rts .endp - +; ------------------------------------------------- +.proc MakeWalls +; ------------------------------------------------- + bit WallsType ; ; bits 6 and 7: 00 - none, 01 - bump, 10 - wrap, 11 - boxy + bpl WrapAndNone + bvc MakeBump + ; top bounce + bit ytraj+2 + bpl NoOnTop + sec + .rept 4 + lda #$00 + sbc vy+# + sta vy+# + .endr +NoOnTop +MakeBump + cpw xtraj+1 #screenwidth + bcc OnScreen + ; inverse vx (bouncing wall) + sec + .rept 4 + lda #$00 + sbc vx+# + sta vx+# + .endr + rts +WrapAndNone + bvc NoWall + cpw xtraj+1 #screenwidth + bcc OnScreen + ; (wrapping wall) + bit xtraj+2 + bmi LeftWrap +RightWrap + sbw xtraj+1 #screenwidth + rts +LeftWrap + adw xtraj+1 #screenwidth +OnScreen +NoWall + rts +.endp ; ------------------------------------------------- .proc WhiteFlag ; -------------------------------------------------