Merge branch 'master' into fix_nonmatching

This commit is contained in:
PikalaxALT 2018-02-07 00:55:50 -05:00
commit c28d691ff2
146 changed files with 59826 additions and 4424 deletions

View File

@ -55,5 +55,6 @@ matrix:
- ./build_tools.sh
- make -j2 ruby_de
- make -j2 sapphire_de
- make -j2 ruby_de_debug
allow_failures:
- env: _="Formatting"

View File

@ -19,9 +19,9 @@ PREPROC := tools/preproc/preproc
SCANINC := tools/scaninc/scaninc
RAMSCRGEN := tools/ramscrgen/ramscrgen
ASFLAGS := -mcpu=arm7tdmi -I include --defsym $(GAME_VERSION)=1 --defsym REVISION=$(GAME_REVISION) --defsym $(GAME_LANGUAGE)=1
ASFLAGS := -mcpu=arm7tdmi -I include --defsym $(GAME_VERSION)=1 --defsym REVISION=$(GAME_REVISION) --defsym $(GAME_LANGUAGE)=1 --defsym DEBUG=$(DEBUG)
CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef -Werror -Wno-trigraphs -D $(GAME_VERSION) -D REVISION=$(GAME_REVISION) -D $(GAME_LANGUAGE)
CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef -Werror -Wno-trigraphs -D $(GAME_VERSION) -D REVISION=$(GAME_REVISION) -D $(GAME_LANGUAGE) -D DEBUG=$(DEBUG)
#### Files ####
@ -100,12 +100,12 @@ clean: tidy
$(RM) $(ALL_OBJECTS)
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.rl' \) -exec rm {} +
ALL_BUILDS := ruby ruby_rev1 ruby_rev1 sapphire sapphire_rev1 sapphire_rev2 ruby_de sapphire_de
ALL_BUILDS := ruby ruby_rev1 ruby_rev1 sapphire sapphire_rev1 sapphire_rev2 ruby_de sapphire_de ruby_de_debug
tidy:
$(RM) $(ALL_BUILDS:%=poke%{.gba,.elf,.map})
$(RM) -r build
%.gba: %.elf
$(ROM): %.gba: %.elf
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
%.elf: $(LD_SCRIPT) $(ALL_OBJECTS)
@ -138,6 +138,7 @@ sapphire_rev1: ; @$(MAKE) --no-print-directory GAME_VERSION=SAPPHIRE GAME_REVISI
sapphire_rev2: ; @$(MAKE) --no-print-directory GAME_VERSION=SAPPHIRE GAME_REVISION=2
ruby_de: ; @$(MAKE) --no-print-directory GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN
sapphire_de: ; @$(MAKE) --no-print-directory GAME_VERSION=SAPPHIRE GAME_LANGUAGE=GERMAN
ruby_de_debug: ; @$(MAKE) --no-print-directory GAME_VERSION=RUBY GAME_LANGUAGE=GERMAN DEBUG=1
#### Graphics Rules ####

View File

@ -794,6 +794,77 @@ _0800DAB0: .4byte 0x0600d000
_0800DAB4: .4byte gBattleTerrainPalette_BattleTower
thumb_func_end DrawMainBattleBackground
.if DEBUG
thumb_func_start sub_800DAB8
sub_800DAB8:
.syntax divided
push {r4, r5, lr}
add sp, sp, #0xfffffffc
ldr r0, ._113 @ gUnknown_08D00000
mov r1, #0xc0
lsl r1, r1, #0x13
bl LZDecompressVram
ldr r0, ._113 + 4 @ gUnknown_08D00524
ldr r4, ._113 + 8 @ 0x600c000
mov r2, #0x80
lsl r2, r2, #0x4
add r1, r4, #0
bl CpuSet
ldr r0, ._113 + 12 @ gUnknown_08D004E0
mov r1, #0x0
mov r2, #0x40
bl LoadCompressedPalette
bl sub_800D74C
bl DrawMainBattleBackground
ldr r0, ._113 + 16 @ gBattleTypeFlags
ldrh r1, [r0]
mov r0, #0x2
and r0, r0, r1
cmp r0, #0
beq ._112 @cond_branch
ldr r0, ._113 + 20 @ 0x6000600
mov r1, #0x0
add r2, r4, #0
mov r3, #0x1
bl debug_sub_8008218
ldr r5, ._113 + 24 @ 0x101
mov r4, #0x1
str r4, [sp]
add r0, r5, #0
mov r1, #0x3
mov r2, #0x1
mov r3, #0x3
bl debug_sub_8008264
str r4, [sp]
add r0, r5, #0
mov r1, #0x3
mov r2, #0x15
mov r3, #0x3
bl debug_sub_8008264
str r4, [sp]
add r0, r5, #0
mov r1, #0x3
mov r2, #0x29
mov r3, #0x3
bl debug_sub_8008264
._112:
add sp, sp, #0x4
pop {r4, r5}
pop {r0}
bx r0
._114:
.align 2, 0
._113:
.word gUnknown_08D00000
.word gUnknown_08D00524
.word 0x600c000
.word gUnknown_08D004E0
.word gBattleTypeFlags
.word 0x6000600
.word 0x101
.syntax unified
thumb_func_end sub_800DAB8
.else
thumb_func_start sub_800DAB8
sub_800DAB8: @ 800DAB8
push {lr}
@ -820,6 +891,7 @@ _0800DAEC: .4byte gUnknown_08D00524
_0800DAF0: .4byte 0x0600c000
_0800DAF4: .4byte gUnknown_08D004E0
thumb_func_end sub_800DAB8
.endif
thumb_func_start sub_800DAF8
sub_800DAF8: @ 800DAF8

View File

@ -1387,6 +1387,176 @@ _08036AFE:
bx r1
thumb_func_end AI_ShouldSwitch
.if DEBUG
thumb_func_start sub_8036B0C
sub_8036B0C:
.syntax divided
push {r4, r5, r6, lr}
ldr r5, ._205 @ gBattleTypeFlags
ldrh r1, [r5]
mov r0, #0x8
and r0, r0, r1
cmp r0, #0
bne ._197 @cond_branch
b ._216
._197:
bl AI_ShouldSwitch
lsl r0, r0, #0x18
cmp r0, #0
bne ._199 @cond_branch
b ._200
._199:
ldr r4, ._205 + 4 @ 0x2000000
ldr r0, ._205 + 8 @ gActiveBank
ldrb r0, [r0]
bl GetBankIdentity
lsl r0, r0, #0x18
lsr r0, r0, #0x19
ldr r1, ._205 + 12 @ 0x160c8
add r0, r0, r1
add r0, r0, r4
ldrb r0, [r0]
cmp r0, #0x6
bne ._201 @cond_branch
bl sub_8036CD4
lsl r0, r0, #0x18
lsr r4, r0, #0x18
cmp r4, #0x6
bne ._211 @cond_branch
ldrh r1, [r5]
mov r0, #0x1
and r0, r0, r1
cmp r0, #0
bne ._203 @cond_branch
mov r0, #0x1
bl GetBankByIdentity
lsl r0, r0, #0x18
lsr r5, r0, #0x18
add r6, r5, #0
b ._204
._206:
.align 2, 0
._205:
.word gBattleTypeFlags
.word 0x2000000
.word gActiveBank
.word 0x160c8
._203:
mov r0, #0x1
bl GetBankByIdentity
lsl r0, r0, #0x18
lsr r6, r0, #0x18
mov r0, #0x3
bl GetBankByIdentity
lsl r0, r0, #0x18
lsr r5, r0, #0x18
._204:
mov r4, #0x0
._212:
mov r0, #0x64
mul r0, r0, r4
ldr r1, ._214 @ gEnemyParty
add r0, r0, r1
mov r1, #0x39
bl GetMonData
cmp r0, #0
beq ._210 @cond_branch
ldr r1, ._214 + 4 @ gBattlePartyID
lsl r0, r6, #0x1
add r0, r0, r1
ldrh r0, [r0]
cmp r4, r0
beq ._210 @cond_branch
lsl r0, r5, #0x1
add r0, r0, r1
ldrh r0, [r0]
cmp r4, r0
beq ._210 @cond_branch
ldr r1, ._214 + 8 @ 0x2000000
ldr r2, ._214 + 12 @ 0x16068
add r0, r6, r2
add r0, r0, r1
ldrb r0, [r0]
cmp r4, r0
beq ._210 @cond_branch
add r0, r5, r2
add r0, r0, r1
ldrb r0, [r0]
cmp r4, r0
bne ._211 @cond_branch
._210:
add r4, r4, #0x1
cmp r4, #0x5
ble ._212 @cond_branch
._211:
ldr r0, ._214 + 16 @ gActiveBank
ldrb r0, [r0]
bl GetBankIdentity
ldr r1, ._214 + 8 @ 0x2000000
lsl r0, r0, #0x18
lsr r0, r0, #0x19
ldr r3, ._214 + 20 @ 0x160c8
add r0, r0, r3
add r0, r0, r1
strb r4, [r0]
._201:
ldr r4, ._214 + 16 @ gActiveBank
ldrb r0, [r4]
bl GetBankIdentity
ldr r2, ._214 + 8 @ 0x2000000
ldrb r1, [r4]
ldr r3, ._214 + 12 @ 0x16068
add r1, r1, r3
add r1, r1, r2
lsl r0, r0, #0x18
lsr r0, r0, #0x19
add r3, r3, #0x60
add r0, r0, r3
add r0, r0, r2
ldrb r0, [r0]
strb r0, [r1]
b ._217
._215:
.align 2, 0
._214:
.word gEnemyParty
.word gBattlePartyID
.word 0x2000000
.word 0x16068
.word gActiveBank
.word 0x160c8
._200:
ldr r0, ._218 @ gUnknown_02023A14
ldrb r1, [r0]
mov r0, #0x20
and r0, r0, r1
cmp r0, #0
bne ._216 @cond_branch
bl AI_ShouldUseItem
lsl r0, r0, #0x18
cmp r0, #0
bne ._217 @cond_branch
._216:
ldr r0, ._218 + 4 @ gActiveBank
ldrb r0, [r0]
mov r2, #0x1
eor r2, r2, r0
lsl r2, r2, #0x8
mov r0, #0x1
mov r1, #0x0
bl Emitcmd33
._217:
pop {r4, r5, r6}
pop {r0}
bx r0
._219:
.align 2, 0
._218:
.word gUnknown_02023A14+0x50
.word gActiveBank
.syntax unified
thumb_func_end sub_8036B0C
.else
thumb_func_start sub_8036B0C
sub_8036B0C: @ 8036B0C
push {r4-r6,lr}
@ -1540,6 +1710,7 @@ _08036C40:
.align 2, 0
_08036C48: .4byte gActiveBank
thumb_func_end sub_8036B0C
.endif
thumb_func_start sub_8036C4C
sub_8036C4C: @ 8036C4C

View File

@ -5,7 +5,6 @@
.text
thumb_func_start sub_80FCB5C
sub_80FCB5C: @ 80FCB5C
push {r4-r7,lr}

2013
asm/dark.s

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4686
asm/nakamura_debug_menu.s Normal file

File diff suppressed because it is too large Load Diff

2198
asm/nohara_debug_menu.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -323,6 +323,149 @@ sub_809CA8C: @ 809CA8C
bx r0
thumb_func_end sub_809CA8C
.if DEBUG
thumb_func_start debug_sub_80AA40C
debug_sub_80AA40C:
.syntax divided
push {lr}
bl sub_809AB8C
lsl r0, r0, #0x10
cmp r0, #0
beq ._2084 @cond_branch
bl sub_809CDCC
mov r0, #0x20
bl sub_809CDEC
mov r0, #0x6
bl sub_809CDEC
mov r0, #0x1
b ._2085
._2084:
mov r0, #0x0
._2085:
pop {r1}
bx r1
.syntax unified
thumb_func_end debug_sub_80AA40C
.endif
.if DEBUG
thumb_func_start sub_809CAB0
sub_809CAB0:
.syntax divided
push {lr}
ldr r0, ._2088 @ unk_2038790
ldrb r0, [r0]
cmp r0, #0
beq ._2086 @cond_branch
bl debug_sub_80AA40C
lsl r0, r0, #0x18
lsr r0, r0, #0x18
b ._2110
._2089:
.align 2, 0
._2088:
.word unk_2038790
._2086:
bl sub_809CDCC
bl sub_809AB8C
lsl r0, r0, #0x10
lsr r1, r0, #0x10
ldr r0, ._2094 @ gPokemonStorageSystemPtr
ldr r0, [r0]
ldrb r0, [r0, #0x5]
cmp r0, #0x1
beq ._2090 @cond_branch
cmp r0, #0x1
bgt ._2091 @cond_branch
cmp r0, #0
beq ._2092 @cond_branch
b ._2108
._2095:
.align 2, 0
._2094:
.word gPokemonStorageSystemPtr
._2091:
cmp r0, #0x2
beq ._2096 @cond_branch
b ._2108
._2090:
cmp r1, #0
beq ._2108 @cond_branch
mov r0, #0x1
bl sub_809CDEC
b ._2109
._2092:
cmp r1, #0
beq ._2108 @cond_branch
mov r0, #0x2
bl sub_809CDEC
b ._2109
._2096:
ldr r0, ._2105 @ gUnknown_020384E6
ldrb r0, [r0]
cmp r0, #0
beq ._2102 @cond_branch
cmp r1, #0
beq ._2103 @cond_branch
mov r0, #0x4
bl sub_809CDEC
b ._2109
._2106:
.align 2, 0
._2105:
.word gUnknown_020384E6
._2103:
mov r0, #0x5
bl sub_809CDEC
b ._2109
._2102:
cmp r1, #0
beq ._2108 @cond_branch
mov r0, #0x3
bl sub_809CDEC
b ._2109
._2108:
mov r0, #0x0
b ._2110
._2109:
mov r0, #0x6
bl sub_809CDEC
ldr r0, ._2114 @ gPokemonStorageSystemPtr
ldr r0, [r0]
ldrb r0, [r0, #0x5]
cmp r0, #0x2
bne ._2113 @cond_branch
ldr r0, ._2114 + 4 @ gUnknown_020384E4
ldrb r0, [r0]
lsl r0, r0, #0x18
asr r0, r0, #0x18
cmp r0, #0
bne ._2112 @cond_branch
mov r0, #0x2
bl sub_809CDEC
b ._2113
._2115:
.align 2, 0
._2114:
.word gPokemonStorageSystemPtr
.word gUnknown_020384E4
._2112:
mov r0, #0x1
bl sub_809CDEC
._2113:
mov r0, #0x8
bl sub_809CDEC
mov r0, #0x7
bl sub_809CDEC
mov r0, #0x0
bl sub_809CDEC
mov r0, #0x1
._2110:
pop {r1}
bx r1
.syntax unified
thumb_func_end sub_809CAB0
.else
thumb_func_start sub_809CAB0
sub_809CAB0: @ 809CAB0
push {lr}
@ -418,6 +561,7 @@ _0809CB6E:
pop {r1}
bx r1
thumb_func_end sub_809CAB0
.endif
thumb_func_start sub_809CB74
sub_809CB74: @ 809CB74

2054
asm/taya_debug_window.s Normal file

File diff suppressed because it is too large Load Diff

8100
asm/tomomichi_debug_menu.s Normal file

File diff suppressed because it is too large Load Diff

747
asm/unk_debug_menu_3.s Normal file
View File

@ -0,0 +1,747 @@
.if DEBUG
.include "constants/gba_constants.inc"
.include "include/macros.inc"
.text
thumb_func_start debug_sub_813C404
debug_sub_813C404:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._1 @ gUnknown_Debug_845DDB2
ldr r4, ._1 + 4 @ gUnknown_Debug_845DAE1
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_812620C
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._2:
.align 2, 0
._1:
.word gUnknown_Debug_845DDB2
.word gUnknown_Debug_845DAE1
thumb_func_end debug_sub_813C404
thumb_func_start debug_sub_813C430
debug_sub_813C430:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._3 @ gUnknown_Debug_845E402
ldr r4, ._3 + 4 @ gUnknown_Debug_845E3E0
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_812620C
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._4:
.align 2, 0
._3:
.word gUnknown_Debug_845E402
.word gUnknown_Debug_845E3E0
thumb_func_end debug_sub_813C430
thumb_func_start debug_sub_813C45C
debug_sub_813C45C:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._5 @ gUnknown_Debug_845E443
ldr r4, ._5 + 4 @ gUnknown_Debug_845E422
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_812620C
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._6:
.align 2, 0
._5:
.word gUnknown_Debug_845E443
.word gUnknown_Debug_845E422
thumb_func_end debug_sub_813C45C
thumb_func_start debug_sub_813C488
debug_sub_813C488:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._7 @ gUnknown_Debug_845E422
ldr r4, ._7 + 4 @ gUnknown_Debug_845E402
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_812620C
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._8:
.align 2, 0
._7:
.word gUnknown_Debug_845E422
.word gUnknown_Debug_845E402
thumb_func_end debug_sub_813C488
thumb_func_start debug_sub_813C4B4
debug_sub_813C4B4:
push {r4, lr}
ldr r4, ._9 @ gUnknown_Debug_845E619
ldr r1, ._9 + 4 @ gUnknown_Debug_845E606
sub r4, r4, r1
add r2, r4, #0
bl memcpy
add r0, r4, #0
pop {r4}
pop {r1}
bx r1
._10:
.align 2, 0
._9:
.word gUnknown_Debug_845E619
.word gUnknown_Debug_845E606
thumb_func_end debug_sub_813C4B4
thumb_func_start debug_sub_813C4D4
debug_sub_813C4D4:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._11 @ gUnknown_Debug_845E712
ldr r4, ._11 + 4 @ gUnknown_Debug_845E619
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_81261B4
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._12:
.align 2, 0
._11:
.word gUnknown_Debug_845E712
.word gUnknown_Debug_845E619
thumb_func_end debug_sub_813C4D4
thumb_func_start debug_sub_813C500
debug_sub_813C500:
push {r4, r5, r6, lr}
add r6, r0, #0
ldr r5, ._13 @ gUnknown_Debug_845E797
ldr r4, ._13 + 4 @ gUnknown_Debug_845E712
sub r5, r5, r4
add r1, r4, #0
add r2, r5, #0
bl memcpy
add r0, r6, #0
add r1, r4, #0
bl unref_sub_812620C
add r0, r5, #0
pop {r4, r5, r6}
pop {r1}
bx r1
._14:
.align 2, 0
._13:
.word gUnknown_Debug_845E797
.word gUnknown_Debug_845E712
thumb_func_end debug_sub_813C500
thumb_func_start debug_sub_813C52C
debug_sub_813C52C:
push {r4, r5, r6, lr}
mov r6, r9
mov r5, r8
push {r5, r6}
mov r8, r0
lsl r5, r1, #0x10
lsr r0, r5, #0x10
mov r9, r0
ldr r6, ._15 @ gUnknown_Debug_845E7BB
ldr r4, ._15 + 4 @ gUnknown_Debug_845E797
sub r6, r6, r4
mov r0, r8
add r1, r4, #0
add r2, r6, #0
bl memcpy
ldr r0, ._15 + 8 @ gUnknown_Debug_845E7B5
sub r0, r0, r4
add r0, r0, r8
add r0, r0, #0x3
mov r1, r9
strb r1, [r0]
lsr r5, r5, #0x18
strb r5, [r0, #0x1]
mov r0, r8
add r1, r4, #0
bl unref_sub_812620C
add r0, r6, #0
pop {r3, r4}
mov r8, r3
mov r9, r4
pop {r4, r5, r6}
pop {r1}
bx r1
._16:
.align 2, 0
._15:
.word gUnknown_Debug_845E7BB
.word gUnknown_Debug_845E797
.word gUnknown_Debug_845E7B5
thumb_func_end debug_sub_813C52C
thumb_func_start debug_sub_813C580
debug_sub_813C580:
push {lr}
mov r1, #0xd
bl debug_sub_813C52C
pop {r1}
bx r1
thumb_func_end debug_sub_813C580
thumb_func_start debug_sub_813C58C
debug_sub_813C58C:
push {lr}
mov r1, #0x4
bl debug_sub_813C52C
pop {r1}
bx r1
thumb_func_end debug_sub_813C58C
thumb_func_start debug_sub_813C598
debug_sub_813C598:
push {lr}
mov r1, #0x85
bl debug_sub_813C52C
pop {r1}
bx r1
thumb_func_end debug_sub_813C598
thumb_func_start debug_sub_813C5A4
debug_sub_813C5A4:
push {lr}
ldr r1, ._17 @ 0x121
bl debug_sub_813C52C
pop {r1}
bx r1
._18:
.align 2, 0
._17:
.word 0x121
thumb_func_end debug_sub_813C5A4
thumb_func_start debug_sub_813C5B4
debug_sub_813C5B4:
push {r4, r5, r6, r7, lr}
add r4, r0, #0
ldr r7, ._23 @ gSaveBlock1
ldr r0, ._23 + 4 @ gUnknown_Debug_845DDD6
ldr r1, ._23 + 8 @ gUnknown_Debug_845DDB2
sub r0, r0, r1
add r6, r0, r4
ldr r0, ._23 + 12 @ gUnknown_Debug_845E306
sub r5, r0, r1
ldr r0, ._23 + 16 @ Str_842E23C
mov r1, #0x0
mov r2, #0x0
bl GetEnigmaBerryChecksum
mov r2, #0x0
ldr r3, ._23 + 20 @ 0xfff
mov r1, #0x0
._19:
add r0, r4, r2
strb r1, [r0]
add r2, r2, #0x1
cmp r2, r3
ble ._19 @cond_branch
mov r2, #0x0
cmp r2, r5
bcs ._20 @cond_branch
ldr r3, ._23 + 8 @ gUnknown_Debug_845DDB2
._21:
add r0, r4, r2
add r1, r2, r3
ldrb r1, [r1]
strb r1, [r0]
add r2, r2, #0x1
cmp r2, r5
bcc ._21 @cond_branch
._20:
mov r2, #0x0
ldr r3, ._23 + 24 @ 0x52f
._22:
add r0, r6, r2
add r1, r7, r2
ldrb r1, [r1]
strb r1, [r0]
add r2, r2, #0x1
cmp r2, r3
bls ._22 @cond_branch
bl ClearEnigmaBerries
ldr r1, ._23 + 8 @ gUnknown_Debug_845DDB2
add r0, r4, #0
bl unref_sub_81261B4
add r0, r5, #0
pop {r4, r5, r6, r7}
pop {r1}
bx r1
._24:
.align 2, 0
._23:
.word gSaveBlock1+0x3160
.word gUnknown_Debug_845DDD6
.word gUnknown_Debug_845DDB2
.word gUnknown_Debug_845E306
.word Str_842E23C
.word 0xfff
.word 0x52f
thumb_func_end debug_sub_813C5B4
thumb_func_start debug_sub_813C638
debug_sub_813C638:
push {r4, r5, r6, lr}
mov r6, r8
push {r6}
add sp, sp, #0xffffffec
mov r8, r0
add r4, r1, #0
add r5, r2, #0
add r6, r3, #0
lsl r4, r4, #0x10
lsr r4, r4, #0x10
lsl r5, r5, #0x18
lsr r5, r5, #0x18
lsl r6, r6, #0x10
lsr r6, r6, #0x10
bl ZeroMonData
mov r0, #0x0
str r0, [sp]
str r0, [sp, #0x4]
mov r0, #0x1
str r0, [sp, #0x8]
ldr r0, ._25 @ 0x270f
str r0, [sp, #0xc]
mov r0, r8
add r1, r4, #0
add r2, r5, #0
mov r3, #0x20
bl CreateMon
ldr r2, ._25 + 4 @ Str_842E240
mov r0, r8
mov r1, #0x7
bl SetMonData
ldr r2, ._25 + 8 @ Str_842E248
mov r0, r8
mov r1, #0x2
bl SetMonData
str r6, [sp, #0x10]
mov r0, r8
mov r1, #0xc
add r2, sp, #0x10
bl SetMonData
add sp, sp, #0x14
pop {r3}
mov r8, r3
pop {r4, r5, r6}
pop {r0}
bx r0
._26:
.align 2, 0
._25:
.word 0x270f
.word Str_842E240
.word Str_842E248
thumb_func_end debug_sub_813C638
thumb_func_start debug_sub_813C6AC
debug_sub_813C6AC:
push {r4, r5, r6, r7, lr}
mov r7, r8
push {r7}
add sp, sp, #0xfffffff8
add r6, r0, #0
add r5, r1, #0
add r0, r5, #0
bl ClearMailStruct
add r0, r6, #0
mov r1, #0xc
bl GetMonData
lsl r0, r0, #0x10
lsr r0, r0, #0x10
mov r8, r0
bl ItemIsMail
lsl r0, r0, #0x18
cmp r0, #0
beq ._27 @cond_branch
add r4, r5, #0
add r4, r4, #0x12
add r7, r5, #0
add r7, r7, #0x1a
mov r1, #0x9
add r0, r5, #0
add r0, r0, #0x10
._28:
strh r1, [r0]
sub r1, r1, #0x1
sub r0, r0, #0x2
cmp r0, r5
bge ._28 @cond_branch
add r0, r6, #0
mov r1, #0x7
mov r2, sp
bl GetMonData
add r0, r4, #0
mov r1, sp
mov r2, #0x8
bl StringCopyN
add r0, r6, #0
mov r1, #0x1
bl GetMonData
add r1, r7, #0
bl write_word_to_mem
add r0, r6, #0
mov r1, #0xb
bl GetMonData
add r4, r0, #0
lsl r4, r4, #0x10
lsr r4, r4, #0x10
add r0, r6, #0
mov r1, #0x0
bl GetMonData
add r1, r0, #0
add r0, r4, #0
bl SpeciesToMailSpecies
strh r0, [r5, #0x1e]
mov r0, r8
strh r0, [r5, #0x20]
._27:
add sp, sp, #0x8
pop {r3}
mov r8, r3
pop {r4, r5, r6, r7}
pop {r0}
bx r0
thumb_func_end debug_sub_813C6AC
thumb_func_start debug_sub_813C740
debug_sub_813C740:
push {r4, r5, r6, lr}
mov r6, sl
mov r5, r9
mov r4, r8
push {r4, r5, r6}
add sp, sp, #0xffffffd0
add r6, r0, #0
ldr r0, ._29 @ gUnknown_Debug_845E443
mov r8, r0
ldr r1, ._29 + 4 @ gUnknown_Debug_845E4EF
ldr r5, ._29 + 8 @ gEnemyParty
sub r1, r1, r0
mov r9, r1
add r0, r6, #0
mov r1, r8
mov r2, r9
bl memcpy
add r0, r5, #0
mov r1, #0x19
mov r2, #0x5
mov r3, #0x0
bl debug_sub_813C638
add r4, sp, #0x24
mov r0, #0x1
mov sl, r0
mov r1, sl
strb r1, [r4]
add r0, r5, #0
mov r1, #0x2d
add r2, r4, #0
bl SetMonData
mov r0, #0x3
strb r0, [r4]
add r0, r5, #0
mov r1, #0x20
add r2, r4, #0
bl SetMonData
mov r0, #0xff
strb r0, [r4]
add r0, r5, #0
mov r1, #0x23
add r2, r4, #0
bl SetMonData
ldr r1, ._29 + 12 @ Str_842E238
add r0, r4, #0
mov r2, #0xb
bl StringCopyN
add r0, r5, #0
mov r1, #0x2
add r2, r4, #0
bl SetMonData
mov r0, sl
strb r0, [r4]
add r0, r5, #0
mov r1, #0x3
add r2, r4, #0
bl SetMonData
ldr r0, ._29 + 16 @ gUnknown_Debug_845E467
add r0, r6, r0
mov r1, r8
sub r0, r0, r1
add r1, r5, #0
mov r2, #0x64
bl memcpy
ldr r0, ._29 + 20 @ gUnknown_Debug_845E4CB
add r6, r6, r0
mov r0, r8
sub r6, r6, r0
add r0, r6, #0
mov r1, sp
mov r2, #0x24
bl memcpy
mov r0, r9
add sp, sp, #0x30
pop {r3, r4, r5}
mov r8, r3
mov r9, r4
mov sl, r5
pop {r4, r5, r6}
pop {r1}
bx r1
._30:
.align 2, 0
._29:
.word gUnknown_Debug_845E443
.word gUnknown_Debug_845E4EF
.word gEnemyParty
.word Str_842E238
.word gUnknown_Debug_845E467
.word gUnknown_Debug_845E4CB
thumb_func_end debug_sub_813C740
thumb_func_start debug_sub_813C810
debug_sub_813C810:
push {r4, r5, r6, lr}
mov r6, r8
push {r6}
add sp, sp, #0xffffffdc
add r6, r0, #0
ldr r5, ._31 @ gUnknown_Debug_845E443
ldr r0, ._31 + 4 @ gUnknown_Debug_845E4EF
ldr r4, ._31 + 8 @ gEnemyParty
sub r0, r0, r5
mov r8, r0
add r0, r6, #0
add r1, r5, #0
mov r2, r8
bl memcpy
add r0, r4, #0
mov r1, #0xc9
mov r2, #0x15
mov r3, #0x82
bl debug_sub_813C638
add r0, r4, #0
mov r1, sp
bl debug_sub_813C6AC
ldr r0, ._31 + 12 @ gUnknown_Debug_845E467
add r0, r6, r0
sub r0, r0, r5
add r1, r4, #0
mov r2, #0x64
bl memcpy
ldr r0, ._31 + 16 @ gUnknown_Debug_845E4CB
add r0, r6, r0
sub r0, r0, r5
mov r1, sp
mov r2, #0x24
bl memcpy
add r0, r6, #0
add r1, r5, #0
bl unref_sub_812620C
mov r0, r8
add sp, sp, #0x24
pop {r3}
mov r8, r3
pop {r4, r5, r6}
pop {r1}
bx r1
._32:
.align 2, 0
._31:
.word gUnknown_Debug_845E443
.word gUnknown_Debug_845E4EF
.word gEnemyParty
.word gUnknown_Debug_845E467
.word gUnknown_Debug_845E4CB
thumb_func_end debug_sub_813C810
thumb_func_start debug_sub_813C888
debug_sub_813C888:
push {r4, r5, r6, lr}
mov r6, r8
push {r6}
add sp, sp, #0xffffffdc
add r6, r0, #0
ldr r5, ._33 @ gUnknown_Debug_845E443
ldr r0, ._33 + 4 @ gUnknown_Debug_845E4EF
ldr r4, ._33 + 8 @ gEnemyParty
sub r0, r0, r5
mov r8, r0
add r0, r6, #0
add r1, r5, #0
mov r2, r8
bl memcpy
add r0, r4, #0
mov r1, #0xc9
mov r2, #0x15
mov r3, #0x82
bl debug_sub_813C638
add r0, r4, #0
mov r1, sp
bl debug_sub_813C6AC
mov r0, #0x0
strh r0, [r4, #0x1c]
ldr r0, ._33 + 12 @ gUnknown_Debug_845E467
add r0, r6, r0
sub r0, r0, r5
add r1, r4, #0
mov r2, #0x64
bl memcpy
ldr r0, ._33 + 16 @ gUnknown_Debug_845E4CB
add r0, r6, r0
sub r0, r0, r5
mov r1, sp
mov r2, #0x24
bl memcpy
add r0, r6, #0
add r1, r5, #0
bl unref_sub_812620C
mov r0, r8
add sp, sp, #0x24
pop {r3}
mov r8, r3
pop {r4, r5, r6}
pop {r1}
bx r1
._34:
.align 2, 0
._33:
.word gUnknown_Debug_845E443
.word gUnknown_Debug_845E4EF
.word gEnemyParty
.word gUnknown_Debug_845E467
.word gUnknown_Debug_845E4CB
thumb_func_end debug_sub_813C888
thumb_func_start debug_sub_813C904
debug_sub_813C904:
push {r4, lr}
ldr r4, ._35 @ gPlayerParty
add r0, r4, #0
mov r1, #0x5
mov r2, #0x32
mov r3, #0xb7
bl debug_sub_813C638
add r0, r4, #0
add r0, r0, #0x64
mov r1, #0x8
mov r2, #0x32
mov r3, #0xc4
bl debug_sub_813C638
add r4, r4, #0xc8
add r0, r4, #0
mov r1, #0x2
mov r2, #0x32
mov r3, #0x8d
bl debug_sub_813C638
pop {r4}
pop {r0}
bx r0
._36:
.align 2, 0
._35:
.word gPlayerParty
thumb_func_end debug_sub_813C904
thumb_func_start debug_sub_813C93C
debug_sub_813C93C:
push {r4, r5, r6, lr}
add sp, sp, #0xffffff44
add r4, r0, #0
ldr r6, ._37 @ gUnknown_Debug_845E4EF
ldr r5, ._37 + 4 @ gUnknown_Debug_845E606
sub r5, r5, r6
add r1, r6, #0
add r2, r5, #0
bl memcpy
bl SavePlayerParty
bl debug_sub_813C904
ldr r1, ._37 + 8 @ Str_842E253
ldr r2, ._37 + 12 @ 0x270f
mov r0, sp
bl debug_sub_8075DB4
bl LoadPlayerParty
ldr r0, ._37 + 16 @ gUnknown_Debug_845E506
add r4, r4, r0
sub r4, r4, r6
add r0, r4, #0
mov r1, sp
mov r2, #0xbc
bl memcpy
add r0, r5, #0
add sp, sp, #0xbc
pop {r4, r5, r6}
pop {r1}
bx r1
._38:
.align 2, 0
._37:
.word gUnknown_Debug_845E4EF
.word gUnknown_Debug_845E606
.word Str_842E253+5 @ weird...
.word 0x270f
.word gUnknown_Debug_845E506
thumb_func_end debug_sub_813C93C
.align 2, 0
.endif

View File

@ -1,256 +0,0 @@
.include "constants/gba_constants.inc"
.include "include/macros.inc"
.syntax unified
.text
thumb_func_start sub_8095904
sub_8095904: @ 8095904
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x1C
str r0, [sp]
adds r7, r1, 0
adds r4, r2, 0
ldr r0, [sp, 0x3C]
lsls r4, 24
lsrs r4, 24
lsls r3, 16
lsrs r3, 16
str r3, [sp, 0x4]
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x8]
ldr r0, [sp]
bl StringLength
lsls r0, 16
lsrs r0, 16
mov r8, r0
cmp r4, 0
bne _08095988
movs r5, 0
cmp r5, r8
bcs _08095A2E
_0809593E:
ldr r1, [sp]
adds r0, r1, r5
ldrb r2, [r0]
ldr r0, _08095980 @ =0x0000fff0
ands r0, r2
lsls r0, 6
movs r1, 0xF
ands r2, r1
lsls r2, 5
adds r0, r2
ldr r1, _08095984 @ =gFont3LatinGlyphs
adds r4, r0, r1
adds r0, r4, 0
adds r1, r7, 0
movs r2, 0x10
bl CpuSet
movs r2, 0x80
lsls r2, 2
adds r0, r4, r2
ldr r3, [sp, 0x4]
adds r1, r7, r3
movs r2, 0x10
bl CpuSet
adds r7, 0x20
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, r8
bcc _0809593E
b _08095A2E
.align 2, 0
_08095980: .4byte 0x0000fff0
_08095984: .4byte gFont3LatinGlyphs
_08095988:
movs r0, 0
mov r9, r0
ldr r1, [sp, 0x8]
lsls r0, r1, 28
lsrs r0, 24
str r0, [sp, 0xC]
mov r2, r8
lsls r0, r2, 21
movs r1, 0
lsrs r0, 1
str r0, [sp, 0x10]
_0809599E:
movs r5, 0
ldr r3, [sp, 0x4]
adds r3, r7, r3
str r3, [sp, 0x14]
adds r0, r1, 0x1
str r0, [sp, 0x18]
cmp r5, r8
bcs _08095A12
movs r2, 0xF
mov r12, r2
lsls r1, 9
ldr r0, _08095A40 @ =gFont3LatinGlyphs
adds r1, r0
mov r10, r1
_080959BA:
ldr r3, [sp]
adds r0, r3, r5
ldrb r1, [r0]
ldr r0, _08095A44 @ =0x0000fff0
ands r0, r1
lsls r0, 6
mov r2, r12
ands r1, r2
lsls r1, 5
adds r0, r1
mov r3, r10
adds r4, r0, r3
movs r6, 0
adds r5, 0x1
_080959D6:
ldrb r0, [r4]
movs r3, 0xF0
ands r3, r0
mov r2, r12
ands r2, r0
cmp r3, 0
bne _080959E6
ldr r3, [sp, 0xC]
_080959E6:
cmp r2, 0
bne _080959EC
ldr r2, [sp, 0x8]
_080959EC:
mov r0, r9
adds r1, r0, 0x1
lsls r1, 16
lsrs r1, 16
mov r9, r1
ldr r1, [sp, 0x40]
adds r0, r1, r0
orrs r3, r2
strb r3, [r0]
adds r4, 0x1
adds r0, r6, 0x1
lsls r0, 16
lsrs r6, r0, 16
cmp r6, 0x1F
bls _080959D6
lsls r0, r5, 16
lsrs r5, r0, 16
cmp r5, r8
bcc _080959BA
_08095A12:
ldr r0, [sp, 0x40]
adds r1, r7, 0
ldr r3, [sp, 0x10]
lsrs r2, r3, 16
bl CpuSet
ldr r7, [sp, 0x14]
movs r0, 0
mov r9, r0
ldr r1, [sp, 0x18]
lsls r0, r1, 16
lsrs r1, r0, 16
cmp r1, 0x1
bls _0809599E
_08095A2E:
add sp, 0x1C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08095A40: .4byte gFont3LatinGlyphs
_08095A44: .4byte 0x0000fff0
thumb_func_end sub_8095904
thumb_func_start unref_sub_8095A48
unref_sub_8095A48: @ 8095A48
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x10
adds r4, r0, 0
adds r5, r1, 0
lsls r2, 24
lsrs r2, 24
mov r8, r2
lsls r3, 24
lsrs r7, r3, 24
movs r6, 0
_08095A60:
movs r3, 0
ldrb r0, [r4]
adds r1, r0, 0
adds r2, r0, 0
cmp r1, 0xFF
beq _08095ACE
_08095A6C:
mov r0, sp
adds r0, r3
adds r0, 0x8
strb r2, [r0]
adds r4, 0x1
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, 0x3
bhi _08095AA8
ldrb r0, [r4]
adds r1, r0, 0
adds r2, r0, 0
cmp r1, 0xFF
bne _08095A6C
cmp r3, 0
beq _08095ACE
movs r6, 0x1
cmp r3, 0x3
bhi _08095AA8
movs r2, 0
_08095A96:
adds r0, r3, 0
adds r1, r0, 0x1
lsls r1, 16
lsrs r3, r1, 16
add r0, sp
adds r0, 0x8
strb r2, [r0]
cmp r3, 0x3
bls _08095A96
_08095AA8:
mov r1, sp
adds r1, r3
adds r1, 0x8
movs r0, 0xFF
strb r0, [r1]
str r7, [sp]
ldr r0, [sp, 0x28]
str r0, [sp, 0x4]
add r0, sp, 0x8
adds r1, r5, 0
mov r2, r8
movs r3, 0x80
bl sub_8095904
movs r0, 0x80
lsls r0, 1
adds r5, r0
cmp r6, 0
beq _08095A60
_08095ACE:
add sp, 0x10
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end unref_sub_8095A48
.align 2, 0 @ Don't pad with nop.

9578
asm/watanabe_debug_menu.s Normal file

File diff suppressed because it is too large Load Diff

7
asmdiff_de_debug.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb"
OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))"
$OBJDUMP $OPTIONS baserom_de_debug.gba > baserom_de_debug.dump
$OBJDUMP $OPTIONS pokeruby_de_debug.gba > pokeruby_de_debug.dump
diff baserom_de_debug.dump pokeruby_de_debug.dump

View File

@ -44,6 +44,7 @@ SUPER_ER = 2C
'+' = 2E
LV = 34
'=' = 35
';' = 36
'¿' = 51
'¡' = 52
PK = 53
@ -59,6 +60,10 @@ UP_ARROW = 79
DOWN_ARROW = 7A
LEFT_ARROW = 7B
RIGHT_ARROW = 7C
SUPER_E = 84
'<' = 85
'>' = 86
SUPER_RE = A0
'0' = A1
'1' = A2
'2' = A3

View File

@ -4,6 +4,7 @@
GAME_VERSION ?= RUBY
GAME_REVISION ?= 0
GAME_LANGUAGE ?= ENGLISH
DEBUG ?= 0
COMPARE ?= 1
# Version
@ -42,3 +43,9 @@ else
$(error unknown language $(GAME_LANGUAGE))
endif
endif
# Debug
ifeq ($(DEBUG), 1)
BUILD_NAME := $(BUILD_NAME)_debug
endif

View File

@ -3279,6 +3279,7 @@ PacifidlogTown_House2_EventScript_1A14DC:: @ 81A14DC
Route101_EventScript_1A14DC:: @ 81A14DC
return
.include "data/scripts/debug.inc"
.include "data/scripts/berry_tree.inc"
.include "data/text/berry_tree.inc"

View File

@ -3137,7 +3137,7 @@ gBattleAnimSpriteTemplate_83D9F0C:: @ 83D9F0C
.align 2
gSpriteTemplate_83D9F24:: @ 83D9F24
spr_template 10050, 10050, gOamData_837DF34, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, unc_080B08A0
spr_template 10050, 10050, gOamData_837DF34, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_080B08A0
.align 2
gSpriteAnim_83D9F3C:: @ 83D9F3C

View File

@ -203,6 +203,121 @@ gUnknown_081F96C8:: @ 81F96C8
gSpriteTemplate_81F96D0:: @ 81F96D0
spr_template 0, 0, gDummyOamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_800F828
.if DEBUG
UnkDebug0:: @ 0x821F3B8
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
gUnknown_Debug_821F424::
.byte 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x9b, 0x01, 0x01, 0x00, 0x12, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x64, 0x00, 0x01, 0x00, 0x18, 0x00, 0x0e, 0x00, 0x02, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x2e, 0x00
.byte 0x1a, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x30, 0x00, 0x1c, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x01, 0x00, 0x04, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x44, 0x00, 0x0a, 0x00
.byte 0x04, 0x00, 0x64, 0x00, 0x01, 0x00, 0x4a, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x60, 0x00, 0x1a, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x62, 0x00, 0x1c, 0x00, 0x04, 0x00
.byte 0x02, 0x00, 0x00, 0x00, 0x66, 0x00, 0x01, 0x00, 0x06, 0x00, 0x9b, 0x01, 0x00, 0x00, 0x76, 0x00, 0x0a, 0x00, 0x06, 0x00, 0x64, 0x00, 0x01, 0x00, 0x7c, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x5c, 0x01
.byte 0x00, 0x00, 0x92, 0x00, 0x1a, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00, 0x94, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x98, 0x00, 0x01, 0x00, 0x08, 0x00, 0x9b, 0x01, 0x00, 0x00
.byte 0xa8, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x64, 0x00, 0x01, 0x00, 0xae, 0x00, 0x0e, 0x00, 0x08, 0x00, 0x5c, 0x01, 0x00, 0x00, 0xc4, 0x00, 0x1a, 0x00, 0x08, 0x00, 0x05, 0x00, 0x00, 0x00, 0xc6, 0x00
.byte 0x1c, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x9b, 0x01, 0x00, 0x00, 0xda, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x64, 0x00, 0x01, 0x00, 0xe0, 0x00, 0x0e, 0x00
.byte 0x0a, 0x00, 0x5c, 0x01, 0x00, 0x00, 0xf6, 0x00, 0x1a, 0x00, 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x1c, 0x00, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x01, 0x00, 0x0c, 0x00
.byte 0x9b, 0x01, 0x00, 0x00, 0x0c, 0x01, 0x0a, 0x00, 0x0c, 0x00, 0x64, 0x00, 0x01, 0x00, 0x12, 0x01, 0x0e, 0x00, 0x0c, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x28, 0x01, 0x1a, 0x00, 0x0c, 0x00, 0x05, 0x00
.byte 0x00, 0x00, 0x2a, 0x01, 0x1c, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e, 0x01, 0x06, 0x00, 0x12, 0x00, 0x09, 0x00, 0x01, 0x00, 0x34, 0x01, 0x1a, 0x00, 0x12, 0x00, 0x09, 0x00, 0x01, 0x00
gUnknown_Debug_821F564::
.byte 0x36, 0x01
gUnknown_Debug_821F566::
.byte 0x01, 0x00
gUnknown_Debug_821F568::
.byte 0x0e, 0x00, 0x62, 0x01
gUnknown_Debug_821F56C::
.byte 0x01, 0x00, 0x4a, 0x01, 0x0c, 0x00, 0x0e, 0x00, 0x62, 0x01, 0x00, 0x00, 0x5e, 0x01, 0x01, 0x00, 0x10, 0x00, 0x62, 0x01, 0x00, 0x00, 0x72, 0x01, 0x0c, 0x00, 0x10, 0x00, 0x62, 0x01, 0x00, 0x00
gUnknown_Debug_821F58C::
.byte 0x86, 0x01, 0x17, 0x00, 0x0e, 0x00, 0x94, 0x01, 0x17, 0x00, 0x10, 0x00
gUnknown_Debug_821F598::
.byte 0x00, 0x00, 0x09, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0a, 0x00, 0x0b, 0x00, 0x4b, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00
gUnknown_Debug_821F5AC::
.byte 0x01, 0x14, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, 0x14, 0x00, 0x03, 0x00, 0x00, 0x14, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00
.byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x00, 0x06, 0x14, 0x00, 0x14, 0x00, 0x00, 0x14, 0x00, 0x07, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x14, 0x00, 0x14, 0x14, 0x00
.byte 0x09, 0x14, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x00, 0x14, 0x14, 0x00, 0x0b, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00
.byte 0x0d, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
Str_821F624:: @ 0x821F624
.string "$"
str_821F631:: @ 0x821F631
.string "$"
.string "$"
.string "$"
.string "$"
Str_821F649:: @ 0x821F649
.string "$"
debug_unk_0b::
@ 0x821F64D
.string "  $"
@ 0x821F652
.string "$"
@ 0x821F655
.string "$"
@ 0x821F65A
.string "$"
@ 0x821F65F
.string "$"
@ 0x821F665
.string "$"
@ 0x821F66D
.string "$"
@ 0x821f675
.byte 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00
gUnknown_Debug_821F680::
.byte 0xc0, 0x00, 0x00, 0x00, 0xd2, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00
.byte 0x72, 0x01, 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xd2, 0x01, 0x00, 0x00, 0xda, 0x01, 0x00, 0x00, 0xf2, 0x01, 0x00, 0x00, 0xf6, 0x01, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00
.byte 0x52, 0x02, 0x00, 0x00, 0x5a, 0x02, 0x00, 0x00, 0x72, 0x02, 0x00, 0x00, 0x76, 0x02, 0x00, 0x00, 0xc0, 0x02, 0x00, 0x00, 0xd2, 0x02, 0x00, 0x00, 0xda, 0x02, 0x00, 0x00, 0xf2, 0x02, 0x00, 0x00
.byte 0xf6, 0x02, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x5a, 0x03, 0x00, 0x00, 0x72, 0x03, 0x00, 0x00, 0x76, 0x03, 0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0xd4, 0x04, 0x00, 0x00
.byte 0xde, 0x04, 0x00, 0x00, 0xe8, 0x04, 0x00, 0x00, 0xf2, 0x04, 0x00, 0x00, 0xc0, 0x08, 0x00, 0x00, 0xd2, 0x08, 0x00, 0x00, 0xda, 0x08, 0x00, 0x00, 0xf2, 0x08, 0x00, 0x00, 0xf6, 0x08, 0x00, 0x00
.byte 0x40, 0x09, 0x00, 0x00, 0x52, 0x09, 0x00, 0x00, 0x5a, 0x09, 0x00, 0x00, 0x72, 0x09, 0x00, 0x00, 0x76, 0x09, 0x00, 0x00, 0xc0, 0x09, 0x00, 0x00, 0xd2, 0x09, 0x00, 0x00, 0xda, 0x09, 0x00, 0x00
.byte 0xf2, 0x09, 0x00, 0x00, 0xf6, 0x09, 0x00, 0x00, 0x40, 0x0a, 0x00, 0x00, 0x52, 0x0a, 0x00, 0x00, 0x5a, 0x0a, 0x00, 0x00, 0x72, 0x0a, 0x00, 0x00, 0x76, 0x0a, 0x00, 0x00, 0xc0, 0x0a, 0x00, 0x00
.byte 0xd2, 0x0a, 0x00, 0x00, 0xda, 0x0a, 0x00, 0x00, 0xf2, 0x0a, 0x00, 0x00, 0xf6, 0x0a, 0x00, 0x00, 0x40, 0x0b, 0x00, 0x00, 0x52, 0x0b, 0x00, 0x00, 0x5a, 0x0b, 0x00, 0x00, 0x72, 0x0b, 0x00, 0x00
.byte 0x76, 0x0b, 0x00, 0x00, 0xc0, 0x0c, 0x00, 0x00, 0xd4, 0x0c, 0x00, 0x00, 0xde, 0x0c, 0x00, 0x00, 0xe8, 0x0c, 0x00, 0x00, 0xf2, 0x0c, 0x00, 0x00
gUnknown_Debug_821F798::
.byte 0xc0, 0x03, 0x00, 0x00, 0xd6, 0x03, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x56, 0x04, 0x00, 0x00, 0xc0, 0x0b, 0x00, 0x00, 0xd6, 0x0b, 0x00, 0x00, 0x40, 0x0c, 0x00, 0x00, 0x56, 0x0c, 0x00, 0x00
Str_821F7B8:: @ 0x821F7B8
.string " $"
Str_821F7BD:: @ 0x821F7BD
.string "{PALETTE 1}{COLOR_HIGHLIGHT_SHADOW BLUE YELLOW MAGENTA}   \n"
.string "  $"
Str_821F7DA:: @ 0x821F7DA
.string "{PALETTE 1}{COLOR_HIGHLIGHT_SHADOW BLUE YELLOW MAGENTA}\n"
.string "$"
Str_821F7EA:: @ 0x821F7EA
.string "$"
@ 0x821F7F3
gUnknown_Debug_821F7F3::
.string "$"
.endif
.align 2
gOamData_81F96E8:: @ 81F96E8
.2byte 0x0100

106
data/debug_menu_3.s Normal file
View File

@ -0,0 +1,106 @@
.if DEBUG
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
gUnknown_Debug_845DAE1::
.byte 0x01, 0xe1, 0xda, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x45, 0x08, 0xb2, 0xdd, 0x45, 0x08, 0x06, 0x08
.byte 0x01, 0x01, 0x56, 0xdb, 0x45, 0x08, 0x0d, 0xdd, 0x45, 0x08, 0x0b, 0x01, 0x05, 0x13, 0x01, 0x05, 0x0d, 0xdd, 0x45, 0x08, 0x02, 0xc6, 0xd5, 0xe9, 0xda, 0x00, 0xe9, 0xe2, 0xd8, 0x00, 0xd6, 0xd9
.byte 0xe7, 0xe9, 0xd7, 0xdc, 0xd9, 0x00, 0xd8, 0xd9, 0xdd, 0xe2, 0xd9, 0xe2, 0x00, 0xd0, 0xd5, 0xe8, 0xd9, 0xe6, 0x00, 0xdd, 0xe2, 0x00, 0xd8, 0xd9, 0xe6, 0xfe, 0xbb, 0xcc, 0xbf, 0xc8, 0xbb, 0x00
.byte 0xea, 0xe3, 0xe2, 0x00, 0xbc, 0xc6, 0xf3, 0xce, 0xbf, 0xc8, 0xbc, 0xcf, 0xcc, 0xc1, 0x00, 0xbd, 0xc3, 0xce, 0xd3, 0xad, 0xff, 0xb8, 0x56, 0xdb, 0x45, 0x08, 0x47, 0x13, 0x01, 0x01, 0x00, 0x21
.byte 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0xb4, 0xdb, 0x45, 0x08, 0x4a, 0x13, 0x01, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0xb4, 0xdb, 0x45, 0x08, 0x2b, 0xce, 0x00, 0xbb, 0x01, 0xb4
.byte 0xdb, 0x45, 0x08, 0x6a, 0x5a, 0xbd, 0xbe, 0xdb, 0x45, 0x08, 0x66, 0x6d, 0x46, 0x13, 0x01, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x00, 0x00, 0xbb, 0x01, 0xb5, 0xdb, 0x45, 0x08, 0x1a, 0x00, 0x80, 0x13
.byte 0x01, 0x1a, 0x01, 0x80, 0x01, 0x00, 0x09, 0x00, 0x29, 0x53, 0x08, 0xbd, 0x00, 0xdc, 0x45, 0x08, 0x66, 0x6d, 0x6c, 0x0d, 0xbd, 0x94, 0xdc, 0x45, 0x08, 0x66, 0x6d, 0x6c, 0x02, 0xd0, 0xbb, 0xce
.byte 0xbf, 0xcc, 0xf0, 0x00, 0xfd, 0x01, 0xab, 0x00, 0xcd, 0xd7, 0xdc, 0xf5, 0xe2, 0xb8, 0x00, 0xd8, 0xdd, 0xd7, 0xdc, 0x00, 0xee, 0xe9, 0x00, 0xe7, 0xd9, 0xdc, 0xd9, 0xe2, 0xab, 0xfe, 0xc2, 0xdd
.byte 0xd9, 0xe6, 0x00, 0xdd, 0xe7, 0xe8, 0x00, 0xd9, 0xdd, 0xe2, 0x00, 0xbc, 0xe6, 0xdd, 0xd9, 0xda, 0x00, 0xda, 0xf6, 0xe6, 0x00, 0xd8, 0xdd, 0xd7, 0xdc, 0xb8, 0x00, 0xfd, 0x01, 0xad, 0xff, 0xd0
.byte 0xbb, 0xce, 0xbf, 0xcc, 0xf0, 0x00, 0xc3, 0xd7, 0xdc, 0x00, 0xd6, 0xdd, 0xe2, 0x00, 0xe1, 0xdd, 0xe6, 0x00, 0xe2, 0xdd, 0xd7, 0xdc, 0xe8, 0x00, 0xe7, 0xdd, 0xd7, 0xdc, 0xd9, 0xe6, 0xb8, 0x00
.byte 0xd9, 0xe7, 0xfe, 0xdf, 0xf5, 0xe2, 0xe2, 0xe8, 0xd9, 0x00, 0xd9, 0xdd, 0xe2, 0x00, 0xce, 0xc3, 0xbd, 0xc5, 0xbf, 0xce, 0x00, 0xda, 0xf6, 0xe6, 0x00, 0xd9, 0xdd, 0xe2, 0xd9, 0x00, 0xc0, 0xf4
.byte 0xdc, 0xe6, 0xd9, 0x00, 0xe7, 0xd9, 0xdd, 0xe2, 0xad, 0xfb, 0xbe, 0xe9, 0x00, 0xe7, 0xe3, 0xe0, 0xe0, 0xe8, 0xd9, 0xe7, 0xe8, 0x00, 0xe2, 0xd5, 0xd7, 0xdc, 0x00, 0xcd, 0xbf, 0xbf, 0xc1, 0xcc
.byte 0xbb, 0xcd, 0xcf, 0xc6, 0xbc, 0x00, 0xbd, 0xc3, 0xce, 0xd3, 0x00, 0xdb, 0xd9, 0xdc, 0xd9, 0xe2, 0xfe, 0xe9, 0xe2, 0xd8, 0x00, 0xd8, 0xdd, 0xd7, 0xdc, 0x00, 0xd8, 0xe3, 0xe6, 0xe8, 0x00, 0xdb
.byte 0xd9, 0xe2, 0xd5, 0xe9, 0xd9, 0xe6, 0x00, 0xd9, 0xe6, 0xdf, 0xe9, 0xe2, 0xd8, 0xdd, 0xdb, 0xd9, 0xe2, 0xad, 0xff, 0xd0, 0xbb, 0xce, 0xbf, 0xcc, 0xf0, 0x00, 0xfd, 0x01, 0xb8, 0x00, 0xd8, 0xdd
.byte 0xd9, 0x00, 0xbc, 0xbb, 0xcd, 0xc3, 0xcd, 0xae, 0xce, 0xbb, 0xcd, 0xbd, 0xc2, 0xbf, 0xfe, 0xd8, 0xd9, 0xdd, 0xe2, 0xd9, 0xe7, 0x00, 0xbc, 0xbf, 0xcf, 0xce, 0xbf, 0xc6, 0xcd, 0x00, 0xdd, 0xe7
.byte 0xe8, 0x00, 0xea, 0xe3, 0xe0, 0xe0, 0xad, 0xfb, 0xc6, 0xd5, 0xdb, 0xd9, 0xe6, 0xd9, 0x00, 0xd9, 0xdd, 0xe2, 0xdd, 0xdb, 0xd9, 0x00, 0xd8, 0xd9, 0xdd, 0xe2, 0xd9, 0xe6, 0x00, 0xbc, 0xd5, 0xe7
.byte 0xdd, 0xe7, 0xae, 0xc3, 0xe8, 0xd9, 0xe1, 0xe7, 0x00, 0xdd, 0xe2, 0xfe, 0xd8, 0xd9, 0xdd, 0xe2, 0xd9, 0xe1, 0x00, 0xca, 0xbd, 0x00, 0xe9, 0xe2, 0xd8, 0x00, 0xdf, 0xe3, 0xe1, 0xe1, 0x00, 0xd8
.byte 0xd5, 0xe2, 0xe2, 0x00, 0xeb, 0xdd, 0xd9, 0xd8, 0xd9, 0xe6, 0xad, 0xff, 0xb8, 0x0d, 0xdd, 0x45, 0x08, 0x47, 0x13, 0x01, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0x53, 0xdd, 0x45
.byte 0x08, 0x4a, 0x13, 0x01, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0x53, 0xdd, 0x45, 0x08, 0x2b, 0xce, 0x00, 0xbb, 0x01, 0x53, 0xdd, 0x45, 0x08, 0x46, 0x13, 0x01, 0x01, 0x00, 0x21
.byte 0x0d, 0x80, 0x00, 0x00, 0xbb, 0x01, 0x5b, 0xdd, 0x45, 0x08, 0xbe, 0x16, 0xdb, 0x45, 0x08, 0x0e, 0x02, 0x02, 0xbe, 0x63, 0xdd, 0x45, 0x08, 0x0e, 0x03, 0x02, 0xbe, 0x95, 0xdd, 0x45, 0x08, 0x0e
.byte 0x03, 0x02, 0xbe, 0xdd, 0xd9, 0xe7, 0xd9, 0xe7, 0x00, 0xc1, 0xbf, 0xcd, 0xbd, 0xc2, 0xbf, 0xc2, 0xbf, 0xc8, 0x00, 0xdf, 0xd5, 0xe2, 0xe2, 0x00, 0xe2, 0xe9, 0xe6, 0x00, 0xd9, 0xdd, 0xe2, 0xe1
.byte 0xd5, 0xe0, 0xfe, 0xdb, 0xd9, 0xe7, 0xe4, 0xdd, 0xd9, 0xe0, 0xe8, 0x00, 0xeb, 0xd9, 0xe6, 0xd8, 0xd9, 0xe2, 0xad, 0xff, 0xbe, 0xd9, 0xdd, 0xe2, 0xd9, 0x00, 0xbc, 0xbb, 0xcd, 0xc3, 0xcd, 0xae
.byte 0xce, 0xbb, 0xcd, 0xbd, 0xc2, 0xbf, 0x00, 0xdd, 0xe7, 0xe8, 0x00, 0xea, 0xe3, 0xe0, 0xe0, 0xad, 0xff
gUnknown_Debug_845DDB2::
.byte 0x01, 0xb2, 0xdd, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xdd, 0x45, 0x08, 0x06, 0xe3, 0x45, 0x08, 0x07, 0xd6
.byte 0xdd, 0x45, 0x08, 0x02
gUnknown_Debug_845DDD6::
.space 0x530
gUnknown_Debug_845E306::
.byte 0x01, 0x06, 0xe3, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x05, 0x29, 0xe3, 0x45, 0x08, 0x03, 0x02, 0x4f, 0xe3, 0x45, 0x08, 0x03, 0x03, 0x87, 0xe3
.byte 0x45, 0x08, 0x02, 0xb8, 0x29, 0xe3, 0x45, 0x08, 0x43, 0x21, 0x0d, 0x80, 0x06, 0x00, 0xbb, 0x01, 0x4c, 0xe3, 0x45, 0x08, 0x79, 0x45, 0x01, 0x0f, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x0e, 0x02, 0x02, 0x0e, 0x03, 0x02, 0xbf, 0xdd, 0xe2, 0x00, 0xca, 0xc9, 0xc5, 0x1b, 0xc7, 0xc9, 0xc8, 0x00, 0xeb, 0xe9, 0xe6, 0xd8, 0xd9, 0x00, 0xdd, 0xe2, 0x00, 0xd8, 0xd5
.byte 0xe7, 0x00, 0xce, 0xd9, 0xd5, 0xe1, 0x00, 0xd8, 0xd9, 0xe7, 0xfe, 0xcd, 0xe4, 0xdd, 0xd9, 0xe0, 0xd9, 0xe6, 0xe7, 0x00, 0xd5, 0xe9, 0xda, 0xdb, 0xd9, 0xe2, 0xe3, 0xe1, 0xe1, 0xd9, 0xe2, 0xad
.byte 0xff, 0xbe, 0xd5, 0xe7, 0x00, 0xce, 0xd9, 0xd5, 0xe1, 0x00, 0xd8, 0xd9, 0xe7, 0x00, 0xcd, 0xe4, 0xdd, 0xd9, 0xe0, 0xd9, 0xe6, 0xe7, 0x00, 0xdd, 0xe7, 0xe8, 0x00, 0xea, 0xe3, 0xe0, 0xe0, 0xe7
.byte 0xe8, 0xf4, 0xe2, 0xd8, 0xdd, 0xdb, 0xad, 0xfe, 0xbf, 0xe7, 0x00, 0xdf, 0xd5, 0xe2, 0xe2, 0x00, 0xdf, 0xd9, 0xdd, 0xe2, 0x00, 0xeb, 0xd9, 0xdd, 0xe8, 0xd9, 0xe6, 0xd9, 0xe7, 0x00, 0xca, 0xc9
.byte 0xc5, 0x1b, 0xc7, 0xc9, 0xc8, 0xfa, 0xd5, 0xe9, 0xda, 0xdb, 0xd9, 0xe2, 0xe3, 0xe1, 0xe1, 0xd9, 0xe2, 0x00, 0xeb, 0xd9, 0xe6, 0xd8, 0xd9, 0xe2, 0xad, 0xff
gUnknown_Debug_845E3E0::
.byte 0x01, 0xe0, 0xe3, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe3, 0x45, 0x08, 0x02, 0xe4, 0x45, 0x08, 0x08, 0x00
.byte 0x01, 0x02
gUnknown_Debug_845E402::
.byte 0x01, 0x02, 0xe4, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe4, 0x45, 0x08, 0x22, 0xe4, 0x45, 0x08, 0x09, 0x02
gUnknown_Debug_845E422::
.byte 0x01, 0x22, 0xe4, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0xe4, 0x45, 0x08, 0x43, 0xe4, 0x45, 0x08, 0x0a, 0x01
.byte 0x02
gUnknown_Debug_845E443::
.byte 0x01, 0x43, 0xe4, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x61, 0xe4, 0x45, 0x08, 0xef, 0xe4, 0x45, 0x08, 0x0c, 0x67
.byte 0xe4, 0x45, 0x08, 0x02
gUnknown_Debug_845E467::
.space 100
gUnknown_Debug_845E4CB::
.space 36
gUnknown_Debug_845E4EF::
.byte 0x01, 0xef, 0xe4, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0d, 0x06, 0xe5, 0x45, 0x08, 0x02
gUnknown_Debug_845E506::
.space 256
gUnknown_Debug_845E606::
.byte 0x01, 0x06, 0xe6, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0e, 0x02
gUnknown_Debug_845E619::
.byte 0x01, 0x19, 0xe6, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x37, 0xe6, 0x45, 0x08, 0x12, 0xe7, 0x45, 0x08, 0x06, 0x08
.byte 0x01, 0x01, 0x83, 0xe6, 0x45, 0x08, 0x12, 0xe7, 0x45, 0x08, 0x03, 0xff, 0x4c, 0xe6, 0x45, 0x08, 0x04, 0x02, 0x02, 0xbc, 0xd9, 0xe7, 0xe9, 0xd7, 0xdc, 0xd9, 0x00, 0xd8, 0xd9, 0xdd, 0xe2, 0xd9
.byte 0xe2, 0x00, 0xd0, 0xd5, 0xe8, 0xd9, 0xe6, 0x00, 0xdd, 0xe2, 0x00, 0xd8, 0xd9, 0xe6, 0x00, 0xbb, 0xcc, 0xbf, 0xc8, 0xbb, 0xfe, 0xea, 0xe3, 0xe2, 0x00, 0xbc, 0xc6, 0xf3, 0xce, 0xbf, 0xc8, 0xbc
.byte 0xcf, 0xcc, 0xc1, 0x00, 0xbd, 0xc3, 0xce, 0xd3, 0xad, 0xff, 0xb8, 0x83, 0xe6, 0x45, 0x08, 0x47, 0xa9, 0x00, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0xbf, 0xe6, 0x45, 0x08, 0x4a
.byte 0xa9, 0x00, 0x01, 0x00, 0x21, 0x0d, 0x80, 0x01, 0x00, 0xbb, 0x01, 0xbf, 0xe6, 0x45, 0x08, 0x6a, 0x5a, 0xbd, 0xc0, 0xe6, 0x45, 0x08, 0x66, 0x6d, 0x1a, 0x00, 0x80, 0xa9, 0x00, 0x1a, 0x01, 0x80
.byte 0x01, 0x00, 0x09, 0x00, 0x6c, 0x0d, 0x0c, 0xd0, 0xbb, 0xce, 0xbf, 0xcc, 0xf0, 0x00, 0xc2, 0xdd, 0xb8, 0x00, 0xfd, 0x01, 0xab, 0xfb, 0xc3, 0xd7, 0xdc, 0x00, 0xdc, 0xd5, 0xd6, 0xd9, 0x00, 0xdb
.byte 0xd9, 0xe6, 0xd5, 0xd8, 0xd9, 0x00, 0xd8, 0xdd, 0xd9, 0xe7, 0xd9, 0x00, 0xe7, 0xd9, 0xe0, 0xe8, 0xd9, 0xe2, 0xd9, 0x00, 0xbc, 0xbf, 0xbf, 0xcc, 0xbf, 0xfe, 0xd9, 0xe6, 0xdc, 0xd5, 0xe0, 0xe8
.byte 0xd9, 0xe2, 0xad, 0x00, 0xc3, 0xd7, 0xdc, 0x00, 0xe7, 0xd7, 0xdc, 0xd9, 0xe2, 0xdf, 0xd9, 0x00, 0xe7, 0xdd, 0xd9, 0x00, 0xd8, 0xdd, 0xe6, 0xab, 0xff
gUnknown_Debug_845E712::
.byte 0x01, 0x12, 0xe7, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe7, 0x45, 0x08, 0x97, 0xe7, 0x45, 0x08, 0x05, 0x36
.byte 0xe7, 0x45, 0x08, 0x02, 0xb8, 0x36, 0xe7, 0x45, 0x08, 0x81, 0x00, 0x78, 0x00, 0x4b, 0x78, 0x00, 0x21, 0x0d, 0x80, 0x00, 0x00, 0xbb, 0x01, 0x55, 0xe7, 0x45, 0x08, 0xbe, 0x5d, 0xe7, 0x45, 0x08
.byte 0x0e, 0x02, 0x02, 0xbe, 0x71, 0xe7, 0x45, 0x08, 0x0e, 0x03, 0x02, 0xfd, 0x02, 0x00, 0xeb, 0xe9, 0xe6, 0xd8, 0xd9, 0x00, 0xf6, 0xd6, 0xd9, 0xe6, 0xdb, 0xd9, 0xd6, 0xd9, 0xe2, 0xad, 0xff, 0xbf
.byte 0xe7, 0x00, 0xdd, 0xe7, 0xe8, 0x00, 0xdf, 0xd9, 0xdd, 0xe2, 0x00, 0xca, 0xe0, 0xd5, 0xe8, 0xee, 0x00, 0xda, 0xf6, 0xe6, 0x00, 0xfd, 0x02, 0xfe, 0xea, 0xe3, 0xe6, 0xdc, 0xd5, 0xe2, 0xd8, 0xd9
.byte 0xe2, 0xad, 0xad, 0xad, 0xff
gUnknown_Debug_845E797::
.byte 0x01, 0x97, 0xe7, 0x45, 0x08, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xb5, 0xe7, 0x45, 0x08, 0xbb, 0xe7, 0x45, 0x08
gUnknown_Debug_845E7B5::
.byte 0x0b, 0x01, 0x03, 0x0d, 0x00, 0x02
gUnknown_Debug_845E7BB::
.byte 0x00
.endif

229
data/debug_menu_nohara.s Normal file
View File

@ -0,0 +1,229 @@
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
.if DEBUG
.align 2
gUnknown_Debug_083C48C4:: @ 0x83C48C4
.string "TV$"
gUnknown_Debug_083C48C7:: @ 0x83C48C7
.string "Fan$"
gUnknown_Debug_083C48CB:: @ 0x83C48CB
.string "Battle (vs Dad)$"
gUnknown_Debug_083C48DB:: @ 0x83C48DB
.string "Dad after battle$"
gUnknown_Debug_083C48EC:: @ 0x83C48EC
.string "SOOTOPOLIS CITY$"
gUnknown_Debug_083C48FC:: @ 0x83C48FC
.string "Embark$"
gUnknown_Debug_083C4903:: @ 0x83C4903
.string "Yes 9999$"
gUnknown_Debug_083C490C:: @ 0x83C490C
.string "Legends flag ON$"
gUnknown_Debug_083C491C:: @ 0x83C491C
.string "Add num of winning streaks$"
.align 2
gUnknown_Debug_083C4938:: @ 0x83C4938
.4byte gUnknown_Debug_083C48C4, NoharaDebugMenu_TV+1
.4byte gUnknown_Debug_083C48C7, NoharaDebugMenu_Fan+1
.4byte gUnknown_Debug_083C48CB, NoharaDebugMenu_BattleVSDad+1
.4byte gUnknown_Debug_083C48DB, NoharaDebugMenu_DadAfterBattle+1
.4byte gUnknown_Debug_083C48EC, NoharaDebugMenu_SootopolisCity+1
.4byte gUnknown_Debug_083C48FC, NoharaDebugMenu_Embark+1
.4byte gUnknown_Debug_083C4903, NoharaDebugMenu_Yes9999+1
.4byte gUnknown_Debug_083C490C, NoharaDebugMenu_LegendsFlagOn+1
.4byte gUnknown_Debug_083C491C, NoharaDebugMenu_AddNumWinningStreaks+1
gUnknown_Debug_083C4980:: @ 0x83C4980
.string "Want to change data type{CLEAR_TO 143}Press Left\n"
.string "to see secret type now{CLEAR_TO 143}to switch$"
gUnknown_Debug_083C49CA:: @ 0x83C49CA
.string "Choose the TV data you wish to\n"
.string "create to check a transmission$"
gUnknown_Debug_083C4A09:: @ 0x83C4A09
.string "  \n"
.string " 1 $"
gUnknown_Debug_083C4A2E:: @ 0x83C4A2E
.string "SURVEY$"
gUnknown_Debug_083C4A35:: @ 0x83C4A35
.string "RECENT HAPPENINGS$"
gUnknown_Debug_083C4A47:: @ 0x83C4A47
.string "POKMON FAN CLUB$"
gUnknown_Debug_083C4A58:: @ 0x83C4A58
.string "$"
gUnknown_Debug_083C4A5B:: @ 0x83C4A5B
.string "OUTBREAKS$"
gUnknown_Debug_083C4A65:: @ 0x83C4A65
.string "NAME RATER$"
gUnknown_Debug_083C4A70:: @ 0x83C4A70
.string "CONTEST$"
gUnknown_Debug_083C4A78:: @ 0x83C4A78
.string "INTRODUCTION$"
gUnknown_Debug_083C4A85:: @ 0x83C4A85
.string "SHOPPING$"
gUnknown_Debug_083C4A8E:: @ 0x83C4A8E
.string "MISFORTUNE$"
gUnknown_Debug_083C4A99:: @ 0x83C4A99
.string "FISHING$"
gUnknown_Debug_083C4AA1:: @ 0x83C4AA1
.string "MEMORABLE DAY$"
gUnknown_Debug_083C4AAF:: @ 0x83C4AAF
.string "BRAVO TRAINER$"
gUnknown_Debug_083C4ABD:: @ 0x83C4ABD
.string "   0·BIG SALE$"
gUnknown_Debug_083C4B05:: @ 0x83C4B05
.string "SERVICE DAY$"
gUnknown_Debug_083C4B11:: @ 0x83C4B11
.string "CLEAROUT SALE$"
gUnknown_Debug_083C4B20:: @ 0x83C4B20
.string " {0xFC}"
gUnknown_Debug_083C4B30:: @ 0x83C4B30
.string "Secret type$"
gUnknown_Debug_083C4B3C:: @ 0x83C4B3C
.string "Start$"
gUnknown_Debug_083C4B42:: @ 0x83C4B42
.string "Create TV$"
gUnknown_Debug_083C4B4C:: @ 0x83C4B4C
.string "All clear$"
gUnknown_Debug_083C4B56:: @ 0x83C4B56
.string "All seen$"
gUnknown_Debug_083C4B5F:: @ 0x83C4B5F
.string "Create CM$"
gUnknown_Debug_083C4B69:: @ 0x83C4B69
.string "Not yet seen$"
gUnknown_Debug_083C4B76:: @ 0x83C4B76
.string "Hit Table$"
gUnknown_Debug_083C4B80:: @ 0x83C4B80
.string "Set full$"
.align 2
gUnknown_Debug_083C4B8C:: @ 0x83C4B8C
.4byte gUnknown_Debug_083C4B30, debug_sub_808F4EC+1
.4byte gUnknown_Debug_083C4B3C, debug_sub_808F8AC+1
.4byte gUnknown_Debug_083C4B42, debug_sub_808F8CC+1
.4byte gUnknown_Debug_083C4B4C, debug_sub_808FEBC+1
.4byte gUnknown_Debug_083C4B56, debug_sub_808F560+1
.4byte gUnknown_Debug_083C4B5F, debug_sub_808FECC+1
.4byte gUnknown_Debug_083C4B69, debug_sub_808F594+1
.4byte gUnknown_Debug_083C4B76, debug_sub_808F5D8+1
.4byte gUnknown_Debug_083C4B80, debug_sub_80900AC+1
gUnknown_Debug_083C4BD4:: @ 0x83C4BD4
.string "                                                                                                                        "
gUnknown_Debug_083C4C64:: @ 0x83C4C64
.string "TERUKUN$"
gUnknown_Debug_083C4C6C:: @ 0x83C4C6C
.string "TERUTERUDA$"
gUnknown_Debug_083C4C77:: @ 0x83C4C77
.string "1 $"
gUnknown_Debug_083C4C7D:: @ 0x83C4C7D
.string "2 $"
gUnknown_Debug_083C4C83:: @ 0x83C4C83
.string "3 $"
gUnknown_Debug_083C4C89:: @ 0x83C4C89
.string "4 $"
gUnknown_Debug_083C4C8F:: @ 0x83C4C8F
.string "5 $"
gUnknown_Debug_083C4C95:: @ 0x83C4C95
.string "6 $"
gUnknown_Debug_083C4C9B:: @ 0x83C4C9B
.string "7 $"
gUnknown_Debug_083C4CA1:: @ 0x83C4CA1
.string "8 $"
.align 2
gUnknown_Debug_083C4CA8:: @ 0x83C4CA8
.4byte gUnknown_Debug_083C4C77, gUnknown_Debug_083C4C7D
.4byte gUnknown_Debug_083C4C83, gUnknown_Debug_083C4C89
.4byte gUnknown_Debug_083C4C8F, gUnknown_Debug_083C4C95
.4byte gUnknown_Debug_083C4C9B, gUnknown_Debug_083C4CA1
gUnknown_Debug_083C4CC8:: @ 0x83C4CC8
.string "Start$"
gUnknown_Debug_083C4CCE:: @ 0x83C4CCE
.string "Increase$"
gUnknown_Debug_083C4CD7:: @ 0x83C4CD7
.string "Reduce$"
gUnknown_Debug_083C4CDE:: @ 0x83C4CDE
.string "Points$"
gUnknown_Debug_083C4CE5:: @ 0x83C4CE5
.string "Play time 6$"
gUnknown_Debug_083C4CF1:: @ 0x83C4CF1
.string "P ELITE FOUR$"
gUnknown_Debug_083C4CFE:: @ 0x83C4CFE
.string "P SECRET BASE$"
gUnknown_Debug_083C4D0C:: @ 0x83C4D0C
.string "P CONTEST$"
gUnknown_Debug_083C4D16:: @ 0x83C4D16
.string "P BATTLE TOWER$"
.align 2
gUnknown_Debug_083C4D28:: @ 0x83C4D28
.4byte gUnknown_Debug_083C4CC8, debug_sub_80901E4+1
.4byte gUnknown_Debug_083C4CCE, debug_sub_80901F8+1
.4byte gUnknown_Debug_083C4CD7, debug_sub_8090238+1
.4byte gUnknown_Debug_083C4CDE, debug_sub_809029C+1
.4byte gUnknown_Debug_083C4CE5, debug_sub_80902E4+1
.4byte gUnknown_Debug_083C4CF1, debug_sub_80902FC+1
.4byte gUnknown_Debug_083C4CFE, debug_sub_8090310+1
.4byte gUnknown_Debug_083C4D0C, debug_sub_8090324+1
.4byte gUnknown_Debug_083C4D16, debug_sub_8090338+1
.endif

219
data/debug_menu_taya.s Normal file
View File

@ -0,0 +1,219 @@
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
.if DEBUG
gUnknown_Debug_083C4E54:: @ 0x83C4E54
.string "Profile$"
gUnknown_Debug_083C4E5C:: @ 0x83C4E5C
.string "Battles start$"
gUnknown_Debug_083C4E6B:: @ 0x83C4E6B
.string "Good saying$"
gUnknown_Debug_083C4E77:: @ 0x83C4E77
.string "Lose a battle$"
gUnknown_Debug_083C4E85:: @ 0x83C4E85
.string "MAIL$"
gUnknown_Debug_083C4E8A:: @ 0x83C4E8A
.string "MAIL salutation$"
gUnknown_Debug_083C4E9A:: @ 0x83C4E9A
.string "BARDs song$"
gUnknown_Debug_083C4EA6:: @ 0x83C4EA6
.string "Interview$"
gUnknown_Debug_083C4EB0:: @ 0x83C4EB0
.string "InterviewBT$"
.align 2
gUnknown_Debug_083C4EC0:: @ 0x83C4EC0
.4byte gUnknown_Debug_083C4E54, 0x0
.4byte gUnknown_Debug_083C4E5C, 0x1
.4byte gUnknown_Debug_083C4E6B, 0xD
.4byte gUnknown_Debug_083C4E77, 0x3
.4byte gUnknown_Debug_083C4E85, 0x4
.4byte gUnknown_Debug_083C4E8A, 0x5
.4byte gUnknown_Debug_083C4E9A, 0x6
.4byte gUnknown_Debug_083C4EA6, 0x7
.4byte gUnknown_Debug_083C4EB0, 0xC
gUnknown_Debug_083C4F08:: @ 0x83C4F08
.string ""
gUnknown_Debug_083C4F0E:: @ 0x83C4F0E
.string "BARD$"
gUnknown_Debug_083C4F13:: @ 0x83C4F13
.string "HIPSTER$"
gUnknown_Debug_083C4F1B:: @ 0x83C4F1B
.string "RECYCLE$"
gUnknown_Debug_083C4F23:: @ 0x83C4F23
.string "STORYTELLER$"
gUnknown_Debug_083C4F2F:: @ 0x83C4F2F
.string "GIDDY GUY$"
gUnknown_Debug_083C4F39:: @ 0x83C4F39
.string "Flag OFF$"
gUnknown_Debug_083C4F42:: @ 0x83C4F42
.string "21 letters$"
gUnknown_Debug_083C4F4D:: @ 0x83C4F4D
.string "$"
.align 2
gUnknown_Debug_083C4F54:: @ 0x83C4F54
.4byte gUnknown_Debug_083C4F0E, 0x0
.4byte gUnknown_Debug_083C4F13, 0x0
.4byte gUnknown_Debug_083C4F1B, 0x0
.4byte gUnknown_Debug_083C4F23, 0x0
.4byte gUnknown_Debug_083C4F2F, 0x0
.4byte gUnknown_Debug_083C4F39, 0x0
.4byte gUnknown_Debug_083C4F42, 0x0
.4byte gUnknown_Debug_083C4F4D, 0x0
gUnknown_Debug_083C4F94:: @ 0x83C4F94
.string "$"
gUnknown_Debug_083C4FA3:: @ 0x83C4FA3
.string "Weather$"
gUnknown_Debug_083C4FAB:: @ 0x83C4FAB
.string "LANETTES PC$"
gUnknown_Debug_083C4FB8:: @ 0x83C4FB8
.string "SimpleText$"
gUnknown_Debug_083C4FC3:: @ 0x83C4FC3
.string "Old man$"
gUnknown_Debug_083C4FCB:: @ 0x83C4FCB
.string "Trend$"
gUnknown_Debug_083C4FD1:: @ 0x83C4FD1
.string "Trend R$"
gUnknown_Debug_083C4FD9:: @ 0x83C4FD9
.string "Town flag$"
gUnknown_Debug_083C4FE3:: @ 0x83C4FE3
.string "Award a ribbon$"
gUnknown_Debug_083C4FF2:: @ 0x83C4FF2
.string "{PKMN}LOTTERY$"
gUnknown_Debug_083C4FFC:: @ 0x83C4FFC
.string "Trainer$"
gUnknown_Debug_083C5004:: @ 0x83C5004
.string "POKéNAV D$"
.align 2
gUnknown_Debug_083C5010:: @ 0x83C5010
.4byte gUnknown_Debug_083C4FA3, debug_sub_808560C+1
.4byte gUnknown_Debug_083C4FAB, TayaDebugMenu_LanettesPC+1
.4byte gUnknown_Debug_083C4FB8, TayaDebugMenu_SimpleText+1
.4byte gUnknown_Debug_083C4FC3, TayaDebugMenu_OldMan+1
.4byte gUnknown_Debug_083C4FCB, TayaDebugMenu_Trend+1
.4byte gUnknown_Debug_083C4FD1, TayaDebugMenu_TrendR+1
.4byte gUnknown_Debug_083C4FD9, TayaDebugMenu_TownFlags+1
.4byte gUnknown_Debug_083C4FE3, TayaDebugMenu_AwardARibbon+1
.4byte gUnknown_Debug_083C4FF2, TayaDebugMenu_PKMNLottery+1
gUnknown_Debug_083C5058:: @ 0x83C5058
.4byte gUnknown_Debug_083C4FFC, TayaDebugMenu_Trainer+1
.4byte gUnknown_Debug_083C5004, TayaDebugMenu_PokenavD+1
gUnknown_Debug_83C5068::
.4byte gUnknown_Debug_083C5010, 0x9
.4byte gUnknown_Debug_083C5058, 0x2
gUnknown_Debug_083C5078:: @ 0x83C5078
.string "CHANP$"
gUnknown_Debug_083C507E:: @ 0x83C507E
.string "COOL$"
gUnknown_Debug_083C5083:: @ 0x83C5083
.string "BEAUTY$"
gUnknown_Debug_083C508A:: @ 0x83C508A
.string "CUTE$"
gUnknown_Debug_083C508F:: @ 0x83C508F
.string "SMART$"
gUnknown_Debug_083C5095:: @ 0x83C5095
.string "TOUGH$"
gUnknown_Debug_083C509B:: @ 0x83C509B
.string "WIN$"
gUnknown_Debug_083C509F:: @ 0x83C509F
.string "VICTORY$"
gUnknown_Debug_083C50A7:: @ 0x83C50A7
.string "BROMIDE$"
gUnknown_Debug_083C50AF:: @ 0x83C50AF
.string "ACCESSIT$"
gUnknown_Debug_083C50B8:: @ 0x83C50B8
.string "MARINE$"
gUnknown_Debug_083C50BF:: @ 0x83C50BF
.string "LAND$"
gUnknown_Debug_083C50C4:: @ 0x83C50C4
.string "SKY$"
gUnknown_Debug_083C50C8:: @ 0x83C50C8
.string "COUNTRY$"
gUnknown_Debug_083C50D0:: @ 0x83C50D0
.string "NATIONAL$"
gUnknown_Debug_083C50D9:: @ 0x83C50D9
.string "EARTH$"
gUnknown_Debug_083C50DF:: @ 0x83C50DF
.string "WORLD$"
gUnknown_Debug_083C50E5:: @ 0x83C50E5
.string "     $"
.align 2
gUnknown_Debug_083C50EC:: @ 0x83C50EC
.4byte gUnknown_Debug_083C5078, 0x43
.4byte gUnknown_Debug_083C507E, 0x32
.4byte gUnknown_Debug_083C5083, 0x33
.4byte gUnknown_Debug_083C508A, 0x34
.4byte gUnknown_Debug_083C508F, 0x35
.4byte gUnknown_Debug_083C5095, 0x36
.4byte gUnknown_Debug_083C509B, 0x44
.4byte gUnknown_Debug_083C509F, 0x45
.4byte gUnknown_Debug_083C50A7, 0x46
.4byte gUnknown_Debug_083C50AF, 0x47
.4byte gUnknown_Debug_083C50B8, 0x48
.4byte gUnknown_Debug_083C50BF, 0x49
.4byte gUnknown_Debug_083C50C4, 0x4A
.4byte gUnknown_Debug_083C50C8, 0x4B
.4byte gUnknown_Debug_083C50D0, 0x4C
.4byte gUnknown_Debug_083C50D9, 0x4D
.4byte gUnknown_Debug_083C50DF, 0x4E
.4byte gUnknown_Debug_083C50E5, 0x0
gUnknown_Debug_083C517C:: @ 0x83C517C
.string "Select Ribbon$"
.endif

2711
data/debug_menu_tomomichi.s Normal file

File diff suppressed because it is too large Load Diff

744
data/debug_menu_watanabe.s Normal file
View File

@ -0,0 +1,744 @@
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
.if DEBUG
gUnknown_Debug_083F7FD4:: @ 0x83F7FD4
.string "$"
gUnknown_Debug_083F7FD6:: @ 0x83F7FD6
.string "$"
gUnknown_Debug_083F7FDE:: @ 0x83F7FDE
.string "$"
gUnknown_Debug_083F7FE2:: @ 0x83F7FE2
.string "L$"
gUnknown_Debug_083F7FED:: @ 0x83F7FED
.string "R$"
gUnknown_Debug_083F7FF6:: @ 0x83F7FF6
.string "U $"
gUnknown_Debug_083F8001:: @ 0x83F8001
.string "D $"
gUnknown_Debug_083F800C:: @ 0x83F800C
.string "A$"
gUnknown_Debug_083F8019:: @ 0x83F8019
.string "B$"
gUnknown_Debug_083F8022:: @ 0x83F8022
.string "スタート:$"
gUnknown_Debug_083F8028:: @ 0x83F8028
.string ":$"
gUnknown_Debug_083F802E:: @ 0x83F802E
.string "$"
gUnknown_Debug_083F8036:: @ 0x83F8036
.string "1VS1$"
gUnknown_Debug_083F803F:: @ 0x83F803F
.string "2VS2$"
gUnknown_Debug_083F8048:: @ 0x83F8048
.string "{COLOR BLUE}1VS1$"
gUnknown_Debug_083F8058:: @ 0x83F8058
.string "{COLOR BLUE}2VS2$"
gUnknown_Debug_083F8068:: @ 0x83F8068
.4byte gUnknown_Debug_083F802E, 0x100
.4byte gUnknown_Debug_083F8036, 0x108
.4byte gUnknown_Debug_083F803F, 0x209
.4byte gUnknown_Debug_083F8048, 0x10A
.4byte gUnknown_Debug_083F8058, 0x20B
gUnknown_Debug_083F8090:: @ 0x83F8090
.string "$"
gUnknown_Debug_083F8097:: @ 0x83F8097
.string "AI2$"
gUnknown_Debug_083F809E:: @ 0x83F809E
.string "AI3$"
gUnknown_Debug_083F80A5:: @ 0x83F80A5
.string "AI4$"
gUnknown_Debug_083F80AC:: @ 0x83F80AC
.string "AI5$"
gUnknown_Debug_083F80B3:: @ 0x83F80B3
.string "AI6$"
gUnknown_Debug_083F80BA:: @ 0x83F80BA
.string "AI7$"
gUnknown_Debug_083F80C1:: @ 0x83F80C1
.string "AI8$"
gUnknown_Debug_083F80C8:: @ 0x83F80C8
.string "AI9$"
gUnknown_Debug_083F80CF:: @ 0x83F80CF
.string "AI10$"
.align 2
gUnknown_Debug_083F80D8:: @ 0x83F80D8
.4byte gUnknown_Debug_083F8090, 0x1
.4byte gUnknown_Debug_083F8097, 0x2
.4byte gUnknown_Debug_083F809E, 0x4
.4byte gUnknown_Debug_083F80A5, 0x8
.4byte gUnknown_Debug_083F80AC, 0x10
.4byte gUnknown_Debug_083F80B3, 0x20
.4byte gUnknown_Debug_083F80BA, 0x40
.4byte gUnknown_Debug_083F80C1, 0x80
.4byte gUnknown_Debug_083F80C8, 0x100
.4byte gUnknown_Debug_083F80CF, 0x200
gUnknown_Debug_083F8128:: @ 0x83F8128
.string "$"
gUnknown_Debug_083F812B:: @ 0x83F812B
.string " $"
gUnknown_Debug_083F8132:: @ 0x83F8132
.string "$"
gUnknown_Debug_083F8135:: @ 0x83F8135
.string "$"
gUnknown_Debug_083F8138:: @ 0x83F8138
.string "$"
gUnknown_Debug_083F813B:: @ 0x83F813B
.string "$"
gUnknown_Debug_083F813E:: @ 0x83F813E
.string "$"
gUnknown_Debug_083F8141:: @ 0x83F8141
.string "$"
gUnknown_Debug_083F8146:: @ 0x83F8146
.string "$"
.align 2
gUnknown_Debug_083F814C:: @ 0x83F814C
.4byte gUnknown_Debug_083F8128, 0x0
.4byte gUnknown_Debug_083F812B, 0x1
.4byte gUnknown_Debug_083F8132, 0x2
.4byte gUnknown_Debug_083F8135, 0x3
.4byte gUnknown_Debug_083F8138, 0x4
.4byte gUnknown_Debug_083F813B, 0x5
.4byte gUnknown_Debug_083F813E, 0x6
.4byte gUnknown_Debug_083F8141, 0x7
.4byte gUnknown_Debug_083F8146, 0x8
gUnknown_Debug_083F8194:: @ 0x83F8194
.string " $"
gUnknown_Debug_083F81A0:: @ 0x83F81A0
.string "{COLOR RED}START:$"
gUnknown_Debug_083F81AD:: @ 0x83F81AD
.string "{COLOR RED} $"
gUnknown_Debug_083F81BA:: @ 0x83F81BA
.string "{COLOR RED} $"
gUnknown_Debug_083F81C7:: @ 0x83F81C7
.string " $"
gUnknown_Debug_083F81D6:: @ 0x83F81D6
.string "{COLOR RED} $"
gUnknown_Debug_083F81E5:: @ 0x83F81E5
.string "{COLOR RED}AI $"
gUnknown_Debug_083F81F5:: @ 0x83F81F5
.string "{COLOR RED}START:$"
gUnknown_Debug_083F8202:: @ 0x83F8202
.string "{COLOR RED} $"
gUnknown_Debug_083F8211:: @ 0x83F8211
.string "  $"
gUnknown_Debug_083F8222:: @ 0x83F8222
.string "{COLOR RED} $"
gUnknown_Debug_083F822F:: @ 0x83F822F
.string "$"
gUnknown_Debug_083F8233:: @ 0x83F8233
.string "$"
Str_83F8237:
.string "Kind$"
.align 2
_83F823C:
.4byte 1
.byte 0x82, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8248:
.string "Level$"
.align 2
_83F8250:
.4byte 1
.byte 0x64, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F825C:
.string "EXP Points$"
.align 2
_83F8268:
.4byte 1
.byte 0x80, 0x84, 0x1E, 0x00, 0x00, 0x07, 0x00, 0x00
Str_83F8274:
.string "ID$"
.align 2
_83F8278:
.4byte 0
.byte 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0A, 0x00, 0x00
Str_83F8284:
.string "Rnd Numbers$"
.align 2
_83F8290:
.4byte 0
.byte 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0A, 0x00, 0x00
Str_83F829C:
.string "Sex$"
.align 2
_83F82A0:
.4byte 0
.byte 0x02, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00
Str_83F82AC:
.string "Character$"
.align 2
_83F82B8:
.4byte 0
.byte 0x18, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00
Str_83F82C4:
.string "Move1$"
.align 2
_83F82CC:
.4byte 0
.byte 0x62, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F82D8:
.string "Move2$"
.align 2
_83F82E0:
.4byte 0
.byte 0x62, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F82EC:
.string "Move3$"
.align 2
_83F82F4:
.4byte 0
.byte 0x62, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8300:
.string "Move4$"
.align 2
_83F8308:
.4byte 0
.byte 0x62, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8314:
.string "Hold$"
.align 2
_83F831C:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8328:
.string "SP. Ability$"
.align 2
_83F8334:
.4byte 0
.byte 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00
Str_83F8340:
.string "HPrnd$"
.align 2
_83F8348:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F8354:
.string "HPexp$"
.align 2
_83F835C:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8368:
.string "ATKrnd$"
.align 2
_83F8370:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F837C:
.string "ATKexp$"
.align 2
_83F8384:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8390:
.string "DEFrnd$"
.align 2
_83F8398:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F83A4:
.string "DEFexp$"
.align 2
_83F83AC:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F83B8:
.string "SPDrnd$"
.align 2
_83F83C0:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F83CC:
.string "SPDexp$"
.align 2
_83F83D4:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F83E0:
.string "SP. ATK$"
.string "rnd$"
.align 2
_83F83EC:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F83F8:
.string "SP. ATK$"
.string "exp$"
.align 2
_83F8404:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8410:
.string "SP. DEF$"
.string "rnd$"
.align 2
_83F841C:
.4byte 0
.byte 0x1F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00
Str_83F8428:
.string "SP. DEF$"
.string "exp$"
.align 2
_83F8434:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8440:
.string "Cool$"
.align 2
_83F8448:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8454:
.string "Beauty$"
.align 2
_83F845C:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8468:
.string "Cute$"
.align 2
_83F8470:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F847C:
.string "Smart$"
.align 2
_83F8484:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F8490:
.string "Tough$"
.align 2
_83F8498:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F84A4:
.string "Sheen$"
.align 2
_83F84AC:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F84B8:
.string "Tameness$"
.align 2
_83F84C4:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F84D0:
.string "{PK}RUS$"
.align 2
_83F84D8:
.4byte 0
.byte 0xFF, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00
Str_83F84E4:
.string "EGG$"
.string "$"
.align 2
_83F84EC:
.4byte 0
.byte 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00
Str_83F84F8:
.string "Status$"
.align 2
_83F8500:
.4byte 0
.byte 0x06, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00
gUnknown_Debug_083F850A:: @ 0x83F850A
.string "{COLOR RED}HP  $"
gUnknown_Debug_083F8514:: @ 0x83F8514
.string "{COLOR RED}ATK $"
gUnknown_Debug_083F851C:: @ 0x83F851C
.string "{COLOR RED}DEF $"
gUnknown_Debug_083F8524:: @ 0x83F8524
.string "{COLOR RED}SPEED$"
gUnknown_Debug_083F852D:: @ 0x83F852D
.string "{COLOR RED}SPATK$"
gUnknown_Debug_083F8537:: @ 0x83F8537
.string "{COLOR RED}SPDEF$"
gUnknown_Debug_083F8541:: @ 0x83F8541
.string "$"
gUnknown_Debug_083F8544:: @ 0x83F8544
.string "$"
gUnknown_Debug_083F8546:: @ 0x83F8546
.string "$"
gUnknown_Debug_083F8548:: @ 0x83F8548
.string "$"
gUnknown_Debug_083F854A:: @ 0x83F854A
.string "ON$"
gUnknown_Debug_083F854D:: @ 0x83F854D
.string "OFF$"
.align 2
gUnknown_Debug_083F8554:: @ 0x83F8554
.4byte Str_83F8237, _83F823C
.4byte Str_83F8248, _83F8250
.4byte Str_83F825C, _83F8268
.4byte Str_83F8274, _83F8278
.4byte Str_83F8284, _83F8290
.4byte Str_83F829C, _83F82A0
.4byte Str_83F82AC, _83F82B8
.4byte Str_83F82C4, _83F82CC
.4byte Str_83F82D8, _83F82E0
.4byte Str_83F82EC, _83F82F4
.4byte Str_83F8300, _83F8308
.4byte Str_83F8314, _83F831C
.4byte Str_83F8328, _83F8334
.4byte Str_83F8340, _83F8348
.4byte Str_83F8354, _83F835C
.4byte Str_83F8368, _83F8370
.4byte Str_83F837C, _83F8384
.4byte Str_83F8390, _83F8398
.4byte Str_83F83A4, _83F83AC
.4byte Str_83F83B8, _83F83C0
.4byte Str_83F83CC, _83F83D4
.4byte Str_83F83E0, _83F83EC
.4byte Str_83F83F8, _83F8404
.4byte Str_83F8410, _83F841C
.4byte Str_83F8428, _83F8434
.4byte Str_83F8440, _83F8448
.4byte Str_83F8454, _83F845C
.4byte Str_83F8468, _83F8470
.4byte Str_83F847C, _83F8484
.4byte Str_83F8490, _83F8498
.4byte Str_83F84A4, _83F84AC
.4byte Str_83F84B8, _83F84C4
.4byte Str_83F84D0, _83F84D8
.4byte Str_83F84E4, _83F84EC
.4byte Str_83F84F8, _83F8500
gUnknown_Debug_083F866C:: @ 0x83F866C
.string " $"
gUnknown_Debug_083F8674:: @ 0x83F8674
.string "$"
gUnknown_Debug_083F8678:: @ 0x83F8678
.string "$"
gUnknown_Debug_083F867F:: @ 0x83F867F
.string "\n"
.string "$"
gUnknown_Debug_083F8687:: @ 0x83F8687
.string "{STRING 255}$"
.align 2
gUnknown_Debug_083F8698:: @ 0x83F8698
.4byte gUnknown_Debug_083F866C, 0x5
.4byte gUnknown_Debug_083F8674, 0x3
.4byte gUnknown_Debug_083F8678, 0x6
.4byte gUnknown_Debug_083F867F, 0x6
.4byte gUnknown_Debug_083F8687, 0x6
.4byte 0x83F868F, 0x6
gUnknown_Debug_083F86C8:: @ 0x83F86C8
.string "$"
gUnknown_Debug_083F86CC:: @ 0x83F86CC
.string "SLP$"
gUnknown_Debug_083F86D0:: @ 0x83F86D0
.string "PSN$"
gUnknown_Debug_083F86D4:: @ 0x83F86D4
.string "BRN$"
gUnknown_Debug_083F86D8:: @ 0x83F86D8
.string "FRZ$"
gUnknown_Debug_083F86DC:: @ 0x83F86DC
.string "PAR$"
gUnknown_Debug_083F86E0:: @ 0x83F86E0
.string "PSN2$"
.align 2
gUnknown_Debug_083F86E8:: @ 0x83F86E8
.4byte gUnknown_Debug_083F86C8, 0x0
.4byte gUnknown_Debug_083F86CC, 0x1
.4byte gUnknown_Debug_083F86D0, 0x8
.4byte gUnknown_Debug_083F86D4, 0x10
.4byte gUnknown_Debug_083F86D8, 0x20
.4byte gUnknown_Debug_083F86DC, 0x40
.4byte gUnknown_Debug_083F86E0, 0x80
gUnknown_Debug_083F8720:: @ 0x83F8720
.string "PKMNLIST$"
gUnknown_Debug_083F872A:: @ 0x83F872A
.string "PKMNBOX$"
gUnknown_Debug_083F8733:: @ 0x83F8733
.string "Create POKMON   LR:Shift  START:Add$"
gUnknown_Debug_083F8758:: @ 0x83F8758
.string "$"
gUnknown_Debug_083F875C:: @ 0x83F875C
.string "DebugG$"
gUnknown_Debug_083F8764::
.string " $"
.byte 0, 0
gUnknown_Debug_083F8768::
.4byte 0x00000001
.4byte 0x0000000a
.4byte 0x00000064
.4byte 0x000003e8
.4byte 0x00002710
.4byte 0x000186a0
.4byte 0x000f4240
.4byte 0x00989680
.4byte 0x05f5e100
.4byte 0x3b9aca00
gUnknown_Debug_083F8790::
.2byte 0x0000
.2byte 0x0002
.2byte 0x0004
.2byte 0x0006
.2byte 0x0008
.2byte 0x000a
.2byte 0x000c
.2byte 0x000e
.2byte 0x0010
.2byte 0x0012
.2byte 0x0014
.2byte 0x0016
.2byte 0x0018
.2byte 0x001a
.2byte 0x001c
.2byte 0x001e
.2byte 0x001f
.2byte 0x001e
.2byte 0x001c
.2byte 0x001a
.2byte 0x0018
.2byte 0x0016
.2byte 0x0014
.2byte 0x0012
.2byte 0x0010
.2byte 0x000e
.2byte 0x000c
.2byte 0x000a
.2byte 0x0008
.2byte 0x0006
.2byte 0x0004
.2byte 0x0002
gUnknown_Debug_083F87D0:: @ 0x83F87D0
.string "{COLOR RED}L{ESCAPE}$"
gUnknown_Debug_083F87D8:: @ 0x83F87D8
.string "{COLOR RED}{ESCAPE}R$"
gUnknown_Debug_083F87E0:: @ 0x83F87E0
.string "$"
gUnknown_Debug_083F87E9:: @ 0x83F87E9
.string "$"
gUnknown_Debug_083F87F4:: @ 0x83F87F4
.string "{COLOR RED}A:$"
gUnknown_Debug_083F8801:: @ 0x83F8801
.string "{COLOR RED}A: B:$"
gUnknown_Debug_083F8813:: @ 0x83F8813
.string ":$"
gUnknown_Debug_083F8815::
.byte 0x00
.byte 0x10
.byte 0x20
.byte 0x20
.byte 0x20
.byte 0x21
.byte 0x20
.byte 0x20
.byte 0x20
.byte 0x21
.byte 0x20
.byte 0x20
.byte 0x20
.byte 0x21
.byte 0x20
.byte 0x20
.byte 0x20
.byte 0x21
.align 2
stru_83F8828::
obj_tiles byte_83F88EC, 0x800, 0x1000
null_obj_tiles
stru_83F8838::
obj_pal word_83F888C, 0x1000
null_obj_pal
gOamData_83F8848:
.2byte 0x00a0
.2byte 0x0000
.2byte 0x0000
.align 2
gSpriteAnim_83F8850:
obj_image_anim_frame 38, 30
obj_image_anim_end
gSpriteAnim_83F8858:
obj_image_anim_frame 39, 30
obj_image_anim_end
gSpriteAnim_83F8860:
obj_image_anim_frame 40, 30
obj_image_anim_end
gSpriteAnimTable_83F8868::
.4byte gSpriteAnim_83F8850, gSpriteAnim_83F8858, gSpriteAnim_83F8860
gSpriteTemplate_83F8874::
spr_template 0x1000, 0x1000, gOamData_83F8848, gSpriteAnimTable_83F8868, 0, gDummySpriteAffineAnimTable, debug_80C7584
word_83F888C::
.incbin "graphics/debug/sprite_browser.gbapal"
byte_83F88EC::
.incbin "graphics/debug/sprite_browser.4bpp"
.endif

View File

@ -0,0 +1,20 @@
.if DEBUG
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
Str_843DA70::
.string "CARDE emulation$"
Str_843DA84::
.string "LR: select A: send$"
Str_843DA98::
.string "sending$"
Str_843DAA3::
.string "completed$"
.endif

View File

@ -3269,6 +3269,7 @@ PacifidlogTown_House2_EventScript_1A14DC:: @ 81A14DC
Route101_EventScript_1A14DC:: @ 81A14DC
return
.include "data/scripts/debug.inc"
.include "data/scripts/berry_tree.inc"
.include "data/text/berry_tree.inc"

View File

@ -18,8 +18,11 @@ gUnknown_08D00524:: @ 8D00524
.include "data/graphics/pokemon/circled_question_mark_graphics.inc"
@ 8D019E4
gUnusedOldCharmap_Gfx_lz::
.incbin "graphics/unused/old_charmap.4bpp.lz" @ japanese table and bunch of stuff
gUnusedOldCharmap_Tilemap_lz::
.incbin "graphics/unused/old_charmap.bin.lz"
gUnusedOldCharmap_Pal_lz::
.incbin "graphics/unused/old_charmap.gbapal.lz"
.align 2

View File

@ -4,6 +4,7 @@
.section .rodata
.align 2
gUnknown_083BBBD4:: @ 83BBBD4
.4byte sub_809C464, 0
.4byte sub_809C664, 1
@ -71,6 +72,11 @@ gSpriteTemplate_83BBC70:: @ 83BBC70
gSpriteTemplate_83BBC88:: @ 83BBC88
spr_template 1, 56006, gOamData_83BBC34, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_809CB74
.if DEBUG
gUnknown_Debug_0x83E6268:: @ 0x83E6268
.string "$"
.endif
.align 2
gUnknown_083BBCA0:: @ 83BBCA0
.4byte PCText_Cancel2
@ -105,3 +111,6 @@ gUnknown_083BBCA0:: @ 83BBCA0
.4byte PCText_PokeCenter
.4byte PCText_Machine
.4byte PCText_Plain
.if DEBUG
.4byte gUnknown_Debug_0x83E6268
.endif

View File

@ -147,6 +147,13 @@ gUnknown_083F8EF4:: @ 83F8EF4
// This might indicate a file boundary
.if DEBUG
@ Could also be after English-only graphics
gUnknown_Debug_0842510D:: @ 0x842510D
.string "Set COIN and Press START\n"
.string "Ap1 Bm1 R:L×10$"
.endif
.ifdef ENGLISH
.align 2
RouletteSpritePalette_01:

536
data/scripts/debug.inc vendored Normal file
View File

@ -0,0 +1,536 @@
.if DEBUG
DebugScript_081C1CFE:: @ 81C1CFE
setflag 0x804
call EverGrandeCity_HallOfFame_EventScript_19FC13
end
DebugScript_081C1D07:: @ 81C1D07
checkitem ITEM_COIN_CASE, 1
compare 0x800d, 1
goto_if_eq DebugScript_081C1D1D
giveitem ITEM_COIN_CASE, 1
end
DebugScript_081C1D1D:: @ 81C1D1D
end
DebugScript_081C1D1E:: @ 81C1D1E
goto Route103_EventScript_14ED46
DebugScript_081C1D23:: @ 81C1D23
end
DebugScript_081C1D24:: @ 81C1D24
setvar 0x40ba, 1
end
DebugScript_081C1D2A:: @ 81C1D2A
giveitem ITEM_SS_TICKET, 1
goto DebugScript_081C1CFE
DebugScript_081C1D34:: @ 81C1D34
end
DebugScript_081C1D35:: @ 81C1D35
getpartysize
compare 0x800d, 6
goto_if_eq DebugScript_081C1D45
giveegg SPECIES_KYOGRE
end
DebugScript_081C1D45:: @ 81C1D45
end
DebugScript_081C1D46:: @ 81C1D46
giveitem ITEM_POTION, 99
giveitem ITEM_ANTIDOTE, 99
giveitem ITEM_BURN_HEAL, 99
giveitem ITEM_ICE_HEAL, 99
giveitem ITEM_AWAKENING, 99
giveitem ITEM_PARALYZE_HEAL, 99
giveitem ITEM_FULL_RESTORE, 99
giveitem ITEM_MAX_POTION, 99
giveitem ITEM_HYPER_POTION, 99
giveitem ITEM_SUPER_POTION, 99
giveitem ITEM_FULL_HEAL, 99
giveitem ITEM_REVIVE, 99
giveitem ITEM_MAX_REVIVE, 99
giveitem ITEM_FRESH_WATER, 99
giveitem ITEM_SODA_POP, 99
giveitem ITEM_LEMONADE, 99
giveitem ITEM_MOOMOO_MILK, 99
giveitem ITEM_ENERGY_POWDER, 99
giveitem ITEM_ENERGY_ROOT, 99
giveitem ITEM_HEAL_POWDER, 99
giveitem ITEM_ORANGE_MAIL, 92
giveitem ITEM_RETRO_MAIL, 94
giveitem ITEM_POTION, 89
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_ULTRA_BALL, 99
giveitem ITEM_GREAT_BALL, 99
giveitem ITEM_POKE_BALL, 99
giveitem ITEM_NET_BALL, 99
giveitem ITEM_DIVE_BALL, 99
giveitem ITEM_NEST_BALL, 99
giveitem ITEM_REPEAT_BALL, 99
giveitem ITEM_TIMER_BALL, 99
giveitem ITEM_LUXURY_BALL, 99
giveitem ITEM_PREMIER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_MASTER_BALL, 99
giveitem ITEM_GREAT_BALL, 79
giveitem ITEM_ULTRA_BALL, 84
giveitem ITEM_POKE_BALL, 89
giveitem ITEM_MASTER_BALL, 74
giveitem ITEM_TM01_FOCUS_PUNCH, 99
giveitem ITEM_TM02_DRAGON_CLAW, 99
giveitem ITEM_TM03_WATER_PULSE, 99
giveitem ITEM_TM04_CALM_MIND, 99
giveitem ITEM_TM05_ROAR, 99
giveitem ITEM_TM06_TOXIC, 99
giveitem ITEM_TM07_HAIL, 99
giveitem ITEM_TM08_BULK_UP, 99
giveitem ITEM_TM09_BULLET_SEED, 99
giveitem ITEM_TM10_HIDDEN_POWER, 99
giveitem ITEM_TM11_SUNNY_DAY, 99
giveitem ITEM_TM12_TAUNT, 99
giveitem ITEM_TM13_ICE_BEAM, 99
giveitem ITEM_TM14_BLIZZARD, 99
giveitem ITEM_TM15_HYPER_BEAM, 99
giveitem ITEM_TM16_LIGHT_SCREEN, 99
giveitem ITEM_TM17_PROTECT, 99
giveitem ITEM_TM18_RAIN_DANCE, 99
giveitem ITEM_TM19_GIGA_DRAIN, 99
giveitem ITEM_TM20_SAFEGUARD, 99
giveitem ITEM_TM21_FRUSTRATION, 99
giveitem ITEM_TM22_SOLARBEAM, 99
giveitem ITEM_TM23_IRON_TAIL, 99
giveitem ITEM_TM24_THUNDERBOLT, 99
giveitem ITEM_TM25_THUNDER, 99
giveitem ITEM_TM26_EARTHQUAKE, 99
giveitem ITEM_TM27_RETURN, 99
giveitem ITEM_TM28_DIG, 99
giveitem ITEM_TM29_PSYCHIC, 99
giveitem ITEM_TM30_SHADOW_BALL, 99
giveitem ITEM_TM31_BRICK_BREAK, 99
giveitem ITEM_TM32_DOUBLE_TEAM, 99
giveitem ITEM_TM33_REFLECT, 99
giveitem ITEM_TM34_SHOCK_WAVE, 99
giveitem ITEM_TM35_FLAMETHROWER, 99
giveitem ITEM_TM36_SLUDGE_BOMB, 99
giveitem ITEM_TM37_SANDSTORM, 99
giveitem ITEM_TM38_FIRE_BLAST, 99
giveitem ITEM_TM39_ROCK_TOMB, 99
giveitem ITEM_TM40_AERIAL_ACE, 99
giveitem ITEM_TM41_TORMENT, 99
giveitem ITEM_TM42_FACADE, 99
giveitem ITEM_TM43_SECRET_POWER, 99
giveitem ITEM_TM44_REST, 99
giveitem ITEM_TM45_ATTRACT, 99
giveitem ITEM_TM46_THIEF, 99
giveitem ITEM_TM47_STEEL_WING, 99
giveitem ITEM_TM48_SKILL_SWAP, 99
giveitem ITEM_TM49_SNATCH, 99
giveitem ITEM_TM50_OVERHEAT, 99
giveitem ITEM_CHERI_BERRY, 200
giveitem ITEM_CHERI_BERRY, 200
giveitem ITEM_CHERI_BERRY, 200
giveitem ITEM_CHERI_BERRY, 200
giveitem ITEM_CHERI_BERRY, 199
giveitem ITEM_CHESTO_BERRY, 200
giveitem ITEM_CHESTO_BERRY, 200
giveitem ITEM_CHESTO_BERRY, 200
giveitem ITEM_CHESTO_BERRY, 200
giveitem ITEM_CHESTO_BERRY, 199
giveitem ITEM_PECHA_BERRY, 200
giveitem ITEM_PECHA_BERRY, 200
giveitem ITEM_PECHA_BERRY, 200
giveitem ITEM_PECHA_BERRY, 200
giveitem ITEM_PECHA_BERRY, 199
giveitem ITEM_RAWST_BERRY, 200
giveitem ITEM_RAWST_BERRY, 200
giveitem ITEM_RAWST_BERRY, 200
giveitem ITEM_RAWST_BERRY, 200
giveitem ITEM_RAWST_BERRY, 199
giveitem ITEM_ASPEAR_BERRY, 200
giveitem ITEM_ASPEAR_BERRY, 200
giveitem ITEM_ASPEAR_BERRY, 200
giveitem ITEM_ASPEAR_BERRY, 200
giveitem ITEM_ASPEAR_BERRY, 199
giveitem ITEM_LEPPA_BERRY, 200
giveitem ITEM_LEPPA_BERRY, 200
giveitem ITEM_LEPPA_BERRY, 200
giveitem ITEM_LEPPA_BERRY, 200
giveitem ITEM_LEPPA_BERRY, 199
giveitem ITEM_ORAN_BERRY, 200
giveitem ITEM_ORAN_BERRY, 200
giveitem ITEM_ORAN_BERRY, 200
giveitem ITEM_ORAN_BERRY, 200
giveitem ITEM_ORAN_BERRY, 199
giveitem ITEM_PERSIM_BERRY, 200
giveitem ITEM_PERSIM_BERRY, 200
giveitem ITEM_PERSIM_BERRY, 200
giveitem ITEM_PERSIM_BERRY, 200
giveitem ITEM_PERSIM_BERRY, 199
giveitem ITEM_LUM_BERRY, 200
giveitem ITEM_LUM_BERRY, 200
giveitem ITEM_LUM_BERRY, 200
giveitem ITEM_LUM_BERRY, 200
giveitem ITEM_LUM_BERRY, 199
giveitem ITEM_SITRUS_BERRY, 200
giveitem ITEM_SITRUS_BERRY, 200
giveitem ITEM_SITRUS_BERRY, 200
giveitem ITEM_SITRUS_BERRY, 200
giveitem ITEM_SITRUS_BERRY, 199
giveitem ITEM_FIGY_BERRY, 200
giveitem ITEM_FIGY_BERRY, 200
giveitem ITEM_FIGY_BERRY, 200
giveitem ITEM_FIGY_BERRY, 200
giveitem ITEM_FIGY_BERRY, 199
giveitem ITEM_WIKI_BERRY, 200
giveitem ITEM_WIKI_BERRY, 200
giveitem ITEM_WIKI_BERRY, 200
giveitem ITEM_WIKI_BERRY, 200
giveitem ITEM_WIKI_BERRY, 199
giveitem ITEM_MAGO_BERRY, 200
giveitem ITEM_MAGO_BERRY, 200
giveitem ITEM_MAGO_BERRY, 200
giveitem ITEM_MAGO_BERRY, 200
giveitem ITEM_MAGO_BERRY, 199
giveitem ITEM_AGUAV_BERRY, 200
giveitem ITEM_AGUAV_BERRY, 200
giveitem ITEM_AGUAV_BERRY, 200
giveitem ITEM_AGUAV_BERRY, 200
giveitem ITEM_AGUAV_BERRY, 199
giveitem ITEM_IAPAPA_BERRY, 200
giveitem ITEM_IAPAPA_BERRY, 200
giveitem ITEM_IAPAPA_BERRY, 200
giveitem ITEM_IAPAPA_BERRY, 200
giveitem ITEM_IAPAPA_BERRY, 199
giveitem ITEM_RAZZ_BERRY, 200
giveitem ITEM_RAZZ_BERRY, 200
giveitem ITEM_RAZZ_BERRY, 200
giveitem ITEM_RAZZ_BERRY, 200
giveitem ITEM_RAZZ_BERRY, 199
giveitem ITEM_BLUK_BERRY, 200
giveitem ITEM_BLUK_BERRY, 200
giveitem ITEM_BLUK_BERRY, 200
giveitem ITEM_BLUK_BERRY, 200
giveitem ITEM_BLUK_BERRY, 199
giveitem ITEM_NANAB_BERRY, 200
giveitem ITEM_NANAB_BERRY, 200
giveitem ITEM_NANAB_BERRY, 200
giveitem ITEM_NANAB_BERRY, 200
giveitem ITEM_NANAB_BERRY, 199
giveitem ITEM_WEPEAR_BERRY, 200
giveitem ITEM_WEPEAR_BERRY, 200
giveitem ITEM_WEPEAR_BERRY, 200
giveitem ITEM_WEPEAR_BERRY, 200
giveitem ITEM_WEPEAR_BERRY, 199
giveitem ITEM_PINAP_BERRY, 200
giveitem ITEM_PINAP_BERRY, 200
giveitem ITEM_PINAP_BERRY, 200
giveitem ITEM_PINAP_BERRY, 200
giveitem ITEM_PINAP_BERRY, 199
giveitem ITEM_POMEG_BERRY, 200
giveitem ITEM_POMEG_BERRY, 200
giveitem ITEM_POMEG_BERRY, 200
giveitem ITEM_POMEG_BERRY, 200
giveitem ITEM_POMEG_BERRY, 199
giveitem ITEM_KELPSY_BERRY, 200
giveitem ITEM_KELPSY_BERRY, 200
giveitem ITEM_KELPSY_BERRY, 200
giveitem ITEM_KELPSY_BERRY, 200
giveitem ITEM_KELPSY_BERRY, 199
giveitem ITEM_QUALOT_BERRY, 200
giveitem ITEM_QUALOT_BERRY, 200
giveitem ITEM_QUALOT_BERRY, 200
giveitem ITEM_QUALOT_BERRY, 200
giveitem ITEM_QUALOT_BERRY, 199
giveitem ITEM_HONDEW_BERRY, 200
giveitem ITEM_HONDEW_BERRY, 200
giveitem ITEM_HONDEW_BERRY, 200
giveitem ITEM_HONDEW_BERRY, 200
giveitem ITEM_HONDEW_BERRY, 199
giveitem ITEM_GREPA_BERRY, 200
giveitem ITEM_GREPA_BERRY, 200
giveitem ITEM_GREPA_BERRY, 200
giveitem ITEM_GREPA_BERRY, 200
giveitem ITEM_GREPA_BERRY, 199
giveitem ITEM_TAMATO_BERRY, 200
giveitem ITEM_TAMATO_BERRY, 200
giveitem ITEM_TAMATO_BERRY, 200
giveitem ITEM_TAMATO_BERRY, 200
giveitem ITEM_TAMATO_BERRY, 199
giveitem ITEM_CORNN_BERRY, 200
giveitem ITEM_CORNN_BERRY, 200
giveitem ITEM_CORNN_BERRY, 200
giveitem ITEM_CORNN_BERRY, 200
giveitem ITEM_CORNN_BERRY, 199
giveitem ITEM_MAGOST_BERRY, 999
giveitem ITEM_RABUTA_BERRY, 999
giveitem ITEM_NOMEL_BERRY, 999
giveitem ITEM_SPELON_BERRY, 999
giveitem ITEM_PAMTRE_BERRY, 999
giveitem ITEM_WATMEL_BERRY, 999
giveitem ITEM_DURIN_BERRY, 999
giveitem ITEM_BELUE_BERRY, 999
giveitem ITEM_LIECHI_BERRY, 999
giveitem ITEM_GANLON_BERRY, 999
giveitem ITEM_SALAC_BERRY, 999
giveitem ITEM_PETAYA_BERRY, 999
giveitem ITEM_APICOT_BERRY, 999
giveitem ITEM_LANSAT_BERRY, 999
giveitem ITEM_STARF_BERRY, 999
giveitem ITEM_ENIGMA_BERRY, 999
end
DebugScript_081C221F:: @ 81C221F
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_DESK
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_SMALL_CHAIR
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_PLANT
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_RED_BRICK
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_JUMP_MAT
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_BALL_POSTER
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_DUSKULL_DOLL
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
givedecoration DECOR_KISS_CUSHION
end
DebugScript_081C23E2:: @ 81C23E2
givecoins 9999
end
DebugScript_081C23E6:: @ 81C23E6
setflag 0x081
setflag 0x071
warp MAP_SOOTOPOLIS_CITY, 0xFF, 31, 33
waitstate
end
DebugScript_081C23F6:: @ 81C23F6
takemoney 999999, 0x00
end
DebugScript_081C23FD:: @ 81C23FD
getpartysize
compare 0x800d, 1
goto_if_eq DebugScript_081C2436
compare 0x800d, 2
goto_if_eq DebugScript_081C2445
compare 0x800d, 3
goto_if_eq DebugScript_081C2454
compare 0x800d, 4
goto_if_eq DebugScript_081C2463
compare 0x800d, 5
goto_if_eq DebugScript_081C2472
end
DebugScript_081C2436:: @ 81C2436
givemon SPECIES_BARBOACH, 99, 0, 0, 0, 0
DebugScript_081C2445:
givemon SPECIES_BARBOACH, 99, 0, 0, 0, 0
DebugScript_081C2454:
givemon SPECIES_BARBOACH, 99, 0, 0, 0, 0
DebugScript_081C2463:
givemon SPECIES_BARBOACH, 99, 0, 0, 0, 0
DebugScript_081C2472:
givemon SPECIES_BARBOACH, 99, 0, 0, 0, 0
end
DebugScript_081C2482:: @ 81C2482
getpartysize
compare 0x800d, 1
goto_if_eq DebugScript_081C24BB
compare 0x800d, 2
goto_if_eq DebugScript_081C24CA
compare 0x800d, 3
goto_if_eq DebugScript_081C24D9
compare 0x800d, 4
goto_if_eq DebugScript_081C24E8
compare 0x800d, 5
goto_if_eq DebugScript_081C24F7
end
DebugScript_081C24BB:: @ 81C24BB
givemon SPECIES_SHROOMISH, 99, 0, 0, 0, 0
DebugScript_081C24CA:
givemon SPECIES_SHROOMISH, 99, 0, 0, 0, 0
DebugScript_081C24D9:
givemon SPECIES_SHROOMISH, 99, 0, 0, 0, 0
DebugScript_081C24E8:
givemon SPECIES_SHROOMISH, 99, 0, 0, 0, 0
DebugScript_081C24F7:
givemon SPECIES_SHROOMISH, 99, 0, 0, 0, 0
end
DebugScript_081C2507:: @ 81C2507
getpartysize
compare 0x800d, 6
goto_if_eq DebugScript_081C2517
giveegg SPECIES_BARBOACH
end
DebugScript_081C2517:: @ 81C2517
end
DebugScript_081C2518:: @ 81C2518
getpartysize
compare 0x800d, 6
goto_if_eq DebugScript_081C2528
giveegg SPECIES_SHROOMISH
end
DebugScript_081C2528:: @ 81C2528
end
.endif

495
data/start_menu_debug.s Normal file
View File

@ -0,0 +1,495 @@
.if DEBUG
#include "constants/moves.h"
.include "include/macros.inc"
.include "constants/constants.inc"
.section .rodata
Str_839BD90:: @ 0x839BD90
.string "$"
Str_839BD96:: @ 0x839BD96
.string "$"
Str_839BD9C:: @ 0x839BD9C
.string "$"
Str_839BDA0:: @ 0x839BDA0
.string "$"
Str_839BDA6:: @ 0x839BDA6
.string "$"
Str_839BDAC:: @ 0x839BDAC
.string "RAYMOND$"
Str_839BDB4:: @ 0x839BDB4
.string "TIFFANY$"
Str_839BDBC:: @ 0x839BDBC
.string "x$"
.align 2
gUnknown_Debug_839BDC4:: @ 0x839BDC4
.4byte Str_839BD90, 0x0
.4byte Str_839BD96, 0x0
.4byte Str_839BDA0, 0x1
.4byte Str_839BDA6, 0x1
.4byte Str_839BDAC, 0x80
.4byte Str_839BDB4, 0x81
.4byte Str_839BD9C, 0x0
.4byte Str_839BDBC, 0x1
Str_839BE04:: @ 0x839BE04
.string "ID$"
Str_839BE07:: @ 0x839BE07
.string "X$"
Str_839BE09:: @ 0x839BE09
.string " Y$"
Str_839BE0C:: @ 0x839BE0C
.string " H$"
Str_839BE0F:: @ 0x839BE0F
.string "HP$"
Str_839BE12:: @ 0x839BE12
.string "PAR$"
Str_839BE16:: @ 0x839BE16
.string "SLP$"
Str_839BE1A:: @ 0x839BE1A
.string "PSN$"
Str_839BE1E:: @ 0x839BE1E
.string "$"
.align 2
gUnknown_Debug_839BE24:: @ 0x839BE24
.4byte Str_839BE0F, DebugMenu_8077434+1
.4byte Str_839BE12, DebugMenu_8077434+1
.4byte Str_839BE16, DebugMenu_8077434+1
.4byte Str_839BE1A, DebugMenu_8077434+1
.4byte Str_839BE1E, DebugMenu_8077434+1
Str_839BE4C:: @ 0x839BE4C
.string "OFF$"
Str_839BE50:: @ 0x839BE50
.string "ON$"
Str_839BE53:: @ 0x839BE53
.string "BG0\n"
.string "BG1\n"
.string "BG2\n"
.string "BG3\n"
.string "$"
Str_839BE64:: @ 0x839BE64
.string "ON$"
Str_839BE67:: @ 0x839BE67
.string "OFF$"
Str_839BE6B:: @ 0x839BE6B
.string "さいせんかのうトレーナー:{STR_VAR_1}\n"
.string "さいせんじょうたいトレーナー:{STR_VAR_2}$"
Str_839BE8D:: @ 0x839BE8D
.string "$"
Str_839BE90:: @ 0x839BE90
.string "$"
Str_839BE94:: @ 0x839BE94
.string "Max num of steps$"
Str_839BEA5:: @ 0x839BEA5
.string "Clear num of steps$"
Str_839BEB8:: @ 0x839BEB8
.string "See trainers$"
Str_839BEC5:: @ 0x839BEC5
.string "Flag all clear$"
Str_839BED4:: @ 0x839BED4
.string "Flag all set$"
.align 2
gUnknown_Debug_839BEE4:: @ 0x839BEE4
.4byte Str_839BEB8, DebugMenu_8077974+1
.4byte Str_839BE94, DebugMenu_8077A20+1
.4byte Str_839BEA5, DebugMenu_8077A40+1
.4byte Str_839BED4, DebugMenu_8077934+1
.4byte Str_839BEC5, DebugMenu_8077954+1
Str_839BF0C:: @ 0x839BF0C
.string " {STR_VAR_1}$"
Str_839BF14:: @ 0x839BF14
.string "{STR_VAR_1}\n"
.string " {STR_VAR_2}$"
Str_839BF1F:: @ 0x839BF1F
.string "\n"
.string " $"
Str_839BF33:: @ 0x839BF33
.string "1$"
Str_839BF3F:: @ 0x839BF3F
.string "1$"
Str_839BF4B:: @ 0x839BF4B
.string "$"
Str_839BF53:: @ 0x839BF53
.string "30$"
Str_839BF5E:: @ 0x839BF5E
.string "500$"
.align 2
gUnknown_Debug_839BF6C:: @ 0x839BF6C
.4byte Str_839BF4B, DebugMenu_8077B00+1
.4byte Str_839BF5E, DebugMenu_8077ACC+1
.4byte Str_839BF33, DebugMenu_8077AE8+1
.4byte Str_839BF53, DebugMenu_8077A9C+1
.4byte Str_839BF3F, DebugMenu_8077AB4+1
gUnknown_Debug_839BF94:: @ 0x839BF94
.4byte gMoveNames + 13 * MOVE_CUT, DebugMenu_8077BB4+1
.4byte gMoveNames + 13 * MOVE_FLASH, DebugMenu_8077BC0+1
.4byte gMoveNames + 13 * MOVE_ROCK_SMASH, DebugMenu_8077BCC+1
.4byte gMoveNames + 13 * MOVE_STRENGTH, DebugMenu_8077BD8+1
.4byte gMoveNames + 13 * MOVE_SURF, debug_sub_80B0770+1
.4byte gMoveNames + 13 * MOVE_FLY, debug_sub_80B07B0+1
.4byte gMoveNames + 13 * MOVE_WATERFALL, DebugMenu_8077BE4+1
.4byte gMoveNames + 13 * MOVE_DIVE, debug_sub_80B0800+1
.4byte gMoveNames + 13 * MOVE_SECRET_POWER, DebugMenu_8077BF4+1
Str_839BFDC:: @ 0x839BFDC
.string "   $"
gUnknown_Debug_839BFE8::
.byte 0x63, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00
Str_839C008: @ 0x839C008
gDebug0x839C008::
.string "Which item?$"
Str_839C014:: @ 0x839C014
.string "How many$"
Str_839C01E:: @ 0x839C01E
.string " \n"
.string "\n"
.string "\n"
.string "\n"
.string "\n"
.string "$"
Str_839C04D:: @ 0x839C04D
.string "$"
Str_839C053:: @ 0x839C053
.string "Miracle Island emerged\n"
.string "Random numbers:{STR_VAR_1}$"
Str_839C07C:: @ 0x839C07C
.string "{STR_VAR_1}:{STR_VAR_2}\n"
.string "{STR_VAR_3}$"
Str_839C085:: @ 0x839C085
.string " $"
Str_839C08E:: @ 0x839C08E
.string "Confirmation$"
Str_839C09B:: @ 0x839C09B
.string "Max-1 set$"
Str_839C0A5:: @ 0x839C0A5
.string "Zero clear$"
Str_839C0B0:: @ 0x839C0B0
.string "$"
Str_839C0B5:: @ 0x839C0B5
.string " $"
Str_839C0BD:: @ 0x839C0BD
.string " $"
Str_839C0C8:: @ 0x839C0C8
.string " $"
Str_839C0D5:: @ 0x839C0D5
.string "$"
Str_839C0DF:: @ 0x839C0DF
.string "$"
Str_839C0E3:: @ 0x839C0E3
.string "$"
Str_839C0EA:: @ 0x839C0EA
.string "$"
Str_839C0EE:: @ 0x839C0EE
.string "$"
Str_839C0F5:: @ 0x839C0F5
.string "$"
Str_839C0FE:: @ 0x839C0FE
.string "$"
Str_839C105:: @ 0x839C105
.string "$"
Str_839C10D:: @ 0x839C10D
.string " $"
Str_839C116:: @ 0x839C116
.string "$"
Str_839C11E:: @ 0x839C11E
.string "$"
Str_839C124:: @ 0x839C124
.string " $"
Str_839C12E:: @ 0x839C12E
.string " $"
Str_839C137:: @ 0x839C137
.string " $"
Str_839C140:: @ 0x839C140
.string "ひでん:$"
Str_839C14A:: @ 0x839C14A
.string "ひでん:$"
Str_839C154:: @ 0x839C154
.string " $"
Str_839C15C:: @ 0x839C15C
.string "$"
Str_839C165:: @ 0x839C165
.string "$"
Str_839C16E:: @ 0x839C16E
.string " $"
Str_839C176:: @ 0x839C176
.string " $"
Str_839C17E:: @ 0x839C17E
.string " $"
Str_839C188:: @ 0x839C188
.string "わざ:$"
Str_839C18F:: @ 0x839C18F
.string "わざ:$"
Str_839C198:: @ 0x839C198
.string "$"
Str_839C1A6:: @ 0x839C1A6
.string " $"
Str_839C1B2:: @ 0x839C1B2
.string "$"
Str_839C1B9:: @ 0x839C1B9
.string "$"
Str_839C1C2:: @ 0x839C1C2
.string "$"
Str_839C1CE:: @ 0x839C1CE
.string "$"
Str_839C1D7:: @ 0x839C1D7
.string "$"
Str_839C1E5:: @ 0x839C1E5
.string "$"
Str_839C1F1:: @ 0x839C1F1
.string "CPU$"
Str_839C1FD:: @ 0x839C1FD
.string "CPU$"
Str_839C208:: @ 0x839C208
.string "$"
Str_839C20D:: @ 0x839C20D
.string "$"
Str_839C216:: @ 0x839C216
.string "$"
Str_839C21B:: @ 0x839C21B
.string "$"
Str_839C222:: @ 0x839C222
.string " $"
Str_839C22B:: @ 0x839C22B
.string " $"
Str_839C234:: @ 0x839C234
.string "TV $"
Str_839C23B:: @ 0x839C23B
.string " $"
Str_839C243:: @ 0x839C243
.string " $"
Str_839C24C:: @ 0x839C24C
.string "$"
Str_839C255:: @ 0x839C255
.string "$"
Str_839C25F:: @ 0x839C25F
.string " $"
.align 2
gUnknown_Debug_839C26C:: @ 0x839C26C
.4byte 0xFFFFFF, Str_839C0B0
.4byte 0x3E73B3B, Str_839C0B5
.4byte 0xFFFFFF, Str_839C0BD
.4byte 0xFFFFFF, Str_839C0C8
.4byte 0xFFFFFF, Str_839C0D5
.4byte 0xFFFFFF, Str_839C0DF
.4byte 0xFFFFFF, Str_839C0E3
.4byte 0xFFFFFF, Str_839C0EA
.4byte 0xFFFFFF, Str_839C0EE
.4byte 0xFFFFFF, Str_839C0F5
.4byte 0x3E7, Str_839C0FE
.4byte 0xFFFFFF, Str_839C105
.4byte 0xFFFFFF, Str_839C10D
.4byte 0xFFFFFF, Str_839C116
.4byte 0xFFFFFF, Str_839C11E
.4byte 0xFFFFFF, Str_839C124
.4byte 0xFFFFFF, Str_839C12E
.4byte 0xFFFFFF, Str_839C137
.4byte 0xFFFFFF, Str_839C140
.4byte 0xFFFFFF, Str_839C14A
.4byte 0xFFFFFF, Str_839C154
.4byte 0xFFFFFF, Str_839C15C
.4byte 0xFFFFFF, Str_839C165
.4byte 0x270F, Str_839C16E
.4byte 0x270F, Str_839C176
.4byte 0x270F, Str_839C17E
.4byte 0xFFFFFF, Str_839C188
.4byte 0xFFFFFF, Str_839C18F
.4byte 0xFFFFFF, Str_839C198
.4byte 0xFFFFFF, Str_839C1A6
.4byte 0xFFFFFF, Str_839C1B2
.4byte 0x0, Str_839C1B9
.4byte 0x0, Str_839C1C2
.4byte 0xFFFFFF, Str_839C1CE
.4byte 0xFFFFFF, Str_839C1D7
.4byte 0xFFFFFF, Str_839C1E5
.4byte 0xFFFFFF, Str_839C1F1
.4byte 0xFFFFFF, Str_839C1FD
.4byte 0xFFFFFF, Str_839C208
.4byte 0xFFFFFF, Str_839C20D
.4byte 0xFFFFFF, Str_839C216
.4byte 0xFFFFFF, Str_839C21B
.4byte 0xFFFFFF, Str_839C222
.4byte 0xFFFFFF, Str_839C22B
.4byte 0xFFFFFF, Str_839C234
.4byte 0xFFFFFF, Str_839C23B
.4byte 0xFFFFFF, Str_839C243
.4byte 0xFFFFFF, Str_839C24C
.4byte 0xFFFFFF, Str_839C255
.4byte 0xFFFFFF, Str_839C25F
gUnknown_Debug_839C3FC:: @ 0x839C3FC
.4byte Str_839C08E, DebugMenu_8078774+1
.4byte Str_839C09B, DebugMenu_8078788+1
.4byte Str_839C0A5, DebugMenu_807879C+1
Str_839C414:: @ 0x839C414
.string "ATTR:{STR_VAR_1} HEIGHT:{STR_VAR_3}\n"
.string "CODE:{STR_VAR_2}$"
Str_839C42E:: @ 0x839C42E
.string "  $"
Str_839C438:: @ 0x839C438
.string " {STR_VAR_1}$"
gUnknown_Debug_839C444::
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00
.byte 0x0c, 0x03, 0x03, 0x03, 0x03, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
Str_839C574:: @ 0x839C574
gDebug0x839C574::
.string "write to flash$"
Str_839C583:: @ 0x839C583
.string "read from flash$"
.align 2
gUnknown_Debug_839C594:: @ 0x839C594
.4byte gDebug0x839C574, DebugMenu_8078C80+1
.4byte Str_839C583, DebugMenu_8078D30+1
Str_839C5A4:: @ 0x839C5A4
.string "Press A, begin to write\n"
.string "Press B, cancel$"
Str_839C5CC:: @ 0x839C5CC
.string " $"
Str_839C5D6:: @ 0x839C5D6
.string "$"
Str_839C5DF:: @ 0x839C5DF
.string " $"
Str_839C5E9:: @ 0x839C5E9
.string " $"
.align 1
gUnknown_Debug_839C5F4::
.byte 0x00, 0x00, 0xe7, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x09, 0x03, 0x00, 0x00
Str_839C60C:: @ 0x839C60C
gDebug0x839C60C::
.string "Set FLASH ERR$"
Str_839C61A:: @ 0x839C61A
.string "abcde; abcde: ABCDE; ABCDE:\p"
.string "Tableaux des verbes du 2{SUPER_E} groupe.\p"
.string "La1{SUPER_RE} chose à apprendre cest de lire.\p"
.string "Tableaux des verbes du 1{SUPER_ER} groupe.\p"
.string "\n"
.string "<>\p"
.string ",$"
.endif

105
data/unk_debug_menu_3.s Normal file
View File

@ -0,0 +1,105 @@
.section .rodata
.align 2
Str_842E238:: @ 0x842E238
.string "$"
.if DEBUG
Str_842E23C:: @ 0x842E23C
.string "$"
Str_842E240:: @ 0x842E240
.string "ENGLISH$"
Str_842E248:: @ 0x842E248
.string "TOURNAMENT$"
Str_842E253:: @ 0x842E253
.string "   $"
Str_842E25E:: @ 0x842E25E
.string "$"
Str_842E264:: @ 0x842E264
.string "ticket$"
Str_842E26B:: @ 0x842E26B
.string "{PKMN}$"
Str_842E26E:: @ 0x842E26E
.string "wrong {PKMN}$"
Str_842E277:: @ 0x842E277
.string "ribbon$"
Str_842E27E:: @ 0x842E27E
.string "DEX$"
Str_842E282:: @ 0x842E282
.string "message$"
Str_842E28A:: @ 0x842E28A
.string "egg$"
Str_842E28E:: @ 0x842E28E
.string "RAM seed$"
Str_842E297:: @ 0x842E297
.string "trainer$"
Str_842E29F:: @ 0x842E29F
.string "clock$"
Str_842E2A5:: @ 0x842E2A5
.string "item$"
Str_842E2AA:: @ 0x842E2AA
.string "goods$"
Str_842E2B0:: @ 0x842E2B0
.string "potion$"
Str_842E2B7:: @ 0x842E2B7
.string "ball$"
Str_842E2BC:: @ 0x842E2BC
.string "cheri berry$"
Str_842E2C8:: @ 0x842E2C8
.string "TM01$"
.align 2
gUnknown_Debug_842E2D0::
.4byte Str_842E264, debug_sub_813C404+1
.4byte Str_842E26B, debug_sub_813C810+1
.4byte Str_842E26E, debug_sub_813C888+1
.4byte Str_842E277, debug_sub_813C430+1
.4byte Str_842E27E, debug_sub_813C488+1
.4byte Str_842E282, debug_sub_813C45C+1
.4byte Str_842E28A, debug_sub_813C740+1
.4byte Str_842E28E, debug_sub_813C5B4+1
.4byte Str_842E297, debug_sub_813C93C+1
.4byte Str_842E29F, debug_sub_813C4B4+1
.4byte Str_842E2A5, debug_sub_813C4D4+1
.4byte Str_842E2AA, debug_sub_813C500+1
.4byte Str_842E2B0, debug_sub_813C580+1
.4byte Str_842E2B7, debug_sub_813C58C+1
.4byte Str_842E2BC, debug_sub_813C598+1
.4byte Str_842E2C8, debug_sub_813C5A4+1
gUnknown_Debug_842E350::
.4byte 0x10
.4byte gUnknown_Debug_845DAE1
.4byte gUnknown_Debug_845DDB2
.4byte gUnknown_Debug_845E306
.4byte gUnknown_Debug_845E3E0
.4byte gUnknown_Debug_845E3E0
.4byte gUnknown_Debug_845E402
.4byte gUnknown_Debug_845E402
.4byte gUnknown_Debug_845E422
.4byte gUnknown_Debug_845E422
.4byte gUnknown_Debug_845E443
.endif

View File

@ -1 +1,2 @@
git checkout override.mk asm/ data/ graphics
git checkout override.mk data/ graphics
rm data/ingame_trades.inc

View File

@ -0,0 +1,51 @@
JASC-PAL
0100
48
115 139 65
255 0 0
255 123 0
255 255 0
123 255 0
0 255 0
0 255 131
0 255 255
0 123 255
0 0 255
123 0 255
255 0 255
255 0 123
0 0 0
123 123 123
255 255 255
115 139 65
255 0 0
255 123 0
255 255 0
123 255 0
0 255 0
0 255 131
0 255 255
0 123 255
0 0 255
123 0 255
255 0 255
255 0 123
0 0 0
123 123 123
255 255 255
115 139 65
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49
49 49 49

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

View File

@ -763,6 +763,8 @@ void sub_8012324(void);
void SwapTurnOrder(u8, u8);
u8 GetWhoStrikesFirst(u8, u8, u8);
void debug_sub_8010800(void);
// asm/battle_3.o
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check);
u8 UpdateTurnCounters(void);

View File

@ -20,5 +20,8 @@ void sub_8083B90(void);
void sub_8083BDC(void);
bool32 sub_8083BF4(u8 linkPlayerIndex);
void sub_8083C50(u8 taskId);
#if DEBUG
void debug_sub_808B838(u8);
#endif
#endif // GUARD_CABLE_CLUB_H

View File

@ -3,6 +3,7 @@
// TODO: time of day and seconds in a day defines
void InitTimeBasedEvents(void);
void DoTimeBasedEvents(void);
#endif

View File

@ -123,4 +123,6 @@
#define DECOR_REGICE_DOLL 119
#define DECOR_REGISTEEL_DOLL 120
#define DECOR_COUNT 121
#endif // GUARD_CONSTANTS_DECORATIONS_H

View File

@ -401,4 +401,6 @@
// Check if the item is one that can be used on a Pokemon.
#define IS_POKEMON_ITEM(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2)
#define IS_ITEM_MAIL(item) ((item) >= ITEM_ORANGE_MAIL && (item) <= ITEM_RETRO_MAIL)
#endif // GUARD_CONSTANTS_ITEMS_H

View File

@ -1,7 +1,17 @@
#ifndef GUARD_DEBUG_H
#define GUARD_DEBUG_H
// start_menu_debug
void DebugMenu_8077048(void);
// matsuda_debug_menu
void sub_80AAF30(void);
void Crash(const u8 *text);
// tomomichi_debug_menu
void debug_nullsub_66(void);
// sound_check_menu
void CB2_StartSoundCheckMenu(void);
#endif // GUARD_DEBUG_H

View File

@ -117,6 +117,7 @@ struct Shared1000
// const pointer to shared1000. easy_chat might be two separate files.
extern struct Shared1000 *const gEasyChatStruct;
void sub_80E60D8(void);
void sub_80E62A0(u8 arg0, u16 *arg1, void (*arg2)(void), u8 arg3);
u16 sub_80EB72C(u16 group);
void sub_80EB6FC(u16 *, u16);

View File

@ -36,5 +36,6 @@ bool8 sub_8068870(u16 a);
bool8 sub_8068894(void);
bool8 sub_8068A64(struct MapPosition *, u16);
u8 sub_8068F18(void);
bool8 dive_warp(struct MapPosition *position, u16 b);
#endif

View File

@ -27,5 +27,6 @@ void sub_8080F48(void);
void sub_8080F58(void);
void sub_8080F68(void);
void sub_8080F9C(void);
void debug_sub_80888D8(void);
#endif // GUARD_FIELD_FADETRANSITION_H

View File

@ -194,5 +194,9 @@ u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]);
void LinkVSync(void);
void Timer3Intr(void);
void SerialCB(void);
void LinkTestScreen(void);
void debug_sub_8008218(u16 *buffer, void *arg1, u16 (*arg2)[], u32 arg3);
void debug_sub_8008264(u32 value, int left, int top, int r3, int sp0);
u32 sub_8007E40(void);
#endif // GUARD_LINK_H

View File

@ -2,5 +2,6 @@
#define GUARD_MYSTERY_EVENT_MENU_H
void CB2_InitMysteryEventMenu(void);
void debug_sub_815D15C(void);
#endif // GUARD_MYSTERY_EVENT_MENU_H

View File

@ -235,4 +235,6 @@ void CreateLinkPlayerSprite(u8);
void SpriteCB_LinkPlayer(struct Sprite *);
void sub_805465C(void);
void CB2_InitTestMenu(void);
#endif // GUARD_ROM4_H

View File

@ -3,12 +3,20 @@
enum
{
PBLOCK_CLR_BLACK,
PBLOCK_CLR_RED,
PBLOCK_CLR_RED = 1,
PBLOCK_CLR_BLUE,
PBLOCK_CLR_PINK,
PBLOCK_CLR_GREEN,
PBLOCK_CLR_YELLOW
PBLOCK_CLR_YELLOW,
PBLOCK_CLR_PURPLE,
PBLOCK_CLR_INDIGO,
PBLOCK_CLR_BROWN,
PBLOCK_CLR_LITEBLUE,
PBLOCK_CLR_OLIVE,
PBLOCK_CLR_GRAY,
PBLOCK_CLR_BLACK,
PBLOCK_CLR_WHITE,
PBLOCK_CLR_GOLD,
};
enum

View File

@ -68,5 +68,6 @@ void CreateRegionMapPlayerIcon(u16, u16);
const u8 *GetMapSectionName(u8 *dest, u16 mapSectionId, u16 length);
const u8 *CopyMapName(u8 *dest, u16 b);
const u8 *CopyLocationName(u8 *dest, u16 b);
void CB2_InitFlyRegionMap(void);
#endif // GUARD_REGION_MAP_H

View File

@ -2,5 +2,6 @@
#define GUARD_RESET_RTC_SCREEN_H
void CB2_InitResetRtcScreen(void);
void debug_sub_806F8F8(void);
#endif // GUARD_RESET_RTC_SCREEN_H

View File

@ -106,5 +106,6 @@ void sub_8078BD4(struct Sprite *sprite);
void sub_807941C(struct Sprite *sprite);
void sub_80789D4(bool8 a1);
void sub_8079AB8(u8 sprite, u8 sprite2);
u8 sub_807A4A0(int bank, u8 sprite, int species);
#endif // GUARD_ROM_8077ABC_H

View File

@ -75,5 +75,6 @@ struct SlotMachineEwramStruct {
void PlaySlotMachine(u8 arg0, MainCallback cb);
void sub_8104DA4(void);
u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2);
void debug_sub_811609C(u8, void (*)(void));
#endif // GUARD_SLOT_MACHINE_H

View File

@ -164,7 +164,7 @@ extern const u8 gOtherText_None[];
extern const u8 gOtherText_ThreeQuestions2[];
extern const u8 gOtherText_FiveQuestionsAndSlash[];
extern const u8 gOtherText_FiveQuestions[];
extern const u8 gOtherText_OneDash[];
extern const u8 gOtherText_TwoDashes[];

View File

@ -51,6 +51,7 @@ extern const u32 gUnknown_0820CA98[];
extern const u16 gUnknown_0820F798[];
void sub_8047CD8(void);
void sub_804B790(void);
void sub_804E174(void);
extern const u8 gOtherText_MaleSymbol3[2];
extern const u8 gOtherText_FemaleSymbol3[2];

View File

@ -32,6 +32,8 @@ void TrainerCard_ShowPlayerCard(void (*)(void));
void TrainerCard_ShowLinkCard(u8, void (*)(void));
void TrainerCard_GenerateCardForPlayer(struct TrainerCard *);
u8 sub_80934C4(u8 id);
void debug_sub_80A0710(void (*)(void));
void debug_sub_80A073C(void (*)(void));
extern struct TrainerCard gTrainerCards[4];

View File

@ -100,6 +100,7 @@ SECTIONS {
src/engine/reset_rtc_screen.o(.text);
src/field/party_menu.o(.text);
src/field/start_menu.o(.text);
src/debug/start_menu_debug.o(.text);
src/engine/menu.o(.text);
src/engine/tileset_anim.o(.text);
src/engine/palette.o(.text);
@ -116,7 +117,13 @@ SECTIONS {
src/field/field_screen_effect.o(.text);
src/battle/battle_setup.o(.text);
src/engine/cable_club.o(.text);
src/debug/tomomichi_debug_menu.o(.text);
asm/tomomichi_debug_menu.o(.text);
src/debug/nohara_debug_menu.o(.text);
asm/nohara_debug_menu.o(.text);
src/debug/mori_debug_menu.o(.text);
asm/taya_debug_window.o(.text);
src/debug/taya_debug_window.o(.text);
src/field/trainer_see.o(.text);
src/field/wild_encounter.o(.text);
src/field/field_effect.o(.text);
@ -127,7 +134,7 @@ SECTIONS {
src/engine/trainer_card.o(.text);
src/engine/save_menu_util.o(.text);
src/battle/battle_party_menu.o(.text);
asm/unk_text_8095904.o(.text);
src/unk_text_8095904.o(.text);
src/pokemon/pokemon_storage_system.o(.text);
src/pokemon/pokemon_storage_system_2.o(.text);
src/pokemon/pokemon_storage_system_3.o(.text);
@ -138,6 +145,7 @@ SECTIONS {
src/pokemon/pokemon_summary_screen.o(.text);
src/field/script_movement.o(.text);
src/field/fldeff_cut.o(.text);
src/debug/kagaya_debug_menu.o(.text);
src/pokemon/mail_data.o(.text);
src/field/map_name_popup.o(.text);
src/field/item_menu.o(.text);
@ -149,6 +157,8 @@ SECTIONS {
src/field/shop.o(.text);
src/field/fldeff_escalator.o(.text);
src/field/berry.o(.text);
src/debug/watanabe_debug_menu.o(.text);
asm/watanabe_debug_menu.o(.text);
src/field/script_menu.o(.text);
src/engine/naming_screen.o(.text);
src/field/money.o(.text);
@ -293,7 +303,7 @@ SECTIONS {
src/battle/anim/shock.o(.text);
asm/current.o(.text);
asm/ice.o(.text);
asm/fight.o(.text);
src/battle/anim/fight.o(.text);
src/battle/anim/poison.o(.text);
asm/flying.o(.text);
src/battle/anim/psychic.o(.text);
@ -302,7 +312,6 @@ SECTIONS {
asm/ghost.o(.text);
src/battle/anim/dragon.o(.text);
src/battle/anim/dark.o(.text);
asm/dark.o(.text);
asm/ground.o(.text);
asm/normal.o(.text);
src/battle/anim/battle_intro.o(.text);
@ -358,6 +367,7 @@ SECTIONS {
src/unused_8124F94.o(.text);
src/engine/save.o(.text);
src/engine/mystery_event_script.o(.text);
asm/unk_debug_menu_3.o(.text);
src/field/field_effect_helpers.o(.text);
src/contest_ai.o(.text);
src/unused_81258BC.o(.text);
@ -386,6 +396,8 @@ SECTIONS {
src/field/braille_puzzles.o(.text);
src/pokemon/pokeblock_feed.o(.text);
src/engine/clear_save_data_menu.o(.text);
src/debug/nakamura_debug_menu.o(.text);
asm/nakamura_debug_menu.o(.text);
src/scene/intro_credits_graphics.o(.text);
src/scene/evolution_graphics.o(.text);
src/field/bard_music.o(.text);
@ -528,6 +540,9 @@ SECTIONS {
src/engine/reset_rtc_screen.o(.rodata);
src/field/party_menu.o(.rodata);
src/field/start_menu.o(.rodata);
src/debug/start_menu_debug.o(.data);
src/debug/start_menu_debug.o(.rodata);
data/start_menu_debug.o(.rodata);
src/engine/menu.o(.rodata);
src/engine/tileset_anim.o(.rodata);
src/engine/palette.o(.rodata);
@ -549,7 +564,10 @@ SECTIONS {
src/field/field_screen_effect.o(.rodata);
src/battle/battle_setup.o(.rodata);
src/engine/cable_club.o(.rodata);
data/debug_menu_tomomichi.o(.rodata);
data/debug_menu_nohara.o(.rodata);
src/debug/mori_debug_menu.o(.rodata);
data/debug_menu_taya.o(.rodata);
src/field/trainer_see.o(.rodata);
src/field/wild_encounter.o(.rodata);
src/field/field_effect.o(.rodata);
@ -567,6 +585,7 @@ SECTIONS {
src/pokemon/pokemon_icon.o(.rodata);
src/pokemon/pokemon_summary_screen.o(.rodata);
src/field/fldeff_cut.o(.rodata);
src/debug/kagaya_debug_menu.o(.rodata);
src/field/item_menu.o(.rodata);
src/battle/battle_anim_80A7E7C.o(.rodata);
src/field/item.o(.rodata);
@ -575,6 +594,7 @@ SECTIONS {
src/field/shop.o(.rodata);
src/field/fldeff_escalator.o(.rodata);
src/field/berry.o(.rodata);
data/debug_menu_watanabe.o(.rodata);
src/field/script_menu.o(.rodata);
src/engine/naming_screen.o(.rodata);
src/field/money.o(.rodata);
@ -619,6 +639,7 @@ SECTIONS {
src/field/fldeff_flash.o(.rodata);
src/engine/time_events.o(.rodata);
src/field/field_specials.o(.rodata);
src/battle/battle_records.o(.rodata);
data/pokedex_area_screen.o(.rodata);
src/scene/evolution_scene.o(.rodata);
data/roulette.o(.rodata);
@ -630,6 +651,7 @@ SECTIONS {
src/field/choose_party.o(.rodata);
src/scene/cable_car.o(.rodata);
src/engine/save.o(.rodata);
data/unk_debug_menu_3.o(.rodata);
src/field/field_effect_helpers.o(.rodata);
src/contest_ai.o(.rodata);
src/battle/battle_controller_safari.o(.rodata);
@ -649,8 +671,10 @@ SECTIONS {
src/field/diploma.o(.rodata);
src/strings.o(.rodata);
src/field/berry_tag_screen.o(.rodata);
data/debug_mystery_event_menu.o(.rodata);
src/engine/save_failed_screen.o(.rodata);
src/pokemon/pokeblock_feed.o(.rodata);
src/debug/nakamura_debug_menu.o(.rodata);
src/scene/intro_credits_graphics.o(.rodata);
src/scene/evolution_graphics.o(.rodata);
src/field/bard_music.o(.rodata);
@ -658,6 +682,7 @@ SECTIONS {
data/strings2.o(.rodata);
src/engine/menu_cursor.o(.rodata);
src/engine/mystery_event_msg.o(.rodata);
data/debug_menu_3.o(.rodata);
src/libs/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);
} =0

1
ruby_de_debug.sha1 Normal file
View File

@ -0,0 +1 @@
ca5e3d415c4b47353a73a616878ba833f3648b7a pokeruby_de_debug.gba

View File

@ -1,4 +1,3 @@
.align 2
gMPlayTable:: @ 845545C
music_player gMPlay_BGM, gUnknown_030007B8 + 0x40, 10, 0

View File

@ -1,22 +1,47 @@
#include "global.h"
#include "rom_8077ABC.h"
#include "trig.h"
#include "battle_anim.h"
#include "sound.h"
#include "blend_palette.h"
#include "decompress.h"
#include "ewram.h"
#include "palette.h"
#include "rom_8077ABC.h"
#include "scanline_effect.h"
void sub_80DFE90(struct Sprite *sprite);
void sub_80DFC9C(u8 taskId);
void sub_80DFD58(u8 taskId);
#include "sound.h"
#include "sprite.h"
#include "trig.h"
#include "constants/battle_constants.h"
extern s16 gBattleAnimArgs[];
extern u8 gAnimBankAttacker;
extern u8 gAnimBankTarget;
extern u8 gObjectBankIDs[];
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattlePartyID[];
extern u8 gAnimMoveTurn;
extern const u8 gUnknown_08D1D574[];
extern const u8 gUnknown_08D1D410[];
extern const u16 gUnknown_08D1D54C[];
static void sub_80DFE90(struct Sprite *sprite);
static void sub_80DFC9C(u8 taskId);
static void sub_80DFD58(u8 taskId);
static void sub_80DFF58(struct Sprite *sprite);
static void sub_80DFF98(struct Sprite *sprite);
static void sub_80E00D0(struct Sprite *sprite);
static void sub_80E02A4(u8 taskId);
static void sub_80E0620(u8 taskId);
static void sub_80E08CC(u8 priority);
static void sub_80E079C(struct Task *task);
static void sub_80E0CD0(u8 taskId);
// used in Smoke Ball escape, Sky Attack, Feint Attack and Camouflage
void sub_80DFC24(u8 taskId)
{
int bank;
@ -31,7 +56,7 @@ void sub_80DFC24(u8 taskId)
gTasks[taskId].func = sub_80DFC9C;
}
void sub_80DFC9C(u8 taskId)
static void sub_80DFC9C(u8 taskId)
{
u8 r2 = gTasks[taskId].data[1] >> 8;
u8 r1 = gTasks[taskId].data[1];
@ -111,7 +136,7 @@ void sub_80DFE14(struct Sprite *sprite)
sub_80DFE90(sprite);
}
void sub_80DFE90(struct Sprite *sprite)
static void sub_80DFE90(struct Sprite *sprite)
{
sprite->data[3] += sprite->data[1];
sprite->data[4] += sprite->data[2];
@ -136,3 +161,848 @@ void sub_80DFE90(struct Sprite *sprite)
if (--sprite->data[0] == 0)
DestroyAnimSprite(sprite);
}
void sub_80DFF1C(struct Sprite *sprite)
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
StartSpriteAffineAnim(sprite, gBattleAnimArgs[2]);
sprite->data[0] = gBattleAnimArgs[3];
sprite->data[1] = gBattleAnimArgs[4];
sprite->data[2] = gBattleAnimArgs[5];
sprite->callback = sub_80DFF58;
}
static void sub_80DFF58(struct Sprite *sprite)
{
sprite->data[4] += sprite->data[0];
sprite->data[5] += sprite->data[1];
sprite->pos2.x = sprite->data[4] >> 8;
sprite->pos2.y = sprite->data[5] >> 8;
if (++sprite->data[3] == sprite->data[2])
sprite->callback = sub_80DFF98;
}
static void sub_80DFF98(struct Sprite *sprite)
{
sprite->data[4] -= sprite->data[0];
sprite->data[5] -= sprite->data[1];
sprite->pos2.x = sprite->data[4] >> 8;
sprite->pos2.y = sprite->data[5] >> 8;
if (--sprite->data[3] == 0)
move_anim_8074EE0(sprite);
}
void sub_80DFFD0(struct Sprite *sprite)
{
u8 bank;
s8 xOffset;
if (gBattleAnimArgs[0] == 0)
bank = gAnimBankAttacker;
else
bank = gAnimBankTarget;
xOffset = 20;
sprite->oam.tileNum += 4;
switch (gBattleAnimArgs[1])
{
case 0:
sprite->pos1.x = sub_807A100(bank, 5) - 8;
sprite->pos1.y = sub_807A100(bank, 2) + 8;
break;
case 1:
sprite->pos1.x = sub_807A100(bank, 5) - 14;
sprite->pos1.y = sub_807A100(bank, 2) + 16;
break;
case 2:
sprite->pos1.x = sub_807A100(bank, 4) + 8;
sprite->pos1.y = sub_807A100(bank, 2) + 8;
StartSpriteAffineAnim(sprite, 1);
xOffset = -20;
break;
case 3:
sprite->pos1.x = sub_807A100(bank, 4) + 14;
sprite->pos1.y = sub_807A100(bank, 2) + 16;
StartSpriteAffineAnim(sprite, 1);
xOffset = -20;
break;
}
sprite->data[0] = 32;
sprite->data[2] = sprite->pos1.x + xOffset;
sprite->data[4] = sprite->pos1.y + 12;
sprite->data[5] = -12;
sub_80786EC(sprite);
sprite->callback = sub_80E00D0;
}
static void sub_80E00D0(struct Sprite *sprite)
{
if (sub_8078718(sprite))
move_anim_8074EE0(sprite);
}
void sub_80E00EC(u8 taskId)
{
struct ScanlineEffectParams scanlineParams;
struct Struct_sub_8078914 subStruct;
u16 i;
u8 pos;
int var0;
struct Task *task = &gTasks[taskId];
task->data[7] = GetBankPosition(gAnimBankAttacker, 1) + 31;
task->data[6] = sub_807A100(gAnimBankAttacker, 2) - 7;
task->data[5] = task->data[7];
task->data[4] = task->data[6];
task->data[13] = (task->data[7] - task->data[6]) << 8;
pos = GetBankPosition(gAnimBankAttacker, 0);
task->data[14] = pos - 32;
task->data[15] = pos + 32;
if (GetBankSide(gAnimBankAttacker) == SIDE_PLAYER)
task->data[8] = -12;
else
task->data[8] = -64;
task->data[3] = GetBankIdentity_permutated(gAnimBankAttacker);
if (task->data[3] == 1)
{
sub_8078914(&subStruct);
task->data[10] = gBattle_BG1_Y;
REG_BLDCNT = 0x3F42;
FillPalette(0, subStruct.field_8 << 4, 32);
scanlineParams.dmaDest = &REG_BG1VOFS;
var0 = 2;
if (!IsContest())
gBattle_BG2_X += 240;
}
else
{
task->data[10] = gBattle_BG2_Y;
REG_BLDCNT = 0x3F44;
FillPalette(0, 144, 32);
scanlineParams.dmaDest = &REG_BG2VOFS;
var0 = 4;
if (!IsContest())
gBattle_BG1_X += 240;
}
scanlineParams.dmaControl = 0xA2600001;
scanlineParams.initState = 1;
scanlineParams.unused9 = 0;
task->data[11] = 0;
task->data[12] = 16;
task->data[0] = 0;
task->data[1] = 0;
task->data[2] = 0;
sub_80E08CC(3);
for (i = 0; i < 112; i++)
{
gScanlineEffectRegBuffers[0][i] = task->data[10];
gScanlineEffectRegBuffers[1][i] = task->data[10];
}
ScanlineEffect_SetParams(scanlineParams);
REG_WINOUT = 0x3F00 | (var0 ^ 0x3F);
REG_WININ = 0x3F3F;
gBattle_WIN0H = (task->data[14] << 8) | task->data[15];
gBattle_WIN0V = 160;
task->func = sub_80E02A4;
}
static void sub_80E02A4(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
if (++task->data[1] > 1)
{
task->data[1] = 0;
if (++task->data[2] & 1)
{
if (task->data[11] != 12)
task->data[11]++;
}
else
{
if (task->data[12] != 8)
task->data[12]--;
}
REG_BLDALPHA = (task->data[12] << 8) | task->data[11];
if (task->data[11] == 12 && task->data[12] == 8)
task->data[0]++;
}
break;
case 1:
task->data[4] -= 8;
sub_80E079C(task);
if (task->data[4] < task->data[8])
task->data[0]++;
break;
case 2:
task->data[4] -= 8;
sub_80E079C(task);
task->data[14] += 4;
task->data[15] -= 4;
if (task->data[14] >= task->data[15])
task->data[14] = task->data[15];
gBattle_WIN0H = (task->data[14] << 8) | task->data[15];
if (task->data[14] == task->data[15])
task->data[0]++;
break;
case 3:
gScanlineEffect.state = 3;
task->data[0]++;
break;
case 4:
DestroyAnimVisualTask(taskId);
break;
}
}
void sub_80E03BC(u8 taskId)
{
struct Struct_sub_8078914 subStruct;
struct ScanlineEffectParams scanlineParams;
u8 pos;
u16 i;
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
if (IsContest() == TRUE)
{
gBattle_WIN0H = 0;
gBattle_WIN0V = 0;
REG_WININ = 0x3F3F;
REG_WINOUT = 0x3F3F;
DestroyAnimVisualTask(taskId);
}
else
{
task->data[3] = GetBankIdentity_permutated(gAnimBankTarget);
if (task->data[3] == 1)
{
REG_BLDCNT = 0x3F42;
gBattle_BG2_X += 240;
}
else
{
REG_BLDCNT = 0x3F44;
gBattle_BG1_X += 240;
}
task->data[0]++;
}
break;
case 1:
if (task->data[3] == 1)
{
sub_8078914(&subStruct);
task->data[10] = gBattle_BG1_Y;
FillPalette(0, subStruct.field_8 << 4, 32);
}
else
{
task->data[10] = gBattle_BG2_Y;
FillPalette(0, 144, 32);
}
sub_80E08CC(3);
task->data[0]++;
break;
case 2:
task->data[7] = GetBankPosition(gAnimBankTarget, 1) + 31;
task->data[6] = sub_807A100(gAnimBankTarget, 2) - 7;
task->data[13] = (task->data[7] - task->data[6]) << 8;
pos = GetBankPosition(gAnimBankTarget, 0);
task->data[14] = pos - 4;
task->data[15] = pos + 4;
if (GetBankSide(gAnimBankTarget) == SIDE_PLAYER)
task->data[8] = -12;
else
task->data[8] = -64;
task->data[4] = task->data[8];
task->data[5] = task->data[8];
task->data[11] = 12;
task->data[12] = 8;
task->data[0]++;
break;
case 3:
if (task->data[3] == 1)
scanlineParams.dmaDest = &REG_BG1VOFS;
else
scanlineParams.dmaDest = &REG_BG2VOFS;
for (i = 0; i < 112; i++)
{
gScanlineEffectRegBuffers[0][i] = task->data[10] + (159 - i);
gScanlineEffectRegBuffers[1][i] = task->data[10] + (159 - i);
}
scanlineParams.dmaControl = 0xA2600001;
scanlineParams.initState = 1;
scanlineParams.unused9 = 0;
ScanlineEffect_SetParams(scanlineParams);
task->data[0]++;
break;
case 4:
if (task->data[3] == 1)
REG_WINOUT = 0x3F3D;
else
REG_WINOUT = 0x3F3B;
REG_WININ = 0x3F3F;
gBattle_WIN0H = (task->data[14] << 8) | task->data[15];
gBattle_WIN0V = 160;
task->data[0] = 0;
task->data[1] = 0;
task->data[2] = 0;
REG_BLDALPHA = 0x80C;
task->func = sub_80E0620;
break;
}
}
static void sub_80E0620(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
task->data[5] += 8;
if (task->data[5] >= task->data[7])
task->data[5] = task->data[7];
sub_80E079C(task);
if (task->data[5] == task->data[7])
task->data[0]++;
break;
case 1:
if (task->data[15] - task->data[14] < 64)
{
task->data[14] -= 4;
task->data[15] += 4;
}
else
{
task->data[1] = 1;
}
gBattle_WIN0H = (task->data[14] << 8) | task->data[15];
task->data[4] += 8;
if (task->data[4] >= task->data[6])
task->data[4] = task->data[6];
sub_80E079C(task);
if (task->data[4] == task->data[6] && task->data[1] != 0)
{
task->data[1] = 0;
task->data[0]++;
}
break;
case 2:
if (++task->data[1] > 1)
{
task->data[1] = 0;
if ((++task->data[2] & 1) != 0)
{
if (task->data[11] != 0)
task->data[11]--;
}
else
{
if (task->data[12] < 16)
task->data[12]++;
}
REG_BLDALPHA = (task->data[12] << 8) | task->data[11];
if (task->data[11] == 0 && task->data[12] == 16)
task->data[0]++;
}
break;
case 3:
gScanlineEffect.state = 3;
task->data[0]++;
break;
case 4:
gBattle_WIN0H = 0;
gBattle_WIN0V = 0;
REG_WININ = 0x3F3F;
REG_WINOUT = 0x3F3F;
DestroyAnimVisualTask(taskId);
break;
}
}
// static void sub_80E079C(struct Task *task)
// {
// int var0, var1;
// s16 var2;
// s16 i, j;
// var2 = task->data[5] - task->data[4];
// if (var2 != 0)
// {
// var0 = task->data[13] / var2;
// var1 = task->data[6];
// for (i = 0; i < task->data[4]; i++)
// {
// gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[10] - (i - 159);
// }
// for (i = task->data[4]; i <= task->data[5]; i++)
// {
// if (i >= 0)
// {
// gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = (var1 - i) + task->data[10];
// }
// var1 += var0;
// }
// for (j = i; j < task->data[7]; j++)
// {
// if (j >= 0)
// {
// gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][j] = (task->data[10] + 159) - j;
// }
// }
// }
// else
// {
// for (i = 0; i < 112; i++)
// {
// gScanlineEffectRegBuffers[0][i] = task->data[10] + 159 - i;
// gScanlineEffectRegBuffers[1][i] = task->data[10] + 159 - i;
// }
// }
// }
__attribute__((naked))
static void sub_80E079C(struct Task *task)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r8\n\
push {r7}\n\
adds r6, r0, 0\n\
ldrh r0, [r6, 0x12]\n\
ldrh r4, [r6, 0x10]\n\
subs r0, r4\n\
lsls r0, 16\n\
asrs r1, r0, 16\n\
cmp r1, 0\n\
beq _080E0890\n\
movs r2, 0x22\n\
ldrsh r0, [r6, r2]\n\
bl __divsi3\n\
mov r8, r0\n\
movs r3, 0x14\n\
ldrsh r0, [r6, r3]\n\
lsls r5, r0, 8\n\
lsls r0, r4, 16\n\
movs r4, 0\n\
cmp r0, 0\n\
ble _080E07FC\n\
ldr r0, _080E0888 @ =gScanlineEffectRegBuffers\n\
mov r12, r0\n\
ldr r7, _080E088C @ =gScanlineEffect\n\
_080E07D0:\n\
lsls r2, r4, 16\n\
asrs r2, 16\n\
lsls r3, r2, 1\n\
ldrb r1, [r7, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r3, r0\n\
add r3, r12\n\
adds r1, r2, 0\n\
subs r1, 0x9F\n\
ldrh r0, [r6, 0x1C]\n\
subs r0, r1\n\
strh r0, [r3]\n\
adds r2, 0x1\n\
lsls r2, 16\n\
lsrs r4, r2, 16\n\
asrs r2, 16\n\
movs r1, 0x10\n\
ldrsh r0, [r6, r1]\n\
cmp r2, r0\n\
blt _080E07D0\n\
_080E07FC:\n\
ldrh r4, [r6, 0x10]\n\
lsls r3, r4, 16\n\
asrs r1, r3, 16\n\
movs r2, 0x12\n\
ldrsh r0, [r6, r2]\n\
cmp r1, r0\n\
bgt _080E0846\n\
ldr r0, _080E0888 @ =gScanlineEffectRegBuffers\n\
mov r12, r0\n\
ldr r7, _080E088C @ =gScanlineEffect\n\
_080E0810:\n\
asrs r4, r3, 16\n\
cmp r4, 0\n\
blt _080E0832\n\
asrs r1, r5, 8\n\
subs r1, r4\n\
lsls r3, r4, 1\n\
ldrb r2, [r7, 0x14]\n\
lsls r0, r2, 4\n\
subs r0, r2\n\
lsls r0, 7\n\
adds r3, r0\n\
add r3, r12\n\
lsls r1, 16\n\
asrs r1, 16\n\
ldrh r2, [r6, 0x1C]\n\
adds r1, r2\n\
strh r1, [r3]\n\
_080E0832:\n\
add r5, r8\n\
adds r0, r4, 0x1\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
lsls r3, r4, 16\n\
asrs r1, r3, 16\n\
movs r2, 0x12\n\
ldrsh r0, [r6, r2]\n\
cmp r1, r0\n\
ble _080E0810\n\
_080E0846:\n\
movs r3, 0x1C\n\
ldrsh r0, [r6, r3]\n\
adds r0, 0x9F\n\
lsls r2, r4, 16\n\
asrs r1, r2, 16\n\
subs r5, r0, r1\n\
movs r3, 0x16\n\
ldrsh r0, [r6, r3]\n\
cmp r1, r0\n\
bge _080E08BE\n\
ldr r7, _080E0888 @ =gScanlineEffectRegBuffers\n\
ldr r4, _080E088C @ =gScanlineEffect\n\
_080E085E:\n\
asrs r3, r2, 16\n\
cmp r3, 0\n\
blt _080E0876\n\
lsls r2, r3, 1\n\
ldrb r1, [r4, 0x14]\n\
lsls r0, r1, 4\n\
subs r0, r1\n\
lsls r0, 7\n\
adds r2, r0\n\
adds r2, r7\n\
strh r5, [r2]\n\
subs r5, 0x1\n\
_080E0876:\n\
adds r0, r3, 0x1\n\
lsls r2, r0, 16\n\
asrs r1, r2, 16\n\
movs r3, 0x16\n\
ldrsh r0, [r6, r3]\n\
cmp r1, r0\n\
blt _080E085E\n\
b _080E08BE\n\
.align 2, 0\n\
_080E0888: .4byte gScanlineEffectRegBuffers\n\
_080E088C: .4byte gScanlineEffect\n\
_080E0890:\n\
movs r1, 0x1C\n\
ldrsh r0, [r6, r1]\n\
adds r5, r0, 0\n\
adds r5, 0x9F\n\
movs r4, 0\n\
ldr r3, _080E08C8 @ =gScanlineEffectRegBuffers\n\
movs r2, 0xF0\n\
lsls r2, 3\n\
adds r6, r3, r2\n\
_080E08A2:\n\
lsls r0, r4, 16\n\
asrs r0, 16\n\
lsls r2, r0, 1\n\
adds r1, r2, r3\n\
strh r5, [r1]\n\
adds r2, r6\n\
strh r5, [r2]\n\
subs r5, 0x1\n\
adds r0, 0x1\n\
lsls r0, 16\n\
lsrs r4, r0, 16\n\
asrs r0, 16\n\
cmp r0, 0x6F\n\
ble _080E08A2\n\
_080E08BE:\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.align 2, 0\n\
_080E08C8: .4byte gScanlineEffectRegBuffers\n\
.syntax divided\n");
}
static void sub_80E08CC(u8 priority)
{
u16 i;
for (i = 0; i < 4; i++)
{
u8 spriteId = GetAnimBankSpriteId(i);
if (spriteId != 0xFF)
gSprites[spriteId].oam.priority = priority;
}
}
void sub_80E0918(u8 taskId)
{
u8 toBG2 = GetBankIdentity_permutated(gAnimBankAttacker) ^ 1 ? 1 : 0;
sub_8076034(gAnimBankAttacker, toBG2);
gSprites[gObjectBankIDs[gAnimBankAttacker]].invisible = 0;
if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2))
{
sub_8076034(gAnimBankAttacker ^ 2, toBG2 ^ 1);
gSprites[gObjectBankIDs[gAnimBankAttacker ^ 2]].invisible = 0;
}
DestroyAnimVisualTask(taskId);
}
void sub_80E09C4(u8 taskId)
{
u8 toBG2 = GetBankIdentity_permutated(gAnimBankAttacker) ^ 1 ? 1 : 0;
sub_8076464(toBG2);
if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2))
sub_8076464(toBG2 ^ 1);
DestroyAnimVisualTask(taskId);
}
void sub_80E0A10(struct Sprite *sprite)
{
sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1];
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
sprite->callback = sub_8078600;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80E0A4C(u8 taskId)
{
u16 species;
u8 spriteId;
u8 newSpriteId;
u16 paletteNum;
struct Struct_sub_8078914 subStruct;
int var0 = 0;
gBattle_WIN0H = var0;
gBattle_WIN0V = var0;
REG_WININ = 0x3F3F;
REG_WINOUT = 0x3F3D;
REG_DISPCNT |= DISPCNT_OBJWIN_ON;
REG_BLDCNT = 0x3F42;
REG_BLDALPHA = 0xC08;
REG_BG1CNT_BITFIELD.priority = 0;
REG_BG1CNT_BITFIELD.screenSize = 0;
if (!IsContest())
REG_BG1CNT_BITFIELD.charBaseBlock = 1;
if (IsDoubleBattle() && !IsContest())
{
if (GetBankIdentity(gAnimBankAttacker) == 3 || GetBankIdentity(gAnimBankAttacker) == 0)
{
if (IsAnimBankSpriteVisible(gAnimBankAttacker ^ 2) == TRUE)
{
gSprites[gObjectBankIDs[gAnimBankAttacker ^ 2]].oam.priority--;
REG_BG1CNT_BITFIELD.priority = 1;
var0 = 1;
}
}
}
if (IsContest())
{
species = EWRAM_19348;
}
else
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
species = GetMonData(&gEnemyParty[gBattlePartyID[gAnimBankAttacker]], MON_DATA_SPECIES);
else
species = GetMonData(&gPlayerParty[gBattlePartyID[gAnimBankAttacker]], MON_DATA_SPECIES);
}
spriteId = GetAnimBankSpriteId(0);
newSpriteId = sub_807A4A0(gAnimBankAttacker, spriteId, species);
sub_8078914(&subStruct);
DmaClear32(3, subStruct.field_4, 0x1000);
LZDecompressVram(&gUnknown_08D1D574, subStruct.field_4);
LZDecompressVram(&gUnknown_08D1D410, subStruct.field_0);
LoadCompressedPalette(&gUnknown_08D1D54C, subStruct.field_8 << 4, 32);
gBattle_BG1_X = -gSprites[spriteId].pos1.x + 96;
gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32;
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
if (gBattleAnimArgs[1] == 0)
sub_8079108(paletteNum, FALSE);
else
BlendPalette(paletteNum * 16, 16, 11, gBattleAnimArgs[2]);
gTasks[taskId].data[0] = newSpriteId;
gTasks[taskId].data[1] = gBattleAnimArgs[0];
gTasks[taskId].data[2] = gBattleAnimArgs[1];
gTasks[taskId].data[3] = gBattleAnimArgs[2];
gTasks[taskId].data[6] = var0;
gTasks[taskId].func = sub_80E0CD0;
}
static void sub_80E0CD0(u8 taskId)
{
struct Struct_sub_8078914 subStruct;
u16 paletteNum;
u8 spriteId;
u8 taskIdCopy = taskId;
gTasks[taskIdCopy].data[10] += 4;
gBattle_BG1_X -= 4;
if (gTasks[taskIdCopy].data[10] == 128)
{
gTasks[taskIdCopy].data[10] = 0;
gBattle_BG1_X += 128;
if (++gTasks[taskIdCopy].data[11] == 2)
{
sub_8076464(0);
gBattle_WIN0H = 0;
gBattle_WIN0V = 0;
REG_WININ = 0x3F3F;
REG_WINOUT = 0x3F3F;
if (!IsContest())
REG_BG1CNT_BITFIELD.charBaseBlock = 0;
REG_DISPCNT ^= DISPCNT_OBJWIN_ON;
REG_BLDCNT = 0;
REG_BLDALPHA = 0;
spriteId = GetAnimBankSpriteId(0);
paletteNum = 16 + gSprites[spriteId].oam.paletteNum;
if (gTasks[taskIdCopy].data[1] == 0)
sub_8079108(paletteNum, 1);
DestroySprite(&gSprites[gTasks[taskIdCopy].data[0]]);
sub_8078914(&subStruct);
DmaClear32(3, subStruct.field_4, 0x800);
if (gTasks[taskIdCopy].data[6] == 1)
{
gSprites[gObjectBankIDs[gAnimBankAttacker ^ 2]].oam.priority++;
}
DestroyAnimVisualTask(taskIdCopy);
}
}
}
void sub_80E0E24(u8 taskId)
{
u8 spriteId;
u8 bank;
bool8 calcSpriteId = FALSE;
u8 identity = 0;
switch (gBattleAnimArgs[0])
{
case 0:
case 1:
case 2:
case 3:
spriteId = GetAnimBankSpriteId(gBattleAnimArgs[0]);
break;
case 4:
identity = IDENTITY_PLAYER_MON1;
calcSpriteId = TRUE;
break;
case 5:
identity = IDENTITY_PLAYER_MON2;
calcSpriteId = TRUE;
break;
case 6:
identity = IDENTITY_OPPONENT_MON1;
calcSpriteId = TRUE;
break;
case 7:
identity = IDENTITY_OPPONENT_MON2;
calcSpriteId = TRUE;
break;
default:
spriteId = 0xFF;
break;
}
if (calcSpriteId)
{
bank = GetBankByIdentity(identity);
if (IsAnimBankSpriteVisible(bank))
spriteId = gObjectBankIDs[bank];
else
spriteId = 0xFF;
}
if (spriteId != 0xFF)
sub_8079108(gSprites[spriteId].oam.paletteNum + 16, gBattleAnimArgs[1]);
DestroyAnimVisualTask(taskId);
}
void sub_80E0EE8(u8 taskId)
{
if (gAnimMoveTurn < 2)
gBattleAnimArgs[7] = 0;
if (gAnimMoveTurn == 2)
gBattleAnimArgs[7] = 1;
DestroyAnimVisualTask(taskId);
}

647
src/battle/anim/fight.c Normal file
View File

@ -0,0 +1,647 @@
#include "global.h"
#include "battle_anim.h"
#include "random.h"
#include "rom_8077ABC.h"
#include "sprite.h"
#include "task.h"
#include "trig.h"
#include "constants/battle_constants.h"
extern s16 gBattleAnimArgs[];
extern u8 gBankAttacker;
extern u8 gAnimBankAttacker;
extern u8 gAnimBankTarget;
extern u8 gObjectBankIDs[];
extern u8 gBanksBySide[];
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattlePartyID[];
extern u8 gAnimMoveTurn;
extern struct SpriteTemplate gBattleAnimSpriteTemplate_83DB4A8;
static void sub_80D927C(struct Sprite *sprite);
static void sub_80D9328(struct Sprite *sprite);
static void sub_80D9404(struct Sprite *sprite);
static void sub_80D9474(struct Sprite *sprite);
static void sub_80D94CC(struct Sprite *sprite);
static void sub_80D9524(struct Sprite *sprite);
static void sub_80D9640(struct Sprite *sprite);
static void sub_80D97A0(struct Sprite *sprite);
static void sub_80D986C(struct Sprite *sprite);
static void sub_80D9934(struct Sprite *sprite);
static void sub_80D99F4(struct Sprite *sprite);
void sub_080B08A0(struct Sprite *sprite)
{
sub_807867C(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1];
sprite->data[0] = 15;
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80D902C(struct Sprite *sprite)
{
if (gBattleAnimArgs[7] == 1 && GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
{
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
}
StartSpriteAnim(sprite, gBattleAnimArgs[6]);
gBattleAnimArgs[6] = 0;
sub_8079534(sprite);
}
void sub_80D9078(struct Sprite *sprite)
{
if (IsContest())
{
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
}
sub_80D902C(sprite);
}
void sub_80D90A4(struct Sprite *sprite)
{
StartSpriteAnim(sprite, gBattleAnimArgs[4]);
if (gBattleAnimArgs[3] == 0)
sub_80787B0(sprite, 1);
else
sub_8078764(sprite, 1);
sprite->data[0] = gBattleAnimArgs[2];
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80D90F4(struct Sprite *sprite)
{
u8 bank;
s16 xMod, yMod;
s16 x, y;
if (gBattleAnimArgs[0] == 0)
bank = gAnimBankAttacker;
else
bank = gAnimBankTarget;
if (gBattleAnimArgs[2] < 0)
gBattleAnimArgs[2] = Random() % 5;
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
sprite->pos1.x = GetBankPosition(bank, 2);
sprite->pos1.y = GetBankPosition(bank, 3);
xMod = sub_807A100(bank, 1) / 2;
yMod = sub_807A100(bank, 0) / 4;
x = Random() % xMod;
y = Random() % yMod;
if (Random() & 1)
x *= -1;
if (Random() & 1)
y *= -1;
if ((gBanksBySide[bank] & 1) == 0)
y += 0xFFF0;
sprite->pos1.x += x;
sprite->pos1.y += y;
sprite->data[0] = gBattleAnimArgs[1];
sprite->data[7] = CreateSprite(&gBattleAnimSpriteTemplate_83DB4A8, sprite->pos1.x, sprite->pos1.y, sprite->subpriority + 1);
if (sprite->data[7] != 64)
{
StartSpriteAffineAnim(&gSprites[sprite->data[7]], 0);
gSprites[sprite->data[7]].callback = SpriteCallbackDummy;
}
sprite->callback = sub_80D927C;
}
static void sub_80D927C(struct Sprite *sprite)
{
if (sprite->data[0] == 0)
{
if (sprite->data[7] != 64)
{
FreeOamMatrix(gSprites[sprite->data[7]].oam.matrixNum);
DestroySprite(&gSprites[sprite->data[7]]);
}
DestroyAnimSprite(sprite);
}
else
{
sprite->data[0]--;
}
}
void sub_80D92D0(struct Sprite *sprite)
{
sub_8078764(sprite, 1);
sprite->data[0] = 30;
if (gBattleAnimArgs[2] == 0)
{
sprite->data[2] = sprite->pos1.x - 20;
}
else
{
sprite->data[2] = sprite->pos1.x + 20;
sprite->hFlip = 1;
}
sprite->data[4] = sprite->pos1.y - 20;
sprite->callback = sub_8078B34;
StoreSpriteCallbackInData(sprite, sub_80D9328);
}
static void sub_80D9328(struct Sprite *sprite)
{
if (++sprite->data[5] == 11)
{
sprite->data[2] = sprite->pos1.x - sprite->pos2.x;
sprite->data[4] = sprite->pos1.y - sprite->pos2.y;
sprite->data[0] = 8;
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
sprite->pos2.y = 0;
sprite->pos2.x = 0;
sprite->callback = sub_8078B34;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
}
void sub_80D9378(struct Sprite *sprite)
{
if ((gAnimBankAttacker ^ 2) == gAnimBankTarget && GetBankIdentity(gAnimBankTarget) < 2)
gBattleAnimArgs[0] *= -1;
sub_8078764(sprite, 1);
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
sprite->data[0] = gBattleAnimArgs[3];
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2];
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = sprite->pos1.y;
obj_translate_based_on_private_1_2_3_4(sprite);
sprite->data[5] = gBattleAnimArgs[5];
sprite->data[6] = gBattleAnimArgs[4];
sprite->data[7] = 0;
sprite->callback = sub_80D9404;
}
static void sub_80D9404(struct Sprite *sprite)
{
if (!sub_8078B5C(sprite))
{
sprite->pos2.y += Sin(sprite->data[7] >> 8, sprite->data[5]);
sprite->data[7] += sprite->data[6];
}
else
{
DestroyAnimSprite(sprite);
}
}
void sub_80D943C(struct Sprite *sprite)
{
sub_8078764(sprite, 1);
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
sprite->data[0] = gBattleAnimArgs[3];
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, sub_80D9474);
}
static void sub_80D9474(struct Sprite *sprite)
{
StartSpriteAffineAnim(sprite, 0);
sprite->affineAnimPaused = 1;
sprite->data[0] = 20;
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80D94A8(struct Sprite *sprite)
{
sub_8078764(sprite, 1);
sprite->data[0] = gBattleAnimArgs[2];
sprite->callback = sub_80D94CC;
}
static void sub_80D94CC(struct Sprite *sprite)
{
if (--sprite->data[0] == -1)
{
sprite->data[0] = 6;
sprite->data[2] = GetBankPosition(gAnimBankTarget, 2);
sprite->data[4] = GetBankPosition(gAnimBankTarget, 3);
sprite->callback = sub_8078B34;
StoreSpriteCallbackInData(sprite, sub_80D9524);
}
}
static void sub_80D9524(struct Sprite *sprite)
{
sprite->data[0] = 15;
sprite->callback = sub_80782D8;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80D9540(struct Sprite *sprite)
{
if (sprite->data[0] == 0)
{
sub_8078764(sprite, 1);
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[2] = gBattleAnimArgs[3];
sprite->data[0]++;
}
else
{
sprite->data[4] += sprite->data[1];
sprite->pos2.x = sprite->data[4] >> 8;
sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]);
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
if (sprite->data[3] > 100)
sprite->invisible = sprite->data[3] % 2;
if (sprite->data[3] > 120)
DestroyAnimSprite(sprite);
}
}
void sub_80D95D0(struct Sprite *sprite)
{
if (gBattleAnimArgs[0] == 0)
{
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0);
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1);
}
else
{
sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0);
sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1);
}
sprite->pos1.x += gBattleAnimArgs[1];
sprite->pos1.y += gBattleAnimArgs[2];
sprite->data[0] = 0;
sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[4];
sprite->data[3] = 0;
sprite->callback = sub_80D9640;
}
static void sub_80D9640(struct Sprite *sprite)
{
switch (sprite->data[0])
{
case 0:
if (--sprite->data[1] == 0)
{
if (sprite->data[2] == 0)
DestroyAnimSprite(sprite);
else
sprite->data[0]++;
}
break;
case 1:
if (++sprite->data[1] > 1)
{
sprite->data[1] = 0;
sprite->data[3]++;
if (sprite->data[3] & 1)
sprite->pos2.x = 2;
else
sprite->pos2.x = -2;
}
if (--sprite->data[2] == 0)
DestroyAnimSprite(sprite);
break;
}
}
void sub_80D96B8(struct Sprite *sprite)
{
if (gBattleAnimArgs[0] == 0)
{
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0) + gBattleAnimArgs[2];
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[3];
}
else
{
sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0) + gBattleAnimArgs[2];
sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1) + gBattleAnimArgs[3];
}
sprite->oam.tileNum += gBattleAnimArgs[1] * 16;
sprite->data[0] = 0;
switch (gBattleAnimArgs[1])
{
case 0:
sprite->data[6] = -3;
sprite->data[7] = -3;
break;
case 1:
sprite->data[6] = 3;
sprite->data[7] = -3;
break;
case 2:
sprite->data[6] = -3;
sprite->data[7] = 3;
break;
case 3:
sprite->data[6] = 3;
sprite->data[7] = 3;
break;
default:
DestroyAnimSprite(sprite);
return;
}
sprite->callback = sub_80D97A0;
}
static void sub_80D97A0(struct Sprite *sprite)
{
sprite->pos1.x += sprite->data[6];
sprite->pos1.y += sprite->data[7];
if (++sprite->data[0] > 40)
DestroyAnimSprite(sprite);
}
void sub_80D97CC(struct Sprite *sprite)
{
if (gBattleAnimArgs[0] == 0)
{
sprite->pos1.x = GetBankPosition(gBankAttacker, 2);
sprite->pos1.y = GetBankPosition(gBankAttacker, 3);
sprite->oam.priority = sub_8079ED4(gAnimBankAttacker);
sprite->data[7] = gAnimBankTarget;
}
else
{
sprite->oam.priority = sub_8079ED4(gAnimBankTarget);
sprite->data[7] = gAnimBankAttacker;
}
sprite->data[0] = 0;
sprite->data[1] = 12;
sprite->data[2] = 8;
sprite->callback = sub_80D986C;
}
static void sub_80D986C(struct Sprite *sprite)
{
if (++sprite->data[0] == 180)
{
REG_BLDCNT = 0;
sprite->data[0] = 16;
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBankPosition(sprite->data[7], 2);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBankPosition(sprite->data[7], 3);
obj_translate_based_on_private_1_2_3_4(sprite);
StoreSpriteCallbackInData(sprite, move_anim_8074EE0);
sprite->callback = sub_8078BB8;
}
}
void sub_80D98D8(struct Sprite *sprite)
{
sprite->pos1.x = gBattleAnimArgs[0];
sprite->pos1.y = 120;
sprite->data[0] = gBattleAnimArgs[3];
sub_8079BF4(&sprite->data[4], &sprite->data[5], (void *)(sprite->pos1.y << 8));
sprite->data[6] = gBattleAnimArgs[1];
sprite->oam.tileNum += gBattleAnimArgs[2] * 4;
sprite->callback = sub_80D9934;
}
static void sub_80D9934(struct Sprite *sprite)
{
void *var0;
if (sprite->data[0] != 0)
{
var0 = sub_8079BFC(sprite->data[4], sprite->data[5]);
var0 -= sprite->data[6];
sub_8079BF4(&sprite->data[4], &sprite->data[5], var0);
var0 = (void *)(((intptr_t)var0) >> 8);
sprite->pos1.y = (intptr_t)var0;
if (sprite->pos1.y < -8)
DestroyAnimSprite(sprite);
else
sprite->data[0]--;
}
else
{
s16 pos0 = GetBankPosition(gAnimBankAttacker, 2);
s16 pos1 = GetBankPosition(gAnimBankAttacker, 3);
s16 pos2 = GetBankPosition(gAnimBankTarget, 2);
s16 pos3 = GetBankPosition(gAnimBankTarget, 3);
sprite->data[0] = pos2 - pos0;
sprite->data[1] = pos3 - pos1;
sprite->data[2] = sprite->pos1.x << 4;
sprite->data[3] = sprite->pos1.y << 4;
sprite->callback = sub_80D99F4;
}
}
static void sub_80D99F4(struct Sprite *sprite)
{
u16 edgeX;
sprite->data[2] += sprite->data[0];
sprite->data[3] += sprite->data[1];
sprite->pos1.x = sprite->data[2] >> 4;
sprite->pos1.y = sprite->data[3] >> 4;
edgeX = sprite->pos1.x + 8;
if (edgeX > 256 || sprite->pos1.y < -8 || sprite->pos1.y > 120)
DestroyAnimSprite(sprite);
}
void sub_80D9A38(struct Sprite *sprite)
{
u8 bank;
if (gBattleAnimArgs[0] == 0)
{
sprite->pos1.x = GetBankPosition(gBankAttacker, 2);
sprite->pos1.y = GetBankPosition(gBankAttacker, 3);
bank = gAnimBankTarget;
sprite->oam.priority = sub_8079ED4(gAnimBankAttacker);
}
else
{
bank = gAnimBankAttacker;
sprite->oam.priority = sub_8079ED4(gAnimBankTarget);
}
if (IsContest())
sprite->oam.matrixNum |= 0x8;
else if (GetBankSide(bank) == SIDE_PLAYER)
sprite->oam.matrixNum |= 0x18;
sprite->data[0] = 16;
sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBankPosition(bank, 2);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBankPosition(bank, 3);
obj_translate_based_on_private_1_2_3_4(sprite);
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
sprite->callback = sub_8078BB8;
}
static void sub_80D9B24(struct Sprite *sprite)
{
if (sprite->data[0] == sprite->data[4])
DestroyAnimSprite(sprite);
sprite->data[0]++;
}
void sub_80D9B48(struct Sprite *sprite)
{
u8 turn;
sprite->pos1.x = GetBankPosition(gAnimBankTarget, 2);
sprite->pos1.y = GetBankPosition(gAnimBankTarget, 3);
sprite->data[1] = gBattleAnimArgs[3];
sprite->data[2] = gBattleAnimArgs[0];
sprite->data[3] = gBattleAnimArgs[1];
sprite->data[4] = gBattleAnimArgs[2];
turn = gAnimMoveTurn;
if (GetBankSide(gAnimBankTarget) == SIDE_PLAYER)
turn++;
if (turn & 1)
{
sprite->data[2] = -sprite->data[2];
sprite->data[1]++;
}
StartSpriteAnim(sprite, sprite->data[1]);
sprite->pos2.x = sprite->data[2];
sprite->pos2.y = sprite->data[3];
sprite->callback = sub_80D9B24;
}
void sub_80D9BD4(struct Sprite *sprite)
{
if (gBattleAnimArgs[2] == 0)
sub_80787B0(sprite, 0);
else
sub_8078764(sprite, 0);
if (IsContest())
{
StartSpriteAnim(sprite, 2);
}
else if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
{
StartSpriteAnim(sprite, 1);
}
sprite->callback = sub_8078600;
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
}
void sub_80D9C40(struct Sprite *sprite)
{
if (sprite->affineAnimEnded)
{
sprite->data[1] = (sprite->data[1] + 40) & 0xFF;
sprite->pos2.x = Sin(sprite->data[1], 2);
if (++sprite->data[0] > 40)
{
DestroyAnimSprite(sprite);
}
}
}
void sub_80D9C80(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
sub_80789D4(0);
task->data[8] = gBattleAnimArgs[0];
task->data[0]++;
break;
case 1:
if (--task->data[8] == -1)
task->data[0]++;
break;
case 2:
default:
task->data[9] += 1280;
break;
}
task->data[10] += 2816;
if (GetBankSide(gAnimBankTarget) == SIDE_PLAYER)
gBattle_BG3_X += task->data[9] >> 8;
else
gBattle_BG3_X -= task->data[9] >> 8;
gBattle_BG3_Y += task->data[10] >> 8;
task->data[9] &= 0xFF;
task->data[10] &= 0xFF;
if (gBattleAnimArgs[7] == -1)
{
gBattle_BG3_X = 0;
gBattle_BG3_Y = 0;
sub_80789D4(1);
DestroyAnimVisualTask(taskId);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5018,7 +5018,156 @@ _0801F610: .4byte BattleScript_SAtkDown2\n\
}
#endif // NONMATCHING
#if DEBUG
__attribute__((naked))
static void atk15_seteffectwithchance(void)
{
asm("\
push {r4, lr}\n\
ldr r2, ._1037 @ gBattleMons\n\
ldr r0, ._1037 + 4 @ gBankAttacker\n\
ldrb r1, [r0]\n\
mov r0, #0x58\n\
mul r0, r0, r1\n\
add r0, r0, r2\n\
add r0, r0, #0x20\n\
ldrb r0, [r0]\n\
cmp r0, #0x20\n\
bne ._1035 @cond_branch\n\
ldr r2, ._1037 + 8 @ gBattleMoves\n\
ldr r0, ._1037 + 12 @ gCurrentMove\n\
ldrh r1, [r0]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r2\n\
ldrb r0, [r0, #0x5]\n\
lsl r4, r0, #0x1\n\
b ._1036\n\
._1038:\n\
.align 2, 0\n\
._1037:\n\
.word gBattleMons\n\
.word gBankAttacker\n\
.word gBattleMoves\n\
.word gCurrentMove\n\
._1035:\n\
ldr r2, ._1045 @ gBattleMoves\n\
ldr r0, ._1045 + 4 @ gCurrentMove\n\
ldrh r1, [r0]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r2\n\
ldrb r4, [r0, #0x5]\n\
._1036:\n\
ldr r0, ._1045 + 8 @ gUnknown_02023A14_50\n\
ldrb r1, [r0]\n\
mov r0, #0x4\n\
and r0, r0, r1\n\
ldr r2, ._1045 + 12 @ gBattleCommunication\n\
cmp r0, #0\n\
beq ._1039 @cond_branch\n\
ldrb r1, [r2, #0x3]\n\
mov r0, #0x80\n\
and r0, r0, r1\n\
cmp r0, #0\n\
bne ._1040 @cond_branch\n\
ldr r0, ._1045 + 16 @ gBattleMoveFlags\n\
ldrb r1, [r0]\n\
mov r0, #0x29\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._1050 @cond_branch\n\
._1039:\n\
ldrb r1, [r2, #0x3]\n\
mov r0, #0x80\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._1043 @cond_branch\n\
._1040:\n\
ldr r0, ._1045 + 16 @ gBattleMoveFlags\n\
ldrb r1, [r0]\n\
mov r0, #0x29\n\
and r0, r0, r1\n\
cmp r0, #0\n\
bne ._1043 @cond_branch\n\
ldr r2, ._1045 + 12 @ gBattleCommunication\n\
ldrb r1, [r2, #0x3]\n\
mov r0, #0x7f\n\
and r0, r0, r1\n\
strb r0, [r2, #0x3]\n\
b ._1044\n\
._1046:\n\
.align 2, 0\n\
._1045:\n\
.word gBattleMoves\n\
.word gCurrentMove\n\
.word gUnknown_02023A14_50\n\
.word gBattleCommunication\n\
.word gBattleMoveFlags\n\
._1043:\n\
bl Random\n\
lsl r0, r0, #0x10\n\
lsr r0, r0, #0x10\n\
mov r1, #0x64\n\
bl __umodsi3\n\
lsl r0, r0, #0x10\n\
lsr r0, r0, #0x10\n\
cmp r0, r4\n\
bhi ._1049 @cond_branch\n\
ldr r0, ._1052 @ gBattleCommunication\n\
ldrb r0, [r0, #0x3]\n\
cmp r0, #0\n\
beq ._1049 @cond_branch\n\
ldr r0, ._1052 + 4 @ gBattleMoveFlags\n\
ldrb r1, [r0]\n\
mov r0, #0x29\n\
and r0, r0, r1\n\
cmp r0, #0\n\
bne ._1049 @cond_branch\n\
cmp r4, #0x63\n\
bls ._1050 @cond_branch\n\
._1044:\n\
mov r0, #0x0\n\
mov r1, #0x80\n\
bl SetMoveEffect\n\
b ._1054\n\
._1053:\n\
.align 2, 0\n\
._1052:\n\
.word gBattleCommunication\n\
.word gBattleMoveFlags\n\
._1050:\n\
mov r0, #0x0\n\
mov r1, #0x0\n\
bl SetMoveEffect\n\
b ._1054\n\
._1049:\n\
ldr r1, ._1055 @ gBattlescriptCurrInstr\n\
ldr r0, [r1]\n\
add r0, r0, #0x1\n\
str r0, [r1]\n\
._1054:\n\
ldr r0, ._1055 + 4 @ gBattleCommunication\n\
mov r1, #0x0\n\
strb r1, [r0, #0x3]\n\
ldr r0, ._1055 + 8 @ \n\
ldr r2, ._1055 + 12 @ \n\
add r0, r0, r2\n\
strb r1, [r0]\n\
pop {r4}\n\
pop {r0}\n\
bx r0\n\
._1056:\n\
.align 2, 0\n\
._1055:\n\
.word gBattlescriptCurrInstr\n\
.word gBattleCommunication\n\
.word +0x2000000\n\
.word 0x16112");
}
#else
static void atk15_seteffectwithchance(void)
{
u32 PercentChance;
@ -5043,6 +5192,7 @@ static void atk15_seteffectwithchance(void)
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattleStruct->unk16112 = 0;
}
#endif
static void atk16_seteffectprimary(void)
{
@ -12620,6 +12770,193 @@ static void atk9D_mimicattackcopy(void)
}
}
#if DEBUG
__attribute__((naked))
static void atk9E_metronome(void)
{
asm("\
push {r4, r5, r6, r7, lr}\n\
mov r7, r8\n\
push {r7}\n\
ldr r6, ._3076 @ gBankAttacker\n\
ldrb r2, [r6]\n\
lsl r1, r2, #0x1\n\
ldr r0, ._3076 + 4 @ \n\
add r3, r1, r0\n\
ldr r5, ._3076 + 8 @ \n\
mov r4, #0x58\n\
add r0, r2, #0\n\
mul r0, r0, r4\n\
add r1, r0, r5\n\
ldrh r0, [r1, #0xe]\n\
cmp r0, #0\n\
bne ._3071 @cond_branch\n\
ldrh r2, [r1, #0x10]\n\
cmp r2, #0\n\
beq ._3071 @cond_branch\n\
ldrh r0, [r1, #0x12]\n\
cmp r0, #0\n\
beq ._3071 @cond_branch\n\
ldrh r0, [r3]\n\
cmp r0, #0\n\
bne ._3072 @cond_branch\n\
strh r2, [r3]\n\
._3072:\n\
ldr r1, ._3076 + 12 @ \n\
ldrh r0, [r3]\n\
strh r0, [r1]\n\
ldrb r0, [r6]\n\
mul r0, r0, r4\n\
add r0, r0, r5\n\
ldrh r5, [r0, #0x10]\n\
ldrh r2, [r0, #0x12]\n\
add r7, r1, #0\n\
cmp r5, r2\n\
bcs ._3073 @cond_branch\n\
ldrh r0, [r3]\n\
cmp r0, r2\n\
beq ._3074 @cond_branch\n\
add r0, r0, #0x1\n\
b ._3079\n\
._3077:\n\
.align 2, 0\n\
._3076:\n\
.word gBankAttacker\n\
.word +0x20160b4\n\
.word gBattleMons\n\
.word gCurrentMove\n\
._3073:\n\
ldrh r4, [r3]\n\
add r1, r4, #0\n\
mov r0, #0xb1\n\
lsl r0, r0, #0x1\n\
cmp r1, r0\n\
bne ._3078 @cond_branch\n\
mov r0, #0x1\n\
b ._3079\n\
._3078:\n\
cmp r1, r2\n\
bne ._3080 @cond_branch\n\
._3074:\n\
strh r5, [r3]\n\
b ._3081\n\
._3080:\n\
add r0, r4, #1\n\
._3079:\n\
strh r0, [r3]\n\
._3081:\n\
ldr r4, ._3083 @ gHitMarker\n\
ldr r2, [r4]\n\
ldr r0, ._3083 + 4 @ 0xfffffbff\n\
and r2, r2, r0\n\
str r2, [r4]\n\
ldr r6, ._3083 + 8 @ gBattlescriptCurrInstr\n\
ldr r5, ._3083 + 12 @ gBattleScriptsForMoveEffects\n\
ldr r3, ._3083 + 16 @ gBattleMoves\n\
ldrh r1, [r7]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r3\n\
ldrb r0, [r0]\n\
lsl r0, r0, #0x2\n\
add r0, r0, r5\n\
ldr r0, [r0]\n\
str r0, [r6]\n\
mov r0, #0x80\n\
lsl r0, r0, #0x4\n\
orr r2, r2, r0\n\
str r2, [r4]\n\
ldrh r0, [r7]\n\
b ._3082\n\
._3084:\n\
.align 2, 0\n\
._3083:\n\
.word gHitMarker\n\
.word 0xfffffbff\n\
.word gBattlescriptCurrInstr\n\
.word gBattleScriptsForMoveEffects\n\
.word gBattleMoves\n\
._3071:\n\
ldr r7, ._3090 @ gCurrentMove\n\
mov r6, #0xb1\n\
lsl r6, r6, #0x1\n\
ldr r5, ._3090 + 4 @ sMovesForbiddenToCopy\n\
ldr r0, ._3090 + 8 @ gBattlescriptCurrInstr\n\
mov r8, r0\n\
._3089:\n\
bl Random\n\
ldr r2, ._3090 + 12 @ 0x1ff\n\
add r1, r2, #0\n\
and r0, r0, r1\n\
add r0, r0, #0x1\n\
strh r0, [r7]\n\
cmp r0, r6\n\
bhi ._3089 @cond_branch\n\
mov r0, #0x3\n\
._3086:\n\
sub r0, r0, #0x1\n\
cmp r0, #0\n\
bge ._3086 @cond_branch\n\
ldr r4, ._3090 @ gCurrentMove\n\
ldrh r2, [r4]\n\
ldr r3, ._3090 + 16 @ 0xffff\n\
sub r0, r5, #2\n\
._3088:\n\
add r0, r0, #0x2\n\
ldrh r1, [r0]\n\
cmp r1, r2\n\
beq ._3087 @cond_branch\n\
cmp r1, r3\n\
bne ._3088 @cond_branch\n\
._3087:\n\
ldr r0, ._3090 + 16 @ 0xffff\n\
cmp r1, r0\n\
bne ._3089 @cond_branch\n\
ldr r2, ._3090 + 20 @ gHitMarker\n\
ldr r0, [r2]\n\
ldr r1, ._3090 + 24 @ 0xfffffbff\n\
and r0, r0, r1\n\
str r0, [r2]\n\
ldr r3, ._3090 + 28 @ gBattleScriptsForMoveEffects\n\
ldr r2, ._3090 + 32 @ gBattleMoves\n\
ldrh r1, [r4]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r2\n\
ldrb r0, [r0]\n\
lsl r0, r0, #0x2\n\
add r0, r0, r3\n\
ldr r0, [r0]\n\
mov r1, r8\n\
str r0, [r1]\n\
ldrh r0, [r4]\n\
._3082:\n\
mov r1, #0x0\n\
bl GetMoveTarget\n\
ldr r1, ._3090 + 36 @ gBankTarget\n\
strb r0, [r1]\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._3091:\n\
.align 2, 0\n\
._3090:\n\
.word gCurrentMove\n\
.word sMovesForbiddenToCopy\n\
.word gBattlescriptCurrInstr\n\
.word 0x1ff\n\
.word 0xffff\n\
.word gHitMarker\n\
.word 0xfffffbff\n\
.word gBattleScriptsForMoveEffects\n\
.word gBattleMoves\n\
.word gBankTarget");
}
#else
#ifdef NONMATCHING
static void atk9E_metronome(void)
{
@ -12721,6 +13058,7 @@ _0802795C: .4byte gBankTarget\n\
.syntax divided");
}
#endif // NONMATCHING
#endif
static void atk9F_dmgtolevel(void)
{

View File

@ -13,6 +13,8 @@
#include "util.h"
#include "ewram.h"
extern u8 gUnknown_02023A14_50;
extern u32 gUnknown_02023A14_4C;
extern u16 gBattleTypeFlags;
extern u16 gBattleWeather;
extern u8 gActiveBank;
@ -336,11 +338,15 @@ void BattleAI_SetupAIData(void)
else if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
AI_THINKING_STRUCT->aiFlags = 0x80000000;
#ifdef GERMAN
else if (gBattleTypeFlags & 0x900 || gTrainerBattleOpponent == 0x400)
else if (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER) || gTrainerBattleOpponent == 0x400)
AI_THINKING_STRUCT->aiFlags = 7;
#endif
else // otherwise, just set aiFlags to whatever flags the trainer has set in their data.
AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent].aiFlags;
#if DEBUG
if (gUnknown_02023A14_50 & 1)
AI_THINKING_STRUCT->aiFlags = gUnknown_02023A14_4C;
#endif
}
u8 BattleAI_GetAIActionToUse(void)

View File

@ -30,6 +30,7 @@ struct MovePpInfo
u8 ppBonuses;
};
extern u8 gUnknown_02023A14_50;
extern u8 gActiveBank;
extern u8 gBattleBufferA[][0x200];
extern u16 gBattlePartyID[];
@ -1213,14 +1214,23 @@ void OpponentHandleTrainerThrow(void)
{
u32 trainerPicIndex;
if (gTrainerBattleOpponent == 0x400)
trainerPicIndex = GetSecretBaseTrainerPicIndex();
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
trainerPicIndex = get_trainer_class_pic_index();
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
trainerPicIndex = GetEReaderTrainerPicIndex();
#if DEBUG
if (gUnknown_02023A14_50 & 0x10)
{
trainerPicIndex = gSharedMem[0x160A3];
}
else
trainerPicIndex = gTrainers[gTrainerBattleOpponent].trainerPic;
#endif
{
if (gTrainerBattleOpponent == 0x400)
trainerPicIndex = GetSecretBaseTrainerPicIndex();
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
trainerPicIndex = get_trainer_class_pic_index();
else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER)
trainerPicIndex = GetEReaderTrainerPicIndex();
else
trainerPicIndex = gTrainers[gTrainerBattleOpponent].trainerPic;
}
sub_8031A6C(trainerPicIndex, gActiveBank);
GetMonSpriteTemplate_803C5A0(trainerPicIndex, GetBankIdentity(gActiveBank));
@ -1427,6 +1437,315 @@ void OpponentHandlecmd19(void)
OpponentBufferExecCompleted();
}
#if DEBUG
__attribute__((naked))
void OpponentHandlecmd20(void)
{
asm("\
push {r4, r5, r6, r7, lr}\n\
mov r7, sl\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5, r6, r7}\n\
ldr r6, ._549 @ gActiveBank\n\
ldrb r0, [r6]\n\
lsl r0, r0, #0x9\n\
ldr r1, ._549 + 4 @ gBattleBufferA\n\
add r5, r0, r1\n\
ldr r2, ._549 + 8 @ gUnknown_02023A14_50\n\
ldrb r1, [r2]\n\
mov r0, #0x4\n\
and r0, r0, r1\n\
mov sl, r6\n\
cmp r0, #0\n\
beq ._546 @cond_branch\n\
ldr r0, ._549 + 12 @ gBattleMoves\n\
mov r9, r0\n\
ldr r1, ._549 + 16 @ \n\
mov ip, r1\n\
add r7, r6, #0\n\
mov r0, #0x2\n\
mov r8, r0\n\
ldr r6, ._549 + 20 @ \n\
._552:\n\
ldrb r1, [r7]\n\
mov r0, r8\n\
and r0, r0, r1\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x19\n\
add r0, r0, r6\n\
mov r1, ip\n\
add r3, r0, r1\n\
ldrb r1, [r3]\n\
lsl r0, r1, #0x1\n\
add r0, r5, r0\n\
ldrh r2, [r0]\n\
add r4, r1, #0\n\
cmp r2, #0\n\
beq ._547 @cond_branch\n\
add r0, r4, #1\n\
strb r0, [r3]\n\
b ._548\n\
._550:\n\
.align 2, 0\n\
._549:\n\
.word gActiveBank\n\
.word gBattleBufferA+4\n\
.word gUnknown_02023A14_50\n\
.word gBattleMoves\n\
.word +0x2000000\n\
.word 0x1609e\n\
._547:\n\
strb r2, [r3]\n\
._548:\n\
ldrb r0, [r7]\n\
mov r1, r8\n\
and r1, r1, r0\n\
lsl r1, r1, #0x18\n\
lsr r1, r1, #0x19\n\
add r1, r1, r6\n\
add r1, r1, ip\n\
ldrb r0, [r1]\n\
cmp r0, #0x3\n\
bls ._551 @cond_branch\n\
mov r0, #0x0\n\
strb r0, [r1]\n\
._551:\n\
cmp r2, #0\n\
beq ._552 @cond_branch\n\
lsl r0, r2, #0x1\n\
add r0, r0, r2\n\
lsl r0, r0, #0x2\n\
add r0, r0, r9\n\
ldrb r3, [r0, #0x6]\n\
mov r0, #0x12\n\
and r0, r0, r3\n\
cmp r0, #0\n\
beq ._553 @cond_branch\n\
mov r1, sl\n\
ldrb r0, [r1]\n\
b ._561\n\
._553:\n\
ldr r0, ._559 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._557 @cond_branch\n\
ldr r0, ._559 + 4 @ gUnknown_02023A14_50\n\
ldrb r1, [r0]\n\
mov r5, #0x2\n\
add r0, r5, #0\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._556 @cond_branch\n\
cmp r3, #0\n\
bne ._557 @cond_branch\n\
mov r1, sl\n\
ldrb r0, [r1]\n\
bl GetBankIdentity\n\
mov r1, #0x2\n\
eor r0, r0, r1\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
b ._558\n\
._560:\n\
.align 2, 0\n\
._559:\n\
.word gBattleTypeFlags\n\
.word gUnknown_02023A14_50\n\
._556:\n\
bl Random\n\
add r1, r5, #0\n\
and r1, r1, r0\n\
lsl r1, r1, #0x10\n\
lsr r0, r1, #0x10\n\
b ._561\n\
._557:\n\
mov r0, #0x0\n\
._558:\n\
bl GetBankByIdentity\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
._561:\n\
lsl r2, r0, #0x8\n\
orr r2, r2, r4\n\
mov r0, #0x1\n\
mov r1, #0xa\n\
._569:\n\
bl Emitcmd33\n\
._573:\n\
bl OpponentBufferExecCompleted\n\
b ._562\n\
._546:\n\
ldr r0, ._567 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x93\n\
lsl r0, r0, #0x3\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._563 @cond_branch\n\
bl BattleAI_SetupAIData\n\
bl BattleAI_GetAIActionToUse\n\
lsl r0, r0, #0x18\n\
lsr r4, r0, #0x18\n\
cmp r4, #0x4\n\
beq ._564 @cond_branch\n\
cmp r4, #0x5\n\
bne ._565 @cond_branch\n\
mov r0, #0x1\n\
mov r1, #0x4\n\
b ._566\n\
._568:\n\
.align 2, 0\n\
._567:\n\
.word gBattleTypeFlags\n\
._564:\n\
mov r0, #0x1\n\
mov r1, #0x3\n\
._566:\n\
mov r2, #0x0\n\
b ._569\n\
._565:\n\
ldr r3, ._574 @ gBattleMoves\n\
lsl r0, r4, #0x1\n\
add r2, r5, r0\n\
ldrh r1, [r2]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r3\n\
ldrb r1, [r0, #0x6]\n\
mov r0, #0x12\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._570 @cond_branch\n\
ldr r1, ._574 + 4 @ gBankTarget\n\
ldrb r0, [r6]\n\
strb r0, [r1]\n\
._570:\n\
ldrh r1, [r2]\n\
lsl r0, r1, #0x1\n\
add r0, r0, r1\n\
lsl r0, r0, #0x2\n\
add r0, r0, r3\n\
ldrb r1, [r0, #0x6]\n\
mov r0, #0x8\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._572 @cond_branch\n\
mov r0, #0x0\n\
bl GetBankByIdentity\n\
ldr r5, ._574 + 4 @ gBankTarget\n\
strb r0, [r5]\n\
ldr r0, ._574 + 8 @ gAbsentBankFlags\n\
ldrb r1, [r0]\n\
ldr r2, ._574 + 12 @ gBitTable\n\
ldrb r0, [r5]\n\
lsl r0, r0, #0x2\n\
add r0, r0, r2\n\
ldr r0, [r0]\n\
and r1, r1, r0\n\
cmp r1, #0\n\
beq ._572 @cond_branch\n\
mov r0, #0x2\n\
bl GetBankByIdentity\n\
strb r0, [r5]\n\
._572:\n\
ldr r0, ._574 + 4 @ gBankTarget\n\
ldrb r2, [r0]\n\
lsl r2, r2, #0x8\n\
orr r2, r2, r4\n\
mov r0, #0x1\n\
mov r1, #0xa\n\
bl Emitcmd33\n\
b ._573\n\
._575:\n\
.align 2, 0\n\
._574:\n\
.word gBattleMoves\n\
.word gBankTarget\n\
.word gAbsentBankFlags\n\
.word gBitTable\n\
._563:\n\
mov r6, #0x3\n\
._576:\n\
bl Random\n\
add r4, r0, #0\n\
and r4, r4, r6\n\
lsl r0, r4, #0x1\n\
add r0, r5, r0\n\
ldrh r2, [r0]\n\
cmp r2, #0\n\
beq ._576 @cond_branch\n\
ldr r1, ._579 @ gBattleMoves\n\
lsl r0, r2, #0x1\n\
add r0, r0, r2\n\
lsl r0, r0, #0x2\n\
add r0, r0, r1\n\
ldrb r1, [r0, #0x6]\n\
mov r0, #0x12\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._577 @cond_branch\n\
ldr r0, ._579 + 4 @ gActiveBank\n\
ldrb r2, [r0]\n\
lsl r2, r2, #0x8\n\
b ._578\n\
._580:\n\
.align 2, 0\n\
._579:\n\
.word gBattleMoves\n\
.word gActiveBank\n\
._577:\n\
ldr r0, ._583 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._581 @cond_branch\n\
bl Random\n\
mov r1, #0x2\n\
and r1, r1, r0\n\
lsl r1, r1, #0x18\n\
lsr r1, r1, #0x18\n\
add r0, r1, #0\n\
bl GetBankByIdentity\n\
add r2, r0, #0\n\
lsl r2, r2, #0x18\n\
lsr r2, r2, #0x10\n\
._578:\n\
orr r2, r2, r4\n\
mov r0, #0x1\n\
mov r1, #0xa\n\
bl Emitcmd33\n\
b ._582\n\
._584:\n\
.align 2, 0\n\
._583:\n\
.word gBattleTypeFlags\n\
._581:\n\
mov r0, #0x0\n\
bl GetBankByIdentity\n\
add r2, r0, #0\n\
lsl r2, r2, #0x18\n\
lsr r2, r2, #0x10\n\
orr r2, r2, r4\n\
mov r0, #0x1\n\
mov r1, #0xa\n\
bl Emitcmd33\n\
._582:\n\
bl OpponentBufferExecCompleted\n\
._562:\n\
pop {r3, r4, r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov sl, r5\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0");
}
#else
#ifdef NONMATCHING
void OpponentHandlecmd20(void)
{
@ -1501,7 +1820,7 @@ void OpponentHandlecmd20(void)
ldr r6, _0803545C @ =gActiveBank\n\
ldrb r0, [r6]\n\
lsls r0, 9\n\
ldr r1, _08035460 @ =gUnknown_02023A64\n\
ldr r1, _08035460 @ =gBattleBufferA+4\n\
adds r5, r0, r1\n\
ldr r0, _08035464 @ =gBattleTypeFlags\n\
ldrh r1, [r0]\n\
@ -1523,7 +1842,7 @@ void OpponentHandlecmd20(void)
b _0803546C\n\
.align 2, 0\n\
_0803545C: .4byte gActiveBank\n\
_08035460: .4byte gUnknown_02023A64\n\
_08035460: .4byte gBattleBufferA+4\n\
_08035464: .4byte gBattleTypeFlags\n\
_08035468:\n\
movs r0, 0x1\n\
@ -1670,6 +1989,7 @@ _0803558A:\n\
.syntax divided\n");
}
#endif
#endif
void OpponentHandleOpenBag(void)
{

View File

@ -42,6 +42,8 @@ extern struct Window gUnknown_03004210;
extern void (*gBattleBankFunc[])(void);
extern u32 gOamMatrixAllocBitmap;
extern u8 gUnknown_020297ED;
extern u8 gActiveBank;
extern u8 gActionSelectionCursor[];
extern u8 gDisplayedStringBattle[];
@ -617,9 +619,14 @@ struct ChooseMoveStruct
const u8 gUnknown_081FAE80[] = _("{PALETTE 5}{COLOR_HIGHLIGHT_SHADOW WHITE LIGHT_BLUE WHITE2}");
void debug_sub_8030C24(void);
void sub_802C68C(void)
{
u32 r8 = 0;
#if DEBUG
u8 count = 0;
#endif
struct ChooseMoveStruct *r6 = (struct ChooseMoveStruct *)(gBattleBufferA[gActiveBank] + 4);
if (gMain.newKeys & A_BUTTON)
@ -750,6 +757,43 @@ void sub_802C68C(void)
gBattleBankFunc[gActiveBank] = sub_802CA60;
}
}
#if DEBUG
else if (gUnknown_020297ED == 1 && (gMain.newKeys & START_BUTTON))
{
const u8 *moveName;
s32 i;
Text_FillWindowRect(&gUnknown_03004210, 0x1016, 1, 0x37, 16, 0x3A);
moveName = gMoveNames[GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MOVE1)];
Text_InitWindowAndPrintText(&gUnknown_03004210, moveName, 0x100, 2, 0x37);
ConvertIntToDecimalStringN(
gDisplayedStringBattle,
GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MOVE1),
2, 3);
Text_InitWindowAndPrintText(&gUnknown_03004210, gDisplayedStringBattle, 0x110, 10, 0x37);
Text_InitWindowAndPrintText(&gUnknown_03004210, gString_TurnJP, 0x116, 1, 0x39);
ConvertIntToDecimalStringN(gDisplayedStringBattle, gAnimMoveTurn, 2, 3);
Text_InitWindowAndPrintText(&gUnknown_03004210, gDisplayedStringBattle, 0x11C, 4, 0x39);
for (i = 0; i < 64; i++)
{
if (gSprites[i].inUse)
count++;
}
ConvertIntToDecimalStringN(gDisplayedStringBattle, count, 2, 2);
Text_InitWindowAndPrintText(&gUnknown_03004210, gDisplayedStringBattle, 0x122, 8, 0x39);
count = GetTaskCount();
ConvertIntToDecimalStringN(gDisplayedStringBattle, count, 2, 2);
Text_InitWindowAndPrintText(&gUnknown_03004210, gDisplayedStringBattle, 0x126, 11, 0x39);
for (i = 0, count = 0; i < 32; i++)
{
if (gOamMatrixAllocBitmap & (1 << i))
count++;
}
ConvertIntToDecimalStringN(gDisplayedStringBattle, count, 2, 2);
Text_InitWindowAndPrintText(&gUnknown_03004210, gDisplayedStringBattle, 0x12A, 14, 0x39);
gBattleBankFunc[gActiveBank] = debug_sub_8030C24;
}
#endif
}
extern const u8 BattleText_Format[];
@ -956,6 +1000,688 @@ void sub_802D18C(void)
}
}
#if DEBUG
__attribute__((naked))
void debug_sub_8030C24(void)
{
asm("\
push {r4, r5, r6, lr}\n\
add sp, sp, #0xfffffff4\n\
ldr r1, ._293 @ gBattlePartyID\n\
ldr r4, ._293 + 4 @ gActiveBank\n\
ldrb r0, [r4]\n\
lsl r0, r0, #0x1\n\
add r0, r0, r1\n\
ldrh r1, [r0]\n\
mov r0, #0x64\n\
mul r0, r0, r1\n\
ldr r1, ._293 + 8 @ gPlayerParty\n\
add r0, r0, r1\n\
mov r1, #0xd\n\
bl GetMonData\n\
add r1, sp, #0x8\n\
strh r0, [r1]\n\
ldr r5, ._293 + 12 @ gMain\n\
ldrh r1, [r5, #0x30]\n\
cmp r1, #0x20\n\
bne ._286 @cond_branch\n\
b ._287\n\
._286:\n\
cmp r1, #0x20\n\
bgt ._288 @cond_branch\n\
cmp r1, #0x8\n\
beq ._289 @cond_branch\n\
cmp r1, #0x8\n\
bgt ._290 @cond_branch\n\
cmp r1, #0x4\n\
beq ._291 @cond_branch\n\
b ._348\n\
._294:\n\
.align 2, 0\n\
._293:\n\
.word gBattlePartyID\n\
.word gActiveBank\n\
.word gPlayerParty\n\
.word gMain\n\
._290:\n\
cmp r1, #0x10\n\
bne ._295 @cond_branch\n\
b ._296\n\
._295:\n\
b ._348\n\
._288:\n\
cmp r1, #0x80\n\
bne ._298 @cond_branch\n\
b ._302\n\
._298:\n\
cmp r1, #0x80\n\
bgt ._300 @cond_branch\n\
cmp r1, #0x40\n\
bne ._301 @cond_branch\n\
b ._302\n\
._301:\n\
b ._348\n\
._300:\n\
mov r0, #0x80\n\
lsl r0, r0, #0x1\n\
cmp r1, r0\n\
bne ._304 @cond_branch\n\
b ._305\n\
._304:\n\
mov r0, #0x80\n\
lsl r0, r0, #0x2\n\
cmp r1, r0\n\
bne ._306 @cond_branch\n\
b ._307\n\
._306:\n\
b ._348\n\
._289:\n\
ldrb r0, [r4]\n\
mov r1, #0x1\n\
bl dp11b_obj_free\n\
ldrb r0, [r4]\n\
mov r1, #0x0\n\
bl dp11b_obj_free\n\
ldr r0, ._312 @ gBankAttacker\n\
ldrb r2, [r4]\n\
strb r2, [r0]\n\
ldrh r1, [r5, #0x28]\n\
mov r0, #0x2\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._310 @cond_branch\n\
ldr r0, ._312 + 4 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._310 @cond_branch\n\
ldr r0, ._312 + 8 @ gBankTarget\n\
mov r1, #0x2\n\
eor r1, r1, r2\n\
strb r1, [r0]\n\
b ._311\n\
._313:\n\
.align 2, 0\n\
._312:\n\
.word gBankAttacker\n\
.word gBattleTypeFlags\n\
.word gBankTarget\n\
._310:\n\
ldr r0, ._317 @ gMain\n\
ldrh r1, [r0, #0x28]\n\
mov r2, #0x1\n\
add r0, r2, #0\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._315 @cond_branch\n\
ldr r0, ._317 + 4 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
add r0, r2, #0\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._315 @cond_branch\n\
mov r0, #0x3\n\
b ._316\n\
._318:\n\
.align 2, 0\n\
._317:\n\
.word gMain\n\
.word gBattleTypeFlags\n\
._315:\n\
mov r0, #0x1\n\
._316:\n\
bl GetBankByIdentity\n\
ldr r1, ._320 @ gBankTarget\n\
strb r0, [r1]\n\
._311:\n\
mov r0, #0x0\n\
bl sub_80326EC\n\
add r0, sp, #0x8\n\
ldrh r0, [r0]\n\
bl DoMoveAnim\n\
ldr r1, ._320 + 4 @ gBattleBankFunc\n\
ldr r0, ._320 + 8 @ gActiveBank\n\
ldrb r0, [r0]\n\
b ._332\n\
._321:\n\
.align 2, 0\n\
._320:\n\
.word gBankTarget\n\
.word gBattleBankFunc\n\
.word gActiveBank\n\
._291:\n\
ldrb r0, [r4]\n\
mov r1, #0x1\n\
bl dp11b_obj_free\n\
ldrb r0, [r4]\n\
mov r1, #0x0\n\
bl dp11b_obj_free\n\
ldr r0, ._325 @ gBankTarget\n\
ldrb r2, [r4]\n\
strb r2, [r0]\n\
ldrh r1, [r5, #0x28]\n\
mov r0, #0x2\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._323 @cond_branch\n\
ldr r0, ._325 + 4 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._323 @cond_branch\n\
ldr r0, ._325 + 8 @ gBankAttacker\n\
mov r1, #0x2\n\
eor r1, r1, r2\n\
strb r1, [r0]\n\
b ._324\n\
._326:\n\
.align 2, 0\n\
._325:\n\
.word gBankTarget\n\
.word gBattleTypeFlags\n\
.word gBankAttacker\n\
._323:\n\
ldr r0, ._330 @ gMain\n\
ldrh r1, [r0, #0x28]\n\
mov r2, #0x1\n\
add r0, r2, #0\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._328 @cond_branch\n\
ldr r0, ._330 + 4 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
add r0, r2, #0\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._328 @cond_branch\n\
mov r0, #0x3\n\
b ._329\n\
._331:\n\
.align 2, 0\n\
._330:\n\
.word gMain\n\
.word gBattleTypeFlags\n\
._328:\n\
mov r0, #0x1\n\
._329:\n\
bl GetBankByIdentity\n\
ldr r1, ._333 @ gBankAttacker\n\
strb r0, [r1]\n\
._324:\n\
mov r0, #0x0\n\
bl sub_80326EC\n\
add r0, sp, #0x8\n\
ldrh r0, [r0]\n\
bl DoMoveAnim\n\
ldr r1, ._333 + 4 @ gBattleBankFunc\n\
ldr r0, ._333 + 8 @ gActiveBank\n\
ldrb r0, [r0]\n\
b ._332\n\
._334:\n\
.align 2, 0\n\
._333:\n\
.word gBankAttacker\n\
.word gBattleBankFunc\n\
.word gActiveBank\n\
._305:\n\
ldrh r1, [r5, #0x28]\n\
mov r0, #0x2\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._336 @cond_branch\n\
ldr r0, ._338 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._336 @cond_branch\n\
ldrb r0, [r4]\n\
mov r1, #0x1\n\
bl dp11b_obj_free\n\
ldrb r0, [r4]\n\
mov r1, #0x0\n\
bl dp11b_obj_free\n\
mov r0, #0x3\n\
bl GetBankByIdentity\n\
ldr r1, ._338 + 4 @ gBankAttacker\n\
strb r0, [r1]\n\
mov r0, #0x1\n\
b ._337\n\
._339:\n\
.align 2, 0\n\
._338:\n\
.word gBattleTypeFlags\n\
.word gBankAttacker\n\
._336:\n\
add r0, sp, #0x8\n\
mov r1, #0x0\n\
ldsh r0, [r0, r1]\n\
add r0, r0, #0x9\n\
add r1, sp, #0x8\n\
strh r0, [r1]\n\
._296:\n\
add r0, sp, #0x8\n\
mov r2, #0x0\n\
ldsh r0, [r0, r2]\n\
add r0, r0, #0x1\n\
lsl r2, r0, #0x10\n\
add r1, sp, #0x8\n\
strh r0, [r1]\n\
mov r0, #0xb1\n\
lsl r0, r0, #0x11\n\
cmp r2, r0\n\
ble ._347 @cond_branch\n\
mov r1, #0x1\n\
add r0, sp, #0x8\n\
strh r1, [r0]\n\
b ._347\n\
._307:\n\
ldrh r1, [r5, #0x28]\n\
mov r0, #0x2\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._343 @cond_branch\n\
ldr r0, ._345 @ gBattleTypeFlags\n\
ldrh r1, [r0]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._343 @cond_branch\n\
ldrb r0, [r4]\n\
mov r1, #0x1\n\
bl dp11b_obj_free\n\
ldrb r0, [r4]\n\
mov r1, #0x0\n\
bl dp11b_obj_free\n\
mov r0, #0x1\n\
bl GetBankByIdentity\n\
ldr r1, ._345 + 4 @ gBankAttacker\n\
strb r0, [r1]\n\
mov r0, #0x3\n\
._337:\n\
bl GetBankByIdentity\n\
ldr r1, ._345 + 8 @ gBankTarget\n\
strb r0, [r1]\n\
mov r0, #0x0\n\
bl sub_80326EC\n\
add r0, sp, #0x8\n\
ldrh r0, [r0]\n\
bl DoMoveAnim\n\
ldr r1, ._345 + 12 @ gBattleBankFunc\n\
ldrb r0, [r4]\n\
._332:\n\
lsl r0, r0, #0x2\n\
add r0, r0, r1\n\
ldr r1, ._345 + 16 @ debug_sub_803107C\n\
str r1, [r0]\n\
b ._348\n\
._346:\n\
.align 2, 0\n\
._345:\n\
.word gBattleTypeFlags\n\
.word gBankAttacker\n\
.word gBankTarget\n\
.word gBattleBankFunc\n\
.word debug_sub_803107C+1\n\
._343:\n\
add r1, sp, #0x8\n\
add r0, r1, #0\n\
ldrh r0, [r0]\n\
sub r0, r0, #0x9\n\
strh r0, [r1]\n\
._287:\n\
add r1, sp, #0x8\n\
add r0, r1, #0\n\
ldrh r0, [r0]\n\
sub r0, r0, #0x1\n\
strh r0, [r1]\n\
lsl r0, r0, #0x10\n\
cmp r0, #0\n\
bgt ._347 @cond_branch\n\
mov r2, #0xb1\n\
lsl r2, r2, #0x1\n\
add r0, r2, #0\n\
strh r0, [r1]\n\
._347:\n\
ldr r1, ._349 @ gBattlePartyID\n\
ldr r4, ._349 + 4 @ gActiveBank\n\
ldrb r0, [r4]\n\
lsl r0, r0, #0x1\n\
add r0, r0, r1\n\
ldrh r1, [r0]\n\
mov r0, #0x64\n\
mul r0, r0, r1\n\
ldr r1, ._349 + 8 @ gPlayerParty\n\
add r0, r0, r1\n\
mov r1, #0xd\n\
add r2, sp, #0x8\n\
bl SetMonData\n\
ldr r2, ._349 + 12 @ gBattleMons\n\
ldrb r1, [r4]\n\
mov r0, #0x58\n\
mul r0, r0, r1\n\
add r0, r0, r2\n\
add r1, sp, #0x8\n\
ldrh r1, [r1]\n\
strh r1, [r0, #0xc]\n\
ldr r5, ._349 + 16 @ gUnknown_03004210\n\
ldr r1, ._349 + 20 @ 0x1016\n\
mov r0, #0x10\n\
str r0, [sp]\n\
mov r0, #0x38\n\
str r0, [sp, #0x4]\n\
add r0, r5, #0\n\
mov r2, #0x1\n\
mov r3, #0x37\n\
bl Text_FillWindowRect\n\
add r0, sp, #0x8\n\
mov r2, #0x0\n\
ldsh r1, [r0, r2]\n\
mov r0, #0xd\n\
mul r1, r1, r0\n\
ldr r0, ._349 + 24 @ gMoveNames\n\
add r1, r1, r0\n\
mov r2, #0x80\n\
lsl r2, r2, #0x1\n\
mov r6, #0x37\n\
str r6, [sp]\n\
add r0, r5, #0\n\
mov r3, #0x2\n\
bl Text_InitWindowAndPrintText\n\
ldr r4, ._349 + 28 @ gDisplayedStringBattle\n\
add r0, sp, #0x8\n\
mov r2, #0x0\n\
ldsh r1, [r0, r2]\n\
add r0, r4, #0\n\
mov r2, #0x2\n\
mov r3, #0x3\n\
bl ConvertIntToDecimalStringN\n\
mov r2, #0x88\n\
lsl r2, r2, #0x1\n\
str r6, [sp]\n\
add r0, r5, #0\n\
add r1, r4, #0\n\
mov r3, #0xa\n\
bl Text_InitWindowAndPrintText\n\
b ._348\n\
._350:\n\
.align 2, 0\n\
._349:\n\
.word gBattlePartyID\n\
.word gActiveBank\n\
.word gPlayerParty\n\
.word gBattleMons\n\
.word gUnknown_03004210\n\
.word 0x1016\n\
.word gMoveNames\n\
.word gDisplayedStringBattle\n\
._302:\n\
ldr r0, ._353 @ gMain\n\
ldrh r0, [r0, #0x30]\n\
cmp r0, #0x40\n\
bne ._351 @cond_branch\n\
ldr r1, ._353 + 4 @ gAnimMoveTurn\n\
ldrb r0, [r1]\n\
sub r0, r0, #0x1\n\
b ._352\n\
._354:\n\
.align 2, 0\n\
._353:\n\
.word gMain\n\
.word gAnimMoveTurn\n\
._351:\n\
ldr r1, ._359 @ gAnimMoveTurn\n\
ldrb r0, [r1]\n\
add r0, r0, #0x1\n\
._352:\n\
strb r0, [r1]\n\
ldr r4, ._359 + 4 @ gDisplayedStringBattle\n\
ldrb r1, [r1]\n\
add r0, r4, #0\n\
mov r2, #0x2\n\
mov r3, #0x3\n\
bl ConvertIntToDecimalStringN\n\
ldr r0, ._359 + 8 @ gUnknown_03004210\n\
mov r2, #0x8e\n\
lsl r2, r2, #0x1\n\
mov r1, #0x39\n\
str r1, [sp]\n\
add r1, r4, #0\n\
mov r3, #0x4\n\
bl Text_InitWindowAndPrintText\n\
._348:\n\
ldr r0, ._359 + 12 @ gMain\n\
ldrh r2, [r0, #0x28]\n\
mov r1, #0xc0\n\
lsl r1, r1, #0x2\n\
add r0, r1, #0\n\
and r0, r0, r2\n\
cmp r0, r1\n\
bne ._355 @cond_branch\n\
mov r4, #0x0\n\
ldr r5, ._359 + 4 @ gDisplayedStringBattle\n\
ldr r6, ._359 + 8 @ gUnknown_03004210\n\
._361:\n\
add r0, r5, #0\n\
ldr r1, ._359 + 16 @ BattleText_Format\n\
bl StringCopy\n\
ldr r1, ._359 + 20 @ gBattlePartyID\n\
ldr r0, ._359 + 24 @ gActiveBank\n\
ldrb r0, [r0]\n\
lsl r0, r0, #0x1\n\
add r0, r0, r1\n\
ldrh r1, [r0]\n\
mov r0, #0x64\n\
mul r0, r0, r1\n\
ldr r1, ._359 + 28 @ gPlayerParty\n\
add r0, r0, r1\n\
add r1, r4, #0\n\
add r1, r1, #0xd\n\
bl GetMonData\n\
mov r1, #0xd\n\
mul r1, r1, r0\n\
ldr r0, ._359 + 32 @ gMoveNames\n\
add r1, r1, r0\n\
add r0, r5, #0\n\
bl StringAppend\n\
lsl r0, r4, #0x14\n\
mov r1, #0x80\n\
lsl r1, r1, #0x11\n\
add r0, r0, r1\n\
lsr r2, r0, #0x10\n\
mov r0, #0x1\n\
and r0, r0, r4\n\
mov r3, #0x2\n\
cmp r0, #0\n\
beq ._356 @cond_branch\n\
mov r3, #0xa\n\
._356:\n\
cmp r4, #0x1\n\
bhi ._357 @cond_branch\n\
mov r0, #0x37\n\
b ._358\n\
._360:\n\
.align 2, 0\n\
._359:\n\
.word gAnimMoveTurn\n\
.word gDisplayedStringBattle\n\
.word gUnknown_03004210\n\
.word gMain\n\
.word BattleText_Format\n\
.word gBattlePartyID\n\
.word gActiveBank\n\
.word gPlayerParty\n\
.word gMoveNames\n\
._357:\n\
mov r0, #0x39\n\
._358:\n\
str r0, [sp]\n\
add r0, r6, #0\n\
add r1, r5, #0\n\
bl Text_InitWindow\n\
ldr r0, ._362 @ gUnknown_03004210\n\
bl Text_PrintWindow8002F44\n\
add r0, r4, #1\n\
lsl r0, r0, #0x18\n\
lsr r4, r0, #0x18\n\
cmp r4, #0x3\n\
bls ._361 @cond_branch\n\
ldr r1, ._362 + 4 @ gBattleBankFunc\n\
ldr r0, ._362 + 8 @ gActiveBank\n\
ldrb r0, [r0]\n\
lsl r0, r0, #0x2\n\
add r0, r0, r1\n\
ldr r1, ._362 + 12 @ sub_802C68C\n\
str r1, [r0]\n\
._355:\n\
add sp, sp, #0xc\n\
pop {r4, r5, r6}\n\
pop {r0}\n\
bx r0\n\
._363:\n\
.align 2, 0\n\
._362:\n\
.word gUnknown_03004210\n\
.word gBattleBankFunc\n\
.word gActiveBank\n\
.word sub_802C68C+1");
}
__attribute__((naked))
void debug_sub_803107C(void)
{
asm("\
push {r4, r5, r6, r7, lr}\n\
add sp, sp, #0xfffffffc\n\
mov r7, #0x0\n\
ldr r0, ._369 @ gAnimScriptCallback\n\
ldr r0, [r0]\n\
bl _call_via_r0\n\
ldr r0, ._369 + 4 @ gAnimScriptActive\n\
ldrb r0, [r0]\n\
cmp r0, #0\n\
bne ._364 @cond_branch\n\
mov r0, #0x1\n\
bl sub_80326EC\n\
ldr r4, ._369 + 8 @ gActiveBank\n\
ldrb r0, [r4]\n\
mov r1, #0x1\n\
mov r2, #0x7\n\
mov r3, #0x1\n\
bl dp11b_obj_instanciate\n\
ldrb r0, [r4]\n\
mov r1, #0x0\n\
mov r2, #0x7\n\
mov r3, #0x1\n\
bl dp11b_obj_instanciate\n\
ldr r0, ._369 + 12 @ gSprites\n\
add r2, r0, #0\n\
add r2, r2, #0x3e\n\
mov r1, #0x3f\n\
._366:\n\
ldrb r0, [r2]\n\
lsl r0, r0, #0x1f\n\
cmp r0, #0\n\
beq ._365 @cond_branch\n\
add r0, r7, #1\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
._365:\n\
add r2, r2, #0x44\n\
sub r1, r1, #0x1\n\
cmp r1, #0\n\
bge ._366 @cond_branch\n\
ldr r4, ._369 + 16 @ gDisplayedStringBattle\n\
add r0, r4, #0\n\
add r1, r7, #0\n\
mov r2, #0x2\n\
mov r3, #0x2\n\
bl ConvertIntToDecimalStringN\n\
ldr r6, ._369 + 20 @ gUnknown_03004210\n\
mov r2, #0x91\n\
lsl r2, r2, #0x1\n\
mov r5, #0x39\n\
str r5, [sp]\n\
add r0, r6, #0\n\
add r1, r4, #0\n\
mov r3, #0x8\n\
bl Text_InitWindowAndPrintText\n\
bl GetTaskCount\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
add r0, r4, #0\n\
add r1, r7, #0\n\
mov r2, #0x2\n\
mov r3, #0x2\n\
bl ConvertIntToDecimalStringN\n\
mov r2, #0x93\n\
lsl r2, r2, #0x1\n\
str r5, [sp]\n\
add r0, r6, #0\n\
add r1, r4, #0\n\
mov r3, #0xb\n\
bl Text_InitWindowAndPrintText\n\
mov r1, #0x0\n\
mov r7, #0x0\n\
ldr r0, ._369 + 24 @ gOamMatrixAllocBitmap\n\
mov r3, #0x1\n\
ldr r2, [r0]\n\
._368:\n\
add r0, r3, #0\n\
LSL r0, r1\n\
and r0, r0, r2\n\
cmp r0, #0\n\
beq ._367 @cond_branch\n\
add r0, r7, #1\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
._367:\n\
add r1, r1, #0x1\n\
cmp r1, #0x1f\n\
ble ._368 @cond_branch\n\
ldr r4, ._369 + 16 @ gDisplayedStringBattle\n\
add r0, r4, #0\n\
add r1, r7, #0\n\
mov r2, #0x2\n\
mov r3, #0x2\n\
bl ConvertIntToDecimalStringN\n\
ldr r0, ._369 + 20 @ gUnknown_03004210\n\
mov r2, #0x95\n\
lsl r2, r2, #0x1\n\
mov r1, #0x39\n\
str r1, [sp]\n\
add r1, r4, #0\n\
mov r3, #0xe\n\
bl Text_InitWindowAndPrintText\n\
ldr r1, ._369 + 28 @ gBattleBankFunc\n\
ldr r0, ._369 + 8 @ gActiveBank\n\
ldrb r0, [r0]\n\
lsl r0, r0, #0x2\n\
add r0, r0, r1\n\
ldr r1, ._369 + 32 @ debug_sub_8030C24\n\
str r1, [r0]\n\
._364:\n\
add sp, sp, #0x4\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._370:\n\
.align 2, 0\n\
._369:\n\
.word gAnimScriptCallback\n\
.word gAnimScriptActive\n\
.word gActiveBank\n\
.word gSprites\n\
.word gDisplayedStringBattle\n\
.word gUnknown_03004210\n\
.word gOamMatrixAllocBitmap\n\
.word gBattleBankFunc\n\
.word debug_sub_8030C24+1");
}
#endif
void sub_802D204(void)
{
if (gSprites[gObjectBankIDs[gActiveBank]].callback == SpriteCallbackDummy)

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "battle_anim_81258BC.h"
#include "battle.h"
#include "battle_interface.h"
#include "battle_message.h"
#include "data2.h"
#include "link.h"
@ -272,6 +273,17 @@ void bx_battle_menu_t6_2(void)
sub_802E3E4(gActionSelectionCursor[gActiveBank], 0);
}
}
#if DEBUG
else if (gMain.newKeys & R_BUTTON)
{
if (!ewram17810[gActiveBank].unk0_5)
move_anim_start_t3(gActiveBank, gActiveBank, gActiveBank, 4, 0);
}
else if (gMain.newKeys & START_BUTTON)
{
sub_804454C();
}
#endif
}
void sub_812B65C(void)

View File

@ -79,8 +79,8 @@ extern const u16 gBattleInterfaceStatusIcons_DynPal[];
static void sub_8043D5C(struct Sprite *);
static const void *sub_8043CDC(u8);
static void sub_8044210(u8, s16, u8);
static void draw_status_ailment_maybe(u8);
/*static*/ void sub_8044210(u8, s16, u8);
/*static*/ void draw_status_ailment_maybe(u8);
extern void sub_8045180(struct Sprite *);
static void sub_8045110(struct Sprite *);
static void sub_8045048(struct Sprite *);
@ -651,7 +651,7 @@ void sub_8043F44(u8 a)
#define CHAR_LV_SEPARATOR CHAR_PERIOD
#endif
static void sub_8043FC0(u8 a, u8 b)
/*static*/ void sub_8043FC0(u8 a, u8 b)
{
u8 str[30];
void *const *r7;
@ -905,7 +905,7 @@ _0804420C: .4byte 0x04000008\n\
}
#endif
static void sub_8044210(u8 a, s16 b, u8 c)
/*static*/ void sub_8044210(u8 a, s16 b, u8 c)
{
u8 str[0x14];
u8 *ptr;
@ -1277,6 +1277,8 @@ _08044548: .4byte 0x04000008\n\
}
#endif
extern u8 gUnknown_020297ED;
void sub_804454C(void)
{
s32 i;
@ -1285,7 +1287,11 @@ void sub_804454C(void)
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gSprites[gHealthboxIDs[i]].callback == SpriteCallbackDummy
#if DEBUG
&& (gUnknown_020297ED != 0 || GetBankSide(i) != 1)
#else
&& GetBankSide(i) != 1
#endif
&& (IsDoubleBattle() || GetBankSide(i) != 0))
{
u8 r6;
@ -2359,7 +2365,7 @@ void sub_8045180(struct Sprite *sprite)
sprite->pos2.y = gSprites[spriteId].pos2.y;
}
static void sub_80451A0(u8 a, struct Pokemon *pkmn)
/*static*/ void sub_80451A0(u8 a, struct Pokemon *pkmn)
{
u8 nickname[POKEMON_NAME_LENGTH];
u8 gender;
@ -2507,7 +2513,7 @@ static void sub_8045458(u8 a, u8 b)
}
}
static void draw_status_ailment_maybe(u8 a)
/*static*/ void draw_status_ailment_maybe(u8 a)
{
s32 r4;
s32 r4_2;
@ -2649,7 +2655,7 @@ static u8 sub_80457E8(u8 a, u8 b)
return ret;
}
static void sub_80458B0(u8 a)
/*static*/ void sub_80458B0(u8 a)
{
u8 *r6;
u8 r8;
@ -2675,7 +2681,7 @@ static void sub_80458B0(u8 a)
}
static void sub_8045998(u8 a)
/*static*/ void sub_8045998(u8 a)
{
u8 *r7;
u8 status;
@ -2752,6 +2758,15 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
{
if (c == 3 || c == 0)
sub_8043FC0(a, GetMonData(pkmn, MON_DATA_LEVEL));
#if DEBUG
if (gUnknown_020297ED == 1)
{
if (c == 1 || c == 0)
sub_80440EC(a, GetMonData(pkmn, MON_DATA_HP), 0);
if (c == 2 || c == 0)
sub_80440EC(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1);
}
#endif
if (c == 5 || c == 0)
{
load_gfxc_health_bar(0);

View File

@ -8,9 +8,35 @@
#include "strings2.h"
#include "trainer_card.h"
struct DebugStruct1
{
u16 var0;
u8 var1[10];
};
extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4];
extern u8 gBattleOutcome;
#if DEBUG
const struct DebugStruct1 gUnknown_Debug_4245CC[] =
{
{ 1, _("NUMBER1") },
{ 2, _("ナンバー2") },
{ 3, _("ナンバー3") },
{ 4, _("ナンバー4") },
{ 5, _("ナンバー5") },
{ 6, _("ナンバー6") },
{ 7, _("ナンバー7") },
};
const u8 gUnknown_Debug_8424620[][4] =
{
{ 1, 1, 0, 0 },
{ 2, 1, 0, 0 },
{ 3, 1, 0, 0 },
};
#endif
static void InitLinkBattleRecord(struct LinkBattleRecord *record)
{
CpuFill16(0, record, sizeof(struct LinkBattleRecord));
@ -197,6 +223,66 @@ void UpdateLinkBattleRecords(int id)
gLinkPlayers[gLinkPlayerMapObjects[id].linkPlayerId].language);
}
#if DEBUG
__attribute__((naked))
void debug_sub_81257E0(void)
{
asm("\
push {r4, r5, r6, r7, lr}\n\
mov r7, r8\n\
push {r7}\n\
add sp, sp, #0xfffffffc\n\
bl InitLinkBattleRecords\n\
mov r5, #0x0\n\
ldr r6, ._62 @ gUnknown_Debug_4245CC\n\
sub r0, r6, #2\n\
mov r8, r0\n\
ldr r7, ._62 + 4 @ gLinkPlayers\n\
._61:\n\
ldr r0, ._62 + 8 @ gUnknown_Debug_8424620\n\
lsl r3, r5, #0x2\n\
add r3, r3, r0\n\
ldrb r4, [r3]\n\
sub r4, r4, #0x1\n\
lsl r0, r4, #0x1\n\
add r0, r0, r4\n\
lsl r0, r0, #0x2\n\
add r1, r0, r6\n\
add r0, r0, r8\n\
ldrh r2, [r0]\n\
ldrb r3, [r3, #0x1]\n\
ldr r0, ._62 + 12 @ gLinkPlayerMapObjects\n\
lsl r4, r4, #0x2\n\
add r4, r4, r0\n\
ldrb r4, [r4, #0x1]\n\
lsl r0, r4, #0x3\n\
sub r0, r0, r4\n\
lsl r0, r0, #0x2\n\
add r0, r0, r7\n\
ldrb r0, [r0, #0x1a]\n\
str r0, [sp]\n\
ldr r0, ._62 + 16 @ gSaveBlock1\n\
bl UpdateLinkBattleRecords_\n\
add r5, r5, #0x1\n\
cmp r5, #0x2\n\
bls ._61 @cond_branch\n\
add sp, sp, #0x4\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._63:\n\
.align 2, 0\n\
._62:\n\
.word gUnknown_Debug_4245CC+2\n\
.word gLinkPlayers\n\
.word gUnknown_Debug_8424620\n\
.word gLinkPlayerMapObjects\n\
.word gSaveBlock1+0x30b8");
}
#endif
static void PrintLinkBattleWinsLossesDraws(struct LinkBattleRecord *records)
{
ConvertIntToDecimalStringN_DigitWidth6(gStringVar1, GetGameStat(GAME_STAT_LINK_BATTLE_WINS), STR_CONV_MODE_RIGHT_ALIGN, 4);
@ -240,7 +326,8 @@ static void PrintLinkBattleRecord(struct LinkBattleRecord *record, u8 y)
}
}
void ShowLinkBattleRecords(void) {
void ShowLinkBattleRecords(void)
{
s32 i;
Menu_DrawStdWindowFrame(1, 0, 28, 18);
sub_8072BD8(gOtherText_BattleResults, 0, 1, 240);

View File

@ -22,6 +22,8 @@
#include "constants/species.h"
#include "constants/weather.h"
extern u8 gUnknown_02023A14_50;
extern const u8* gBattlescriptCurrInstr;
extern u8 gActiveBank;
extern u8 gBattleBufferB[4][0x200];
@ -1736,17 +1738,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
else
moveType = gBattleMoves[move].type;
//_080184AC
switch (caseID)
{
case ABILITYEFFECT_ON_SWITCHIN: // 0
//_08018518
if (gBankAttacker >= gNoOfAllBanks)
gBankAttacker = bank;
switch (gLastUsedAbility)
{
case 0xFF: //weather from overworld
//_08018586
switch (GetCurrentWeather())
{
case WEATHER_RAIN_LIGHT:
@ -1786,7 +1785,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_DRIZZLE:
//_08018680
if (!(gBattleWeather & WEATHER_RAIN_PERMANENT))
{
gBattleWeather = (WEATHER_RAIN_PERMANENT | WEATHER_RAIN_TEMPORARY);
@ -1796,7 +1794,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_SAND_STREAM:
//_080186B8
if (!(gBattleWeather & WEATHER_SANDSTORM_PERMANENT))
{
gBattleWeather = (WEATHER_SANDSTORM_PERMANENT | WEATHER_SANDSTORM_TEMPORARY);
@ -1806,7 +1803,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_DROUGHT:
//_080186F0
if (!(gBattleWeather & WEATHER_SUN_PERMANENT))
{
gBattleWeather = (WEATHER_SUN_PERMANENT | WEATHER_SUN_TEMPORARY);
@ -1816,7 +1812,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_INTIMIDATE:
//_08018728
if (!(gSpecialStatuses[bank].intimidatedPoke))
{
gStatuses3[bank] |= STATUS3_INTIMIDATE_POKES;
@ -1824,7 +1819,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_FORECAST:
//_0801875C
effect = CastformDataTypeChange(bank);
if (effect != 0)
{
@ -1834,7 +1828,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_TRACE:
//_080187A0
if (!(gSpecialStatuses[bank].traced))
{
gStatuses3[bank] |= STATUS3_TRACE;
@ -1843,7 +1836,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
break;
case ABILITY_CLOUD_NINE:
case ABILITY_AIR_LOCK:
//_080187DC
{
// that's a weird choice for a variable, why not use i or bank?
for (target1 = 0; target1 < gNoOfAllBanks; target1++)
@ -1862,7 +1854,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_ENDTURN: // 1
//_08018814
if (gBattleMons[bank].hp != 0)
{
gBankAttacker = bank;
@ -1922,7 +1913,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_MOVES_BLOCK: // 2
//_08018A40
if (gLastUsedAbility == ABILITY_SOUNDPROOF)
{
for (i = 0; gSoundMovesTable[i] != 0xFFFF; i++)
@ -1940,7 +1930,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_ABSORBING: // 3
//_08018AD8
if (move)
{
switch (gLastUsedAbility)
@ -2010,11 +1999,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_CONTACT: // 4
//_08018CF0
switch (gLastUsedAbility)
{
case ABILITY_COLOR_CHANGE:
//_08018DCC
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& move != MOVE_STRUGGLE
&& gBattleMoves[move].power != 0
@ -2035,7 +2022,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_ROUGH_SKIN:
//_08018E94
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
@ -2051,100 +2037,195 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITY_EFFECT_SPORE:
//_08018F54
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 10) == 0)
{
do
{
gBattleCommunication[MOVE_EFFECT_BYTE] = Random() & 3;
} while (gBattleCommunication[MOVE_EFFECT_BYTE] == 0);
if (gBattleCommunication[MOVE_EFFECT_BYTE] == 3)
gBattleCommunication[MOVE_EFFECT_BYTE] += 2;
gBattleCommunication[MOVE_EFFECT_BYTE] += 0x40;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
if (DEBUG && (gUnknown_02023A14_50 & 4))
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
{
do
{
gBattleCommunication[MOVE_EFFECT_BYTE] = Random() & 3;
} while (gBattleCommunication[MOVE_EFFECT_BYTE] == 0);
if (gBattleCommunication[MOVE_EFFECT_BYTE] == 3)
gBattleCommunication[MOVE_EFFECT_BYTE] += 2;
gBattleCommunication[MOVE_EFFECT_BYTE] += 0x40;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
else
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 10) == 0)
{
do
{
gBattleCommunication[MOVE_EFFECT_BYTE] = Random() & 3;
} while (gBattleCommunication[MOVE_EFFECT_BYTE] == 0);
if (gBattleCommunication[MOVE_EFFECT_BYTE] == 3)
gBattleCommunication[MOVE_EFFECT_BYTE] += 2;
gBattleCommunication[MOVE_EFFECT_BYTE] += 0x40;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
break;
case ABILITY_POISON_POINT:
//_0801904C
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x42;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
if (DEBUG && (gUnknown_02023A14_50 & 4))
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x42;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
else
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x42;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
break;
case ABILITY_STATIC:
//_08019128
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x45;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
if (DEBUG && (gUnknown_02023A14_50 & 4))
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x45;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
else
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x45;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
break;
case ABILITY_FLAME_BODY:
//_08019204
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x43;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
if (DEBUG && (gUnknown_02023A14_50 & 4))
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special))
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x43;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
else
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& (Random() % 3) == 0)
{
gBattleCommunication[MOVE_EFFECT_BYTE] = 0x43;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect;
gHitMarker |= HITMARKER_IGNORE_SAFEGUARD;
effect++;
}
}
break;
case ABILITY_CUTE_CHARM:
//_080192E0
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& gBattleMons[gBankTarget].hp != 0
&& (Random() % 3) == 0
&& gBattleMons[gBankAttacker].ability != ABILITY_OBLIVIOUS
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef)
&& !(gBattleMons[gBankAttacker].status2 & STATUS2_INFATUATION)
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != 0xFF
&& GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) != 0xFF)
{
gBattleMons[gBankAttacker].status2 |= (gBitTable[gBankTarget] << 0x10);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_CuteCharmActivates;
effect++;
}
if (DEBUG && (gUnknown_02023A14_50 & 4))
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& gBattleMons[gBankTarget].hp != 0
&& gBattleMons[gBankAttacker].ability != ABILITY_OBLIVIOUS
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef)
&& !(gBattleMons[gBankAttacker].status2 & STATUS2_INFATUATION)
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != 0xFF
&& GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) != 0xFF)
{
gBattleMons[gBankAttacker].status2 |= (gBitTable[gBankTarget] << 0x10);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_CuteCharmActivates;
effect++;
}
}
else
{
if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT)
&& gBattleMons[gBankAttacker].hp != 0
&& !gProtectStructs[gBankAttacker].confusionSelfDmg
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
&& (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special)
&& gBattleMons[gBankTarget].hp != 0
&& (Random() % 3) == 0
&& gBattleMons[gBankAttacker].ability != ABILITY_OBLIVIOUS
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef)
&& !(gBattleMons[gBankAttacker].status2 & STATUS2_INFATUATION)
&& GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != 0xFF
&& GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) != 0xFF)
{
gBattleMons[gBankAttacker].status2 |= (gBitTable[gBankTarget] << 0x10);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_CuteCharmActivates;
effect++;
}
}
break;
}
break;
case ABILITYEFFECT_IMMUNITY: // 5
//_08019448
{
for (bank = 0; bank < gNoOfAllBanks; bank++)
{
@ -2228,7 +2309,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_FORECAST: // 6
//_080197B4
{
for (bank = 0; bank < gNoOfAllBanks; bank++)
{
@ -2247,7 +2327,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_SYNCHRONIZE: // 7
//_08019804
if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT))
{
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
@ -2263,7 +2342,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_ATK_SYNCHRONIZE: // 8
//_08019880
if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT))
{
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
@ -2279,7 +2357,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_INTIMIDATE1: // 9
//_080198FC
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ABILITY_INTIMIDATE && gStatuses3[i] & STATUS3_INTIMIDATE_POKES)
@ -2294,7 +2371,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_TRACE: // 11
//_08019940
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
@ -2308,7 +2384,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0
&& gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
{
//_080199AE
gActiveBank = GetBankByIdentity(((Random() & 1) * 2) | side);
gBattleMons[i].ability = gBattleMons[gActiveBank].ability;
gLastUsedAbility = gBattleMons[gActiveBank].ability;
@ -2316,7 +2391,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
else if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0)
{
//_08019A34
gActiveBank = target1;
gBattleMons[i].ability = gBattleMons[gActiveBank].ability;
gLastUsedAbility = gBattleMons[gActiveBank].ability;
@ -2324,7 +2398,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
else if (gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
{
//_08019A78
gActiveBank = target2;
gBattleMons[i].ability = gBattleMons[gActiveBank].ability;
gLastUsedAbility = gBattleMons[gActiveBank].ability;
@ -2332,7 +2405,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
}
else
//_08019ABC
{
gActiveBank = target1;
if (gBattleMons[target1].ability && gBattleMons[target1].hp)
@ -2364,7 +2436,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_INTIMIDATE2: // 10
//_08019B1C
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ABILITY_INTIMIDATE && (gStatuses3[i] & STATUS3_INTIMIDATE_POKES))
@ -2380,7 +2451,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_CHECK_OTHER_SIDE: // 12
//_08019B60
side = GetBankSide(bank);
for (i = 0; i < gNoOfAllBanks; i++)
{
@ -2392,7 +2462,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_CHECK_BANK_SIDE: // 13
//_08019BBC
side = GetBankSide(bank);
for (i = 0; i < gNoOfAllBanks; i++)
{
@ -2404,7 +2473,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_FIELD_SPORT: // 14
//_08019C18
switch (gLastUsedAbility)
{
case 0xFD:
@ -2434,7 +2502,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_CHECK_ON_FIELD: // 19
//_08019CD4
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ability && gBattleMons[i].hp != 0)
@ -2445,7 +2512,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK: // 15
//_08019D18
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ability && i != bank)
@ -2456,7 +2522,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_COUNT_OTHER_SIZE: // 16
//_08019D5C
side = GetBankSide(bank);
for (i = 0; i < gNoOfAllBanks; i++)
{
@ -2468,7 +2533,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_COUNT_BANK_SIDE: // 17
//_08019DB8
side = GetBankSide(bank);
for (i = 0; i < gNoOfAllBanks; i++)
{
@ -2480,7 +2544,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
case ABILITYEFFECT_COUNT_ON_FIELD: // 18
//_08019F44
for (i = 0; i < gNoOfAllBanks; i++)
{
if (gBattleMons[i].ability == ability && i != bank)
@ -2491,7 +2554,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
}
break;
}
//_08019F76
if (effect && caseID < 0xC && gLastUsedAbility != 0xFF)
RecordAbilityBattle(bank, gLastUsedAbility);
}
@ -3385,17 +3447,25 @@ u8 IsMonDisobedient(void)
if (gBattleTypeFlags & BATTLE_TYPE_LINK
|| GetBankSide(gBankAttacker) == 1
|| !IsOtherTrainer(gBattleMons[gBankAttacker].otId, gBattleMons[gBankAttacker].otName)
|| FlagGet(FLAG_BADGE08_GET))
return 0;
|| !IsOtherTrainer(gBattleMons[gBankAttacker].otId, gBattleMons[gBankAttacker].otName))
return 0;
obedienceLevel = 10;
if (FlagGet(FLAG_BADGE02_GET))
obedienceLevel = 30;
if (FlagGet(FLAG_BADGE04_GET))
obedienceLevel = 50;
if (FlagGet(FLAG_BADGE06_GET))
obedienceLevel = 70;
if (DEBUG && (gUnknown_02023A14_50 & 0x40))
{
obedienceLevel = 10;
}
else
{
if (FlagGet(FLAG_BADGE08_GET))
return 0;
obedienceLevel = 10;
if (FlagGet(FLAG_BADGE02_GET))
obedienceLevel = 30;
if (FlagGet(FLAG_BADGE04_GET))
obedienceLevel = 50;
if (FlagGet(FLAG_BADGE06_GET))
obedienceLevel = 70;
}
if (gBattleMons[gBankAttacker].level <= obedienceLevel)
return 0;

View File

@ -33,6 +33,8 @@
#include "util.h"
#include "contest_ai.h"
extern u8 gUnknown_020297ED;
extern u8 AreMovesContestCombo(u16, u16); // I don't think this is a bool
extern void sub_80C8A38(u8);
extern void sub_80C8AD0(u8);
@ -238,6 +240,7 @@ void sub_80B0BC4(u8, bool8);
void sub_80B0C5C(struct Sprite *);
void sub_80B0CB0(struct Sprite *);
void sub_80B0CDC(u8, int);
void unref_sub_80B0CF4(void);
void sub_80B0D7C(void);
void sub_80B1118(void);
void sub_80B114C(u8);
@ -613,6 +616,10 @@ void sub_80AB9A0(u8 taskId)
void ContestMainCallback2(void)
{
#if DEBUG
if (gUnknown_020297ED == 1 && gMain.newKeys == 4)
unref_sub_80B0CF4();
#endif
AnimateSprites();
RunTasks();
BuildOamBuffer();
@ -732,6 +739,8 @@ void sub_80ABCDC(u8 taskId)
gTasks[taskId].func = sub_80ABEA0;
}
void debug_sub_80B9EBC(u8);
// Handle move selection input
void sub_80ABEA0(u8 taskId)
{
@ -804,10 +813,193 @@ void sub_80ABEA0(u8 taskId)
if (numMoves > 1)
PlaySE(SE_SELECT);
break;
#if DEBUG
case START_BUTTON:
if (gUnknown_020297ED == 1 && !(gIsLinkContest & 1))
{
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = gContestMons[gContestPlayerMonIndex].moves[0];
gTasks[taskId].func = debug_sub_80B9EBC;
}
break;
#endif
}
}
}
#if DEBUG
void debug_sub_80BA054(u8);
void debug_sub_80B9EBC(u8 taskId)
{
u8 text[100];
switch (gTasks[taskId].data[0])
{
case 0:
Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA340[0][0],
gUnknown_083CA340[0][1],
gUnknown_083CA340[0][2],
gUnknown_083CA340[0][3]);
Text_InitWindowAndPrintText(
&gUnknown_03004210,
gMoveNames[gTasks[taskId].data[1]],
776,
gUnknown_083CA340[0][0],
gUnknown_083CA340[0][1]);
ConvertIntToDecimalStringN(text, gTasks[taskId].data[1], 2, 3);
Text_InitWindowAndPrintText(
&gUnknown_03004210,
text,
796,
gUnknown_083CA340[1][0],
gUnknown_083CA340[1][1]);
sub_80AED58();
sub_80AEBEC(gTasks[taskId].data[1]);
gTasks[taskId].data[0]++;
break;
case 1:
switch (gMain.newAndRepeatedKeys)
{
case 0x20:
gTasks[taskId].data[1] -= 1;
if (gTasks[taskId].data[1] < 1)
gTasks[taskId].data[1] = 354;
gTasks[taskId].data[0]--;
break;
case 0x200:
gTasks[taskId].data[1] -= 10;
if (gTasks[taskId].data[1] < 1)
gTasks[taskId].data[1] = 354;
gTasks[taskId].data[0]--;
break;
case 0x10:
gTasks[taskId].data[1] += 1;
if (gTasks[taskId].data[1] > 354)
gTasks[taskId].data[1] = 1;
gTasks[taskId].data[0]--;
break;
case 0x100:
gTasks[taskId].data[1] += 10;
if (gTasks[taskId].data[1] > 354)
gTasks[taskId].data[1] = 1;
gTasks[taskId].data[0]--;
break;
case 4:
case 8:
gBattle_BG0_Y = 0;
gBattle_BG2_Y = 0;
sub_80B1BDC();
gTasks[taskId].data[0] = 0;
gTasks[taskId].func = debug_sub_80BA054;
break;
case 2:
gBattle_BG0_Y = DISPLAY_HEIGHT;
gBattle_BG2_Y = DISPLAY_HEIGHT;
gContestMons[gContestPlayerMonIndex].moves[0] = gTasks[taskId].data[1];
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = 0;
gTasks[taskId].func = sub_80ABCDC;
break;
}
break;
}
}
void debug_sub_80BA054(u8 taskId)
{
s32 i;
u8 r6;
switch (gTasks[taskId].data[0])
{
case 0:
for (i = 0; i < 4; i++)
gBattleMonForms[i] = 0;
memset(&shared19348, 0, sizeof(shared19348));
sub_80B28F0(gContestPlayerMonIndex);
r6 = sub_80AE9FC(
gContestMons[gContestPlayerMonIndex].species,
gContestMons[gContestPlayerMonIndex].otId,
gContestMons[gContestPlayerMonIndex].personality);
gSprites[r6].pos2.x = 120;
gSprites[r6].callback = sub_80AD8FC;
gTasks[taskId].data[2] = r6;
gObjectBankIDs[gBankAttacker] = r6;
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[0]++;
sContest.unk1925E = 0;
break;
case 1:
r6 = gTasks[taskId].data[2];
if (gSprites[r6].callback == SpriteCallbackDummy)
{
sContestantStatus[gContestPlayerMonIndex].currMove = gTasks[taskId].data[1];
sub_80B2790(gContestPlayerMonIndex);
sub_80B28F0(gContestPlayerMonIndex);
SelectContestMoveBankTarget(gTasks[taskId].data[1]);
DoMoveAnim(gTasks[taskId].data[1]);
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[0]++;
}
break;
case 2:
gAnimScriptCallback();
if (!gAnimScriptActive)
{
sub_80B28CC(gContestPlayerMonIndex);
if (sContest.unk1925E != 0)
{
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[0] = 20;
}
else
{
gTasks[taskId].data[0]++;
}
}
break;
case 3:
gTasks[taskId].data[3]++;
if (gTasks[taskId].data[3] == 21)
{
r6 = gTasks[taskId].data[2];
gSprites[r6].callback = sub_80AD92C;
sub_80B1B14();
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[0]++;
}
break;
case 4:
r6 = gTasks[taskId].data[2];
if (gSprites[r6].invisible)
{
FreeSpriteOamMatrix(&gSprites[r6]);
DestroySprite(&gSprites[r6]);
gTasks[taskId].data[0] = 0;
gTasks[taskId].func = debug_sub_80B9EBC;
gBattle_BG0_Y = DISPLAY_HEIGHT;
gBattle_BG2_Y = DISPLAY_HEIGHT;
}
break;
case 20:
if (gTasks[taskId].data[10]++ > 30)
{
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[0] = 1;
}
break;
}
}
#endif
void sub_80AC0AC(s8 a)
{
MenuCursor_SetPos814A880(4, 88 + a * 16);

View File

@ -6337,7 +6337,8 @@ static const u8 DexDescription_Deoxys_2[] = _(
"dieses POKéMON ist sein Gehirn.");
#endif
static const struct PokedexEntry gPokedexEntries[] = {
const struct PokedexEntry gPokedexEntries[] =
{
{
// Dummy
.categoryName = _("UNBEKANNT"),

View File

@ -5389,7 +5389,7 @@ static const u8 DexDescription_Deoxys_2[] = _(
"chest appears to be its brain.");
#endif
static const struct PokedexEntry gPokedexEntries[] =
const struct PokedexEntry gPokedexEntries[] =
{
{ //Dummy
.categoryName = _("UNKNOWN"),

View File

@ -0,0 +1,183 @@
#if DEBUG
#include "global.h"
#include "field_effect.h"
#include "field_control_avatar.h"
#include "field_player_avatar.h"
#include "main.h"
#include "menu.h"
#include "overworld.h"
#include "palette.h"
#include "random.h"
#include "region_map.h"
#include "script.h"
#include "slot_machine.h"
#include "trainer_card.h"
extern u8 (*gMenuCallback)(void);
void InitKagayaDebugMenu_B(void);
u8 debug_sub_80B061C(void);
u8 KagayaDebugMenu_TrainerCard(void);
u8 debug_sub_80B068C(void);
u8 KagayaDebugMenu_CardToExchange(void);
u8 debug_sub_80B06E0(void);
u8 KagayaDebugMenu_SlotMachine(void);
u8 Kagaya_80B0734(void);
u8 debug_sub_80B07DC(void);
const u8 Str_83EBB34[] = _("Trainers card");
const u8 Str_83EBB43[] = _("Card to exchange");
const u8 Str_83EBB54[] = _("Slot machine");
const struct MenuAction _83EBB64[] =
{
{ Str_83EBB34, KagayaDebugMenu_TrainerCard },
{ Str_83EBB43, KagayaDebugMenu_CardToExchange },
{ Str_83EBB54, KagayaDebugMenu_SlotMachine },
};
u8 InitKagayaDebugMenu_A(void)
{
InitKagayaDebugMenu_B();
return 0;
}
void InitKagayaDebugMenu_B(void)
{
Menu_EraseScreen();
Menu_DrawStdWindowFrame(0, 0, 14, 7);
Menu_PrintItems(2, 1, 3, _83EBB64);
InitMenu(0, 1, 1, 3, 0, 13);
gMenuCallback = debug_sub_80B061C;
}
u8 debug_sub_80B061C(void)
{
s8 input = Menu_ProcessInput();
if (input == -2)
{
return 0;
}
else if (input == -1)
{
CloseMenu();
return 1;
}
else
{
gMenuCallback = _83EBB64[input].func;
return 0;
}
}
u8 KagayaDebugMenu_TrainerCard(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
gMenuCallback = debug_sub_80B068C;
return 0;
}
u8 debug_sub_80B068C(void)
{
if (!UpdatePaletteFade())
{
debug_sub_80A0710(sub_805469C);
CloseMenu();
ScriptContext2_Enable();
return 1;
}
return 0;
}
u8 KagayaDebugMenu_CardToExchange(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
gMenuCallback = debug_sub_80B06E0;
return 0;
}
u8 debug_sub_80B06E0(void)
{
if (!UpdatePaletteFade())
{
debug_sub_80A073C(sub_805469C);
CloseMenu();
ScriptContext2_Enable();
return 1;
}
return 0;
}
u8 KagayaDebugMenu_SlotMachine(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
gMenuCallback = Kagaya_80B0734;
return 0;
}
u8 Kagaya_80B0734(void)
{
if (!UpdatePaletteFade())
{
debug_sub_811609C(Random() % 6, sub_805469C);
CloseMenu();
ScriptContext2_Enable();
return 1;
}
return 0;
}
u8 debug_sub_80B0770(void)
{
if (!(gPlayerAvatar.flags & 8))
{
CloseMenu();
if (IsPlayerFacingSurfableFishableWater())
{
gFieldEffectArguments[0] = 0;
FieldEffectStart(9);
}
}
else
{
CloseMenu();
}
return 1;
}
u8 debug_sub_80B07B0(void)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
gMenuCallback = debug_sub_80B07DC;
return 0;
}
u8 debug_sub_80B07DC(void)
{
if (!UpdatePaletteFade())
{
CloseMenu();
SetMainCallback2(CB2_InitFlyRegionMap);
return 1;
}
return 0;
}
u8 debug_sub_80B0800(void)
{
u8 r2;
CloseMenu();
r2 = sub_8068F18();
if (r2 != 0)
{
gFieldEffectArguments[0] = 0;
gFieldEffectArguments[1] = r2 - 1;
FieldEffectStart(0x2C);
}
return 1;
}
#endif // DEBUG

View File

@ -0,0 +1,189 @@
#if DEBUG
#include "global.h"
#include "menu.h"
EWRAM_DATA u8 _nakamuraData0 = 0;
EWRAM_DATA u8 _nakamuraData1 = 0;
EWRAM_DATA u8 _nakamuraData2 = 0;
EWRAM_DATA u8 _nakamuraData3 = 0;
EWRAM_DATA u8 _nakamuraData4 = 0;
EWRAM_DATA u8 _nakamuraData5 = 0;
EWRAM_DATA u16 _nakamuraData6 = 0;
EWRAM_DATA u16 _nakamuraData8 = 0;
EWRAM_DATA u16 _nakamuraDataA = 0;
EWRAM_DATA u16 _nakamuraDataC = 0;
__attribute__((unused)) static u8 _nakamuraStatic0[0x18];
__attribute__((unused)) static u8 _nakamuraStatic18;
__attribute__((unused)) static u8 gDebugFiller3000814[4];
asm(".global _nakamuraStatic0");
asm(".global _nakamuraStatic18");
u8 debug_sub_815FC54();
u8 debug_sub_815F2B4();
u8 debug_sub_815FC94();
u8 debug_sub_815FB1C();
u8 debug_sub_815F2F4();
u8 debug_sub_815F62C();
u8 debug_sub_815FBE8();
u8 debug_sub_815FE1C();
u8 debug_sub_8160D98();
const u8 Str_843E36C[] = _("Berries");
const u8 Str_843E374[] = _("Goods");
const u8 Str_843E37A[] = _("{PKMN} list");
const u8 Str_843E382[] = _("トラップ");
const u8 Str_843E387[] = _("Move your base");
const u8 Str_843E396[] = _("Moving {PKMN}");
const u8 Str_843E3A0[] = _("Fishing points");
const u8 Str_843E3AF[] = _("Set {POKEBLOCK}");
const u8 Str_843E3B9[] = _("Make bases(to max)");
const u8 Str_843E3CC[] = _("Base location");
const struct MenuAction _843E3DC[] = {
{ Str_843E36C, debug_sub_815FC54 },
{ Str_843E37A, debug_sub_815F2B4 },
{ Str_843E374, debug_sub_815FC94 },
{ Str_843E387, debug_sub_815FB1C },
{ Str_843E3B9, debug_sub_815F2F4 },
{ Str_843E3CC, debug_sub_815F62C },
{ Str_843E396, debug_sub_815FBE8 },
{ Str_843E3A0, debug_sub_815FE1C },
{ Str_843E3AF, debug_sub_8160D98 },
};
const u8 _843E424[][4] = {
{ 1, 118, 47, 14 },
{ 2, 125, 53, 10 },
{ 3, 113, 49, 8 },
{ 0xB, 118, 67, 6 },
{ 0xC, 121, 40, 11 },
{ 0xD, 111, 35, 1 },
{ 0x15, 115, 20, 53 },
{ 0x16, 121, 18, 13 },
{ 0x17, 119, 26, 81 },
{ 0x1F, 127, 59, 67 },
{ 0x20, 125, 55, 11 },
{ 0x21, 111, 27, 27 },
{ 0x29, 114, 9, 47 },
{ 0x2A, 115, 32, 39 },
{ 0x2B, 115, 23, 8 },
{ 0x33, 114, 30, 51 },
{ 0x34, 115, 26, 15 },
{ 0x35, 115, 32, 46 },
{ 0x3D, 114, 11, 62 },
{ 0x3E, 115, 21, 18 },
{ 0x3F, 115, 25, 24 },
{ 0x47, 114, 19, 70 },
{ 0x48, 115, 32, 6 },
{ 0x49, 114, 32, 57 },
{ 0x51, 116, 71, 4 },
{ 0x52, 123, 47, 3 },
{ 0x53, 123, 57, 5 },
{ 0x5B, 116, 79, 11 },
{ 0x5C, 123, 49, 3 },
{ 0x5D, 120, 18, 12 },
{ 0x65, 120, 28, 62 },
{ 0x66, 116, 56, 6 },
{ 0x67, 119, 16, 81 },
{ 0x6F, 120, 30, 62 },
{ 0x70, 116, 55, 15 },
{ 0x71, 119, 16, 28 },
{ 0x79, 111, 33, 34 },
{ 0x7A, 118, 29, 5 },
{ 0x7B, 127, 45, 24 },
{ 0x83, 111, 24, 36 },
{ 0x84, 125, 7, 25 },
{ 0x85, 115, 8, 30 },
{ 0x8D, 111, 34, 50 },
{ 0x8E, 127, 59, 72 },
{ 0x8F, 127, 61, 21 },
{ 0x97, 127, 67, 63 },
{ 0x98, 125, 24, 32 },
{ 0x99, 111, 35, 31 },
{ 0xA1, 111, 13, 19 },
{ 0xA2, 121, 43, 7 },
{ 0xA3, 118, 47, 5 },
{ 0xA4, 111, 14, 19 },
{ 0xAB, 118, 46, 5 },
{ 0xAC, 121, 42, 7 },
{ 0xAD, 119, 19, 76 },
{ 0xAE, 115, 7, 20 },
{ 0xB5, 110, 16, 25 },
{ 0xB6, 114, 11, 27 },
{ 0xB7, 115, 8, 20 },
{ 0xBF, 110, 17, 25 },
{ 0xC0, 114, 12, 27 },
{ 0xC1, 119, 18, 76 },
{ 0xC9, 119, 5, 2 },
{ 0xCA, 119, 4, 89 },
{ 0xCB, 120, 38, 54 },
{ 0xCC, 120, 5, 76 },
{ 0xD3, 119, 5, 15 },
{ 0xD4, 119, 7, 101 },
{ 0xD5, 120, 31, 23 },
{ 0xDD, 119, 34, 24 },
{ 0xDE, 120, 26, 10 },
{ 0xDF, 119, 4, 15 },
{ 0xE7, 119, 31, 73 },
{ 0xE8, 120, 29, 85 },
{ 0xE9, 119, 6, 2 },
};
const u8 Str_843E550[] = _("R");
const u8 Str_843E552[] = _("X");
const u8 Str_843E554[] = _("Y");
const u8 Str_843E556[] = _(
"♂1\n"
"♂2\n"
"♂3\n"
"♂4\n"
"♂5\n"
"♀1\n"
"♀2\n"
"♀3\n"
"♀4\n"
"♀5");
const u8 Str_843E574[] = _("");
const u8 Str_843E576[] = _("");
const u8 Str_843E578[] = _("");
const u8 Str_843E57A[] = _("A");
const u8 Str_843E57C[] = _("a");
const u8 Str_843E57E[] = _("0");
const u8 Str_843E580[] = _(
"ADD\n"
"DEL\n"
"EXIT");
const u8 Str_843E58D[] = _(
"Fishing location R119\n"
" Y1\n"
" Y2\n"
" Y3\n"
"Encounter location\n"
"\n"
"\n"
"front of you");
const u8 _843E5D1[] = {0x0F, 0x16, 0x19};
const u8 Str_843E5D4[] = _(
"Aボタン {ESCAPE}\p"
"  Bボタン \n"
"START けってい");
const u8 Str_843E5F0[] = _("");
const u8 Str_843E5F2[] = _("HP どりょくち");
const u8 Str_843E5FB[] = _("こうげき どりょくち");
const u8 Str_843E606[] = _("ぼうぎょ どりょくち");
const u8 Str_843E611[] = _("すばやさ どりょくち");
const u8 Str_843E61C[] = _("とくこう どりょくち");
const u8 Str_843E627[] = _("とくぼう どりょくち");
const u8 Str_843E632[] = _("なつきど");
const u8 Str_843E637[] = _("どりょくち ごうけい");
const u8 Str_843E642[] = _("ここから");
const u8 Str_843E647[] = _("ここまで");
const u8 Str_843E64C[] = _("かいすう");
const u8 Str_843E651[] = _("けっか");
const u8 Str_843E655[] = _("かい");
const u8 Str_843E658[] = _("0");
const u8 Str_843E65A[] = _("はんい");
#endif // DEBUG

View File

@ -0,0 +1,12 @@
#if DEBUG
#include "global.h"
__attribute__((unused)) static u8 gDebug_03000724;
__attribute__((unused)) static u8 gDebug_03000725;
__attribute__((unused)) static u8 gDebug_03000726;
asm(".global gDebug_03000724");
asm(".global gDebug_03000725");
asm(".global gDebug_03000726");
#endif

6051
src/debug/start_menu_debug.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,6 @@
#if DEBUG
#include "global.h"
EWRAM_DATA u8 unk_2030224[4] = { 0 };
#endif

View File

@ -0,0 +1,20 @@
#if DEBUG
#include "global.h"
// These should be static, uninitialized once it gets decompiled.
#define BSS_DATA __attribute__((section(".bss")))
BSS_DATA u8 gDebug_03000700[4] = {0};
BSS_DATA u8 gDebug_03000704[4] = {0};
BSS_DATA u8 gDebug_03000708[4] = {0};
BSS_DATA u8 gDebug_0300070C = 0;
BSS_DATA u8 gDebug_0300070D = 0;
BSS_DATA u8 gDebug_0300070E = 0;
BSS_DATA u8 gDebug_0300070F = 0;
BSS_DATA u8 gDebug_03000710[13] = {0};
BSS_DATA u8 gDebug_0300071D = 0;
BSS_DATA u8 gDebug_0300071E = 0;
BSS_DATA u8 gDebug_0300071F = 0;
BSS_DATA u8 gDebug_03000720 = 0;
BSS_DATA u8 gDebug_03000721 = 0;
#endif

View File

@ -0,0 +1,11 @@
#if DEBUG
#include "global.h"
EWRAM_DATA u8 gUnknown_Debug_20389EC[0x20] = { 0 };
EWRAM_DATA u8 gUnknown_Debug_2038A0C[0x10] = { 0 };
EWRAM_DATA u8 gUnknown_Debug_2038A1C[4] = { 0 };
EWRAM_DATA u8 gUnknown_Debug_2038A20[4] = { 0 };
u8 byte_3005E30[0x20];
#endif

View File

@ -23,6 +23,7 @@
#include "text.h"
#include "trainer_card.h"
extern u8 unk_2030220;
extern u16 gSpecialVar_Result;
extern struct TrainerCard gTrainerCards[4];
extern u8 gUnknown_03004860;
@ -41,7 +42,7 @@ extern struct
u8 field1;
} gUnknown_020297D8;
static void sub_8082F20(u8 taskId);
/*static*/ void sub_8082F20(u8 taskId);
static void sub_8082F68(u8 taskId);
static void sub_8082FEC(u8 taskId);
static void sub_808303C(u8 taskId);
@ -95,6 +96,382 @@ const u8 *const gTrainerCardColorNames[] =
TrainerCardColorName_Gold,
};
#if DEBUG
__attribute__((naked))
int debug_sub_808A4D0()
{
asm("\
push {lr}\n\
add r1, r0, #0\n\
ldr r0, ._3 @ sub_8082F68\n\
cmp r1, r0\n\
bne ._1 @cond_branch\n\
mov r0, #0x1\n\
b ._30\n\
._4:\n\
.align 2, 0\n\
._3:\n\
.word sub_8082F68+1\n\
._1:\n\
ldr r0, ._7 @ sub_8082FEC\n\
cmp r1, r0\n\
bne ._5 @cond_branch\n\
mov r0, #0x11\n\
b ._30\n\
._8:\n\
.align 2, 0\n\
._7:\n\
.word sub_8082FEC+1\n\
._5:\n\
ldr r0, ._11 @ sub_808303C\n\
cmp r1, r0\n\
bne ._9 @cond_branch\n\
mov r0, #0x12\n\
b ._30\n\
._12:\n\
.align 2, 0\n\
._11:\n\
.word sub_808303C+1\n\
._9:\n\
ldr r0, ._15 @ sub_8083188\n\
cmp r1, r0\n\
bne ._13 @cond_branch\n\
mov r0, #0x13\n\
b ._30\n\
._16:\n\
.align 2, 0\n\
._15:\n\
.word sub_8083188+1\n\
._13:\n\
ldr r0, ._19 @ sub_80830E4\n\
cmp r1, r0\n\
bne ._17 @cond_branch\n\
mov r0, #0x14\n\
b ._30\n\
._20:\n\
.align 2, 0\n\
._19:\n\
.word sub_80830E4+1\n\
._17:\n\
ldr r0, ._23 @ sub_80831F8\n\
cmp r1, r0\n\
bne ._21 @cond_branch\n\
mov r0, #0x21\n\
b ._30\n\
._24:\n\
.align 2, 0\n\
._23:\n\
.word sub_80831F8+1\n\
._21:\n\
ldr r0, ._27 @ sub_8083314\n\
cmp r1, r0\n\
bne ._25 @cond_branch\n\
mov r0, #0x2\n\
b ._30\n\
._28:\n\
.align 2, 0\n\
._27:\n\
.word sub_8083314+1\n\
._25:\n\
ldr r0, ._31 @ sub_80833C4\n\
cmp r1, r0\n\
beq ._29 @cond_branch\n\
mov r0, #0x0\n\
b ._30\n\
._32:\n\
.align 2, 0\n\
._31:\n\
.word sub_80833C4+1\n\
._29:\n\
mov r0, #0x3\n\
._30:\n\
pop {r1}\n\
bx r1");
}
__attribute__((naked))
void debug_sub_808A55C()
{
asm("\
push {r4, r5, r6, r7, lr}\n\
mov r7, r8\n\
push {r7}\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
ldr r2, ._37 @ gTasks\n\
lsl r0, r7, #0x2\n\
add r0, r0, r7\n\
lsl r0, r0, #0x3\n\
add r4, r0, r2\n\
mov r0, #0x8\n\
ldsh r1, [r4, r0]\n\
lsl r0, r1, #0x2\n\
add r0, r0, r1\n\
lsl r0, r0, #0x3\n\
add r0, r0, r2\n\
ldrb r0, [r0, #0x4]\n\
cmp r0, #0\n\
bne ._33 @cond_branch\n\
mov r1, #0xa\n\
ldsh r0, [r4, r1]\n\
cmp r0, #0x5\n\
bne ._34 @cond_branch\n\
add r0, r7, #0\n\
bl DestroyTask\n\
._34:\n\
ldrh r0, [r4, #0xa]\n\
add r0, r0, #0x1\n\
strh r0, [r4, #0xa]\n\
._33:\n\
ldr r0, ._37 + 4 @ gShouldAdvanceLinkState\n\
ldrb r0, [r0]\n\
mov r1, #0x2\n\
mov r2, #0x0\n\
mov r3, #0x2\n\
bl PrintHex\n\
ldr r0, ._37 + 8 @ gBlockSendBuffer\n\
ldrb r0, [r0]\n\
mov r1, #0x16\n\
mov r2, #0x5\n\
mov r3, #0x4\n\
bl PrintHex\n\
mov r4, #0x0\n\
lsl r3, r7, #0x2\n\
mov r8, r3\n\
mov r6, #0xc0\n\
lsl r6, r6, #0x13\n\
mov r5, #0xa0\n\
lsl r5, r5, #0x13\n\
._35:\n\
ldr r0, ._37 + 12 @ gLinkPlayerPending\n\
add r0, r4, r0\n\
ldrb r0, [r0]\n\
lsr r1, r5, #0x18\n\
mov r2, #0x0\n\
mov r3, #0x1\n\
bl PrintHex\n\
ldr r1, ._37 + 16 @ gBlockRecvBuffer\n\
lsl r0, r4, #0x8\n\
add r0, r0, r1\n\
ldrh r0, [r0]\n\
lsr r2, r6, #0x18\n\
mov r1, #0x16\n\
mov r3, #0x4\n\
bl PrintHex\n\
mov r0, #0x80\n\
lsl r0, r0, #0x11\n\
add r6, r6, r0\n\
mov r1, #0x80\n\
lsl r1, r1, #0x12\n\
add r5, r5, r1\n\
add r4, r4, #0x1\n\
cmp r4, #0x3\n\
ble ._35 @cond_branch\n\
ldr r4, ._37 + 20 @ gLinkStatus\n\
ldr r0, [r4]\n\
mov r1, #0xf\n\
mov r2, #0x0\n\
mov r3, #0x8\n\
bl PrintHex\n\
ldr r0, ._37 + 24 @ gLink\n\
ldrb r0, [r0, #0x1]\n\
mov r1, #0x2\n\
mov r2, #0xa\n\
mov r3, #0x2\n\
bl PrintHex\n\
bl GetMultiplayerId\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0x7\n\
mov r2, #0xc\n\
mov r3, #0x2\n\
bl PrintHex\n\
bl GetBlockReceivedStatus\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0x7\n\
mov r2, #0xa\n\
mov r3, #0x2\n\
bl PrintHex\n\
ldr r0, ._37 + 28 @ gReceivedRemoteLinkPlayers\n\
ldrb r0, [r0]\n\
mov r1, #0x2\n\
mov r2, #0xc\n\
mov r3, #0x1\n\
bl PrintHex\n\
ldr r0, ._37 + 32 @ gSpecialVar_Result\n\
ldrh r0, [r0]\n\
mov r1, #0xb\n\
mov r2, #0x8\n\
mov r3, #0x2\n\
bl PrintHex\n\
ldr r0, [r4]\n\
mov r1, #0x1c\n\
and r0, r0, r1\n\
lsr r0, r0, #0x2\n\
mov r1, #0xb\n\
mov r2, #0xa\n\
mov r3, #0x2\n\
bl PrintHex\n\
bl IsLinkConnectionEstablished\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0xb\n\
mov r2, #0xc\n\
mov r3, #0x1\n\
bl PrintHex\n\
bl IsLinkTaskFinished\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0xf\n\
mov r2, #0xa\n\
mov r3, #0x1\n\
bl PrintHex\n\
ldr r2, ._37 @ gTasks\n\
mov r3, r8\n\
add r0, r3, r7\n\
lsl r0, r0, #0x3\n\
add r0, r0, r2\n\
mov r3, #0x8\n\
ldsh r1, [r0, r3]\n\
lsl r0, r1, #0x2\n\
add r0, r0, r1\n\
lsl r0, r0, #0x3\n\
add r0, r0, r2\n\
ldr r0, [r0]\n\
bl debug_sub_808A4D0\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0xf\n\
mov r2, #0xc\n\
mov r3, #0x2\n\
bl PrintHex\n\
ldr r0, ._37 + 36 @ gLinkCallback\n\
ldr r0, [r0]\n\
mov r1, #0x2\n\
mov r2, #0xd\n\
mov r3, #0x8\n\
bl PrintHex\n\
bl HasLinkErrorOccurred\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0x2\n\
mov r2, #0x2\n\
mov r3, #0x1\n\
bl PrintHex\n\
ldr r0, ._37 + 40 @ gLinkPlayers\n\
mov r6, #0x80\n\
lsl r6, r6, #0x12\n\
add r5, r0, #0\n\
add r5, r5, #0x14\n\
mov r4, #0x3\n\
._36:\n\
ldr r0, [r5]\n\
lsr r1, r6, #0x18\n\
mov r2, #0x3\n\
mov r3, #0x4\n\
bl PrintHex\n\
mov r0, #0xc0\n\
lsl r0, r0, #0x13\n\
add r6, r6, r0\n\
add r5, r5, #0x1c\n\
sub r4, r4, #0x1\n\
cmp r4, #0\n\
bge ._36 @cond_branch\n\
ldr r0, ._37 + 44 @ 0x4000128\n\
ldrh r0, [r0]\n\
mov r1, #0x2\n\
mov r2, #0x6\n\
mov r3, #0x4\n\
bl PrintHex\n\
bl debug_sub_808B850\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
mov r1, #0x19\n\
mov r2, #0x3\n\
mov r3, #0x1\n\
bl PrintHex\n\
pop {r3}\n\
mov r8, r3\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._38:\n\
.align 2, 0\n\
._37:\n\
.word gTasks\n\
.word gShouldAdvanceLinkState\n\
.word gBlockSendBuffer\n\
.word gLinkPlayerPending\n\
.word gBlockRecvBuffer\n\
.word gLinkStatus\n\
.word gLink\n\
.word gReceivedRemoteLinkPlayers\n\
.word gSpecialVar_Result\n\
.word gLinkCallback\n\
.word gLinkPlayers\n\
.word 0x4000128");
}
#endif
#if DEBUG
__attribute__((naked))
static void sub_8082CD4(u8 arg0, u8 arg1)
{
asm("\
push {r4, r5, r6, r7, lr}\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
lsl r1, r1, #0x18\n\
lsr r6, r1, #0x18\n\
mov r0, #0xc\n\
mov r1, #0x0\n\
mov r2, #0x1f\n\
mov r3, #0x2\n\
bl InitLinkTestBG_Unused\n\
ldr r4, ._40 @ sub_8082F20\n\
add r0, r4, #0\n\
bl FindTaskIdByFunc\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
cmp r0, #0xff\n\
bne ._39 @cond_branch\n\
add r0, r4, #0\n\
mov r1, #0x50\n\
bl CreateTask\n\
add r4, r0, #0\n\
lsl r4, r4, #0x18\n\
lsr r4, r4, #0x18\n\
ldr r5, ._40 + 4 @ gTasks\n\
lsl r0, r4, #0x2\n\
add r0, r0, r4\n\
lsl r0, r0, #0x3\n\
add r0, r0, r5\n\
strh r7, [r0, #0xa]\n\
strh r6, [r0, #0xc]\n\
ldr r0, ._40 + 8 @ debug_sub_808A55C\n\
mov r1, #0x50\n\
bl CreateTask\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
lsl r1, r0, #0x2\n\
add r1, r1, r0\n\
lsl r1, r1, #0x3\n\
add r1, r1, r5\n\
strh r4, [r1, #0x8]\n\
._39:\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._41:\n\
.align 2, 0\n\
._40:\n\
.word sub_8082F20+1\n\
.word gTasks\n\
.word debug_sub_808A55C+1");
}
#else
static void sub_8082CD4(u8 arg0, u8 arg1)
{
if (FindTaskIdByFunc(sub_8082F20) == 0xFF)
@ -105,6 +482,7 @@ static void sub_8082CD4(u8 arg0, u8 arg1)
gTasks[taskId].data[2] = arg1;
}
}
#endif
static void sub_8082D18(u32 value)
{
@ -207,7 +585,7 @@ void unref_sub_8082EEC(u8 taskId)
}
}
static void sub_8082F20(u8 taskId)
/*static*/ void sub_8082F20(u8 taskId)
{
s16 *data = gTasks[taskId].data;
@ -360,6 +738,10 @@ void sub_80831F8(u8 taskId)
|| sub_8082DF4(taskId) == TRUE)
return;
#if DEBUG
sub_8082D60(taskId, GetLinkPlayerCount_2());
#endif
gSpecialVar_Result = sub_8082D9C(local1, local2);
if (gSpecialVar_Result == 0)
return;
@ -908,6 +1290,74 @@ void sub_8083C50(u8 taskId)
DestroyTask(taskId);
}
#if DEBUG
__attribute__((naked))
void debug_sub_808B778()
{
asm("\
push {r4, lr}\n\
ldr r4, ._390 @ debug_sub_808B7A8\n\
add r0, r4, #0\n\
bl FuncIsActiveTask\n\
lsl r0, r0, #0x18\n\
cmp r0, #0\n\
bne ._389 @cond_branch\n\
add r0, r4, #0\n\
mov r1, #0x50\n\
bl CreateTask\n\
._389:\n\
ldr r1, ._390 + 4 @ unk_3004E98\n\
ldr r0, [r1]\n\
add r0, r0, #0x1\n\
str r0, [r1]\n\
pop {r4}\n\
pop {r0}\n\
bx r0\n\
._391:\n\
.align 2, 0\n\
._390:\n\
.word debug_sub_808B7A8+1\n\
.word unk_3004E98");
}
__attribute__((naked))
void debug_sub_808B7A8()
{
asm("\
push {lr}\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
ldr r2, ._393 @ gTasks\n\
lsl r1, r0, #0x2\n\
add r1, r1, r0\n\
lsl r1, r1, #0x3\n\
add r1, r1, r2\n\
ldrh r0, [r1, #0x8]\n\
add r0, r0, #0x1\n\
strh r0, [r1, #0x8]\n\
lsl r0, r0, #0x10\n\
asr r0, r0, #0x10\n\
cmp r0, #0x1e\n\
bne ._392 @cond_branch\n\
mov r0, #0x0\n\
strh r0, [r1, #0x8]\n\
ldr r2, ._393 + 4 @ unk_3004E94\n\
ldrh r0, [r2]\n\
mov r1, #0x1\n\
orr r0, r0, r1\n\
strh r0, [r2]\n\
._392:\n\
pop {r0}\n\
bx r0\n\
._394:\n\
.align 2, 0\n\
._393:\n\
.word gTasks\n\
.word unk_3004E94");
}
#endif
static void sub_8083CA4(u8 taskId)
{
if (!gReceivedRemoteLinkPlayers)
@ -921,4 +1371,23 @@ void unref_sub_8083CC8(u8 taskId)
{
sub_800832C();
gTasks[taskId].func = sub_8083CA4;
}
}
#if DEBUG
void debug_sub_808B82C(void)
{
unk_2030220 = 0;
}
void debug_sub_808B838(u8 a)
{
unk_2030220 |= 1 << a;
}
int debug_sub_808B850(void)
{
return unk_2030220;
}
#endif

View File

@ -13,12 +13,11 @@
#include "tv.h"
#include "wallclock.h"
static void InitTimeBasedEvents(void);
static void UpdatePerDay(struct Time *time);
static void UpdatePerMinute(struct Time *time);
static void ReturnFromStartWallClock(void);
static void InitTimeBasedEvents(void)
void InitTimeBasedEvents(void)
{
FlagSet(FLAG_SYS_CLOCK_SET);
RtcCalcLocalTime();

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "cable_club.h"
#include "link.h"
#include "battle.h"
#include "berry.h"
@ -12,6 +13,7 @@
#include "constants/songs.h"
#include "sound.h"
#include "sprite.h"
#include "string_util.h"
#include "strings2.h"
#include "task.h"
#include "text.h"
@ -66,7 +68,7 @@ u32 sub_8007E40(void);
static void SetBlockReceivedFlag(u8);
static u16 LinkTestCalcBlockChecksum(void *, u16);
static void PrintHexDigit(u8, u8, u8);
static void PrintHex(u32, u8, u8, u8);
void PrintHex(u32, u8, u8, u8);
static void LinkCB_RequestPlayerDataExchange(void);
static void Task_PrintTestData(u8);
bool8 sub_8008224(void);
@ -79,7 +81,7 @@ static void sub_80084C8(void);
static void sub_80084F4(void);
static void CheckErrorStatus(void);
static void CB2_PrintErrorMessage(void);
void CB2_PrintErrorMessage(void);
static u8 IsSioMultiMaster(void);
static void DisableSerial(void);
static void EnableSerial(void);
@ -145,6 +147,9 @@ void (*gLinkCallback)(void);
struct LinkPlayer gSavedLinkPlayers[MAX_LINK_PLAYERS];
u8 gShouldAdvanceLinkState;
u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
#if DEBUG
u8 gUnknown_Debug_30030E0;
#endif
u8 gBlockRequestType;
u8 gLastSendQueueCount;
struct Link gLink;
@ -156,11 +161,11 @@ u8 deUnkValue1;
u8 deUnkValue2;
#endif
EWRAM_DATA bool8 gLinkTestDebugValuesEnabled = {0};
EWRAM_DATA bool8 gLinkTestDummyBool = {0};
EWRAM_DATA u32 gFiller_20238B8 = {0};
EWRAM_DATA u32 dword_20238BC = {0};
EWRAM_DATA bool8 gLinkOpen = {0};
EWRAM_DATA bool8 gLinkTestDebugValuesEnabled = 0;
EWRAM_DATA bool8 gLinkTestDummyBool = 0;
EWRAM_DATA u32 gFiller_20238B8 = 0;
EWRAM_DATA u32 dword_20238BC = 0;
EWRAM_DATA bool8 gLinkOpen = 0;
static const u16 sLinkTestDigitPalette[] = INCBIN_U16("graphics/interface/link_test_digits.gbapal");
static const u32 sLinkTestDigitTiles[] = INCBIN_U32("graphics/interface/link_test_digits.4bpp");
@ -189,9 +194,19 @@ const struct BlockRequest sBlockRequestLookupTable[5] =
static const u8 sTestString[] = _("テストな");
ALIGNED(4) static const u8 sMagic[] = "GameFreak inc.";
// TODO: fix the alignment here
ALIGNED(4) static const u8 sEmptyString[] = _("");
ALIGNED(4) const u8 sMagic[] = "GameFreak inc.";
#if DEBUG
const u8 sEmptyString[] = _(" ");
#else
ALIGNED(4) const u8 sEmptyString[] = _("");
#endif
#if DEBUG
const u8 linkDebugFillerPleaseRemove[2] = {0};
#endif
void Task_DestroySelf(u8 taskId)
{
@ -543,6 +558,9 @@ static void ProcessRecvCmds(u8 unusedParam)
else
{
SetBlockReceivedFlag(i);
#if DEBUG
debug_sub_808B838(i);
#endif
}
}
break;
@ -952,7 +970,7 @@ static void PrintHexDigit(u8 tileNum, u8 x, u8 y)
tilemap[(32 * y) + x] = (gLinkTestBGInfo.paletteNum << 12) | (tileNum + 1);
}
static void PrintHex(u32 num, u8 x, u8 y, u8 maxDigits)
void PrintHex(u32 num, u8 x, u8 y, u8 maxDigits)
{
u8 buffer[16];
s32 i;
@ -970,6 +988,143 @@ static void PrintHex(u32 num, u8 x, u8 y, u8 maxDigits)
}
}
#if DEBUG
EWRAM_DATA u16 *debugCharacterBase = NULL;
EWRAM_DATA void *unk_20238C8 = NULL;
EWRAM_DATA u16 (*debugTileMap)[] = NULL;
EWRAM_DATA u32 unk_20238D0 = 0;
void debug_sub_8008218(u16 *buffer, void *arg1, u16 (*arg2)[], u32 arg3)
{
CpuSet(sLinkTestDigitTiles, buffer, 272);
debugCharacterBase = buffer;
unk_20238C8 = arg1;
debugTileMap = arg2;
unk_20238D0 = arg3;
}
#ifdef NONMATCHING
void debug_sub_8008264(u32 value, int left, int top, int r3, int sp0)
{
u32 buffer[8];
u32 *ptr;
u16 *dest;
int i;
if (unk_20238D0 != sp0)
return;
r3 = max(r3, 8);
ptr = &buffer[0];
dest = &(*debugTileMap)[left + top * 32];
for (i = r3; i != 0; i--)
{
*(ptr++) = value & 0xF;
value = value >> 4;
}
ptr = &buffer[8 - r3];
for (i = r3; i != 0; i--)
{
int charOffset = (((uintptr_t) debugCharacterBase) - ((uintptr_t) unk_20238C8)) / 32;
*dest = *ptr + charOffset + 1;
ptr--;
dest++;
}
}
#else
__attribute__((naked))
void debug_sub_8008264(u32 value, int left, int top, int r3, int sp0)
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" mov r7, r8\n"
" push {r7}\n"
" add sp, sp, #0xffffffe0\n"
" add r5, r0, #0\n"
" add r6, r1, #0\n"
" add r4, r3, #0\n"
" ldr r0, [sp, #0x38]\n"
" ldr r1, ._347 @ unk_20238D0\n"
" ldr r1, [r1]\n"
" cmp r1, r0\n"
" bne ._345 @cond_branch\n"
" cmp r4, #0x8\n"
" ble ._342 @cond_branch\n"
" mov r4, #0x8\n"
"._342:\n"
" mov r3, sp\n"
" ldr r0, ._347 + 4 @ debugTileMap\n"
" mov r8, r0\n"
" lsl r2, r2, #0x6\n"
" mov ip, r2\n"
" lsl r6, r6, #0x1\n"
" lsl r7, r4, #0x2\n"
" cmp r4, #0\n"
" ble ._343 @cond_branch\n"
" mov r1, #0xf\n"
" add r2, r4, #0\n"
"._344:\n"
" add r0, r5, #0\n"
" and r0, r0, r1\n"
" stmia r3!, {r0}\n"
" lsr r5, r5, #0x4\n"
" sub r2, r2, #0x1\n"
" cmp r2, #0\n"
" bne ._344 @cond_branch\n"
"._343:\n"
" mov r1, r8\n"
" ldr r0, [r1]\n"
" add r0, r0, ip\n"
" add r5, r0, r6\n"
" mov r1, sp\n"
" add r0, r1, r7\n"
" sub r3, r0, #4\n"
" cmp r4, #0\n"
" ble ._345 @cond_branch\n"
" ldr r7, ._347 + 8 @ debugCharacterBase\n"
" ldr r6, ._347 + 12 @ unk_20238C8\n"
" add r2, r4, #0\n"
"._346:\n"
" ldr r1, [r7]\n"
" ldr r0, [r6]\n"
" sub r1, r1, r0\n"
" lsr r1, r1, #0x5\n"
" ldr r0, [r3]\n"
" add r0, r0, r1\n"
" add r0, r0, #0x1\n"
" strh r0, [r5]\n"
" sub r3, r3, #0x4\n"
" add r5, r5, #0x2\n"
" sub r2, r2, #0x1\n"
" cmp r2, #0\n"
" bne ._346 @cond_branch\n"
"._345:\n"
" add sp, sp, #0x20\n"
" pop {r3}\n"
" mov r8, r3\n"
" pop {r4, r5, r6, r7}\n"
" pop {r0}\n"
" bx r0\n"
"._348:\n"
" .align 2, 0\n"
"._347:\n"
" .word unk_20238D0\n"
" .word debugTileMap\n"
" .word debugCharacterBase\n"
" .word unk_20238C8\n"
"\n"
);
}
#endif
#endif
static void LinkCB_RequestPlayerDataExchange(void)
{
// Only one request needs to be sent, so only the master sends it.
@ -1248,14 +1403,33 @@ void CB2_LinkError(void)
SetMainCallback2(CB2_PrintErrorMessage);
}
static void CB2_PrintErrorMessage(void)
void CB2_PrintErrorMessage(void)
{
u8 array[64] __attribute__((unused)); // unused
u8 array[32] __attribute__((unused)); // unused
u8 array2[32] __attribute__((unused)); // unused
switch (gMain.state)
{
case 0:
Menu_PrintTextPixelCoords(gMultiText_LinkError, 20, 56, 1);
#if DEBUG
StringCopy(array, sColorCodes);
ConvertIntToHexStringN(array2, sErrorLinkStatus, STR_CONV_MODE_LEADING_ZEROS, 8);
StringAppend(array, array2);
StringAppend(array, sEmptyString);
ConvertIntToHexStringN(array2, sErrorLastSendQueueCount, STR_CONV_MODE_LEADING_ZEROS, 2);
StringAppend(array, array2);
StringAppend(array, sEmptyString);
ConvertIntToHexStringN(array2, sErrorLastRecvQueueCount, STR_CONV_MODE_LEADING_ZEROS, 2);
StringAppend(array, array2);
Menu_PrintText(array, 2, 15);
#endif
break;
case 30:
case 60:

View File

@ -338,3 +338,463 @@ static void CB2_MysteryEventMenu(void)
BuildOamBuffer();
UpdatePaletteFade();
}
#if DEBUG
void debug_sub_815D1D8();
__attribute__((naked))
void debug_sub_815D04C()
{
asm(
" push {r4, r5, r6, lr}\n"
" lsl r0, r0, #0x18\n"
" lsr r5, r0, #0x18\n"
" ldr r1, ._125 @ gTasks\n"
" lsl r0, r5, #0x2\n"
" add r0, r0, r5\n"
" lsl r0, r0, #0x3\n"
" add r4, r0, r1\n"
" mov r1, #0x8\n"
" ldsh r0, [r4, r1]\n"
" cmp r0, #0\n"
" bne ._121 @cond_branch\n"
" mov r0, #0x4\n"
" mov r1, #0x4\n"
" mov r2, #0xd\n"
" mov r3, #0x7\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r1, ._125 + 4 @ gUnknown_Debug_842E2D0\n"
" mov r2, #0xa\n"
" ldsh r0, [r4, r2]\n"
" lsl r0, r0, #0x3\n"
" add r0, r0, r1\n"
" ldr r0, [r0]\n"
" mov r1, #0x5\n"
" mov r2, #0x5\n"
" bl Menu_PrintText\n"
" ldrh r0, [r4, #0x8]\n"
" add r0, r0, #0x1\n"
" strh r0, [r4, #0x8]\n"
"._121:\n"
" ldr r2, ._125 + 8 @ gMain\n"
" ldrh r1, [r2, #0x2e]\n"
" mov r0, #0x20\n"
" and r0, r0, r1\n"
" add r6, r2, #0\n"
" cmp r0, #0\n"
" beq ._122 @cond_branch\n"
" ldrh r1, [r4, #0xa]\n"
" mov r2, #0xa\n"
" ldsh r0, [r4, r2]\n"
" cmp r0, #0\n"
" bne ._123 @cond_branch\n"
" ldr r0, ._125 + 12 @ gUnknown_Debug_842E350\n"
" ldrb r0, [r0]\n"
" sub r0, r0, #0x1\n"
" b ._124\n"
"._126:\n"
" .align 2, 0\n"
"._125:\n"
" .word gTasks\n"
" .word gUnknown_Debug_842E2D0\n"
" .word gMain\n"
" .word gUnknown_Debug_842E350\n"
"._123:\n"
" sub r0, r1, #1\n"
"._124:\n"
" strh r0, [r4, #0xa]\n"
" ldr r0, ._130 @ gTasks\n"
" lsl r1, r5, #0x2\n"
" add r1, r1, r5\n"
" lsl r1, r1, #0x3\n"
" add r1, r1, r0\n"
" mov r0, #0x0\n"
" strh r0, [r1, #0x8]\n"
"._122:\n"
" ldrh r1, [r6, #0x2e]\n"
" mov r0, #0x10\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" beq ._127 @cond_branch\n"
" ldr r1, ._130 @ gTasks\n"
" lsl r2, r5, #0x2\n"
" add r0, r2, r5\n"
" lsl r0, r0, #0x3\n"
" add r4, r0, r1\n"
" mov r0, #0xa\n"
" ldsh r3, [r4, r0]\n"
" ldr r0, ._130 + 4 @ gUnknown_Debug_842E350\n"
" ldrb r0, [r0]\n"
" sub r0, r0, #0x1\n"
" cmp r3, r0\n"
" bne ._128 @cond_branch\n"
" mov r0, #0x0\n"
" b ._129\n"
"._131:\n"
" .align 2, 0\n"
"._130:\n"
" .word gTasks\n"
" .word gUnknown_Debug_842E350\n"
"._128:\n"
" ldrh r0, [r4, #0xa]\n"
" add r0, r0, #0x1\n"
"._129:\n"
" strh r0, [r4, #0xa]\n"
" add r0, r2, r5\n"
" lsl r0, r0, #0x3\n"
" add r0, r0, r1\n"
" mov r1, #0x0\n"
" strh r1, [r0, #0x8]\n"
"._127:\n"
" ldrh r1, [r6, #0x2e]\n"
" mov r0, #0x1\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" beq ._132 @cond_branch\n"
" ldr r1, ._133 @ gTasks\n"
" lsl r0, r5, #0x2\n"
" add r0, r0, r5\n"
" lsl r0, r0, #0x3\n"
" add r0, r0, r1\n"
" mov r2, #0xa\n"
" ldsh r1, [r0, r2]\n"
" lsl r1, r1, #0x3\n"
" ldr r0, ._133 + 4 @ gUnknown_Debug_842E2D0\n"
" add r0, r0, #0x4\n"
" add r1, r1, r0\n"
" ldr r0, ._133 + 8 @ \n"
" ldr r1, [r1]\n"
" bl _call_via_r1\n"
" ldr r0, ._133 + 12 @ \n"
" add r1, r6, r0\n"
" ldrb r0, [r1]\n"
" add r0, r0, #0x1\n"
" strb r0, [r1]\n"
" add r0, r5, #0\n"
" bl DestroyTask\n"
"._132:\n"
" pop {r4, r5, r6}\n"
" pop {r0}\n"
" bx r0\n"
"._134:\n"
" .align 2, 0\n"
"._133:\n"
" .word gTasks\n"
" .word gUnknown_Debug_842E2D0\n"
" .word +0x2004000\n"
" .word 0x43c\n"
"\n"
);
}
void debug_sub_815D15C(void)
{
ResetSpriteData();
FreeAllSpritePalettes();
ResetTasks();
SetVBlankCallback(VBlankCB);
Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
Menu_EraseScreen();
REG_DISPCNT = DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_MODE_0;
REG_BLDCNT = 0;
CreateTask(Task_DestroySelf, 0);
StopMapMusic();
RunTasks();
AnimateSprites();
BuildOamBuffer();
UpdatePaletteFade();
FillPalette(0, 0, 2);
SetMainCallback2(debug_sub_815D1D8);
}
__attribute__((naked))
void debug_sub_815D1D8()
{
asm(
" push {r4, lr}\n"
" add sp, sp, #0xfffffffc\n"
" ldr r1, ._139 @ gMain\n"
" ldr r2, ._139 + 4 @ 0x43c\n"
" add r0, r1, r2\n"
" ldrb r0, [r0]\n"
" add r4, r1, #0\n"
" cmp r0, #0xb\n"
" bls ._137 @cond_branch\n"
" b ._196\n"
"._137:\n"
" lsl r0, r0, #0x2\n"
" ldr r1, ._139 + 8 @ \n"
" add r0, r0, r1\n"
" ldr r0, [r0]\n"
" mov pc, r0\n"
"._140:\n"
" .align 2, 0\n"
"._139:\n"
" .word gMain\n"
" .word 0x43c\n"
" .word ._141\n"
"._141:\n"
" .word ._142\n"
" .word ._143\n"
" .word ._144\n"
" .word ._145\n"
" .word ._146\n"
" .word ._196\n"
" .word ._148\n"
" .word ._149\n"
" .word ._150\n"
" .word ._151\n"
" .word ._152\n"
" .word ._153\n"
"._142:\n"
" mov r0, #0x3\n"
" mov r1, #0xe\n"
" mov r2, #0x1b\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" mov r0, #0x1\n"
" neg r0, r0\n"
" mov r1, #0x0\n"
" str r1, [sp]\n"
" mov r2, #0x10\n"
" mov r3, #0x0\n"
" bl BeginNormalPaletteFade\n"
" ldr r1, ._155 @ gMain\n"
" ldr r0, ._155 + 4 @ 0x43c\n"
" add r1, r1, r0\n"
" b ._189\n"
"._156:\n"
" .align 2, 0\n"
"._155:\n"
" .word gMain\n"
" .word 0x43c\n"
"._143:\n"
" ldr r0, ._161 @ gPaletteFade\n"
" ldrb r1, [r0, #0x7]\n"
" mov r0, #0x80\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" beq ._157 @cond_branch\n"
" b ._196\n"
"._157:\n"
" ldrh r1, [r4, #0x2c]\n"
" mov r0, #0x80\n"
" lsl r0, r0, #0x1\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" beq ._159 @cond_branch\n"
" ldr r1, ._161 + 4 @ gUnknown_Debug_30030E0\n"
" ldrb r0, [r1]\n"
" add r0, r0, #0x1\n"
" strb r0, [r1]\n"
"._159:\n"
" ldr r0, ._161 + 8 @ Str_843DA70\n"
" mov r1, #0x4\n"
" mov r2, #0xf\n"
" bl MenuPrintMessage\n"
" ldr r2, ._161 + 12 @ 0x43c\n"
" add r1, r4, r2\n"
" b ._189\n"
"._162:\n"
" .align 2, 0\n"
"._161:\n"
" .word gPaletteFade\n"
" .word gUnknown_Debug_30030E0\n"
" .word Str_843DA70\n"
" .word 0x43c\n"
"._144:\n"
" bl Menu_UpdateWindowText\n"
" lsl r0, r0, #0x18\n"
" cmp r0, #0\n"
" bne ._163 @cond_branch\n"
" b ._196\n"
"._163:\n"
" ldr r1, ._166 @ gMain\n"
" ldr r0, ._166 + 4 @ 0x43c\n"
" add r1, r1, r0\n"
" ldrb r0, [r1]\n"
" add r0, r0, #0x1\n"
" strb r0, [r1]\n"
" ldr r1, ._166 + 8 @ gLinkType\n"
" ldr r2, ._166 + 12 @ 0x5501\n"
" add r0, r2, #0\n"
" strh r0, [r1]\n"
" bl OpenLink\n"
" b ._196\n"
"._167:\n"
" .align 2, 0\n"
"._166:\n"
" .word gMain\n"
" .word 0x43c\n"
" .word gLinkType\n"
" .word 0x5501\n"
"._145:\n"
" ldr r0, ._171 @ gReceivedRemoteLinkPlayers\n"
" ldrb r0, [r0]\n"
" cmp r0, #0\n"
" bne ._168 @cond_branch\n"
" b ._196\n"
"._168:\n"
" ldr r1, ._171 + 4 @ 0x43c\n"
" add r0, r4, r1\n"
" ldrb r1, [r0]\n"
" add r1, r1, #0x1\n"
" strb r1, [r0]\n"
" ldr r0, ._171 + 8 @ Str_843DA84\n"
" mov r1, #0x4\n"
" mov r2, #0xf\n"
" bl MenuPrintMessage\n"
" b ._196\n"
"._172:\n"
" .align 2, 0\n"
"._171:\n"
" .word gReceivedRemoteLinkPlayers\n"
" .word 0x43c\n"
" .word Str_843DA84\n"
"._146:\n"
" bl Menu_UpdateWindowText\n"
" lsl r0, r0, #0x18\n"
" cmp r0, #0\n"
" bne ._173 @cond_branch\n"
" b ._196\n"
"._173:\n"
" ldr r0, ._176 @ debug_sub_815D04C\n"
" mov r1, #0xa\n"
" bl CreateTask\n"
" ldr r1, ._176 + 4 @ gMain\n"
" ldr r2, ._176 + 8 @ 0x43c\n"
" add r1, r1, r2\n"
" b ._189\n"
"._177:\n"
" .align 2, 0\n"
"._176:\n"
" .word debug_sub_815D04C+1\n"
" .word gMain\n"
" .word 0x43c\n"
"._148:\n"
" ldr r0, ._179 @ Str_843DA98\n"
" mov r1, #0x4\n"
" mov r2, #0xf\n"
" bl MenuPrintMessage\n"
" ldr r1, ._179 + 4 @ 0x2004000\n"
" ldr r2, ._179 + 8 @ 0x2004\n"
" mov r0, #0x0\n"
" bl SendBlock\n"
" ldr r1, ._179 + 12 @ gMain\n"
" ldr r0, ._179 + 16 @ 0x43c\n"
" add r1, r1, r0\n"
" b ._189\n"
"._180:\n"
" .align 2, 0\n"
"._179:\n"
" .word Str_843DA98\n"
" .word 0x2004000\n"
" .word 0x2004\n"
" .word gMain\n"
" .word 0x43c\n"
"._149:\n"
" bl Menu_UpdateWindowText\n"
" bl IsLinkTaskFinished\n"
" lsl r0, r0, #0x18\n"
" cmp r0, #0\n"
" beq ._196 @cond_branch\n"
" ldr r1, ._183 @ gMain\n"
" ldr r2, ._183 + 4 @ 0x43c\n"
" add r1, r1, r2\n"
" b ._189\n"
"._184:\n"
" .align 2, 0\n"
"._183:\n"
" .word gMain\n"
" .word 0x43c\n"
"._150:\n"
" bl sub_800832C\n"
" ldr r1, ._186 @ gMain\n"
" ldr r0, ._186 + 4 @ 0x43c\n"
" add r1, r1, r0\n"
" b ._189\n"
"._187:\n"
" .align 2, 0\n"
"._186:\n"
" .word gMain\n"
" .word 0x43c\n"
"._151:\n"
" ldr r0, ._190 @ gReceivedRemoteLinkPlayers\n"
" ldrb r0, [r0]\n"
" cmp r0, #0\n"
" bne ._196 @cond_branch\n"
" mov r0, #0x4\n"
" mov r1, #0xf\n"
" mov r2, #0x1a\n"
" mov r3, #0x12\n"
" bl Menu_BlankWindowRect\n"
" ldr r0, ._190 + 4 @ Str_843DAA3\n"
" mov r1, #0x4\n"
" mov r2, #0xf\n"
" bl Menu_PrintText\n"
" ldr r1, ._190 + 8 @ gMain\n"
" ldr r2, ._190 + 12 @ 0x43c\n"
" add r1, r1, r2\n"
" b ._189\n"
"._191:\n"
" .align 2, 0\n"
"._190:\n"
" .word gReceivedRemoteLinkPlayers\n"
" .word Str_843DAA3\n"
" .word gMain\n"
" .word 0x43c\n"
"._152:\n"
" ldrh r1, [r4, #0x2e]\n"
" mov r0, #0x1\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" beq ._196 @cond_branch\n"
" mov r0, #0x1\n"
" neg r0, r0\n"
" mov r1, #0x0\n"
" str r1, [sp]\n"
" mov r2, #0x0\n"
" mov r3, #0x10\n"
" bl BeginNormalPaletteFade\n"
" ldr r0, ._194 @ 0x43c\n"
" add r1, r4, r0\n"
"._189:\n"
" ldrb r0, [r1]\n"
" add r0, r0, #0x1\n"
" strb r0, [r1]\n"
" b ._196\n"
"._195:\n"
" .align 2, 0\n"
"._194:\n"
" .word 0x43c\n"
"._153:\n"
" ldr r0, ._197 @ gPaletteFade\n"
" ldrb r1, [r0, #0x7]\n"
" mov r0, #0x80\n"
" and r0, r0, r1\n"
" cmp r0, #0\n"
" bne ._196 @cond_branch\n"
" ldr r0, ._197 + 4 @ CB2_InitTitleScreen\n"
" bl SetMainCallback2\n"
"._196:\n"
" bl RunTasks\n"
" bl AnimateSprites\n"
" bl BuildOamBuffer\n"
" bl UpdatePaletteFade\n"
" add sp, sp, #0x4\n"
" pop {r4}\n"
" pop {r0}\n"
" bx r0\n"
"._198:\n"
" .align 2, 0\n"
"._197:\n"
" .word gPaletteFade\n"
" .word CB2_InitTitleScreen+1\n"
"\n"
);
}
#endif

View File

@ -147,6 +147,13 @@ const struct SpriteTemplate gSpriteTemplate_83764E8 =
const u8 gUnknown_08376500[] = _(" : ");
#if DEBUG
const u8 gUnknown_Debug_0839AE94[] = _("にっすう");
const u8 gUnknown_Debug_0839AE99[] = _("じかん");
const u8 gUnknown_Debug_0839AE9D[] = _("ゲームない じかん");
const u8 gUnknown_Debug_0839AEA7[] = _("RTC じかん");
#endif
void SpriteCB_ResetRtcCusor0(struct Sprite *sprite)
{
int state = gTasks[sprite->data[0]].data[2];
@ -587,3 +594,319 @@ void Task_ResetRtcScreen(u8 taskId)
}
}
}
#if DEBUG
__attribute__((naked))
void debug_sub_806F8F8(void)
{
asm("\
push {lr}\n\
ldr r0, ._131 @ CB2_InitResetRtcScreen\n\
bl SetMainCallback2\n\
pop {r0}\n\
bx r0\n\
._132:\n\
.align 2, 0\n\
._131:\n\
.word CB2_InitResetRtcScreen+1");
}
__attribute__((naked))
void debug_sub_806F908(u8 a)
{
asm("\
push {r4, r5, lr}\n\
lsl r0, r0, #0x18\n\
lsr r5, r0, #0x18\n\
lsl r0, r5, #0x2\n\
add r0, r0, r5\n\
lsl r0, r0, #0x3\n\
ldr r2, ._136 @ gTasks\n\
add r4, r0, r2\n\
mov r1, #0x0\n\
ldsh r0, [r4, r1]\n\
cmp r0, #0\n\
beq ._133 @cond_branch\n\
cmp r0, #0x1\n\
beq ._134 @cond_branch\n\
b ._141\n\
._137:\n\
.align 2, 0\n\
._136:\n\
.word gTasks+0x8\n\
._133:\n\
ldr r0, ._139 @ Task_ResetRtc_0\n\
mov r1, #0x50\n\
bl CreateTask\n\
lsl r0, r0, #0x18\n\
lsr r0, r0, #0x18\n\
strh r0, [r4, #0x2]\n\
ldrh r0, [r4]\n\
add r0, r0, #0x1\n\
strh r0, [r4]\n\
b ._141\n\
._140:\n\
.align 2, 0\n\
._139:\n\
.word Task_ResetRtc_0+1\n\
._134:\n\
sub r2, r2, #0x8\n\
mov r0, #0x2\n\
ldsh r1, [r4, r0]\n\
lsl r0, r1, #0x2\n\
add r0, r0, r1\n\
lsl r0, r0, #0x3\n\
add r2, r0, r2\n\
mov r1, #0x8\n\
ldsh r0, [r2, r1]\n\
cmp r0, #0\n\
beq ._141 @cond_branch\n\
mov r1, #0xa\n\
ldsh r0, [r2, r1]\n\
cmp r0, #0x1\n\
bne ._142 @cond_branch\n\
ldr r3, ._143 @ gLocalTime\n\
mov r1, #0x0\n\
ldsh r0, [r3, r1]\n\
mov r1, #0x2\n\
ldsb r1, [r3, r1]\n\
mov r2, #0x3\n\
ldsb r2, [r3, r2]\n\
ldrb r3, [r3, #0x4]\n\
lsl r3, r3, #0x18\n\
asr r3, r3, #0x18\n\
bl RtcCalcLocalTimeOffset\n\
._142:\n\
ldrb r0, [r4, #0x2]\n\
bl DestroyTask\n\
bl Menu_EraseScreen\n\
bl ScriptContext2_Disable\n\
add r0, r5, #0\n\
bl DestroyTask\n\
._141:\n\
pop {r4, r5}\n\
pop {r0}\n\
bx r0\n\
._144:\n\
.align 2, 0\n\
._143:\n\
.word gLocalTime");
}
__attribute__((naked))
void debug_sub_806F99C()
{
asm("\
push {lr}\n\
bl RtcCalcLocalTime\n\
ldr r0, ._145 @ debug_sub_806F908\n\
mov r1, #0x50\n\
bl CreateTask\n\
bl ScriptContext2_Enable\n\
pop {r0}\n\
bx r0\n\
._146:\n\
.align 2, 0\n\
._145:\n\
.word debug_sub_806F908+1");
}
__attribute__((naked))
void debug_sub_806F9B8()
{
asm("\
push {lr}\n\
ldr r2, ._147 @ gLocalTime\n\
ldr r0, ._147 + 4 @ gSaveBlock2\n\
add r0, r0, #0xa0\n\
ldr r1, [r0, #0x4]\n\
ldr r0, [r0]\n\
str r0, [r2]\n\
str r1, [r2, #0x4]\n\
ldr r0, ._147 + 8 @ debug_sub_806F908\n\
mov r1, #0x50\n\
bl CreateTask\n\
bl ScriptContext2_Enable\n\
pop {r0}\n\
bx r0\n\
._148:\n\
.align 2, 0\n\
._147:\n\
.word gLocalTime\n\
.word gSaveBlock2\n\
.word debug_sub_806F908+1");
}
__attribute__((naked))
void debug_sub_806F9E4()
{
asm("\
push {r4, r5, r6, r7, lr}\n\
mov r7, sl\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5, r6, r7}\n\
lsl r0, r0, #0x18\n\
lsr r7, r0, #0x18\n\
lsl r0, r7, #0x2\n\
add r0, r0, r7\n\
lsl r0, r0, #0x3\n\
ldr r1, ._153 @ gTasks\n\
add r5, r0, r1\n\
ldr r6, ._153 + 4 @ gStringVar4\n\
mov r1, #0x0\n\
ldsh r0, [r5, r1]\n\
cmp r0, #0x1\n\
beq ._149 @cond_branch\n\
cmp r0, #0x1\n\
bgt ._150 @cond_branch\n\
cmp r0, #0\n\
beq ._151 @cond_branch\n\
b ._165\n\
._154:\n\
.align 2, 0\n\
._153:\n\
.word gTasks+0x8\n\
.word gStringVar4\n\
._150:\n\
cmp r0, #0x2\n\
beq ._155 @cond_branch\n\
b ._165\n\
._149:\n\
mov r0, #0x0\n\
mov r1, #0x9\n\
mov r2, #0x1d\n\
mov r3, #0x13\n\
bl Menu_DrawStdWindowFrame\n\
add r4, r6, #0\n\
add r4, r4, #0x50\n\
bl RtcGetErrorStatus\n\
add r1, r0, #0\n\
lsl r1, r1, #0x10\n\
lsr r1, r1, #0x10\n\
add r0, r4, #0\n\
mov r2, #0x2\n\
mov r3, #0x4\n\
bl ConvertIntToHexStringN\n\
add r0, r4, #0\n\
mov r1, #0x2\n\
mov r2, #0xa\n\
bl Menu_PrintText\n\
ldr r0, ._158 @ gUnknown_Debug_0839AE94\n\
mov r1, #0xc\n\
mov r2, #0xc\n\
bl Menu_PrintText\n\
ldr r0, ._158 + 4 @ gUnknown_Debug_0839AE99\n\
mov r1, #0x14\n\
mov r2, #0xc\n\
bl Menu_PrintText\n\
ldr r0, ._158 + 8 @ gUnknown_Debug_0839AEA7\n\
mov r1, #0x1\n\
mov r2, #0xe\n\
bl Menu_PrintText\n\
ldr r0, ._158 + 12 @ gUnknown_Debug_0839AE9D\n\
mov r1, #0x1\n\
mov r2, #0x10\n\
bl Menu_PrintText\n\
._151:\n\
ldrh r0, [r5]\n\
add r0, r0, #0x1\n\
strh r0, [r5]\n\
b ._165\n\
._159:\n\
.align 2, 0\n\
._158:\n\
.word gUnknown_Debug_0839AE94\n\
.word gUnknown_Debug_0839AE99\n\
.word gUnknown_Debug_0839AEA7\n\
.word gUnknown_Debug_0839AE9D\n\
._155:\n\
bl RtcCalcLocalTime\n\
add r0, r6, #0\n\
bl FormatHexRtcTime\n\
mov r2, #0x14\n\
add r2, r2, r6\n\
mov r9, r2\n\
mov r0, r9\n\
bl debug_sub_8009894\n\
mov r0, #0x28\n\
add r0, r0, r6\n\
mov sl, r0\n\
ldr r4, ._163 @ gLocalTime\n\
mov r1, #0x2\n\
ldsb r1, [r4, r1]\n\
mov r2, #0x3\n\
ldsb r2, [r4, r2]\n\
mov r3, #0x4\n\
ldsb r3, [r4, r3]\n\
bl FormatDecimalTime\n\
mov r1, #0x3c\n\
add r1, r1, r6\n\
mov r8, r1\n\
mov r2, #0x0\n\
ldsh r1, [r4, r2]\n\
mov r0, r8\n\
mov r2, #0x1\n\
mov r3, #0x4\n\
bl ConvertIntToDecimalStringN\n\
ldr r0, ._163 + 4 @ gSaveBlock2\n\
ldrb r0, [r0, #0x12]\n\
cmp r0, #0\n\
bne ._160 @cond_branch\n\
add r0, r6, #0\n\
mov r1, #0x14\n\
mov r2, #0xe\n\
bl Menu_PrintText\n\
mov r0, r9\n\
mov r1, #0xc\n\
mov r2, #0xe\n\
bl Menu_PrintText\n\
mov r0, sl\n\
mov r1, #0x14\n\
mov r2, #0x10\n\
bl Menu_PrintText\n\
mov r0, r8\n\
mov r1, #0xc\n\
mov r2, #0x10\n\
bl Menu_PrintText\n\
._160:\n\
ldrh r1, [r5, #0x2]\n\
mov r2, #0x2\n\
ldsh r0, [r5, r2]\n\
cmp r0, #0x13\n\
ble ._161 @cond_branch\n\
add r0, r1, #1\n\
strh r0, [r5, #0x2]\n\
b ._165\n\
._164:\n\
.align 2, 0\n\
._163:\n\
.word gLocalTime\n\
.word gSaveBlock2\n\
._161:\n\
ldr r0, ._166 @ gMain\n\
ldrh r1, [r0, #0x2e]\n\
mov r0, #0x1\n\
and r0, r0, r1\n\
cmp r0, #0\n\
beq ._165 @cond_branch\n\
bl Menu_EraseScreen\n\
add r0, r7, #0\n\
bl DestroyTask\n\
bl ScriptContext2_Disable\n\
._165:\n\
pop {r3, r4, r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov sl, r5\n\
pop {r4, r5, r6, r7}\n\
pop {r0}\n\
bx r0\n\
._167:\n\
.align 2, 0\n\
._166:\n\
.word gMain");
}
#endif

View File

@ -268,6 +268,28 @@ void FormatHexDate(u8 *dest, s32 year, s32 month, s32 day)
*dest = EOS;
}
#if DEBUG
void debug_sub_800987C(u8 *dest)
{
FormatHexDate(dest, sRtc.year, sRtc.month, sRtc.day);
}
void debug_sub_8009894(u8 *dest)
{
u16 dayCount;
dayCount = RtcGetDayCount(&sRtc);
ConvertIntToDecimalStringN(dest, dayCount, STR_CONV_MODE_RIGHT_ALIGN, 4);
}
void debug_sub_80098B8(u8 *dest)
{
ConvertIntToHexStringN(dest, sRtc.status, STR_CONV_MODE_LEADING_ZEROS, 2);
}
#endif
void RtcCalcTimeDifference(struct SiiRtcInfo *rtc, struct Time *result, struct Time *t)
{
u16 days = RtcGetDayCount(rtc);
@ -347,3 +369,10 @@ u32 RtcGetMinuteCount()
RtcGetInfo(&sRtc);
return (24 * 60) * RtcGetDayCount(&sRtc) + 60 * sRtc.hour + sRtc.minute;
}
#if DEBUG
void debug_sub_8009A60()
{
RtcGetRawInfo(&sRtc);
}
#endif

View File

@ -663,6 +663,35 @@ static u16 CalculateChecksum(void *data, u16 size)
return ((checksum >> 16) + checksum);
}
#if DEBUG
void sub_813B79C(void)
{
struct SaveSector *sbSector;
struct SaveSector *hofSector;
const struct SaveBlockChunk *sbChunks;
const struct SaveBlockChunk *hofChunks;
u16 i;
sbSector = eSaveSection;
sbChunks = sSaveBlockChunks;
for (i = 0; i < NUM_SECTORS_PER_SAVE_SLOT * 2; i++)
{
DoReadFlashWholeSection(i, sbSector);
sbSector->checksum = CalculateChecksum(sbSector, sbChunks[sbSector->id].size);
ProgramFlashSectorAndVerify(i, sbSector->data);
}
hofSector = eSaveSection;
hofChunks = sHallOfFameChunks;
for (i = 0; i < NUM_HALL_OF_FAME_SECTORS; i++)
{
DoReadFlashWholeSection(HALL_OF_FAME_SECTOR + i, hofSector);
hofSector->id = CalculateChecksum(hofSector, hofChunks[i].size); // why id?
ProgramFlashSectorAndVerify(HALL_OF_FAME_SECTOR + i, hofSector->data);
}
}
#endif
u8 Save_WriteDataInternal(u8 saveType)
{
u8 i;
@ -706,13 +735,21 @@ u8 Save_WriteDataInternal(u8 saveType)
return 0;
}
#if DEBUG
extern u32 gUnknown_Debug_03004BD0;
#endif
u8 Save_WriteData(u8 saveType) // TrySave
{
if (gFlashMemoryPresent != TRUE)
return SAVE_STATUS_ERROR;
Save_WriteDataInternal(saveType);
if (!gDamagedSaveSectors)
if (!gDamagedSaveSectors
#if DEBUG
&& gUnknown_Debug_03004BD0 == 0
#endif
)
return SAVE_STATUS_OK;
DoSaveFailedScreen(saveType);
@ -815,7 +852,7 @@ u8 Save_LoadGameData(u8 saveType)
return result;
}
static const u8 sUnusedFlashSectors[] = { 30, 31 };
const u8 sUnusedFlashSectors[] = { 30, 31 };
bool8 unref_sub_8125F4C(struct UnkSaveSection *a1)
{

View File

@ -61,16 +61,18 @@ static const u8 sClockFrames[8][3] =
static const u8 gSaveFailedClockPal[] = INCBIN_U8("graphics/misc/clock_small.gbapal");
static const u8 gSaveFailedClockGfx[] = INCBIN_U8("graphics/misc/clock_small.4bpp.lz");
#define static
static void VBlankCB(void);
static void CB2_SaveFailedScreen(void);
static void CB2_WipeSave(void);
static void CB2_GameplayCannotBeContinued(void);
/*static*/ void CB2_GameplayCannotBeContinued(void);
static void CB2_FadeAndReturnToTitleScreen(void);
static void CB2_ReturnToTitleScreen(void);
static void VBlankCB_UpdateClockGraphics(void);
static bool8 VerifySectorWipe(u16 sector);
static bool8 WipeSector(u16 sector);
static bool8 WipeSectors(u32 sectorBits);
/*static*/ bool8 WipeSectors(u32 sectorBits);
void DoSaveFailedScreen(u8 saveType)
{
@ -148,6 +150,151 @@ static void CB2_SaveFailedScreen(void)
}
}
#if DEBUG
__attribute__((naked))
void CB2_WipeSave()
{
asm(
" push {r4, r5, lr}\n"
" mov r4, #0x0\n"
" ldr r0, ._20 @ gSaveFailedClockInfo\n"
" mov r2, #0x1\n"
" strh r2, [r0]\n"
" ldr r0, ._20 + 4 @ gUnknown_Debug_03004BD0\n"
" ldr r0, [r0]\n"
" ldr r1, ._20 + 8 @ gDamagedSaveSectors\n"
" cmp r0, #0\n"
" beq ._12 @cond_branch\n"
" str r2, [r1]\n"
"._12:\n"
" ldr r0, [r1]\n"
" cmp r0, #0\n"
" beq ._16 @cond_branch\n"
" add r5, r1, #0\n"
"._17:\n"
" ldr r0, [r5]\n"
" bl WipeSectors\n"
" lsl r0, r0, #0x18\n"
" cmp r0, #0\n"
" bne ._14 @cond_branch\n"
" mov r0, #0x1\n"
" mov r1, #0xa\n"
" mov r2, #0x1c\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r0, ._20 + 12 @ gSystemText_CheckCompleteSaveAttempt\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
" ldr r0, ._20 + 16 @ gSaveFailedType\n"
" ldrb r0, [r0]\n"
" bl Save_WriteDataInternal\n"
" ldr r0, [r5]\n"
" cmp r0, #0\n"
" beq ._15 @cond_branch\n"
" mov r0, #0x1\n"
" mov r1, #0xa\n"
" mov r2, #0x1c\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r0, ._20 + 20 @ gSystemText_SaveFailedBackupCheck\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
"._15:\n"
" add r0, r4, #1\n"
" lsl r0, r0, #0x18\n"
" lsr r4, r0, #0x18\n"
" ldr r0, [r5]\n"
" cmp r0, #0\n"
" beq ._16 @cond_branch\n"
" cmp r4, #0x2\n"
" bls ._17 @cond_branch\n"
"._16:\n"
" cmp r4, #0x3\n"
" bne ._18 @cond_branch\n"
" mov r0, #0x1\n"
" mov r1, #0xa\n"
" mov r2, #0x1c\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r0, ._20 + 24 @ gSystemText_BackupDamagedGameContinue\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
" ldr r0, ._20 + 28 @ CB2_FadeAndReturnToTitleScreen\n"
" bl SetMainCallback2\n"
" b ._23\n"
"._21:\n"
" .align 2, 0\n"
"._20:\n"
" .word gSaveFailedClockInfo\n"
" .word gUnknown_Debug_03004BD0\n"
" .word gDamagedSaveSectors\n"
" .word gSystemText_CheckCompleteSaveAttempt\n"
" .word gSaveFailedType\n"
" .word gSystemText_SaveFailedBackupCheck\n"
" .word gSystemText_BackupDamagedGameContinue\n"
" .word CB2_FadeAndReturnToTitleScreen+1\n"
"._18:\n"
" mov r0, #0x1\n"
" mov r1, #0xa\n"
" mov r2, #0x1c\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r0, ._24 @ gGameContinueCallback\n"
" ldr r0, [r0]\n"
" cmp r0, #0\n"
" bne ._22 @cond_branch\n"
" ldr r0, ._24 + 4 @ gSystemText_SaveCompletedGameEnd\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
" b ._23\n"
"._25:\n"
" .align 2, 0\n"
"._24:\n"
" .word gGameContinueCallback\n"
" .word gSystemText_SaveCompletedGameEnd\n"
"._14:\n"
" mov r0, #0x1\n"
" mov r1, #0xa\n"
" mov r2, #0x1c\n"
" mov r3, #0x13\n"
" bl Menu_DrawStdWindowFrame\n"
" ldr r0, ._27 @ gSystemText_BackupDamagedGameContinue\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
" ldr r0, ._27 + 4 @ CB2_GameplayCannotBeContinued\n"
" bl SetMainCallback2\n"
" b ._26\n"
"._28:\n"
" .align 2, 0\n"
"._27:\n"
" .word gSystemText_BackupDamagedGameContinue\n"
" .word CB2_GameplayCannotBeContinued+1\n"
"._22:\n"
" ldr r0, ._29 @ gSystemText_SaveCompletedPressA\n"
" mov r1, #0x2\n"
" mov r2, #0xb\n"
" bl Menu_PrintText\n"
"._23:\n"
" ldr r0, ._29 + 4 @ CB2_FadeAndReturnToTitleScreen\n"
" bl SetMainCallback2\n"
"._26:\n"
" pop {r4, r5}\n"
" pop {r0}\n"
" bx r0\n"
"._30:\n"
" .align 2, 0\n"
"._29:\n"
" .word gSystemText_SaveCompletedPressA\n"
" .word CB2_FadeAndReturnToTitleScreen+1\n"
"\n"
);
}
#else
static void CB2_WipeSave(void)
{
u8 wipeTries = 0;
@ -198,8 +345,9 @@ static void CB2_WipeSave(void)
SetMainCallback2(CB2_FadeAndReturnToTitleScreen);
}
#endif
static void CB2_GameplayCannotBeContinued(void)
/*static*/ void CB2_GameplayCannotBeContinued(void)
{
gSaveFailedClockInfo[0] = FALSE;
@ -264,6 +412,41 @@ static void VBlankCB_UpdateClockGraphics(void)
gSaveFailedClockInfo[1]--;
}
#if DEBUG
__attribute__((naked))
bool8 VerifySectorWipe(u16 sector)
{
asm(
" push {lr}\n"
" lsl r0, r0, #0x10\n"
" lsr r0, r0, #0x10\n"
" ldr r2, ._50 @ \n"
" mov r3, #0x80\n"
" lsl r3, r3, #0x5\n"
" mov r1, #0x0\n"
" bl ReadFlash\n"
" mov r0, #0x0\n"
" ldr r1, ._50 + 4 @ \n"
"._49:\n"
" add r0, r0, #0x1\n"
" lsl r0, r0, #0x10\n"
" lsr r0, r0, #0x10\n"
" cmp r0, r1\n"
" bls ._49 @cond_branch\n"
" ldr r0, ._50 + 8 @ \n"
" ldrb r0, [r0]\n"
" pop {r1}\n"
" bx r1\n"
"._51:\n"
" .align 2, 0\n"
"._50:\n"
" .word +0x2000000\n"
" .word 0x3ff\n"
" .word gUnknown_Debug_03004BD0\n"
"\n"
);
}
#else
static bool8 VerifySectorWipe(u16 sector)
{
u32 *ptr = (u32 *)&gSharedMem;
@ -277,6 +460,7 @@ static bool8 VerifySectorWipe(u16 sector)
return FALSE;
}
#endif
static bool8 WipeSector(u16 sector)
{
@ -294,7 +478,7 @@ static bool8 WipeSector(u16 sector)
return failed;
}
static bool8 WipeSectors(u32 sectorBits)
/*static*/ bool8 WipeSectors(u32 sectorBits)
{
u16 i;

View File

@ -1,8 +1,10 @@
#include "global.h"
#include "debug.h"
#include "sprite.h"
#include "main.h"
#include "menu_cursor.h"
#include "palette.h"
#include "sprite.h"
#define MAX_SPRITE_COPY_REQUESTS 64
@ -822,6 +824,12 @@ static void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct Spr
gSpriteCopyRequests[gSpriteCopyRequestCount].size = images[index].size;
gSpriteCopyRequestCount++;
}
#if DEBUG
else
{
Crash(sDmaOverErrorMsg);
}
#endif
}
void RequestSpriteCopy(const void *src, u8 *dest, u16 size)
@ -833,6 +841,12 @@ void RequestSpriteCopy(const void *src, u8 *dest, u16 size)
gSpriteCopyRequests[gSpriteCopyRequestCount].size = size;
gSpriteCopyRequestCount++;
}
#if DEBUG
else
{
Crash(sDmaOverErrorMsg);
}
#endif
}
// these two functions are unused.

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "debug.h"
#include "task.h"
#define ACTIVE_SENTINEL 0x10
@ -11,8 +12,9 @@ struct Task gTasks[ACTIVE_SENTINEL];
static void InsertTask(u8 newTaskId);
static u8 FindFirstActiveTask();
// Unused string
const u8 sTaskOverString[] = _("TASK OVER\nタスクがオーバーしました");
const u8 gError_NoTasksLeft[] = _(
"TASK OVER\n"
"タスクがオーバーしました");
void ResetTasks()
{
@ -49,6 +51,10 @@ u8 CreateTask(TaskFunc func, u8 priority)
}
}
#if DEBUG
Crash(gError_NoTasksLeft);
#endif
return 0;
}

View File

@ -4495,8 +4495,8 @@ static __attribute__((naked)) void sub_804B41C(void)
}
#endif
static void sub_804B790(void)
// In-game trade init
void sub_804B790(void)
{
u8 otName[11];
switch (gMain.state)

View File

@ -5,6 +5,7 @@
#include "field_effect.h"
#include "graphics.h"
#include "link.h"
#include "m4a.h"
#include "main.h"
#include "menu.h"
#include "money.h"
@ -52,7 +53,6 @@ extern struct LinkPlayerMapObject gLinkPlayerMapObjects[];
EWRAM_DATA struct TrainerCard gTrainerCards[4] = {0};
extern const u8 gBadgesTiles[];
extern const u16 gUnknown_083B5F0C[];
extern const u16 gBadgesPalette[];
extern const u16 gUnknown_083B5F4C[];
@ -63,6 +63,34 @@ const u8 gBadgesTiles[] = INCBIN_U8("graphics/trainer_card/badges.4bpp");
// XXX: what is this?
u8 *const ewram_ = gSharedMem;
#if DEBUG
const struct TrainerCard gUnknown_Debug_083E0448 =
{
.gender = FEMALE,
.stars = 4,
.hasPokedex = TRUE,
.var_3 = TRUE,
.var_4 = TRUE,
.firstHallOfFameA = 999,
.firstHallOfFameB = 99,
.firstHallOfFameC = 99,
.pokedexSeen = 411,
.trainerId = 12345,
.playTimeHours = 99,
.playTimeMinutes = 99,
.linkBattleWins = 9999,
.linkBattleLosses = 9999,
.battleTowerWins = 9999,
.battleTowerLosses = 9999,
.contestsWithFriends = 999,
.pokeblocksWithFriends = 0xFFFF,
.pokemonTrades = 0xFFFF,
.money = 99999,
.var_28 = {1, 2, 3, 4},
.playerName = _("てすと"),
};
#endif
bool8 TrainerCard_Init(struct Task *);
bool8 TrainerCard_WaitForFadeInToFinish(struct Task *);
bool8 TrainerCard_WaitForKeys(struct Task *);
@ -176,8 +204,15 @@ static void TrainerCard_Back_PrintPokemonTrades_Label(void);
static void TrainerCard_Back_PrintPokemonTrades(void);
void unref_sub_8094588(u16 left, u16 top);
#if DEBUG
static u8 gDebug_03000748;
#endif
void TrainerCard_ShowPlayerCard(Callback arg1)
{
#if DEBUG
gDebug_03000748 = 0;
#endif
TrainerCard_InitScreenForPlayer(arg1);
SetMainCallback2(sub_8093174);
ewram0_2.language = GAME_LANGUAGE;
@ -185,11 +220,41 @@ void TrainerCard_ShowPlayerCard(Callback arg1)
void TrainerCard_ShowLinkCard(u8 playerIndex, Callback arg2)
{
#if DEBUG
gDebug_03000748 = 0;
#endif
TrainerCard_InitScreenForLinkPlayer(playerIndex, arg2);
SetMainCallback2(sub_8093174);
ewram0_2.language = gLinkPlayers[gLinkPlayerMapObjects[playerIndex].linkPlayerId].language;
}
#if DEBUG
void debug_sub_80A0710(Callback callback)
{
gDebug_03000748 = TRUE;
TrainerCard_InitScreenForPlayer(callback);
SetMainCallback2(sub_8093174);
ewram0_2.language = GAME_LANGUAGE;
}
void debug_sub_80A073C(Callback callback)
{
memcpy(&gTrainerCards[0], &gUnknown_Debug_083E0448, sizeof(struct TrainerCard));
gDebug_03000748=TRUE;
TrainerCard_InitScreenForLinkPlayer(0, callback);
SetMainCallback2(sub_8093174);
ewram0_2.language = GAME_LANGUAGE;
}
void debug_sub_80A0780()
{
int i;
for (i = 0; i < 4; i++)
memcpy(&gTrainerCards[i], &gUnknown_Debug_083E0448, sizeof(struct TrainerCard));
}
#endif
static void sub_8093174(void)
{
switch (gMain.state)
@ -538,6 +603,19 @@ static void TrainerCard_FillFlags(void)
}
}
}
#if DEBUG
if (gDebug_03000748 != 0)
{
ewram0_2.showHallOfFame = TRUE;
ewram0_2.showLinkBattleStatus = TRUE;
ewram0_2.showBattleTowerStatus = TRUE;
ewram0_2.showContestRecord = TRUE;
ewram0_2.showMixingRecord = TRUE;
ewram0_2.showTradingRecord = TRUE;
memset(ewram0_2.ownedBadges, TRUE, sizeof(ewram0_2.ownedBadges));
}
#endif
}
void sub_80937A4()
@ -630,6 +708,17 @@ bool8 TrainerCard_WaitForKeys(struct Task *task)
}
return TRUE;
}
#if DEBUG
else if (gDebug_03000748 && gMain.newKeys & R_BUTTON)
{
ewram0_2.starCount++;
ewram0_2.starCount %= 5;
TrainerCard_LoadPalettes();
if (ewram0_2.backSideShown == 0)
TrainerCard_DrawStars();
}
#endif
return FALSE;
}
@ -1334,7 +1423,11 @@ static void TrainerCard_Front_PrintPokedexCount(void)
{
u8 buffer[16];
if (!ewram0_2.showPokedexCount)
if (
#if DEBUG
gDebug_03000748 == 0 &&
#endif
!ewram0_2.showPokedexCount)
{
TrainerCard_ClearPokedexLabel();
}

View File

@ -259,7 +259,7 @@ static void SaveCurrentWinStreak(void);
static void sub_8135CFC(void);
static void CheckMonBattleTowerBanlist(u16, u16, u16, u8, u8, u16 *, u16 *, u8 *);
static void ClearEReaderTrainer(struct BattleTowerEReaderTrainer *);
static void SetEReaderTrainerChecksum(struct BattleTowerEReaderTrainer *ereaderTrainer);
void SetEReaderTrainerChecksum(struct BattleTowerEReaderTrainer *ereaderTrainer);
static void SetBattleTowerRecordChecksum(struct BattleTowerRecord *);
static void ClearBattleTowerRecord(struct BattleTowerRecord *);

View File

@ -999,6 +999,66 @@ extern u16 gSpecialVar_0x8006;
static u8 CalcBerryYield(struct BerryTree *tree);
static u16 GetStageDurationByBerryType(u8 berry);
#if DEBUG
__attribute__((naked))
void debug_sub_80C2B04()
{
asm(
" push {lr}\n"
" mov r0, #0x0\n"
" bl sub_80B47D8\n"
" lsl r0, r0, #0x18\n"
" lsr r0, r0, #0x18\n"
" ldr r2, ._1 @ gTasks\n"
" lsl r1, r0, #0x2\n"
" add r1, r1, r0\n"
" lsl r1, r1, #0x3\n"
" add r1, r1, r2\n"
" ldrh r0, [r1, #0x10]\n"
" sub r0, r0, #0x1\n"
" strh r0, [r1, #0x10]\n"
" bl CloseMenu\n"
" mov r0, #0x1\n"
" pop {r1}\n"
" bx r1\n"
"._2:\n"
" .align 2, 0\n"
"._1:\n"
" .word gTasks\n"
"\n"
);
}
__attribute__((naked))
void debug_sub_80C2B30()
{
asm(
" push {lr}\n"
" mov r0, #0x1\n"
" bl sub_80B47D8\n"
" lsl r0, r0, #0x18\n"
" lsr r0, r0, #0x18\n"
" ldr r2, ._3 @ gTasks\n"
" lsl r1, r0, #0x2\n"
" add r1, r1, r0\n"
" lsl r1, r1, #0x3\n"
" add r1, r1, r2\n"
" ldrh r0, [r1, #0x10]\n"
" sub r0, r0, #0x1\n"
" strh r0, [r1, #0x10]\n"
" bl CloseMenu\n"
" mov r0, #0x1\n"
" pop {r1}\n"
" bx r1\n"
"._4:\n"
" .align 2, 0\n"
"._3:\n"
" .word gTasks\n"
"\n"
);
}
#endif
// unused
// this could be static, but making it so causes a compile-time warning.
void ClearEnigmaBerries(void)
@ -1022,6 +1082,180 @@ void SetEnigmaBerry(u8 *src)
gSaveBlock1.enigmaBerry.berry.description2 = gSaveBlock1.enigmaBerry.description2;
}
#if DEBUG
__attribute__((naked))
void debug_sub_80C2BD0()
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" ldr r3, ._11 @ gSaveBlock1\n"
" ldr r1, ._11 + 4 @ 0x316c\n"
" add r4, r3, r1\n"
" ldr r6, [r4]\n"
" add r1, r1, #0x4\n"
" add r2, r3, r1\n"
" ldr r7, [r2]\n"
" mov r1, #0x0\n"
" str r1, [r4]\n"
" str r1, [r2]\n"
" add r4, r0, #0\n"
" mov r2, #0x0\n"
" ldr r5, ._11 + 8 @ 0x52b\n"
"._10:\n"
" add r0, r4, r1\n"
" ldrb r0, [r0]\n"
" add r2, r2, r0\n"
" add r1, r1, #0x1\n"
" cmp r1, r5\n"
" bls ._10 @cond_branch\n"
" ldr r1, ._11 + 4 @ 0x316c\n"
" add r0, r3, r1\n"
" str r6, [r0]\n"
" add r1, r1, #0x4\n"
" add r0, r3, r1\n"
" str r7, [r0]\n"
" add r0, r2, #0\n"
" pop {r4, r5, r6, r7}\n"
" pop {r1}\n"
" bx r1\n"
"._12:\n"
" .align 2, 0\n"
"._11:\n"
" .word gSaveBlock1\n"
" .word 0x316c\n"
" .word 0x52b\n"
"\n"
);
}
#endif
#if DEBUG
__attribute__((naked))
u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" mov r7, r9\n"
" mov r6, r8\n"
" push {r6, r7}\n"
" add r3, r0, #0\n"
" lsl r1, r1, #0x18\n"
" lsr r1, r1, #0x18\n"
" mov r9, r1\n"
" lsl r2, r2, #0x18\n"
" lsr r2, r2, #0x18\n"
" mov r8, r2\n"
" ldr r4, ._16 @ gSaveBlock1\n"
" ldr r1, ._16 + 4 @ 0x3160\n"
" add r0, r4, r1\n"
" add r2, r0, #0\n"
" ldr r1, ._16 + 8 @ gBerries\n"
" ldmia r1!, {r5, r6, r7}\n"
" stmia r2!, {r5, r6, r7}\n"
" ldmia r1!, {r5, r6, r7}\n"
" stmia r2!, {r5, r6, r7}\n"
" ldr r1, [r1]\n"
" str r1, [r2]\n"
" add r1, r3, #0\n"
" bl StringCopy\n"
" ldr r0, ._16 + 12 @ 0x361c\n"
" add r6, r4, r0\n"
" ldr r1, ._16 + 16 @ gUnknown_Debug_083F7F84\n"
" add r0, r6, #0\n"
" bl StringCopy\n"
" ldr r1, ._16 + 20 @ 0x3649\n"
" add r5, r4, r1\n"
" ldr r1, ._16 + 24 @ gUnknown_Debug_083F7F90\n"
" add r0, r5, #0\n"
" bl StringCopy\n"
" ldr r2, ._16 + 28 @ 0x316c\n"
" add r0, r4, r2\n"
" str r6, [r0]\n"
" ldr r6, ._16 + 32 @ 0x3170\n"
" add r0, r4, r6\n"
" str r5, [r0]\n"
" mov r2, #0x0\n"
" ldr r6, ._16 + 36 @ 0x47f\n"
" ldr r7, ._16 + 40 @ 0x317c\n"
" add r5, r4, r7\n"
" ldr r3, ._16 + 44 @ gSpriteImage_UnusedCherry\n"
"._13:\n"
" add r0, r2, r5\n"
" add r1, r2, r3\n"
" ldrb r1, [r1]\n"
" strb r1, [r0]\n"
" add r2, r2, #0x1\n"
" cmp r2, r6\n"
" ble ._13 @cond_branch\n"
" ldr r0, ._16 @ gSaveBlock1\n"
" ldr r3, ._16 + 48 @ gSpritePalette_UnusedCherry\n"
" ldr r2, ._16 + 52 @ 0x35fc\n"
" add r1, r0, r2\n"
" mov r2, #0xf\n"
"._14:\n"
" ldrh r0, [r3]\n"
" strh r0, [r1]\n"
" add r3, r3, #0x2\n"
" add r1, r1, #0x2\n"
" sub r2, r2, #0x1\n"
" cmp r2, #0\n"
" bge ._14 @cond_branch\n"
" mov r2, #0x0\n"
" ldr r5, ._16 + 56 @ gSaveBlock1\n"
" ldr r3, ._16 + 60 @ gUnknown_Debug_839B6CE\n"
"._15:\n"
" add r0, r2, r5\n"
" add r1, r2, r3\n"
" ldrb r1, [r1]\n"
" strb r1, [r0]\n"
" add r2, r2, #0x1\n"
" cmp r2, #0x11\n"
" ble ._15 @cond_branch\n"
" ldr r5, ._16 + 64 @ 0x3688\n"
" add r0, r4, r5\n"
" mov r6, r9\n"
" strb r6, [r0]\n"
" ldr r7, ._16 + 68 @ 0x3689\n"
" add r0, r4, r7\n"
" mov r1, r8\n"
" strb r1, [r0]\n"
" ldr r2, ._16 + 4 @ 0x3160\n"
" add r0, r4, r2\n"
" bl debug_sub_80C2BD0\n"
" add r5, r5, #0x4\n"
" add r1, r4, r5\n"
" str r0, [r1]\n"
" pop {r3, r4}\n"
" mov r8, r3\n"
" mov r9, r4\n"
" pop {r4, r5, r6, r7}\n"
" pop {r0}\n"
" bx r0\n"
"._17:\n"
" .align 2, 0\n"
"._16:\n"
" .word gSaveBlock1\n"
" .word 0x3160\n"
" .word gBerries\n"
" .word 0x361c\n"
" .word gUnknown_Debug_083F7F84\n"
" .word 0x3649\n"
" .word gUnknown_Debug_083F7F90\n"
" .word 0x316c\n"
" .word 0x3170\n"
" .word 0x47f\n"
" .word 0x317c\n"
" .word gSpriteImage_UnusedCherry\n"
" .word gSpritePalette_UnusedCherry\n"
" .word 0x35fc\n"
" .word gSaveBlock1+0x3676\n"
" .word gUnknown_Debug_839B6CE\n"
" .word 0x3688\n"
" .word 0x3689\n"
"\n"
);
}
#else
static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
{
const u8 *description1;
@ -1051,9 +1285,110 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
return checksum;
}
#endif
#if DEBUG
__attribute__((naked))
void debug_sub_80C2D24()
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" mov r7, r8\n"
" push {r7}\n"
" ldr r6, [sp, #0x18]\n"
" ldr r4, [sp, #0x1c]\n"
" mov r8, r4\n"
" ldr r5, ._18 @ gSaveBlock1\n"
" ldr r7, ._18 + 4 @ 0x3175\n"
" add r4, r5, r7\n"
" strb r0, [r4]\n"
" ldr r4, ._18 + 8 @ 0x3176\n"
" add r0, r5, r4\n"
" strb r1, [r0]\n"
" add r7, r7, #0x2\n"
" add r0, r5, r7\n"
" strb r2, [r0]\n"
" ldr r1, ._18 + 12 @ 0x3178\n"
" add r0, r5, r1\n"
" strb r3, [r0]\n"
" add r4, r4, #0x3\n"
" add r0, r5, r4\n"
" strb r6, [r0]\n"
" add r7, r7, #0x3\n"
" add r0, r5, r7\n"
" mov r1, r8\n"
" strb r1, [r0]\n"
" sub r4, r4, #0x19\n"
" add r0, r5, r4\n"
" bl debug_sub_80C2BD0\n"
" ldr r7, ._18 + 16 @ 0x368c\n"
" add r5, r5, r7\n"
" str r0, [r5]\n"
" pop {r3}\n"
" mov r8, r3\n"
" pop {r4, r5, r6, r7}\n"
" pop {r0}\n"
" bx r0\n"
"._19:\n"
" .align 2, 0\n"
"._18:\n"
" .word gSaveBlock1\n"
" .word 0x3175\n"
" .word 0x3176\n"
" .word 0x3178\n"
" .word 0x368c\n"
"\n"
);
}
#endif
// due to e-reader scans being particularly volatile to failure, it is a requirement to check for
// their integrity here due to scans possibly failing to produce the correct result.
#if DEBUG
__attribute__((naked))
bool32 IsEnigmaBerryValid()
{
asm(
" push {r4, lr}\n"
" ldr r4, ._24 @ gSaveBlock1\n"
" ldr r1, ._24 + 4 @ 0x3174\n"
" add r0, r4, r1\n"
" ldrb r0, [r0]\n"
" cmp r0, #0\n"
" beq ._22 @cond_branch\n"
" ldr r2, ._24 + 8 @ 0x316a\n"
" add r0, r4, r2\n"
" ldrb r0, [r0]\n"
" cmp r0, #0\n"
" beq ._22 @cond_branch\n"
" ldr r1, ._24 + 12 @ 0x3160\n"
" add r0, r4, r1\n"
" bl debug_sub_80C2BD0\n"
" ldr r2, ._24 + 16 @ 0x368c\n"
" add r1, r4, r2\n"
" ldr r1, [r1]\n"
" cmp r0, r1\n"
" bne ._22 @cond_branch\n"
" mov r0, #0x1\n"
" b ._23\n"
"._25:\n"
" .align 2, 0\n"
"._24:\n"
" .word gSaveBlock1\n"
" .word 0x3174\n"
" .word 0x316a\n"
" .word 0x3160\n"
" .word 0x368c\n"
"._22:\n"
" mov r0, #0x0\n"
"._23:\n"
" pop {r4}\n"
" pop {r1}\n"
" bx r1\n"
"\n"
);
}
#else
bool32 IsEnigmaBerryValid(void)
{
if (gSaveBlock1.enigmaBerry.berry.stageDuration == 0)
@ -1064,6 +1399,7 @@ bool32 IsEnigmaBerryValid(void)
return FALSE;
return TRUE;
}
#endif
const struct Berry *GetBerryInfo(u8 berry)
{
@ -1417,6 +1753,177 @@ bool8 PlayerHasBerries(void)
return IsBagPocketNonEmpty(BAG_BERRIES);
}
#if DEBUG
void debug_sub_80C33FC(u8 *buffer, s32 value, u8 n)
{
StringAppend(gStringVar4, buffer);
ConvertIntToDecimalStringN(gStringVar1, value, STR_CONV_MODE_LEADING_ZEROS, n);
StringAppend(gStringVar4, gStringVar1);
}
extern const u8 gUnknown_Debug_083F7F9D[];
extern const u8 gUnknown_Debug_083F7FA2[];
extern const u8 gUnknown_Debug_083F7FA9[];
extern const u8 gUnknown_Debug_083F7FB0[];
extern const u8 gUnknown_Debug_083F7FB7[];
extern const u8 gUnknown_Debug_083F7FBE[];
extern const u8 gUnknown_Debug_083F7FC5[];
extern const u8 gUnknown_Debug_083F7FCC[];
extern const u8 gUnknown_Debug_083F7FD3[];
extern const u8 gUnknown_Debug_083F7FD3[];
extern const u8 gUnknown_Debug_083F7FD3[];
#ifdef NONMATCHING
u8* DebugOpenBerryInfo(void)
{
s32 i;
u8 berryTreeId;
struct BerryTree *berryTree;
if (GetFieldObjectScriptPointerPlayerFacing() != &S_BerryTree)
return NULL;
berryTreeId = FieldObjectGetBerryTreeId(gSelectedMapObject);
berryTree = GetBerryTreeInfo(berryTreeId);
for (i = 0; i < 500; i++)
gStringVar4[i] |= 0xFF;
debug_sub_80C33FC(gUnknown_Debug_083F7F9D, berryTreeId, 3);
debug_sub_80C33FC(gUnknown_Debug_083F7FA2, berryTree->berry, 2);
debug_sub_80C33FC(gUnknown_Debug_083F7FA9, berryTree->stage, 2);
debug_sub_80C33FC(gUnknown_Debug_083F7FB0, berryTree->secondsUntilNextStage, 5);
debug_sub_80C33FC(gUnknown_Debug_083F7FB7, berryTree->berryYield, 2);
debug_sub_80C33FC(gUnknown_Debug_083F7FBE, berryTree->regrowthCount, 3);
debug_sub_80C33FC(gUnknown_Debug_083F7FC5, berryTree->growthSparkle, 1);
debug_sub_80C33FC(gUnknown_Debug_083F7FCC, berryTree->watered1, 1);
debug_sub_80C33FC(gUnknown_Debug_083F7FD3, berryTree->watered2, 1);
debug_sub_80C33FC(gUnknown_Debug_083F7FD3, berryTree->watered3, 1);
debug_sub_80C33FC(gUnknown_Debug_083F7FD3, berryTree->watered4, 1);
return gStringVar4;
}
#else
__attribute__((naked))
void DebugOpenBerryInfo()
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" bl GetFieldObjectScriptPointerPlayerFacing\n"
" ldr r1, ._138 @ S_BerryTree\n"
" cmp r0, r1\n"
" beq ._136 @cond_branch\n"
" mov r0, #0x0\n"
" b ._137\n"
"._139:\n"
" .align 2, 0\n"
"._138:\n"
" .word S_BerryTree\n"
"._136:\n"
" ldr r0, ._141 @ gSelectedMapObject\n"
" ldrb r0, [r0]\n"
" bl FieldObjectGetBerryTreeId\n"
" lsl r0, r0, #0x18\n"
" lsr r6, r0, #0x18\n"
" add r0, r6, #0\n"
" bl GetBerryTreeInfo\n"
" add r5, r0, #0\n"
" mov r2, #0x0\n"
" ldr r7, ._141 + 4 @ 0x1f3\n"
" ldr r4, ._141 + 8 @ gStringVar4\n"
" mov r3, #0xff\n"
"._140:\n"
" add r1, r2, r4\n"
" ldrb r0, [r1]\n"
" orr r0, r0, r3\n"
" strb r0, [r1]\n"
" add r2, r2, #0x1\n"
" cmp r2, r7\n"
" ble ._140 @cond_branch\n"
" ldr r0, ._141 + 12 @ gUnknown_Debug_083F7F9D\n"
" add r1, r6, #0\n"
" mov r2, #0x3\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 16 @ gUnknown_Debug_083F7FA2\n"
" ldrb r1, [r5]\n"
" mov r2, #0x2\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 20 @ gUnknown_Debug_083F7FA9\n"
" ldrb r1, [r5, #0x1]\n"
" lsl r1, r1, #0x19\n"
" lsr r1, r1, #0x19\n"
" mov r2, #0x2\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 24 @ gUnknown_Debug_083F7FB0\n"
" ldrh r1, [r5, #0x2]\n"
" mov r2, #0x5\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 28 @ gUnknown_Debug_083F7FB7\n"
" ldrb r1, [r5, #0x4]\n"
" mov r2, #0x2\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 32 @ gUnknown_Debug_083F7FBE\n"
" ldrb r1, [r5, #0x5]\n"
" lsl r1, r1, #0x1c\n"
" lsr r1, r1, #0x1c\n"
" mov r2, #0x3\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 36 @ gUnknown_Debug_083F7FC5\n"
" ldrb r1, [r5, #0x1]\n"
" lsr r1, r1, #0x7\n"
" mov r2, #0x1\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 40 @ gUnknown_Debug_083F7FCC\n"
" ldrb r1, [r5, #0x5]\n"
" lsl r1, r1, #0x1b\n"
" lsr r1, r1, #0x1f\n"
" mov r2, #0x1\n"
" bl debug_sub_80C33FC\n"
" ldr r4, ._141 + 44 @ gUnknown_Debug_083F7FD3\n"
" ldrb r1, [r5, #0x5]\n"
" lsl r1, r1, #0x1a\n"
" lsr r1, r1, #0x1f\n"
" add r0, r4, #0\n"
" mov r2, #0x1\n"
" bl debug_sub_80C33FC\n"
" ldrb r1, [r5, #0x5]\n"
" lsl r1, r1, #0x19\n"
" lsr r1, r1, #0x1f\n"
" add r0, r4, #0\n"
" mov r2, #0x1\n"
" bl debug_sub_80C33FC\n"
" ldrb r1, [r5, #0x5]\n"
" lsr r1, r1, #0x7\n"
" add r0, r4, #0\n"
" mov r2, #0x1\n"
" bl debug_sub_80C33FC\n"
" ldr r0, ._141 + 8 @ gStringVar4\n"
"._137:\n"
" pop {r4, r5, r6, r7}\n"
" pop {r1}\n"
" bx r1\n"
"._142:\n"
" .align 2, 0\n"
"._141:\n"
" .word gSelectedMapObject\n"
" .word 0x1f3\n"
" .word gStringVar4\n"
" .word gUnknown_Debug_083F7F9D\n"
" .word gUnknown_Debug_083F7FA2\n"
" .word gUnknown_Debug_083F7FA9\n"
" .word gUnknown_Debug_083F7FB0\n"
" .word gUnknown_Debug_083F7FB7\n"
" .word gUnknown_Debug_083F7FBE\n"
" .word gUnknown_Debug_083F7FC5\n"
" .word gUnknown_Debug_083F7FCC\n"
" .word gUnknown_Debug_083F7FD3\n"
"\n"
);
}
#endif
#endif
// whenever the player is not within view of the berry tree during its sparkle state, the
// sparkle state will be reset.
void ResetBerryTreeSparkleFlags(void)
@ -1445,3 +1952,17 @@ void ResetBerryTreeSparkleFlags(void)
}
}
}
#if DEBUG
static const u8 gUnknown_Debug_083F7F84[] = _("そとから きた きのみ");
static const u8 gUnknown_Debug_083F7F90[] = _("ただいま かいはつちゅう");
static const u8 gUnknown_Debug_083F7F9D[] = _("POS:");
static const u8 gUnknown_Debug_083F7FA2[] = _("\nTYPE:");
static const u8 gUnknown_Debug_083F7FA9[] = _("\nGROW:");
static const u8 gUnknown_Debug_083F7FB0[] = _("\nTIME:");
static const u8 gUnknown_Debug_083F7FB7[] = _("\nFCNT:");
static const u8 gUnknown_Debug_083F7FBE[] = _("\nSCNT:");
static const u8 gUnknown_Debug_083F7FC5[] = _("\nHOOK:");
static const u8 gUnknown_Debug_083F7FCC[] = _("\nWBIT:");
static const u8 gUnknown_Debug_083F7FD3[] = _("");
#endif

View File

@ -42,7 +42,7 @@ extern u8 gBerryCheck_Pal[];
extern u8 gUnknown_08E788E4[];
extern u8 gUnknown_08E78A84[];
static const u8 *const gUnknown_0841192C[] =
const u8 *const gUnknown_0841192C[] =
{
ContestStatsText_VerySoft,
ContestStatsText_Soft,

View File

@ -14,6 +14,11 @@ extern bool8 gBikeCyclingChallenge;
extern u8 gBikeCollisions;
extern u8 gUnusedBikeCameraAheadPanback;
#if DEBUG
extern u8 gUnknown_020297ED;
u8 debug_sub_805F2B0(u8);
#endif
static void MovePlayerOnMachBike(u8, u16, u16);
static u8 GetMachBikeTransition(u8 *);
static void MachBikeTransition_FaceDirection(u8);
@ -134,6 +139,13 @@ void MovePlayerOnBike(u8 direction, u16 newKeys, u16 heldKeys)
static void MovePlayerOnMachBike(u8 direction, u16 newKeys, u16 heldKeys)
{
#if DEBUG
if (gUnknown_020297ED && debug_sub_805F2B0(direction))
{
Bike_SetBikeStill();
return;
}
#endif
sMachBikeTransitions[GetMachBikeTransition(&direction)](direction);
}
@ -271,6 +283,14 @@ static void MachBikeTransition_TrySlowDown(u8 var)
// the acro bike requires the input handler to be executed before the transition can.
static void MovePlayerOnAcroBike(u8 newDirection, u16 newKeys, u16 heldKeys)
{
#if DEBUG
if (gUnknown_020297ED && debug_sub_805F2B0(newDirection))
{
Bike_SetBikeStill();
return;
}
#endif
sAcroBikeTransitions[CheckMovementInputAcroBike(&newDirection, newKeys, heldKeys)](newDirection);
}

View File

@ -528,6 +528,107 @@ static void BattleTowerEntryMenuCallback_Exit(u8 taskId)
sub_81227FC(taskId);
}
#if DEBUG
__attribute__((naked))
void debug_sub_81381B4()
{
asm(
" push {r4, r5, r6, r7, lr}\n"
" mov r7, r9\n"
" mov r6, r8\n"
" push {r6, r7}\n"
" ldr r4, ._189 @ gUnknown_02023A00\n"
" add r0, r4, #0\n"
" mov r1, #0x0\n"
" mov r2, #0x60\n"
" bl memset\n"
" mov r7, #0x0\n"
" mov r8, r4\n"
" mov r0, #0x4\n"
" add r0, r0, r8\n"
" mov r9, r0\n"
"._188:\n"
" mov r0, #0x64\n"
" add r1, r7, #0\n"
" mul r1, r1, r0\n"
" ldr r0, ._189 + 4 @ gPlayerParty\n"
" add r5, r1, r0\n"
" add r0, r5, #0\n"
" mov r1, #0x41\n"
" bl GetMonData\n"
" lsl r4, r7, #0x5\n"
" mov r1, r8\n"
" add r6, r4, r1\n"
" strh r0, [r6]\n"
" lsl r0, r0, #0x10\n"
" cmp r0, #0\n"
" beq ._187 @cond_branch\n"
" add r0, r5, #0\n"
" mov r1, #0x38\n"
" bl GetMonData\n"
" strb r0, [r6, #0xf]\n"
" add r0, r5, #0\n"
" mov r1, #0x39\n"
" bl GetMonData\n"
" strh r0, [r6, #0x10]\n"
" add r0, r5, #0\n"
" mov r1, #0x3a\n"
" bl GetMonData\n"
" strh r0, [r6, #0x12]\n"
" add r0, r5, #0\n"
" mov r1, #0x37\n"
" bl GetMonData\n"
" mov r1, r8\n"
" add r1, r1, #0x14\n"
" add r1, r4, r1\n"
" str r0, [r1]\n"
" add r0, r5, #0\n"
" mov r1, #0xc\n"
" bl GetMonData\n"
" strh r0, [r6, #0x2]\n"
" add r0, r5, #0\n"
" mov r1, #0x0\n"
" bl GetMonData\n"
" mov r1, r8\n"
" add r1, r1, #0x18\n"
" add r1, r4, r1\n"
" str r0, [r1]\n"
" add r0, r5, #0\n"
" bl GetMonGender\n"
" strb r0, [r6, #0x1c]\n"
" add r4, r4, r9\n"
" add r0, r5, #0\n"
" mov r1, #0x2\n"
" add r2, r4, #0\n"
" bl GetMonData\n"
" add r0, r4, #0\n"
" bl Text_StripExtCtrlCodes\n"
" add r0, r5, #0\n"
" mov r1, #0x3\n"
" bl GetMonData\n"
" strb r0, [r6, #0x1d]\n"
"._187:\n"
" add r0, r7, #1\n"
" lsl r0, r0, #0x18\n"
" lsr r7, r0, #0x18\n"
" cmp r7, #0x2\n"
" bls ._188 @cond_branch\n"
" pop {r3, r4}\n"
" mov r8, r3\n"
" mov r9, r4\n"
" pop {r4, r5, r6, r7}\n"
" pop {r0}\n"
" bx r0\n"
"._190:\n"
" .align 2, 0\n"
"._189:\n"
" .word gUnknown_02023A00\n"
" .word gPlayerParty+0x12c\n"
"\n"
);
}
#endif
bool8 SetupLinkMultiBattlePartyMenu(void)
{
switch (ewram1B000_alt.setupState)

View File

@ -164,3 +164,14 @@ u8 sub_81341D4(void)
}
return count;
}
#if DEBUG
void debug_sub_814A3A8(void)
{
u8 decor;
for (decor = 0; decor < DECOR_COUNT; decor++)
IsThereStorageSpaceForDecoration(decor);
}
#endif

View File

@ -4,6 +4,7 @@
#include "bike.h"
#include "coord_event_weather.h"
#include "daycare.h"
#include "debug.h"
#include "event_data.h"
#include "field_fadetransition.h"
#include "field_player_avatar.h"
@ -35,6 +36,7 @@ extern u16 gSpecialVar_Facing;
extern struct LinkPlayerMapObject gLinkPlayerMapObjects[];
extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
extern u8 gUnknown_020297ED;
static EWRAM_DATA u8 gUnknown_0202E8C0 = 0;
static EWRAM_DATA u16 gUnknown_0202E8C2 = 0;
@ -103,7 +105,7 @@ static void sub_8068C30(struct MapHeader *, s8, struct MapPosition *);
static bool8 map_warp_consider_2_to_inside(struct MapPosition *, u16, u8);
static s8 map_warp_check(struct MapHeader *, u16, u16, u8);
static u8 *mapheader_trigger_activate_at(struct MapHeader *, u16, u16, u8);
static struct BgEvent *FindInvisibleMapObjectByPosition(struct MapHeader *, u16, u16, u8);
static struct BgEvent *FindInvisibleMapObjectByPosition(struct MapHeader *, u16, u16, u8);;
void FieldClearPlayerInput(struct FieldInput *input)
{
@ -162,6 +164,31 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
input->dpadDirection = DIR_WEST;
else if (heldKeys & DPAD_RIGHT)
input->dpadDirection = DIR_EAST;
#if DEBUG
if ((heldKeys & R_BUTTON) && input->pressedStartButton)
{
input->input_field_1_2 = TRUE;
input->pressedStartButton = FALSE;
}
if (gUnknown_020297ED)
{
if (heldKeys & R_BUTTON)
{
input->input_field_1_1 = TRUE;
input->input_field_0_6 = FALSE;
input->input_field_0_1 = FALSE;
input->input_field_0_4 = FALSE;
input->input_field_0_5 = FALSE;
if (newKeys & SELECT_BUTTON)
{
input->input_field_1_0 = TRUE;
input->pressedSelectButton = FALSE;
}
}
if (heldKeys & L_BUTTON)
input->input_field_1_3 = TRUE;
}
#endif
}
int sub_8068024(struct FieldInput *input)
@ -173,10 +200,25 @@ int sub_8068024(struct FieldInput *input)
r6 = player_get_direction_lower_nybble();
player_get_pos_to_and_height(&position);
r4 = MapGridGetMetatileBehaviorAt(position.x, position.y);
if (CheckTrainers() == TRUE)
#if DEBUG
if (input->input_field_1_3 && dive_warp(&position, r4) == TRUE)
return TRUE;
if (mapheader_run_first_tag2_script_list_match() == 1)
#endif
if (
#if DEBUG
!input->input_field_1_1 &&
#endif
CheckTrainers() == TRUE)
return TRUE;
if (
#if DEBUG
!input->input_field_1_1 &&
#endif
mapheader_run_first_tag2_script_list_match() == 1)
return TRUE;
if (input->pressedBButton && sub_80687A4() == 1)
return TRUE;
if (input->input_field_0_6)
@ -211,6 +253,21 @@ int sub_8068024(struct FieldInput *input)
}
if (input->pressedSelectButton && sub_80A6D1C() == TRUE)
return TRUE;
#if DEBUG
if (input->input_field_1_0)
{
debug_sub_80888D8();
return TRUE;
}
if (input->input_field_1_2)
{
PlaySE(SE_WIN_OPEN);
DebugMenu_8077048();
return TRUE;
}
#endif
return FALSE;
}
@ -810,7 +867,7 @@ static struct BgEvent *FindInvisibleMapObjectByPosition(struct MapHeader *mapHea
return NULL;
}
int dive_warp(struct MapPosition *position, u16 b)
bool8 dive_warp(struct MapPosition *position, u16 b)
{
if (gMapHeader.mapType == MAP_TYPE_UNDERWATER && sub_805750C(b) == 0)
{

Some files were not shown because too many files have changed in this diff Show More