Options screen is now separate from setting the game's initial variables.

For easier porting to the C64 or others.
This commit is contained in:
Pecusx
2022-12-14 13:11:40 +01:00
parent b7a5e7c9b5
commit 54a4dcf7d8
4 changed files with 63 additions and 58 deletions
+1
View File
@@ -316,6 +316,7 @@ START
RMTSong song_main_menu
jsr Options ;startup screen
jsr SetVariablesFromOptions
jsr MakeDarkScreen
bit escFlag
bmi START
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+61 -57
View File
@@ -109,7 +109,7 @@ OptionsNoLeft
OptionsNoRight
cmp #@kbcode._ret ; $c ;Return key
bne OptionsNoReturn
jmp OptionsFinished
rts ; options selected
OptionsNoReturn
cmp #@kbcode._tab ; Tab key
@@ -119,62 +119,6 @@ OptionsNoReturn
sta Gradient
OptionsNoTab
jmp OptionsMainLoop
OptionsFinished
;first option
ldy OptionsTable
iny
iny
sty NumberOfPlayers ;1=1 player (but minimum is 2)
;second option (cash)
ldy OptionsTable+1
ldx #0
@
lda CashOptionL,y
sta moneyL,x
lda CashOptionH,y
sta moneyH,x
inx
cpx NumberOfPlayers
bne @-
;third option (gravity)
ldy OptionsTable+2
lda GravityTable,y
sta gravity
;fourth option (wind)
ldy OptionsTable+3
lda MaxWindTable,y
sta MaxWind
;fifth option (no of rounds)
ldy OptionsTable+4
lda RoundsTable,y
sta RoundsInTheGame
;6th option (shell speed)
ldy OptionsTable+5
lda flyDelayTable,y
sta flyDelay
;7th option (Airstrike after how many missess)
ldy OptionsTable+6
lda seppukuTable,y
sta seppukuVal
;8th option (how aggressive are mountains)
ldy OptionsTable+7
lda mountainsDeltaTableH,y
sta mountainDeltaH
lda mountainsDeltaTableL,y
sta mountainDeltaL
rts
.endp
;--------
; inversing selected option (cursor)
@@ -236,6 +180,66 @@ invertme
rts
.endp
; --------------------------------------
; Sets the appropriate variables based on the options table
;
.proc SetVariablesFromOptions
;first option
ldy OptionsTable
iny
iny
sty NumberOfPlayers ;1=1 player (but minimum is 2)
;second option (cash)
ldy OptionsTable+1
ldx #0
@
lda CashOptionL,y
sta moneyL,x
lda CashOptionH,y
sta moneyH,x
inx
cpx NumberOfPlayers
bne @-
;third option (gravity)
ldy OptionsTable+2
lda GravityTable,y
sta gravity
;fourth option (wind)
ldy OptionsTable+3
lda MaxWindTable,y
sta MaxWind
;fifth option (no of rounds)
ldy OptionsTable+4
lda RoundsTable,y
sta RoundsInTheGame
;6th option (shell speed)
ldy OptionsTable+5
lda flyDelayTable,y
sta flyDelay
;7th option (Airstrike after how many missess)
ldy OptionsTable+6
lda seppukuTable,y
sta seppukuVal
;8th option (how aggressive are mountains)
ldy OptionsTable+7
lda mountainsDeltaTableH,y
sta mountainDeltaH
lda mountainsDeltaTableL,y
sta mountainDeltaL
rts
.endp
;-------------------------------------------
; call of the purchase (and activate) screens for each tank
.proc CallPurchaseForEveryTank