consolidate FX

This commit is contained in:
Peter Ferrie 2021-10-07 23:28:11 -07:00
parent 21b7bec898
commit e63d2f473d
12 changed files with 853 additions and 427 deletions

48
bin/buildfx.js Normal file
View File

@ -0,0 +1,48 @@
a = new ActiveXObject("scripting.filesystemobject")
b = a.opentextfile(WScript.Arguments(0))
entries = []
while (!b.atendofstream)
{
c = b.readline()
d = c.indexOf("#")
if (d >= 0)
{
c = c.substr(0, d)
}
d = c.indexOf("=")
if (d >= 0)
{
c = c.substr(0, d)
}
if (c.indexOf("[") >= 0)
{
break
}
if (c.length > 0)
{
entries.push(c)
}
}
y = "build\\FX\\"
fx_off = 0
groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n"
for (i = 0; i < entries.length; i++)
{
groups += "!byte " + (1 + 1 + entries[i].length + 1 + 3).toString() + "\n" + "!byte " + entries[i].length.toString() + "\n" + "!text \"" + entries[i] + "\"\n" + "!byte 3"+ "\n" + "!be24 " + fx_off.toString() + "\n"
fx_off += a.getfile(y + entries[i]).size
}
f = a.createtextfile(WScript.Arguments(1))
f.write(groups)
f.close()
new ActiveXObject("wscript.shell").run('cmd /c %acme% -o ' + WScript.Arguments(2) + " " + WScript.Arguments(1))

20
bin/buildfxful.bat Normal file
View File

