From bf86cb788b6c0013a2defdbd4209c165d9e94f2d Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 11 Mar 2020 21:19:42 -0700 Subject: [PATCH] accelerate decompression --- Makefile | 4 ++-- src/prorwts2.a | 4 +--- src/ui.attract.hgr.a | 6 +++++- src/ui.attract.shr.a | 8 ++++++-- winmake.bat | 14 ++++++++++---- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 9acc922f1..c255d0027 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,10 @@ dsk: md asm compress for f in res/title.hgr res/title.dhgr res/action.hgr res/action.dhgr res/action.gr res/artwork.shr res/attract res/ss res/demo res/title.animated; do rsync -aP "$$f"/* build/$$(basename $$f | tr '[:lower:]' '[:upper:]') >>build/log; done bin/buildfileinfo.sh build/TITLE.HGR "06" "4000" >>build/log bin/buildfileinfo.sh build/TITLE.DHGR "06" "4000" >>build/log - bin/buildfileinfo.sh build/ACTION.HGR "06" "4000" >>build/log + bin/buildfileinfo.sh build/ACTION.HGR "06" "3FF8" >>build/log bin/buildfileinfo.sh build/ACTION.DHGR "06" "4000" >>build/log bin/buildfileinfo.sh build/ACTION.GR "06" "6000" >>build/log - bin/buildfileinfo.sh build/ARTWORK.SHR "C1" "2000" >>build/log + bin/buildfileinfo.sh build/ARTWORK.SHR "06" "1FF8" >>build/log bin/buildfileinfo.sh build/ATTRACT "04" "8000" >>build/log bin/buildfileinfo.sh build/SS "04" "4000" >>build/log rsync -aP res/fx/* build/FX >>build/log diff --git a/src/prorwts2.a b/src/prorwts2.a index e5170037c..98c32b889 100644 --- a/src/prorwts2.a +++ b/src/prorwts2.a @@ -2577,9 +2577,8 @@ attribpatch !if allow_subdir = 1 { plp bcs hddrdwrfilei - } else { ;allow_subdir = 0 -++ } ;allow_subdir = 1 +++ } ;rwts_mode = 1 hddrdwrpart @@ -2590,7 +2589,6 @@ hddrdwrfile hddrdwrfilex !if allow_subdir = 1 { clc -++ } ;allow_subdir = 1 !if (no_interrupts + (rwts_mode xor 1)) > 1 { !if detect_err = 1 { diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index 256a45942..64950037c 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -173,6 +173,8 @@ HGRActionCallback ; $0200..$02CB clobbered by decompressor ;------------------------------------------------------------------------------ DecompressHGR + jsr SwitchToBank2 + jsr EnableAccelerator clc lda sizelo2 adc #$F8 @@ -180,4 +182,6 @@ DecompressHGR lda sizehi2 adc #$3F sta _byte_hi - jmp decrunch + jsr decrunch + jsr DisableAccelerator + jmp SwitchToBank1 diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 76e336291..e1747062c 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -97,7 +97,7 @@ SHRArtworkCallback jsr BlankSHR - ; load compressed SHR artwork at $1FF8/main (not aux) + ; load compressed SHR artwork at $1FF0/main (not aux) jsr LoadFile !word kSHRArtworkDirectory @sfname !word $FDFD @@ -154,6 +154,8 @@ BlankSHR ; $0200..$02CB clobbered by decompressor ;------------------------------------------------------------------------------ DecompressSHR + jsr SwitchToBank2 + jsr EnableAccelerator clc lda sizelo2 adc #$F8 @@ -161,4 +163,6 @@ DecompressSHR lda sizehi2 adc #$1F sta _byte_hi - jmp decrunch + jsr decrunch + jsr DisableAccelerator + jmp SwitchToBank1 diff --git a/winmake.bat b/winmake.bat index 6a64c6bc1..6bc2f6a3a 100644 --- a/winmake.bat +++ b/winmake.bat @@ -40,6 +40,7 @@ goto :EOF if "%1" equ "dsk" ( :dsk call :asm +call :compress 2>nul del build\log 1>nul copy /y res\blank.2mg "build\%DISK%" >>build\log 1>nul copy /y res\_FileInformation.txt build\ >>build\log @@ -56,21 +57,21 @@ for %%q in (build\*.CONF) do %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "%%q" %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPTEXT" >>build\log cscript /nologo bin\rsync.js res\title.hgr\* build\TITLE.HGR >>build\log cscript /nologo bin\rsync.js res\title.dhgr\* build\TITLE.DHGR >>build\log -for %%q in (res\action.hgr\*) do if not exist build\%%~nxq %EXOMIZER% res\action.hgr\%%~nxq@0x4000 -o build\ACTION.HGR\%%~nxq +cscript /nologo bin\rsync.js res\action.hgr\* build\ACTION.HGR >>build\log cscript /nologo bin\rsync.js res\title.dgr\* build\TITLE.DGR >>build\log cscript /nologo bin\rsync.js res\action.dhgr\* build\ACTION.DHGR >>build\log cscript /nologo bin\rsync.js res\action.gr\* build\ACTION.GR >>build\log -for %%q in (res\artwork.shr\*) do if not exist build\%%~nxq %EXOMIZER% res\artwork.shr\%%~nxq@0x2000 -o build\ARTWORK.SHR\%%~nxq +cscript /nologo bin\rsync.js res\artwork.shr\* build\ARTWORK.SHR >>build\log cscript /nologo bin\rsync.js res\attract\* build\ATTRACT >>build\log cscript /nologo bin\rsync.js res\ss\* build\SS >>build\log cscript /nologo bin\rsync.js res\demo\* build\DEMO >>build\log cscript /nologo bin\rsync.js res\title.animated\* build\TITLE.ANIMATED >>build\log cscript /nologo bin\buildfileinfo.js build\TITLE.HGR "06" "4000" >>build\log cscript /nologo bin\buildfileinfo.js build\TITLE.DHGR "06" "4000" >>build\log -cscript /nologo bin\buildfileinfo.js build\ACTION.HGR "06" "4000" >>build\log +cscript /nologo bin\buildfileinfo.js build\ACTION.HGR "06" "3FF8" >>build\log cscript /nologo bin\buildfileinfo.js build\ACTION.DHGR "06" "4000" >>build\log cscript /nologo bin\buildfileinfo.js build\ACTION.GR "06" "6000" >>build\log -cscript /nologo bin\buildfileinfo.js build\ARTWORK.SHR "C1" "2000" >>build\log +cscript /nologo bin\buildfileinfo.js build\ARTWORK.SHR "06" "1FF8" >>build\log cscript /nologo bin\buildfileinfo.js build\ATTRACT "04" "8000" >>build\log cscript /nologo bin\buildfileinfo.js build\SS "04" "4000" >>build\log cscript /nologo bin\rsync.js res\fx\* build\FX >>build\log @@ -153,3 +154,8 @@ for %%q in (src\prelaunch\*.a) do ( for %%q in (res\title.hgr\*) do if not exist build\prelaunch\%%~nxq 1>nul copy build\prelaunch\standard build\prelaunch\%%~nxq for %%q in (res\title.dhgr\*) do if not exist build\prelaunch\%%~nxq 1>nul copy build\prelaunch\standard build\prelaunch\%%~nxq ) +goto :EOF + +:compress +for %%q in (res\action.hgr.uncompressed\*) do if not exist res\action.hgr\%%~nxq %EXOMIZER% res\action.hgr.uncompressed\%%~nxq@0x4000 -o res\action.hgr\%%~nxq +for %%q in (res\artwork.shr.uncompressed\*) do if not exist res\artwork.shr\%%~nxq %EXOMIZER% res\artwork.shr.uncompressed\%%~nxq@0x2000 -o res\artwork.shr\%%~nxq