add DGR mode and action screenshots for DGR games

fixes https://github.com/a2-4am/4cade/issues/326
This commit is contained in:
4am 2021-12-10 21:50:10 -05:00
parent c9f54f0f5f
commit c48469ec80
54 changed files with 265 additions and 45 deletions

View File

@ -141,10 +141,11 @@ index: md asmfx asmprelaunch compress
[ -f build/index ] || ((for f in res/ACTION.HGR/[YZ]*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.HGR > build/HGR6.IDX)
[ -f build/index ] || ((for f in res/ACTION.DHGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a build/TOTAL.DATA res/ACTION.DHGR > build/DHGR.IDX)
#
# precompute indexed files for GR action screenshots
# precompute indexed files for GR and DGR action screenshots
# note: these can be padded because they are not compressed
#
[ -f build/index ] || ((for f in res/ACTION.GR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA res/ACTION.GR > build/GR.IDX)
[ -f build/index ] || ((for f in res/ACTION.DGR/*; do echo "$$(basename $$f)"; done) | bin/buildindexedfile.sh -a -p build/TOTAL.DATA res/ACTION.DGR > build/DGR.IDX)
#
# precompute indexed files for SHR artwork
# note: these can not be padded because they are compressed and the decompressor needs the exact size
@ -190,12 +191,14 @@ index: md asmfx asmprelaunch compress
[ -f build/index ] || bin/addfile.sh build/HGR6.IDX build/TOTAL.DATA > src/index/hgr6.idx.a
[ -f build/index ] || bin/addfile.sh build/DHGR.IDX build/TOTAL.DATA > src/index/dhgr.idx.a
[ -f build/index ] || bin/addfile.sh build/GR.IDX build/TOTAL.DATA > src/index/gr.idx.a
[ -f build/index ] || bin/addfile.sh build/DGR.IDX build/TOTAL.DATA > src/index/dgr.idx.a
[ -f build/index ] || bin/addfile.sh build/ARTWORK.IDX build/TOTAL.DATA > src/index/artwork.idx.a
#
# add additional miscellaneous files
#
[ -f build/index ] || bin/addfile.sh build/COVERFADE build/TOTAL.DATA > src/index/coverfade.idx.a
[ -f build/index ] || bin/addfile.sh build/GR.FIZZLE build/TOTAL.DATA > src/index/gr.fizzle.idx.a
[ -f build/index ] || bin/addfile.sh build/DGR.FIZZLE build/TOTAL.DATA > src/index/dgr.fizzle.idx.a
[ -f build/index ] || bin/addfile.sh build/HELPTEXT build/TOTAL.DATA > src/index/helptext.idx.a
[ -f build/index ] || bin/addfile.sh build/CREDITS build/TOTAL.DATA > src/index/credits.idx.a
[ -f build/index ] || bin/addfile.sh res/DECRUNCH build/TOTAL.DATA > src/index/decrunch.idx.a

View File

@ -81,6 +81,8 @@ cat res/ATTRACT.CONF |
check_slideshow res/SS/"$module_name" res/ARTWORK.SHR/
elif [ "$module_type" = "6" ]; then
check_slideshow res/SS/"$module_name" res/ACTION.GR/
elif [ "$module_type" = "7" ]; then
check_slideshow res/SS/"$module_name" res/ACTION.DGR/
else
fatal_error "Unknown module type" $module_type
fi

View File

@ -43,6 +43,14 @@ cat res/GAMES.CONF |
sort |
uniq >> /tmp/g
# add DGR action screenshots, if any
cat res/SS/ACTDGR*.CONF |
egrep "(^|=)""$game""$" |
cut -d"=" -f1 |
sed -e "s/$/=E/g" |
sort |
uniq >> /tmp/g
# add self-running demo, if any
cat res/ATTRACT.CONF |
grep "^$game=0" >> /tmp/g

BIN
res/ACTION.DGR/BEJEWELED Normal file

Binary file not shown.

BIN
res/ACTION.DGR/FLAPPLE.BIRD Normal file

Binary file not shown.

Binary file not shown.

View File

@ -25,10 +25,12 @@
# 4 = DHGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.DHGR/)
# 5 = SHR box art slideshow (|key| is a file in /SS/ containing files in /ARTWORK.SHR/)
# 6 = GR action slideshow (|key| is a file in /SS/ containing files in /ACTION.GR/)
# 7 = DGR action slideshow (|key| is a file in /SS/ containing files in /ACTION.DGR/)
# A = single HGR file (|key| is a file in /ACTION.HGR/)
# B = single DHGR file (|key| is a file in /ACTION.DHGR/)
# C = single SHR file (|key| is a file in /ARTWORK.SHR/)
# D = single GR file (|key| is a file in /ACTION.GR/)
# E = single DGR file (|key| is a file in /ACTION.DGR/)
#
# Blank lines and lines beginning with '#' are ignored (like this one!)
# A line beginning with '[' terminates the parsing
@ -47,6 +49,7 @@ ACTIONPOP.CONF=2
SAMMY.LIGHTFOOT=0
ACTIONEFG6.CONF=2
ADVINT.CONF=1
ACTDGR1.CONF=7
SHR1.CONF=5
# set 2

View File

@ -3,5 +3,6 @@
# This file is automatically generated
#
BEJEWELED=E
[eof]

View File

@ -3,5 +3,7 @@
# This file is automatically generated
#
FLAPPLE.BIRD2=E
FLAPPLE.BIRD=E
[eof]

9
res/SS/ACTDGR1.CONF Normal file
View File

@ -0,0 +1,9 @@
#
# action shots slideshow of double lo-res games
#
FLAPPLE.BIRD
BEJEWELED
FLAPPLE.BIRD2=FLAPPLE.BIRD
[eof]

View File

@ -104,6 +104,7 @@ ResetVector ; 6 bytes, copied to $100
!source "src/ui.attract.dhgr.a"
!source "src/ui.attract.shr.a"
!source "src/ui.attract.gr.a"
!source "src/ui.attract.dgr.a"
!source "src/ui.offscreen.a"
!source "src/ui.cheats.a"
!source "src/ui.credits.a"

View File

@ -201,7 +201,7 @@ PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be d
iCurBlockLo = $D601 ; constant
iCurBlockHi = $D603 ; constant
launchpatch = $D853 ; glue.launch.a
iAddToPath = $FECB ; Roger Rabbit, avoid, use Infiltrator 2 style instead
iAddToPath = $FEBF ; Roger Rabbit, avoid, use Infiltrator 2 style instead
itraverse = $DB31 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
ldrlo = $55 ; constant
ldrhi = $56 ; constant

36
src/fx/fx.dgr.fizzle.a Normal file
View File

@ -0,0 +1,36 @@
;license:MIT
;(c) 2017-2021 by qkumba/4am/John Brooks
;
!cpu 6502
!to "build/DGR.FIZZLE",plain
*=$6000
src = $FC
dst = $FE
ldy #0
sty src
sty dst
lda #$40
sta src+1
sta $C005
clv
-- ldx #4
stx dst+1
- tya
and #$78
cmp #$78
beq + ; skip screen holes
lda (src), y
sta (dst), y
+ iny
bne -
inc src+1
inc dst+1
dex
bne -
bvs exit
sta $C004
bit exit
bvs -- ; always branches
exit rts

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10925185
!be24 10931567
!le16 4244

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10878065
!le16 5223
!be24 10884353
!le16 5239

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10820924
!be24 10827212
!le16 3586

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10833294
!be24 10839582
!le16 3946

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10848693
!be24 10854981
!le16 4998

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10866345
!be24 10872633
!le16 5571

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10929429
!be24 10935811
!le16 410

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10930147
!be24 10936579
!le16 448

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10930595
!be24 10937027
!le16 303

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10885434
!be24 10891738
!le16 1242

View File

@ -0,0 +1,8 @@
;
; Index record for build/DGR.FIZZLE
;
; This file is automatically generated
;
!byte 0
!be24 10936328
!le16 50

8
src/index/dgr.idx.a Normal file
View File

@ -0,0 +1,8 @@
;
; Index record for build/DGR.IDX
;
; This file is automatically generated
;
!byte 0
!be24 10931508
!le16 59

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10923855
!be24 10930178
!le16 1249

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10909845
!be24 10916168
!le16 464

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10883288
!be24 10889592
!le16 2146

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10886907
!be24 10893211
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10929839
!be24 10936221
!le16 107

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10925104
!be24 10931427
!le16 81

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10929946
!be24 10936378
!le16 201

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10910309
!be24 10916632
!le16 4407

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10914716
!be24 10921039
!le16 1533

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10916249
!be24 10922572
!le16 1040

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10917289
!be24 10923612
!le16 3237

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10920526
!be24 10926849
!le16 2764

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10923290
!be24 10929613
!le16 460

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10923750
!be24 10930073
!le16 105

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10930898
!be24 10937330
!le16 2370

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10897950
!be24 10904273
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10871916
!be24 10878204
!le16 6149

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10812892
!be24 10819180
!le16 8032

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10824510
!be24 10830798
!le16 8784

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10837240
!be24 10843528
!le16 11453

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10853691
!be24 10859979
!le16 12654

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10886676
!be24 10892980
!le16 231

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10893056
!le16 4894
!be24 10899360
!le16 4913

View File

@ -4,5 +4,5 @@
; This file is automatically generated
;
!byte 0
!be24 10904099
!be24 10910422
!le16 5746

View File

@ -102,6 +102,9 @@ kDHGRActionIndexRecord
kGRActionIndexRecord
!source "src/index/gr.idx.a"
kDGRActionIndexRecord
!source "src/index/dgr.idx.a"
kHGRActionIndexLo
!byte <kHGRActionIndexRecord0
!byte <kHGRActionIndexRecord1
@ -179,6 +182,9 @@ kCoverFadeRecord
kGRFizzleRecord
!source "src/index/gr.fizzle.idx.a"
kDGRFizzleRecord
!source "src/index/dgr.fizzle.idx.a"
kHelpBackgroundRecord
!source "src/index/res.help.idx.a"

106
src/ui.attract.dgr.a Normal file
View File

@ -0,0 +1,106 @@
;license:MIT
;(c) 2021 by 4am
;
; DGR action slideshows
;
; Public functions
; - DGRActionSlideshow
; - DGRSingle
;
;------------------------------------------------------------------------------
; DGRActionSlideshow
; display a slideshow of double lo-res action screenshots
;
; safe to call if machine only has 64K (does nothing and exits)
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen, which is blank
;------------------------------------------------------------------------------
DGRActionSlideshow
bit MachineStatus ; only run DGR slideshow if we have 128K
bvc DGRRTS
jsr LoadDGRTransition ; load transition effect code at $6000
jsr BlankDGR ; switch to DGR mode with initial blank screen
jsr okvs_iter ; cycle through all listed DGR files
!word gSlideshowStore
!word DGRActionCallback ; address of callback (called on each file)
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
;------------------------------------------------------------------------------
; DGRSingle
; display a single lo-res screenshot, with transition effect
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen
;------------------------------------------------------------------------------
DGRSingle
+ST16 IndexedDGRFilename
jsr BlankDGR ; switch to DGR mode with initial blank screen
jsr LoadIndexedDGRFile ; load DGR screen at $4000
jsr LoadDGRTransition ; load transition effect code at $6000
jsr ExecuteTransitionAt6000AndWait
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
;------------------------------------------------------------------------------
; LoadDGRTransition [private]
;
; in: none
; out: all registers and flags clobbered
; $6000..$BFFF/main contains transition effect code (probably not all
; of that, but no promises)
;------------------------------------------------------------------------------
LoadDGRTransition
jsr LoadIndexedFile
!word $6000
!word kDGRFizzleRecord
DGRRTS rts
;------------------------------------------------------------------------------
; DGRActionCallback [private]
; callback called by okvs_iter on gSlideshowStore
; to load and display a single DGR action screenshot
; in: A/Y contains address of filename (name only, path is always /ACTION.DGR/)
; $WINDEX contains 0-based index of the current record in gSlideshowStore (word)
; out: all registers and flags clobbered
; $0800..$1EFF preserved (this contains the gSlideshowStore OKVS data)
; $2000..$BFFF clobbered by graphics data and transition code
;------------------------------------------------------------------------------
DGRActionCallback
bit KBD
bmi DGRRTS
+ST16 IndexedDGRFilename
jsr FindGame
; if game name is not found (C will be set here), it means the game
; can't be played due to memory or joystick requirements, so we hide
; it from slideshows
bcs DGRRTS
jsr LoadIndexedDGRFile
jmp ExecuteTransitionAt6000AndWait
LoadIndexedDGRFile
; in: caller has set IndexedDGRFilename
; out: all flags & registers clobbered
jsr LoadIndexedFile ; load index file into $4A00
- !word $4A00
!word kDGRActionIndexRecord
jsr okvs_find
!word -
IndexedDGRFilename
!word $FDFD ; SMC
+ST16 @indexRecordPtr
jsr LoadIndexedFile ; load entire DGR screenshot at $4000..$47FF
!word $4000 ; because that's where the transition code expects to find it
; auxmem half is first ($4000..$43FF)
; mainmem half is second ($4400..$47FF)
@indexRecordPtr
!word $FDFD ; SMC
rts

View File

@ -211,11 +211,13 @@ RunAttractModule
!byte <DHGRActionSlideshow
!byte <SHRSlideshow
!byte <GRActionSlideshow
!byte <DGRActionSlideshow
@singleslo
!byte <HGRSingle
!byte <DHGRSingle
!byte <SHRSingle
!byte <GRSingle
!byte <DGRSingle
@slideshowshi
!byte >HGRTitleSlideshow
!byte >HGRActionSlideshow
@ -223,11 +225,13 @@ RunAttractModule
!byte >DHGRActionSlideshow
!byte >SHRSlideshow
!byte >GRActionSlideshow
!byte >DGRActionSlideshow
@singleshi
!byte >HGRSingle
!byte >DHGRSingle
!byte >SHRSingle
!byte >GRSingle
!byte >DGRSingle
DemoFilename
!byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

View File

@ -54,6 +54,22 @@ Home
lda TEXTMODE
jmp UnwaitForVBL
BlankDGR
jsr BlankDHGR
ldy #$2C ; BIT
sty PageFrom
ldx #$04
stx PageTo+2
jsr ClearToBlack
sta WRITEAUXMEM
ldx #$04
stx PageTo+2
jsr ClearToBlack
sta WRITEMAINMEM
lda #1
sta OffscreenPage
bne DGRMode ; always branches
;------------------------------------------------------------------------------
; BlankDHGR
; clear and show DHGR page 1 without flickering
@ -73,13 +89,20 @@ BlankDHGR
; /!\ execution falls through here to DHGRMode
;------------------------------------------------------------------------------
; DHGRMode
; switch to DHGR mode (HARDER THAN IT SOUNDS)
; DHGRMode / DGRMode
; switch to DHGR or DGR mode (HARDER THAN IT SOUNDS)
;
; in: none
; out: none
;------------------------------------------------------------------------------
DHGRMode
jsr +
jmp HGRMode
DGRMode
jsr +
bit $C056
jmp GRMode
+
; magic sequence to set colour mode on an RGB card
; SET80VID clears the RGB-card shift-register
; DHIRESON/OFF shifts that bit into the mode register
@ -98,8 +121,7 @@ DHGRMode
jsr ShowOtherPage
lda #1
sta gMachineInDHGRMode
jsr UnwaitForVBL
jmp HGRMode
jmp UnwaitForVBL
;------------------------------------------------------------------------------
; IsSearchKey

View File

@ -233,14 +233,15 @@ ClearMem
;------------------------------------------------------------------------------
CopyHGR
ldx #$20
ldy #$B9 ; LDY
ldy #$B9 ; LDA $0000,Y opcode
+ sty PageFrom
sta PageTo+2
ClearToBlack
lda #$00
ClearGR
ldy #0
PageFrom lda $FD00,y ; SMC
PageTo sta $FD00,y ; SMC
PageFrom lda $FD00,y ; SMC address high byte, also SMC opcode (might be BIT)
PageTo sta $FD00,y ; SMC address high byte
iny
bne PageFrom
inc PageFrom+2