summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-09-19 11:26:16 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-09-19 11:26:16 -0400
commita6eab76914cd395f62789b43b2674a7bd4bbaca7 (patch)
tree16252d661eef832b5e108a15fa5b15dd850fcafb
parent1253640dc41e845453cbfd42c0c85382f0be3a59 (diff)
More bank3f documentation and a bit of audio.asm prep
-rw-r--r--audio.asm12
-rw-r--r--audio/headers/musicheaders3.asm2
-rw-r--r--engine/bank3f/main.asm189
-rwxr-xr-xwram.asm4
-rwxr-xr-xyellow/main.asm1
5 files changed, 192 insertions, 16 deletions
diff --git a/audio.asm b/audio.asm
index 55bf4a1b..15ec17a9 100644
--- a/audio.asm
+++ b/audio.asm
@@ -50,8 +50,6 @@ INCLUDE "audio/sfx/muted_snare2_1.asm"
INCLUDE "audio/sfx/muted_snare3_1.asm"
INCLUDE "audio/sfx/muted_snare4_1.asm"
-Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/start_menu_1.asm"
INCLUDE "audio/sfx/pokeflute.asm"
INCLUDE "audio/sfx/cut_1.asm"
@@ -125,7 +123,7 @@ INCLUDE "audio/sfx/cry1f_1.asm"
INCLUDE "audio/sfx/cry20_1.asm"
INCLUDE "audio/sfx/cry21_1.asm"
INCLUDE "audio/sfx/cry22_1.asm"
-
+Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
SECTION "Sound Effects 2", ROMX, BANK[AUDIO_2]
@@ -149,8 +147,6 @@ INCLUDE "audio/sfx/muted_snare2_2.asm"
INCLUDE "audio/sfx/muted_snare3_2.asm"
INCLUDE "audio/sfx/muted_snare4_2.asm"
-Audio2_WavePointers: INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/press_ab_2.asm"
INCLUDE "audio/sfx/start_menu_2.asm"
INCLUDE "audio/sfx/tink_2.asm"
@@ -250,7 +246,7 @@ INCLUDE "audio/sfx/cry1f_2.asm"
INCLUDE "audio/sfx/cry20_2.asm"
INCLUDE "audio/sfx/cry21_2.asm"
INCLUDE "audio/sfx/cry22_2.asm"
-
+Audio2_WavePointers: INCLUDE "audio/wave_instruments.asm"
SECTION "Sound Effects 3", ROMX, BANK[AUDIO_3]
@@ -274,8 +270,6 @@ INCLUDE "audio/sfx/muted_snare2_3.asm"
INCLUDE "audio/sfx/muted_snare3_3.asm"
INCLUDE "audio/sfx/muted_snare4_3.asm"
-Audio3_WavePointers: INCLUDE "audio/wave_instruments.asm"
-
INCLUDE "audio/sfx/start_menu_3.asm"
INCLUDE "audio/sfx/cut_3.asm"
INCLUDE "audio/sfx/go_inside_3.asm"
@@ -357,7 +351,7 @@ INCLUDE "audio/sfx/cry1f_3.asm"
INCLUDE "audio/sfx/cry20_3.asm"
INCLUDE "audio/sfx/cry21_3.asm"
INCLUDE "audio/sfx/cry22_3.asm"
-
+Audio3_WavePointers: INCLUDE "audio/wave_instruments.asm"
SECTION "Audio Engine 1", ROMX, BANK[AUDIO_1]
diff --git a/audio/headers/musicheaders3.asm b/audio/headers/musicheaders3.asm
index 7846e48f..75633a7a 100644
--- a/audio/headers/musicheaders3.asm
+++ b/audio/headers/musicheaders3.asm
@@ -71,8 +71,6 @@ Music_IntroBattle:: ; 7c294 (1f:4294)
dw Music_IntroBattle_Ch2
db CH2
dw Music_IntroBattle_Ch3
- db CH3
- dw Music_IntroBattle_Ch4
; Power Plant, Unknown Dungeon, Rocket HQ
Music_Dungeon1:: ; 7c2a0 (1f:42a0)
diff --git a/engine/bank3f/main.asm b/engine/bank3f/main.asm
index c20c5fd0..830723da 100644
--- a/engine/bank3f/main.asm
+++ b/engine/bank3f/main.asm
@@ -1080,11 +1080,194 @@ Func_fcb71: ; fcb71 (3f:4b71)
ret
Func_fcb84: ; fcb84 (3f:4b84)
- dr $fcb84,$fcba1
+ push bc
+ ld hl,wd437
+ ld [hl],$ff
+ inc hl
+ ld bc,$10
+ xor a
+ call FillMemory
+ pop bc
+ ret
+
+Func_fcb94: ; fcb94 (3f:4b94)
+ ld hl,wd437
+ inc [hl]
+ ld e,[hl]
+ ld d,0
+ ld hl,wd438
+ add hl,de
+ ld [hl],a
+ ret
+
Func_fcba1: ; fcba1 (3f:4ba1)
- dr $fcba1,$fcc08
+ call Func_fcb84
+ call Func_fcbac
+ ret c
+ call Func_fcb94
+ ret
+
+Func_fcbac: ; fcbac (3f:4bac)
+ ld bc,wSpriteStateData1 + $f0
+ ld hl,$104
+ add hl,bc
+ ld a,[W_YCOORD]
+ add $4
+ sub [hl]
+ jr z,.asm_fcbd7
+ jr c,.asm_fcbca
+ call Func_fcc01
+ jr c,.asm_fcbc6
+ ld a,$5
+ and a
+ ret
+.asm_fcbc6
+ ld a,$1
+ and a
+ ret
+.asm_fcbca
+ call Func_fcc01
+ jr c,.asm_fcbd3
+ ld a,$6
+ and a
+ ret
+.asm_fcbd3
+ ld a,$2
+ and a
+ ret
+.asm_fcbd7
+ ld hl,$105
+ add hl,bc
+ ld a,[W_XCOORD]
+ add $4
+ sub [hl]
+ jr z,.asm_fcbff
+ jr c,.asm_fcbf2
+ call Func_fcc01
+ jr c,.asm_fcbee
+ ld a,$8
+ and a
+ ret
+.asm_fcbee
+ ld a,$4
+ and a
+ ret
+.asm_fcbf2
+ call Func_fcc01
+ jr c,.asm_fcbfb
+ ld a,$7
+ and a
+ ret
+.asm_fcbfb
+ ld a,$3
+ and a
+ ret
+.asm_fcbff
+ scf
+ ret
+
+Func_fcc01: ; fcc01 (3f:4c01)
+ jr nc,.asm_fcc05
+ cpl
+ inc a
+.asm_fcc05
+ cp $2
+ ret
+
Func_fcc08:: ; fcc08 (3f:4c08)
- dr $fcc08,$fcc92
+ call Func_fcc23
+ ret nc
+ ld a,[wd736]
+ bit 6,a
+ jr nz,.asm_fcc1b
+ call Func_fcc42
+ ret c
+ call Func_fcb94
+ ret
+.asm_fcc1b
+ call Func_fcc64
+ ret c
+ call Func_fcb94
+ ret
+
+Func_fcc23: ; fcc23 (3f:4c28)
+ ld a,[wd430]
+ bit 5,a
+ jr nz,.asm_fcc40
+ ld a,[wd430]
+ bit 7,a
+ jr nz,.asm_fcc40
+ ld a,[wd472]
+ bit 7,a
+ jr z,.asm_fcc40
+ ld a,[wWalkBikeSurfState]
+ and a
+ jr nz,.asm_fcc40
+ scf
+ ret
+.asm_fcc40
+ and a
+ ret
+
+Func_fcc42: ; fcc42 (3f:4c42)
+ xor a
+ ld a,[wPlayerDirection]
+ bit 3,a
+ jr nz,.asm_fcc58
+ bit 2,a
+ jr nz,.asm_fcc5b
+ bit 1,a
+ jr nz,.asm_fcc5e
+ bit 0,a
+ jr nz,.asm_fcc61
+ scf
+ ret
+.asm_fcc58
+ ld a,$2
+ ret
+.asm_fcc5b
+ ld a,$1
+ ret
+.asm_fcc5e
+ ld a,$3
+ ret
+.asm_fcc61
+ ld a,$4
+ ret
+
+Func_fcc64: ; fcc64 (3f:4c64)
+ ld hl,wd430
+ bit 6,[hl]
+ jr z,.asm_fcc6e
+ res 6,[hl]
+ ret
+.asm_fcc6e
+ set 6,[hl]
+ xor a
+ ld a,[wPlayerDirection]
+ bit 3,a
+ jr nz,.asm_fcc86
+ bit 2,a
+ jr nz,.asm_fcc89
+ bit 1,a
+ jr nz,.asm_fcc8c
+ bit 0,a
+ jr nz,.asm_fcc8f
+ scf
+ ret
+.asm_fcc86
+ ld a,$6
+ ret
+.asm_fcc89
+ ld a,$5
+ ret
+.asm_fcc8c
+ ld a,$7
+ ret
+.asm_fcc8f
+ ld a,$8
+ ret
+
Func_fcc92: ; fcc92 (3f:4c92)
dr $fcc92,$fccb2
Func_fccb2:: ; fccb2 (3f:4cb2)
diff --git a/wram.asm b/wram.asm
index 0222922e..e8284909 100755
--- a/wram.asm
+++ b/wram.asm
@@ -2508,8 +2508,10 @@ wd433:: ds 1 ; d432
wd434:: ds 1
wd435:: ds 1
wd436:: ds 1
+wd437:: ds 1
+wd438:: ds 1
- ds 17
+ ds 15
wExpressionNumber::
ds 1
diff --git a/yellow/main.asm b/yellow/main.asm
index caa2b49c..2734efc4 100755
--- a/yellow/main.asm
+++ b/yellow/main.asm
@@ -75,7 +75,6 @@ _DisplayPokedex: ; 7c18 (1:7abf)
dr $7abf,$8000
SECTION "bank02",ROMX,BANK[$02]
-
dr $8000,$9064
PlayBattleMusic: ; 9064 (2:5064)
dr $9064,$909d