@ -0,0 +1,20 @@
@echo off
setlocal enabledelayedexpansion
1>nul copy /y nul %2
set f=0
for /f "tokens=*" %%a in (%1) do (
call :x %%a %2
)
goto:eof
:x
call :check %1
if !f!==2 goto:eof
if !f!==0 1>nul copy /b /y %2+build\FX\%1 %2
)
goto:eof
:check
set a=%1
if not x%a:#=%==x%a% set/a f=1
if not x%a:[=%==x%a% set/a f=2

View File

@ -6,6 +6,8 @@ GAMES.CONF=Type(04),AuxType(8000),Access(C3)
ATTRACT.DATA=Type(06),AuxType(6000),Access(C3)
FX.DATA=Type(06),AuxType(6000),Access(C3)
DFX.DATA=Type(06),AuxType(6000),Access(C3)
FXFUL=Type(06),AuxType(8000),Access(C3)
DFXFUL=Type(06),AuxType(8000),Access(C3)
COVER=Type(06),AuxType(2000),Access(C3)
TITLE=Type(06),AuxType(2000),Access(C3)
HELP=Type(06),AuxType(2000),Access(C3)

View File

@ -7,7 +7,7 @@
;
; LC RAM BANK 1
; D000..E789 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
; E941..FFF1 - main program code
; E910..FFF1 - main program code
; FFF2..FFF9 - API functions and global constants available for main program
; code, prelaunchers, transition effects, &c.
; (Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
@ -15,9 +15,9 @@
;
; LC RAM BANK 2
; D000..D3FF - ProRWTS data
; D400..D677 - ProRWTS code
; D678..DB9D - HGR font code & ProRWTS glue code
; DB9E..DBAD - backup of stack (during gameplay and self-running demos)
; D400..D66F - ProRWTS code
; D670..DB95 - HGR font code & ProRWTS glue code
; DB96..DBA5 - backup of stack (during gameplay and self-running demos)
; ...unused...
; DBB4..DBFF - (de)acceleration function
; DC00..DFFF - HGR font data
@ -147,12 +147,12 @@ CHEATS_ENABLED = %00001000
; shared symbols for prelaunch and effects to call ProRWTS2 functions
iCurBlockLo = $D401
iCurBlockHi = $D403
iProDOS_enter = $D678
LoadFileDirect = $DB01
iAuxReq = $DB27
launchpatch = $D616
iAddToPath = $FEC6
itraverse = $D8E0
iProDOS_enter = $D670
LoadFileDirect = $DAF9
iAuxReq = $DB1F
launchpatch = $D60E
iAddToPath = $FEB9
itraverse = $D8D8
ldrhi = $56
namlo = $57
namhi = $58

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018-2020 by 4am/qkumba
;(c) 2018-2021 by 4am & qkumba
;
; Ordered key/value store (6502 compatible)(256+ records compatible)
;

View File

@ -126,6 +126,14 @@ kDFXDataFile
!byte 8
!raw "DFX.DATA"
kFXFile
!byte 5
!raw "FXFUL"
kDFXFile
!byte 6
!raw "DFXFUL"
kCreditsFile
!byte 7
!raw "CREDITS"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018-2020 by 4am
;(c) 2018-2020 by 4am & qkumba
;
; Double hi-res slideshows
;
@ -123,7 +123,7 @@ ForceHGRMode
gMachineInDHGRMode=*+1
lda #$00 ; SMC
bne BlankHGR
beq DHGRRTS
rts
;------------------------------------------------------------------------------
; LoadDHGRTransition [private]
@ -144,7 +144,7 @@ LoadDHGRTransition
jsr pref_get ; get DHGR transition effect from prefs
!word kNextDFX
!word gDFXStore
+ST16 ++ ; A/Y = filename (don't load file yet)
+ST16 zpword ; A/Y = filename (don't load file yet)
; $WINDEX = index of the transition in DFX store
+LDADDR gDFXStore
jsr okvs_next ; get transition after this one
@ -154,11 +154,8 @@ LoadDHGRTransition
!word kNextDFX
+ !word $FDFD ; SMC
jsr LoadFile ; now load transition effect code into $6000
!word kFXDirectory
++ !word $FDFD ; SMC
!word $6000
rts
+LDADDR kDFXFile
jmp LoadFX
;------------------------------------------------------------------------------
; DHGRTitleCallback [private]

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018-2020 by 4am
;(c) 2018-2021 by 4am & qkumba
;
; HGR title and action slideshows
;
@ -37,7 +37,7 @@ HGRActionSlideshow
jsr okvs_iter ; cycle through all listed HGR files
!word gSlideshowStore
!word HGRActionCallback ; address of callback (called on each file)
rts ; exit with last picture still visible
HGRRTS rts ; exit with last picture still visible
;------------------------------------------------------------------------------
; HGRSingle
@ -75,7 +75,7 @@ LoadHGRTransition
jsr pref_get ; get HGR transition effect from prefs
!word kNextFX
!word gFXStore
+ST16 ++ ; A/Y = filename (don't load file yet)
+ST16 zpword ; A/Y = filename (don't load file yet)
; $WINDEX = index of the transition in FX store
+LDADDR gFXStore
jsr okvs_next ; get transition after this one
@ -85,11 +85,8 @@ LoadHGRTransition
!word kNextFX
+ !word $FDFD ; SMC
jsr LoadFile ; now load transition effect code into $6000
!word kFXDirectory
++ !word $FDFD ; SMC
!word $6000
HGRRTS rts
+LDADDR kFXFile
jmp LoadFX
;------------------------------------------------------------------------------
; HGRTitleCallback [private]

View File

@ -22,9 +22,8 @@
SHRSlideshow
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
and #SUPPORTS_SHR
bne +
SHRRTS rts
+ jsr LoadSHRTransition
beq SHRRTS
jsr LoadSHRTransition
jsr okvs_iter
!word gSlideshowStore
!word SHRArtworkCallback
@ -69,7 +68,7 @@ LoadSHRTransition
!word kFXDirectory
!word kSFXFizzleFile
!word $A000
rts
SHRRTS rts
;------------------------------------------------------------------------------
; SHRArtworkCallback [private]

View File

@ -1,5 +1,5 @@
;license:MIT
;(c) 2018-2020 by 4am
;(c) 2018-2021 by 4am & qkumba
;
; credits page
;
@ -67,3 +67,48 @@ Help
jsr LoadHelpOffscreen ; load fancy backdrop
ldx #7
bne - ; always branches
LoadFX
+ST16 @filename
inc $BF0E ; disable ROM mapping on return
ldx #2
ldy #0 ; SMC
lda (zpword), y
tay
iny
- iny
lda (zpword), y
sta @offset, x
dex
bpl -
jsr $bf00 ; yes, ProDOS abstraction
!byte $c8
!word @c8_parms
jsr $bf00
!byte $ce
!word @ce_parms
jsr $bf00
!byte $ca
!word @ca_parms
jsr $bf00
!byte $cc
!word @cc_parms
dec $BF0E ; re-enable ROM mapping on return
jmp SwitchToBank1
@c8_parms
!byte 3
@filename
!word $DFDF ; SMC
!byte 0
@ce_parms
!byte $d0
!byte 1
@offset !byte 0, 0, 0 ; SMC
!byte $ff
@ca_parms
!byte $ff
@cc_parms
!byte 1
!word $6000
!word $600

View File

@ -51,8 +51,10 @@ cscript /nologo bin\padto.js 512 build\PREFS.CONF
cscript /nologo bin\buildhelp.js "build\HELPFUL" "build\helper.inc" >>build\log
%ACME% -r build\helper.lst src\helper\helper.a >>build\log
cscript /nologo bin\buildokvs.js "res\ATTRACT.CONF" "build\ATTRACT.DATA" >>build\log
cscript /nologo bin\buildokvs.js "res\FX.CONF" "build\FX.DATA" >>build\log
cscript /nologo bin\buildokvs.js "res\DFX.CONF" "build\DFX.DATA" >>build\log
call bin\buildfxful.bat res\FX.CONF "build\FXFUL" >>build\log
call bin\buildfxful.bat res\DFX.CONF "build\DFXFUL" >>build\log
cscript /nologo bin\buildfx.js "res\FX.CONF" "build\fx.inc" "build\FX.DATA" >>build\log
cscript /nologo bin\buildfx.js "res\DFX.CONF" "build\dfx.inc" "build\DFX.DATA" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\TITLE" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\COVER" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\HELP" >>build\log
@ -67,6 +69,8 @@ cscript /nologo bin\dumpcr.js "build\HELPTEXT"
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPER" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPFUL" >>build\log
for %%q in (build\*.DATA) do %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "%%q" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\FXFUL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\DFXFUL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\DECRUNCH" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\JOYSTICK" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\Finder.Data" >>build\log
@ -97,7 +101,10 @@ cscript /nologo bin\buildfileinfo.js res\ICONS "CA" "0000" >>build/log
%CADIUS% RENAMEFILE "build\%DISK%" "/%VOLUME%/DEMO/SPCARTOON.44" "SPCARTOON.4." >>build\log
%CADIUS% RENAMEFILE "build\%DISK%" "/%VOLUME%/DEMO/SPCARTOON.55" "SPCARTOON.5." >>build\log
%CADIUS% RENAMEFILE "build\%DISK%" "/%VOLUME%/DEMO/SPCARTOON.66" "SPCARTOON.6." >>build\log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/FX" "build\FX" >>build\log
for %%q in (build\FX\*.DATA) do %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/FX" "%%q" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/FX/" "build\FX\COVERFADE" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/FX/" "build\FX\GR.FIZZLE" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/FX/" "build\FX\SHR.FIZZLE" >>build\log
for %%q in (res\dsk\*.po) do %CADIUS% EXTRACTVOLUME "%%q" build\X\ >>build\log
1>nul 2>nul del /s build\X\.DS_Store build\X\PRODOS build\X\LOADER.SYSTEM
%CADIUS% CREATEFOLDER "build\%DISK%" "/%VOLUME%/X/" >>build\log