Add conditional jump to music player

This commit is contained in:
Natt Akuma 2025-11-26 20:54:53 +07:00
parent c006e1a0a2
commit 6c7de32c6e
8 changed files with 42 additions and 5 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ loader/samples/minexample/*.o
loader/samples/minexample/*.zx0.prg loader/samples/minexample/*.zx0.prg
loader/samples/minexample/*.lz.prg loader/samples/minexample/*.lz.prg
loader/samples/minexample/*.tmp loader/samples/minexample/*.tmp
loader/samples/minexample/song0.bin

View file

@ -131,7 +131,7 @@ DISKIMAGE = $(BUILDDIR)/$(NAME)-$(_PLATFORM_).d64
AS_FLAGS = -Wa -I../../../shared -I ../../include -u __EXEHDR__ AS_FLAGS = -Wa -I../../../shared -I ../../include -u __EXEHDR__
ZX0PRGS = \ ZX0PRGS = \
use_this_sid.zx0.prg \ song0.zx0.prg \
badguy.zx0.prg \ badguy.zx0.prg \
title_320-prepared.zx0.prg \ title_320-prepared.zx0.prg \
tower.zx0.prg \ tower.zx0.prg \
@ -180,7 +180,7 @@ $(DISKIMAGE): $(ASSEMBLE) $(CC1541) $(ZX0PRGS) $(LZPRGS) font.bin
$(RM) $@ $(RM) $@
$(CC1541) -n "otomata labs" -i " 2025" \ $(CC1541) -n "otomata labs" -i " 2025" \
-f "ys2intro" -w $< \ -f "ys2intro" -w $< \
-f "song0" -w use_this_sid.zx0.prg \ -f "song0" -w song0.zx0.prg \
-f "badguy" -w badguy.zx0.prg \ -f "badguy" -w badguy.zx0.prg \
-f "font" -w font.bin \ -f "font" -w font.bin \
-f "intrbmp" -w title_320-prepared.zx0.prg \ -f "intrbmp" -w title_320-prepared.zx0.prg \
@ -226,7 +226,7 @@ $(ZX02):
$(PRINTF) "\x00\x90" | cat - $@.tmp > $@ $(PRINTF) "\x00\x90" | cat - $@.tmp > $@
$(RM) $@.tmp $(RM) $@.tmp
use_this_sid.bin: ys2_port_legato.fur song0.bin: ys2_fixed_drums.fur
cd $(FURC64) && ./convert.sh $(abspath $<) cd $(FURC64) && ./convert.sh $(abspath $<)
cp $(FURC64)/asm/song.bin $@ cp $(FURC64)/asm/song.bin $@

View file

@ -116,6 +116,7 @@ fil_hi_n: .res CHIP_AMT
base: .res 1 base: .res 1
chipnum: .res 1 chipnum: .res 1
has_played: .res chnum has_played: .res chnum
extin: .res 1
vars_len = *-start_vars vars_len = *-start_vars
.endmacro .endmacro
@ -357,6 +358,7 @@ init:
jmp initaddr jmp initaddr
play: play:
jmp playaddr jmp playaddr
jmp extaddr
.byte " furC64 driver by AArt1256" .byte " furC64 driver by AArt1256"
.if actual_use_zp = 0 .if actual_use_zp = 0
@ -779,6 +781,18 @@ effectF0:
jmp begnote jmp begnote
.endmacro .endmacro
.macro add_EExx
effectF2:
get_patzp
ldx extin
beq :+
sta patind
lda #$ff
sta jumppat
:
jmp begnote
.endmacro
add_09xx add_09xx
add_0Fxx add_0Fxx
add_00xx add_00xx
@ -796,6 +810,7 @@ add_E5xx
add_EAxx add_EAxx
add_ECxx add_ECxx
add_4xxx add_4xxx
add_EExx
other_effects: other_effects:
lda effects_temp lda effects_temp
@ -866,11 +881,11 @@ effect_smc:
jmp cont_advance jmp cont_advance
eff_lo: eff_lo:
.repeat $12, I .repeat $13, I
.lobytes .ident(.concat ("effect", .sprintf("%02X",I+$e0))) .lobytes .ident(.concat ("effect", .sprintf("%02X",I+$e0)))
.endrepeat .endrepeat
eff_hi: eff_hi:
.repeat $12, I .repeat $13, I
.hibytes .ident(.concat ("effect", .sprintf("%02X",I+$e0))) .hibytes .ident(.concat ("effect", .sprintf("%02X",I+$e0)))
.endrepeat .endrepeat
@ -2142,6 +2157,12 @@ clamp_note:
: :
rts rts
.proc extaddr
sta extin
lda patind
rts
.endproc
note_table_lo: note_table_lo:
.incbin "note_lo.bin" .incbin "note_lo.bin"
note_table_hi: note_table_hi:

View file

@ -44,6 +44,7 @@ def comp(pat):
elif pat[i] == 0xEF: i += 1 elif pat[i] == 0xEF: i += 1
elif pat[i] == 0xF0: i += 1 elif pat[i] == 0xF0: i += 1
elif pat[i] == 0xF1: i += 2 elif pat[i] == 0xF1: i += 2
elif pat[i] == 0xF2: i += 2
elif pat[i] == 0xFF: i += 2 elif pat[i] == 0xFF: i += 2
elif pat[i] == 0xFD: elif pat[i] == 0xFD:
i += 1 i += 1
@ -114,6 +115,11 @@ def conv_pattern(pattern):
temp.extend([0xED, k[1]]) temp.extend([0xED, k[1]])
has0Dxx = 0 has0Dxx = 0
continue continue
if k[0] == 0xEE:
new_byte = 1
temp.extend([0xF2, k[1]])
has0Dxx = 0
continue
if (k[0] == 0x09 or k[0] == 0x0F) and (speed_type == 1): if (k[0] == 0x09 or k[0] == 0x0F) and (speed_type == 1):
new_byte = 1 new_byte = 1
temp.extend([0xE1, k[1]]) temp.extend([0xE1, k[1]])

View file

@ -1502,6 +1502,15 @@ part_10:
@finish: @finish:
jsr position_2x_to_display jsr position_2x_to_display
part_11:
; tell the music to end and wait
:
lda #1
jsr $a006
cmp #17
bne :-
jmp end
.res ((*+$ff)&$ff00|2)-* .res ((*+$ff)&$ff00|2)-*
end: end:
ldx #<fontname ldx #<fontname

Binary file not shown.