-
Notifications
You must be signed in to change notification settings - Fork 5
/
vgm_demo.asm
74 lines (50 loc) · 1.22 KB
/
vgm_demo.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
ORG 0
INCLUDE "lib/exomiser.h.asm"
ORG &1900
.start
INCLUDE "lib/exomiser.asm"
INCLUDE "lib/vgmplayer.asm"
INCLUDE "lib/irq.asm"
.event_handler
{
php
cmp #4
bne not_vsync
\\ Preserve registers
pha:txa:pha:tya:pha
; prevent re-entry
lda re_entrant
bne skip_update
inc re_entrant
\\ Poll the music player
jsr vgm_poll_player
dec re_entrant
.skip_update
\\ Restore registers
pla:tay:pla:tax:pla
\\ Return
.not_vsync
plp
rts
.re_entrant EQUB 0
}
.main
{
LDX #LO(&3000)
LDY #HI(&3000)
JSR vgm_init_stream
\\ Start our event driven fx
ldx #LO(event_handler)
ldy #HI(event_handler)
JSR start_eventv
rts
}
ORG &3000
INCBIN "music/vgm_out/Chris Kelly - SMS Power 15th Anniversary Competitions - Collision Chaos.bin.exo"
.end
SAVE "Main", start, end, main
PUTFILE "music/vgm_out/BotB 16433 Slimeball - Fluid Dynamics.bin.exo", "V.FLUID", &3000, &3000
PUTFILE "music/vgm_out/ne7-magic_beansmaster_system_psg.bin.exo", "V.MAGIC", &3000, &3000
PUTFILE "music/vgm_out/Chris Kelly - SMS Power 15th Anniversary Competitions - Collision Chaos.bin.exo", "V.CHAOS", &3000, &3000
PRINT "Vgm Player Size = ", (vgm_player_end-vgm_player_start)
PRINT "Exo Compressor Size = ", (exo_end-exo_start)