mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-10 13:29:57 +00:00
double: use pt3 music
should fit in the blank
This commit is contained in:
parent
fd9cf82d2c
commit
0cdf8b01c8
|
@ -211,10 +211,7 @@ skip_all_checks:
|
||||||
;========================
|
;========================
|
||||||
|
|
||||||
jsr mockingboard_init
|
jsr mockingboard_init
|
||||||
jsr mockingboard_setup_interrupt
|
; jsr mockingboard_setup_interrupt
|
||||||
|
|
||||||
|
|
||||||
zurg:
|
|
||||||
|
|
||||||
;============================
|
;============================
|
||||||
; Init the Mockingboard
|
; Init the Mockingboard
|
||||||
|
@ -385,46 +382,35 @@ stringing_done:
|
||||||
|
|
||||||
sta FULLGR
|
sta FULLGR
|
||||||
|
|
||||||
|
|
||||||
;==============
|
;==============
|
||||||
; set up music
|
; set up music
|
||||||
;==============
|
;==============
|
||||||
|
|
||||||
lda #0
|
lda #<fighting_zx02
|
||||||
sta CURRENT_CHUNK
|
sta ZX0_src
|
||||||
sta DONE_PLAYING
|
|
||||||
sta BASE_FRAME_L
|
|
||||||
|
|
||||||
; set up first song
|
lda #>fighting_zx02
|
||||||
|
sta ZX0_src+1
|
||||||
|
|
||||||
lda #<music_parts_l
|
lda #$b0 ; decompress at $b000
|
||||||
sta chunk_l_smc+1
|
|
||||||
lda #>music_parts_l
|
|
||||||
sta chunk_l_smc+2
|
|
||||||
|
|
||||||
lda #<music_parts_h
|
jsr full_decomp
|
||||||
sta chunk_h_smc+1
|
|
||||||
lda #>music_parts_h
|
|
||||||
sta chunk_h_smc+2
|
|
||||||
|
|
||||||
lda #$D0
|
PT3_LOC = $b000
|
||||||
sta CHUNK_NEXT_LOAD ; Load at $D0
|
|
||||||
jsr load_song_chunk
|
|
||||||
|
|
||||||
lda #$D0 ; music starts at $d000
|
;==================
|
||||||
sta CHUNK_NEXT_PLAY
|
; init song
|
||||||
sta BASE_FRAME_H
|
;==================
|
||||||
|
|
||||||
|
jsr pt3_init_song
|
||||||
|
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta DONE_PLAYING
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
sta LOOP
|
sta LOOP
|
||||||
; sta CURRENT_CHUNK
|
|
||||||
sta LOAD_NEXT_CHUNK
|
|
||||||
|
|
||||||
; switch in language card
|
|
||||||
; read/write RAM, $d000 bank 2
|
|
||||||
|
|
||||||
lda $C08b
|
|
||||||
lda $C08b
|
|
||||||
|
|
||||||
;=================================
|
;=================================
|
||||||
; main static loop
|
; main static loop
|
||||||
|
@ -433,10 +419,7 @@ stringing_done:
|
||||||
|
|
||||||
double_loop:
|
double_loop:
|
||||||
|
|
||||||
|
jsr fake_interrupt
|
||||||
jsr load_music
|
|
||||||
jsr play_music
|
|
||||||
|
|
||||||
|
|
||||||
; note, coming out of vblank routines might be
|
; note, coming out of vblank routines might be
|
||||||
; 8-12 cycles in already
|
; 8-12 cycles in already
|
||||||
|
@ -587,9 +570,11 @@ wait_until_keypress:
|
||||||
|
|
||||||
|
|
||||||
.include "pt3_lib_detect_model.s"
|
.include "pt3_lib_detect_model.s"
|
||||||
.include "pt3_lib_mockingboard_detect.s"
|
.include "pt3_lib_core.s"
|
||||||
|
.include "pt3_lib_init.s"
|
||||||
.include "pt3_lib_mockingboard_setup.s"
|
.include "pt3_lib_mockingboard_setup.s"
|
||||||
.include "interrupt_handler.s"
|
.include "interrupt_handler.s"
|
||||||
|
.include "pt3_lib_mockingboard_detect.s"
|
||||||
.include "pt3_lib_mockingboard_patch.s"
|
.include "pt3_lib_mockingboard_patch.s"
|
||||||
|
|
||||||
.include "zx02_optim.s"
|
.include "zx02_optim.s"
|
||||||
|
@ -629,41 +614,11 @@ config_string:
|
||||||
.include "gr_fast_clear.s"
|
.include "gr_fast_clear.s"
|
||||||
.include "wait_a_bit.s"
|
.include "wait_a_bit.s"
|
||||||
.include "wait.s"
|
.include "wait.s"
|
||||||
.include "load_music.s"
|
;.include "load_music.s"
|
||||||
|
|
||||||
music_parts_h:
|
|
||||||
.byte >fighting_part1_zx02,>fighting_part2_zx02,>fighting_part3_zx02
|
|
||||||
.byte >fighting_part4_zx02,>fighting_part5_zx02,>fighting_part6_zx02
|
|
||||||
.byte >fighting_part7_zx02,>fighting_part8_zx02,>fighting_part9_zx02
|
|
||||||
.byte >fighting_part10_zx02
|
|
||||||
.byte $00
|
|
||||||
|
|
||||||
music_parts_l:
|
fighting_zx02:
|
||||||
.byte <fighting_part1_zx02,<fighting_part2_zx02,<fighting_part3_zx02
|
.incbin "music/fighting.zx02"
|
||||||
.byte <fighting_part4_zx02,<fighting_part5_zx02,<fighting_part6_zx02
|
|
||||||
.byte <fighting_part7_zx02,<fighting_part8_zx02,<fighting_part9_zx02
|
|
||||||
.byte <fighting_part10_zx02
|
|
||||||
|
|
||||||
fighting_part1_zx02:
|
|
||||||
.incbin "music/fighting.part1.zx02"
|
|
||||||
fighting_part2_zx02:
|
|
||||||
.incbin "music/fighting.part2.zx02"
|
|
||||||
fighting_part3_zx02:
|
|
||||||
.incbin "music/fighting.part3.zx02"
|
|
||||||
fighting_part4_zx02:
|
|
||||||
.incbin "music/fighting.part4.zx02"
|
|
||||||
fighting_part5_zx02:
|
|
||||||
.incbin "music/fighting.part5.zx02"
|
|
||||||
fighting_part6_zx02:
|
|
||||||
.incbin "music/fighting.part6.zx02"
|
|
||||||
fighting_part7_zx02:
|
|
||||||
.incbin "music/fighting.part7.zx02"
|
|
||||||
fighting_part8_zx02:
|
|
||||||
.incbin "music/fighting.part8.zx02"
|
|
||||||
fighting_part9_zx02:
|
|
||||||
.incbin "music/fighting.part9.zx02"
|
|
||||||
fighting_part10_zx02:
|
|
||||||
.incbin "music/fighting.part10.zx02"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,176 +18,56 @@
|
||||||
; to be sure status flag and accumulator set properly
|
; to be sure status flag and accumulator set properly
|
||||||
|
|
||||||
interrupt_handler:
|
interrupt_handler:
|
||||||
.if 0
|
; php ; save status flags
|
||||||
php ; save status flags
|
; cld ; clear decimal mode
|
||||||
cld ; clear decimal mode
|
; pha ; save A ; 3
|
||||||
pha ; save A ; 3
|
|
||||||
; A is saved in $45 by firmware
|
; A is saved in $45 by firmware
|
||||||
txa
|
; txa
|
||||||
pha ; save X
|
; pha ; save X
|
||||||
tya
|
; tya
|
||||||
pha ; save Y
|
; pha ; save Y
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; inc $0404 ; debug (flashes char onscreen)
|
; inc $0404 ; debug (flashes char onscreen)
|
||||||
|
|
||||||
inc TIMER_COUNT
|
|
||||||
|
|
||||||
pt3_irq_smc1:
|
fake_interrupt:
|
||||||
bit MOCK_6522_T1CL ; clear 6522 interrupt by reading T1C-L ; 4
|
|
||||||
.endif
|
|
||||||
|
|
||||||
play_music:
|
.include "pt3_lib_irq_handler.s"
|
||||||
lda DONE_PLAYING ; 3
|
|
||||||
beq ym_play_music ; if song done, don't play music ; 3/2nt
|
|
||||||
jmp done_pt3_irq_handler ; 3
|
|
||||||
;============
|
|
||||||
; 13
|
|
||||||
|
|
||||||
ym_play_music:
|
jmp exit_interrupt
|
||||||
|
|
||||||
; see if need to pre-load next chunk
|
;=================================
|
||||||
lda BASE_FRAME_L
|
; Finally done with this interrupt
|
||||||
cmp #1
|
;=================================
|
||||||
bne no_preload_chunk
|
|
||||||
|
|
||||||
lda BASE_FRAME_H
|
quiet_exit:
|
||||||
and #1
|
stx DONE_PLAYING
|
||||||
bne no_preload_chunk
|
jsr clear_ay_both
|
||||||
|
|
||||||
inc LOAD_NEXT_CHUNK ; defer this until after interrupt
|
ldx #$ff ; also mute the channel
|
||||||
|
stx AY_REGISTERS+7 ; just in case
|
||||||
no_preload_chunk:
|
|
||||||
|
|
||||||
lda BASE_FRAME_L ; reset frame pointer to beginning
|
|
||||||
sta CURRENT_FRAME_L
|
|
||||||
lda BASE_FRAME_H
|
|
||||||
sta CURRENT_FRAME_H
|
|
||||||
|
|
||||||
ldx #0
|
|
||||||
frame_loop:
|
|
||||||
ldy #0
|
|
||||||
lda (CURRENT_FRAME_L),Y
|
|
||||||
cmp #$ff
|
|
||||||
bne all_good
|
|
||||||
cpx #1 ; see if A coarse is $FF
|
|
||||||
beq go_next_chunk ; if so, end of song, loop
|
|
||||||
|
|
||||||
all_good:
|
|
||||||
jsr update_ay_register ; output to the AY
|
|
||||||
|
|
||||||
clc
|
|
||||||
lda CURRENT_FRAME_H ; next register set is 2 pages away
|
|
||||||
adc #$2 ; was 4
|
|
||||||
sta CURRENT_FRAME_H
|
|
||||||
|
|
||||||
inx
|
|
||||||
cpx #12 ; only output 11 regs
|
|
||||||
bne frame_loop
|
|
||||||
|
|
||||||
|
|
||||||
inc BASE_FRAME_L ; increment frame ptr (16bit)
|
exit_interrupt:
|
||||||
bne not_oflo
|
|
||||||
|
|
||||||
inc BASE_FRAME_H ; wrap to next page
|
|
||||||
lda BASE_FRAME_H ; if too big, go to next chunk
|
|
||||||
and #$3
|
|
||||||
cmp #$2 ; was D4
|
|
||||||
bne not_oflo
|
|
||||||
|
|
||||||
go_next_chunk:
|
|
||||||
lda CHUNK_NEXT_PLAY ; toggle $D0/$E8
|
|
||||||
eor #$38
|
|
||||||
sta CHUNK_NEXT_PLAY
|
|
||||||
sta BASE_FRAME_H
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta BASE_FRAME_L ; in case song ended early
|
|
||||||
|
|
||||||
inc CURRENT_CHUNK ; point to next chunk
|
|
||||||
|
|
||||||
; inc LOAD_NEXT_CHUNK ; defer this until after interrupt
|
|
||||||
; jsr load_song_chunk
|
|
||||||
|
|
||||||
|
|
||||||
not_oflo:
|
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.if 0
|
; pla
|
||||||
exit_interrupt:
|
; tay ; restore Y
|
||||||
|
; pla
|
||||||
pla
|
; tax ; restore X
|
||||||
tay ; restore Y
|
; pla ; restore a ; 4
|
||||||
pla
|
|
||||||
tax ; restore X
|
|
||||||
pla ; restore a ; 4
|
|
||||||
|
|
||||||
; on II+/IIe (but not IIc) we need to do this?
|
; on II+/IIe (but not IIc) we need to do this?
|
||||||
interrupt_smc:
|
interrupt_smc:
|
||||||
lda $45 ; restore A
|
; lda $45 ; restore A
|
||||||
plp
|
; plp
|
||||||
|
|
||||||
rti ; return from interrupt ; 6
|
; rti ; return from interrupt ; 6
|
||||||
|
|
||||||
;============
|
;============
|
||||||
; typical
|
; typical
|
||||||
; ???? cycles
|
; ???? cycles
|
||||||
|
|
||||||
.endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=========================
|
|
||||||
; update ay_register
|
|
||||||
; reg in X
|
|
||||||
; value in A
|
|
||||||
|
|
||||||
update_ay_register:
|
|
||||||
|
|
||||||
pt3_irq_smc2:
|
|
||||||
stx MOCK_6522_ORA1 ; put address on PA1 ; 4
|
|
||||||
stx MOCK_6522_ORA2 ; put address on PA2 ; 4
|
|
||||||
ldy #MOCK_AY_LATCH_ADDR ; latch_address for PB1 ; 2
|
|
||||||
pt3_irq_smc3:
|
|
||||||
sty MOCK_6522_ORB1 ; latch_address on PB1 ; 4
|
|
||||||
sty MOCK_6522_ORB2 ; latch_address on PB2 ; 4
|
|
||||||
ldy #MOCK_AY_INACTIVE ; go inactive ; 2
|
|
||||||
pt3_irq_smc4:
|
|
||||||
sty MOCK_6522_ORB1 ; 4
|
|
||||||
sty MOCK_6522_ORB2 ; 4
|
|
||||||
|
|
||||||
; value
|
|
||||||
pt3_irq_smc5:
|
|
||||||
sta MOCK_6522_ORA1 ; put value on PA1 ; 4
|
|
||||||
sta MOCK_6522_ORA2 ; put value on PA2 ; 4
|
|
||||||
lda #MOCK_AY_WRITE ; ; 2
|
|
||||||
pt3_irq_smc6:
|
|
||||||
sta MOCK_6522_ORB1 ; write on PB1 ; 4
|
|
||||||
sty MOCK_6522_ORB1 ; 4
|
|
||||||
pt3_irq_smc7:
|
|
||||||
sta MOCK_6522_ORB2 ; write on PB2 ; 4
|
|
||||||
sty MOCK_6522_ORB2 ; 4
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
done_pt3_irq_handler:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
disable_music:
|
|
||||||
|
|
||||||
; sei
|
|
||||||
|
|
||||||
ldx #1
|
|
||||||
stx DONE_PLAYING
|
|
||||||
jsr clear_ay_both
|
|
||||||
|
|
||||||
; mute the sound
|
|
||||||
|
|
||||||
ldx #7
|
|
||||||
lda #$ff
|
|
||||||
jsr update_ay_register
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
|
@ -1,55 +1,16 @@
|
||||||
YM5_TO_RAW = ~/research/vmw-meter.git/ay-3-8910/conversion_tools/ym5_to_raw
|
|
||||||
YM_TO_YM5 = ~/research/vmw-meter.git/ay-3-8910/conversion_tools/ym_to_ym5
|
|
||||||
RAW_INTERLEAVE = ~/research/vmw-meter.git/ay-3-8910/conversion_tools/raw_interleave
|
|
||||||
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
|
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
|
||||||
|
|
||||||
all: fighting.part1.zx02 fighting.part2.zx02 fighting.part3.zx02 \
|
all: fighting.zx02
|
||||||
fighting.part4.zx02 fighting.part5.zx02 fighting.part6.zx02 \
|
|
||||||
fighting.part7.zx02 fighting.part8.zx02 fighting.part9.zx02 \
|
|
||||||
fighting.part10.zx02
|
|
||||||
|
|
||||||
fighting.raw: fighting.ym
|
|
||||||
$(YM5_TO_RAW) ./fighting.ym > fighting.raw
|
|
||||||
|
|
||||||
####
|
###
|
||||||
|
|
||||||
fighting.part1: fighting.raw
|
|
||||||
$(RAW_INTERLEAVE) -m 11 -c 512 ./fighting
|
|
||||||
|
|
||||||
fighting.part1.zx02: fighting.part1
|
|
||||||
$(ZX02) fighting.part1 fighting.part1.zx02
|
|
||||||
|
|
||||||
fighting.part2.zx02: fighting.part2
|
|
||||||
$(ZX02) fighting.part2 fighting.part2.zx02
|
|
||||||
|
|
||||||
fighting.part3.zx02: fighting.part3
|
|
||||||
$(ZX02) fighting.part3 fighting.part3.zx02
|
|
||||||
|
|
||||||
fighting.part4.zx02: fighting.part4
|
|
||||||
$(ZX02) fighting.part4 fighting.part4.zx02
|
|
||||||
|
|
||||||
fighting.part5.zx02: fighting.part5
|
|
||||||
$(ZX02) fighting.part5 fighting.part5.zx02
|
|
||||||
|
|
||||||
fighting.part6.zx02: fighting.part6
|
|
||||||
$(ZX02) fighting.part6 fighting.part6.zx02
|
|
||||||
|
|
||||||
fighting.part7.zx02: fighting.part7
|
|
||||||
$(ZX02) fighting.part7 fighting.part7.zx02
|
|
||||||
|
|
||||||
fighting.part8.zx02: fighting.part8
|
|
||||||
$(ZX02) fighting.part8 fighting.part8.zx02
|
|
||||||
|
|
||||||
fighting.part9.zx02: fighting.part9
|
|
||||||
$(ZX02) fighting.part9 fighting.part9.zx02
|
|
||||||
|
|
||||||
fighting.part10.zx02: fighting.part10
|
|
||||||
$(ZX02) fighting.part10 fighting.part10.zx02
|
|
||||||
|
|
||||||
|
fighting.zx02: fighting.pt3
|
||||||
|
$(ZX02) fighting.pt3 fighting.zx02
|
||||||
|
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
|
clean:
|
||||||
clean:
|
rm -f *~ *.o *.lst *.zx02
|
||||||
rm -f *.zx02 *.part1 *.part2 *.part3 *.part4 *.part5 *.part6 *.part7 *.part8 *.part9 *.part10
|
|
||||||
|
|
BIN
vaporlock/doubledouble/music/fighting.pt3
Normal file
BIN
vaporlock/doubledouble/music/fighting.pt3
Normal file
Binary file not shown.
Binary file not shown.
1993
vaporlock/doubledouble/pt3_lib_core.s
Normal file
1993
vaporlock/doubledouble/pt3_lib_core.s
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -20,24 +20,45 @@ BASH = $29
|
||||||
V2 = $2D
|
V2 = $2D
|
||||||
COLOR = $30
|
COLOR = $30
|
||||||
|
|
||||||
; ym player
|
; pt3 player
|
||||||
CURRENT_FRAME_L = $70
|
|
||||||
CURRENT_FRAME_H = $71
|
|
||||||
BASE_FRAME_L = $72
|
|
||||||
BASE_FRAME_H = $73
|
|
||||||
CURRENT_CHUNK = $74
|
|
||||||
TIME_MINUTES = $75
|
|
||||||
TIME_SECONDS = $76
|
|
||||||
CURSOR_X = $77
|
|
||||||
|
|
||||||
DRAW_PAGE = $7A
|
ORNAMENT_L = $60
|
||||||
|
ORNAMENT_H = $61
|
||||||
|
SAMPLE_L = $62
|
||||||
|
SAMPLE_H = $63
|
||||||
|
|
||||||
CHUNK_NEXT_LOAD = $7D
|
LOOP = $64
|
||||||
CHUNK_NEXT_PLAY = $7E
|
MB_ADDR_L = $65
|
||||||
LOAD_NEXT_CHUNK = $7F
|
MB_ADDR_H = $66
|
||||||
TIMER_COUNT = $81
|
MB_VALUE = $67
|
||||||
|
DONE_PLAYING = $68
|
||||||
|
DONE_SONG = $69
|
||||||
|
PT3_TEMP = $6A
|
||||||
|
APPLEII_MODEL = $6B
|
||||||
|
|
||||||
APPLEII_MODEL = $8B
|
|
||||||
|
AY_REGISTERS = $70
|
||||||
|
A_FINE_TONE = $70
|
||||||
|
A_COARSE_TONE = $71
|
||||||
|
B_FINE_TONE = $72
|
||||||
|
B_COARSE_TONE = $73
|
||||||
|
C_FINE_TONE = $74
|
||||||
|
C_COARSE_TONE = $75
|
||||||
|
NOISE = $76
|
||||||
|
ENABLE = $77
|
||||||
|
PT3_MIXER_VAL = $77
|
||||||
|
A_VOLUME = $78
|
||||||
|
B_VOLUME = $79
|
||||||
|
C_VOLUME = $7A
|
||||||
|
ENVELOPE_FINE = $7B
|
||||||
|
ENVELOPE_COARSE = $7C
|
||||||
|
ENVELOPE_SHAPE = $7D
|
||||||
|
|
||||||
|
PATTERN_L = $7E
|
||||||
|
PATTERN_H = $7F
|
||||||
|
|
||||||
|
|
||||||
|
DRAW_PAGE = $8A
|
||||||
|
|
||||||
SOUND_STATUS = $DE
|
SOUND_STATUS = $DE
|
||||||
SOUND_DISABLED = $80
|
SOUND_DISABLED = $80
|
||||||
|
@ -55,12 +76,12 @@ TEMPY = $F0
|
||||||
XX = $F1
|
XX = $F1
|
||||||
|
|
||||||
; rest of pt3_player
|
; rest of pt3_player
|
||||||
LOOP = $F4
|
;LOOP = $F4
|
||||||
MB_VALUE = $F5
|
;MB_VALUE = $F5
|
||||||
MB_ADDR_L = $F6
|
;MB_ADDR_L = $F6
|
||||||
MB_ADDR_H = $F7
|
;MB_ADDR_H = $F7
|
||||||
DONE_PLAYING = $F8
|
;DONE_PLAYING = $F8
|
||||||
DONE_SONG = $F9
|
;DONE_SONG = $F9
|
||||||
|
|
||||||
|
|
||||||
YPOS = $FA
|
YPOS = $FA
|
||||||
|
|
Loading…
Reference in New Issue
Block a user