scrolly credits thingy

This commit is contained in:
Peter Ferrie 2018-06-20 15:58:05 -07:00
parent 6f4219f8fb
commit ffb0e13217
8 changed files with 307 additions and 63 deletions

View File

@ -1,88 +1,90 @@
Games, descriptions, and artwork are
copyright 1979-1988 Infocom, Inc.
Invisiclues are copyright 1993, 1999
Activision, Inc.
Games, descriptions, and artwork are
copyright 1979-1988 Infocom, Inc.
Zork and all other game names are
registered trademarks of Activision.
Invisiclues are copyright 1993, 1999
Activision, Inc.
~
Zork and all other game names are
registered trademarks of Activision.
Pitch Dark is a frontend for exploring
and playing Infocom text adventures.
~
Copyright 2018 4am
Pitch Dark is a frontend for exploring
and playing Infocom text adventures.
https://github.com/a2-4am/pitch-dark
Copyright 2018 4am
~
https://github.com/a2-4am/pitch-dark
On Beyond Z-Machine! is a ProDOS port of
Infocom's Z-Machine interpreters.
~
Copyright 2018 qkumba
On Beyond Z-Machine! is a ProDOS port
of Infocom's Z-Machine interpreters.
based on code from six different games
copyright 1979-1988 Infocom, Inc.
Copyright 2018 qkumba
~
based on code from six different games
copyright 1979-1988 Infocom, Inc.
WeeGUI is a compact and easy to use GUI
library for 8-bit Apple ][ computers.
~
Copyright 2014-8 Quinn Dunki
WeeGUI is a compact and easy to use
GUI library for 8-bit Apple ][
computers.
https://github.com/blondie7575/WeeGUI/
Copyright 2014-8 Quinn Dunki
~
https://github.com/blondie7575/WeeGUI/
Artwork was scanned from original retail
boxes and converted to Apple II native
formats with the help of
~
Bmp2DHR copyright 2014 Bill Buckels
A2FCBmp copyright 2012-5 Bill Buckels
buckshot copyright 2017 Dagen Brock
Artwork was scanned from original
retail boxes and converted to Apple II
native formats with the help of
http://www.appleoldies.ca/bmp2dhr/
https://apple2.gs/buckshot/
Bmp2DHR copyright 2014 Bill Buckels
A2FCBmp copyright 2012-5 Bill Buckels
buckshot copyright 2017 Dagen Brock
~
http://www.appleoldies.ca/bmp2dhr/
https://apple2.gs/buckshot/
The PRIZM Project (Pretty Reliable
Invisiclues for Z-Machine) are genuine
Infocom Invisiclues, accessible in your
favorite Z-Machine interpreter.
~
Copyright 1999 Digby McWiggle and
Steven Marsh
The PRIZM Project (Pretty Reliable
Invisiclues for Z-Machine) are genuine
Infocom Invisiclues, accessible in
your favorite Z-Machine interpreter.
Compiled, edited, and Z-coded by
Digby McWiggle
Steven Marsh
Copyright 1999 Digby McWiggle and
Steven Marsh
from material supplied by
Henrik Dittmann
Paul David Doherty
Volker Blasius
Mike Threepoint
Compiled, edited, and Z-coded by
Digby McWiggle
Steven Marsh
Thanks also to
Brian Hall
L. Ross Raszewski
Graham Nelson
from material supplied by
Henrik Dittmann
Paul David Doherty
Volker Blasius
Mike Threepoint
http://www.waitingforgo.com/
Thanks also to
Brian Hall
L. Ross Raszewski
Graham Nelson
~
http://www.waitingforgo.com/
The authors also wish to express their
gratitude to their wonderfully patient
beta testers, who will be named here:
~
- TODO1
- TODO2
- TODO3
The authors also wish to express their
gratitude to their wonderfully patient
beta testers, who will be named here:
[EOF]
- TODO1
- TODO2
- TODO3
[EOF]

View File

@ -40,6 +40,7 @@
!source "src/ui.resume.a"
!source "src/ui.versions.a"
!source "src/ui.artwork.a"
!source "src/ui.credits.a"
gGamesListStore
!word *+2 ; address of first okvs store

226
src/ui.credits.a Normal file
View File

@ -0,0 +1,226 @@
;license:MIT
;(c) 2018 by 4am
;
; User interface - views and paint routines for credits screen
;
; Public functions
; - CreditsDialog
;
; View IDs (application-specific, acceptable range 0..15, no duplicates)
ID_CREDITS_FRAME = 1
ID_CREDITS_OK = 2
; action keys for credits screen
kCreditsKeys
!byte $CF,ID_CREDITS_OK ; O
!byte $EF,ID_CREDITS_OK ; o
!byte $8D,ID_CREDITS_OK ; Return
!byte $9B,ID_CREDITS_OK ; Esc
!byte $8B,ID_SCROLLUP ; up arrow
!byte $8A,ID_SCROLLDOWN ; down arrow
_endCreditsKeys
;------------------------------------------------------------------------------
; CreditsDialog
; call WeeGUI to create and paint credits screen, and run to completion
;
; in: WeeGUI initialized
; out: exits via MainScreen
; all registers and flags clobbered
;------------------------------------------------------------------------------
CreditsDialog
ldx #$FF
txs
jsr HardResetWeeGUI
jsr CreateDialog ; create decorated frame
!word kViewCreditsFrame
!word kStringCreditsFrame
ldx #WGViewSetAction ; set view action (called automatically after scrolling)
+LDADDR PaintCreditsView
+STAY PARAM0
jsr WeeGUI
jsr CreateButton ; create OK button
!word kViewCreditsOK
ldx #WGDesktop ; paint background
jsr WeeGUI
jsr PaintTitleBar ; paint top title bar
ldx #WGViewPaintAll ; paint UI controls (window frame, buttons, checkboxes, radio buttons)
jsr WeeGUI
jsr LoadCredits ; fetch contents for credits box
jsr PaintCreditsView ; paint contents of credits box
jsr ClearPendingInput
- ldx #WGPendingViewAction
jsr WeeGUI ; handle mouse movement and clicks
lda $C000
bpl -
jsr ClearPendingInput
jsr HandleCreditsKey ; handle keypresses
bra -
LoadCredits
jsr LoadFile ; load credits file at $2800
!word @kStringCreditsFilename
!word $2800
!word kProDOSFileBuffer
bcs @NoCredits
ldy #$20
lda #0
+STAY PARAM2
ldy #$28 ; doubles as 40-column width
+STAY PARAM0
stz CreditsMaxLine+1
-- lda (PARAM0)
inc PARAM0
bne +
inc PARAM1
+ cmp #$0A
beq ++ ; ignore LF entirely
ora #$80 ; set bit 7
tax
- cpx #$8D ; watch for CR
php
bne +
lda #$A0 ; switch to spaces
+ dey
beq +
sta (PARAM2)
inc PARAM2
bne +
inc PARAM3
+ plp
bne ++
tya
bne - ; pad line with spaces until width
inc CreditsMaxLine+1
tya
ldy #$29 ; reload 40-column width, +1 to compensate for DEY
tax ; replace cached char with #$00
beq - ; loop to store it and then resume
++ lda mliparam+6
bne +
dec mliparam+7
+ dec mliparam+6
dec
ora mliparam+7
bne --
@NoCredits
rts
@kStringCreditsFilename
!byte 11
!raw "CREDITS.TXT"
PaintCreditsView
ldx #WGSelectView
lda #ID_CREDITS_FRAME
jsr WeeGUI
lda #$20
sta CreditsPosHi+1
stz CreditsPosLo+1
stz CreditsCurLine+1
--
CreditsCurLine
lda #$FD ; SMC
stz PARAM0
sta PARAM1
ldx #WGSetCursor
jsr WeeGUI
CreditsPosHi
ldy #$20
CreditsPosLo
lda #0
+STAY PARAM0
ldx #WGPrint
jsr WeeGUI
- lda (PARAM0)
inc PARAM0
bne +
inc PARAM1
+ tax
bne -
lda PARAM0
sta CreditsPosLo+1
lda PARAM1
sta CreditsPosHi+1
inc CreditsCurLine+1
lda CreditsCurLine+1
CreditsMaxLine
cmp #$FD ; SMC
bne --
lda CreditsMaxLine+1 ; minimum content height
ldx #WGSetContentHeight ; set content height so we stop scrolling on the last line of text
jmp WeeGUI
;------------------------------------------------------------------------------
; internal functions
;------------------------------------------------------------------------------
; HandleCredits
;
; in: A = key pressed
; out: all registers and flags clobbered
;------------------------------------------------------------------------------
HandleCreditsKey
ldy #(_endCreditsKeys-kCreditsKeys)-2
- cmp kCreditsKeys,y
beq @found
dey
dey
bpl -
jmp SoftBell
@found ldx #WGSelectView
lda kCreditsKeys+1,y
bpl @activateView ; ID < #$80 is a WeeGUI view, so activate it
ldy #$FF
cmp #ID_SCROLLDOWN ; arrow keys scroll the description box
beq @scroll
ldy #$01
@scroll phy
ldx #WGSelectView
lda #ID_CREDITS_FRAME
jsr WeeGUI
ldx #WGScrollYBy
pla
@activateView
jsr WeeGUI
jmp SimulateClick
callback_credits_ok
jmp MainScreen
;------------------------------------------------------------------------------
; WeeGUI view configuration records
kViewCreditsFrame
!byte ID_CREDITS_FRAME ; view ID
!byte 2 ; style (decorated frame)
!byte 1 ; left
!byte 3 ; top
!byte 77 ; visible width
!byte 20 ; visible height
!byte 77 ; width
!byte 100 ; height
kViewCreditsOK
!byte ID_CREDITS_OK ; view ID
!byte 67 ; left
!byte 4 ; top
!byte 10 ; width
!word callback_credits_ok ; callback
!word kStringOK ; caption
kStringCreditsFrame
!text "Credits",0

View File

@ -20,6 +20,7 @@ ID_HINTS = 6
ID_VERSIONS = 7
ID_INFO = 8
ID_DESCRIPTION = 9
ID_ABOUT = 10
gMainScreenPaintDirty
!byte 0
@ -105,6 +106,9 @@ RepaintMainIfDirty
!word kViewVersions
!word kHasVersions
jsr CreateButton ; create '?' button
!word kViewAbout
pla ; clear screen before repainting?
beq @nohome ; no -> repaint over existing screen, YOLO
@ -376,6 +380,14 @@ kViewDescription
!byte 77 ; width
!byte 39 ; height
kViewAbout
!byte ID_ABOUT ; view ID
!byte 79 ; left
!byte 0 ; top
!byte 1 ; width
!word CreditsDialog ; callback
!word kStringAbout
kStringPrevious
!text "< "
!byte $10 ; 'P' inverse
@ -406,3 +418,5 @@ kStringHints
kStringVersions
!byte $16 ; 'V' inverse
!text "ersion",0
kStringAbout
!byte $3F, 0 ; '?' inverse

View File

@ -44,6 +44,7 @@ kMainKeys
!byte $F9,ID_Y ; y
!byte $DA,ID_Z ; Z
!byte $FA,ID_Z ; z
!byte $BF,ID_ABOUT ; ?
_endMainKeys
;------------------------------------------------------------------------------
@ -54,7 +55,7 @@ _endMainKeys
; out: all registers and flags clobbered
;------------------------------------------------------------------------------
HandleKey
ldx #_endMainKeys-kMainKeys
ldx #(_endMainKeys-kMainKeys)-2
- cmp kMainKeys,x
beq @found
dex

View File

@ -122,7 +122,7 @@ OptionsDialog
; out: all registers and flags clobbered
;------------------------------------------------------------------------------
HandleOptionsKey
ldx #_endOptionsKeys-kOptionsKeys
ldx #(_endOptionsKeys-kOptionsKeys)-2
- cmp kOptionsKeys,x
beq @found
dex

View File

@ -143,7 +143,7 @@ ResumeDialog
; out: all registers and flags clobbered
;------------------------------------------------------------------------------
HandleResumeKey
ldx #_endResumeKeys-kResumeKeys
ldx #(_endResumeKeys-kResumeKeys)-2
- cmp kResumeKeys,x
beq @found
dex

View File

@ -166,7 +166,7 @@ iNumVersions=*+1
; out: all registers and flags clobbered
;------------------------------------------------------------------------------
HandleVersionsKey
ldx #_endVersionsKeys-kVersionsKeys
ldx #(_endVersionsKeys-kVersionsKeys)-2
- cmp kVersionsKeys,x
beq @found
dex