Skip to content

Commit

Permalink
Update PCM sample offset because PCM data have embbeded driver
Browse files Browse the repository at this point in the history
  • Loading branch information
hansbonini committed Jul 9, 2024
1 parent 06f26ec commit b0a30e2
Show file tree
Hide file tree
Showing 11 changed files with 3,219 additions and 916 deletions.
4,109 changes: 3,206 additions & 903 deletions Altered Beast.asm

Large diffs are not rendered by default.

Binary file renamed audio/pcm/0001376C.pcm → audio/pcm/000138EC.pcm
Binary file not shown.
Binary file renamed audio/pcm/000154AC.pcm → audio/pcm/0001552C.pcm
Binary file not shown.
Binary file renamed audio/pcm/00017234.pcm → audio/pcm/000173B4.pcm
Binary file not shown.
Binary file renamed audio/pcm/0001AE54.pcm → audio/pcm/0001AFD4.pcm
Binary file not shown.
Binary file renamed audio/pcm/0001CDD6.pcm → audio/pcm/0001CF56.pcm
Binary file not shown.
Binary file renamed audio/pcm/0001ED58.pcm → audio/pcm/0001EED8.pcm
Binary file not shown.
4 changes: 2 additions & 2 deletions includes/helpers/init_z80.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ loc_4924: ; CODE XREF: reset_z80+3A j
btst #0,(IO_Z80BUS).l
bne.s loc_4924
transfer_sounddriver_to_z80: ; CODE XREF: reset_z80+28 j
; play_bgm+34 j
; play_sound+34 j
clr.l (dword_FFFE1A).w
clr.w (word_FFFE26).w
lea (z80snd_driver).l,a5
Expand Down Expand Up @@ -30,7 +30,7 @@ loc_4946: ; CODE XREF: reset_z80+74 j
lea (dword_FFFE20).w,a5
move.b (a5),(a6)+
move.b (a5),(a6)+
loc_4978: ; CODE XREF: play_bgm+B2 j
loc_4978: ; CODE XREF: play_sound+B2 j
move.w #0,(IO_Z80RES).l ; Disable the Z80 reset
move.w #0,(IO_Z80BUS).l ; Give the Z80 the bus back
moveq #9,d0
Expand Down
12 changes: 6 additions & 6 deletions includes/helpers/load_pcm.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load_pcm: ; CODE XREF: play_bgm+6 j
load_pcm: ; CODE XREF: play_sound+6 j
bclr #7,(dword_FFFE1A).w
move.w (dword_FFFE1A).w,d0
add.w d0,d0
Expand All @@ -9,11 +9,11 @@ load_pcm: ; CODE XREF: play_bgm+6 j
movea.l (a5),a5
move.w (word_FFFE1E).w,d7
move.w #$100,(IO_Z80BUS).l
loc_4A12: ; CODE XREF: play_bgm+80 j
loc_4A12: ; CODE XREF: play_sound+80 j
btst #0,(IO_Z80BUS).l
bne.s loc_4A12
lea (Z80_RAM).l,a6
loc_4A22: ; CODE XREF: play_bgm+A8 j
loc_4A22: ; CODE XREF: play_sound+A8 j
move.b (a5)+,(a6)+
move.b (a5)+,(a6)+
move.b (a5)+,(a6)+
Expand All @@ -31,12 +31,12 @@ loc_4A22: ; CODE XREF: play_bgm+A8 j
move.b (a5)+,(a6)+
move.b (a5)+,(a6)+
dbf d0,loc_4A22
loc_4A46: ; DATA XREF: play_bgm+64 o
loc_4A46: ; DATA XREF: play_sound+64 o
move.b d7,(byte_A0017F).l
bra.w loc_4978
; End of function play_bgm
; End of function play_sound
; ---------------------------------------------------------------------------
dacdriver_list: dc.w $1C4 ; entries.size
pcm_list: dc.w $1C4 ; entries.size
dc.l pcm_1 ; entries.offset
dc.w $1E8 ; entries.size
dc.l pcm_2 ; entries.offset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
play_bgm: ; CODE XREF: VBLANK+6E p
play_sound: ; CODE XREF: VBLANK+6E p
tst.w (dword_FFFE1A).w
beq.s locret_49DA
bmi.s load_pcm
Expand All @@ -7,13 +7,13 @@ play_bgm: ; CODE XREF: VBLANK+6E p
cmpi.w #$F,d0
bhi.s loc_49B6
move.b bgm_list(pc,d0.w),(dword_FFFE20).w
loc_49B6: ; CODE XREF: play_bgm+14 j
loc_49B6: ; CODE XREF: play_sound+14 j
move.w #$100,(IO_Z80BUS).l ; Send the Z80 a bus request
loc_49BE: ; CODE XREF: play_bgm+2C j
loc_49BE: ; CODE XREF: play_sound+2C j
btst #0,(IO_Z80BUS).l
bne.s loc_49BE
tst.b (byte_A0017F).l
beq.w transfer_sounddriver_to_z80
move.w #0,(IO_Z80BUS).l ; Give the Z80 the bus back
locret_49DA: ; CODE XREF: play_bgm+4 j
locret_49DA: ; CODE XREF: play_sound+4 j
rts
2 changes: 1 addition & 1 deletion includes/interrupts/vblank.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ loc_A7C0: ; CODE XREF: VBLANK+4A j
loc_A7DA: ; CODE XREF: VBLANK+56 j
; VBLANK+60 j
clr.b (byte_FFB154).w
jsr (play_bgm).l
jsr (play_sound).l
movem.l (sp)+,d0-d7/a0-a6
locret_A7E8: ; CODE XREF: ROM:loc_A7EA j
rte
Expand Down

0 comments on commit b0a30e2

Please sign in to comment.