pt3: measure overhead. Consistently about 17% across a wide range of pt3 files

This commit is contained in:
Vince Weaver 2019-05-19 17:23:36 -04:00
parent ba4cedbbac
commit db3d9fa93d
3 changed files with 78 additions and 4 deletions

View File

@ -16,7 +16,7 @@ pt3_player.dsk: PT3_PLAYER HELLO
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/EA.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/VC.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/OS.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/BA.PT3
# $(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/BA.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/CR.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/DF.PT3
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/F4.PT3
@ -33,17 +33,32 @@ pt3_player.dsk: PT3_PLAYER HELLO
$(DOS33) -y pt3_player.dsk BSAVE -a 0x4000 ./music/ND.PT3
pt3_debug.dsk: PT3_PLAYER PT3_DUMPER PT3_TIMER HELLO_DEBUG DUMP
pt3_debug.dsk: PT3_DUMPER PT3_TIMER HELLO_DEBUG DUMP
cp empty.dsk pt3_debug.dsk
$(DOS33) -y pt3_debug.dsk SAVE A HELLO_DEBUG HELLO
$(DOS33) -y pt3_debug.dsk SAVE A DUMP
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x1000 PT3_DUMPER
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x1000 PT3_PLAYER
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x1000 PT3_TIMER
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/SR.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/EA.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/VC.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/SR.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/OS.PT3
# $(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/BA.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/CR.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/DF.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/F4.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/FC.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/HI.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/I2.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/IT.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/MB.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/RI.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/SD.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/FR.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/CH.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/BH.PT3
$(DOS33) -y pt3_debug.dsk BSAVE -a 0x4000 ./music/ND.PT3
HELLO: hello.bas
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO

View File

@ -0,0 +1,47 @@
Code Optimization
~~~~~~~~~~~~~~~~~
The original working code is about 4k (not counting the pt3 file)
and has an overhead of roughly 20% when playing a song interrupt-driven
at 50Hz.
I'm keeping some stats here as I try to optimize the size and speed.
Song: "Summer of Rain"
~~~~~~~~~~~~~~~~~~~~~~
lz4 compressed
pt3 size: raw size: ym5 size: pt3.lz4:
3871 137015 7637 1793
Decoder Type size ZP use decode total CPU overhead
-------------------------------------------------------------
Original 4k(?) 22B 28.16s 171s 16%
Song: "Outer Space"
~~~~~~~~~~~~~~~~~~~
pt3 size
Times:
BH.PT3: 10.0B 16 1:33 93 17.2%
CH.PT3: 1D.12 29 2:49 169 17.2%
CR.PT3: 0F.25 15 1:30 90 16.7%
DF.PT3: 19.1C 25 2:27 147 17.0%
EA.PT3: 1E.13 30 2:53 173 17.3%
F4.PT3: 18.1D 24 2:16 136 17.6%
FC.PT3: 20.24 32 3:12 192 16.7%
FR.PT3: 0B.0A 11 1:01 61 18.0%
HI.PT3: 11.19 17 1:34 94 18.0%
I2.PT3: 1E.0C 30 2:59 179 16.8%
IT.PT3: 16.19 22 2:11 131 16.8%
MB.PT3: 14.08 20 1:59 119 16.8%
ND.PT3: 14.1C 20 1:52 112 17.9%
OS.PT3: 13.24 19 1:48 108 17.6%
RI.PT3: 0F.03 15 1:26 86 17.4%
SD.PT3: 11.16 17 1:40 100 17.0%
SR.PT3: 1F.22 31 2:51 171 18.1%
VC.PT3: 1B.20 27 2:40 160 16.9%

View File

@ -1,4 +1,4 @@
; VMW Chiptune Player
; PT3 Timer -- times how long it takes
.include "zp.inc"
@ -271,6 +271,9 @@ done_decrement:
song_list:
.asciiz "DF.PT3"
.include "song_list.inc"
;=========
@ -353,6 +356,8 @@ interrupt_simulator:
; bit $C404 ; clear 6522 interrupt by reading T1C-L ; 4
bit $1234
lda DONE_PLAYING ; 3
beq pt3_play_music ; if song done, don't play music ; 3/2nt
jmp check_keyboard ; 3
@ -363,6 +368,13 @@ pt3_play_music:
jsr pt3_make_frame
lda DONE_SONG
beq mb_write_frame
lda #$20
jmp quiet_exit
;======================================
; Write frames to Mockingboard
;======================================