resize version dialog based on number of available versions

This commit is contained in:
4am 2018-04-11 18:55:28 -04:00
parent 4a698edb5c
commit 385c2fa55f
7 changed files with 34 additions and 25 deletions

View File

@ -31,8 +31,8 @@
for the "Class One Security Mode Access Decoder" is always 12.
[versions]
R79.DEPROT.Z4=Release 79 / Serial number 851122
R77.DEPROT.Z4=Release 77 / Serial number 850814
R79.DEPROT.Z4=Release 79 / Serial number 851122 (patched)
R77.DEPROT.Z4=Release 77 / Serial number 850814 (patched)
[options]
ARTWORK=1

View File

@ -40,8 +40,8 @@
are asked five questions in the paranoid's house, you may give any answers.
[versions]
R116.DEPROT.Z4=Release 116 / Licence number 870602
R86.DEPROT.Z4=Release 86 / Licence number 870212
R116.DEPROT.Z4=Release 116 / Licence number 870602 (patched)
R86.DEPROT.Z4=Release 86 / Licence number 870212 (patched)
[options]
ARTWORK=1

View File

@ -22,11 +22,11 @@
white, gray, black, red, black.
[versions]
R18.DEPROT.Z3=Release 18 / Serial number 860904
R15.DEPROT.Z3=Release 15 / Serial number 851108
R13.DEPROT.Z3=Release 13 / Serial number 851021
R6.DEPROT.Z3=Release 6 / Serial number 840508
R4.DEPROT.Z3=Release 4 / Serial number 840131
R18.DEPROT.Z3=Release 18 / Serial number 860904 (patched)
R15.DEPROT.Z3=Release 15 / Serial number 851108 (patched)
R13.DEPROT.Z3=Release 13 / Serial number 851021 (patched)
R6.DEPROT.Z3=Release 6 / Serial number 840508 (patched)
R4.DEPROT.Z3=Release 4 / Serial number 840131 (patched)
[options]
ARTWORK=1

View File

@ -26,8 +26,8 @@
it look easy." The answer is Barsap.
[versions]
R87.DEPROT.Z3=Release 87 / Serial number 860904
R63.DEPROT.Z3=Release 63 / Serial number 850916
R87.DEPROT.Z3=Release 87 / Serial number 860904 (patched)
R63.DEPROT.Z3=Release 63 / Serial number 850916 (patched)
[options]
ARTWORK=1

View File

@ -42,7 +42,7 @@
just enter the current GST (displayed at the top of the screen).
[versions]
R107.DEPROT.Z3=Release 107 / Serial number 870430
R107.DEPROT.Z3=Release 107 / Serial number 870430 (patched)
[options]
ARTWORK=1

View File

@ -62,7 +62,7 @@ CreateButton
; creates a WeeGUI decorated frame view
;
; in: WeeGUI initialized
; stack contains 8 bytes of parameters:
; stack contains 4 bytes of parameters:
; +1 [word] address of WeeGUI view configuration block for frame
; +3 [word] address of null-terminated string for frame title
; out: $00/$01 clobbered

View File

@ -75,17 +75,19 @@ VersionsDialog
!word gVersionsStore
sta .numVersions
; TODO calculate proper height based on number of available versions
ldy #3
sty kViewVersionsFrame+3 ; frame top
iny
sty kViewVersionsOK+2 ; OK top
iny
iny
sty kViewVersionsCancel+2 ; Cancel top
ldy #19
sty kViewVersionsFrame+5 ; frame visible height
sty kViewVersionsFrame+7 ; frame height
asl
inc
sta kViewVersionsFrame+5 ; frame visible height = 1 + (2 * numVersions)
sta kViewVersionsFrame+7 ; frame height
lda #12
sec
sbc .numVersions
sta kViewVersionsFrame+3 ; frame top = 12 - numVersions
inc
sta kViewVersionsOK+2 ; OK top = frame top + 1
inc
inc
sta kViewVersionsCancel+2 ; Cancel top = OK top + 2
jsr CreateDialog
!word kViewVersionsFrame
@ -96,7 +98,7 @@ VersionsDialog
jsr CreateButton
!word kViewVersionsCancel
ldx #0
ldx #0 ; X = index of radio button (0-based)
.createRadioLoop
phx
lda #1
@ -107,6 +109,13 @@ VersionsDialog
lda kVersions,x
ldy kVersions+1,x
+STAY +
+STAY SRC
txa
inc
clc
adc kViewVersionsFrame+3
ldy #2
sta (SRC),y ; radio button top = frame top + 1 + (2 * X)
jsr CreateRadio ; create radio button for this version (will print label later)
+ !word $FDFD ; SMC
plx