This commit is contained in:
4am 2018-03-26 16:28:20 -04:00
parent 0af8117251
commit f035b99059
2 changed files with 60 additions and 57 deletions

View File

@ -9,7 +9,8 @@
; - CreateButton
; - CreateTitleView
; - PaintTitleView
; - DeleteAllViews
; - SetCheckboxByPref
; - SetPrefByCheckbox
;
; ROM routines
@ -78,14 +79,44 @@ viewTitle
!byte 1 ; height
.stringTitle
!raw " Pitch Dark ",0
}
DeleteAllViews
lda #15
- ldx #WGSelectView
!zone {
SetCheckboxByPref
+PARAMS_ON_STACK 3
ldy #1
lda (PARAM),y
sta .id
iny
lda (PARAM),y
sta .key
iny
lda (PARAM),y
sta .key+1
jsr okvs_get
!word gPrefsStore
.key !word $FDFD ; set at runtime
bcs .exit
jsr okvs_as_boolean
beq .exit
ldx #WGSelectView
.id=*+1
lda #$FD ; set at runtime
jsr WeeGUI
ldx #WGDeleteView
ldx #WGSetState
lda #1
sta PARAM0
jsr WeeGUI
dec
bpl -
.exit rts
}
!zone {
SetPrefByCheckbox
+PARAMS_ON_STACK 3
rts
}

View File

@ -59,59 +59,19 @@ OptionsDialog
!word .viewScriptToFile
jsr CreateCheckbox
!word .viewAutoScript
; set initial state of checkboxes based on preferences
jsr okvs_get
!word gPrefsStore
jsr SetCheckboxByPref ; set initial state of checkboxes based on preferences
!byte ID_OPTIONS_FORCE40
!word kForce40
jsr okvs_as_boolean
beq +
ldx #WGSelectView
lda #ID_OPTIONS_FORCE40
jsr WeeGUI
ldx #WGSetState
lda #1
sta PARAM0
jsr WeeGUI
+
jsr okvs_get
!word gPrefsStore
jsr SetCheckboxByPref
!byte ID_OPTIONS_FORCEUPPER
!word kForceUpper
jsr okvs_as_boolean
beq +
ldx #WGSelectView
lda #ID_OPTIONS_FORCEUPPER
jsr WeeGUI
ldx #WGSetState
lda #1
sta PARAM0
jsr WeeGUI
+
jsr okvs_get
!word gPrefsStore
jsr SetCheckboxByPref
!byte ID_OPTIONS_SCRIPTTOFILE
!word kScriptToFile
jsr okvs_as_boolean
beq +
ldx #WGSelectView
lda #ID_OPTIONS_SCRIPTTOFILE
jsr WeeGUI
ldx #WGSetState
lda #1
sta PARAM0
jsr WeeGUI
+
jsr okvs_get
!word gPrefsStore
jsr SetCheckboxByPref
!byte ID_OPTIONS_AUTOSCRIPT
!word kAutoScript
jsr okvs_as_boolean
beq +
ldx #WGSelectView
lda #ID_OPTIONS_AUTOSCRIPT
jsr WeeGUI
ldx #WGSetState
lda #1
sta PARAM0
jsr WeeGUI
+
ldx #WGDesktop ; paint background
jsr WeeGUI
@ -223,7 +183,19 @@ HandleOptionsKey
jmp WeeGUI
callback_options_ok
; TODO set preferences
jsr SetPrefByCheckbox
!byte ID_OPTIONS_FORCE40
!word kForce40
jsr SetPrefByCheckbox
!byte ID_OPTIONS_FORCEUPPER
!word kForceUpper
jsr SetPrefByCheckbox
!byte ID_OPTIONS_SCRIPTTOFILE
!word kScriptToFile
jsr SetPrefByCheckbox
!byte ID_OPTIONS_AUTOSCRIPT
!word kAutoScript
; execution falls through here
callback_options_cancel
jmp MainScreen