-
Notifications
You must be signed in to change notification settings - Fork 2
/
music_test.asm
70 lines (60 loc) · 1.08 KB
/
music_test.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
.include "x16.inc"
.org $080D
.segment "STARTUP"
.segment "INIT"
.segment "ONCE"
.segment "CODE"
jmp start
.include "filenames.asm"
.include "loadbank.asm"
.include "irq.asm"
.include "globals.asm"
.include "music.asm"
.macro PRINT_STRING str_arg
.scope
jmp end_string
string_begin: .byte str_arg
end_string:
lda #<string_begin
sta ZP_PTR_1
lda #>string_begin
sta ZP_PTR_1+1
ldx #(end_string-string_begin)
ldy #0
loop:
lda (ZP_PTR_1),y
jsr CHROUT
iny
dex
bne loop
.endscope
.endmacro
.macro PRINT_CR
lda #$0D
jsr CHROUT
.endmacro
start:
PRINT_STRING "playing music.bin"
PRINT_CR
PRINT_STRING "press spacebar to stop playback"
PRINT_CR
; store additional binaries to banked RAM
jsr loadbank
; setup interrupts
jsr init_irq
mainloop:
wai
lda vsync_trig
beq mainloop
jsr GETIN
cmp #$20
bne @continue
jsr stop_music
PRINT_CR
bra @exit
@continue:
jsr music_tick
stz vsync_trig
bra mainloop
@exit:
rts