diff --git a/res/text/amfv.txt b/res/text/amfv.txt index 8754606..cce39d5 100644 --- a/res/text/amfv.txt +++ b/res/text/amfv.txt @@ -35,5 +35,8 @@ R79.DEPROT.Z4=Release 79 / Serial number 851122 R77.DEPROT.Z4=Release 77 / Serial number 850814 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/ballyhoo.txt b/res/text/ballyhoo.txt index bba41fe..346df3e 100644 --- a/res/text/ballyhoo.txt +++ b/res/text/ballyhoo.txt @@ -26,6 +26,8 @@ R97.851218.Z3=Release 97 / Serial number 851218 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/beyond.zork.txt b/res/text/beyond.zork.txt index bff2611..daf56a3 100644 --- a/res/text/beyond.zork.txt +++ b/res/text/beyond.zork.txt @@ -47,5 +47,8 @@ R49.870917.Z5=Release 49 / Serial number 870917 R47.870915.Z5=Release 47 / Serial number 870915 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/border.zone.txt b/res/text/border.zone.txt index 070974d..33d5f39 100644 --- a/res/text/border.zone.txt +++ b/res/text/border.zone.txt @@ -53,6 +53,8 @@ R9.871008.Z5=Release 9 / Serial number 871008 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/bureaucracy.txt b/res/text/bureaucracy.txt index 02780aa..482c12b 100644 --- a/res/text/bureaucracy.txt +++ b/res/text/bureaucracy.txt @@ -44,5 +44,8 @@ R116.DEPROT.Z4=Release 116 / Licence number 870602 R86.DEPROT.Z4=Release 86 / Licence number 870212 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/cutthroats.txt b/res/text/cutthroats.txt index a8337d0..712638e 100644 --- a/res/text/cutthroats.txt +++ b/res/text/cutthroats.txt @@ -25,6 +25,8 @@ R23.840809.Z3=Release 23 / Serial number 840809 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/deadline.txt b/res/text/deadline.txt index 2077a49..3ef9628 100644 --- a/res/text/deadline.txt +++ b/res/text/deadline.txt @@ -28,5 +28,8 @@ R19.820427.Z3=Release 19 / Serial number 820427 R18.820311.Z3=Release 18 / Serial number 820311 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/enchanter.txt b/res/text/enchanter.txt index b6412a6..d3f50d1 100644 --- a/res/text/enchanter.txt +++ b/res/text/enchanter.txt @@ -28,5 +28,8 @@ R15.831107.Z3=Release 15 / Serial number 831107 R10.830810.Z3=Release 10 / Serial number 830810 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/hgttg.txt b/res/text/hgttg.txt index d759b69..398aaac 100644 --- a/res/text/hgttg.txt +++ b/res/text/hgttg.txt @@ -35,5 +35,8 @@ R47.840914.Z3=Release 47 / Serial number 840914 R31.871119.Z5=Release 31 / Serial number 871119 (Solid Gold) [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/hollywood.txt b/res/text/hollywood.txt index f83c2e7..734808a 100644 --- a/res/text/hollywood.txt +++ b/res/text/hollywood.txt @@ -45,5 +45,8 @@ R37.861215.Z3=Release 37 / Serial number 861215 R235.861118.Z3=Release 235 / Serial number 861118 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/infidel.txt b/res/text/infidel.txt index 1b39d45..d1bc827 100644 --- a/res/text/infidel.txt +++ b/res/text/infidel.txt @@ -22,6 +22,8 @@ R22.830916.Z3=Release 22 / Serial number 830916 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/lgop.txt b/res/text/lgop.txt index 4ca96c0..954a159 100644 --- a/res/text/lgop.txt +++ b/res/text/lgop.txt @@ -28,5 +28,8 @@ R50.860711.Z3=Release 50 / Serial number 860711 R4.880405.Z5=Release 4 / Serial number 880405 (Solid Gold) [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/lurking.horror.txt b/res/text/lurking.horror.txt index a9fc391..d125e66 100644 --- a/res/text/lurking.horror.txt +++ b/res/text/lurking.horror.txt @@ -42,5 +42,8 @@ R219.870912.Z3=Release 219 / Serial number 870912 R203.870506.Z3=Release 203 / Serial number 870506 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/moonmist.txt b/res/text/moonmist.txt index e616991..a9b4b3c 100644 --- a/res/text/moonmist.txt +++ b/res/text/moonmist.txt @@ -30,5 +30,8 @@ R9.861022.Z3=Release 9 / Serial number 861022 R4.860918.Z3=Release 4 / Serial number 860918 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/nord.and.bert.txt b/res/text/nord.and.bert.txt index 7e73eab..a9e70b0 100644 --- a/res/text/nord.and.bert.txt +++ b/res/text/nord.and.bert.txt @@ -46,6 +46,8 @@ R19.870722.Z4=Release 19 / Serial number 870722 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/planetfall.txt b/res/text/planetfall.txt index c5c1154..0488b4d 100644 --- a/res/text/planetfall.txt +++ b/res/text/planetfall.txt @@ -29,5 +29,8 @@ R20.830708.Z3=Release 20 / Serial number 830708 R10.880531.Z5=Release 10 / Serial number 880531 (Solid Gold) [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/plundered.txt b/res/text/plundered.txt index c0b78b5..f48e743 100644 --- a/res/text/plundered.txt +++ b/res/text/plundered.txt @@ -37,6 +37,8 @@ R26.870730.Z3=Release 26 / Serial number 870730 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/seastalker.txt b/res/text/seastalker.txt index f9b6d28..a210e5d 100644 --- a/res/text/seastalker.txt +++ b/res/text/seastalker.txt @@ -29,5 +29,8 @@ R15A.840501.Z3=Release 15 / Serial number 840501 R86.840320.Z3=Release 86 / Serial number 840320 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/sherlock.txt b/res/text/sherlock.txt index d082d4d..098a961 100644 --- a/res/text/sherlock.txt +++ b/res/text/sherlock.txt @@ -52,5 +52,8 @@ R26.880127.Z5=Release 26 / Serial number 880127 R21.871214.Z5=Release 21 / Serial number 871214 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/sorcerer.txt b/res/text/sorcerer.txt index 3607b12..23e78cb 100644 --- a/res/text/sorcerer.txt +++ b/res/text/sorcerer.txt @@ -29,5 +29,8 @@ R6.DEPROT.Z3=Release 6 / Serial number 840508 R4.DEPROT.Z3=Release 4 / Serial number 840131 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/spellbreaker.txt b/res/text/spellbreaker.txt index a6348e5..5ee7d0f 100644 --- a/res/text/spellbreaker.txt +++ b/res/text/spellbreaker.txt @@ -30,5 +30,8 @@ R87.DEPROT.Z3=Release 87 / Serial number 860904 R63.DEPROT.Z3=Release 63 / Serial number 850916 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/starcross.txt b/res/text/starcross.txt index 3c54e37..9e3ad54 100644 --- a/res/text/starcross.txt +++ b/res/text/starcross.txt @@ -22,5 +22,8 @@ R17.821021.Z3=Release 17 / Serial number 821021 R15.820901.Z3=Release 15 / Serial number 820901 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/stationfall.txt b/res/text/stationfall.txt index cfe92f0..4749fc8 100644 --- a/res/text/stationfall.txt +++ b/res/text/stationfall.txt @@ -45,6 +45,8 @@ R107.DEPROT.Z3=Release 107 / Serial number 870430 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/suspect.txt b/res/text/suspect.txt index 9e74ff8..e20a5e8 100644 --- a/res/text/suspect.txt +++ b/res/text/suspect.txt @@ -26,6 +26,8 @@ R14.841005.Z3=Release 14 / Serial number 841005 [options] +ARTWORK=1 +CLUES=1 VERSIONS=0 [eof] diff --git a/res/text/suspended.txt b/res/text/suspended.txt index eb33c01..33f58a1 100644 --- a/res/text/suspended.txt +++ b/res/text/suspended.txt @@ -30,5 +30,8 @@ R7.830419.Z3=Release 7 / Seial number 830419 R5.830222.Z3=Release 5 / Serial number 830222 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/trinity.txt b/res/text/trinity.txt index 78305e6..1e66c51 100644 --- a/res/text/trinity.txt +++ b/res/text/trinity.txt @@ -26,5 +26,8 @@ R12.860926.Z4=Release 12 / Serial number 860926 R11.860509.Z4=Release 11 / Serial number 860509 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/wishbringer.txt b/res/text/wishbringer.txt index c28d83f..f7bd78c 100644 --- a/res/text/wishbringer.txt +++ b/res/text/wishbringer.txt @@ -23,5 +23,8 @@ R68.850501.Z3=Release 68 / Serial number 850501 R23.880706.Z5=Release 23 / Serial number 880706 (Solid Gold) [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/witness.txt b/res/text/witness.txt index feaf343..1295ce7 100644 --- a/res/text/witness.txt +++ b/res/text/witness.txt @@ -30,5 +30,8 @@ R18.830910.Z3=Release 18 / Serial number 830910 R13.830524.Z3=Release 13 / Serial number 830524 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/zork.i.txt b/res/text/zork.i.txt index 142c0ff..6ae9e8f 100644 --- a/res/text/zork.i.txt +++ b/res/text/zork.i.txt @@ -35,5 +35,8 @@ R15.UG3AU5.Z2=Release 15 / Serial number UG3AU5 R5.000000.Z1=Release 5 / Serial number 000000 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/zork.ii.txt b/res/text/zork.ii.txt index fdaa046..0ccf5af 100644 --- a/res/text/zork.ii.txt +++ b/res/text/zork.ii.txt @@ -34,5 +34,8 @@ R15.820308.Z3=Release 15 / Serial number 820308 R7.UG3AU5.Z2=Release 7 / Serial number UG3AU5 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/res/text/zork.iii.txt b/res/text/zork.iii.txt index 98fd554..3e3bf82 100644 --- a/res/text/zork.iii.txt +++ b/res/text/zork.iii.txt @@ -30,5 +30,8 @@ R12.821025.Z3=Release 12 / Serial number 821025 R10.820818.Z3=Release 10 / Serial number 820818 [options] +ARTWORK=1 +CLUES=1 +VERSIONS=1 [eof] diff --git a/src/ui.main.a b/src/ui.main.a index 697554b..d1305eb 100644 --- a/src/ui.main.a +++ b/src/ui.main.a @@ -7,6 +7,10 @@ ; - PaintMain ; - RepaintMainIfDirty ; +; Public variables +; - gMainScreenPaintDirty +; - gViewInUse +; MAGICRTS = $FF58 ; used to set overflow bit @@ -23,7 +27,7 @@ ID_DESCRIPTION = 9 gMainScreenPaintDirty !byte 0 ; 0=false, 1=true -gViewHasActiveHotkey +gViewInUse !byte 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0 ;------------------------------------------------------------------------------ @@ -40,9 +44,9 @@ gViewHasActiveHotkey PaintMain ldx #WGReset jsr WeeGUI - stz gViewHasActiveHotkey+ID_BOXART - stz gViewHasActiveHotkey+ID_HINTS - stz gViewHasActiveHotkey+ID_VERSIONS + stz gViewInUse+ID_BOXART + stz gViewInUse+ID_HINTS + stz gViewInUse+ID_VERSIONS ldx #1 ; flag - clear screen before painting stx gMainScreenPaintDirty !byte $2C @@ -73,17 +77,17 @@ RepaintMainIfDirty !word kViewPlay .donePlayOrResume - jsr CreateConditionalButton ; create or destroy 'artwork' button + jsr CreateOrDestroyButton ; create or destroy 'artwork' button !byte ID_BOXART !word kViewBoxArt !word kHasArtwork - jsr CreateConditionalButton ; create or destroy 'hints' button + jsr CreateOrDestroyButton ; create or destroy 'hints' button !byte ID_HINTS !word kViewHints !word kHasHints - jsr CreateConditionalButton ; create or destroy 'revisions' button + jsr CreateOrDestroyButton ; create or destroy 'revisions' button !byte ID_VERSIONS !word kViewVersions !word kHasVersions @@ -140,8 +144,9 @@ RepaintMainIfDirty } ;------------------------------------------------------------------------------ -; CreateConditionalButton -; conditionally create a WeeGUI Button, based on per-game options +; CreateOrDestroyButton +; create or destroy a WeeGUI Button view, based on per-game options +; and whether the button already exists ; ; in: WeeGUI loaded and initialized ; gOptionsStore populated @@ -152,7 +157,7 @@ RepaintMainIfDirty ; out: all registers and flags clobbered ;------------------------------------------------------------------------------ !zone { -CreateConditionalButton +CreateOrDestroyButton +PARAMS_ON_STACK 5 ldy #1 @@ -180,20 +185,21 @@ CreateConditionalButton .viewID=*+1 ldx #$FD ; SMC (X = WeeGUI view ID) jsr okvs_as_boolean - beq .no - lda gViewHasActiveHotkey,x - bne .done + beq .destroy + + lda gViewInUse,x ; create button if it doesn't exist + bne .done ; oh it does exist, so we're done lda #1 - sta gViewHasActiveHotkey,x + sta gViewInUse,x jsr CreateButton .viewConfigurationRecord !word $FDFD ; SMC bra .done -.no lda gViewHasActiveHotkey,x - beq .done +.destroy lda gViewInUse,x ; destroy button if it exists + beq .done ; oh it doesn't exist, so we're done lda #0 - sta gViewHasActiveHotkey,x + sta gViewInUse,x txa ; A = WeeGUI view ID ldx #WGSelectView jsr WeeGUI diff --git a/src/ui.main.keys.a b/src/ui.main.keys.a index a00ea4c..185fb16 100644 --- a/src/ui.main.keys.a +++ b/src/ui.main.keys.a @@ -97,7 +97,7 @@ HandleKey bra .focusAndDoAction .activateView tax - ldy gViewHasActiveHotkey,x + ldy gViewInUse,x beq .notFound ldx #WGSelectView jsr WeeGUI