Skip to content

Commit

Permalink
Add remaining PCM drivers disassembly
Browse files Browse the repository at this point in the history
  • Loading branch information
hansbonini committed Jul 11, 2024
1 parent 8573fc7 commit 9c85ac1
Show file tree
Hide file tree
Showing 25 changed files with 3,219 additions and 146 deletions.
185 changes: 54 additions & 131 deletions Altered Beast.asm

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ SJASMPLUS := $(TOOLS_DIR)/sjasmplus/sjasmplus.exe
all: extract build
build: z80_assemble 68k_assemble sha1
z80_assemble:
$(SJASMPLUS) --raw="$(Z80_DIR)/sounddriver.bin" --lst="$(Z80_DIR)/sounddriver.txt" "$(Z80_DIR)/sounddriver.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver1.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver1.txt" "$(Z80_DIR)/pcm_driver/pcm_driver1.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver2.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver2.txt" "$(Z80_DIR)/pcm_driver/pcm_driver2.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver3.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver3.txt" "$(Z80_DIR)/pcm_driver/pcm_driver3.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver4.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver4.txt" "$(Z80_DIR)/pcm_driver/pcm_driver4.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver5.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver5.txt" "$(Z80_DIR)/pcm_driver/pcm_driver5.asm"
$(SJASMPLUS) --raw="$(Z80_DIR)/pcm_driver/pcm_driver6.bin" --lst="$(Z80_DIR)/pcm_driver/pcm_driver6.txt" "$(Z80_DIR)/pcm_driver/pcm_driver6.asm"
68k_assemble:
$(ASM68K) $(ASM68K_SWITCHES) "$(NAME).asm","$(BUILD_DIR)/$(NAME) ($(REGION)) ($(VERSION)) [!].bin",,"$(BUILD_DIR)/$(NAME) ($(REGION)) ($(VERSION)) [!].txt"
sha1:
Expand Down
Binary file modified audio/pcm/000173B4.pcm
Binary file not shown.
Binary file modified audio/pcm/0001AFD4.pcm
Binary file not shown.
Binary file modified audio/pcm/0001CF56.pcm
Binary file not shown.
Binary file modified 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 @@ -4,7 +4,7 @@ loc_4924: ; CODE XREF: reset_z80+3A j
transfer_sounddriver_to_z80: ; CODE XREF: reset_z80+28 j
; play_sound+34 j
clr.l (dword_FFFE1A).w
clr.w (unk_FFFE26).w
clr.w (word_FFFE26).w
lea (z80snd_driver).l,a5
lea (Z80_RAM).l,a6
move.w #$1CB,d0
Expand All @@ -27,7 +27,7 @@ loc_4946: ; CODE XREF: reset_z80+74 j
move.b (a5)+,(a6)+
dbf d0,loc_4946
lea (byte_A01D03).l,a6
lea (unk_FFFE20).w,a5
lea (dword_FFFE20).w,a5
move.b (a5),(a6)+
move.b (a5),(a6)+
loc_4978: ; CODE XREF: play_sound+B2 j
Expand Down
2 changes: 1 addition & 1 deletion includes/helpers/load_pcm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ load_pcm: ; CODE XREF: play_sound+6 j
lea loc_4A46+4(pc,d0.w),a5
move.w (a5)+,d0
movea.l (a5),a5
move.w (unk_FFFE1E).w,d7
move.w (word_FFFE1E).w,d7
move.w #$100,(IO_Z80BUS).l ; Send the Z80 a bus request
loc_4A12: ; CODE XREF: play_sound+80 j
btst #0,(IO_Z80BUS).l ; Give the Z80 the bus back
Expand Down
4 changes: 2 additions & 2 deletions includes/helpers/play_sound.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ play_sound: ; CODE XREF: VBLANK+6E p
tst.w (dword_FFFE1A).w
beq.s locret_49DA
bmi.s load_pcm
move.b (unk_FFFE20).w,d0
move.b (dword_FFFE20).w,d0
andi.w #$7F,d0
cmpi.w #$F,d0
bhi.s loc_49B6
move.b bgm_list(pc,d0.w),(unk_FFFE20).w
move.b bgm_list(pc,d0.w),(dword_FFFE20).w
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_sound+2C j
Expand Down
2 changes: 1 addition & 1 deletion includes/helpers/reset_z80.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
reset_z80: ; CODE XREF: Reset+AA p
; ROM:screen_segalogo p ...
move.l #$80000000,(unk_FFFE20).w
move.l #$80000000,(dword_FFFE20).w
loc_48FA: ; CODE XREF: ROM:0000BAE4 p
; DATA XREF: ROM:0000BAE4 o
move.w #$100,(IO_Z80BUS).l ; Send the Z80 a bus request
Expand Down
2 changes: 1 addition & 1 deletion includes/helpers/write_z80ram_1d03.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ loc_4AD4: ; CODE XREF: write_z80ram_1d03+16 j
move.b d7,(byte_A01D03).l
move.w #0,(IO_Z80BUS).l ; Give the Z80 the bus back
loc_4AEC: ; CODE XREF: write_z80ram_1d03+4 j
move.b d7,(unk_FFFE20).w
move.b d7,(dword_FFFE20).w
rts
; End of function write_z80ram_1d03
11 changes: 5 additions & 6 deletions src/ram_addrs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ SEGARD_DECOMP_BUFFER equ $FFFFF400
unk_FFFE00 equ $FFFFFE00
DIFFICULTY equ $FFFFFE04
LIVES equ $FFFFFE06
unk_FFFE07 equ $FFFFFE07
BEAST equ $FFFFFE08
unk_FFFE12 equ $FFFFFE12
unk_FFFE14 equ $FFFFFE14
word_FFFE12 equ $FFFFFE12
word_FFFE14 equ $FFFFFE14
STAGE equ $FFFFFE16
byte_FFFE18 equ $FFFFFE18
dword_FFFE1A equ $FFFFFE1A
unk_FFFE1E equ $FFFFFE1E
unk_FFFE20 equ $FFFFFE20
unk_FFFE26 equ $FFFFFE26
word_FFFE1E equ $FFFFFE1E
dword_FFFE20 equ $FFFFFE20
word_FFFE26 equ $FFFFFE26
unk_FFFFFF equ $FFFFFFFF
Z80_RAM equ $A00000
byte_A0017F equ $A0017F
Expand Down
Loading

0 comments on commit 9c85ac1

Please sign in to comment.