Fix for different types of joysticks in different ports.

This commit is contained in:
Pecusx
2023-06-01 09:13:45 +02:00
parent 1b99839d77
commit 2d82073983
7 changed files with 21 additions and 7 deletions
+5 -4
View File
@@ -16,8 +16,9 @@
; - money each player has on the beginning of the game (moneyL i moneyH) ; - 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 ; - and I am sure maxwind, gravity, no_of_rounds in a game, speed of shell flight
mwa #(display+40*140) temp ; we only need to clear last 60 lines (faster) ; mwa #(display+40*140) temp ; we only need to clear last 60 lines (faster)
jsr clearscreen.Go ;let the screen be clean ; jsr clearscreen.Go ;let the screen be clean
jsr clearscreen ;let the screen be clean
mwa #DisplayCopyRom temp mwa #DisplayCopyRom temp
mwa #display temp2 mwa #display temp2
@@ -221,7 +222,7 @@ invertme
jmp AfterManualPurchase jmp AfterManualPurchase
ManualPurchase ManualPurchase
lda JoyNumber,x lda JoyNumber,x
sta JoystickNumber ; set joystick port for player jsr SetJoystickPort ; set joystick port for player
mva #0 isInventory mva #0 isInventory
jsr Purchase ; purchase weapons jsr Purchase ; purchase weapons
bit escFlag bit escFlag
@@ -1542,7 +1543,7 @@ displayloop1
mva #0 COLOR1 mva #0 COLOR1
sta COLBAKS ; set color of background sta COLBAKS ; set color of background
sta CreditsVScrol sta CreditsVScrol
sta JoystickNumber ; set joystick port for player jsr SetJoystickPort ; set joystick port for player
mva #TextForegroundColor COLOR2 mva #TextForegroundColor COLOR2
SetDLI DLIinterruptGameOver ; jsr SetDLI for Game Over screen SetDLI DLIinterruptGameOver ; jsr SetDLI for Game Over screen
; make text and color lines for each tank ; make text and color lines for each tank
+4 -3
View File
@@ -52,7 +52,7 @@ MainGameLoop
mva #0 TankNr ; mva #0 TankNr ;
sta COLBAKS ; set background color to black sta COLBAKS ; set background color to black
sta JoystickNumber ; set joystick port for player jsr SetJoystickPort ; set joystick port for player
; Hide all (easier than hide last ;) ) tanks ; Hide all (easier than hide last ;) ) tanks
jsr cleartanks ; A=0 jsr cleartanks ; A=0
@@ -374,7 +374,7 @@ RoboTanks
ManualShooting ManualShooting
lda JoyNumber,x lda JoyNumber,x
sta JoystickNumber ; set joystick port for player jsr SetJoystickPort ; set joystick port for player
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda #%00000000 lda #%00000000
sta TestFlightFlag ; set "Test Fight" off sta TestFlightFlag ; set "Test Fight" off
@@ -809,7 +809,6 @@ deletePtr = temp
; clean variables ; clean variables
lda #0 lda #0
sta escFlag sta escFlag
sta JoystickNumber
tay tay
mwa #variablesStart deletePtr mwa #variablesStart deletePtr
@ tya @ tya
@@ -817,6 +816,8 @@ deletePtr = temp
inw deletePtr inw deletePtr
cpw deletePtr #variablesEnd cpw deletePtr #variablesEnd
bne @- bne @-
tya
jsr SetJoystickPort
; ser initial shapes for each tank (tanks 0-5 has shape 0 now) ; ser initial shapes for each tank (tanks 0-5 has shape 0 now)
ldy #1 ldy #1
+9
View File
@@ -375,6 +375,15 @@ NoRMT_PALchange
icl 'game.asm' icl 'game.asm'
;-------------------------------------------------- ;--------------------------------------------------
.proc SetJoystickPort
sta JoystickNumber
.IF TARGET = 800
jsr WaitOneFrame
jmp GetKey.Check2button ; update state second joy button
.ELSE
rts
.ENDIF
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc GetKey .proc GetKey
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+3
View File
@@ -235,6 +235,9 @@ FirstSTART
icl 'game.asm' icl 'game.asm'
;-------------------------------------------------- ;--------------------------------------------------
.proc SetJoystickPort
rts
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc GetKey .proc GetKey
BIN
View File
Binary file not shown.