-
Notifications
You must be signed in to change notification settings - Fork 0
/
chipnsfx_test.asm
86 lines (65 loc) · 1.29 KB
/
chipnsfx_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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
; to get square roots music : bndbuild disc Square\ Roots\ CHP.DSK get CHIP-SQR.BIN
; to build sna : basm chipnsfx_test.asm --sna -o chipnsfx.sna && AceDL chipnsfx.sna
org 0x1000
run $
di
ld hl, 0xc9fb
ld (0x38), hl
ld sp, $
ei
ld bc, 0xbc00 + 1 : out (c), c
ld bc, 0xbd00 + 0 : out (c), c
; song prebuilt/ no need to init
;ld hl, song_header
;call chip_song
loop
ld b, 0xf5
in a, (c)
rra
jr nc, loop
halt
halt
ld bc, 0x7f10 : out (c), c
ld bc, 0x7f4b : out (c), c
call chip_play
ld bc, 0x7f10 : out (c), c
ld bc, 0x7f40 : out (c), c
ld b, 100
wait defs 60
djnz wait
jp loop
writepsg ; A=BYTE,C=REG.; -
push bc
ld b,$F4
out (c),c
ld bc,$F6C0;SELECT
out (c),c
dw $71ED;CPC PLUS!
ld b,$F4
out (c),a
ld bc,$F680;UPDATE
out (c),c
dw $71ED;CPC PLUS!
pop bc
ret
; song-only and prebuilt chipnsfx_bss
CHIPNSFX_FLAG = 0 + 4 + 256
chipnsfx
include "music/chipnsfx.z80"
music
if 1
include "music/WARHAWK.asm"
chip_song_a = song_a
chip_song_b = song_b
chip_song_c = song_c
else
incbin "music/CHIP-SQR.BIN" ; header is automatically removed
chip_song_a = music + 0x00
chip_song_b = music + 0xbb
chip_song_c = music + 0x16b
;song_header:
; DEFW chip_song_a-$-2
; DEFW chip_song_b-$-2
; DEFW chip_song_c-$-2
endif
print "CHIPNSFX_TOTAL=", CHIPNSFX_TOTAL