From 97c6201cfe57470cfb7f4d00961ec2247573eda8 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 9 Oct 2017 02:19:44 -0400 Subject: [PATCH 1/8] add build/ support. --- .gitignore | 1 + Makefile | 81 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index e1600820c..9f10eb5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ tools/* *.dump *.sa* Thumbs.db +build/ .DS_Store *.ddump diff --git a/Makefile b/Makefile index e176b1258..dd1a96ebb 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef LD := $(DEVKITARM)/bin/arm-none-eabi-ld -LDFLAGS := -T ld_script.ld -Map pokeemerald.map +LDFLAGS := -T ld_script.ld -Map ../../pokeemerald.map OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy @@ -35,17 +35,22 @@ RAMSCRGEN := tools/ramscrgen/ramscrgen .PHONY: rom clean compare tidy + +$(shell mkdir -p build/ build/emerald/{,asm,data,src}) + C_SRCS := $(wildcard src/*.c) -C_OBJS := $(C_SRCS:%.c=%.o) +C_OBJS := $(C_SRCS:%.c=build/emerald/%.o) ASM_SRCS := $(wildcard asm/*.s) -ASM_OBJS := $(ASM_SRCS:%.s=%.o) +ASM_OBJS := $(ASM_SRCS:%.s=build/emerald/%.o) DATA_ASM_SRCS := $(wildcard data/*.s) -DATA_ASM_OBJS := $(DATA_ASM_SRCS:%.s=%.o) +DATA_ASM_OBJS := $(DATA_ASM_SRCS:%.s=build/emerald/%.o) OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) +$OBJS_REL := $(OBJS:build/emerald/%=%) + ROM := pokeemerald.gba ELF := $(ROM:.gba=.elf) @@ -59,8 +64,10 @@ clean: tidy find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + tidy: - rm -f ld_script.ld sym_bss.ld sym_common.ld sym_ewram.ld - rm -f $(ROM) $(ELF) $(OBJS) $(C_SRCS:%.c=%.i) pokeemerald.map + rm -f pokeemerald.gba + rm -f pokeemerald.map + rm -f pokeemerald.elf + rm -r build/* include graphics_file_rules.mk @@ -75,56 +82,58 @@ include graphics_file_rules.mk %.lz: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@ -src/libc.o: CC1 := tools/agbcc/bin/old_agbcc -src/libc.o: CFLAGS := -O2 +%src/libc.o: CC1 := tools/agbcc/bin/old_agbcc +%src/libc.o: CFLAGS := -O2 -src/siirtc.o: CFLAGS := -mthumb-interwork +%src/siirtc.o: CFLAGS := -mthumb-interwork -src/agb_flash.o: CFLAGS := -O -mthumb-interwork -src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork -src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork +%src/agb_flash.o: CFLAGS := -O -mthumb-interwork +%src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork +%src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork -src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc -src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc +%src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc +%src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc ifeq ($(NODEP),) -%.o: c_dep = $(shell $(SCANINC) $*.c) +build/emerald/src/%.o: c_dep = $(shell $(SCANINC) src/$(*F).c) else -%.o: c_dep := +build/emerald/src/%.o: c_dep := endif -$(C_OBJS): %.o : %.c $$(c_dep) - @$(CPP) $(CPPFLAGS) $< -o $*.i - @$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s - @echo -e ".text\n\t.align\t2, 0\n" >> $*.s - $(AS) $(ASFLAGS) -o $@ $*.s +build/emerald/%.o : %.c $$(c_dep) + @$(CPP) $(CPPFLAGS) $< -o build/emerald/$*.i + @$(PREPROC) build/emerald/$*.i charmap.txt | $(CC1) $(CFLAGS) -o build/emerald/$*.s + @echo -e ".text\n\t.align\t2, 0\n" >> build/emerald/$*.s + $(AS) $(ASFLAGS) -o $@ build/emerald/$*.s ifeq ($(NODEP),) -%.o: asm_dep = $(shell $(SCANINC) $*.s) +build/emerald/asm/%.o: asm_dep = $(shell $(SCANINC) asm/$(*F).s) +build/emerald/data/%.o: asm_dep = $(shell $(SCANINC) data/$(*F).s) else -%.o: asm_dep := +build/emerald/asm/%.o: asm_dep := +build/emerald/data/%.o: asm_dep := endif -$(ASM_OBJS): %.o: %.s $$(asm_dep) +build/emerald/asm/%.o: asm/%.s $$(asm_dep) $(AS) $(ASFLAGS) -o $@ $< -$(DATA_ASM_OBJS): %.o: %.s $$(asm_dep) +build/emerald/data/%.o: data/%.s $$(asm_dep) $(PREPROC) $< charmap.txt | $(AS) $(ASFLAGS) -o $@ -sym_bss.ld: sym_bss.txt - $(RAMSCRGEN) .bss sym_bss.txt ENGLISH >$@ +build/emerald/sym_bss.ld: sym_bss.txt + cd build/emerald && ../../$(RAMSCRGEN) .bss ../../sym_bss.txt ENGLISH >sym_bss.ld -sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) - $(RAMSCRGEN) COMMON sym_common.txt ENGLISH -c src,common_syms >$@ +build/emerald/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) + cd build/emerald && ../../$(RAMSCRGEN) COMMON ../../sym_common.txt ENGLISH -c src,../../common_syms >sym_common.ld -sym_ewram.ld: sym_ewram.txt - $(RAMSCRGEN) ewram_data sym_ewram.txt ENGLISH >$@ +build/emerald/sym_ewram.ld: sym_ewram.txt + cd build/emerald && ../../$(RAMSCRGEN) ewram_data ../../sym_ewram.txt ENGLISH >sym_ewram.ld -ld_script.ld: ld_script.txt sym_bss.ld sym_common.ld sym_ewram.ld - sed -f ld_script.sed ld_script.txt >ld_script.ld +build/emerald/ld_script.ld: ld_script.txt build/emerald/sym_bss.ld build/emerald/sym_common.ld build/emerald/sym_ewram.ld + cd build/emerald && sed -f ../../ld_script.sed ../../ld_script.txt | sed "s#tools/#../../tools/#g" | sed "s#sound/#../../sound/#g" >ld_script.ld -$(ELF): ld_script.ld $(OBJS) - $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBGCC) +pokeemerald.elf: build/emerald/ld_script.ld $(OBJS) + cd build/emerald && $(LD) $(LDFLAGS) -o ../../$@ $(OBJS_REL) ../../$(LIBGCC) -$(ROM): $(ELF) +pokeemerald.gba: %.gba: %.elf $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@ From fdfbbb49518eb020a7d525039ab598629c1c24b5 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 9 Oct 2017 13:55:31 +0200 Subject: [PATCH 2/8] add diploma header and static names fix --- include/diploma.h | 6 ++++++ src/diploma.c | 29 +++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 include/diploma.h diff --git a/include/diploma.h b/include/diploma.h new file mode 100644 index 000000000..8d730fa05 --- /dev/null +++ b/include/diploma.h @@ -0,0 +1,6 @@ +#ifndef GUARD_DIPLOMA_H +#define GUARD_DIPLOMA_H + +void CB2_ShowDiploma(void); + +#endif // GUARD_DIPLOMA_H diff --git a/src/diploma.c b/src/diploma.c index f2cbcabb7..d4a269757 100755 --- a/src/diploma.c +++ b/src/diploma.c @@ -1,4 +1,5 @@ #include "global.h" +#include "diploma.h" #include "palette.h" #include "main.h" #include "gpu_regs.h" @@ -33,7 +34,7 @@ static void InitDiplomaBg(void); static void InitDiplomaWindow(void); static void PrintDiplomaText(u8 *, u8, u8); -EWRAM_DATA void **gDiplomaTilemapPtr = {NULL}; +EWRAM_DATA static void **sDiplomaTilemapPtr = {NULL}; static void VBlankCB(void) { @@ -42,14 +43,14 @@ static void VBlankCB(void) TransferPlttBuffer(); } -static const u16 gDiplomaPalettes[][16] = +static const u16 sDiplomaPalettes[][16] = { INCBIN_U16("graphics/misc/diploma_national.gbapal"), INCBIN_U16("graphics/misc/diploma_hoenn.gbapal"), }; -static const u8 gDiplomaTilemap[] = INCBIN_U8("graphics/misc/diploma_map.bin.lz"); -static const u8 gDiplomaTiles[] = INCBIN_U8("graphics/misc/diploma.4bpp.lz"); +static const u8 sDiplomaTilemap[] = INCBIN_U8("graphics/misc/diploma_map.bin.lz"); +static const u8 sDiplomaTiles[] = INCBIN_U8("graphics/misc/diploma.4bpp.lz"); void CB2_ShowDiploma(void) { @@ -76,15 +77,15 @@ void CB2_ShowDiploma(void) ResetSpriteData(); ResetPaletteFade(); FreeAllSpritePalettes(); - LoadPalette(gDiplomaPalettes, 0, 64); - gDiplomaTilemapPtr = malloc(0x1000); + LoadPalette(sDiplomaPalettes, 0, 64); + sDiplomaTilemapPtr = malloc(0x1000); InitDiplomaBg(); InitDiplomaWindow(); reset_temp_tile_data_buffers(); - decompress_and_copy_tile_data_to_vram(1, &gDiplomaTiles, 0, 0, 0); + decompress_and_copy_tile_data_to_vram(1, &sDiplomaTiles, 0, 0, 0); while (free_temp_tile_data_buffers_if_possible()) ; - LZDecompressWram(&gDiplomaTilemap, gDiplomaTilemapPtr); + LZDecompressWram(&sDiplomaTilemap, sDiplomaTilemapPtr); CopyBgTilemapBufferToVram(1); DisplayDiplomaText(); BlendPalettes(-1, 16, 0); @@ -122,7 +123,7 @@ static void Task_DiplomaFadeOut(u8 taskId) { if (!gPaletteFade.active) { - Free(gDiplomaTilemapPtr); + Free(sDiplomaTilemapPtr); FreeAllWindowBuffers(); DestroyTask(taskId); SetMainCallback2(sub_80861E8); @@ -147,7 +148,7 @@ static void DisplayDiplomaText(void) CopyWindowToVram(0, 3); } -static const struct BgTemplate gDiplomaBgTemplates[2] = +static const struct BgTemplate sDiplomaBgTemplates[2] = { { .bg = 0, @@ -172,8 +173,8 @@ static const struct BgTemplate gDiplomaBgTemplates[2] = static void InitDiplomaBg(void) { ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, gDiplomaBgTemplates, 2); - SetBgTilemapBuffer(1, gDiplomaTilemapPtr); + InitBgsFromTemplates(0, sDiplomaBgTemplates, 2); + SetBgTilemapBuffer(1, sDiplomaTilemapPtr); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); ShowBg(1); @@ -182,7 +183,7 @@ static void InitDiplomaBg(void) SetGpuReg(REG_OFFSET_BLDY, DISPCNT_MODE_0); } -static const struct WindowTemplate gDiplomaWinTemplates[2] = +static const struct WindowTemplate sDiplomaWinTemplates[2] = { { .priority = 0, @@ -198,7 +199,7 @@ static const struct WindowTemplate gDiplomaWinTemplates[2] = static void InitDiplomaWindow(void) { - InitWindows(gDiplomaWinTemplates); + InitWindows(sDiplomaWinTemplates); DeactivateAllTextPrinters(); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); FillWindowPixelBuffer(0, 0); From 6d66081be0b1b26ce55a6f1a2a20644e2ae5c7f7 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Mon, 9 Oct 2017 20:25:34 -0400 Subject: [PATCH 3/8] minor tweak to make tidy. --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dd1a96ebb..d10505145 100644 --- a/Makefile +++ b/Makefile @@ -64,9 +64,7 @@ clean: tidy find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + tidy: - rm -f pokeemerald.gba - rm -f pokeemerald.map - rm -f pokeemerald.elf + rm -f pokeemerald.{gba,map,elf} rm -r build/* include graphics_file_rules.mk From 57e5624e0619b8d96fb43ff68d9eeefe734b1a4f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 10 Oct 2017 18:01:45 +0200 Subject: [PATCH 4/8] battle9 is being worked on --- asm/battle_9.s | 1487 +-------------------- asm/battle_controller_opponent.s | 10 +- asm/battle_controller_player.s | 20 +- asm/battle_controller_player_partner.s | 6 +- asm/battle_controller_recorded_opponent.s | 6 +- asm/battle_controller_recorded_player.s | 8 +- asm/battle_controller_safari.s | 4 +- asm/battle_controller_wally.s | 6 +- asm/rom3.s | 6 +- include/battle_controllers.h | 1 + include/battle_script_commands.h | 2 +- ld_script.txt | 1 + src/battle_9.c | 525 ++++++++ src/battle_script_commands.c | 8 +- 14 files changed, 568 insertions(+), 1522 deletions(-) create mode 100644 src/battle_9.c diff --git a/asm/battle_9.s b/asm/battle_9.s index 0dfc105ec..6d77d1593 100644 --- a/asm/battle_9.s +++ b/asm/battle_9.s @@ -5,1487 +5,6 @@ .text - thumb_func_start ai_switch_perish_song -ai_switch_perish_song: @ 8062BF8 - push {lr} - ldr r1, =gStatuses3 - ldr r0, =gActiveBank - ldrb r2, [r0] - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08062C50 - ldr r0, =gDisableStructs - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0xF] - lsls r0, 28 - cmp r0, 0 - bne _08062C50 - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, r2, r0 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062C52 - .pool -_08062C50: - movs r0, 0 -_08062C52: - pop {r1} - bx r1 - thumb_func_end ai_switch_perish_song - - thumb_func_start sub_8062C58 -sub_8062C58: @ 8062C58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062C72 - b _08062E2C -_08062C72: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r4, =gBattleMons - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x58 - muls r0, r1 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x19 - beq _08062C9E - b _08062E2C -_08062C9E: - mov r0, r10 - bl GetBankByIdentity - lsls r0, 24 - lsrs r2, r0, 24 - movs r6, 0 - mov r8, r4 - movs r7, 0x58 - adds r0, r2, 0 - muls r0, r7 - adds r4, r0, r4 - movs r0, 0x20 - adds r0, r4 - mov r9, r0 -_08062CBA: - lsls r1, r6, 1 - ldr r5, =gActiveBank - ldrb r0, [r5] - muls r0, r7 - adds r1, r0 - mov r0, r8 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08062CE8 - ldrh r1, [r4] - mov r3, r9 - ldrb r2, [r3] - bl AI_TypeCalc - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062CE8 - b _08062E2C -_08062CE8: - adds r6, 0x1 - cmp r6, 0x3 - ble _08062CBA - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062D50 - ldrb r1, [r5] - movs r0, 0x2 - ands r0, r1 - adds r1, r5, 0 - cmp r0, 0 - bne _08062D20 - movs r4, 0 - movs r0, 0x3 - str r0, [sp] - b _08062D58 - .pool -_08062D20: - movs r4, 0x3 - movs r3, 0x6 - str r3, [sp] - b _08062D58 -_08062D28: - ldr r0, =gActiveBank - ldrb r0, [r0] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _08062E2E - .pool -_08062D50: - movs r4, 0 - movs r3, 0x6 - str r3, [sp] - adds r1, r5, 0 -_08062D58: - ldrb r0, [r1] - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - mov r9, r1 - cmp r0, 0 - bne _08062D6C - ldr r3, =gPlayerParty - mov r9, r3 -_08062D6C: - adds r6, r4, 0 - ldr r0, [sp] - cmp r6, r0 - bge _08062E2C -_08062D74: - movs r0, 0x64 - adds r5, r6, 0 - muls r5, r0 - mov r1, r9 - adds r4, r1, r5 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08062E24 - ldr r1, =gBattlePartyID - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _08062E24 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - adds r0, r4, 0 - movs r1, 0x2E - bl GetMonData - mov r0, r10 - bl GetBankByIdentity - lsls r0, 24 - lsrs r2, r0, 24 - movs r4, 0 - mov r8, r5 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r2 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_08062DE0: - adds r1, r4, 0 - adds r1, 0xD - mov r0, r9 - add r0, r8 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _08062E1E - ldrh r1, [r5] - ldrb r2, [r7] - bl AI_TypeCalc - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08062E1E - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _08062D28 -_08062E1E: - adds r4, 0x1 - cmp r4, 0x3 - ble _08062DE0 -_08062E24: - adds r6, 0x1 - ldr r3, [sp] - cmp r6, r3 - blt _08062D74 -_08062E2C: - movs r0, 0 -_08062E2E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8062C58 - - thumb_func_start sub_8062E54 -sub_8062E54: @ 8062E54 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - movs r0, 0x1 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - beq _08062E82 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08062E82 - b _080630AC -_08062E82: - ldr r1, =gUnknown_02024250 - ldr r5, =gActiveBank - ldrb r3, [r5] - lsls r0, r3, 1 - adds r4, r0, r1 - ldrh r1, [r4] - cmp r1, 0 - bne _08062E94 - b _080630AC -_08062E94: - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08062E9C - b _080630AC -_08062E9C: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08062EB0 - b _080630AC -_08062EB0: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08062F1A - mov r8, r3 - mov r0, r8 - bl GetBankIdentity - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - ldr r1, =gAbsentBankFlags - ldrb r1, [r1] - ldr r2, =gBitTable - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08062F04 - ldrb r7, [r5] - b _08062F1E - .pool -_08062F04: - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - lsls r0, 24 - lsrs r7, r0, 24 - b _08062F1E -_08062F1A: - adds r7, r3, 0 - mov r8, r7 -_08062F1E: - ldr r3, =gBattleMoves - ldr r1, =gUnknown_02024250 - ldr r2, =gActiveBank - ldrb r0, [r2] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x2] - cmp r0, 0xA - bne _08062F4C - movs r0, 0x12 - b _08062F5E - .pool -_08062F4C: - cmp r0, 0xB - bne _08062F56 - movs r1, 0xB - str r1, [sp] - b _08062F60 -_08062F56: - cmp r0, 0xD - beq _08062F5C - b _080630AC -_08062F5C: - movs r0, 0xA -_08062F5E: - str r0, [sp] -_08062F60: - ldr r1, =gBattleMons - ldrb r3, [r2] - movs r0, 0x58 - muls r0, r3 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp] - cmp r0, r1 - bne _08062F76 - b _080630AC -_08062F76: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08062FCC - movs r0, 0x2 - ands r3, r0 - cmp r3, 0 - bne _08062F9C - movs r4, 0 - movs r0, 0x3 - b _08062FD0 - .pool -_08062F9C: - movs r4, 0x3 - movs r1, 0x6 - mov r10, r1 - b _08062FD2 -_08062FA4: - ldr r0, =gActiveBank - ldrb r0, [r0] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r5, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080630AE - .pool -_08062FCC: - movs r4, 0 - movs r0, 0x6 -_08062FD0: - mov r10, r0 -_08062FD2: - ldrb r0, [r2] - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - str r1, [sp, 0x4] - cmp r0, 0 - bne _08062FE6 - ldr r2, =gPlayerParty - str r2, [sp, 0x4] -_08062FE6: - adds r5, r4, 0 - cmp r5, r10 - bge _080630AC - ldr r0, =gBaseStats - mov r9, r0 -_08062FF0: - movs r0, 0x64 - muls r0, r5 - ldr r1, [sp, 0x4] - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080630A6 - ldr r1, =gBattlePartyID - mov r2, r8 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080630A6 - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080630A6 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r6, 0 - movs r1, 0x2E - bl GetMonData - cmp r0, 0 - beq _08063088 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x17] - b _08063092 - .pool -_08063088: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x16] -_08063092: - ldr r1, [sp] - cmp r1, r0 - bne _080630A6 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _080630A6 - b _08062FA4 -_080630A6: - adds r5, 0x1 - cmp r5, r10 - blt _08062FF0 -_080630AC: - movs r0, 0 -_080630AE: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8062E54 - - thumb_func_start ai_switchout_natural_cure -ai_switchout_natural_cure: @ 80630C0 - push {r4,r5,lr} - ldr r3, =gBattleMons - ldr r5, =gActiveBank - ldrb r4, [r5] - movs r0, 0x58 - adds r2, r4, 0 - muls r2, r0 - adds r0, r3, 0 - adds r0, 0x4C - adds r0, r2, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08063188 - adds r1, r2, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x1E - bne _08063188 - ldrh r0, [r1, 0x2C] - ldrh r1, [r1, 0x28] - lsrs r0, 1 - cmp r1, r0 - bcc _08063188 - ldr r1, =gUnknown_02024250 - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _08063106 - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08063128 -_08063106: - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063128 - ldrb r0, [r5] - b _08063190 - .pool -_08063128: - ldr r2, =gBattleMoves - ldr r1, =gUnknown_02024250 - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _08063160 - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063160 - ldrb r0, [r4] - b _08063190 - .pool -_08063160: - movs r0, 0x8 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - movs r0, 0x4 - movs r1, 0x1 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _080631AA - bl Random - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _0806318C -_08063188: - movs r0, 0 - b _080631AC -_0806318C: - ldr r0, =gActiveBank - ldrb r0, [r0] -_08063190: - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb -_080631AA: - movs r0, 0x1 -_080631AC: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end ai_switchout_natural_cure - - thumb_func_start ai_has_super_effective_move_on_field -ai_has_super_effective_move_on_field: @ 80631BC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gAbsentBankFlags - ldrb r1, [r0] - ldr r2, =gBitTable - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _08063256 - movs r4, 0 - ldr r6, =gBattleMons - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r0, 0x20 - adds r0, r5 - mov r8, r0 -_0806320A: - lsls r1, r4, 1 - ldr r0, =gActiveBank - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _08063250 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl AI_TypeCalc - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _08063250 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_08063250: - adds r4, 0x1 - cmp r4, 0x3 - ble _0806320A -_08063256: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0806327C - b _080632FA - .pool -_08063278: - movs r0, 0x1 - b _080632FC -_0806327C: - movs r1, 0x2 - mov r0, r10 - eors r0, r1 - bl GetBankByIdentity - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, =gAbsentBankFlags - ldrb r1, [r0] - ldr r2, =gBitTable - lsls r0, r3, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - bne _080632FA - movs r4, 0 - ldr r6, =gBattleMons - movs r7, 0x58 - adds r0, r3, 0 - muls r0, r7 - adds r5, r0, r6 - movs r3, 0x20 - adds r3, r5 - mov r8, r3 -_080632AE: - lsls r1, r4, 1 - ldr r0, =gActiveBank - ldrb r0, [r0] - muls r0, r7 - adds r1, r0 - adds r0, r6, 0 - adds r0, 0xC - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080632F4 - ldrh r1, [r5] - mov r3, r8 - ldrb r2, [r3] - bl AI_TypeCalc - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080632F4 - mov r0, r9 - cmp r0, 0 - bne _08063278 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08063278 -_080632F4: - adds r4, 0x1 - cmp r4, 0x3 - ble _080632AE -_080632FA: - movs r0, 0 -_080632FC: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_has_super_effective_move_on_field - - thumb_func_start ai_is_too_invested_in_stat_buffs -ai_is_too_invested_in_stat_buffs: @ 806331C - push {r4,lr} - movs r4, 0 - ldr r1, =gBattleMons - ldr r0, =gActiveBank - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x18 - adds r2, r0, r1 - movs r3, 0x7 -_08063330: - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0x6 - ble _08063346 - subs r1, 0x6 - lsls r0, r4, 24 - asrs r0, 24 - adds r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 -_08063346: - adds r2, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08063330 - movs r0, 0 - cmp r4, 0x3 - bls _08063356 - movs r0, 0x1 -_08063356: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end ai_is_too_invested_in_stat_buffs - - thumb_func_start ai_switchout_something -ai_switchout_something: @ 8063364 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - str r1, [sp, 0x4] - ldr r2, =gUnknown_02024250 - ldr r1, =gActiveBank - ldrb r3, [r1] - lsls r0, r3, 1 - adds r4, r0, r2 - ldrh r2, [r4] - adds r5, r1, 0 - cmp r2, 0 - bne _08063390 - b _080635EE -_08063390: - ldr r0, =0x0000ffff - cmp r2, r0 - bne _08063398 - b _080635EE -_08063398: - ldr r0, =gUnknown_02024270 - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080633A4 - b _080635EE -_080633A4: - ldr r2, =gBattleMoves - ldrh r1, [r4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _080633B8 - b _080635EE -_080633B8: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0806342C - mov r9, r3 - mov r0, r9 - bl GetBankIdentity - movs r4, 0x2 - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - ldr r1, =gAbsentBankFlags - ldrb r1, [r1] - ldr r2, =gBitTable - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063414 - ldrb r5, [r5] - mov r10, r5 - b _08063430 - .pool -_08063414: - ldrb r0, [r5] - bl GetBankIdentity - eors r0, r4 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - b _08063430 -_0806342C: - mov r9, r3 - mov r10, r9 -_08063430: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063490 - ldr r2, =gActiveBank - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - adds r5, r2, 0 - cmp r0, 0 - bne _08063460 - movs r4, 0 - movs r0, 0x3 - str r0, [sp, 0x8] - b _08063498 - .pool -_08063460: - movs r4, 0x3 - movs r1, 0x6 - str r1, [sp, 0x8] - b _08063498 -_08063468: - ldr r0, =gActiveBank - ldrb r0, [r0] - ldr r1, =gBattleStruct - ldr r1, [r1] - adds r0, r1 - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - strb r6, [r0] - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb - movs r0, 0x1 - b _080635F0 - .pool -_08063490: - movs r4, 0 - movs r0, 0x6 - str r0, [sp, 0x8] - ldr r5, =gActiveBank -_08063498: - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - str r1, [sp, 0xC] - cmp r0, 0 - bne _080634AC - ldr r2, =gPlayerParty - str r2, [sp, 0xC] -_080634AC: - adds r6, r4, 0 - b _080635E6 - .pool -_080634BC: - movs r0, 0x64 - muls r0, r6 - ldr r1, [sp, 0xC] - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - bne _080634D2 - b _080635E4 -_080634D2: - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - bne _080634E0 - b _080635E4 -_080634E0: - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080635E4 - ldr r1, =gBattlePartyID - mov r2, r9 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r6, r0 - beq _080635E4 - ldr r0, =gBattleStruct - ldr r1, [r0] - mov r2, r9 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - mov r2, r10 - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r6, r0 - beq _080635E4 - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r5, 0 - movs r1, 0x2E - bl GetMonData - cmp r0, 0 - beq _08063558 - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gBaseStats - adds r0, r1 - ldrb r2, [r0, 0x17] - b _08063564 - .pool -_08063558: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r2, =gBaseStats - adds r0, r2 - ldrb r2, [r0, 0x16] -_08063564: - ldr r1, =gUnknown_02024250 - ldr r5, =gActiveBank - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - adds r1, r4, 0 - bl AI_TypeCalc - ldr r1, [sp] - ands r1, r0 - cmp r1, 0 - beq _080635E4 - ldr r1, =gUnknown_02024270 - ldrb r0, [r5] - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 - movs r4, 0 - movs r0, 0x64 - adds r1, r6, 0 - muls r1, r0 - mov r8, r1 - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - adds r5, r0, r1 - adds r7, r5, 0 - adds r7, 0x20 -_080635A2: - adds r1, r4, 0 - adds r1, 0xD - ldr r0, [sp, 0xC] - add r0, r8 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - beq _080635DE - ldrh r1, [r5] - ldrb r2, [r7] - bl AI_TypeCalc - lsls r0, 24 - lsrs r1, r0, 24 - movs r0, 0x2 - ands r1, r0 - cmp r1, 0 - beq _080635DE - bl Random - lsls r0, 16 - lsrs r0, 16 - ldr r1, [sp, 0x4] - bl __modsi3 - cmp r0, 0 - bne _080635DE - b _08063468 -_080635DE: - adds r4, 0x1 - cmp r4, 0x3 - ble _080635A2 -_080635E4: - adds r6, 0x1 -_080635E6: - ldr r0, [sp, 0x8] - cmp r6, r0 - bge _080635EE - b _080634BC -_080635EE: - movs r0, 0 -_080635F0: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ai_switchout_something - - thumb_func_start sub_8063614 -sub_8063614: @ 8063614 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r6, =gBattleMons - ldr r4, =gActiveBank - ldrb r2, [r4] - movs r5, 0x58 - adds r0, r2, 0 - muls r0, r5 - adds r1, r6, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x0400e000 - ands r0, r1 - cmp r0, 0 - beq _0806363E - b _0806386C -_0806363E: - ldr r0, =gStatuses3 - lsls r1, r2, 2 - adds r1, r0 - ldr r1, [r1] - movs r0, 0x80 - lsls r0, 3 - ands r1, r0 - cmp r1, 0 - beq _08063652 - b _0806386C -_08063652: - str r1, [sp] - movs r0, 0xC - adds r1, r2, 0 - movs r2, 0x17 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _0806366A - b _0806386C -_0806366A: - ldrb r1, [r4] - str r0, [sp] - movs r0, 0xC - movs r2, 0x47 - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08063682 - b _0806386C -_08063682: - str r0, [sp] - movs r0, 0xE - movs r1, 0 - movs r2, 0x2A - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _080636B4 - ldrb r0, [r4] - muls r0, r5 - adds r1, r0, r6 - adds r0, r1, 0 - adds r0, 0x21 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636A8 - b _0806386C -_080636A8: - adds r0, r1, 0 - adds r0, 0x22 - ldrb r0, [r0] - cmp r0, 0x8 - bne _080636B4 - b _0806386C -_080636B4: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _080636C4 - b _0806386C -_080636C4: - movs r0, 0 - mov r10, r0 - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _0806372E - ldrb r7, [r4] - adds r0, r7, 0 - bl GetBankIdentity - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - ldr r1, =gAbsentBankFlags - ldrb r1, [r1] - ldr r2, =gBitTable - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063718 - ldrb r6, [r4] - b _08063732 - .pool -_08063718: - ldrb r0, [r4] - bl GetBankIdentity - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - lsls r0, 24 - lsrs r6, r0, 24 - b _08063732 -_0806372E: - ldrb r6, [r4] - adds r7, r6, 0 -_08063732: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063768 - ldr r2, =gActiveBank - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063760 - movs r4, 0 - movs r1, 0x3 - mov r8, r1 - b _08063770 - .pool -_08063760: - movs r4, 0x3 - movs r0, 0x6 - mov r8, r0 - b _08063770 -_08063768: - movs r4, 0 - movs r1, 0x6 - mov r8, r1 - ldr r2, =gActiveBank -_08063770: - ldrb r0, [r2] - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - mov r9, r1 - cmp r0, 0 - bne _08063784 - ldr r0, =gPlayerParty - mov r9, r0 -_08063784: - adds r5, r4, 0 - cmp r5, r8 - bge _080637F2 -_0806378A: - movs r0, 0x64 - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _080637EC - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _080637EC - ldr r1, =gBattlePartyID - lsls r0, r7, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r5, r0 - beq _080637EC - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r5, r0 - beq _080637EC - movs r0, 0x1 - add r10, r0 -_080637EC: - adds r5, 0x1 - cmp r5, r8 - blt _0806378A -_080637F2: - mov r1, r10 - cmp r1, 0 - beq _0806386C - bl ai_switch_perish_song - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062C58 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl sub_8062E54 - lsls r0, 24 - cmp r0, 0 - bne _08063852 - bl ai_switchout_natural_cure - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0 - bl ai_has_super_effective_move_on_field - lsls r0, 24 - cmp r0, 0 - bne _0806386C - bl ai_is_too_invested_in_stat_buffs - lsls r0, 24 - cmp r0, 0 - bne _0806386C - movs r0, 0x8 - movs r1, 0x2 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - bne _08063852 - movs r0, 0x4 - movs r1, 0x3 - bl ai_switchout_something - lsls r0, 24 - cmp r0, 0 - beq _0806386C -_08063852: - movs r0, 0x1 - b _0806386E - .pool -_0806386C: - movs r0, 0 -_0806386E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8063614 - thumb_func_start sub_8063880 sub_8063880: @ 8063880 push {r4-r7,lr} @@ -1515,7 +34,7 @@ _080638A8: bne _080638B6 b _080639E6 _080638B6: - bl sub_8063614 + bl ShouldSwitch lsls r0, 24 cmp r0, 0 bne _080638C2 @@ -1659,7 +178,7 @@ _080639E6: lsls r2, 8 movs r0, 0x1 movs r1, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _080639F8: pop {r3} mov r8, r3 @@ -2802,7 +1321,7 @@ _08064328: movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 ldr r0, =gActiveBank ldrb r0, [r0] lsrs r0, 1 diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s index 48b7c7bf4..3fbeac5c1 100644 --- a/asm/battle_controller_opponent.s +++ b/asm/battle_controller_opponent.s @@ -5243,7 +5243,7 @@ sub_8061FB8: @ 8061FB8 movs r0, 0x1 movs r1, 0xA _08061FD6: - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _08061FDA: bl OpponentBufferExecCompleted b _08062156 @@ -5347,7 +5347,7 @@ _0806209C: movs r0, 0x1 movs r1, 0xA adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08061FDA .pool _080620C4: @@ -5378,7 +5378,7 @@ _080620C6: movs r0, 0x1 movs r1, 0xA adds r2, r4, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08062152 .pool _08062108: @@ -5401,7 +5401,7 @@ _08062108: orrs r2, r4 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08062152 .pool _0806213C: @@ -5413,7 +5413,7 @@ _0806213C: orrs r2, r4 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _08062152: bl OpponentBufferExecCompleted _08062156: diff --git a/asm/battle_controller_player.s b/asm/battle_controller_player.s index 94d4cdef0..e5381b4d8 100644 --- a/asm/battle_controller_player.s +++ b/asm/battle_controller_player.s @@ -226,7 +226,7 @@ _0805764C: movs r0, 0x1 movs r1, 0x3 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _080577C2 _08057658: movs r0, 0x20 @@ -393,7 +393,7 @@ _080577B2: movs r1, 0xC _080577BC: movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _080577C2: bl PlayerBufferExecCompleted b _080577E8 @@ -518,7 +518,7 @@ _080578A0: orrs r2, r0 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 ldrb r0, [r4] movs r1, 0x1 bl dp11b_obj_free @@ -1086,7 +1086,7 @@ _08057E14: _08057E1C: movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl PlayerBufferExecCompleted b _08057F9E .pool @@ -3413,7 +3413,7 @@ _080591FE: lsrs r2, 16 movs r0, 0x1 movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 strb r5, [r4] bl battle_type_is_double lsls r0, 24 @@ -3686,7 +3686,7 @@ _08059430: lsrs r2, 16 movs r0, 0x1 movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 strb r5, [r4] ldr r0, =sub_8059544 str r0, [r6] @@ -4291,14 +4291,14 @@ _08059A2C: movs r0, 0x1 movs r1, 0xE movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08059A76 .pool _08059A6C: movs r0, 0x1 movs r1, 0xD movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _08059A76: bl PlayerBufferExecCompleted _08059A7A: @@ -8658,7 +8658,7 @@ sub_805C158: @ 805C158 lsrs r2, 16 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl PlayerBufferExecCompleted _0805C194: pop {r0} @@ -9378,7 +9378,7 @@ sub_805C80C: @ 805C80C movs r0, 0x1 movs r1, 0 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl PlayerBufferExecCompleted pop {r0} bx r0 diff --git a/asm/battle_controller_player_partner.s b/asm/battle_controller_player_partner.s index 0ddd2a924..269e5347b 100644 --- a/asm/battle_controller_player_partner.s +++ b/asm/battle_controller_player_partner.s @@ -645,7 +645,7 @@ _081BB2E2: lsrs r2, 16 movs r0, 0x1 movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 strb r5, [r4] bl battle_type_is_double lsls r0, 24 @@ -918,7 +918,7 @@ _081BB514: lsrs r2, 16 movs r0, 0x1 movs r1, 0xB - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 strb r5, [r4] ldr r0, =sub_81BB628 str r0, [r6] @@ -5068,7 +5068,7 @@ _081BDB3C: orrs r2, r5 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl PlayerPartnerBufferExecCompleted pop {r4-r6} pop {r0} diff --git a/asm/battle_controller_recorded_opponent.s b/asm/battle_controller_recorded_opponent.s index 152dfca9c..c55bf641f 100644 --- a/asm/battle_controller_recorded_opponent.s +++ b/asm/battle_controller_recorded_opponent.s @@ -4754,7 +4754,7 @@ sub_8188EF0: @ 8188EF0 lsrs r1, 24 movs r0, 0x1 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl RecordedOpponentBufferExecCompleted pop {r0} bx r0 @@ -4785,7 +4785,7 @@ sub_8188F20: @ 8188F20 lsrs r2, 16 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08188F6C .pool _08188F48: @@ -4803,7 +4803,7 @@ _08188F48: orrs r2, r4 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _08188F6C: bl RecordedOpponentBufferExecCompleted pop {r4,r5} diff --git a/asm/battle_controller_recorded_player.s b/asm/battle_controller_recorded_player.s index a2ea742b7..836ff5b95 100644 --- a/asm/battle_controller_recorded_player.s +++ b/asm/battle_controller_recorded_player.s @@ -4861,7 +4861,7 @@ sub_818C49C: @ 818C49C lsrs r1, 24 movs r0, 0x1 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl RecordedPlayerBufferExecCompleted _0818C4C6: pop {r0} @@ -4897,7 +4897,7 @@ _0818C508: lsrs r1, 24 movs r0, 0x1 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl RecordedPlayerBufferExecCompleted _0818C522: pop {r0} @@ -4929,7 +4929,7 @@ sub_818C538: @ 818C538 lsrs r2, 16 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _0818C584 .pool _0818C560: @@ -4947,7 +4947,7 @@ _0818C560: orrs r2, r4 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _0818C584: bl RecordedPlayerBufferExecCompleted pop {r4,r5} diff --git a/asm/battle_controller_safari.s b/asm/battle_controller_safari.s index a5acca8c1..c3fbd0aad 100644 --- a/asm/battle_controller_safari.s +++ b/asm/battle_controller_safari.s @@ -103,13 +103,13 @@ _0815942A: movs r1, 0x7 _0815942E: movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 b _08159440 _08159436: movs r0, 0x1 movs r1, 0x8 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 _08159440: bl SafariBufferExecCompleted b _0815954E diff --git a/asm/battle_controller_wally.s b/asm/battle_controller_wally.s index 64c8b4442..f80292bcc 100644 --- a/asm/battle_controller_wally.s +++ b/asm/battle_controller_wally.s @@ -153,7 +153,7 @@ _081684CE: movs r1, 0x9 _081684E4: movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl WallyBufferExecCompleted ldr r1, [r4] adds r1, 0x94 @@ -208,7 +208,7 @@ _08168540: movs r0, 0x1 movs r1, 0x1 movs r2, 0 - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl WallyBufferExecCompleted _08168564: pop {r4,r5} @@ -3777,7 +3777,7 @@ _0816A550: lsls r2, 1 movs r0, 0x1 movs r1, 0xA - bl dp01_build_cmdbuf_x21_a_bb + bl EmitCmd_x21 bl WallyBufferExecCompleted _0816A574: pop {r4} diff --git a/asm/rom3.s b/asm/rom3.s index bde493568..649097eb6 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -3259,8 +3259,8 @@ _0803413E: .pool thumb_func_end sub_8034110 - thumb_func_start dp01_build_cmdbuf_x21_a_bb -dp01_build_cmdbuf_x21_a_bb: @ 8034158 + thumb_func_start EmitCmd_x21 +EmitCmd_x21: @ 8034158 push {r4,lr} adds r4, r1, 0 lsls r0, 24 @@ -3280,7 +3280,7 @@ dp01_build_cmdbuf_x21_a_bb: @ 8034158 pop {r0} bx r0 .pool - thumb_func_end dp01_build_cmdbuf_x21_a_bb + thumb_func_end EmitCmd_x21 thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes dp01_build_cmdbuf_x22_a_three_bytes: @ 8034184 diff --git a/include/battle_controllers.h b/include/battle_controllers.h index eea544b55..e36c95fbe 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -84,5 +84,6 @@ void Emit_x32(u8 bufferId); void EmitPrintString(u8 bufferId, u16 stringId); void EmitResetActionMoveSelection(u8 bufferId, u8 caseId); void EmitBallThrow(u8 bufferId, u8 caseId); +void EmitCmd_x21(u8 bufferId, u8 arg1, u16 arg2); #endif // GUARD_BATTLE_CONTROLLERS_H diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index ae0d20f28..590944f02 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -43,7 +43,7 @@ void AI_CalcDmg(u8 bankAtk, u8 bankDef); u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef); -u8 AI_TypeCalc(u16 move, u16 species, u8 ability); +u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility); u8 BankGetTurnOrder(u8 bank); void SetMoveEffect(bool8 primary, u8 certain); void BattleDestroyCursorAt(u8 cursorPosition); diff --git a/ld_script.txt b/ld_script.txt index 3e47864f1..1da43ff9d 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -64,6 +64,7 @@ SECTIONS { asm/battle_controller_player.o(.text); asm/battle_7.o(.text); asm/battle_controller_opponent.o(.text); + src/battle_9.o(.text); asm/battle_9.o(.text); asm/battle_controller_linkopponent.o(.text); src/pokemon_1.o(.text); diff --git a/src/battle_9.c b/src/battle_9.c new file mode 100644 index 000000000..1b1a4ab7c --- /dev/null +++ b/src/battle_9.c @@ -0,0 +1,525 @@ +#include "global.h" +#include "battle.h" +#include "battle_controllers.h" +#include "abilities.h" +#include "moves.h" +#include "pokemon.h" +#include "species.h" +#include "rng.h" +#include "util.h" + +extern u8 gActiveBank; +extern u8 gAbsentBankFlags; +extern u32 gBattleTypeFlags; +extern u32 gStatuses3[BATTLE_BANKS_COUNT]; +extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; +extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; +extern u16 gUnknown_02024250[BATTLE_BANKS_COUNT]; +extern u8 gUnknown_02024270[BATTLE_BANKS_COUNT]; + +extern const struct BattleMove gBattleMoves[]; +extern const struct BaseStats gBaseStats[]; + +// this file's functions +bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); +bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent); + +bool8 ShouldSwitchIfPerishSong(void) +{ + if (gStatuses3[gActiveBank] & STATUS3_PERISH_SONG + && gDisableStructs[gActiveBank].perishSong1 == 0) + { + *(gBattleStruct->field_294 + gActiveBank) = 6; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + + return FALSE; +} + +bool8 ShouldSwitchIfWonderGuard(void) +{ + u8 opposingIdentity; + u8 opposingBank; + u8 moveFlags; + s32 i, j; + s32 firstId; + s32 lastId; // + 1 + struct Pokemon *party = NULL; + u16 move; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + return FALSE; + + opposingIdentity = GetBankIdentity(gActiveBank) ^ BIT_SIDE; + + if (gBattleMons[GetBankByIdentity(opposingIdentity)].ability != ABILITY_WONDER_GUARD) + return FALSE; + + // check if pokemon has a super effective move + for (opposingBank = GetBankByIdentity(opposingIdentity), i = 0; i < 4; i++) + { + move = gBattleMons[gActiveBank].moves[i]; + if (move == MOVE_NONE) + continue; + + moveFlags = AI_TypeCalc(move, gBattleMons[opposingBank].species, gBattleMons[opposingBank].ability); + if (moveFlags & MOVESTATUS_SUPEREFFECTIVE) + return FALSE; + } + + // get party information + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + // find a pokemon in the party that has a super effective move + for (i = firstId; i < lastId; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) == 0) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG) + continue; + if (i == gBattlePartyID[gActiveBank]) + continue; + + GetMonData(&party[i], MON_DATA_SPECIES); // unused return value + GetMonData(&party[i], MON_DATA_ALT_ABILITY); // unused return value + + for (opposingBank = GetBankByIdentity(opposingIdentity), j = 0; j < 4; j++) + { + move = GetMonData(&party[i], MON_DATA_MOVE1 + j); + if (move == MOVE_NONE) + continue; + + moveFlags = AI_TypeCalc(move, gBattleMons[opposingBank].species, gBattleMons[opposingBank].ability); + if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % 3 < 2) + { + // we found a mon + *(gBattleStruct->field_294 + gActiveBank) = i; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + } + } + + return FALSE; // at this point there is not a single pokemon in the party that has a super effective move against a pokemon with wonder guard +} + +bool8 sub_8062E54(void) +{ + u8 bankIn1, bankIn2; + u8 absorbingTypeAbility; + s32 firstId; + s32 lastId; // + 1 + struct Pokemon *party; + s32 i; + + if (HasSuperEffectiveMoveAgainstOpponents(TRUE) && Random() % 3 != 0) + return FALSE; + if (gUnknown_02024250[gActiveBank] == 0) + return FALSE; + if (gUnknown_02024250[gActiveBank] == 0xFFFF) + return FALSE; + if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0) + return FALSE; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + bankIn1 = gActiveBank; + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + bankIn2 = gActiveBank; + else + bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + } + else + { + bankIn1 = gActiveBank; + bankIn2 = gActiveBank; + } + + if (gBattleMoves[gUnknown_02024250[gActiveBank]].type == TYPE_FIRE) + absorbingTypeAbility = ABILITY_FLASH_FIRE; + else if (gBattleMoves[gUnknown_02024250[gActiveBank]].type == TYPE_WATER) + absorbingTypeAbility = ABILITY_WATER_ABSORB; + else if (gBattleMoves[gUnknown_02024250[gActiveBank]].type == TYPE_ELECTRIC) + absorbingTypeAbility = ABILITY_VOLT_ABSORB; + else + return FALSE; + + if (gBattleMons[gActiveBank].ability == absorbingTypeAbility) + return FALSE; + + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = firstId; i < lastId; i++) + { + u16 species; + u8 monAbility; + + if (GetMonData(&party[i], MON_DATA_HP) == 0) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG) + continue; + if (i == gBattlePartyID[bankIn1]) + continue; + if (i == gBattlePartyID[bankIn2]) + continue; + if (i == *(gBattleStruct->field_5C + bankIn1)) + continue; + if (i == *(gBattleStruct->field_5C + bankIn2)) + continue; + + species = GetMonData(&party[i], MON_DATA_SPECIES); + if (GetMonData(&party[i], MON_DATA_ALT_ABILITY) != 0) + monAbility = gBaseStats[species].ability2; + else + monAbility = gBaseStats[species].ability1; + + if (absorbingTypeAbility == monAbility && Random() & 1) + { + // we found a mon + *(gBattleStruct->field_294 + gActiveBank) = i; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + } + + return FALSE; +} + +bool8 ShouldSwitchIfNaturalCure(void) +{ + if (!(gBattleMons[gActiveBank].status1 & STATUS_SLEEP)) + return FALSE; + if (gBattleMons[gActiveBank].ability != ABILITY_NATURAL_CURE) + return FALSE; + if (gBattleMons[gActiveBank].hp < gBattleMons[gActiveBank].maxHP / 2) + return FALSE; + + if ((gUnknown_02024250[gActiveBank] == 0 || gUnknown_02024250[gActiveBank] == 0xFFFF) && Random() & 1) + { + *(gBattleStruct->field_294 + gActiveBank) = 6; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + else if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0 && Random() & 1) + { + *(gBattleStruct->field_294 + gActiveBank) = 6; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + + if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTAFFECTED, 1)) + return TRUE; + if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTVERYEFFECTIVE, 1)) + return TRUE; + if (Random() & 1) + { + *(gBattleStruct->field_294 + gActiveBank) = 6; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + + return FALSE; +} + +bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) +{ + u8 opposingIdentity; + u8 opposingBank; + s32 i; + u8 moveFlags; + u16 move; + + opposingIdentity = GetBankIdentity(gActiveBank) ^ BIT_SIDE; + opposingBank = GetBankByIdentity(opposingIdentity); + + if (!(gAbsentBankFlags & gBitTable[opposingBank])) + { + for (i = 0; i < 4; i++) + { + move = gBattleMons[gActiveBank].moves[i]; + if (move == MOVE_NONE) + continue; + + moveFlags = AI_TypeCalc(move, gBattleMons[opposingBank].species, gBattleMons[opposingBank].ability); + if (moveFlags & MOVESTATUS_SUPEREFFECTIVE) + { + if (noRng) + return TRUE; + if (Random() % 10 != 0) + return TRUE; + } + } + } + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + return FALSE; + + opposingBank = GetBankByIdentity(opposingIdentity ^ BIT_MON); + + if (!(gAbsentBankFlags & gBitTable[opposingBank])) + { + for (i = 0; i < 4; i++) + { + move = gBattleMons[gActiveBank].moves[i]; + if (move == MOVE_NONE) + continue; + + moveFlags = AI_TypeCalc(move, gBattleMons[opposingBank].species, gBattleMons[opposingBank].ability); + if (moveFlags & MOVESTATUS_SUPEREFFECTIVE) + { + if (noRng) + return TRUE; + if (Random() % 10 != 0) + return TRUE; + } + } + } + + return FALSE; +} + +bool8 AreStatsRaised(void) +{ + u8 buffedStatsValue = 0; + s32 i; + + for (i = 0; i < BATTLE_STATS_NO; i++) + { + if (gBattleMons[gActiveBank].statStages[i] > 6) + buffedStatsValue += gBattleMons[gActiveBank].statStages[i] - 6; + } + + return (buffedStatsValue > 3); +} + +bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) +{ + u8 bankIn1, bankIn2; + s32 firstId; + s32 lastId; // + 1 + struct Pokemon *party; + s32 i, j; + u16 move; + u8 moveFlags; + + if (gUnknown_02024250[gActiveBank] == 0) + return FALSE; + if (gUnknown_02024250[gActiveBank] == 0xFFFF) + return FALSE; + if (gUnknown_02024270[gActiveBank] == 0xFF) + return FALSE; + if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0) + return FALSE; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + bankIn1 = gActiveBank; + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + bankIn2 = gActiveBank; + else + bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + } + else + { + bankIn1 = gActiveBank; + bankIn2 = gActiveBank; + } + + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = firstId; i < lastId; i++) + { + u16 species; + u8 monAbility; + + if (GetMonData(&party[i], MON_DATA_HP) == 0) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG) + continue; + if (i == gBattlePartyID[bankIn1]) + continue; + if (i == gBattlePartyID[bankIn2]) + continue; + if (i == *(gBattleStruct->field_5C + bankIn1)) + continue; + if (i == *(gBattleStruct->field_5C + bankIn2)) + continue; + + species = GetMonData(&party[i], MON_DATA_SPECIES); + if (GetMonData(&party[i], MON_DATA_ALT_ABILITY) != 0) + monAbility = gBaseStats[species].ability2; + else + monAbility = gBaseStats[species].ability1; + + moveFlags = AI_TypeCalc(gUnknown_02024250[gActiveBank], species, monAbility); + if (moveFlags & flags) + { + bankIn1 = gUnknown_02024270[gActiveBank]; + + for (j = 0; j < 4; j++) + { + move = GetMonData(&party[i], MON_DATA_MOVE1 + j); + if (move == 0) + continue; + + moveFlags = AI_TypeCalc(move, gBattleMons[bankIn1].species, gBattleMons[bankIn1].ability); + if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % moduloPercent == 0) + { + *(gBattleStruct->field_294 + gActiveBank) = i; + EmitCmd_x21(1, 2, 0); + return TRUE; + } + } + } + } + + return FALSE; +} + +bool8 ShouldSwitch(void) +{ + u8 bankIn1, bankIn2; + s32 firstId; + s32 lastId; // + 1 + struct Pokemon *party; + s32 i; + s32 availableToSwitch; + + if (gBattleMons[gActiveBank].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) + return FALSE; + if (gStatuses3[gActiveBank] & STATUS3_ROOTED) + return FALSE; + if (AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gActiveBank, ABILITY_SHADOW_TAG, 0, 0)) + return FALSE; + if (AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gActiveBank, ABILITY_ARENA_TRAP, 0, 0)) + return FALSE; // misses the flying or levitate check + if (AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, gActiveBank, ABILITY_MAGNET_PULL, 0, 0) + && (gBattleMons[gActiveBank].type1 == TYPE_STEEL || gBattleMons[gActiveBank].type2 == TYPE_STEEL)) + return FALSE; + if (gBattleTypeFlags & BATTLE_TYPE_ARENA) + return FALSE; + + availableToSwitch = 0; + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + bankIn1 = gActiveBank; + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + bankIn2 = gActiveBank; + else + bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + } + else + { + bankIn1 = gActiveBank; + bankIn2 = gActiveBank; + } + + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = firstId; i < lastId; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) == 0) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_NONE) + continue; + if (GetMonData(&party[i], MON_DATA_SPECIES2) == SPECIES_EGG) + continue; + if (i == gBattlePartyID[bankIn1]) + continue; + if (i == gBattlePartyID[bankIn2]) + continue; + if (i == *(gBattleStruct->field_5C + bankIn1)) + continue; + if (i == *(gBattleStruct->field_5C + bankIn2)) + continue; + + availableToSwitch++; + } + + if (availableToSwitch == 0) + return FALSE; + if (ShouldSwitchIfPerishSong()) + return TRUE; + if (ShouldSwitchIfWonderGuard()) + return TRUE; + if (sub_8062E54()) + return TRUE; + if (ShouldSwitchIfNaturalCure()) + return TRUE; + if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) + return FALSE; + if (AreStatsRaised()) + return FALSE; + if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTAFFECTED, 2)) + return TRUE; + if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTVERYEFFECTIVE, 3)) + return TRUE; + + return FALSE; +} diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 17b0e2ff9..50ae5bafe 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1772,11 +1772,11 @@ u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef) return flags; } -u8 AI_TypeCalc(u16 move, u16 species, u8 ability) +u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility) { s32 i = 0; u8 flags = 0; - u8 type1 = gBaseStats[species].type1, type2 = gBaseStats[species].type2; + u8 type1 = gBaseStats[targetSpecies].type1, type2 = gBaseStats[targetSpecies].type2; u8 moveType; if (move == MOVE_STRUGGLE) @@ -1784,7 +1784,7 @@ u8 AI_TypeCalc(u16 move, u16 species, u8 ability) moveType = gBattleMoves[move].type; - if (ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) + if (targetAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) { flags = MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED; } @@ -1809,7 +1809,7 @@ u8 AI_TypeCalc(u16 move, u16 species, u8 ability) i += 3; } } - if (ability == ABILITY_WONDER_GUARD + if (targetAbility == ABILITY_WONDER_GUARD && (!(flags & MOVESTATUS_SUPEREFFECTIVE) || ((flags & (MOVESTATUS_SUPEREFFECTIVE | MOVESTATUS_NOTVERYEFFECTIVE)) == (MOVESTATUS_SUPEREFFECTIVE | MOVESTATUS_NOTVERYEFFECTIVE))) && gBattleMoves[move].power) flags |= MOVESTATUS_NOTAFFECTED; From 6dfe8ced2cb516202f2934bf02762503f55fd8da Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 10 Oct 2017 21:45:07 +0200 Subject: [PATCH 5/8] ai switching basically done --- asm/battle_9.s | 726 +------------------------ asm/battle_controller_opponent.s | 4 +- asm/battle_controller_player_partner.s | 4 +- include/battle.h | 1 + include/battle_ai_switch_items.h | 7 + src/battle_9.c | 299 +++++++++- 6 files changed, 299 insertions(+), 742 deletions(-) create mode 100644 include/battle_ai_switch_items.h diff --git a/asm/battle_9.s b/asm/battle_9.s index 6d77d1593..0cf529bcc 100644 --- a/asm/battle_9.s +++ b/asm/battle_9.s @@ -5,726 +5,6 @@ .text - thumb_func_start sub_8063880 -sub_8063880: @ 8063880 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankIdentity - lsls r0, 24 - lsrs r6, r0, 24 - adds r5, r6, 0 - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - mov r8, r1 - cmp r0, 0 - bne _080638A8 - ldr r2, =gPlayerParty - mov r8, r2 -_080638A8: - ldr r7, =gBattleTypeFlags - ldr r0, [r7] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - bne _080638B6 - b _080639E6 -_080638B6: - bl ShouldSwitch - lsls r0, 24 - cmp r0, 0 - bne _080638C2 - b _080639DC -_080638C2: - ldrb r0, [r4] - ldr r2, =gBattleStruct - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x6 - bne _080639B8 - bl sub_8063A90 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bne _080639A6 - ldr r0, [r7] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08063910 - adds r0, r6, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - b _08063928 - .pool -_08063910: - adds r0, r5, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0x2 - eors r5, r0 - adds r0, r5, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r5, r0, 24 -_08063928: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063958 - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063954 - movs r0, 0 - movs r7, 0x3 - b _0806395C - .pool -_08063954: - movs r0, 0x3 - b _0806395A -_08063958: - movs r0, 0 -_0806395A: - movs r7, 0x6 -_0806395C: - adds r4, r0, 0 - cmp r4, r7 - bge _080639A6 -_08063962: - movs r0, 0x64 - muls r0, r4 - add r0, r8 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _080639A0 - ldr r1, =gBattlePartyID - lsls r0, r6, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - lsls r0, r5, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r4, r0 - beq _080639A0 - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _080639A0 - adds r0, r5, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _080639A6 -_080639A0: - adds r4, 0x1 - cmp r4, r7 - blt _08063962 -_080639A6: - ldr r0, =gActiveBank - ldrb r0, [r0] - ldr r2, =gBattleStruct - ldr r1, [r2] - adds r0, r1 - movs r1, 0xA5 - lsls r1, 2 - adds r0, r1 - strb r4, [r0] -_080639B8: - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r0, [r2] - adds r0, r1, r0 - adds r1, r0, 0 - adds r1, 0x5C - movs r2, 0xA5 - lsls r2, 2 - adds r0, r2 - ldrb r0, [r0] - strb r0, [r1] - b _080639F8 - .pool -_080639DC: - bl sub_8063EE0 - lsls r0, 24 - cmp r0, 0 - bne _080639F8 -_080639E6: - ldr r0, =gActiveBank - ldrb r0, [r0] - movs r2, 0x1 - eors r2, r0 - lsls r2, 8 - movs r0, 0x1 - movs r1, 0 - bl EmitCmd_x21 -_080639F8: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8063880 - - thumb_func_start sub_8063A08 -sub_8063A08: @ 8063A08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r6, r3, 0 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp] - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - lsls r2, 24 - lsrs r2, 24 - mov r8, r2 - movs r7, 0 - ldr r0, =gTypeEffectiveness - mov r10, r0 - ldrb r0, [r0] - cmp r0, 0xFF - beq _08063A7A - mov r5, r10 -_08063A36: - ldrb r0, [r5] - cmp r0, 0xFE - beq _08063A6C - ldr r1, [sp] - cmp r0, r1 - bne _08063A6C - ldrb r4, [r5, 0x1] - cmp r4, r9 - bne _08063A56 - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A56: - cmp r4, r8 - bne _08063A6C - cmp r9, r8 - beq _08063A6C - ldrb r1, [r6] - ldrb r0, [r5, 0x2] - muls r0, r1 - movs r1, 0xA - bl __divsi3 - strb r0, [r6] -_08063A6C: - adds r5, 0x3 - adds r7, 0x3 - mov r1, r10 - adds r0, r7, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08063A36 -_08063A7A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8063A08 - - thumb_func_start sub_8063A90 -sub_8063A90: @ 8063A90 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - ldr r4, =gActiveBank - ldrb r2, [r4] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, r2, r0 - adds r1, r0, 0 - adds r1, 0x5C - ldrb r0, [r1] - cmp r0, 0x6 - beq _08063AB2 - b _08063E50 -_08063AB2: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 11 - ands r0, r1 - cmp r0, 0 - beq _08063AE0 - ldr r1, =gBattlePartyID - lsls r0, r2, 1 - adds r0, r1 - ldrb r0, [r0] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _08063E50 - .pool -_08063AE0: - movs r0, 0x1 - ands r1, r0 - cmp r1, 0 - beq _08063B6C - str r2, [sp, 0x10] - adds r0, r2, 0 - bl GetBankIdentity - movs r5, 0x2 - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - ldr r1, =gAbsentBankFlags - ldrb r1, [r1] - ldr r2, =gBitTable - lsls r0, 24 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B20 - ldrb r4, [r4] - str r4, [sp, 0x14] - b _08063B36 - .pool -_08063B20: - ldrb r0, [r4] - bl GetBankIdentity - eors r0, r5 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] -_08063B36: - bl Random - movs r3, 0x2 - ands r0, r3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, =gAbsentBankFlags - ldrb r1, [r0] - ldr r2, =gBitTable - ldr r4, [sp, 0x4] - lsls r0, r4, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - cmp r1, 0 - beq _08063B8A - eors r4, r3 - lsls r0, r4, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - b _08063B8A - .pool -_08063B6C: - adds r0, r2, 0 - bl GetBankIdentity - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldrb r4, [r4] - str r4, [sp, 0x14] - str r4, [sp, 0x10] -_08063B8A: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x00808000 - ands r0, r1 - cmp r0, 0 - beq _08063BC2 - ldr r2, =gActiveBank - ldrb r1, [r2] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08063BB8 - movs r0, 0 - str r0, [sp, 0x18] - movs r1, 0x3 - str r1, [sp, 0x1C] - b _08063BCC - .pool -_08063BB8: - movs r4, 0x3 - str r4, [sp, 0x18] - movs r0, 0x6 - str r0, [sp, 0x1C] - b _08063BCC -_08063BC2: - movs r1, 0 - str r1, [sp, 0x18] - movs r2, 0x6 - str r2, [sp, 0x1C] - ldr r2, =gActiveBank -_08063BCC: - ldrb r0, [r2] - bl GetBankSide - lsls r0, 24 - ldr r4, =gEnemyParty - str r4, [sp, 0x20] - cmp r0, 0 - bne _08063BE0 - ldr r0, =gPlayerParty - str r0, [sp, 0x20] -_08063BE0: - movs r1, 0 - mov r9, r1 -_08063BE4: - movs r2, 0 - str r2, [sp, 0x8] - movs r4, 0x6 - str r4, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063BF6 - b _08063CF2 -_08063BF6: - lsls r0, r7, 2 - ldr r1, =gBitTable - adds r0, r1 - mov r8, r0 - mov r10, sp -_08063C00: - movs r0, 0x64 - muls r0, r7 - ldr r2, [sp, 0x20] - adds r4, r2, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _08063CD8 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08063CD8 - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - ands r0, r1 - cmp r0, 0 - bne _08063CD8 - ldr r1, =gBattlePartyID - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063CD8 - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063CD8 - ldr r1, =gBaseStats - lsls r0, r5, 3 - subs r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r5, [r0, 0x6] - ldrb r6, [r0, 0x7] - movs r0, 0xA - mov r1, r10 - strb r0, [r1] - movs r0, 0x58 - ldr r2, [sp, 0x4] - adds r4, r2, 0 - muls r4, r0 - ldr r0, =gBattleMons - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x21 - ldrb r0, [r0] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - adds r4, 0x22 - ldrb r0, [r4] - adds r1, r5, 0 - adds r2, r6, 0 - mov r3, sp - bl sub_8063A08 - ldr r2, [sp, 0x8] - mov r1, r10 - ldrb r1, [r1] - cmp r2, r1 - bcs _08063CE6 - mov r2, r10 - ldrb r2, [r2] - str r2, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - b _08063CE6 - .pool -_08063CD8: - mov r4, r8 - ldr r0, [r4] - mov r1, r9 - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 -_08063CE6: - movs r2, 0x4 - add r8, r2 - adds r7, 0x1 - ldr r4, [sp, 0x1C] - cmp r7, r4 - blt _08063C00 -_08063CF2: - ldr r0, [sp, 0xC] - cmp r0, 0x6 - beq _08063D54 - movs r7, 0 - movs r0, 0x64 - ldr r1, [sp, 0xC] - adds r5, r1, 0 - muls r5, r0 -_08063D02: - adds r1, r7, 0 - adds r1, 0xD - ldr r2, [sp, 0x20] - adds r0, r2, r5 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08063D2A - ldr r0, =gActiveBank - ldrb r1, [r0] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl TypeCalc - movs r1, 0x2 - ands r1, r0 - cmp r1, 0 - bne _08063D30 -_08063D2A: - adds r7, 0x1 - cmp r7, 0x3 - ble _08063D02 -_08063D30: - cmp r7, 0x4 - beq _08063D36 - b _08063E4E -_08063D36: - ldr r4, [sp, 0xC] - lsls r0, r4, 2 - ldr r1, =gBitTable - adds r0, r1 - ldr r0, [r0] - mov r2, r9 - orrs r2, r0 - lsls r0, r2, 24 - lsrs r0, 24 - mov r9, r0 - b _08063D58 - .pool -_08063D54: - movs r4, 0x3F - mov r9, r4 -_08063D58: - mov r0, r9 - cmp r0, 0x3F - beq _08063D60 - b _08063BE4 -_08063D60: - ldr r0, =gDynamicBasePower - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattleStruct - ldr r0, [r0] - strb r1, [r0, 0x13] - ldr r0, =gBattleScripting - movs r2, 0x1 - strb r2, [r0, 0xE] - ldr r0, =gBattleMoveFlags - strb r1, [r0] - ldr r0, =gCritMultiplier - strb r2, [r0] - movs r1, 0 - str r1, [sp, 0x8] - movs r2, 0x6 - str r2, [sp, 0xC] - ldr r7, [sp, 0x18] - ldr r4, [sp, 0x1C] - cmp r7, r4 - bge _08063E4E -_08063D8A: - movs r0, 0x64 - adds r6, r7, 0 - muls r6, r0 - ldr r0, [sp, 0x20] - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - adds r1, r7, 0x1 - mov r10, r1 - cmp r0, 0 - beq _08063E46 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08063E46 - ldr r1, =gBattlePartyID - ldr r2, [sp, 0x10] - lsls r0, r2, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r4, [sp, 0x14] - lsls r0, r4, 1 - adds r0, r1 - ldrh r0, [r0] - cmp r0, r7 - beq _08063E46 - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r2, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - adds r0, r4, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r7, r0 - beq _08063E46 - movs r5, 0 - mov r9, r6 - ldr r0, =gBattleMoveDamage - mov r8, r0 - ldr r6, =gActiveBank -_08063DEE: - adds r1, r5, 0 - adds r1, 0xD - ldr r0, [sp, 0x20] - add r0, r9 - bl GetMonData - lsls r0, 16 - lsrs r4, r0, 16 - movs r0, 0 - mov r1, r8 - str r0, [r1] - cmp r4, 0 - beq _08063E2A - ldr r0, =gBattleMoves - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0x1 - beq _08063E2A - ldrb r0, [r6] - ldr r1, [sp, 0x4] - bl AI_CalcDmg - ldrb r1, [r6] - adds r0, r4, 0 - ldr r2, [sp, 0x4] - bl TypeCalc -_08063E2A: - mov r2, r8 - ldr r0, [r2] - ldr r4, [sp, 0x8] - cmp r4, r0 - bge _08063E40 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r0, r7, 24 - lsrs r0, 24 - str r0, [sp, 0xC] -_08063E40: - adds r5, 0x1 - cmp r5, 0x3 - ble _08063DEE -_08063E46: - mov r7, r10 - ldr r0, [sp, 0x1C] - cmp r7, r0 - blt _08063D8A -_08063E4E: - ldr r0, [sp, 0xC] -_08063E50: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8063A90 thumb_func_start ai_identify_item_effect ai_identify_item_effect: @ 8063E84 @@ -783,8 +63,8 @@ _08063EDA: bx r1 thumb_func_end ai_identify_item_effect - thumb_func_start sub_8063EE0 -sub_8063EE0: @ 8063EE0 + thumb_func_start ShouldUseItem +ShouldUseItem: @ 8063EE0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -1361,6 +641,6 @@ _0806437E: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_8063EE0 + thumb_func_end ShouldUseItem .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s index 3fbeac5c1..896d86d3a 100644 --- a/asm/battle_controller_opponent.s +++ b/asm/battle_controller_opponent.s @@ -5212,7 +5212,7 @@ sub_8061F90: @ 8061F90 thumb_func_start sub_8061F9C sub_8061F9C: @ 8061F9C push {lr} - bl sub_8063880 + bl AI_TrySwitchOrUseItem bl OpponentBufferExecCompleted pop {r0} bx r0 @@ -5456,7 +5456,7 @@ sub_8062188: @ 8062188 ldrb r0, [r1] cmp r0, 0x6 bne _08062254 - bl sub_8063A90 + bl GetMostSuitableMonToSwitchInto lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 diff --git a/asm/battle_controller_player_partner.s b/asm/battle_controller_player_partner.s index 269e5347b..8c080500e 100644 --- a/asm/battle_controller_player_partner.s +++ b/asm/battle_controller_player_partner.s @@ -4990,7 +4990,7 @@ sub_81BDAA0: @ 81BDAA0 thumb_func_start sub_81BDAAC sub_81BDAAC: @ 81BDAAC push {lr} - bl sub_8063880 + bl AI_TrySwitchOrUseItem bl PlayerPartnerBufferExecCompleted pop {r0} bx r0 @@ -5087,7 +5087,7 @@ sub_81BDB70: @ 81BDB70 thumb_func_start sub_81BDB7C sub_81BDB7C: @ 81BDB7C push {r4-r6,lr} - bl sub_8063A90 + bl GetMostSuitableMonToSwitchInto lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 diff --git a/include/battle.h b/include/battle.h index bb61c7043..0aa778fe2 100644 --- a/include/battle.h +++ b/include/battle.h @@ -5,6 +5,7 @@ #include "battle_util.h" #include "battle_script_commands.h" #include "battle_2.h" +#include "battle_ai_switch_items.h" /* Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h new file mode 100644 index 000000000..5c78a5386 --- /dev/null +++ b/include/battle_ai_switch_items.h @@ -0,0 +1,7 @@ +#ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H +#define GUARD_BATTLE_AI_SWITCH_ITEMS_H + +void AI_TrySwitchOrUseItem(void); +u8 GetMostSuitableMonToSwitchInto(void); + +#endif // GUARD_BATTLE_AI_SWITCH_ITEMS_H diff --git a/src/battle_9.c b/src/battle_9.c index 1b1a4ab7c..291bfc9e3 100644 --- a/src/battle_9.c +++ b/src/battle_9.c @@ -16,13 +16,19 @@ extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern u16 gUnknown_02024250[BATTLE_BANKS_COUNT]; extern u8 gUnknown_02024270[BATTLE_BANKS_COUNT]; +extern u16 gDynamicBasePower; +extern u8 gBattleMoveFlags; +extern u8 gCritMultiplier; +extern s32 gBattleMoveDamage; extern const struct BattleMove gBattleMoves[]; extern const struct BaseStats gBaseStats[]; +extern const u8 gTypeEffectiveness[]; // this file's functions bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent); +bool8 ShouldUseItem(void); bool8 ShouldSwitchIfPerishSong(void) { @@ -121,7 +127,7 @@ bool8 ShouldSwitchIfWonderGuard(void) return FALSE; // at this point there is not a single pokemon in the party that has a super effective move against a pokemon with wonder guard } -bool8 sub_8062E54(void) +bool8 FindMonThatAbsorbsOpponentsMove(void) { u8 bankIn1, bankIn2; u8 absorbingTypeAbility; @@ -430,13 +436,14 @@ bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) bool8 ShouldSwitch(void) { u8 bankIn1, bankIn2; + u8 *activeBankPtr; // needed to match s32 firstId; s32 lastId; // + 1 struct Pokemon *party; s32 i; s32 availableToSwitch; - if (gBattleMons[gActiveBank].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) + if (gBattleMons[*(activeBankPtr = &gActiveBank)].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) return FALSE; if (gStatuses3[gActiveBank] & STATUS3_ROOTED) return FALSE; @@ -444,25 +451,29 @@ bool8 ShouldSwitch(void) return FALSE; if (AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gActiveBank, ABILITY_ARENA_TRAP, 0, 0)) return FALSE; // misses the flying or levitate check - if (AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, gActiveBank, ABILITY_MAGNET_PULL, 0, 0) - && (gBattleMons[gActiveBank].type1 == TYPE_STEEL || gBattleMons[gActiveBank].type2 == TYPE_STEEL)) - return FALSE; + if (AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_MAGNET_PULL, 0, 0)) + { + if (gBattleMons[gActiveBank].type1 == TYPE_STEEL) + return FALSE; + if (gBattleMons[gActiveBank].type2 == TYPE_STEEL) + return FALSE; + } if (gBattleTypeFlags & BATTLE_TYPE_ARENA) return FALSE; availableToSwitch = 0; if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - bankIn1 = gActiveBank; - if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) - bankIn2 = gActiveBank; + bankIn1 = *activeBankPtr; + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(*activeBankPtr) ^ BIT_MON)]) + bankIn2 = *activeBankPtr; else - bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + bankIn2 = GetBankByIdentity(GetBankIdentity(*activeBankPtr) ^ BIT_MON); } else { - bankIn1 = gActiveBank; - bankIn2 = gActiveBank; + bankIn1 = *activeBankPtr; + bankIn2 = *activeBankPtr; } if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) @@ -508,7 +519,7 @@ bool8 ShouldSwitch(void) return TRUE; if (ShouldSwitchIfWonderGuard()) return TRUE; - if (sub_8062E54()) + if (FindMonThatAbsorbsOpponentsMove()) return TRUE; if (ShouldSwitchIfNaturalCure()) return TRUE; @@ -516,10 +527,268 @@ bool8 ShouldSwitch(void) return FALSE; if (AreStatsRaised()) return FALSE; - if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTAFFECTED, 2)) - return TRUE; - if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTVERYEFFECTIVE, 3)) + if (FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTAFFECTED, 2) + || FindMonWithFlagsAndSuperEffective(MOVESTATUS_NOTVERYEFFECTIVE, 3)) return TRUE; return FALSE; } + +void AI_TrySwitchOrUseItem(void) +{ + struct Pokemon *party; + u8 bankIn1, bankIn2; + s32 firstId; + s32 lastId; // + 1 + u8 bankIdentity = GetBankIdentity(gActiveBank); + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + { + if (ShouldSwitch()) + { + if (*(gBattleStruct->field_294 + gActiveBank) == 6) + { + s32 monToSwitchId = GetMostSuitableMonToSwitchInto(); + if (monToSwitchId == 6) + { + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + { + bankIn1 = GetBankByIdentity(bankIdentity); + bankIn2 = bankIn1; + } + else + { + bankIn1 = GetBankByIdentity(bankIdentity); + bankIn2 = GetBankByIdentity(bankIdentity ^ BIT_MON); + } + + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + for (monToSwitchId = firstId; monToSwitchId < lastId; monToSwitchId++) + { + if (GetMonData(&party[monToSwitchId], MON_DATA_HP) == 0) + continue; + if (monToSwitchId == gBattlePartyID[bankIn1]) + continue; + if (monToSwitchId == gBattlePartyID[bankIn2]) + continue; + if (monToSwitchId == *(gBattleStruct->field_5C + bankIn1)) + continue; + if (monToSwitchId == *(gBattleStruct->field_5C + bankIn2)) + continue; + + break; + } + } + + *(gBattleStruct->field_294 + gActiveBank) = monToSwitchId; + } + + *(gBattleStruct->field_5C + gActiveBank) = *(gBattleStruct->field_294 + gActiveBank); + return; + } + else if (ShouldUseItem()) + { + return; + } + } + + EmitCmd_x21(1, 0, (gActiveBank ^ BIT_SIDE) << 8); +} + +#define TYPE_FORESIGHT 0xFE +#define TYPE_ENDTABLE 0xFF + +static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 *var) +{ + s32 i = 0; + + while (gTypeEffectiveness[i] != TYPE_ENDTABLE) + { + if (gTypeEffectiveness[i] == TYPE_FORESIGHT) + { + i += 3; + continue; + } + else if (gTypeEffectiveness[i] == atkType) + { + // check type1 + if (gTypeEffectiveness[i + 1] == defType1) + *var = (*var * gTypeEffectiveness[i + 2]) / 10; + // check type2 + if (gTypeEffectiveness[i + 1] == defType2 && defType1 != defType2) + *var = (*var * gTypeEffectiveness[i + 2]) / 10; + } + i += 3; + } +} + +u8 GetMostSuitableMonToSwitchInto(void) +{ + u8 opposingBank; + u8 bestDmg; // note : should be changed to u32 for obvious reasons + u8 bestMonId; + u8 bankIn1, bankIn2; + s32 firstId; + s32 lastId; // + 1 + struct Pokemon *party; + s32 i, j; + u8 invalidMons; + u16 move; + + if (*(gBattleStruct->field_5C + gActiveBank) != 6) + return *(gBattleStruct->field_5C + gActiveBank); + if (gBattleTypeFlags & BATTLE_TYPE_ARENA) + return gBattlePartyID[gActiveBank] + 1; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + bankIn1 = gActiveBank; + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + bankIn2 = gActiveBank; + else + bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + + // UB: It considers the opponent only player's side even though it can battle alongside player; + opposingBank = Random() & BIT_MON; + if (gAbsentBankFlags & gBitTable[opposingBank]) + opposingBank ^= BIT_MON; + } + else + { + opposingBank = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_SIDE); + bankIn1 = gActiveBank; + bankIn2 = gActiveBank; + } + + if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) + { + if ((gActiveBank & BIT_MON) == 0) + firstId = 0, lastId = 3; + else + firstId = 3, lastId = 6; + } + else + { + firstId = 0, lastId = 6; + } + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + invalidMons = 0; + + while (invalidMons != 0x3F) // all mons are invalid + { + bestDmg = 0; + bestMonId = 6; + // find the mon which type is the most suitable offensively + for (i = firstId; i < lastId; i++) + { + u16 species = GetMonData(&party[i], MON_DATA_SPECIES); + if (species != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_HP) != 0 + && !(gBitTable[i] & invalidMons) + && gBattlePartyID[bankIn1] != i + && gBattlePartyID[bankIn2] != i + && i != *(gBattleStruct->field_5C + bankIn1) + && i != *(gBattleStruct->field_5C + bankIn2)) + { + u8 type1 = gBaseStats[species].type1; + u8 type2 = gBaseStats[species].type2; + u8 typeDmg = 10; + ModulateByTypeEffectiveness(gBattleMons[opposingBank].type1, type1, type2, &typeDmg); + ModulateByTypeEffectiveness(gBattleMons[opposingBank].type2, type1, type2, &typeDmg); + if (bestDmg < typeDmg) + { + bestDmg = typeDmg; + bestMonId = i; + } + } + else + { + invalidMons |= gBitTable[i]; + } + } + + // ok, we know the mon has the right typing but does it have at least one super effective move? + if (bestMonId != 6) + { + for (i = 0; i < 4; i++) + { + move = GetMonData(&party[bestMonId], MON_DATA_MOVE1 + i); + if (move != MOVE_NONE && TypeCalc(move, gActiveBank, opposingBank) & MOVESTATUS_SUPEREFFECTIVE) + break; + } + + if (i != 4) + return bestMonId; // has both the typing and at least one super effective move + + invalidMons |= gBitTable[bestMonId]; // sorry buddy, we want something better + } + else + { + invalidMons = 0x3F; // no viable mon to switch + } + } + + gDynamicBasePower = 0; + gBattleStruct->dynamicMoveType = 0; + gBattleScripting.dmgMultiplier = 1; + gBattleMoveFlags = 0; + gCritMultiplier = 1; + bestDmg = 0; + bestMonId = 6; + + // if we couldn't find the best mon in terms of typing, find the one that deals most damage + for (i = firstId; i < lastId; i++) + { + if ((u16)(GetMonData(&party[i], MON_DATA_SPECIES)) == SPECIES_NONE) + continue; + if (GetMonData(&party[i], MON_DATA_HP) == 0) + continue; + if (gBattlePartyID[bankIn1] == i) + continue; + if (gBattlePartyID[bankIn2] == i) + continue; + if (i == *(gBattleStruct->field_5C + bankIn1)) + continue; + if (i == *(gBattleStruct->field_5C + bankIn2)) + continue; + + for (j = 0; j < 4; j++) + { + move = GetMonData(&party[i], MON_DATA_MOVE1 + j); + gBattleMoveDamage = 0; + if (move != MOVE_NONE && gBattleMoves[move].power != 1) + { + AI_CalcDmg(gActiveBank, opposingBank); + TypeCalc(move, gActiveBank, opposingBank); + } + if (bestDmg < gBattleMoveDamage) + { + bestDmg = gBattleMoveDamage; + bestMonId = i; + } + } + } + + return bestMonId; +} From a3b62f43ee4ce02d8b7dd28acf53692567754bd3 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 11 Oct 2017 12:49:42 +0200 Subject: [PATCH 6/8] battle 9 is decompiled --- asm/battle_9.s | 646 ------------------- include/battle.h | 6 +- include/battle_ai_switch_items.h | 10 + include/pokemon.h | 1 + include/pokemon_item_effects.h | 54 ++ ld_script.txt | 3 +- src/battle_2.c | 28 +- src/battle_ai_script_commands.c | 2 +- src/{battle_9.c => battle_ai_switch_items.c} | 179 ++++- 9 files changed, 252 insertions(+), 677 deletions(-) delete mode 100644 asm/battle_9.s rename src/{battle_9.c => battle_ai_switch_items.c} (78%) diff --git a/asm/battle_9.s b/asm/battle_9.s deleted file mode 100644 index 0cf529bcc..000000000 --- a/asm/battle_9.s +++ /dev/null @@ -1,646 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start ai_identify_item_effect -ai_identify_item_effect: @ 8063E84 - push {r4,lr} - adds r2, r1, 0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bne _08063E94 - movs r0, 0x1 - b _08063EDA -_08063E94: - ldrb r1, [r2, 0x4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08063EA2 - movs r0, 0x2 - b _08063EDA -_08063EA2: - ldrb r4, [r2, 0x3] - movs r3, 0x3F - adds r0, r3, 0 - ands r0, r4 - cmp r0, 0 - beq _08063EB2 - movs r0, 0x3 - b _08063EDA -_08063EB2: - ldrb r1, [r2] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x1] - cmp r0, 0 - bne _08063EC8 - ldrb r0, [r2, 0x2] - cmp r0, 0 - beq _08063ECC -_08063EC8: - movs r0, 0x4 - b _08063EDA -_08063ECC: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - bne _08063ED8 - movs r0, 0x6 - b _08063EDA -_08063ED8: - movs r0, 0x5 -_08063EDA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end ai_identify_item_effect - - thumb_func_start ShouldUseItem -ShouldUseItem: @ 8063EE0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - mov r10, r0 - movs r7, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _08063F12 - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _08063F12 - b _0806437C -_08063F12: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - ldr r5, =gEnemyParty - cmp r0, 0 - bne _08063F24 - ldr r5, =gPlayerParty -_08063F24: - movs r1, 0 - mov r8, r1 -_08063F28: - movs r0, 0x64 - mov r2, r8 - muls r2, r0 - adds r0, r2, 0 - adds r4, r5, r0 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _08063F64 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08063F64 - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 -_08063F64: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x5 - ble _08063F28 - movs r2, 0 - mov r8, r2 -_08063F72: - ldr r1, =gBattleResources - mov r0, r8 - cmp r0, 0 - beq _08063F8E - ldr r0, [r1] - ldr r0, [r0, 0x18] - adds r0, 0x50 - ldrb r0, [r0] - mov r2, r8 - subs r0, r2 - adds r0, 0x1 - cmp r10, r0 - ble _08063F8E - b _08064370 -_08063F8E: - ldr r0, [r1] - ldr r0, [r0, 0x18] - mov r2, r8 - lsls r1, r2, 1 - adds r0, 0x48 - adds r0, r1 - ldrh r0, [r0] - mov r9, r0 - str r1, [sp] - cmp r0, 0 - bne _08063FA6 - b _08064370 -_08063FA6: - ldr r1, =gItemEffectTable - subs r0, 0xD - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - cmp r1, 0 - bne _08063FB6 - b _08064370 -_08063FB6: - mov r0, r9 - cmp r0, 0xAF - bne _08063FE8 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003214 - adds r5, r0, r1 - b _08063FEA - .pool -_08063FE8: - adds r5, r1, 0 -_08063FEA: - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - adds r1, r5, 0 - bl ai_identify_item_effect - ldr r4, =gActiveBank - ldrb r1, [r4] - lsrs r1, 1 - ldr r3, =gBattleStruct - ldr r2, [r3] - adds r1, r2 - adds r1, 0xC4 - strb r0, [r1] - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC4 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x5 - bls _0806401A - b _08064324 -_0806401A: - lsls r0, 2 - ldr r1, =_08064030 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08064030: - .4byte _08064048 - .4byte _08064074 - .4byte _080640BC - .4byte _08064214 - .4byte _080642F4 - .4byte _0806437C -_08064048: - ldr r2, =gBattleMons - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r0, r2 - ldrh r1, [r0, 0x2C] - ldrh r0, [r0, 0x28] - lsrs r1, 2 - cmp r0, r1 - bcc _08064060 - b _08064324 -_08064060: - cmp r0, 0 - bne _08064066 - b _08064324 -_08064066: - movs r7, 0x1 - b _08064328 - .pool -_08064074: - mov r0, r9 - movs r1, 0x4 - movs r2, 0x4 - bl GetItemEffectParamOffset - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08064088 - b _08064324 -_08064088: - ldr r2, =gBattleMons - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - adds r1, r0, r2 - ldrh r2, [r1, 0x28] - cmp r2, 0 - bne _0806409C - b _08064324 -_0806409C: - ldrh r3, [r1, 0x2C] - lsrs r0, r3, 2 - cmp r2, r0 - bcc _08064066 - adds r0, r2, 0 - subs r0, r3, r0 - adds r1, r5, r4 - ldrb r1, [r1] - cmp r0, r1 - bgt _080640B2 - b _08064324 -_080640B2: - b _08064066 - .pool -_080640BC: - ldr r3, =gActiveBank - ldrb r0, [r3] - lsrs r0, 1 - ldr r2, =gBattleStruct - ldr r1, [r2] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldrb r1, [r5, 0x3] - movs r6, 0x20 - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08064100 - ldr r1, =gBattleMons - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08064100 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_08064100: - ldrb r1, [r5, 0x3] - movs r6, 0x10 - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806413A - ldr r1, =gBattleMons - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r1, [r0] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - bne _0806412A - movs r0, 0x80 - ands r1, r0 - cmp r1, 0 - beq _0806413A -_0806412A: - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806413A: - ldrb r1, [r5, 0x3] - movs r6, 0x8 - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0806416C - ldr r1, =gBattleMons - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0806416C - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806416C: - ldrb r1, [r5, 0x3] - movs r6, 0x4 - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0806419E - ldr r1, =gBattleMons - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0806419E - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_0806419E: - ldrb r1, [r5, 0x3] - movs r6, 0x2 - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - ldr r1, =gBattleMons - ldrb r4, [r3] - movs r0, 0x58 - muls r0, r4 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080641D0 - lsrs r1, r4, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - movs r7, 0x1 -_080641D0: - ldrb r1, [r5, 0x3] - movs r4, 0x1 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080641DE - b _08064324 -_080641DE: - ldr r1, =gBattleMons - ldrb r3, [r3] - movs r0, 0x58 - muls r0, r3 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _080641F6 - b _08064324 -_080641F6: - lsrs r1, r3, 1 - ldr r0, [r2] - adds r1, r0 - adds r1, 0xC6 - ldrb r0, [r1] - orrs r0, r4 - strb r0, [r1] - b _08064066 - .pool -_08064214: - ldr r4, =gActiveBank - ldrb r0, [r4] - lsrs r0, 1 - ldr r3, =gBattleStruct - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - movs r1, 0 - strb r1, [r0] - ldr r1, =gDisableStructs - ldrb r2, [r4] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldrb r1, [r5] - movs r6, 0xF - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08064254 - lsrs r2, 1 - ldr r0, [r3] - adds r2, r0 - adds r2, 0xC6 - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_08064254: - ldrb r1, [r5, 0x1] - movs r7, 0xF0 - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _08064272 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r0] -_08064272: - ldrb r1, [r5, 0x1] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0806428E - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0806428E: - ldrb r1, [r5, 0x2] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _080642AA - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080642AA: - ldrb r1, [r5, 0x2] - adds r0, r7, 0 - ands r0, r1 - cmp r0, 0 - beq _080642C6 - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] -_080642C6: - ldrb r1, [r5] - movs r0, 0x30 - ands r0, r1 - cmp r0, 0 - bne _080642D2 - b _08064066 -_080642D2: - ldrb r0, [r4] - lsrs r0, 1 - ldr r1, [r3] - adds r0, r1 - adds r0, 0xC6 - ldrb r1, [r0] - movs r2, 0x80 - orrs r1, r2 - strb r1, [r0] - b _08064066 - .pool -_080642F4: - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gDisableStructs - ldrb r1, [r4] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x16] - cmp r0, 0 - beq _08064324 - ldr r0, =gSideTimers - lsls r1, r3, 1 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x4] - cmp r0, 0 - bne _08064324 - b _08064066 -_08064324: - cmp r7, 0 - beq _08064370 -_08064328: - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl EmitCmd_x21 - ldr r0, =gActiveBank - ldrb r0, [r0] - lsrs r0, 1 - ldr r1, =gBattleStruct - ldr r1, [r1] - lsls r0, 1 - adds r0, r1 - adds r0, 0xC0 - mov r1, r9 - strb r1, [r0] - ldr r0, =gBattleResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - adds r0, 0x48 - ldr r2, [sp] - adds r0, r2 - movs r1, 0 - strh r1, [r0] - adds r0, r7, 0 - b _0806437E - .pool -_08064370: - movs r0, 0x1 - add r8, r0 - mov r1, r8 - cmp r1, 0x3 - bgt _0806437C - b _08063F72 -_0806437C: - movs r0, 0 -_0806437E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end ShouldUseItem - - .align 2, 0 @ Don't pad with nop. diff --git a/include/battle.h b/include/battle.h index 0aa778fe2..a60f450ce 100644 --- a/include/battle.h +++ b/include/battle.h @@ -477,7 +477,7 @@ struct BattleHistory struct UsedMoves usedMoves[BATTLE_BANKS_COUNT]; u8 abilities[BATTLE_BANKS_COUNT]; u8 itemEffects[BATTLE_BANKS_COUNT]; - u16 TrainerItems[BATTLE_BANKS_COUNT]; + u16 trainerItems[BATTLE_BANKS_COUNT]; u8 itemsNo; }; @@ -633,8 +633,8 @@ struct BattleStruct void (*savedCallback)(void); u16 usedHeldItems[BATTLE_BANKS_COUNT]; u8 field_C0[4]; - u8 field_C4[2]; - u8 field_C6[2]; + u8 AI_itemType[2]; + u8 AI_itemFlags[2]; u16 choicedMove[BATTLE_BANKS_COUNT]; u16 changedItems[BATTLE_BANKS_COUNT]; u8 intimidateBank; diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h index 5c78a5386..0a230e7f6 100644 --- a/include/battle_ai_switch_items.h +++ b/include/battle_ai_switch_items.h @@ -1,6 +1,16 @@ #ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H #define GUARD_BATTLE_AI_SWITCH_ITEMS_H +enum +{ + AI_ITEM_FULL_RESTORE = 1, + AI_ITEM_HEAL_HP, + AI_ITEM_CURE_CONDITION, + AI_ITEM_X_STAT, + AI_ITEM_GUARD_SPECS, + AI_ITEM_NOT_RECOGNIZABLE +}; + void AI_TrySwitchOrUseItem(void); u8 GetMostSuitableMonToSwitchInto(void); diff --git a/include/pokemon.h b/include/pokemon.h index 263a37426..c26c28afa 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -642,6 +642,7 @@ void UpdatePartyPokerusTime(u16 days); void PartySpreadPokerus(struct Pokemon *party); s8 GetMonFlavourRelation(struct Pokemon *mon, u8 a2); s8 GetFlavourRelationByPersonality(u32 personality, u8 a2); +u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit); #include "sprite.h" diff --git a/include/pokemon_item_effects.h b/include/pokemon_item_effects.h index 88f341317..505cc0f25 100644 --- a/include/pokemon_item_effects.h +++ b/include/pokemon_item_effects.h @@ -3,6 +3,60 @@ #include "pokemon.h" +// TODO once pokemon item effects is decompiled +/* +struct PokemonItemEffect +{ + //field 0 + u8 xAtk : 4; // x1, x2, x4, x8 = xF + u8 field_0_x10 : 1; // x10 + u8 critRatioUp : 1; // x20 + u8 field_0_x40 : 1; // x40 + u8 cureInfatuation : 1; // x80 + + /*field 1 + u8 xSpeed : 4; // x1, x2, x4, x8 = xF + u8 xDefense : 4; // x10, x20, x40, xF0 + + /*field 2 + u8 xSpAtk : 4; // x1, x2, x4, x8 = xF + u8 xAccuracy : 4; // x10, x20, x40, xF0 + + /*field 3 + u8 cureConfusion : 1; // x1 + u8 cureParalysis : 1; // x2 + u8 cureFreeze : 1; // x4 + u8 cureBurn : 1; // x8 + u8 curePoison : 1; // x10 + u8 cureSleep : 1; // x20 + u8 field_3_x40 : 1; // x40 + u8 cantLowerStats : 1; // x80 + + /*field 4 + u8 hpEv : 1; // x1 + u8 attackEv : 1; // x2 + u8 healHp : 1; // x4 + u8 field_4_x8 : 1; // x8 + u8 field_4_x10 : 1; // x10 + u8 ppUp : 1; // x20 + u8 levelUp : 1; // x40 + u8 evolutionStone : 1; // x80 + + /*field 5 + u8 defEv: 1; // x1 + u8 speedEv : 1; // x2 + u8 spDefEv : 1; // x4 + u8 spAtkEv : 1; // x8 + u8 ppMax : 1; // x10 + u8 field_5_x20 : 1; // x20 + u8 field_5_x40 : 1; // x40 + u8 field_5_x80 : 1; // x80 + + /*field 6 + u8 value; +}; +*/ + bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 itemId, u8 partyId, u8 monMoveIndex, u8 a5); #endif // GUARD_POKEMON_ITEM_EFFECTS diff --git a/ld_script.txt b/ld_script.txt index 1da43ff9d..887f24811 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -64,8 +64,7 @@ SECTIONS { asm/battle_controller_player.o(.text); asm/battle_7.o(.text); asm/battle_controller_opponent.o(.text); - src/battle_9.o(.text); - asm/battle_9.o(.text); + src/battle_ai_switch_items.o(.text); asm/battle_controller_linkopponent.o(.text); src/pokemon_1.o(.text); asm/pokemon_1.o(.text); diff --git a/src/battle_2.c b/src/battle_2.c index 92c48c427..c4da02e36 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -5324,30 +5324,30 @@ static void HandleAction_UseItem(void) { gBattleScripting.bank = gBankAttacker; - switch (*(gBattleStruct->field_C4 + (gBankAttacker >> 1))) + switch (*(gBattleStruct->AI_itemType + (gBankAttacker >> 1))) { - case 1: - case 2: + case AI_ITEM_FULL_RESTORE: + case AI_ITEM_HEAL_HP: break; - case 3: + case AI_ITEM_CURE_CONDITION: gBattleCommunication[MULTISTRING_CHOOSER] = 0; - if (*(gBattleStruct->field_C6 + gBankAttacker / 2) & 1) + if (*(gBattleStruct->AI_itemFlags + gBankAttacker / 2) & 1) { - if (*(gBattleStruct->field_C6 + gBankAttacker / 2) & 0x3E) + if (*(gBattleStruct->AI_itemFlags + gBankAttacker / 2) & 0x3E) gBattleCommunication[MULTISTRING_CHOOSER] = 5; } else { - while (!(*(gBattleStruct->field_C6 + gBankAttacker / 2) & 1)) + while (!(*(gBattleStruct->AI_itemFlags + gBankAttacker / 2) & 1)) { - *(gBattleStruct->field_C6 + gBankAttacker / 2) >>= 1; + *(gBattleStruct->AI_itemFlags + gBankAttacker / 2) >>= 1; gBattleCommunication[MULTISTRING_CHOOSER]++; } } break; - case 4: + case AI_ITEM_X_STAT: gBattleCommunication[MULTISTRING_CHOOSER] = 4; - if (*(gBattleStruct->field_C6 + (gBankAttacker >> 1)) & 0x80) + if (*(gBattleStruct->AI_itemFlags + (gBankAttacker >> 1)) & 0x80) { gBattleCommunication[MULTISTRING_CHOOSER] = 5; } @@ -5356,9 +5356,9 @@ static void HandleAction_UseItem(void) PREPARE_STAT_BUFFER(gBattleTextBuff1, STAT_ATK) PREPARE_STRING_BUFFER(gBattleTextBuff2, 0xD2) - while (!((*(gBattleStruct->field_C6 + (gBankAttacker >> 1))) & 1)) + while (!((*(gBattleStruct->AI_itemFlags + (gBankAttacker >> 1))) & 1)) { - *(gBattleStruct->field_C6 + gBankAttacker / 2) >>= 1; + *(gBattleStruct->AI_itemFlags + gBankAttacker / 2) >>= 1; gBattleTextBuff1[2]++; } @@ -5366,7 +5366,7 @@ static void HandleAction_UseItem(void) gBattleScripting.animArg2 = 0; } break; - case 5: + case AI_ITEM_GUARD_SPECS: if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) gBattleCommunication[MULTISTRING_CHOOSER] = 2; else @@ -5374,7 +5374,7 @@ static void HandleAction_UseItem(void) break; } - gBattlescriptCurrInstr = gUnknown_082DBD3C[*(gBattleStruct->field_C4 + gBankAttacker / 2)]; + gBattlescriptCurrInstr = gUnknown_082DBD3C[*(gBattleStruct->AI_itemType + gBankAttacker / 2)]; } gCurrentActionFuncId = ACTION_RUN_BATTLESCRIPT; } diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index bba66983b..24377eacc 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -331,7 +331,7 @@ void BattleAI_HandleItemUseBeforeAISetup(u8 defaultScoreMoves) { if (gTrainers[gTrainerBattleOpponent_A].items[i] != 0) { - gBattleResources->battleHistory->TrainerItems[gBattleResources->battleHistory->itemsNo] = gTrainers[gTrainerBattleOpponent_A].items[i]; + gBattleResources->battleHistory->trainerItems[gBattleResources->battleHistory->itemsNo] = gTrainers[gTrainerBattleOpponent_A].items[i]; gBattleResources->battleHistory->itemsNo++; } } diff --git a/src/battle_9.c b/src/battle_ai_switch_items.c similarity index 78% rename from src/battle_9.c rename to src/battle_ai_switch_items.c index 291bfc9e3..661759a98 100644 --- a/src/battle_9.c +++ b/src/battle_ai_switch_items.c @@ -7,6 +7,8 @@ #include "species.h" #include "rng.h" #include "util.h" +#include "items.h" +#include "pokemon_item_effects.h" extern u8 gActiveBank; extern u8 gAbsentBankFlags; @@ -24,13 +26,14 @@ extern s32 gBattleMoveDamage; extern const struct BattleMove gBattleMoves[]; extern const struct BaseStats gBaseStats[]; extern const u8 gTypeEffectiveness[]; +extern const u8 * const gItemEffectTable[]; // todo: fix once struct is declared // this file's functions -bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); -bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent); -bool8 ShouldUseItem(void); +static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); +static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent); +static bool8 ShouldUseItem(void); -bool8 ShouldSwitchIfPerishSong(void) +static bool8 ShouldSwitchIfPerishSong(void) { if (gStatuses3[gActiveBank] & STATUS3_PERISH_SONG && gDisableStructs[gActiveBank].perishSong1 == 0) @@ -43,7 +46,7 @@ bool8 ShouldSwitchIfPerishSong(void) return FALSE; } -bool8 ShouldSwitchIfWonderGuard(void) +static bool8 ShouldSwitchIfWonderGuard(void) { u8 opposingIdentity; u8 opposingBank; @@ -127,7 +130,7 @@ bool8 ShouldSwitchIfWonderGuard(void) return FALSE; // at this point there is not a single pokemon in the party that has a super effective move against a pokemon with wonder guard } -bool8 FindMonThatAbsorbsOpponentsMove(void) +static bool8 FindMonThatAbsorbsOpponentsMove(void) { u8 bankIn1, bankIn2; u8 absorbingTypeAbility; @@ -226,7 +229,7 @@ bool8 FindMonThatAbsorbsOpponentsMove(void) return FALSE; } -bool8 ShouldSwitchIfNaturalCure(void) +static bool8 ShouldSwitchIfNaturalCure(void) { if (!(gBattleMons[gActiveBank].status1 & STATUS_SLEEP)) return FALSE; @@ -262,7 +265,7 @@ bool8 ShouldSwitchIfNaturalCure(void) return FALSE; } -bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) +static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) { u8 opposingIdentity; u8 opposingBank; @@ -318,7 +321,7 @@ bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) return FALSE; } -bool8 AreStatsRaised(void) +static bool8 AreStatsRaised(void) { u8 buffedStatsValue = 0; s32 i; @@ -332,7 +335,7 @@ bool8 AreStatsRaised(void) return (buffedStatsValue > 3); } -bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) +static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) { u8 bankIn1, bankIn2; s32 firstId; @@ -433,7 +436,7 @@ bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) return FALSE; } -bool8 ShouldSwitch(void) +static bool8 ShouldSwitch(void) { u8 bankIn1, bankIn2; u8 *activeBankPtr; // needed to match @@ -792,3 +795,157 @@ u8 GetMostSuitableMonToSwitchInto(void) return bestMonId; } + +// TODO: use PokemonItemEffect struct instead of u8 once it's documented +static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u16 as item Id argument +{ + if (itemId == ITEM_FULL_RESTORE) + return AI_ITEM_FULL_RESTORE; + if (itemEffect[4] & 4) + return AI_ITEM_HEAL_HP; + if (itemEffect[3] & 0x3F) + return AI_ITEM_CURE_CONDITION; + if (itemEffect[0] & 0x3F || itemEffect[1] != 0 || itemEffect[2] != 0) + return AI_ITEM_X_STAT; + if (itemEffect[3] & 0x80) + return AI_ITEM_GUARD_SPECS; + + return AI_ITEM_NOT_RECOGNIZABLE; +} + +static bool8 ShouldUseItem(void) +{ + struct Pokemon *party; + s32 i; + u8 validMons = 0; + bool8 shouldUse = FALSE; + + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON2) + return FALSE; + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = 0; i < 6; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + validMons++; + } + } + + for (i = 0; i < 4; i++) + { + u16 item; + const u8 *itemEffects; + u8 paramOffset; + u8 bankSide; + + if (i != 0 && validMons > (gBattleResources->battleHistory->itemsNo - i) + 1) + continue; + item = gBattleResources->battleHistory->trainerItems[i]; + if (item == ITEM_NONE) + continue; + if (gItemEffectTable[item - 13] == NULL) + continue; + + if (item == ITEM_ENIGMA_BERRY) + itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect; + else + itemEffects = gItemEffectTable[item - 13]; + + *(gBattleStruct->AI_itemType + gActiveBank / 2) = GetAI_ItemType(item, itemEffects); + + switch (*(gBattleStruct->AI_itemType + gActiveBank / 2)) + { + case AI_ITEM_FULL_RESTORE: + if (gBattleMons[gActiveBank].hp >= gBattleMons[gActiveBank].maxHP / 4) + break; + if (gBattleMons[gActiveBank].hp == 0) + break; + shouldUse = TRUE; + break; + case AI_ITEM_HEAL_HP: + paramOffset = GetItemEffectParamOffset(item, 4, 4); + if (paramOffset == 0) + break; + if (gBattleMons[gActiveBank].hp == 0) + break; + if (gBattleMons[gActiveBank].hp < gBattleMons[gActiveBank].maxHP / 4 || gBattleMons[gActiveBank].maxHP - gBattleMons[gActiveBank].hp > itemEffects[paramOffset]) + shouldUse = TRUE; + break; + case AI_ITEM_CURE_CONDITION: + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) = 0; + if (itemEffects[3] & 0x20 && gBattleMons[gActiveBank].status1 & STATUS_SLEEP) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x20; + shouldUse = TRUE; + } + if (itemEffects[3] & 0x10 && (gBattleMons[gActiveBank].status1 & STATUS_POISON || gBattleMons[gActiveBank].status1 & STATUS_TOXIC_POISON)) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x10; + shouldUse = TRUE; + } + if (itemEffects[3] & 0x8 && gBattleMons[gActiveBank].status1 & STATUS_BURN) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x8; + shouldUse = TRUE; + } + if (itemEffects[3] & 0x4 && gBattleMons[gActiveBank].status1 & STATUS_FREEZE) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x4; + shouldUse = TRUE; + } + if (itemEffects[3] & 0x2 && gBattleMons[gActiveBank].status1 & STATUS_PARALYSIS) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x2; + shouldUse = TRUE; + } + if (itemEffects[3] & 0x1 && gBattleMons[gActiveBank].status2 & STATUS2_CONFUSION) + { + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x1; + shouldUse = TRUE; + } + break; + case AI_ITEM_X_STAT: + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) = 0; + if (gDisableStructs[gActiveBank].isFirstTurn == 0) + break; + if (itemEffects[0] & 0xF) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x1; + if (itemEffects[1] & 0xF0) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x2; + if (itemEffects[1] & 0xF) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x4; + if (itemEffects[2] & 0xF) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x8; + if (itemEffects[2] & 0xF0) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x20; + if (itemEffects[0] & 0x30) + *(gBattleStruct->AI_itemFlags + gActiveBank / 2) |= 0x80; + shouldUse = TRUE; + break; + case AI_ITEM_GUARD_SPECS: + bankSide = GetBankSide(gActiveBank); + if (gDisableStructs[gActiveBank].isFirstTurn != 0 && gSideTimers[bankSide].mistTimer == 0) + shouldUse = TRUE; + break; + case AI_ITEM_NOT_RECOGNIZABLE: + return FALSE; + } + + if (shouldUse) + { + EmitCmd_x21(1, 1, 0); + *(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item; + gBattleResources->battleHistory->trainerItems[i] = 0; + return shouldUse; + } + } + + return FALSE; +} From 31eeff93197619c653d5e9da8ed131c0aa368a82 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 10 Oct 2017 21:28:32 -0500 Subject: [PATCH 7/8] Use less cd and more vars --- Makefile | 109 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 48 deletions(-) diff --git a/Makefile b/Makefile index d10505145..ca8348f68 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,19 @@ SHELL := /bin/bash -o pipefail +ROM := pokeemerald.gba +OBJ_DIR := build/emerald + +ELF = $(ROM:.gba=.elf) +MAP = $(ROM:.gba=.map) + +C_SUBDIR = src +ASM_SUBDIR = asm +DATA_ASM_SUBDIR = data + +C_BUILDDIR = $(OBJ_DIR)/$(C_SUBDIR) +ASM_BUILDDIR = $(OBJ_DIR)/$(ASM_SUBDIR) +DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) + AS := $(DEVKITARM)/bin/arm-none-eabi-as ASFLAGS := -mcpu=arm7tdmi @@ -10,7 +24,7 @@ CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef LD := $(DEVKITARM)/bin/arm-none-eabi-ld -LDFLAGS := -T ld_script.ld -Map ../../pokeemerald.map +LDFLAGS = -Map $(MAP) OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy @@ -20,7 +34,7 @@ SHA1 := sha1sum -c GFX := tools/gbagfx/gbagfx AIF := tools/aif2pcm/aif2pcm -MID := tools/mid2agb/mid2agb +MID := $(abspath tools/mid2agb/mid2agb) SCANINC := tools/scaninc/scaninc PREPROC := tools/preproc/preproc RAMSCRGEN := tools/ramscrgen/ramscrgen @@ -35,24 +49,19 @@ RAMSCRGEN := tools/ramscrgen/ramscrgen .PHONY: rom clean compare tidy +$(shell mkdir -p $(C_BUILDDIR) $(ASM_BUILDDIR) $(DATA_ASM_BUILDDIR)) -$(shell mkdir -p build/ build/emerald/{,asm,data,src}) +C_SRCS := $(wildcard $(C_SUBDIR)/*.c) +C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) -C_SRCS := $(wildcard src/*.c) -C_OBJS := $(C_SRCS:%.c=build/emerald/%.o) +ASM_SRCS := $(wildcard $(ASM_SUBDIR)/*.s) +ASM_OBJS := $(patsubst $(ASM_SUBDIR)/%.s,$(ASM_BUILDDIR)/%.o,$(ASM_SRCS)) -ASM_SRCS := $(wildcard asm/*.s) -ASM_OBJS := $(ASM_SRCS:%.s=build/emerald/%.o) - -DATA_ASM_SRCS := $(wildcard data/*.s) -DATA_ASM_OBJS := $(DATA_ASM_SRCS:%.s=build/emerald/%.o) +DATA_ASM_SRCS := $(wildcard $(DATA_ASM_SUBDIR)/*.s) +DATA_ASM_OBJS := $(patsubst $(DATA_ASM_SUBDIR)/%.s,$(DATA_ASM_BUILDDIR)/%.o,$(DATA_ASM_SRCS)) OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) - -$OBJS_REL := $(OBJS:build/emerald/%=%) - -ROM := pokeemerald.gba -ELF := $(ROM:.gba=.elf) +OBJS_REL := $(patsubst $(OBJ_DIR)/%,%,$(OBJS)) rom: $(ROM) @@ -64,7 +73,7 @@ clean: tidy find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + tidy: - rm -f pokeemerald.{gba,map,elf} + rm -f $(ROM) $(ELF) $(MAP) rm -r build/* include graphics_file_rules.mk @@ -80,58 +89,62 @@ include graphics_file_rules.mk %.lz: % ; $(GFX) $< $@ %.rl: % ; $(GFX) $< $@ -%src/libc.o: CC1 := tools/agbcc/bin/old_agbcc -%src/libc.o: CFLAGS := -O2 +$(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc +$(C_BUILDDIR)/libc.o: CFLAGS := -O2 -%src/siirtc.o: CFLAGS := -mthumb-interwork +$(C_BUILDDIR)/siirtc.o: CFLAGS := -mthumb-interwork -%src/agb_flash.o: CFLAGS := -O -mthumb-interwork -%src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork -%src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork +$(C_BUILDDIR)/agb_flash.o: CFLAGS := -O -mthumb-interwork +$(C_BUILDDIR)/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork +$(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork -%src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc -%src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc +$(C_BUILDDIR)/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc +$(C_BUILDDIR)/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc ifeq ($(NODEP),) -build/emerald/src/%.o: c_dep = $(shell $(SCANINC) src/$(*F).c) +$(C_BUILDDIR)/%.o: c_dep = $(shell $(SCANINC) $(C_SUBDIR)/$*.c) else -build/emerald/src/%.o: c_dep := +$(C_BUILDDIR)/%.o: c_dep := endif -build/emerald/%.o : %.c $$(c_dep) - @$(CPP) $(CPPFLAGS) $< -o build/emerald/$*.i - @$(PREPROC) build/emerald/$*.i charmap.txt | $(CC1) $(CFLAGS) -o build/emerald/$*.s - @echo -e ".text\n\t.align\t2, 0\n" >> build/emerald/$*.s - $(AS) $(ASFLAGS) -o $@ build/emerald/$*.s +$(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) + @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i + @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s + @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s + $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s ifeq ($(NODEP),) -build/emerald/asm/%.o: asm_dep = $(shell $(SCANINC) asm/$(*F).s) -build/emerald/data/%.o: asm_dep = $(shell $(SCANINC) data/$(*F).s) +$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) $(ASM_SUBDIR)/$*.s) else -build/emerald/asm/%.o: asm_dep := -build/emerald/data/%.o: asm_dep := +$(ASM_BUILDDIR)/%.o: asm_dep := endif -build/emerald/asm/%.o: asm/%.s $$(asm_dep) +$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) $(AS) $(ASFLAGS) -o $@ $< -build/emerald/data/%.o: data/%.s $$(asm_dep) +ifeq ($(NODEP),) +$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) $(DATA_ASM_SUBDIR)/$*.s) +else +$(DATA_ASM_BUILDDIR)/%.o: data_dep := +endif + +$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) $(PREPROC) $< charmap.txt | $(AS) $(ASFLAGS) -o $@ -build/emerald/sym_bss.ld: sym_bss.txt - cd build/emerald && ../../$(RAMSCRGEN) .bss ../../sym_bss.txt ENGLISH >sym_bss.ld +$(OBJ_DIR)/sym_bss.ld: sym_bss.txt + $(RAMSCRGEN) .bss $< ENGLISH > $@ -build/emerald/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) - cd build/emerald && ../../$(RAMSCRGEN) COMMON ../../sym_common.txt ENGLISH -c src,../../common_syms >sym_common.ld +$(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) + $(RAMSCRGEN) COMMON $< ENGLISH -c $(C_BUILDDIR),common_syms > $@ -build/emerald/sym_ewram.ld: sym_ewram.txt - cd build/emerald && ../../$(RAMSCRGEN) ewram_data ../../sym_ewram.txt ENGLISH >sym_ewram.ld +$(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt + $(RAMSCRGEN) ewram_data $< ENGLISH > $@ -build/emerald/ld_script.ld: ld_script.txt build/emerald/sym_bss.ld build/emerald/sym_common.ld build/emerald/sym_ewram.ld - cd build/emerald && sed -f ../../ld_script.sed ../../ld_script.txt | sed "s#tools/#../../tools/#g" | sed "s#sound/#../../sound/#g" >ld_script.ld +$(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld + cd $(OBJ_DIR) && sed -f ../../ld_script.sed ../../$< | sed "s#tools/#../../tools/#g" | sed "s#sound/#../../sound/#g" > ld_script.ld -pokeemerald.elf: build/emerald/ld_script.ld $(OBJS) - cd build/emerald && $(LD) $(LDFLAGS) -o ../../$@ $(OBJS_REL) ../../$(LIBGCC) +$(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) + cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) ../../$(LIBGCC) -pokeemerald.gba: %.gba: %.elf +$(ROM): $(ELF) $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@ From 52db3ad5aa83ae70e06eae87f502b09fff55aecc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 13 Oct 2017 11:09:36 -0400 Subject: [PATCH 8/8] Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning --- asm/battle_frontier_2.s | 12 +- asm/battle_link_817C95C.s | 4 +- asm/battle_setup.s | 4 +- asm/battle_tower.s | 10 +- asm/berry_blender.s | 18 +- asm/cable_club.s | 10 +- asm/contest.s | 40 +- asm/contest_ai.s | 4 +- asm/contest_link_80F57C4.s | 24 +- asm/contest_link_80FC4F4.s | 2 +- asm/dewford_trend.s | 2 +- asm/easy_chat.s | 10 +- asm/field_message_box.s | 6 +- asm/field_poison.s | 2 +- asm/international_string_util.s | 6 +- asm/link.s | 70 +- asm/mauville_old_man.s | 10 +- asm/pokemon_summary_screen.s | 2 +- asm/record_mixing.s | 22 +- asm/recorded_battle.s | 4 +- asm/rom3.s | 2 +- asm/rom6.s | 48 +- asm/scrcmd.s | 6 +- asm/script_pokemon_util_80F87D8.s | 4 +- asm/secret_base.s | 2 +- asm/trade.s | 4 +- asm/tv.s | 16938 -------------------------- common_syms/tv.txt | 4 + data/event_scripts.s | 10 +- data/text/pokemon_news.inc | 165 + data/text/tv.inc | 2891 +++++ data/tv.s | 128 - include/battle.h | 17 +- include/battle_tower.h | 6 + include/contest.h | 18 + include/decoration.h | 147 + include/easy_chat.h | 6 +- include/event_scripts.h | 349 + include/field_camera.h | 2 + include/field_message_box.h | 12 + include/fieldmap.h | 7 +- include/flags.h | 16 +- include/game_stat.h | 3 + include/global.h | 324 +- include/global.tv.h | 535 + include/international_string_util.h | 13 + include/item.h | 1 + include/link.h | 2 +- include/malloc.h | 2 +- include/moves.h | 1 + include/pokedex.h | 4 +- include/pokemon_storage_system.h | 2 + include/region_map.h | 227 + include/rom4.h | 1 + include/rom6.h | 1 + include/script_menu.h | 11 + include/secret_base.h | 11 + include/shop.h | 12 + include/species.h | 1 + include/string_util.h | 2 +- include/strings.h | 33 + include/tv.h | 21 + include/vars.h | 10 + ld_script.txt | 4 +- src/battle_2.c | 13 +- src/battle_script_commands.c | 2 +- src/battle_util.c | 2 +- src/egg_hatch.c | 6 +- src/new_game.c | 2 +- src/safari_zone.c | 2 +- src/start_menu.c | 4 +- src/string_util.c | 2 +- src/tv.c | 7927 ++++++++++++ sym_bss.txt | 11 +- sym_common.txt | 22 +- sym_ewram.txt | 32 +- 76 files changed, 12689 insertions(+), 17601 deletions(-) delete mode 100644 asm/tv.s create mode 100644 common_syms/tv.txt create mode 100644 data/text/pokemon_news.inc create mode 100644 data/text/tv.inc delete mode 100644 data/tv.s create mode 100644 include/battle_tower.h create mode 100644 include/contest.h create mode 100644 include/decoration.h create mode 100644 include/field_message_box.h create mode 100644 include/global.tv.h create mode 100644 include/international_string_util.h create mode 100644 include/region_map.h create mode 100644 include/script_menu.h create mode 100644 include/secret_base.h create mode 100644 include/shop.h create mode 100644 include/strings.h create mode 100644 include/tv.h create mode 100644 src/tv.c diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 9e01d22d1..88ee1c1ed 100755 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -12935,7 +12935,7 @@ _081A1118: adds r1, r0, 0 mov r0, sp movs r2, 0x2 - bl sub_81DB5E8 + bl TVShowConvertInternationalString adds r0, r5, 0 mov r1, sp bl StringCopy @@ -18997,7 +18997,7 @@ sub_81A4594: @ 81A4594 adds r1, r6, 0x6 ldrb r2, [r6, 0xE] add r0, sp, 0xC - bl sub_81DB5E8 + bl TVShowConvertInternationalString ldr r1, =gUnknown_0203AB74 ldrb r0, [r1] mov r3, r8 @@ -19111,7 +19111,7 @@ sub_81A4684: @ 81A4684 adds r1, 0xA ldrb r2, [r5, 0x1A] add r0, sp, 0xC - bl sub_81DB5E8 + bl TVShowConvertInternationalString ldr r1, =gUnknown_0203AB74 ldrb r0, [r1] adds r3, r7, 0x2 @@ -19133,13 +19133,13 @@ sub_81A4684: @ 81A4684 adds r4, r5, 0 adds r4, 0x12 adds r0, r4, 0 - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _081A4734 add r0, sp, 0xC adds r1, r4, 0 movs r2, 0x1 - bl sub_81DB5E8 + bl TVShowConvertInternationalString b _081A473C .pool _081A4734: @@ -28660,7 +28660,7 @@ _081A95EE: lsls r0, r7, 2 adds r0, r1 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage add sp, 0x8 pop {r3,r4} mov r8, r3 diff --git a/asm/battle_link_817C95C.s b/asm/battle_link_817C95C.s index ec5baadd9..aa887bc25 100644 --- a/asm/battle_link_817C95C.s +++ b/asm/battle_link_817C95C.s @@ -3193,7 +3193,7 @@ _0817E63A: adds r1, r4, 0 ldr r2, [sp] ldr r3, [sp, 0x4] - bl sub_80ECB00 + bl PutBattleUpdateOnTheAir b _0817E670 .pool _0817E65C: @@ -3205,7 +3205,7 @@ _0817E65C: adds r1, r4, 0 ldr r2, [sp] ldr r3, [sp, 0x4] - bl sub_80ECB00 + bl PutBattleUpdateOnTheAir _0817E670: add sp, 0x20 pop {r3-r5} diff --git a/asm/battle_setup.s b/asm/battle_setup.s index fbedfff2f..b345ca96d 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -2407,7 +2407,7 @@ _080B1AD8: .pool _080B1AEC: bl sub_80B1C7C - bl box_related_two__2 + bl ShowFieldMessage _080B1AF4: pop {r0} bx r0 @@ -2468,7 +2468,7 @@ _080B1B56: special_trainer_unable_to_battle: @ 80B1B60 push {lr} bl sub_80B1D18 - bl box_related_two__2 + bl ShowFieldMessage pop {r0} bx r0 thumb_func_end special_trainer_unable_to_battle diff --git a/asm/battle_tower.s b/asm/battle_tower.s index 59971c5d2..4d86e8d28 100755 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -1795,7 +1795,7 @@ _08162ED8: adds r0, 0xE4 ldrb r2, [r0] adds r0, r6, 0 - bl sub_81DB5E8 + bl TVShowConvertInternationalString b _08162F62 .pool _08162F00: @@ -1835,7 +1835,7 @@ _08162F3E: adds r1, r0, 0 adds r0, r6, 0 adds r2, r4, 0 - bl sub_81DB5E8 + bl TVShowConvertInternationalString b _08162F62 .pool _08162F5C: @@ -5016,7 +5016,7 @@ _08164B04: lsls r0, 2 adds r0, r1 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage b _08164B54 .pool _08164B28: @@ -5040,7 +5040,7 @@ _08164B28: lsls r1, 2 adds r1, r0 ldr r0, [r1] - bl box_related_two__2 + bl ShowFieldMessage _08164B54: add sp, 0x8 pop {r3-r5} @@ -5673,7 +5673,7 @@ _0816508C: bl SetMonData ldr r0, [r7] adds r0, r4 - bl sub_80EE5A4 + bl GetRibbonCount strb r0, [r5, 0x1] _081650D4: adds r5, 0x4 diff --git a/asm/berry_blender.s b/asm/berry_blender.s index 277a49d2f..6d18ab7cb 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -1275,7 +1275,7 @@ _080802AC: strh r0, [r1] adds r5, 0x1 _080802D4: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -1295,7 +1295,7 @@ _080802EC: bl sub_807FD90 b _08080336 _08080302: - bl sub_8009FCC + bl GetLinkPlayerCount ldr r2, =gUnknown_020322A4 ldr r1, [r2] adds r1, 0x7C @@ -6091,7 +6091,7 @@ _08082BEE: lsls r0, 24 lsrs r5, r0, 24 _08082BF4: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -6104,7 +6104,7 @@ _08082C0C: lsls r0, 24 lsrs r5, r0, 24 _08082C12: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -6118,7 +6118,7 @@ _08082C12: cmp r0, 0 bne _08082C0C _08082C2E: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -6132,7 +6132,7 @@ _08082C48: lsls r0, 24 lsrs r5, r0, 24 _08082C4E: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -6149,7 +6149,7 @@ _08082C6A: ldr r4, =gUnknown_03003110 adds r0, r4, 0 bl sub_8081F94 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -8568,7 +8568,7 @@ sub_8083F94: @ 8083F94 ldrb r0, [r5, 0x12] str r0, [sp] adds r0, r7, 0 - bl sub_80ECC04 + bl Put3CheersForPokeblocksOnTheAir lsls r0, 24 cmp r0, 0 bne _080840BA @@ -8617,7 +8617,7 @@ _08084058: ldrb r0, [r5, 0x12] str r0, [sp] adds r0, r7, 0 - bl sub_80ECC04 + bl Put3CheersForPokeblocksOnTheAir lsls r0, 24 cmp r0, 0 beq _080840C4 diff --git a/asm/cable_club.s b/asm/cable_club.s index d5d3af151..4d2bee19d 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -1059,7 +1059,7 @@ _080B2C5C: lsls r0, 24 lsrs r4, r0, 24 _080B2C7E: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -1361,7 +1361,7 @@ _080B2F0C: movs r0, 0 mov r8, r0 mov r9, r0 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 @@ -1984,7 +1984,7 @@ _080B3474: adds r5, 0x1C adds r4, 0x1 _080B349A: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -2080,7 +2080,7 @@ _080B3574: beq _080B35F8 b _080B35FE _080B357A: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r3, r0, 24 movs r4, 0 @@ -2297,7 +2297,7 @@ _080B3750: b _080B37CC _080B375A: ldr r0, =gUnknown_08278091 - bl box_related_two__2 + bl ShowFieldMessage movs r0, 0x1 strh r0, [r5, 0x8] b _080B37CC diff --git a/asm/contest.s b/asm/contest.s index 561c79857..07883f1cd 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -1525,7 +1525,7 @@ sub_80D8490: @ 80D8490 movs r6, 0 ldr r0, =gUnknown_02039F25 mov r8, r0 - ldr r2, =gUnknown_02039E1E + ldr r2, =gUnknown_02039E00 + 30 mov r10, r2 ldr r7, =gUnknown_02039F34 _080D84B8: @@ -2624,7 +2624,7 @@ _080D8EF2: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy mov r2, r9 @@ -3562,7 +3562,7 @@ _080D96D4: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r4, =gStringVar4 @@ -3671,7 +3671,7 @@ _080D97DC: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r4, =gStringVar4 @@ -3809,7 +3809,7 @@ _080D9904: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r4, =gStringVar4 @@ -4010,7 +4010,7 @@ _080D9AD2: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r4, =gUnknown_02039F34 @@ -4381,7 +4381,7 @@ _080D9DD4: lsls r1, 20 lsrs r1, 29 lsls r1, 6 - ldr r4, =gUnknown_02039E02 + ldr r4, =gUnknown_02039E00 + 2 adds r1, r4 bl StringCopy ldr r0, =gStringVar1 @@ -4476,7 +4476,7 @@ _080D9EDC: bl sub_80DC9B4 ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r0, =gStringVar2 @@ -4626,7 +4626,7 @@ _080DA038: bl sub_80DB89C ldr r0, =gStringVar1 lsls r1, r6, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r4, =gStringVar4 @@ -5096,7 +5096,7 @@ sub_80DA3CC: @ 80DA3CC ldr r0, =gStringVar1 ldrb r1, [r5] lsls r1, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r5, =gStringVar4 @@ -5360,7 +5360,7 @@ _080DA600: lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x8] - bl sub_80ED03C + bl BravoTrainerPokemonProfile_BeforeInterview1 b _080DA668 .pool _080DA65C: @@ -5667,7 +5667,7 @@ _080DA8F2: ldr r5, =gUnknown_02039F25 ldrb r0, [r5] lsls r0, 6 - ldr r4, =gUnknown_02039E0D + ldr r4, =gUnknown_02039E00 + 13 adds r0, r4 mov r1, sp movs r2, 0x8 @@ -6451,7 +6451,7 @@ sub_80DAF1C: @ 80DAF1C add r0, sp, 0x4 bl StringCopy lsls r1, r5, 6 - ldr r0, =gUnknown_02039E0D + ldr r0, =gUnknown_02039E00 + 13 adds r1, r0 add r0, sp, 0x4 bl StringAppend @@ -6508,7 +6508,7 @@ sub_80DAFA0: @ 80DAFA0 lsls r1, 24 lsrs r1, 24 lsls r0, r4, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r0, r2 bl sub_80DAED4 ldr r0, =gUnknown_02039F26 @@ -11173,7 +11173,7 @@ sub_80DD45C: @ 80DD45C lsrs r6, r1, 24 ldr r0, =gStringVar1 lsls r1, r4, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy ldr r0, =gStringVar2 @@ -15385,21 +15385,21 @@ _080DF6AE: beq _080DF6AE _080DF6C4: mov r0, r9 - bl sub_80ECDA4 + bl ContestLiveUpdates_BeforeInterview_1 mov r0, r10 - bl sub_80ECDF4 + bl ContestLiveUpdates_BeforeInterview_2 ldr r5, [sp, 0x4] lsrs r0, r5, 24 - bl sub_80ECE34 + bl ContestLiveUpdates_BeforeInterview_3 ldr r0, =gUnknown_02039F34 ldr r0, [r0] ldr r0, [r0, 0x1C] add r0, r8 ldrh r0, [r0, 0xA] - bl sub_80ECE74 + bl ContestLiveUpdates_BeforeInterview_4 adds r0, r4, 0 adds r1, r6, 0 - bl sub_80ECEB4 + bl ContestLiveUpdates_BeforeInterview_5 _080DF6EE: add sp, 0xC pop {r3-r5} diff --git a/asm/contest_ai.s b/asm/contest_ai.s index f28492886..af2ee5286 100644 --- a/asm/contest_ai.s +++ b/asm/contest_ai.s @@ -144,7 +144,7 @@ sub_81563B0: @ 81563B0 beq _081564A0 adds r7, r5, 0 ldr r6, =gAIScriptPtr - ldr r0, =gUnknown_02039E1E + ldr r0, =gUnknown_02039E00 + 30 mov r8, r0 _081563CC: ldr r0, [r7] @@ -5030,7 +5030,7 @@ sub_8158948: @ 8158948 push {r4-r6,lr} movs r5, 0 movs r4, 0 - ldr r6, =gUnknown_02039E1E + ldr r6, =gUnknown_02039E00 + 30 _08158950: lsls r1, r4, 1 ldr r0, =gUnknown_02039F34 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 03e1aaf2b..34e2811d9 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -1239,7 +1239,7 @@ _080F6334: ldr r1, =gUnknown_02039F20 ldrb r0, [r1] ldr r7, =gStringVar1 - ldr r2, =gUnknown_02039E0D + ldr r2, =gUnknown_02039E00 + 13 mov r8, r2 cmp r0, 0 beq _080F636E @@ -1750,7 +1750,7 @@ task_repel: @ 80F67C4 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] - bl sub_80ED090 + bl BravoTrainerPokemonProfile_BeforeInterview2 _080F67E6: movs r0, 0 str r0, [sp] @@ -4785,7 +4785,7 @@ _080F8074: ldrb r0, [r6] muls r0, r5 adds r0, r4 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -4834,7 +4834,7 @@ _080F80E2: ldrb r0, [r7] muls r0, r6 adds r0, r5 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -4883,7 +4883,7 @@ _080F814E: ldrb r0, [r7] muls r0, r6 adds r0, r5 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -4926,7 +4926,7 @@ _080F8190: ldrb r0, [r7] muls r0, r6 adds r0, r5 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -4969,7 +4969,7 @@ _080F81F8: ldrb r0, [r7] muls r0, r6 adds r0, r5 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -4994,7 +4994,7 @@ sub_80F8264: @ 80F8264 ldr r0, =gSpecialVar_0x8006 ldrh r1, [r0] lsls r1, 6 - ldr r0, =gUnknown_02039E0D + ldr r0, =gUnknown_02039E00 + 13 adds r1, r0 adds r0, r4, 0 bl StringCopy @@ -5013,7 +5013,7 @@ sub_80F8290: @ 80F8290 ldr r1, =gSpecialVar_0x8006 ldrh r1, [r1] lsls r1, 6 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 adds r1, r2 bl StringCopy pop {r0} @@ -5104,7 +5104,7 @@ sub_80F834C: @ 80F834C ldr r2, =gUnknown_02039F20 ldrb r0, [r2] ldr r4, =gStringVar3 - ldr r3, =gUnknown_02039E0D + ldr r3, =gUnknown_02039E00 + 13 cmp r0, 0 beq _080F836E _080F835C: @@ -5137,7 +5137,7 @@ sub_80F8390: @ 80F8390 ldr r2, =gUnknown_02039F20 ldrb r0, [r2] ldr r4, =gStringVar1 - ldr r3, =gUnknown_02039E02 + ldr r3, =gUnknown_02039E00 + 2 cmp r0, 0 beq _080F83B2 _080F83A0: @@ -5578,7 +5578,7 @@ sub_80F8714: @ 80F8714 b _080F877E .pool _080F8748: - ldr r5, =gUnknown_02039E02 + ldr r5, =gUnknown_02039E00 + 2 movs r4, 0x3 _080F874C: adds r0, r5, 0 diff --git a/asm/contest_link_80FC4F4.s b/asm/contest_link_80FC4F4.s index ad22946c5..4565c75aa 100644 --- a/asm/contest_link_80FC4F4.s +++ b/asm/contest_link_80FC4F4.s @@ -141,7 +141,7 @@ sub_80FC5DC: @ 80FC5DC bl GetMultiplayerId ldr r1, =gUnknown_02039F25 strb r0, [r1] - bl sub_8009FCC + bl GetLinkPlayerCount ldr r4, =gUnknown_02039F30 strb r0, [r4] ldr r1, =gUnknown_02039F2A diff --git a/asm/dewford_trend.s b/asm/dewford_trend.s index c3a7b192c..40df2d6a0 100644 --- a/asm/dewford_trend.s +++ b/asm/dewford_trend.s @@ -492,7 +492,7 @@ sub_812287C: @ 812287C bl Free b _08122980 _081228B0: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 mov r9, r0 diff --git a/asm/easy_chat.s b/asm/easy_chat.s index 20bf327ac..fbbc85c25 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -565,7 +565,7 @@ _0811A72C: ldr r4, =gStringVar3 adds r0, r4, 0 movs r1, 0x2 - bl sub_811F88C + bl InitializeEasyChatWordArray b _0811A7C2 .pool _0811A73C: @@ -3704,7 +3704,7 @@ sub_811BDF0: @ 811BDF0 ldrb r2, [r0] mov r0, sp adds r1, r5, 0 - bl sub_81DB5E8 + bl TVShowConvertInternationalString movs r0, 0 mov r1, sp bl sub_81AFC0C @@ -11109,8 +11109,8 @@ _0811F886: bx r1 thumb_func_end sub_811F860 - thumb_func_start sub_811F88C -sub_811F88C: @ 811F88C + thumb_func_start InitializeEasyChatWordArray +InitializeEasyChatWordArray: @ 811F88C push {lr} adds r2, r0, 0 lsls r1, 16 @@ -11133,7 +11133,7 @@ _0811F8AE: pop {r0} bx r0 .pool - thumb_func_end sub_811F88C + thumb_func_end InitializeEasyChatWordArray thumb_func_start sub_811F8BC sub_811F8BC: @ 811F8BC diff --git a/asm/field_message_box.s b/asm/field_message_box.s index 35267e8d4..b86b6b738 100644 --- a/asm/field_message_box.s +++ b/asm/field_message_box.s @@ -108,8 +108,8 @@ _080981E4: .pool thumb_func_end task_del_textbox - thumb_func_start box_related_two__2 -box_related_two__2: @ 80981EC + thumb_func_start ShowFieldMessage +ShowFieldMessage: @ 80981EC push {r4,lr} adds r1, r0, 0 ldr r4, =gUnknown_020375BC @@ -130,7 +130,7 @@ _0809820E: pop {r4} pop {r1} bx r1 - thumb_func_end box_related_two__2 + thumb_func_end ShowFieldMessage thumb_func_start sub_8098214 sub_8098214: @ 8098214 diff --git a/asm/field_poison.s b/asm/field_poison.s index 5b1e24719..fde35ecce 100644 --- a/asm/field_poison.s +++ b/asm/field_poison.s @@ -217,7 +217,7 @@ _080F96FC: ldrb r0, [r4, 0x2] bl sub_80F95C0 ldr r0, =gText_PkmnFainted3 - bl box_related_two__2 + bl ShowFieldMessage ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] diff --git a/asm/international_string_util.s b/asm/international_string_util.s index 7c52fc41a..c4369887d 100755 --- a/asm/international_string_util.s +++ b/asm/international_string_util.s @@ -389,8 +389,8 @@ _081DB5E4: bx r0 thumb_func_end sub_81DB5AC - thumb_func_start sub_81DB5E8 -sub_81DB5E8: @ 81DB5E8 + thumb_func_start TVShowConvertInternationalString +TVShowConvertInternationalString: @ 81DB5E8 push {r4,r5,lr} adds r5, r0, 0 adds r4, r2, 0 @@ -403,7 +403,7 @@ sub_81DB5E8: @ 81DB5E8 pop {r4,r5} pop {r0} bx r0 - thumb_func_end sub_81DB5E8 + thumb_func_end TVShowConvertInternationalString thumb_func_start sub_81DB604 sub_81DB604: @ 81DB604 diff --git a/asm/link.s b/asm/link.s index fb20b1fb2..b5f777139 100644 --- a/asm/link.s +++ b/asm/link.s @@ -1371,8 +1371,8 @@ _08009FC4: .pool thumb_func_end sub_8009FAC - thumb_func_start sub_8009FCC -sub_8009FCC: @ 8009FCC + thumb_func_start GetLinkPlayerCount +GetLinkPlayerCount: @ 8009FCC push {lr} ldr r0, =gLinkVSyncDisabled ldrb r0, [r0] @@ -1392,14 +1392,14 @@ _08009FEC: _08009FF4: pop {r1} bx r1 - thumb_func_end sub_8009FCC + thumb_func_end GetLinkPlayerCount thumb_func_start sub_8009FF8 sub_8009FF8: @ 8009FF8 push {r4-r7,lr} adds r6, r0, 0 adds r5, r1, 0 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r4, r0, 24 movs r2, 0 @@ -1442,7 +1442,7 @@ sub_800A03C: @ 800A03C thumb_func_start sub_800A040 sub_800A040: @ 800A040 push {lr} - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -1546,7 +1546,7 @@ _0800A0EA: b _0800A22E .pool _0800A0FC: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 cmp r0, 0 bne _0800A10E @@ -1572,12 +1572,12 @@ _0800A130: adds r5, 0x1C adds r6, 0x1 _0800A134: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r6, r0 blt _0800A120 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r7, r0 @@ -1714,12 +1714,12 @@ _0800A266: lsls r0, 24 lsrs r4, r0, 24 _0800A26C: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 bcc _0800A24C - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r6, r0 @@ -1742,8 +1742,8 @@ _0800A298: .pool thumb_func_end sub_800A23C - thumb_func_start sub_800A2A4 -sub_800A2A4: @ 800A2A4 + thumb_func_start GetLinkPlayerTrainerId +GetLinkPlayerTrainerId: @ 800A2A4 lsls r0, 24 lsrs r0, 24 ldr r2, =gLinkPlayers @@ -1755,7 +1755,7 @@ sub_800A2A4: @ 800A2A4 ldr r0, [r1] bx lr .pool - thumb_func_end sub_800A2A4 + thumb_func_end GetLinkPlayerTrainerId thumb_func_start sub_800A2BC sub_800A2BC: @ 800A2BC @@ -2697,7 +2697,7 @@ _0800A9E2: lsrs r4, r0, 24 adds r5, 0x1 _0800A9EE: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -3044,7 +3044,7 @@ _0800AC96: thumb_func_start sub_800ACAC sub_800ACAC: @ 800ACAC push {r4,lr} - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r2, r0, 24 movs r3, 0 @@ -3142,7 +3142,7 @@ _0800AD72: thumb_func_start sub_800AD88 sub_800AD88: @ 800AD88 push {r4,r5,lr} - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r3, r0, 24 movs r1, 0 @@ -3239,7 +3239,7 @@ _0800AE46: thumb_func_start sub_800AE5C sub_800AE5C: @ 800AE5C push {r4,lr} - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 @@ -9671,7 +9671,7 @@ _0800E1C8: lsls r0, 24 lsrs r5, r0, 24 _0800E1E6: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 subs r0, 0x1 @@ -9965,7 +9965,7 @@ _0800E428: ble _0800E3FC mov r4, r9 _0800E434: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -10019,7 +10019,7 @@ _0800E4A6: adds r5, 0x1C adds r4, 0x1 _0800E4AC: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -13627,7 +13627,7 @@ sub_80102B8: @ 80102B8 bl sub_800FD14 strh r4, [r5] _080102E6: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 @@ -13734,7 +13734,7 @@ sub_8010390: @ 8010390 b _0801041C .pool _080103CC: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r2, r0, 24 movs r1, 0x1 @@ -15290,7 +15290,7 @@ _08011048: strb r0, [r1, 0x3] adds r4, 0x1 _08011054: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -20950,12 +20950,12 @@ _08014138: adds r5, 0x1C adds r4, 0x1 _08014152: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt _08014138 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -21159,7 +21159,7 @@ sub_8014304: @ 8014304 strh r1, [r0] ldr r0, =0x00004087 bl VarSet - bl sub_8009FCC + bl GetLinkPlayerCount ldr r1, =gUnknown_03005DB8 strb r0, [r1] bl GetMultiplayerId @@ -39697,7 +39697,7 @@ sub_801DDD0: @ 801DDD0 strb r5, [r4, 0x16] movs r0, 0xFF strb r0, [r4, 0x1A] - bl sub_8009FCC + bl GetLinkPlayerCount strb r0, [r4, 0xD] bl GetMultiplayerId strb r0, [r4, 0x13] @@ -42285,7 +42285,7 @@ _0801F30A: movs r0, 0x1 strh r0, [r4] _0801F30E: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 @@ -42446,7 +42446,7 @@ _0801F448: ldrsh r0, [r4, r3] cmp r0, 0 beq _0801F47C - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 @@ -45504,7 +45504,7 @@ _08020C8E: b _08020CF8 .pool _08020CAC: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 mov r8, r0 @@ -53271,7 +53271,7 @@ _08024B2C: _08024B6A: ldr r0, [sp, 0x10] strb r1, [r0] - bl sub_8009FCC + bl GetLinkPlayerCount mov r1, r8 strb r0, [r1] bl GetMultiplayerId @@ -57700,7 +57700,7 @@ _08026EF6: adds r4, 0xC adds r5, 0x1 _08026EFE: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -59511,7 +59511,7 @@ _08027C76: thumb_func_start sub_8027D20 sub_8027D20: @ 8027D20 push {lr} - bl sub_8009FCC + bl GetLinkPlayerCount ldr r1, =gUnknown_02022C98 ldr r1, [r1] adds r1, 0x24 @@ -64891,7 +64891,7 @@ sub_802AA48: @ 802AA48 sub_802AA60: @ 802AA60 push {r4,lr} adds r4, r0, 0 - bl sub_8009FCC + bl GetLinkPlayerCount movs r2, 0 strb r0, [r4, 0x5] adds r1, r4, 0 @@ -68775,7 +68775,7 @@ _0802C8A4: thumb_func_start sub_802C8AC sub_802C8AC: @ 802C8AC push {lr} - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 pop {r1} diff --git a/asm/mauville_old_man.s b/asm/mauville_old_man.s index 7b21e19e7..4972d4096 100644 --- a/asm/mauville_old_man.s +++ b/asm/mauville_old_man.s @@ -1392,7 +1392,7 @@ _08120BB0: movs r0, 0xFF strb r0, [r7, 0x7] mov r0, sp - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _08120BF8 mov r0, sp @@ -1458,7 +1458,7 @@ _08120C48: muls r0, r5 adds r0, 0x5 adds r0, r6, r0 - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _08120C5E mov r0, r8 @@ -1480,7 +1480,7 @@ _08120C6A: movs r5, 0x3 _08120C74: adds r0, r6, 0 - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _08120C84 mov r1, r8 @@ -1569,7 +1569,7 @@ _08120CF2: mov r1, r8 strb r0, [r1, 0x7] mov r0, sp - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _08120D1A movs r0, 0x1 @@ -2205,7 +2205,7 @@ sub_8121178: @ 8121178 bl ConvertInternationalString mov r0, r8 bl sub_8120EC0 - bl box_related_two__2 + bl ShowFieldMessage pop {r3} mov r8, r3 pop {r4-r6} diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index e1a5e4e4c..7c314f8db 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -6514,7 +6514,7 @@ sub_81C3220: @ 81C3220 b _081C3282 .pool _081C326C: - bl sub_80F0020 + bl GetPlayerIDAsU32 adds r4, r0, 0 ldr r0, =0x0000ffff ands r4, r0 diff --git a/asm/record_mixing.s b/asm/record_mixing.s index aacc5baa0..2e946ad2a 100644 --- a/asm/record_mixing.s +++ b/asm/record_mixing.s @@ -1162,7 +1162,7 @@ _080E7714: lsrs r0, 24 mov r8, r0 _080E771C: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r8, r0 @@ -1179,7 +1179,7 @@ _080E771C: adds r1, 0x1 strh r1, [r0, 0x8] _080E773E: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 ldr r4, [sp, 0x8] @@ -1312,7 +1312,7 @@ sub_80E7820: @ 80E7820 sub_80E7830: @ 80E7830 push {r4,lr} adds r4, r0, 0 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 @@ -1341,7 +1341,7 @@ _080E7856: .pool _080E7868: movs r0, 0 - bl sub_800A2A4 + bl GetLinkPlayerTrainerId adds r2, r0, 0 movs r0, 0x1 ands r2, r0 @@ -1362,7 +1362,7 @@ _080E7880: .pool _080E7894: movs r0, 0 - bl sub_800A2A4 + bl GetLinkPlayerTrainerId movs r1, 0x9 bl __umodsi3 adds r2, r0, 0 @@ -1523,7 +1523,7 @@ _080E79CE: adds r4, r1, 0 adds r4, 0x20 adds r0, r4, 0 - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _080E79F2 adds r0, r4, 0 @@ -1738,7 +1738,7 @@ sub_80E7B60: @ 80E7B60 ldr r0, =gLinkPlayers ldrh r0, [r0, 0x4] bl SeedRng2 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r4, r0, 24 movs r0, 0 @@ -1878,7 +1878,7 @@ _080E7C9A: bne _080E7CEE adds r0, r5, 0 adds r0, 0x24 - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _080E7CBA adds r0, r5, 0 @@ -1901,7 +1901,7 @@ _080E7CC6: adds r4, r0, 0 adds r0, r5, 0 adds r0, 0x2C - bl sub_8009228 + bl IsStringJapanese cmp r0, 0 beq _080E7CE2 ldrb r0, [r4] @@ -1931,7 +1931,7 @@ _080E7CFA: lsrs r0, 16 mov r8, r0 _080E7D04: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r8, r0 @@ -3557,7 +3557,7 @@ sub_80E89AC: @ 80E89AC adds r6, r0, 0 mov r8, r1 mov r9, r2 - bl sub_8009FCC + bl GetLinkPlayerCount adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 diff --git a/asm/recorded_battle.s b/asm/recorded_battle.s index e742cbe7d..2209312c2 100644 --- a/asm/recorded_battle.s +++ b/asm/recorded_battle.s @@ -125,7 +125,7 @@ _08184EAC: bl GetMultiplayerId ldr r1, =gUnknown_0203C7B4 strb r0, [r1] - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -505,7 +505,7 @@ _081851D0: adds r4, 0x1C adds r5, 0x1 _081851DA: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 diff --git a/asm/rom3.s b/asm/rom3.s index 649097eb6..0159a453a 100644 --- a/asm/rom3.s +++ b/asm/rom3.s @@ -1963,7 +1963,7 @@ _08033726: lsls r0, r1, 24 lsrs r4, r0, 24 _0803372C: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r4, r0 diff --git a/asm/rom6.s b/asm/rom6.s index 2ed9d888e..6df7ea0f4 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -4121,7 +4121,7 @@ _081377BC: add r2, sp, 0x18 bl SetMonData adds r0, r4, 0 - bl sub_80EE5A4 + bl GetRibbonCount strb r0, [r5, 0x1] movs r7, 0x1 _0813780A: @@ -4629,7 +4629,7 @@ sub_8137C10: @ 8137C10 ldr r0, =gSpecialVar_0x8004 ldrh r0, [r0] bl sub_8137A98 - bl box_related_two__2 + bl ShowFieldMessage pop {r0} bx r0 .pool @@ -5399,13 +5399,13 @@ sub_8138240: @ 8138240 bl GetMultiplayerId lsls r0, 24 lsrs r7, r0, 24 - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 cmp r4, r5 bcs _0813828A - ldr r0, =gUnknown_0858D144 + ldr r0, =gTVStringVarPtrs mov r8, r0 _08138262: cmp r7, r4 @@ -6378,7 +6378,7 @@ sub_8138AA4: @ 8138AA4 sub_8138AC0: @ 8138AC0 push {lr} ldr r0, =gStringVar4 - bl box_related_two__2 + bl ShowFieldMessage pop {r0} bx r0 .pool @@ -6537,7 +6537,7 @@ _08138BF6: thumb_func_start sub_8138C04 sub_8138C04: @ 8138C04 push {r4,lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7060,7 +7060,7 @@ sub_8138FEC: @ 8138FEC thumb_func_start sub_8139004 sub_8139004: @ 8139004 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7084,7 +7084,7 @@ _0813902A: thumb_func_start sub_8139030 sub_8139030: @ 8139030 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7108,7 +7108,7 @@ _08139056: thumb_func_start sub_813905C sub_813905C: @ 813905C push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7132,7 +7132,7 @@ _08139082: thumb_func_start sub_8139088 sub_8139088: @ 8139088 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7156,7 +7156,7 @@ _081390AE: thumb_func_start sub_81390B4 sub_81390B4: @ 81390B4 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7295,7 +7295,7 @@ RemoveScriptFieldObject: @ 81391AC thumb_func_start sub_81391D0 sub_81391D0: @ 81391D0 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7479,7 +7479,7 @@ _08139342: thumb_func_start sub_8139348 sub_8139348: @ 8139348 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7507,7 +7507,7 @@ sub_8139370: @ 8139370 movs r1, 0x1 mov r0, sp strb r1, [r0] - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7519,7 +7519,7 @@ sub_8139370: @ 8139370 mov r2, sp bl SetMonData adds r0, r4, 0 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 @@ -7538,7 +7538,7 @@ _081393B6: thumb_func_start sub_81393C8 sub_81393C8: @ 81393C8 push {lr} - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -7882,8 +7882,8 @@ _08139684: bx r0 thumb_func_end sub_8139668 - thumb_func_start sub_8139688 -sub_8139688: @ 8139688 + thumb_func_start GetIdxOfFirstPartyMemberThatIsNotAnEgg +GetIdxOfFirstPartyMemberThatIsNotAnEgg: @ 8139688 push {r4-r6,lr} bl CalculatePlayerPartyCount lsls r0, 24 @@ -7926,7 +7926,7 @@ _081396D8: pop {r4-r6} pop {r1} bx r1 - thumb_func_end sub_8139688 + thumb_func_end GetIdxOfFirstPartyMemberThatIsNotAnEgg thumb_func_start sub_81396E0 sub_81396E0: @ 81396E0 @@ -8050,7 +8050,7 @@ sub_81397C4: @ 81397C4 cmp r1, r0 bls _081397E0 movs r0, 0 - bl sub_80EF340 + bl TV_PrintIntToStringVar b _08139862 .pool _081397E0: @@ -9094,7 +9094,7 @@ _0813A062: lsls r0, 2 adds r0, r7 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage pop {r4-r7} pop {r0} bx r0 @@ -9996,7 +9996,7 @@ _0813A7C6: lsrs r0, 22 adds r0, r1 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage pop {r0} bx r0 .pool @@ -10036,7 +10036,7 @@ sub_813A820: @ 813A820 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage ldr r0, =0x00004031 adds r1, r4, 0 bl VarSet @@ -10056,7 +10056,7 @@ sub_813A854: @ 813A854 lsrs r0, 14 adds r0, r4 ldr r0, [r0] - bl box_related_two__2 + bl ShowFieldMessage pop {r4} pop {r0} bx r0 diff --git a/asm/scrcmd.s b/asm/scrcmd.s index f2e61a946..e8a838010 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -3267,7 +3267,7 @@ s67_execute_box: @ 809ABD4 bne _0809ABE2 ldr r0, [r4, 0x64] _0809ABE2: - bl box_related_two__2 + bl ShowFieldMessage movs r0, 0 pop {r4} pop {r1} @@ -3793,7 +3793,7 @@ sBD_virtual_message: @ 809AFA0 ldr r1, =gUnknown_020375C4 ldr r1, [r1] subs r0, r1 - bl box_related_two__2 + bl ShowFieldMessage movs r0, 0 pop {r1} bx r1 @@ -3841,7 +3841,7 @@ s7E_load_first_pokenames: @ 809AFFC lsls r2, 2 adds r2, r0 ldr r4, [r2] - bl sub_8139688 + bl GetIdxOfFirstPartyMemberThatIsNotAnEgg lsls r0, 24 lsrs r0, 24 movs r1, 0x64 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 231879f02..52e3b40db 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -222,7 +222,7 @@ sub_80F8970: @ 80F8970 mov r12, r0 ldr r1, =gSpecialVar_0x8006 mov r9, r1 - ldr r2, =gUnknown_02039E02 + ldr r2, =gUnknown_02039E00 + 2 mov r10, r2 mov r2, r12 mov r1, sp @@ -625,7 +625,7 @@ sub_80F8C7C: @ 80F8C7C ldrb r0, [r6] muls r0, r5 adds r0, r4 - bl sub_80EE5A4 + bl GetRibbonCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 diff --git a/asm/secret_base.s b/asm/secret_base.s index 0290e9f7f..0e47eaf4f 100644 --- a/asm/secret_base.s +++ b/asm/secret_base.s @@ -4494,7 +4494,7 @@ sub_80EAF80: @ 80EAF80 bne _080EAF9A b _080EB16A _080EAF9A: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 diff --git a/asm/trade.s b/asm/trade.s index d4c54cef6..31c16195e 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -6603,7 +6603,7 @@ _0807A97C: adds r4, 0x1C adds r5, 0x1 _0807A980: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 @@ -6632,7 +6632,7 @@ _0807A9B0: adds r4, 0x1C adds r5, 0x1 _0807A9B4: - bl sub_8009FCC + bl GetLinkPlayerCount lsls r0, 24 lsrs r0, 24 cmp r5, r0 diff --git a/asm/tv.s b/asm/tv.s deleted file mode 100644 index d61392fa1..000000000 --- a/asm/tv.s +++ /dev/null @@ -1,16938 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start ClearTVShowData -ClearTVShowData: @ 80EBEE0 - push {r4-r7,lr} - movs r3, 0 - ldr r6, =gSaveBlock1Ptr - movs r5, 0 - ldr r7, =0x000027ce -_080EBEEA: - ldr r0, [r6] - lsls r1, r3, 3 - adds r1, r3 - lsls r1, 2 - adds r0, r1 - ldr r2, =0x000027cc - adds r0, r2 - strb r5, [r0] - ldr r0, [r6] - adds r0, r1 - adds r2, 0x1 - adds r0, r2 - strb r5, [r0] - movs r2, 0 - adds r4, r3, 0x1 - adds r3, r1, 0 -_080EBF0A: - ldr r0, [r6] - adds r1, r2, r3 - adds r0, r7 - adds r0, r1 - strb r5, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x21 - bls _080EBF0A - lsls r0, r4, 24 - lsrs r3, r0, 24 - cmp r3, 0x18 - bls _080EBEEA - bl sub_80EEE5C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ClearTVShowData - - thumb_func_start special_0x44 -special_0x44: @ 80EBF3C - push {r4-r7,lr} - movs r4, 0x5 - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - movs r2, 0xA2 - lsls r2, 6 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080EBF70 - adds r3, r1, 0 - subs r2, 0xB4 -_080EBF54: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x17 - bhi _080EBF70 - ldr r0, [r3] - lsls r1, r4, 3 - adds r1, r4 - lsls r1, 2 - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EBF54 -_080EBF70: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r5, r0, 24 - adds r7, r5, 0 - ldr r6, =gSaveBlock1Ptr -_080EBF86: - ldr r1, [r6] - lsls r0, r5, 3 - adds r0, r5 - lsls r4, r0, 2 - adds r1, r4 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _080EBFBC - ldr r0, [r6] - adds r0, r4 - ldr r1, =0x000027cd - adds r0, r1 - ldrb r0, [r0] - b _080EBFCC - .pool -_080EBFBC: - ldr r2, =0x000027cc - adds r0, r4, r2 - ldr r1, [r6] - adds r1, r0 - ldrh r0, [r1, 0x16] - cmp r0, 0 - bne _080EBFD8 - ldrb r0, [r1, 0x1] -_080EBFCC: - cmp r0, 0x1 - bne _080EBFD8 - adds r0, r5, 0 - b _080EBFEC - .pool -_080EBFD8: - cmp r5, 0 - bne _080EBFE0 - movs r5, 0x17 - b _080EBFE6 -_080EBFE0: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EBFE6: - cmp r5, r7 - bne _080EBF86 - movs r0, 0xFF -_080EBFEC: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end special_0x44 - - thumb_func_start sub_80EBFF4 -sub_80EBFF4: @ 80EBFF4 - push {lr} - bl special_0x44 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xFF - bne _080EC006 - movs r0, 0xFF - b _080EC03E -_080EC006: - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r3, =0x00002b90 - adds r0, r2, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080EC03C - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2, r0 - ldr r2, =0x000027cc - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080EC03C - bl sub_80EC18C - lsls r0, 24 - lsrs r0, 24 - b _080EC03E - .pool -_080EC03C: - adds r0, r1, 0 -_080EC03E: - pop {r1} - bx r1 - thumb_func_end sub_80EBFF4 - - thumb_func_start UpdateTVScreensOnMap -@ void UpdateTVScreensOnMap(s32 mapWidth, s32 mapHeight) -UpdateTVScreensOnMap: @ 80EC044 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldr r0, =0x00000891 - bl FlagSet - bl CheckForBigMovieOrEmergencyNewsOnTV - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC06A - cmp r0, 0x2 - beq _080EC0BE - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0xD - bne _080EC080 -_080EC06A: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl SetTVMetatilesOnMap - b _080EC0BE - .pool -_080EC080: - ldr r0, =0x00000892 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EC0BE - bl sub_80EBFF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080EC0AE - bl sub_80EEF20 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080EC0AE - bl IsTVShowInSearchOfTrainersAiring - lsls r0, 24 - cmp r0, 0 - beq _080EC0BE -_080EC0AE: - ldr r0, =0x00000891 - bl FlagReset - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x3 - bl SetTVMetatilesOnMap -_080EC0BE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end UpdateTVScreensOnMap - - thumb_func_start SetTVMetatilesOnMap -@ void SetTVMetatilesOnMap(s32 mapWidth, s32 mapHeight, u16 metatileId) -SetTVMetatilesOnMap: @ 80EC0CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - movs r5, 0 - cmp r5, r10 - bge _080EC120 - movs r1, 0xC0 - lsls r1, 4 - adds r0, r1, 0 - mov r8, r2 - mov r1, r8 - orrs r1, r0 - mov r8, r1 -_080EC0F2: - movs r4, 0 - adds r7, r5, 0x1 - cmp r4, r9 - bge _080EC11A - mov r0, r8 - lsls r6, r0, 16 -_080EC0FE: - adds r0, r4, 0 - adds r1, r5, 0 - bl MapGridGetMetatileBehaviorAt - cmp r0, 0x86 - bne _080EC114 - adds r0, r4, 0 - adds r1, r5, 0 - lsrs r2, r6, 16 - bl MapGridSetMetatileIdAt -_080EC114: - adds r4, 0x1 - cmp r4, r9 - blt _080EC0FE -_080EC11A: - adds r5, r7, 0 - cmp r5, r10 - blt _080EC0F2 -_080EC120: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end SetTVMetatilesOnMap - - thumb_func_start TurnOffTVScreen -TurnOffTVScreen: @ 80EC130 - push {lr} - ldr r1, =gUnknown_03005DC0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - movs r2, 0x2 - bl SetTVMetatilesOnMap - bl DrawWholeMapView - pop {r0} - bx r0 - .pool - thumb_func_end TurnOffTVScreen - - thumb_func_start TurnOnTVScreen -TurnOnTVScreen: @ 80EC14C - push {lr} - ldr r1, =gUnknown_03005DC0 - ldr r0, [r1] - ldr r1, [r1, 0x4] - movs r2, 0x3 - bl SetTVMetatilesOnMap - bl DrawWholeMapView - pop {r0} - bx r0 - .pool - thumb_func_end TurnOnTVScreen - - thumb_func_start special_0x45 -special_0x45: @ 80EC168 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =gSpecialVar_0x8004 - ldrh r2, [r0] - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end special_0x45 - - thumb_func_start sub_80EC18C -sub_80EC18C: @ 80EC18C - push {r4,lr} - movs r2, 0 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] -_080EC194: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r3, r0 - ldr r4, =0x000027cc - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080EC1C0 - cmp r0, 0x29 - beq _080EC1C0 - adds r4, 0x1 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EC1C0 - adds r0, r2, 0 - b _080EC1CC - .pool -_080EC1C0: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080EC194 - movs r0, 0xFF -_080EC1CC: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EC18C - - thumb_func_start special_0x4a -special_0x4a: @ 80EC1D4 - push {lr} - ldr r3, =gSaveBlock1Ptr - ldr r2, =gSpecialVar_0x8004 - ldrh r1, [r2] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r3, [r3] - adds r0, r3, r0 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080EC214 - ldr r1, =0x00002b90 - adds r0, r3, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080EC214 - bl sub_80EC18C - lsls r0, 24 - lsrs r0, 24 - b _080EC216 - .pool -_080EC214: - ldrb r0, [r2] -_080EC216: - pop {r1} - bx r1 - thumb_func_end special_0x4a - - thumb_func_start ResetGabbyAndTy -ResetGabbyAndTy: @ 80EC21C - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r3, =gSaveBlock1Ptr - ldr r2, [r3] - ldr r1, =0x00002ba4 - adds r0, r2, r1 - movs r4, 0 - mov r10, r4 - movs r1, 0 - strh r1, [r0] - ldr r4, =0x00002ba6 - adds r0, r2, r4 - strh r1, [r0] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - ldr r0, =0x00002baa - adds r1, r2, r0 - ldr r0, =0x0000ffff - strh r0, [r1] - adds r4, 0x6 - adds r2, r4 - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - mov r9, r0 - ands r0, r1 - strb r0, [r2] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - mov r8, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r6, 0x5 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r5, 0x9 - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, r4 - ldrb r2, [r1] - movs r0, 0x1F - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r2, =0x00002baf - adds r0, r2 - ldrb r1, [r0] - mov r4, r9 - ands r4, r1 - strb r4, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - mov r4, r8 - ands r4, r1 - strb r4, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - ands r6, r1 - strb r6, [r0] - ldr r0, [r3] - adds r0, r2 - ldrb r1, [r0] - ands r5, r1 - strb r5, [r0] - ldr r1, [r3] - adds r1, r2 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - ldr r1, =0x00002bac - adds r0, r1 - mov r4, r10 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x1 - adds r0, r1 - strb r4, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ResetGabbyAndTy - - thumb_func_start GabbyAndTyBeforeInterview -GabbyAndTyBeforeInterview: @ 80EC31C - push {r4,lr} - ldr r3, =gSaveBlock1Ptr - ldr r2, [r3] - ldr r0, =gBattleResults - mov r12, r0 - ldrh r1, [r0, 0x6] - ldr r4, =0x00002ba4 - adds r0, r2, r4 - strh r1, [r0] - mov r0, r12 - ldrh r1, [r0, 0x26] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - mov r0, r12 - ldrh r1, [r0, 0x22] - adds r4, 0x2 - adds r0, r2, r4 - strh r1, [r0] - ldr r0, =0x00002bad - adds r2, r0 - ldrb r1, [r2] - adds r0, r1, 0 - adds r4, r3, 0 - cmp r0, 0xFF - beq _080EC354 - adds r0, r1, 0x1 - strb r0, [r2] -_080EC354: - ldr r2, [r4] - mov r0, r12 - ldrb r1, [r0, 0x5] - lsls r1, 31 - ldr r0, =0x00002bae - adds r2, r0 - lsrs r1, 31 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - mov r1, r12 - ldrb r0, [r1] - cmp r0, 0 - beq _080EC398 - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x2 - orrs r1, r2 - b _080EC3A6 - .pool -_080EC398: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x3 - negs r1, r1 - ands r1, r2 -_080EC3A6: - strb r1, [r0] - mov r1, r12 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080EC3C4 - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - b _080EC3D2 - .pool -_080EC3C4: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 -_080EC3D2: - strb r1, [r0] - mov r0, r12 - ldrb r1, [r0, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080EC410 - movs r1, 0 - mov r0, r12 - adds r0, 0x36 - ldrb r0, [r0] - cmp r0, 0 - bne _080EC410 -_080EC3EC: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bhi _080EC41E - mov r0, r12 - adds r0, 0x36 - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _080EC3EC - ldr r0, [r4] - ldr r4, =0x00002bae - adds r0, r4 - b _080EC416 - .pool -_080EC410: - ldr r0, [r4] - ldr r1, =0x00002bae - adds r0, r1 -_080EC416: - ldrb r1, [r0] - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0] -_080EC41E: - bl TakeTVShowInSearchOfTrainersOffTheAir - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r4, =0x00002ba8 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - bne _080EC436 - movs r0, 0x1 - bl FlagSet -_080EC436: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTyBeforeInterview - - thumb_func_start GabbyAndTyAfterInterview -GabbyAndTyAfterInterview: @ 80EC448 - push {r4-r6,lr} - ldr r5, =gSaveBlock1Ptr - ldr r2, [r5] - ldr r6, =0x00002bae - adds r0, r2, r6 - ldrb r1, [r0] - lsls r1, 31 - ldr r4, =0x00002baf - adds r2, r4 - lsrs r1, 31 - ldrb r3, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x2 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x3 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x4 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r2, [r5] - adds r0, r2, r6 - ldrb r0, [r0] - adds r2, r4 - movs r1, 0x8 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x9 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, [r5] - adds r1, r6 - ldrb r0, [r1] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r5] - ldr r1, =gMapHeader - ldrb r1, [r1, 0x14] - ldr r2, =0x00002bac - adds r0, r2 - strb r1, [r0] - movs r0, 0x6 - bl IncrementGameStat - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTyAfterInterview - - thumb_func_start TakeTVShowInSearchOfTrainersOffTheAir -TakeTVShowInSearchOfTrainersOffTheAir: @ 80EC4E8 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00002bae - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end TakeTVShowInSearchOfTrainersOffTheAir - - thumb_func_start GabbyAndTyGetBattleNum -GabbyAndTyGetBattleNum: @ 80EC504 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r2, =0x00002bad - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x5 - bls _080EC522 - ldrb r0, [r1] - movs r1, 0x3 - bl __umodsi3 - adds r0, 0x6 - lsls r0, 24 - lsrs r0, 24 -_080EC522: - pop {r1} - bx r1 - .pool - thumb_func_end GabbyAndTyGetBattleNum - - thumb_func_start IsTVShowInSearchOfTrainersAiring -IsTVShowInSearchOfTrainersAiring: @ 80EC530 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r0, [r0] - lsls r0, 27 - lsrs r0, 31 - bx lr - .pool - thumb_func_end IsTVShowInSearchOfTrainersAiring - - thumb_func_start GabbyAndTyGetLastQuote -GabbyAndTyGetLastQuote: @ 80EC548 - push {r4,r5,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r2, =0x00002baa - adds r1, r0, r2 - ldrh r0, [r1] - ldr r4, =0x0000ffff - cmp r0, r4 - beq _080EC584 - ldr r0, =gStringVar1 - ldrh r1, [r1] - bl CopyEasyChatWord - ldr r1, [r5] - ldr r0, =0x00002baa - adds r1, r0 - ldrh r2, [r1] - adds r0, r4, 0 - orrs r0, r2 - strh r0, [r1] - movs r0, 0x1 - b _080EC586 - .pool -_080EC584: - movs r0, 0 -_080EC586: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GabbyAndTyGetLastQuote - - thumb_func_start GabbyAndTyGetLastBattleTrivia -GabbyAndTyGetLastBattleTrivia: @ 80EC58C - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002baf - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080EC5AC - movs r0, 0x1 - b _080EC5D2 - .pool -_080EC5AC: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080EC5B8 - movs r0, 0x2 - b _080EC5D2 -_080EC5B8: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080EC5C4 - movs r0, 0x3 - b _080EC5D2 -_080EC5C4: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080EC5D0 - movs r0, 0 - b _080EC5D2 -_080EC5D0: - movs r0, 0x4 -_080EC5D2: - pop {r1} - bx r1 - thumb_func_end GabbyAndTyGetLastBattleTrivia - - thumb_func_start GabbyAndTySetScriptVarsToFieldObjectLocalIds -GabbyAndTySetScriptVarsToFieldObjectLocalIds: @ 80EC5D8 - push {lr} - bl GabbyAndTyGetBattleNum - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x7 - bhi _080EC6B0 - lsls r0, 2 - ldr r1, =_080EC5F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EC5F8: - .4byte _080EC618 - .4byte _080EC62C - .4byte _080EC640 - .4byte _080EC654 - .4byte _080EC668 - .4byte _080EC67C - .4byte _080EC690 - .4byte _080EC6A4 -_080EC618: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0xE - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0xD - b _080EC6AE - .pool -_080EC62C: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x5 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x6 - b _080EC6AE - .pool -_080EC640: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x12 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x11 - b _080EC6AE - .pool -_080EC654: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x15 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x16 - b _080EC6AE - .pool -_080EC668: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x8 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x9 - b _080EC6AE - .pool -_080EC67C: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x13 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x14 - b _080EC6AE - .pool -_080EC690: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0x17 - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0x18 - b _080EC6AE - .pool -_080EC6A4: - ldr r1, =gSpecialVar_0x8004 - movs r0, 0xA - strh r0, [r1] - ldr r1, =gSpecialVar_0x8005 - movs r0, 0xB -_080EC6AE: - strh r0, [r1] -_080EC6B0: - pop {r0} - bx r0 - .pool - thumb_func_end GabbyAndTySetScriptVarsToFieldObjectLocalIds - - thumb_func_start InterviewAfter -InterviewAfter: @ 80EC6BC - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0x7 - bhi _080EC724 - lsls r0, 2 - ldr r1, =_080EC6DC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EC6DC: - .4byte _080EC6FC - .4byte _080EC702 - .4byte _080EC708 - .4byte _080EC70E - .4byte _080EC724 - .4byte _080EC714 - .4byte _080EC71A - .4byte _080EC720 -_080EC6FC: - bl sub_80ED548 - b _080EC724 -_080EC702: - bl sub_80ED5B8 - b _080EC724 -_080EC708: - bl sub_80ED610 - b _080EC724 -_080EC70E: - bl TaskDummy5 - b _080EC724 -_080EC714: - bl sub_80ECF5C - b _080EC724 -_080EC71A: - bl sub_80ED164 - b _080EC724 -_080EC720: - bl sub_80ECA38 -_080EC724: - pop {r0} - bx r0 - thumb_func_end InterviewAfter - - thumb_func_start sub_80EC728 -sub_80EC728: @ 80EC728 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r4, 0 - bl sub_80EED88 - bl sub_80ED718 - ldr r5, =gBattleResults - ldrh r0, [r5, 0x28] - cmp r0, 0 - bne _080EC74C - bl sub_80EC8FC - b _080EC888 - .pool -_080EC74C: - bl sub_80EC8A4 - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - cmp r0, 0 - beq _080EC75E - b _080EC888 -_080EC75E: - ldrh r1, [r5, 0x28] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x2A - bl StringCompare - cmp r0, 0 - bne _080EC776 - b _080EC888 -_080EC776: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EC888 - movs r0, 0x15 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC888 - movs r2, 0 - adds r1, r5, 0 - adds r1, 0x36 -_080EC7A8: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _080EC7A8 - cmp r4, 0 - bne _080EC7CA - ldrb r1, [r5, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EC888 -_080EC7CA: - movs r4, 0 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - movs r0, 0x15 - strb r0, [r6] - strb r4, [r6, 0x1] - ldrb r1, [r5, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EC81C - movs r4, 0x1 - movs r0, 0x1 - adds r3, r6, 0 - adds r3, 0x13 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - adds r7, r6, 0x4 - b _080EC84E - .pool -_080EC81C: - movs r2, 0 - ldr r0, =gLastUsedItem - mov r12, r0 - adds r3, r6, 0 - adds r3, 0x13 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 - adds r7, r6, 0x4 - adds r1, r5, 0 - adds r1, 0x36 -_080EC830: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r4, r0 - lsls r0, 16 - lsrs r4, r0, 16 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _080EC830 - cmp r4, 0xFF - bls _080EC84A - movs r4, 0xFF -_080EC84A: - mov r1, r12 - ldrh r0, [r1] -_080EC84E: - strb r4, [r6, 0x12] - strb r0, [r6, 0xF] - mov r0, r8 - ldr r1, [r0] - adds r0, r3, 0 - bl StringCopy - ldr r4, =gUnknown_03005D3A - adds r0, r7, 0 - adds r1, r4, 0 - bl StringCopy - adds r0, r7, 0 - bl sub_81DB604 - adds r5, r0, 0 - adds r0, r7, 0 - bl StripExtCtrlCodes - subs r4, 0x2A - ldrh r0, [r4, 0x28] - strh r0, [r6, 0x10] - adds r0, r6, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r6, 0x2] - strb r5, [r6, 0x3] -_080EC888: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC728 - - thumb_func_start sub_80EC8A4 -sub_80EC8A4: @ 80EC8A4 - push {r4,lr} - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00002b2c - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0x19 - beq _080EC8CA - ldr r2, =0x000027cc - adds r0, r1, r2 - movs r1, 0x18 - bl sub_80EF910 - movs r0, 0x5 - bl GetGameStat - strh r0, [r4, 0x6] - movs r0, 0x19 - strb r0, [r4] -_080EC8CA: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - ldr r1, =gBattleResults - ldrh r0, [r1, 0x28] - strh r0, [r4, 0x4] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x8] - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - strb r0, [r4, 0xA] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC8A4 - - thumb_func_start sub_80EC8FC -sub_80EC8FC: @ 80EC8FC - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - cmp r0, 0 - bne _080EC9B4 - movs r1, 0 - movs r5, 0 - ldr r2, =gUnknown_03005D46 -_080EC914: - adds r0, r1, r2 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bls _080EC914 - cmp r5, 0xFF - bls _080EC92E - movs r5, 0xFF -_080EC92E: - cmp r5, 0x2 - bls _080EC9B4 - ldr r0, =gBattleOutcome - mov r8, r0 - ldrb r0, [r0] - cmp r0, 0x6 - beq _080EC940 - cmp r0, 0x1 - bne _080EC9B4 -_080EC940: - ldr r7, =gSaveBlock1Ptr - ldr r0, [r7] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EC9B4 - movs r0, 0x17 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EC9B4 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r7] - adds r4, r0 - movs r1, 0 - movs r0, 0x17 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =gBattleResults - ldrh r0, [r1, 0x6] - strh r0, [r4, 0xC] - ldrh r0, [r1, 0x20] - strh r0, [r4, 0xE] - strb r5, [r4, 0x10] - mov r1, r8 - ldrb r0, [r1] - strb r0, [r4, 0x11] - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - strb r0, [r4, 0x12] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x2] -_080EC9B4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EC8FC - - thumb_func_start sub_80EC9E8 -sub_80EC9E8: @ 80EC9E8 - push {r4,lr} - adds r4, r0, 0 - bl sub_80F0020 - strb r0, [r4, 0x1E] - lsrs r2, r0, 8 - strb r2, [r4, 0x1F] - adds r1, r4, 0 - adds r1, 0x20 - strb r0, [r1] - adds r1, 0x1 - strb r2, [r1] - adds r1, 0x1 - strb r0, [r1] - adds r0, r4, 0 - adds r0, 0x23 - strb r2, [r0] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80EC9E8 - - thumb_func_start sub_80ECA10 -sub_80ECA10: @ 80ECA10 - push {r4,lr} - adds r4, r0, 0 - bl sub_80F0020 - adds r1, r4, 0 - adds r1, 0x20 - strb r0, [r1] - lsrs r1, r0, 8 - adds r2, r4, 0 - adds r2, 0x21 - strb r1, [r2] - adds r2, 0x1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x23 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80ECA10 - - thumb_func_start sub_80ECA38 -sub_80ECA38: @ 80ECA38 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - ldr r7, [r0] - ldr r1, =0x00002b2c - adds r6, r7, r1 - ldrb r1, [r6] - cmp r1, 0x8 - bne _080ECACE - ldr r0, =gUnknown_030060BC - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r5, =0x000027cc - adds r4, r5 - adds r4, r7, r4 - strb r1, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x14 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - ldr r0, =gUnknown_02039F2C - ldrh r0, [r0] - strb r0, [r4, 0x1C] - ldr r0, =gUnknown_02039F24 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r4, 0x12] - ldrh r0, [r6, 0x2] - strh r0, [r4, 0x2] - ldrb r0, [r6, 0xC] - strb r0, [r4, 0xC] - ldrb r0, [r6, 0xD] - strb r0, [r4, 0xD] - ldrb r0, [r6, 0xE] - strb r0, [r4, 0xE] - ldrh r0, [r6, 0x10] - strh r0, [r4, 0x10] - ldrb r0, [r6, 0xF] - strb r0, [r4, 0xF] - adds r0, r4, 0x4 - ldr r2, =0x00002b30 - adds r1, r7, r2 - bl StringCopy - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x1D] - ldrb r0, [r6, 0x1E] - strb r0, [r4, 0x1E] - mov r1, r8 - ldr r0, [r1] - adds r0, r5 - movs r1, 0x18 - bl sub_80EF910 -_080ECACE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECA38 - - thumb_func_start sub_80ECB00 -sub_80ECB00: @ 80ECB00 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - mov r9, r2 - lsls r3, 16 - lsrs r3, 16 - mov r8, r3 - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFADC - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECBEC - movs r0, 0xA - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ECBEC - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r6] - adds r4, r1, r0 - movs r0, 0xA - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - adds r0, r4, 0x4 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - bne _080ECBA0 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080ECBA2 - strb r5, [r4, 0x18] - b _080ECBA4 - .pool -_080ECBA0: - movs r0, 0x2 -_080ECBA2: - strb r0, [r4, 0x18] -_080ECBA4: - mov r0, r10 - strh r0, [r4, 0x14] - mov r0, r9 - strh r0, [r4, 0x16] - mov r0, r8 - strh r0, [r4, 0x2] - lsls r0, r7, 3 - subs r0, r7 - lsls r5, r0, 2 - ldr r6, =gLinkPlayers + 8 - adds r1, r5, r6 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - adds r0, r4, 0 - adds r0, 0xC - mov r1, sp - bl StringCopy - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x19] - cmp r0, 0x1 - beq _080ECBE8 - adds r0, r6, r5 - ldrh r0, [r0, 0x12] - cmp r0, 0x1 - bne _080ECBEA -_080ECBE8: - movs r0, 0x1 -_080ECBEA: - strb r0, [r4, 0x1A] -_080ECBEC: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECB00 - - thumb_func_start sub_80ECC04 -sub_80ECC04: @ 80ECC04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - mov r10, r0 - ldr r0, [sp, 0x44] - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x20] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - ldr r0, [r0] - ldr r7, =0x000027cc - adds r0, r7 - bl sub_80EFADC - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECC54 - movs r0, 0x9 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x1 - bne _080ECC68 -_080ECC54: - movs r0, 0 - b _080ECCEE - .pool -_080ECC68: - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r0 - movs r0, 0x9 - strb r0, [r4] - movs r7, 0x1 - strb r7, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0xC - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - mov r0, sp - mov r1, r10 - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - adds r0, r4, 0x4 - mov r1, sp - bl StringCopy - movs r0, 0x7 - ands r5, r0 - ldrb r1, [r4, 0x3] - subs r0, 0xF - ands r0, r1 - orrs r0, r5 - movs r1, 0x3 - ands r6, r1 - lsls r2, r6, 3 - subs r1, 0x1C - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - add r0, sp, 0x20 - ldrb r0, [r0] - strb r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x14] - cmp r0, 0x1 - beq _080ECCDA - mov r1, r9 - cmp r1, 0x1 - bne _080ECCE8 -_080ECCDA: - strb r7, [r4, 0x15] - b _080ECCEC - .pool -_080ECCE8: - mov r2, r9 - strb r2, [r4, 0x15] -_080ECCEC: - movs r0, 0x1 -_080ECCEE: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80ECC04 - - thumb_func_start sub_80ECD00 -sub_80ECD00: @ 80ECD00 - push {r4-r6,lr} - sub sp, 0x20 - ldr r6, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8006 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r6] - adds r4, r1, r0 - ldr r0, =gSpecialVar_0x8005 - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 1 - strb r0, [r4, 0x16] - adds r0, r4, 0x2 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - movs r0, 0xB - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - bl sub_80F0020 - strb r0, [r4, 0xA] - lsrs r0, 8 - strb r0, [r4, 0xB] - ldr r1, =gStringVar1 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - adds r0, r4, 0 - adds r0, 0xC - mov r1, sp - bl StringCopy - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x17] - cmp r0, 0x1 - beq _080ECD74 - ldr r0, [r6] - ldr r1, =0x000031a0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ECD98 -_080ECD74: - strb r5, [r4, 0x18] - b _080ECD9A - .pool -_080ECD98: - strb r0, [r4, 0x18] -_080ECD9A: - add sp, 0x20 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80ECD00 - - thumb_func_start sub_80ECDA4 -sub_80ECDA4: @ 80ECDA4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - movs r1, 0x18 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECDDC - ldr r0, [r5] - ldr r1, =0x00002b2c - adds r0, r1 - strb r6, [r0, 0xD] - movs r1, 0x8 - strb r1, [r0] -_080ECDDC: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECDA4 - - thumb_func_start sub_80ECDF4 -sub_80ECDF4: @ 80ECDF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE1C - strb r5, [r4, 0xE] -_080ECE1C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECDF4 - - thumb_func_start sub_80ECE34 -sub_80ECE34: @ 80ECE34 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE5C - strb r5, [r4, 0xF] -_080ECE5C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECE34 - - thumb_func_start sub_80ECE74 -sub_80ECE74: @ 80ECE74 - push {r4,r5,lr} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002b2c - adds r4, r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECE9C - strh r5, [r4, 0x10] -_080ECE9C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECE74 - - thumb_func_start sub_80ECEB4 -sub_80ECEB4: @ 80ECEB4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - ldr r0, =0x00002b2c - adds r5, r4, r0 - ldr r1, =0x000027cc - adds r0, r4, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ECF4C - ldr r2, =gUnknown_02039E00 - lsls r1, r6, 6 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r5, 0x2] - ldr r0, =0x00002b30 - adds r4, r0 - adds r2, 0xD - adds r1, r2 - adds r0, r4, 0 - bl StringCopy - adds r0, r4, 0 - bl StripExtCtrlCodes - strb r7, [r5, 0xC] - adds r1, r6, 0x1 - ldr r0, =gUnknown_02039F30 - ldrb r0, [r0] - cmp r1, r0 - ble _080ECF30 - ldr r0, =gLinkPlayers - ldrh r0, [r0, 0x1A] - b _080ECF4A - .pool -_080ECF30: - ldr r0, =gGameLanguage - ldrb r0, [r0] - cmp r0, 0x1 - beq _080ECF48 - ldr r1, =gLinkPlayers - lsls r0, r6, 3 - subs r0, r6 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x1A] - cmp r0, 0x1 - bne _080ECF4A -_080ECF48: - movs r0, 0x1 -_080ECF4A: - strb r0, [r5, 0x1E] -_080ECF4C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECEB4 - - thumb_func_start sub_80ECF5C -sub_80ECF5C: @ 80ECF5C - push {r4-r7,lr} - ldr r0, =gSaveBlock1Ptr - ldr r6, [r0] - ldr r0, =0x00002b2c - adds r5, r6, r0 - ldrb r2, [r5] - cmp r2, 0x6 - bne _080ED02C - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - adds r4, r6, r0 - strb r2, [r4] - movs r7, 0x1 - strb r7, [r4, 0x1] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - adds r0, r4, 0 - adds r0, 0x16 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - adds r0, 0x8 - ldr r2, =0x00002b34 - adds r1, r6, r2 - bl StringCopy - ldrb r0, [r5, 0x13] - lsls r0, 29 - lsrs r0, 29 - ldrb r2, [r4, 0x13] - movs r3, 0x8 - negs r3, r3 - adds r1, r3, 0 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0x13] - ldrb r2, [r5, 0x13] - movs r0, 0x18 - ands r0, r2 - movs r2, 0x19 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0x13] - ldrh r0, [r5, 0x14] - strh r0, [r4, 0x14] - ldrb r0, [r5, 0x13] - movs r1, 0x60 - ands r1, r0 - movs r0, 0x61 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x13] - ldrb r1, [r5, 0x13] - lsls r1, 29 - lsrs r1, 29 - ands r0, r3 - orrs r0, r1 - strb r0, [r4, 0x13] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x1E] - cmp r0, 0x1 - beq _080ECFFA - ldrb r0, [r5, 0x1F] - cmp r0, 0x1 - bne _080ED01C -_080ECFFA: - strb r7, [r4, 0x1F] - b _080ED01E - .pool -_080ED01C: - strb r0, [r4, 0x1F] -_080ED01E: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 -_080ED02C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ECF5C - - thumb_func_start sub_80ED03C -sub_80ED03C: @ 80ED03C - push {r4-r6,lr} - lsls r0, 16 - lsrs r6, r0, 16 - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x00002b2c - adds r5, r0, r1 - bl sub_80EF7B4 - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED07A - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 - strh r6, [r5, 0x14] - movs r0, 0x6 - strb r0, [r5] -_080ED07A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED03C - - thumb_func_start sub_80ED090 -sub_80ED090: @ 80ED090 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - ldr r0, =0x00002b2c - adds r7, r4, r0 - ldr r1, =0x000027cc - adds r0, r4, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED134 - movs r3, 0x3 - adds r0, r5, 0 - ands r0, r3 - lsls r0, 5 - ldrb r1, [r7, 0x13] - movs r2, 0x61 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r7, 0x13] - ldr r0, =gUnknown_02039F2C - ldrb r0, [r0] - movs r1, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r7, 0x13] - ldr r1, =gUnknown_02039F2E - ldrb r1, [r1] - ands r3, r1 - lsls r3, 3 - movs r1, 0x19 - negs r1, r1 - ands r0, r1 - orrs r0, r3 - strb r0, [r7, 0x13] - ldr r0, =gUnknown_02039F24 - mov r8, r0 - ldrb r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x2] - mov r1, r8 - ldrb r0, [r1] - muls r0, r6 - adds r0, r5 - ldr r1, =0x00002b34 - adds r4, r1 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StripExtCtrlCodes - mov r1, r8 - ldrb r0, [r1] - muls r0, r6 - adds r0, r5 - movs r1, 0x3 - bl GetMonData - strb r0, [r7, 0x1F] -_080ED134: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED090 - - thumb_func_start sub_80ED164 -sub_80ED164: @ 80ED164 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - movs r0, 0x7 - strb r0, [r6] - movs r0, 0x1 - strb r0, [r6, 0x1] - adds r0, r6, 0x2 - ldr r4, =gSaveBlock2Ptr - ldr r1, [r4] - bl StringCopy - adds r0, r6, 0 - adds r0, 0xC - ldr r1, [r4] - ldr r2, =0x00000bd8 - adds r1, r2 - bl StringCopy - ldr r1, [r4] - ldr r2, =0x00000bd4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r6, 0xA] - adds r2, 0x2 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r6, 0x14] - ldr r5, =0x00000d07 - adds r1, r5 - ldrb r0, [r1] - movs r1, 0 - bl sub_8164FCC - strh r0, [r6, 0x16] - ldr r0, [r4] - ldr r1, =0x00000d06 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r6, 0x1C] - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080ED1F4 - movs r0, 0x32 - b _080ED1F6 - .pool -_080ED1F4: - movs r0, 0x64 -_080ED1F6: - strb r0, [r6, 0x1A] - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - strb r0, [r6, 0x1B] - adds r0, r6, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r6, 0x1D] - cmp r0, 0x1 - beq _080ED21C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000beb - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ED21E -_080ED21C: - movs r0, 0x1 -_080ED21E: - strb r0, [r6, 0x1E] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED164 - - thumb_func_start SaveRecordedItemPurchasesForTVShow -@ void SaveRecordedItemPurchasesForTVShow() -SaveRecordedItemPurchasesForTVShow: @ 80ED238 - push {r4-r7,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldrh r1, [r0, 0x4] - ldr r0, =0x00003c1a - cmp r1, r0 - beq _080ED2F2 - ldr r0, =0x0000371a - cmp r1, r0 - beq _080ED2F2 - ldr r0, =0x00005555 - bl sub_80EFB38 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080ED2F2 - ldr r0, [r5] - ldr r7, =0x000027cc - adds r0, r7 - bl sub_80EFB08 - ldr r6, =gUnknown_030060BC - strb r0, [r6] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED2F2 - movs r0, 0x16 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080ED2F2 - bl sub_80EF500 - ldr r2, =gUnknown_02039F80 - ldrh r0, [r2, 0x2] - cmp r0, 0x13 - bls _080ED2F2 - movs r1, 0 - ldrsb r1, [r6, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - ldr r1, [r5] - adds r5, r1, r0 - movs r0, 0x16 - strb r0, [r5] - strb r4, [r5, 0x1] - ldr r0, =gMapHeader - ldrb r0, [r0, 0x14] - strb r0, [r5, 0x12] - movs r4, 0 - adds r7, r5, 0x6 - mov r12, r2 - adds r6, r5, 0 - adds r6, 0xC -_080ED2B6: - lsls r2, r4, 1 - adds r3, r7, r2 - lsls r1, r4, 2 - add r1, r12 - ldrh r0, [r1] - strh r0, [r3] - adds r2, r6, r2 - ldrh r0, [r1, 0x2] - strh r0, [r2] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080ED2B6 - movs r0, 0x1 - bl GetPriceReduction - strb r0, [r5, 0x2] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r5, 0x3] -_080ED2F2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end SaveRecordedItemPurchasesForTVShow - - thumb_func_start sub_80ED320 -sub_80ED320: @ 80ED320 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - bl sub_80EF7A8 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ED400 - ldr r0, =gSpecialVar_0x8004 - mov r8, r0 - ldrh r0, [r0] - movs r7, 0x64 - muls r0, r7 - ldr r6, =gPlayerParty - adds r0, r6 - ldr r4, =gStringVar1 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - ldr r1, =gSaveBlock2Ptr - mov r9, r1 - ldr r0, [r1] - bl StringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080ED400 - adds r0, r4, 0 - bl StringLength - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bls _080ED400 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r0, 0x5 - strb r0, [r4] - movs r5, 0x1 - strb r5, [r4, 0x1] - mov r2, r8 - ldrh r0, [r2] - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r4, 0x2] - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - strb r0, [r4, 0x1A] - bl Random - lsls r0, 16 - lsrs r0, 16 - ands r0, r5 - strb r0, [r4, 0x1B] - ldrh r0, [r4, 0x2] - bl sub_80EFA24 - strh r0, [r4, 0x1C] - adds r0, r4, 0 - adds r0, 0xF - mov r2, r9 - ldr r1, [r2] - bl StringCopy - mov r1, r8 - ldrh r0, [r1] - muls r0, r7 - adds r0, r6 - adds r5, r4, 0x4 - movs r1, 0x2 - adds r2, r5, 0 - bl GetMonData - adds r0, r5, 0 - bl StripExtCtrlCodes - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x1E] - mov r2, r8 - ldrh r0, [r2] - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl GetMonData - strb r0, [r4, 0x1F] -_080ED400: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED320 - - thumb_func_start StartMassOutbreak -StartMassOutbreak: @ 80ED430 - push {r4,r5,lr} - ldr r4, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =0x000027cc - adds r1, r0 - ldr r2, [r4] - adds r1, r2, r1 - ldrh r3, [r1, 0xC] - ldr r5, =0x00002b90 - adds r0, r2, r5 - strh r3, [r0] - ldrb r0, [r1, 0x10] - ldr r3, =0x00002b92 - adds r2, r3 - strb r0, [r2] - ldr r0, [r4] - ldrb r2, [r1, 0x11] - adds r5, 0x3 - adds r0, r5 - strb r2, [r0] - ldr r0, [r4] - ldrb r2, [r1, 0x14] - adds r3, 0x2 - adds r0, r3 - strb r2, [r0] - ldr r0, [r4] - ldrb r2, [r1, 0x2] - adds r5, 0x2 - adds r0, r5 - strb r2, [r0] - ldr r2, [r4] - ldrh r3, [r1, 0xE] - adds r5, 0x1 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x4] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x6] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0x8] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrh r3, [r1, 0xA] - adds r5, 0x2 - adds r0, r2, r5 - strh r3, [r0] - ldrb r0, [r1, 0x3] - ldr r3, =0x00002ba0 - adds r2, r3 - strb r0, [r2] - ldr r0, [r4] - ldrb r1, [r1, 0x13] - adds r5, 0x3 - adds r0, r5 - strb r1, [r0] - ldr r0, [r4] - ldr r1, =0x00002ba2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end StartMassOutbreak - - thumb_func_start sub_80ED4DC -sub_80ED4DC: @ 80ED4DC - push {r4,lr} - bl sub_80EFA88 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x1 - beq _080ED532 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - adds r0, r4, 0 - adds r0, 0x17 - bl sub_818E848 - movs r0, 0x2 - strb r0, [r4, 0x18] - movs r0, 0xC - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0x2 - bl sub_818E81C - adds r0, r4, 0 - adds r0, 0xA - adds r1, r4, 0 - adds r1, 0xB - bl sub_818E7E0 - bl sub_818E880 - strb r0, [r4, 0x16] - adds r0, r4, 0 - bl sub_80ECA10 -_080ED532: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED4DC - - thumb_func_start sub_80ED548 -sub_80ED548: @ 80ED548 - push {r4,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r0, 0x1 - strb r0, [r4] - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x18] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED548 - - thumb_func_start sub_80ED5B8 -sub_80ED5B8: @ 80ED5B8 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r5, 0 - movs r0, 0x2 - strb r0, [r4] - movs r0, 0x1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x10 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - strh r5, [r4, 0x2] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x18] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED5B8 - - thumb_func_start sub_80ED610 -sub_80ED610: @ 80ED610 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - movs r0, 0x3 - strb r0, [r5] - movs r0, 0x1 - mov r8, r0 - mov r1, r8 - strb r1, [r5, 0x1] - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r7, 0x64 - muls r0, r7 - ldr r6, =gPlayerParty - adds r0, r6 - movs r1, 0x20 - movs r2, 0 - bl GetMonData - lsrs r0, 4 - movs r1, 0xF - ands r0, r1 - ldrb r2, [r5, 0x4] - movs r1, 0x10 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x4] - ldr r0, =gSpecialVar_0x8007 - ldrb r0, [r0] - lsls r0, 4 - movs r2, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x4] - adds r0, r5, 0x5 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - adds r4, r5, 0 - adds r4, 0x10 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StripExtCtrlCodes - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r5, 0x2] - adds r0, r5, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r5, 0xD] - cmp r0, 0x1 - beq _080ED6D4 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl GetMonData - cmp r0, 0x1 - bne _080ED6F4 -_080ED6D4: - mov r0, r8 - b _080ED706 - .pool -_080ED6F4: - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r7 - adds r0, r6 - movs r1, 0x3 - bl GetMonData -_080ED706: - strb r0, [r5, 0xE] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80ED610 - - thumb_func_start TaskDummy5 -TaskDummy5: @ 80ED714 - bx lr - thumb_func_end TaskDummy5 - - thumb_func_start sub_80ED718 -sub_80ED718: @ 80ED718 - push {r4-r6,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080ED7E4 - movs r1, 0 - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r3, =0x000027cc -_080ED72E: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2, r0 - adds r0, r3 - ldrb r0, [r0] - cmp r0, 0x29 - beq _080ED7E4 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x17 - bls _080ED72E - ldr r0, =0x00000147 - bl sub_80EFB38 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _080ED7E4 - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080ED7E4 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x5 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r2, 0 - ldrsb r2, [r4, r2] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - ldr r2, =0x000027cc - adds r1, r2 - ldr r4, [r6] - adds r4, r1 - movs r1, 0x29 - strb r1, [r4] - movs r3, 0x1 - strb r3, [r4, 0x1] - ldr r2, =gUnknown_0858D094 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0xA] - strb r0, [r4, 0x14] - strb r5, [r4, 0x2] - strb r5, [r4, 0x3] - ldrh r0, [r1] - movs r2, 0 - strh r0, [r4, 0xC] - strh r5, [r4, 0xE] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x4] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x6] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x8] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0xA] - ldrb r0, [r1, 0xB] - strb r0, [r4, 0x10] - strb r2, [r4, 0x11] - strb r2, [r4, 0x12] - movs r0, 0x32 - strb r0, [r4, 0x13] - strb r2, [r4, 0x15] - strh r3, [r4, 0x16] - adds r0, r4, 0 - bl sub_80ECA10 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x18] -_080ED7E4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED718 - - thumb_func_start EndMassOutbreak -EndMassOutbreak: @ 80ED808 - push {r4,r5,lr} - ldr r3, =gSaveBlock1Ptr - ldr r0, [r3] - ldr r2, =0x00002b90 - adds r1, r0, r2 - movs r4, 0 - movs r2, 0 - strh r2, [r1] - ldr r5, =0x00002b92 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - ldr r1, =0x00002b93 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x2 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x2 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - adds r5, 0x2 - adds r1, r0, r5 - strh r2, [r1] - ldr r1, =0x00002ba0 - adds r0, r1 - strb r4, [r0] - ldr r0, [r3] - adds r5, 0x3 - adds r0, r5 - strb r4, [r0] - ldr r0, [r3] - adds r1, 0x2 - adds r0, r1 - strh r2, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end EndMassOutbreak - - thumb_func_start sub_80ED888 -sub_80ED888: @ 80ED888 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80ED8B4 - adds r0, r4, 0 - bl UpdateMassOutbreakTimeLeft - adds r0, r4, 0 - bl sub_80EF120 - adds r0, r4, 0 - bl sub_80EDA48 - adds r0, r4, 0 - bl sub_80EEB98 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80ED888 - - thumb_func_start sub_80ED8B4 -sub_80ED8B4: @ 80ED8B4 - push {r4-r7,lr} - lsls r0, 16 - lsrs r5, r0, 16 - ldr r1, =gSaveBlock1Ptr - ldr r0, [r1] - ldr r2, =0x00002b90 - adds r0, r2 - ldrh r0, [r0] - mov r12, r1 - cmp r0, 0 - bne _080ED91C - movs r1, 0 - ldr r6, =0x000027cc -_080ED8CE: - mov r7, r12 - ldr r4, [r7] - lsls r0, r1, 3 - adds r0, r1 - lsls r3, r0, 2 - adds r2, r4, r3 - adds r0, r2, r6 - ldrb r0, [r0] - cmp r0, 0x29 - bne _080ED912 - ldr r7, =0x000027cd - adds r0, r2, r7 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080ED912 - adds r0, r3, r6 - adds r1, r4, r0 - ldrh r0, [r1, 0x16] - cmp r0, r5 - bcs _080ED90C - movs r0, 0 - strh r0, [r1, 0x16] - b _080ED91C - .pool -_080ED90C: - subs r0, r5 - strh r0, [r1, 0x16] - b _080ED91C -_080ED912: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x17 - bls _080ED8CE -_080ED91C: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80ED8B4 - - thumb_func_start UpdateMassOutbreakTimeLeft -UpdateMassOutbreakTimeLeft: @ 80ED924 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r3, =0x00002ba2 - adds r1, r0, r3 - ldrh r0, [r1] - cmp r0, r2 - bhi _080ED948 - bl EndMassOutbreak - b _080ED94C - .pool -_080ED948: - subs r0, r2 - strh r0, [r1] -_080ED94C: - pop {r0} - bx r0 - thumb_func_end UpdateMassOutbreakTimeLeft - - thumb_func_start sub_80ED950 -sub_80ED950: @ 80ED950 - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - beq _080ED978 - ldr r4, =gUnknown_0203A026 - ldrh r0, [r4] - lsrs r0, 8 - cmp r0, 0x4 - bls _080ED966 - bl sub_80ED9A8 -_080ED966: - ldrb r0, [r4] - strh r0, [r4] - cmp r0, 0xFF - beq _080ED99C - adds r0, 0x1 - b _080ED99A - .pool -_080ED978: - ldr r4, =gUnknown_0203A026 - ldrb r0, [r4] - cmp r0, 0x4 - bls _080ED984 - bl sub_80ED9A8 -_080ED984: - ldrh r0, [r4] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - strh r1, [r4] - lsrs r0, r1, 8 - cmp r0, 0xFF - beq _080ED99C - movs r2, 0x80 - lsls r2, 1 - adds r0, r1, r2 -_080ED99A: - strh r0, [r4] -_080ED99C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED950 - - thumb_func_start sub_80ED9A8 -sub_80ED9A8: @ 80ED9A8 - push {r4-r6,lr} - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDA18 - movs r0, 0x18 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDA18 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x18 - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =gUnknown_0203A026 - ldrh r0, [r1] - strb r0, [r4, 0x2] - ldrh r0, [r1] - lsrs r0, 8 - strb r0, [r4, 0x3] - ldr r0, =gUnknown_0203A024 - ldrh r0, [r0] - strh r0, [r4, 0x4] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x6] -_080EDA18: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80ED9A8 - - thumb_func_start sub_80EDA3C -sub_80EDA3C: @ 80EDA3C - ldr r1, =gUnknown_0203A024 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDA3C - - thumb_func_start sub_80EDA48 -sub_80EDA48: @ 80EDA48 - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r2, =0x00002b2c - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x19 - bne _080EDA6E - ldrh r0, [r1, 0x2] - cmp r0, 0x13 - bls _080EDA62 - bl sub_80EDA80 -_080EDA62: - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - movs r1, 0x18 - bl sub_80EF910 -_080EDA6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDA48 - - thumb_func_start sub_80EDA80 -sub_80EDA80: @ 80EDA80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r7, =gSaveBlock1Ptr - ldr r0, [r7] - ldr r1, =0x00002b2c - adds r5, r0, r1 - ldr r0, =0x0000ffff - bl sub_80EFB38 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080EDB1C - ldr r0, [r7] - ldr r1, =0x000027cc - mov r8, r1 - add r0, r8 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDB1C - movs r0, 0x19 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDB1C - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldr r4, [r7] - adds r4, r0 - movs r0, 0x19 - strb r0, [r4] - strb r6, [r4, 0x1] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x2] - movs r0, 0x5 - bl GetGameStat - ldrh r1, [r5, 0x6] - subs r0, r1 - strh r0, [r4, 0x6] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x8] - ldrb r0, [r5, 0xA] - strb r0, [r4, 0xA] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0xB] - ldr r0, [r7] - add r0, r8 - movs r1, 0x18 - bl sub_80EF910 -_080EDB1C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDA80 - - thumb_func_start sub_80EDB44 -sub_80EDB44: @ 80EDB44 - push {r4-r7,lr} - movs r0, 0x1A - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =gUnknown_030060BC - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDC40 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x000027cc - adds r0, r2 - ldr r1, [r4] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x1A - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r6, =0x00000867 - movs r5, 0 -_080EDB88: - lsls r0, r6, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EDB9C - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EDB9C: - adds r6, 0x1 - ldr r0, =0x0000086e - cmp r6, r0 - bls _080EDB88 - strb r5, [r4, 0x4] - bl IsNationalPokedexEnabled - cmp r0, 0 - beq _080EDBCC - movs r0, 0x1 - bl pokedex_count - b _080EDBD2 - .pool -_080EDBCC: - movs r0, 0x1 - bl sub_80C0844 -_080EDBD2: - strh r0, [r4, 0x2] - ldr r1, =gMapHeader - ldrb r0, [r1, 0x14] - strb r0, [r4, 0x7] - ldrh r0, [r1, 0x12] - movs r1, 0 - strh r0, [r4, 0xA] - strb r1, [r4, 0x5] - strb r1, [r4, 0x6] - movs r6, 0 - adds r7, r4, 0 - adds r7, 0x13 -_080EDBEA: - ldr r0, =gUnknown_0858D0DE - lsls r5, r6, 1 - adds r0, r5, r0 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EDC04 - ldrb r0, [r4, 0x5] - adds r0, 0x1 - strb r0, [r4, 0x5] -_080EDC04: - ldr r0, =gUnknown_0858D0D0 - adds r0, r5, r0 - ldrh r0, [r0] - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EDC1C - ldrb r0, [r4, 0x6] - adds r0, 0x1 - strb r0, [r4, 0x6] -_080EDC1C: - adds r6, 0x1 - cmp r6, 0x6 - bls _080EDBEA - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldr r2, =0x00000eb8 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x8] - adds r0, r7, 0 - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0xC] -_080EDC40: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDB44 - - thumb_func_start sub_80EDC60 -sub_80EDC60: @ 80EDC60 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r7, =gSaveBlock1Ptr - ldr r0, [r7] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDCCE - movs r0, 0x1B - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDCCE - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r7] - adds r4, r0 - movs r1, 0 - movs r0, 0x1B - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - ldrb r0, [r0, 0x8] - strb r0, [r4, 0x8] - ldrh r0, [r5] - strh r0, [r4, 0x4] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x6] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x9] -_080EDCCE: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDC60 - - thumb_func_start sub_80EDCE8 -sub_80EDCE8: @ 80EDCE8 - push {r4-r6,lr} - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDD56 - movs r0, 0x1C - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDD56 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x1C - strb r0, [r4] - strb r1, [r4, 0x1] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - strh r0, [r4, 0x2] - ldr r1, =gMapHeader - ldrb r0, [r1, 0x14] - strb r0, [r4, 0x4] - ldrh r0, [r1, 0x12] - strh r0, [r4, 0x6] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EDD56: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDCE8 - - thumb_func_start sub_80EDD78 -sub_80EDD78: @ 80EDD78 - push {r4-r6,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EDE54 - movs r0, 0x1D - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EDE54 - movs r5, 0 - ldr r0, =gUnknown_0203A02A - ldrb r1, [r0] - adds r6, r0, 0 - cmp r1, 0 - beq _080EDDCC - cmp r1, 0x1 - beq _080EDDEE - b _080EDE54 - .pool -_080EDDCC: - ldr r0, =gUnknown_0203A028 - ldrh r1, [r0] - adds r0, r1, 0 - adds r0, 0xC8 - cmp r4, r0 - blt _080EDDE4 - movs r5, 0x1 - subs r0, r4, r1 - b _080EDE12 - .pool -_080EDDE4: - cmp r1, 0x63 - bls _080EDE54 - adds r0, r1, 0 - subs r0, 0x64 - b _080EDE0C -_080EDDEE: - ldr r0, =gUnknown_0203A028 - ldrh r1, [r0] - adds r0, r1, 0 - adds r0, 0x32 - cmp r4, r0 - blt _080EDE04 - movs r5, 0x1 - subs r0, r4, r1 - b _080EDE12 - .pool -_080EDE04: - cmp r1, 0x31 - bls _080EDE54 - adds r0, r1, 0 - subs r0, 0x32 -_080EDE0C: - cmp r4, r0 - bgt _080EDE54 - subs r0, r1, r4 -_080EDE12: - lsls r0, 16 - lsrs r3, r0, 16 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - movs r1, 0 - movs r0, 0x1D - strb r0, [r4] - strb r1, [r4, 0x1] - strh r3, [r4, 0x4] - ldrb r0, [r6] - strb r0, [r4, 0x3] - strb r5, [r4, 0x2] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x8] -_080EDE54: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDD78 - - thumb_func_start sub_80EDE70 -sub_80EDE70: @ 80EDE70 - ldr r2, =gUnknown_0203A02A - movs r1, 0 - strb r1, [r2] - ldr r1, =gUnknown_0203A028 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDE70 - - thumb_func_start sub_80EDE84 -sub_80EDE84: @ 80EDE84 - ldr r2, =gUnknown_0203A02A - movs r1, 0x1 - strb r1, [r2] - ldr r1, =gUnknown_0203A028 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EDE84 - - thumb_func_start sub_80EDE98 -sub_80EDE98: @ 80EDE98 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - mov r8, r0 - movs r3, 0 - ldr r6, =gUnknown_030060D0 - ldr r7, =gSaveBlock1Ptr - adds r2, r6, 0 - movs r1, 0 -_080EDEAC: - adds r0, r3, r2 - strb r1, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _080EDEAC - movs r3, 0 - movs r5, 0 -_080EDEBE: - ldr r0, [r7] - ldr r1, =0x00001aae - adds r0, r1 - adds r0, r3 - ldrb r4, [r0] - adds r3, 0x1 - cmp r4, 0 - beq _080EDF0A - movs r1, 0 - ldrb r0, [r6] - cmp r0, 0 - bne _080EDEE8 - strb r4, [r6] - b _080EDF04 - .pool -_080EDEE8: - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, r4 - beq _080EDF0A - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bhi _080EDF0A - adds r2, r1, r6 - ldrb r0, [r2] - cmp r0, 0 - bne _080EDEE8 - strb r4, [r2] -_080EDF04: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EDF0A: - lsls r0, r3, 24 - lsrs r3, r0, 24 - cmp r3, 0xF - bls _080EDEBE - cmp r5, 0x4 - bls _080EDF1E - movs r0, 0x4 - mov r1, r8 - strb r0, [r1, 0x3] - b _080EDF22 -_080EDF1E: - mov r0, r8 - strb r5, [r0, 0x3] -_080EDF22: - mov r1, r8 - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080EDFA4 - cmp r0, 0x1 - bne _080EDF34 - ldrb r0, [r6] - strb r0, [r1, 0x4] - b _080EDFA4 -_080EDF34: - movs r6, 0 - adds r7, r5, 0 - muls r7, r5 - cmp r6, r7 - bge _080EDF7E - ldr r0, =gUnknown_030060D0 - mov r9, r0 -_080EDF42: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 24 - lsrs r4, r0, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 24 - lsrs r1, r0, 24 - mov r0, r9 - adds r2, r4, r0 - ldrb r3, [r2] - add r1, r9 - ldrb r0, [r1] - strb r0, [r2] - strb r3, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, r7 - blt _080EDF42 -_080EDF7E: - movs r3, 0 - mov r1, r8 - ldrb r1, [r1, 0x3] - cmp r3, r1 - bcs _080EDFA4 - mov r2, r8 - adds r2, 0x4 - ldr r4, =gUnknown_030060D0 -_080EDF8E: - adds r1, r2, r3 - adds r0, r3, r4 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - mov r0, r8 - ldrb r0, [r0, 0x3] - cmp r3, r0 - bcc _080EDF8E -_080EDFA4: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDE98 - - thumb_func_start sub_80EDFB4 -sub_80EDFB4: @ 80EDFB4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r10, r0 - movs r7, 0 - movs r0, 0 - mov r9, r0 - ldr r1, =gUnknown_030060C0 - mov r8, r1 -_080EDFCA: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - cmp r0, 0 - beq _080EE094 - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - bne _080EE094 - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - ldr r2, =gUnknown_030060E0 - mov r3, r9 - lsls r1, r3, 3 - adds r6, r1, r2 - strb r0, [r6] - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - strh r0, [r6, 0x2] - movs r5, 0 - adds r0, r4, 0 - movs r1, 0xD - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE020 - mov r0, r8 - strh r1, [r0] - movs r5, 0x1 -_080EE020: - adds r0, r4, 0 - movs r1, 0xE - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE03C - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE03C: - adds r0, r4, 0 - movs r1, 0xF - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE058 - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE058: - adds r0, r4, 0 - movs r1, 0x10 - bl GetMonData - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0 - beq _080EE074 - lsls r0, r5, 1 - add r0, r8 - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EE074: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl __modsi3 - lsls r0, 1 - add r0, r8 - ldrh r0, [r0] - strh r0, [r6, 0x4] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080EE094: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x5 - bls _080EDFCA - movs r7, 0 - movs r1, 0 - cmp r1, r9 - bcs _080EE0BE - ldr r2, =gUnknown_030060E0 -_080EE0A8: - lsls r0, r7, 3 - adds r0, r2 - ldrb r0, [r0] - adds r0, r1, r0 - lsls r0, 16 - lsrs r1, r0, 16 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, r9 - bcc _080EE0A8 -_080EE0BE: - adds r0, r1, 0 - mov r1, r9 - bl __divsi3 - mov r1, r10 - strb r0, [r1, 0x2] - bl Random - lsls r0, 16 - lsrs r0, 16 - mov r1, r9 - bl __modsi3 - lsls r0, 16 - ldr r1, =gUnknown_030060E0 - lsrs r0, 13 - adds r0, r1 - ldrh r1, [r0, 0x2] - mov r2, r10 - strh r1, [r2, 0x8] - ldrh r0, [r0, 0x4] - strh r0, [r2, 0xA] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EDFB4 - - thumb_func_start sub_80EE104 -sub_80EE104: @ 80EE104 - push {r4,lr} - movs r0, 0x1F - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =gUnknown_030060BC - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE168 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r4] - adds r4, r0 - movs r1, 0 - movs r0, 0x1F - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0 - bl sub_80EDE98 - adds r0, r4, 0 - bl sub_80EDFB4 - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0xC] -_080EE168: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE104 - - thumb_func_start sub_80EE184 -sub_80EE184: @ 80EE184 - push {r4-r7,lr} - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EE1A4 - b _080EE2C2 -_080EE1A4: - movs r0, 0x1E - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EE1B6 - b _080EE2C2 -_080EE1B6: - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r6] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x1E - strb r0, [r4] - strb r1, [r4, 0x1] - movs r5, 0 - ldr r6, =gBattleResults - ldr r3, =gMapHeader - ldr r7, =gSaveBlock2Ptr - adds r2, r6, 0 - adds r2, 0x36 -_080EE1DA: - adds r0, r1, r2 - ldrb r0, [r0] - adds r0, r5, r0 - lsls r0, 16 - lsrs r5, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bls _080EE1DA - ldrb r1, [r6, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EE1FE - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_080EE1FE: - ldrb r0, [r3, 0x14] - strb r0, [r4, 0x4] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, [r7] - bl StringCopy - ldrh r0, [r6, 0x6] - strh r0, [r4, 0xA] - ldr r0, =gBattleOutcome - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x9 - bhi _080EE282 - lsls r0, 2 - ldr r1, =_080EE244 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EE244: - .4byte _080EE276 - .4byte _080EE26C - .4byte _080EE26C - .4byte _080EE27A - .4byte _080EE27A - .4byte _080EE27E - .4byte _080EE272 - .4byte _080EE27A - .4byte _080EE282 - .4byte _080EE27E -_080EE26C: - movs r0, 0 - strb r0, [r4] - b _080EE2C2 -_080EE272: - movs r0, 0 - b _080EE280 -_080EE276: - movs r0, 0x1 - b _080EE280 -_080EE27A: - movs r0, 0x2 - b _080EE280 -_080EE27E: - movs r0, 0x3 -_080EE280: - strb r0, [r4, 0x5] -_080EE282: - ldr r1, =gBattleResults - ldrh r0, [r1, 0x20] - strh r0, [r4, 0x2] - ldrb r0, [r4, 0x5] - cmp r0, 0x1 - beq _080EE2B2 - cmp r0, 0x1 - bgt _080EE2B6 - cmp r0, 0 - bne _080EE2B6 - ldrb r1, [r1, 0x5] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080EE2A8 - movs r0, 0x1 - b _080EE2AC - .pool -_080EE2A8: - lsls r0, r1, 26 - lsrs r0, 28 -_080EE2AC: - strh r0, [r4, 0x6] - strh r5, [r4, 0x8] - b _080EE2B6 -_080EE2B2: - ldrh r0, [r1, 0x22] - strh r0, [r4, 0xC] -_080EE2B6: - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0xE] -_080EE2C2: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE184 - - thumb_func_start sub_80EE2CC -sub_80EE2CC: @ 80EE2CC - push {r4-r6,lr} - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE33A - movs r0, 0x20 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE33A - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x20 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - ldr r0, =gSpecialVar_0x8004 - ldrb r1, [r0] - movs r0, 0x4 - subs r0, r1 - strb r0, [r4, 0x4] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EE33A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE2CC - - thumb_func_start sub_80EE35C -sub_80EE35C: @ 80EE35C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r3, 0 - ldr r3, [sp, 0x24] - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r1, 16 - lsrs r1, 16 - mov r9, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp] - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - ldr r0, [r0] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE426 - movs r0, 0x21 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE426 - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - mov r2, r8 - ldr r1, [r2] - adds r4, r1, r0 - movs r1, 0 - movs r0, 0x21 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - mov r0, r10 - strh r0, [r4, 0x4] - mov r1, r9 - strh r1, [r4, 0x6] - lsls r0, r6, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r4, 0x2] - movs r2, 0 - movs r3, 0 - adds r5, r4, 0 - adds r5, 0x8 -_080EE3EE: - cmp r2, r6 - beq _080EE408 - lsls r0, r2, 1 - adds r0, r7 - ldrh r1, [r0] - cmp r1, 0 - beq _080EE408 - lsls r0, r3, 1 - adds r0, r5, r0 - strh r1, [r0] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080EE408: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080EE3EE - strb r3, [r4, 0x10] - mov r2, sp - ldrh r2, [r2] - strh r2, [r4, 0xE] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x11] -_080EE426: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE35C - - thumb_func_start sub_80EE44C -sub_80EE44C: @ 80EE44C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE4BE - movs r0, 0x27 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE4BE - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r4, [r6] - adds r4, r0 - movs r1, 0 - movs r0, 0x27 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - mov r0, r8 - strb r0, [r4, 0x2] - strb r7, [r4, 0x3] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x4] -_080EE4BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE44C - - thumb_func_start sub_80EE4DC -sub_80EE4DC: @ 80EE4DC - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r7, =gSaveBlock1Ptr - ldr r0, [r7] - ldr r5, =0x000027cc - adds r0, r5 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE59A - movs r0, 0x23 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE59A - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, [r7] - adds r5, r1, r0 - movs r1, 0 - movs r0, 0x23 - strb r0, [r5] - strb r1, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r4, r5, 0x4 - adds r0, r6, 0 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StripExtCtrlCodes - adds r0, r6, 0 - bl sub_80EE5A4 - strb r0, [r5, 0x2] - mov r0, r8 - bl sub_80EE69C - strb r0, [r5, 0x3] - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r5, 0xF] - cmp r0, 0x1 - beq _080EE578 - adds r0, r6, 0 - movs r1, 0x3 - bl GetMonData - cmp r0, 0x1 - bne _080EE590 -_080EE578: - movs r0, 0x1 - b _080EE598 - .pool -_080EE590: - adds r0, r6, 0 - movs r1, 0x3 - bl GetMonData -_080EE598: - strb r0, [r5, 0x10] -_080EE59A: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EE4DC - - thumb_func_start sub_80EE5A4 -sub_80EE5A4: @ 80EE5A4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x32 - bl GetMonData - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x33 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x34 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x35 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x36 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x43 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x44 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x45 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x46 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x47 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x48 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x49 - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4A - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4B - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4C - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4D - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x4E - bl GetMonData - adds r4, r0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80EE5A4 - - thumb_func_start sub_80EE69C -sub_80EE69C: @ 80EE69C - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x43 - beq _080EE722 - cmp r0, 0x32 - bne _080EE6AE - movs r0, 0x1 - b _080EE728 -_080EE6AE: - cmp r0, 0x33 - bne _080EE6B6 - movs r0, 0x5 - b _080EE728 -_080EE6B6: - cmp r0, 0x34 - bne _080EE6BE - movs r0, 0x9 - b _080EE728 -_080EE6BE: - cmp r0, 0x35 - bne _080EE6C6 - movs r0, 0xD - b _080EE728 -_080EE6C6: - cmp r0, 0x36 - bne _080EE6CE - movs r0, 0x11 - b _080EE728 -_080EE6CE: - cmp r0, 0x44 - bne _080EE6D6 - movs r0, 0x15 - b _080EE728 -_080EE6D6: - cmp r0, 0x45 - bne _080EE6DE - movs r0, 0x16 - b _080EE728 -_080EE6DE: - cmp r0, 0x46 - bne _080EE6E6 - movs r0, 0x17 - b _080EE728 -_080EE6E6: - cmp r0, 0x47 - bne _080EE6EE - movs r0, 0x18 - b _080EE728 -_080EE6EE: - cmp r0, 0x48 - bne _080EE6F6 - movs r0, 0x19 - b _080EE728 -_080EE6F6: - cmp r0, 0x49 - bne _080EE6FE - movs r0, 0x1A - b _080EE728 -_080EE6FE: - cmp r0, 0x4A - bne _080EE706 - movs r0, 0x1B - b _080EE728 -_080EE706: - cmp r0, 0x4B - bne _080EE70E - movs r0, 0x1C - b _080EE728 -_080EE70E: - cmp r0, 0x4C - bne _080EE716 - movs r0, 0x1D - b _080EE728 -_080EE716: - cmp r0, 0x4D - bne _080EE71E - movs r0, 0x1E - b _080EE728 -_080EE71E: - cmp r0, 0x4E - beq _080EE726 -_080EE722: - movs r0, 0 - b _080EE728 -_080EE726: - movs r0, 0x1F -_080EE728: - pop {r1} - bx r1 - thumb_func_end sub_80EE69C - - thumb_func_start sub_80EE72C -sub_80EE72C: @ 80EE72C - push {r4-r6,lr} - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r6, =0x000027cc - adds r0, r6 - bl sub_80EFB08 - ldr r4, =gUnknown_030060BC - strb r0, [r4] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE79C - movs r0, 0x22 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EE79C - movs r1, 0 - ldrsb r1, [r4, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldr r4, [r5] - adds r4, r0 - movs r1, 0 - movs r0, 0x22 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - ldr r0, [r5] - ldr r2, =0x00002bb0 - adds r1, r0, r2 - ldrh r1, [r1] - strh r1, [r4, 0x4] - ldr r1, =0x00002bb2 - adds r0, r1 - ldrh r0, [r0] - strh r0, [r4, 0x6] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x8] -_080EE79C: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE72C - - thumb_func_start sub_80EE7C0 -sub_80EE7C0: @ 80EE7C0 - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE810 - movs r0, 0xB - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0x1 - beq _080EE810 - ldr r0, [r4] - ldr r1, =0x00003150 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - beq _080EE810 - movs r0, 0 - b _080EE812 - .pool -_080EE810: - movs r0, 0x1 -_080EE812: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EE7C0 - - thumb_func_start sub_80EE818 -sub_80EE818: @ 80EE818 - push {r4-r7,lr} - movs r0, 0x24 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EE870 - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r7, r0, r1 - bl sub_80F0020 - adds r4, r0, 0 - movs r6, 0x5 - lsrs r5, r4, 8 -_080EE83C: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - adds r1, r0, r7 - ldrb r0, [r1] - cmp r0, 0x24 - bne _080EE866 - movs r3, 0xFF - adds r0, r4, 0 - ands r0, r3 - adds r2, r1, 0 - adds r2, 0x22 - ldrb r2, [r2] - cmp r0, r2 - bne _080EE866 - adds r0, r5, 0 - ands r0, r3 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - beq _080EE89C -_080EE866: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x17 - bls _080EE83C -_080EE870: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EE8C0 - movs r0, 0x1 - b _080EE8C2 - .pool -_080EE89C: - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - adds r1, r6, 0 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - movs r0, 0x1 - b _080EE8C2 - .pool -_080EE8C0: - movs r0, 0 -_080EE8C2: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EE818 - - thumb_func_start sub_80EE8C8 -sub_80EE8C8: @ 80EE8C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =gUnknown_030060BC - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EE8F4 - b _080EEA52 -_080EE8F4: - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r2, =0x000027cc - adds r0, r2 - ldr r1, [r5] - adds r7, r1, r0 - movs r1, 0 - movs r0, 0x24 - strb r0, [r7] - strb r1, [r7, 0x1] - adds r0, r7, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - strh r6, [r7, 0x2] - strb r4, [r7, 0xD] - subs r0, r4, 0x1 - cmp r0, 0xC - bls _080EE926 - b _080EEA46 -_080EE926: - lsls r0, 2 - ldr r1, =_080EE944 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EE944: - .4byte _080EE978 - .4byte _080EE9A8 - .4byte _080EE9E8 - .4byte _080EEA00 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 - .4byte _080EE978 -_080EE978: - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x4] - adds r0, r4, 0 - adds r0, 0x64 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x6] - adds r4, 0xC8 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x8] - b _080EEA46 - .pool -_080EE9A8: - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x4] - adds r0, r4, 0 - adds r0, 0x64 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x6] - adds r0, r4, 0 - adds r0, 0xC8 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x8] - movs r1, 0x96 - lsls r1, 1 - adds r0, r4, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0xA] - b _080EEA46 - .pool -_080EE9E8: - ldr r4, =gPlayerParty - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x4] - adds r4, 0x64 - adds r0, r4, 0 - b _080EEA3C - .pool -_080EEA00: - ldr r2, =gSaveBlock1Ptr - mov r8, r2 - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldr r1, =0x00000caa - adds r0, r1 - ldrh r0, [r0] - movs r5, 0x64 - adds r1, r0, 0 - muls r1, r5 - movs r4, 0xEA - lsls r4, 1 - adds r1, r4 - ldr r0, [r2] - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x4] - ldr r0, [r6] - ldr r2, =0x00000cac - adds r0, r2 - ldrh r0, [r0] - adds r1, r0, 0 - muls r1, r5 - adds r1, r4 - mov r2, r8 - ldr r0, [r2] - adds r0, r1 -_080EEA3C: - movs r1, 0xB - movs r2, 0 - bl GetMonData - strh r0, [r7, 0x6] -_080EEA46: - adds r0, r7, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r7, 0xC] -_080EEA52: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EE8C8 - - thumb_func_start sub_80EEA70 -sub_80EEA70: @ 80EEA70 - push {r4-r7,lr} - sub sp, 0x20 - movs r0, 0x26 - movs r1, 0 - bl sub_80EF46C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080EEA86 - b _080EEB8C -_080EEA86: - ldr r7, =gSaveBlock1Ptr - ldr r0, [r7] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =gUnknown_030060BC - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEB8C - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r7] - adds r5, r1, r0 - movs r1, 0 - movs r0, 0x26 - strb r0, [r5] - strb r1, [r5, 0x1] - adds r0, r5, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - ldr r0, =0x000040ec - bl VarGet - strh r0, [r5, 0x2] - bl sub_80E980C - ldr r1, =gStringVar1 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - adds r0, r5, 0x4 - mov r1, sp - bl StringCopy - ldr r0, =0x000040ed - bl VarGet - strh r0, [r5, 0x10] - ldr r0, =0x000040ee - bl VarGet - adds r4, r0, 0 - ldr r0, =0x000040ef - bl VarGet - lsls r4, 16 - lsrs r4, 16 - lsls r0, 16 - adds r4, r0 - str r4, [r5, 0xC] - adds r0, r5, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r5, 0x1B] - cmp r0, 0x1 - beq _080EEB3A - ldr r4, [r7] - ldr r6, =0x00004054 - adds r0, r6, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r4, r1 - ldr r0, =0x00001aa9 - adds r4, r0 - ldrb r0, [r4] - cmp r0, 0x1 - bne _080EEB70 -_080EEB3A: - movs r0, 0x1 - b _080EEB8A - .pool -_080EEB70: - adds r0, r6, 0 - bl VarGet - ldr r2, [r7] - lsls r0, 16 - lsrs r0, 16 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 5 - adds r2, r1 - ldr r1, =0x00001aa9 - adds r2, r1 - ldrb r0, [r2] -_080EEB8A: - strb r0, [r5, 0x1C] -_080EEB8C: - add sp, 0x20 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEA70 - - thumb_func_start sub_80EEB98 -sub_80EEB98: @ 80EEB98 - push {r4-r7,lr} - movs r5, 0 - ldr r6, =gUnknown_0858D0EC - adds r7, r6, 0x2 - b _080EEBAE - .pool -_080EEBA8: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_080EEBAE: - cmp r5, 0x6 - bhi _080EEBCE - lsls r4, r5, 2 - adds r0, r4, r6 - ldrh r0, [r0] - bl VarGet - adds r4, r7 - lsls r0, 16 - lsrs r0, 16 - ldrh r4, [r4] - cmp r0, r4 - bcc _080EEBA8 - adds r0, r5, 0 - bl sub_80EEBF4 -_080EEBCE: - movs r5, 0 - ldr r4, =gUnknown_0858D0EC -_080EEBD2: - lsls r0, r5, 2 - adds r0, r4 - ldrh r0, [r0] - movs r1, 0 - bl VarSet - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080EEBD2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEB98 - - thumb_func_start sub_80EEBF4 -sub_80EEBF4: @ 80EEBF4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x25 - movs r1, 0x1 - bl sub_80EF46C - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFB08 - ldr r2, =gUnknown_030060BC - strb r0, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEC60 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r4] - adds r4, r0 - movs r1, 0 - movs r0, 0x25 - strb r0, [r4] - strb r1, [r4, 0x1] - adds r0, r4, 0 - adds r0, 0x13 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - strb r5, [r4, 0x4] - ldr r1, =gUnknown_0858D0EC - lsls r0, r5, 2 - adds r0, r1 - ldrh r0, [r0] - bl VarGet - strh r0, [r4, 0x2] - adds r0, r4, 0 - bl sub_80EC9E8 - ldr r0, =gGameLanguage - ldrb r0, [r0] - strb r0, [r4, 0x5] -_080EEC60: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEBF4 - - thumb_func_start sub_80EEC80 -sub_80EEC80: @ 80EEC80 - push {r4,lr} - ldr r4, =0x000040e6 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEC80 - - thumb_func_start sub_80EECA4 -sub_80EECA4: @ 80EECA4 - push {r4,lr} - ldr r4, =0x000040eb - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECA4 - - thumb_func_start sub_80EECC8 -sub_80EECC8: @ 80EECC8 - push {r4,lr} - ldr r4, =0x000040e7 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECC8 - - thumb_func_start sub_80EECEC -sub_80EECEC: @ 80EECEC - push {r4,lr} - ldr r4, =0x000040e8 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EECEC - - thumb_func_start sub_80EED10 -sub_80EED10: @ 80EED10 - push {r4,lr} - ldr r4, =0x000040e9 - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED10 - - thumb_func_start sub_80EED34 -sub_80EED34: @ 80EED34 - push {r4,lr} - ldr r4, =0x000040ea - adds r0, r4, 0 - bl VarGet - adds r1, r0, 0 - ldr r0, =gSpecialVar_0x8006 - ldrh r0, [r0] - adds r1, r0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r4, 0 - bl VarSet - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED34 - - thumb_func_start sub_80EED60 -sub_80EED60: @ 80EED60 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - ldr r5, =0x000040f1 - adds r0, r5, 0 - bl VarGet - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r4, 0 - bl VarSet - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED60 - - thumb_func_start sub_80EED88 -sub_80EED88: @ 80EED88 - push {r4-r7,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080EEE0C - ldr r6, =gSaveBlock1Ptr - ldr r0, [r6] - ldr r7, =0x00002b50 - adds r0, r7 - bl sub_80EEE30 - ldr r5, =gUnknown_030060BC - strb r0, [r5] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080EEE0C - ldr r0, =0x0000028f - bl sub_80EFB38 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EEE0C - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r4, r0, 0x1 - adds r0, r4, 0 - bl sub_80EF0E4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EEE0C - ldr r1, [r6] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r1, r0 - adds r1, r7 - strb r4, [r1] - ldr r2, [r6] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r0, r2, r0 - ldr r1, =0x00002b52 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0] - movs r0, 0 - ldrsb r0, [r5, r0] - lsls r0, 2 - adds r2, r0 - ldr r0, =0x00002b51 - adds r2, r0 - movs r0, 0x1 - strb r0, [r2] -_080EEE0C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EED88 - - thumb_func_start sub_80EEE30 -sub_80EEE30: @ 80EEE30 - push {lr} - adds r2, r0, 0 - movs r1, 0 -_080EEE36: - lsls r0, r1, 24 - asrs r1, r0, 24 - lsls r0, r1, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EEE48 - adds r0, r1, 0 - b _080EEE58 -_080EEE48: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0xF - ble _080EEE36 - movs r0, 0x1 - negs r0, r0 -_080EEE58: - pop {r1} - bx r1 - thumb_func_end sub_80EEE30 - - thumb_func_start sub_80EEE5C -sub_80EEE5C: @ 80EEE5C - push {r4,lr} - movs r4, 0 -_080EEE60: - adds r0, r4, 0 - bl sub_80EEE78 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080EEE60 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80EEE5C - - thumb_func_start sub_80EEE78 -sub_80EEE78: @ 80EEE78 - push {r4,lr} - lsls r0, 24 - ldr r3, =gSaveBlock1Ptr - ldr r1, [r3] - lsrs r0, 22 - adds r1, r0 - ldr r2, =0x00002b50 - adds r1, r2 - movs r2, 0 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r4, =0x00002b51 - adds r1, r4 - strb r2, [r1] - ldr r1, [r3] - adds r1, r0 - ldr r0, =0x00002b52 - adds r1, r0 - strh r2, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEE78 - - thumb_func_start sub_80EEEB8 -sub_80EEEB8: @ 80EEEB8 - push {r4-r7,lr} - movs r2, 0 - ldr r6, =gSaveBlock1Ptr -_080EEEBE: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - lsls r1, r2, 2 - adds r0, r1 - ldr r3, =0x00002b50 - adds r0, r3 - ldrb r0, [r0] - adds r5, r2, 0x1 - cmp r0, 0 - bne _080EEF12 - lsls r0, r5, 24 - b _080EEF0C - .pool -_080EEEE0: - ldr r3, [r6] - lsls r4, r2, 2 - adds r0, r3, r4 - ldr r7, =0x00002b50 - adds r0, r7 - ldrb r0, [r0] - cmp r0, 0 - beq _080EEF08 - adds r0, r3, r7 - adds r1, r0, r1 - adds r0, r4 - ldr r0, [r0] - str r0, [r1] - adds r0, r2, 0 - bl sub_80EEE78 - b _080EEF12 - .pool -_080EEF08: - adds r0, r2, 0x1 - lsls r0, 24 -_080EEF0C: - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EEEE0 -_080EEF12: - lsls r0, r5, 24 - lsrs r2, r0, 24 - cmp r2, 0xE - bls _080EEEBE - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EEEB8 - - thumb_func_start sub_80EEF20 -sub_80EEF20: @ 80EEF20 - push {r4,lr} - movs r2, 0 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] -_080EEF28: - lsls r0, r2, 2 - adds r1, r3, r0 - ldr r4, =0x00002b50 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080EEF58 - adds r4, 0x1 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080EEF58 - adds r4, 0x1 - adds r0, r1, r4 - ldrh r0, [r0] - cmp r0, 0x2 - bhi _080EEF58 - adds r0, r2, 0 - b _080EEF64 - .pool -_080EEF58: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EEF28 - movs r0, 0xFF -_080EEF64: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EEF20 - - thumb_func_start sub_80EEF6C -sub_80EEF6C: @ 80EEF6C - push {r4,r5,lr} - bl sub_80EEF20 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - bne _080EEF84 - ldr r1, =gScriptResult - movs r0, 0 - b _080EF01A - .pool -_080EEF84: - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - lsls r4, r2, 2 - adds r1, r0, r4 - ldr r0, =0x00002b52 - adds r2, r1, r0 - ldrh r0, [r2] - cmp r0, 0 - bne _080EEFE8 - ldr r2, =0x00002b51 - adds r1, r2 - movs r0, 0x2 - strb r0, [r1] - ldr r0, =gLocalTime - ldrb r0, [r0, 0x2] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x13 - bgt _080EEFC8 - ldr r1, =gUnknown_0858D11C - ldr r0, [r5] - adds r0, r4 - subs r2, 0x1 - b _080EEFD0 - .pool -_080EEFC8: - ldr r1, =gUnknown_0858D130 - ldr r0, [r5] - adds r0, r4 - ldr r2, =0x00002b50 -_080EEFD0: - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - b _080EF016 - .pool -_080EEFE8: - ldrh r1, [r2] - ldr r0, =gStringVar1 - movs r2, 0 - movs r3, 0x1 - bl ConvertIntToDecimalStringN - ldr r0, [r5] - adds r0, r4 - ldr r1, =0x00002b51 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - ldr r1, =gUnknown_0858D108 - ldr r0, [r5] - adds r0, r4 - ldr r2, =0x00002b50 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 -_080EF016: - ldr r1, =gScriptResult - movs r0, 0x1 -_080EF01A: - strh r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EEF6C - - thumb_func_start GetPriceReduction -GetPriceReduction: @ 80EF038 - push {r4,r5,lr} - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _080EF048 - b _080EF08A -_080EF044: - movs r0, 0x1 - b _080EF08C -_080EF048: - movs r2, 0 - ldr r4, =gSaveBlock1Ptr -_080EF04C: - ldr r1, [r4] - lsls r0, r2, 2 - adds r1, r0 - ldr r5, =0x00002b50 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r3 - bne _080EF080 - ldr r2, =0x00002b51 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080EF08A - adds r0, r3, 0 - bl IsPriceDiscounted - lsls r0, 24 - cmp r0, 0 - bne _080EF044 - b _080EF08A - .pool -_080EF080: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080EF04C -_080EF08A: - movs r0, 0 -_080EF08C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end GetPriceReduction - - thumb_func_start IsPriceDiscounted -IsPriceDiscounted: @ 80EF094 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080EF0A6 - cmp r0, 0x3 - beq _080EF0C8 -_080EF0A2: - movs r0, 0x1 - b _080EF0D6 -_080EF0A6: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _080EF0D4 - ldr r0, =gScriptLastTalked - ldrh r0, [r0] - cmp r0, 0x19 - beq _080EF0A2 - b _080EF0D4 - .pool -_080EF0C8: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r1, [r0, 0x4] - ldr r0, =0x0000150d - cmp r1, r0 - beq _080EF0A2 -_080EF0D4: - movs r0, 0 -_080EF0D6: - pop {r1} - bx r1 - .pool - thumb_func_end IsPriceDiscounted - - thumb_func_start sub_80EF0E4 -sub_80EF0E4: @ 80EF0E4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _080EF0F2 -_080EF0EE: - movs r0, 0x1 - b _080EF112 -_080EF0F2: - movs r1, 0 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] - ldr r4, =0x00002b50 -_080EF0FA: - lsls r0, r1, 2 - adds r0, r3, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r2 - beq _080EF0EE - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080EF0FA - movs r0, 0 -_080EF112: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EF0E4 - - thumb_func_start sub_80EF120 -sub_80EF120: @ 80EF120 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r7, r0, 16 - movs r6, 0 - ldr r0, =gSaveBlock1Ptr - mov r8, r0 -_080EF130: - mov r1, r8 - ldr r0, [r1] - lsls r1, r6, 2 - adds r2, r0, r1 - ldr r3, =0x00002b50 - adds r0, r2, r3 - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0 - beq _080EF196 - ldr r1, =0x00002b52 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, r7 - bcs _080EF164 - adds r0, r6, 0 - bl sub_80EEE78 - b _080EF196 - .pool -_080EF164: - ldr r5, =0x00002b51 - adds r0, r2, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080EF186 - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1 - bne _080EF186 - mov r2, r8 - ldr r0, [r2] - adds r0, r4 - adds r0, r5 - strb r1, [r0] -_080EF186: - mov r3, r8 - ldr r1, [r3] - adds r1, r4 - ldr r0, =0x00002b52 - adds r1, r0 - ldrh r0, [r1] - subs r0, r7 - strh r0, [r1] -_080EF196: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xF - bls _080EF130 - bl sub_80EEEB8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF120 - - thumb_func_start sub_80EF1BC -sub_80EF1BC: @ 80EF1BC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x1 - beq _080EF1FC - cmp r1, 0x1 - bgt _080EF1D6 - cmp r1, 0 - beq _080EF1E0 - b _080EF244 -_080EF1D6: - cmp r2, 0x2 - beq _080EF218 - cmp r2, 0x3 - beq _080EF234 - b _080EF244 -_080EF1E0: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x14] - bl StringCopy - b _080EF244 - .pool -_080EF1FC: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x18] - bl StringCopy - b _080EF244 - .pool -_080EF218: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x1C] - bl StringCopy - b _080EF244 - .pool -_080EF234: - ldr r1, =gUnknown_0858D144 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x20] - bl StringCopy -_080EF244: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF1BC - - thumb_func_start CopyContestCategoryToStringVar -@ void CopyContestCategoryToStringVar(u8 stringVarIndex, u8 contestCategoryId) -CopyContestCategoryToStringVar: @ 80EF250 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r0, r1, 24 - cmp r0, 0x4 - bhi _080EF300 - lsls r0, 2 - ldr r1, =_080EF26C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EF26C: - .4byte _080EF280 - .4byte _080EF29C - .4byte _080EF2B8 - .4byte _080EF2D4 - .4byte _080EF2F0 -_080EF280: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1] - bl StringCopy - b _080EF300 - .pool -_080EF29C: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x4] - bl StringCopy - b _080EF300 - .pool -_080EF2B8: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x8] - bl StringCopy - b _080EF300 - .pool -_080EF2D4: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0xC] - bl StringCopy - b _080EF300 - .pool -_080EF2F0: - ldr r1, =gUnknown_0858D144 - lsls r0, r2, 2 - adds r0, r1 - ldr r0, [r0] - ldr r1, =gUnknown_0858BAF0 - ldr r1, [r1, 0x10] - bl StringCopy -_080EF300: - pop {r0} - bx r0 - .pool - thumb_func_end CopyContestCategoryToStringVar - - thumb_func_start SetContestCategoryStringVarForInterview -@ void SetContestCategoryStringVarForInterview() -SetContestCategoryStringVarForInterview: @ 80EF30C - push {lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r1, r0 - ldrb r1, [r1, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - pop {r0} - bx r0 - .pool - thumb_func_end SetContestCategoryStringVarForInterview - - thumb_func_start sub_80EF340 -sub_80EF340: @ 80EF340 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - bl sub_80EF370 - adds r3, r0, 0 - ldr r0, =gUnknown_0858D144 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - lsls r3, 24 - lsrs r3, 24 - adds r1, r5, 0 - movs r2, 0 - bl ConvertIntToDecimalStringN - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF340 - - thumb_func_start sub_80EF370 -sub_80EF370: @ 80EF370 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xA - bl __divsi3 - cmp r0, 0 - beq _080EF3FC - adds r0, r4, 0 - movs r1, 0x64 - bl __divsi3 - cmp r0, 0 - bne _080EF38E - movs r0, 0x2 - b _080EF406 -_080EF38E: - movs r1, 0xFA - lsls r1, 2 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3A0 - movs r0, 0x3 - b _080EF406 -_080EF3A0: - ldr r1, =0x00002710 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3B4 - movs r0, 0x4 - b _080EF406 - .pool -_080EF3B4: - ldr r1, =0x000186a0 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3C8 - movs r0, 0x5 - b _080EF406 - .pool -_080EF3C8: - ldr r1, =0x000f4240 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3DC - movs r0, 0x6 - b _080EF406 - .pool -_080EF3DC: - ldr r1, =0x00989680 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - bne _080EF3F0 - movs r0, 0x7 - b _080EF406 - .pool -_080EF3F0: - ldr r1, =0x05f5e100 - adds r0, r4, 0 - bl __divsi3 - cmp r0, 0 - beq _080EF404 -_080EF3FC: - movs r0, 0x1 - b _080EF406 - .pool -_080EF404: - movs r0, 0x8 -_080EF406: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EF370 - - thumb_func_start sub_80EF40C -sub_80EF40C: @ 80EF40C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r7, 0 - movs r5, 0 -_080EF41E: - lsls r4, r5, 1 - adds r0, r6, 0x6 - adds r1, r0, r4 - ldrh r0, [r1] - cmp r0, 0 - beq _080EF43E - bl itemid_get_market_price - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - adds r1, 0xC - adds r1, r4 - ldrh r1, [r1] - muls r0, r1 - adds r7, r0 -_080EF43E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080EF41E - ldrb r0, [r6, 0x2] - cmp r0, 0x1 - bne _080EF458 - asrs r1, r7, 1 - mov r0, r8 - bl sub_80EF340 - b _080EF460 -_080EF458: - mov r0, r8 - adds r1, r7, 0 - bl sub_80EF340 -_080EF460: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EF40C - - thumb_func_start sub_80EF46C -sub_80EF46C: @ 80EF46C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - mov r8, r0 - bl sub_80F0020 - adds r7, r0, 0 - movs r6, 0x5 -_080EF494: - lsls r0, r6, 3 - adds r0, r6 - lsls r0, 2 - mov r2, r8 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, r10 - bne _080EF4E4 - movs r3, 0xFF - adds r0, r7, 0 - ands r0, r3 - adds r2, r1, 0 - adds r2, 0x22 - ldrb r2, [r2] - cmp r0, r2 - bne _080EF4E4 - lsrs r0, r7, 8 - ands r0, r3 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080EF4E4 - mov r0, r9 - cmp r0, 0x1 - bne _080EF4D8 - ldr r0, [r5] - adds r0, r4 - adds r1, r6, 0 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C -_080EF4D8: - movs r0, 0x1 - b _080EF4F0 - .pool -_080EF4E4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x17 - bls _080EF494 - movs r0, 0 -_080EF4F0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80EF46C - - thumb_func_start sub_80EF500 -sub_80EF500: @ 80EF500 - push {r4-r7,lr} - movs r2, 0 -_080EF504: - adds r1, r2, 0x1 - lsls r0, r1, 24 - lsrs r5, r0, 24 - adds r7, r1, 0 - cmp r5, 0x2 - bhi _080EF53C - ldr r6, =gUnknown_02039F80 - lsls r0, r2, 2 - adds r4, r0, r6 -_080EF516: - lsls r0, r5, 2 - adds r3, r0, r6 - ldrh r0, [r4, 0x2] - ldrh r1, [r3, 0x2] - cmp r0, r1 - bcs _080EF532 - ldrh r1, [r4] - adds r2, r0, 0 - ldrh r0, [r3] - strh r0, [r4] - ldrh r0, [r3, 0x2] - strh r0, [r4, 0x2] - strh r1, [r3] - strh r2, [r3, 0x2] -_080EF532: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080EF516 -_080EF53C: - lsls r0, r7, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bls _080EF504 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF500 - - thumb_func_start sub_80EF550 -sub_80EF550: @ 80EF550 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0 - ldr r5, =gSaveBlock1Ptr - ldr r4, =0x000027cc -_080EF55C: - ldr r3, [r5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r3, r0 - adds r0, r2, r4 - ldrb r0, [r0] - cmp r0, r6 - bne _080EF5A4 - ldr r6, =0x000027cd - adds r0, r2, r6 - ldrb r2, [r0] - cmp r2, 0x1 - bne _080EF590 - ldr r0, =gScriptResult - strh r2, [r0] - b _080EF5B2 - .pool -_080EF590: - adds r0, r3, r4 - bl sub_80EF910 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - bl sub_80EFA88 - b _080EF5B2 -_080EF5A4: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EF55C - bl sub_80EFA88 -_080EF5B2: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80EF550 - - thumb_func_start InterviewBefore -InterviewBefore: @ 80EF5B8 - push {lr} - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - subs r0, 0x1 - cmp r0, 0xA - bhi _080EF646 - lsls r0, 2 - ldr r1, =_080EF5E0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080EF5E0: - .4byte _080EF60C - .4byte _080EF612 - .4byte _080EF618 - .4byte _080EF61E - .4byte _080EF624 - .4byte _080EF62A - .4byte _080EF630 - .4byte _080EF636 - .4byte _080EF63C - .4byte _080EF646 - .4byte _080EF642 -_080EF60C: - bl sub_80EF64C - b _080EF646 -_080EF612: - bl sub_80EF6C4 - b _080EF646 -_080EF618: - bl sub_80EF704 - b _080EF646 -_080EF61E: - bl sub_80EF79C - b _080EF646 -_080EF624: - bl sub_80EF7A8 - b _080EF646 -_080EF62A: - bl sub_80EF7B4 - b _080EF646 -_080EF630: - bl sub_80EF80C - b _080EF646 -_080EF636: - bl sub_80EF7F4 - b _080EF646 -_080EF63C: - bl sub_80EF800 - b _080EF646 -_080EF642: - bl sub_80EF84C -_080EF646: - pop {r0} - bx r0 - thumb_func_end InterviewBefore - - thumb_func_start sub_80EF64C -sub_80EF64C: @ 80EF64C - push {r4,lr} - movs r0, 0x1 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF6A0 - ldr r4, =gStringVar1 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0xB - movs r2, 0 - bl GetMonData - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x6 - bl sub_811F88C -_080EF6A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF64C - - thumb_func_start sub_80EF6C4 -sub_80EF6C4: @ 80EF6C4 - push {lr} - movs r0, 0x2 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF6F0 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x6 - bl sub_811F88C -_080EF6F0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF6C4 - - thumb_func_start sub_80EF704 -sub_80EF704: @ 80EF704 - push {r4-r6,lr} - movs r0, 0x3 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF774 - ldr r6, =gStringVar1 - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0xB - movs r2, 0 - bl GetMonData - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r6, 0 - bl StringCopy - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - muls r0, r5 - adds r0, r4 - ldr r4, =gStringVar2 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StringGetEnd10 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e8 - adds r0, r1 - movs r1, 0x2 - bl sub_811F88C -_080EF774: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF704 - - thumb_func_start sub_80EF79C -sub_80EF79C: @ 80EF79C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_80EF79C - - thumb_func_start sub_80EF7A8 -sub_80EF7A8: @ 80EF7A8 - push {lr} - movs r0, 0x5 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF7A8 - - thumb_func_start sub_80EF7B4 -sub_80EF7B4: @ 80EF7B4 - push {lr} - movs r0, 0x6 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF7E0 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027d0 - adds r0, r1 - movs r1, 0x2 - bl sub_811F88C -_080EF7E0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF7B4 - - thumb_func_start sub_80EF7F4 -sub_80EF7F4: @ 80EF7F4 - push {lr} - movs r0, 0x8 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF7F4 - - thumb_func_start sub_80EF800 -sub_80EF800: @ 80EF800 - push {lr} - movs r0, 0x9 - bl sub_80EF550 - pop {r0} - bx r0 - thumb_func_end sub_80EF800 - - thumb_func_start sub_80EF80C -sub_80EF80C: @ 80EF80C - push {lr} - movs r0, 0x7 - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF838 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e4 - adds r0, r1 - movs r1, 0x1 - bl sub_811F88C -_080EF838: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF80C - - thumb_func_start sub_80EF84C -sub_80EF84C: @ 80EF84C - push {lr} - movs r0, 0xB - bl sub_80EF550 - ldr r0, =gScriptResult - ldrh r0, [r0] - cmp r0, 0 - bne _080EF878 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, [r2] - adds r0, r1 - ldr r1, =0x000027e0 - adds r0, r1 - movs r1, 0x1 - bl sub_811F88C -_080EF878: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EF84C - - thumb_func_start sub_80EF88C -sub_80EF88C: @ 80EF88C - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - adds r5, r1, r0 - ldr r6, =gStringVar1 - adds r0, r5, 0 - movs r1, 0x2 - adds r2, r6, 0 - bl GetMonData - mov r4, sp - adds r0, r5, 0 - movs r1, 0x3 - mov r2, sp - bl GetMonData - strb r0, [r4] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080EF8EC - adds r0, r5, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - movs r1, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r6, 0 - bl StringCompare - cmp r0, 0 - bne _080EF8EC - movs r0, 0 - b _080EF8EE - .pool -_080EF8EC: - movs r0, 0x1 -_080EF8EE: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EF88C - - thumb_func_start sub_80EF8F8 -sub_80EF8F8: @ 80EF8F8 - push {lr} - bl sub_8139688 - lsls r0, 24 - lsrs r0, 24 - bl sub_80EF88C - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_80EF8F8 - - thumb_func_start sub_80EF910 -sub_80EF910: @ 80EF910 - push {lr} - lsls r1, 24 - lsrs r1, 24 - lsls r2, r1, 3 - adds r2, r1 - lsls r2, 2 - adds r2, r0 - movs r0, 0 - strb r0, [r2] - strb r0, [r2, 0x1] - movs r1, 0 - adds r2, 0x2 - movs r3, 0 -_080EF92A: - adds r0, r2, r1 - strb r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x21 - bls _080EF92A - pop {r0} - bx r0 - thumb_func_end sub_80EF910 - - thumb_func_start sub_80EF93C -sub_80EF93C: @ 80EF93C - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 -_080EF942: - lsls r0, r5, 3 - adds r0, r5 - lsls r1, r0, 2 - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _080EF986 - adds r0, r5, 0x1 - b _080EF97E -_080EF954: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0 - beq _080EF97C - adds r1, r4 - adds r0, r3, 0 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_80EF910 - b _080EF986 -_080EF97C: - adds r0, r2, 0x1 -_080EF97E: - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _080EF954 -_080EF986: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080EF942 - movs r5, 0x5 -_080EF992: - lsls r0, r5, 3 - adds r0, r5 - lsls r1, r0, 2 - adds r0, r1, r4 - ldrb r0, [r0] - adds r5, 0x1 - cmp r0, 0 - bne _080EF9D8 - lsls r0, r5, 24 - b _080EF9D2 -_080EF9A6: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0 - beq _080EF9CE - adds r1, r4 - adds r0, r3, 0 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - adds r0, r4, 0 - adds r1, r2, 0 - bl sub_80EF910 - b _080EF9D8 -_080EF9CE: - adds r0, r2, 0x1 - lsls r0, 24 -_080EF9D2: - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080EF9A6 -_080EF9D8: - lsls r0, r5, 24 - lsrs r5, r0, 24 - cmp r5, 0x17 - bls _080EF992 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80EF93C - - thumb_func_start sub_80EF9E8 -sub_80EF9E8: @ 80EF9E8 - push {r4,r5,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - lsrs r0, 16 - bl sub_80EFA24 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - ldr r0, =gUnknown_0858D144 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0xB - muls r1, r5 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80EF9E8 - - thumb_func_start sub_80EFA24 -sub_80EFA24: @ 80EFA24 - push {r4-r6,lr} - lsls r0, 16 - lsrs r5, r0, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000019b - bl __umodsi3 - adds r0, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - adds r6, r4, 0 - b _080EFA62 - .pool -_080EFA48: - cmp r4, 0x1 - bne _080EFA54 - ldr r4, =0x0000019b - b _080EFA5A - .pool -_080EFA54: - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_080EFA5A: - cmp r4, r6 - bne _080EFA62 - adds r4, r5, 0 - b _080EFA7E -_080EFA62: - adds r0, r4, 0 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl GetSetPokedexFlag - lsls r0, 24 - asrs r0, 24 - cmp r0, 0x1 - bne _080EFA48 - cmp r4, r5 - beq _080EFA48 -_080EFA7E: - adds r0, r4, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80EFA24 - - thumb_func_start sub_80EFA88 -sub_80EFA88: @ 80EFA88 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - bl sub_80EFADC - ldr r1, =gUnknown_030060BC - strb r0, [r1] - ldr r2, =gSpecialVar_0x8006 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - strh r1, [r2] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _080EFACC - ldr r1, =gScriptResult - movs r0, 0x1 - b _080EFAD0 - .pool -_080EFACC: - ldr r1, =gScriptResult - movs r0, 0 -_080EFAD0: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFA88 - - thumb_func_start sub_80EFADC -sub_80EFADC: @ 80EFADC - push {lr} - adds r2, r0, 0 - movs r1, 0 -_080EFAE2: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EFAF6 - lsls r0, r1, 24 - asrs r0, 24 - b _080EFB04 -_080EFAF6: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EFAE2 - movs r0, 0x1 - negs r0, r0 -_080EFB04: - pop {r1} - bx r1 - thumb_func_end sub_80EFADC - - thumb_func_start sub_80EFB08 -sub_80EFB08: @ 80EFB08 - push {lr} - adds r2, r0, 0 - movs r1, 0x5 -_080EFB0E: - lsls r0, r1, 24 - asrs r1, r0, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080EFB24 - adds r0, r1, 0 - b _080EFB34 -_080EFB24: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - asrs r0, 24 - cmp r0, 0x17 - ble _080EFB0E - movs r0, 0x1 - negs r0, r0 -_080EFB34: - pop {r1} - bx r1 - thumb_func_end sub_80EFB08 - - thumb_func_start sub_80EFB38 -sub_80EFB38: @ 80EFB38 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - cmp r0, r4 - bls _080EFB50 - movs r0, 0x1 - b _080EFB52 -_080EFB50: - movs r0, 0 -_080EFB52: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFB38 - - thumb_func_start sub_80EFB58 -sub_80EFB58: @ 80EFB58 - push {r4-r6,lr} - adds r4, r0, 0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - bl __umodsi3 - lsls r0, 24 - lsrs r2, r0, 24 - adds r5, r4, 0x4 - ldr r6, =0x0000ffff - b _080EFB7E - .pool -_080EFB78: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080EFB7E: - cmp r2, 0x6 - bne _080EFB84 - movs r2, 0 -_080EFB84: - lsls r1, r2, 1 - adds r0, r5, r1 - ldrh r0, [r0] - adds r3, r4, 0x4 - cmp r0, r6 - beq _080EFB78 - ldr r0, =gStringVar3 - adds r1, r3, r1 - ldrh r1, [r1] - bl CopyEasyChatWord - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFB58 - - thumb_func_start sub_80EFBA4 -sub_80EFBA4: @ 80EFBA4 - push {lr} - adds r2, r0, 0 - movs r3, 0 - movs r1, 0 - ldrb r0, [r2, 0x4] - cmp r0, 0xFF - beq _080EFBD0 - adds r2, 0x4 -_080EFBB4: - adds r0, r2, r1 - ldrb r0, [r0] - adds r0, r3, r0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xA - bhi _080EFBD0 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _080EFBB4 -_080EFBD0: - movs r0, 0x7 - ands r3, r0 - adds r0, r3, 0 - pop {r1} - bx r1 - thumb_func_end sub_80EFBA4 - - thumb_func_start sub_80EFBDC -sub_80EFBDC: @ 80EFBDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - ldr r4, [sp, 0x2C] - ldr r5, [sp, 0x30] - mov r8, r5 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r5, r1, 24 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 16 - lsrs r3, 16 - lsls r4, 16 - lsrs r4, 16 - movs r2, 0 - movs r7, 0xFF -_080EFC06: - mov r1, sp - adds r0, r1, r2 - ldrb r1, [r0] - orrs r1, r7 - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x2 - bls _080EFC06 - cmp r3, 0 - bne _080EFC72 - mov r4, r8 - adds r4, 0xF - adds r0, r4, 0 - bl StringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFC36 - mov r0, sp - adds r1, r4, r5 - b _080EFC40 -_080EFC36: - cmp r6, 0x1 - bne _080EFC46 - mov r0, sp - subs r1, r2, r5 - adds r1, r4, r1 -_080EFC40: - ldrb r1, [r1] - strb r1, [r0] - b _080EFC6C -_080EFC46: - cmp r6, 0x2 - bne _080EFC56 - mov r1, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - b _080EFC66 -_080EFC56: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 -_080EFC66: - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFC6C: - mov r2, r8 - ldrb r1, [r2, 0x1E] - b _080EFCC8 -_080EFC72: - cmp r3, 0x1 - bne _080EFCD0 - mov r4, r8 - adds r4, 0x4 - adds r0, r4, 0 - bl StringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFC8E - mov r0, sp - adds r1, r4, r5 - b _080EFC98 -_080EFC8E: - cmp r6, 0x1 - bne _080EFC9E - mov r0, sp - subs r1, r2, r5 - adds r1, r4, r1 -_080EFC98: - ldrb r1, [r1] - strb r1, [r0] - b _080EFCC4 -_080EFC9E: - cmp r6, 0x2 - bne _080EFCAE - mov r1, sp - adds r0, r4, r5 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r5, 0x1 - b _080EFCBE -_080EFCAE: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 -_080EFCBE: - adds r0, r4, r0 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFCC4: - mov r5, r8 - ldrb r1, [r5, 0x1F] -_080EFCC8: - mov r0, sp - bl ConvertInternationalString - b _080EFD30 -_080EFCD0: - movs r0, 0xB - muls r4, r0 - ldr r7, =gSpeciesNames - adds r0, r4, r7 - bl StringLength - lsls r0, 16 - lsrs r2, r0, 16 - cmp r6, 0 - bne _080EFCF0 - mov r0, sp - adds r1, r5, r4 - b _080EFCFA - .pool -_080EFCF0: - cmp r6, 0x1 - bne _080EFD02 - mov r0, sp - subs r1, r2, r5 - adds r1, r4 -_080EFCFA: - adds r1, r7 - ldrb r1, [r1] - strb r1, [r0] - b _080EFD30 -_080EFD02: - cmp r6, 0x2 - bne _080EFD16 - mov r1, sp - adds r0, r5, r4 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - adds r0, r5, r0 - b _080EFD2A -_080EFD16: - mov r1, sp - subs r0, r2, 0x2 - subs r0, r5 - adds r0, r4 - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1] - subs r0, r2, 0x1 - subs r0, r5 - adds r0, r4 -_080EFD2A: - adds r0, r7 - ldrb r0, [r0] - strb r0, [r1, 0x1] -_080EFD30: - ldr r0, =gUnknown_0858D144 - mov r2, r9 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - mov r1, sp - bl StringCopy - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFBDC - - thumb_func_start sub_80EFD54 -sub_80EFD54: @ 80EFD54 - push {r4,lr} - movs r1, 0 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] - ldr r0, =gSpecialVar_0x8004 - ldrh r2, [r0] - ldr r4, =0x000027cc -_080EFD62: - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r3, r0 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r2 - bne _080EFD84 - movs r0, 0x1 - b _080EFD90 - .pool -_080EFD84: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _080EFD62 - movs r0, 0 -_080EFD90: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFD54 - - thumb_func_start sub_80EFD98 -sub_80EFD98: @ 80EFD98 - push {r4,lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r4, =gStringVar1 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - ldr r0, =gStringVar3 - adds r1, r4, 0 - bl StringCompare - cmp r0, 0 - beq _080EFDD4 - bl sub_80ED320 - movs r0, 0x1 - b _080EFDD6 - .pool -_080EFDD4: - movs r0, 0 -_080EFDD6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80EFD98 - - thumb_func_start sub_80EFDDC -sub_80EFDDC: @ 80EFDDC - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0x8 - ldr r0, =gSpecialVar_0x8004 - mov r9, r0 - ldrh r0, [r0] - movs r1, 0x64 - mov r8, r1 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - ldr r6, =gPlayerParty - adds r0, r6 - ldr r2, =gStringVar3 - movs r1, 0x2 - bl GetMonData - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - ldr r1, =gStringVar2 - mov r10, r1 - movs r1, 0x2 - mov r2, r10 - bl GetMonData - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - bl GetMonGender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r9 - ldrh r0, [r1] - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r0, r6 - movs r1, 0 - movs r2, 0 - bl GetMonData - str r0, [sp] - ldr r0, =c2_080CC144 - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r10 - adds r2, r5, 0 - adds r3, r4, 0 - bl DoNamingScreen - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFDDC - - thumb_func_start c2_080CC144 -c2_080CC144: @ 80EFE98 - push {lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r2, =gStringVar2 - movs r1, 0x2 - bl SetMonData - bl c2_exit_to_overworld_1_continue_scripts_restart_music - pop {r0} - bx r0 - .pool - thumb_func_end c2_080CC144 - - thumb_func_start sub_80EFEC4 -sub_80EFEC4: @ 80EFEC4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x8 - ldr r0, =gSpecialVar_0x8012 - ldrb r0, [r0] - ldr r1, =gSpecialVar_0x8013 - ldrb r1, [r1] - bl GetBoxedMonPtr - adds r6, r0, 0 - ldr r2, =gStringVar3 - movs r1, 0x2 - bl GetBoxMonData - ldr r0, =gStringVar2 - mov r8, r0 - adds r0, r6, 0 - movs r1, 0x2 - mov r2, r8 - bl GetBoxMonData - adds r0, r6, 0 - movs r1, 0xB - movs r2, 0 - bl GetBoxMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r6, 0 - bl GetBoxMonGender - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - movs r1, 0 - movs r2, 0 - bl GetBoxMonData - str r0, [sp] - ldr r0, =sub_80EFF48 - str r0, [sp, 0x4] - movs r0, 0x3 - mov r1, r8 - adds r2, r5, 0 - adds r3, r4, 0 - bl DoNamingScreen - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFEC4 - - thumb_func_start sub_80EFF48 -sub_80EFF48: @ 80EFF48 - push {lr} - ldr r0, =gSpecialVar_0x8012 - ldrb r0, [r0] - ldr r1, =gSpecialVar_0x8013 - ldrb r1, [r1] - ldr r2, =gStringVar2 - bl SetBoxMonNickFromAnyBox - bl c2_exit_to_overworld_1_continue_scripts_restart_music - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF48 - - thumb_func_start sub_80EFF6C -sub_80EFF6C: @ 80EFF6C - push {r4,lr} - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r4, =gStringVar1 - movs r1, 0x2 - adds r2, r4, 0 - bl GetMonData - adds r0, r4, 0 - bl StringGetEnd10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF6C - - thumb_func_start sub_80EFF9C -sub_80EFF9C: @ 80EFF9C - push {r4,lr} - bl sub_80F0020 - adds r4, r0, 0 - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - cmp r4, r0 - bne _080EFFD0 - ldr r1, =gScriptResult - movs r0, 0 - b _080EFFD4 - .pool -_080EFFD0: - ldr r1, =gScriptResult - movs r0, 0x1 -_080EFFD4: - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80EFF9C - - thumb_func_start sub_80EFFE0 -sub_80EFFE0: @ 80EFFE0 - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - adds r2, r1, 0 - cmp r1, 0 - beq _080F0016 - subs r0, r1, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080EFFFA - movs r0, 0x2 - b _080F001C -_080EFFFA: - adds r0, r1, 0 - subs r0, 0x15 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bhi _080F000A - movs r0, 0x3 - b _080F001C -_080F000A: - adds r0, r2, 0 - subs r0, 0x29 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x13 - bls _080F001A -_080F0016: - movs r0, 0 - b _080F001C -_080F001A: - movs r0, 0x4 -_080F001C: - pop {r1} - bx r1 - thumb_func_end sub_80EFFE0 - - thumb_func_start sub_80F0020 -sub_80F0020: @ 80F0020 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldrb r0, [r2, 0xD] - lsls r0, 24 - ldrb r1, [r2, 0xC] - lsls r1, 16 - orrs r0, r1 - ldrb r1, [r2, 0xB] - lsls r1, 8 - orrs r0, r1 - ldrb r1, [r2, 0xA] - orrs r0, r1 - bx lr - .pool - thumb_func_end sub_80F0020 - - thumb_func_start CheckForBigMovieOrEmergencyNewsOnTV -CheckForBigMovieOrEmergencyNewsOnTV: @ 80F0040 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x1 - bne _080F0060 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080F006C - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0 - beq _080F0074 -_080F0060: - movs r0, 0 - b _080F009E - .pool -_080F006C: - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bne _080F0060 -_080F0074: - ldr r0, =0x000008bd - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0092 - movs r0, 0x89 - lsls r0, 4 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F009C -_080F0092: - movs r0, 0x1 - b _080F009E - .pool -_080F009C: - movs r0, 0x2 -_080F009E: - pop {r1} - bx r1 - thumb_func_end CheckForBigMovieOrEmergencyNewsOnTV - - thumb_func_start GetMomOrDadStringForTVMessage -GetMomOrDadStringForTVMessage: @ 80F00A4 - push {r4,lr} - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - movs r0, 0x4 - ldrsb r0, [r1, r0] - cmp r0, 0x1 - bne _080F0104 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080F00EC - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0 - bne _080F0104 - ldr r0, =gStringVar1 - ldr r1, =gText_Mom - bl StringCopy - ldr r0, =0x00004003 - movs r1, 0x1 - bl VarSet - b _080F0104 - .pool -_080F00EC: - movs r0, 0x5 - ldrsb r0, [r1, r0] - cmp r0, 0x2 - bne _080F0104 - ldr r0, =gStringVar1 - ldr r1, =gText_Mom - bl StringCopy - ldr r0, =0x00004003 - movs r1, 0x1 - bl VarSet -_080F0104: - ldr r4, =0x00004003 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - beq _080F0142 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - beq _080F0158 - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080F016C - adds r0, r4, 0 - bl VarGet - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F0158 -_080F0142: - ldr r0, =gStringVar1 - ldr r1, =gText_Mom - bl StringCopy - b _080F01A8 - .pool -_080F0158: - ldr r0, =gStringVar1 - ldr r1, =gText_Dad - bl StringCopy - b _080F01A8 - .pool -_080F016C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F0198 - ldr r0, =gStringVar1 - ldr r1, =gText_Mom - bl StringCopy - adds r0, r4, 0 - movs r1, 0x1 - bl VarSet - b _080F01A8 - .pool -_080F0198: - ldr r0, =gStringVar1 - ldr r1, =gText_Dad - bl StringCopy - adds r0, r4, 0 - movs r1, 0x2 - bl VarSet -_080F01A8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end GetMomOrDadStringForTVMessage - - thumb_func_start sub_80F01B8 -sub_80F01B8: @ 80F01B8 - push {lr} - ldr r0, =0x000040bc - movs r1, 0 - bl VarSet - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrb r1, [r0, 0x5] - ldrb r2, [r0, 0x4] - movs r0, 0x5 - bl RemoveFieldObjectByLocalIdAndMap - ldr r0, =0x00000396 - bl FlagSet - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F01B8 - - thumb_func_start sub_80F01E8 -sub_80F01E8: @ 80F01E8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0xE1 - lsls r0, 4 - bl Alloc - mov r8, r0 - cmp r0, 0 - bne _080F0206 - b _080F0344 -_080F0206: - movs r4, 0 -_080F0208: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 5 - adds r0, r4 - lsls r0, 2 - add r0, r8 - adds r1, r4, 0 - muls r1, r5 - adds r1, r7, r1 - movs r2, 0xE1 - lsls r2, 2 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080F0208 - mov r5, r8 - movs r4, 0 - ldr r7, =gLinkPlayers - b _080F0276 - .pool -_080F0238: - lsls r0, r4, 3 - subs r2, r0, r4 - lsls r0, r2, 2 - adds r3, r0, r7 - ldrb r1, [r3] - subs r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1 - bhi _080F025A - lsls r0, r2, 5 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - bl sub_80F1254 - b _080F0270 -_080F025A: - cmp r1, 0x3 - bne _080F0270 - ldrh r0, [r3, 0x1A] - cmp r0, 0x1 - bne _080F0270 - lsls r0, r2, 5 - adds r0, r4 - lsls r0, 2 - adds r0, r5, r0 - bl sub_80F12A4 -_080F0270: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080F0276: - bl sub_8009FCC - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _080F0238 - cmp r6, 0x1 - beq _080F02C4 - cmp r6, 0x1 - bgt _080F0290 - cmp r6, 0 - beq _080F029A - b _080F031E -_080F0290: - cmp r6, 0x2 - beq _080F02DC - cmp r6, 0x3 - beq _080F0304 - b _080F031E -_080F029A: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - movs r2, 0xE1 - lsls r2, 2 - adds r1, r5, r2 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - ldr r4, =0x00000a8c - adds r3, r5, r4 - bl sub_80F0358 - b _080F031E - .pool -_080F02C4: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x000027cc - adds r1, r0 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - b _080F02EA - .pool -_080F02DC: - movs r0, 0xE1 - lsls r0, 2 - adds r1, r5, r0 - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r3, =0x000027cc - adds r2, r3 -_080F02EA: - ldr r4, =0x00000a8c - adds r3, r5, r4 - adds r0, r5, 0 - bl sub_80F0358 - b _080F031E - .pool -_080F0304: - movs r0, 0xE1 - lsls r0, 2 - adds r1, r5, r0 - movs r3, 0xE1 - lsls r3, 3 - adds r2, r5, r3 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] - ldr r4, =0x000027cc - adds r3, r4 - adds r0, r5, 0 - bl sub_80F0358 -_080F031E: - ldr r5, =gSaveBlock1Ptr - ldr r0, [r5] - ldr r4, =0x000027cc - adds r0, r4 - bl sub_80EF93C - bl sub_80F0C04 - ldr r0, [r5] - adds r0, r4 - bl sub_80EF93C - bl sub_80F0708 - bl sub_80F0B64 - mov r0, r8 - bl Free -_080F0344: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F01E8 - - thumb_func_start sub_80F0358 -sub_80F0358: @ 80F0358 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - str r0, [sp, 0x10] - str r1, [sp, 0x14] - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - add r0, sp, 0x10 - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - add r0, sp, 0x18 - str r0, [sp, 0x8] - add r0, sp, 0x1C - str r0, [sp, 0xC] - bl sub_8009FCC - ldr r1, =gUnknown_03001174 - strb r0, [r1] -_080F0384: - movs r6, 0 - ldr r0, =gUnknown_03001174 - ldrb r1, [r0] - cmp r6, r1 - bcs _080F0384 - mov r10, r0 -_080F0390: - cmp r6, 0 - bne _080F0398 - ldr r2, =gUnknown_0203A02C - strb r6, [r2] -_080F0398: - lsls r4, r6, 2 - mov r3, sp - adds r0, r3, r4 - ldr r0, [r0] - ldr r0, [r0] - bl sub_80F06D0 - ldr r1, =gUnknown_03001176 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - adds r7, r4, 0 - cmp r0, r1 - bne _080F03E0 - ldr r1, =gUnknown_0203A02C - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - mov r2, r10 - ldrb r2, [r2] - cmp r0, r2 - beq _080F048C - adds r6, 0x1 - mov r9, r6 - b _080F0470 - .pool -_080F03E0: - movs r5, 0 - mov r3, r10 - ldrb r0, [r3] - subs r0, 0x1 - adds r2, r6, 0x1 - mov r9, r2 - cmp r5, r0 - bge _080F0456 - ldr r3, =gUnknown_03001174 - mov r8, r3 -_080F03F4: - adds r0, r6, r5 - adds r4, r0, 0x1 - mov r0, r8 - ldrb r1, [r0] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r0, [r0] - bl sub_80EFB08 - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0446 - mov r2, r8 - ldrb r1, [r2] - adds r0, r4, 0 - bl __modsi3 - adds r2, r0, 0 - lsls r0, r2, 2 - add r0, sp - ldr r0, [r0] - mov r3, sp - adds r1, r3, r7 - ldr r1, [r1] - lsls r2, 24 - lsrs r2, 24 - bl sub_80F049C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0456 -_080F0446: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - mov r1, r8 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - blt _080F03F4 -_080F0456: - mov r2, r10 - ldrb r0, [r2] - subs r0, 0x1 - cmp r5, r0 - bne _080F0470 - mov r3, sp - adds r0, r3, r7 - ldr r0, [r0] - ldr r0, [r0] - ldr r1, =gUnknown_03001176 - ldrb r1, [r1] - bl sub_80EF910 -_080F0470: - mov r1, r9 - lsls r0, r1, 24 - lsrs r6, r0, 24 - mov r2, r10 - ldrb r2, [r2] - cmp r6, r2 - bcc _080F0390 - b _080F0384 - .pool -_080F048C: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80F0358 - - thumb_func_start sub_80F049C -sub_80F049C: @ 80F049C - push {r4-r7,lr} - sub sp, 0x4 - lsls r2, 24 - lsrs r7, r2, 24 - ldr r4, [r0] - ldr r6, [r1] - movs r5, 0 - ldr r2, =gUnknown_03001176 - movs r1, 0 - ldrsb r1, [r2, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0] - str r2, [sp] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - ldr r2, [sp] - cmp r0, 0x3 - beq _080F050C - cmp r0, 0x3 - bgt _080F04DC - cmp r0, 0x2 - beq _080F04E2 - b _080F055A - .pool -_080F04DC: - cmp r1, 0x4 - beq _080F0534 - b _080F055A -_080F04E2: - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F0580 - b _080F0556 - .pool -_080F050C: - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F05E8 - b _080F0556 - .pool -_080F0534: - ldr r0, =gUnknown_030060BC - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r6, r1 - adds r2, r7, 0 - bl sub_80F0668 -_080F0556: - lsls r0, 24 - lsrs r5, r0, 24 -_080F055A: - cmp r5, 0x1 - beq _080F0568 - movs r0, 0 - b _080F0574 - .pool -_080F0568: - ldr r0, =gUnknown_03001176 - ldrb r1, [r0] - adds r0, r6, 0 - bl sub_80EF910 - movs r0, 0x1 -_080F0574: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80F049C - - thumb_func_start sub_80F0580 -sub_80F0580: @ 80F0580 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r5, r0, 0 - movs r2, 0xFF - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r0, r1 - bne _080F05B0 - lsrs r0, r5, 8 - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F05B0 - movs r0, 0 - b _080F05E0 -_080F05B0: - adds r1, r4, 0 - adds r1, 0x20 - ldrb r0, [r1] - adds r2, r4, 0 - adds r2, 0x22 - strb r0, [r2] - adds r3, r4, 0 - adds r3, 0x21 - ldrb r0, [r3] - adds r2, 0x1 - strb r0, [r2] - strb r5, [r1] - lsrs r0, r5, 8 - strb r0, [r3] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] -_080F05E0: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0580 - - thumb_func_start sub_80F05E8 -sub_80F05E8: @ 80F05E8 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r2, r0, 0 - movs r3, 0xFF - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x20 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0614 - lsrs r0, r2, 8 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x21 - ldrb r1, [r1] - cmp r0, r1 - beq _080F0634 -_080F0614: - movs r3, 0xFF - adds r0, r2, 0 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x22 - lsrs r5, r2, 8 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0638 - adds r0, r5, 0 - ands r0, r3 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0638 -_080F0634: - movs r0, 0 - b _080F0660 -_080F0638: - ldrb r1, [r4, 0x1E] - adds r0, r4, 0 - adds r0, 0x20 - strb r1, [r0] - ldrb r0, [r4, 0x1F] - adds r1, r4, 0 - adds r1, 0x21 - strb r0, [r1] - strb r2, [r4, 0x1E] - strb r5, [r4, 0x1F] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] -_080F0660: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F05E8 - - thumb_func_start sub_80F0668 -sub_80F0668: @ 80F0668 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_800A2A4 - adds r5, r0, 0 - movs r2, 0xFF - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0698 - lsrs r0, r5, 8 - ands r0, r2 - adds r1, r4, 0 - adds r1, 0x23 - ldrb r1, [r1] - cmp r0, r1 - bne _080F0698 - movs r0, 0 - b _080F06CA -_080F0698: - adds r1, r4, 0 - adds r1, 0x20 - ldrb r0, [r1] - adds r2, r4, 0 - adds r2, 0x22 - strb r0, [r2] - adds r3, r4, 0 - adds r3, 0x21 - ldrb r0, [r3] - adds r2, 0x1 - strb r0, [r2] - strb r5, [r1] - lsrs r0, r5, 8 - strb r0, [r3] - adds r1, r6, 0 - adds r0, r4, 0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - movs r0, 0x1 - strb r0, [r6, 0x1] - strh r0, [r6, 0x16] -_080F06CA: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0668 - - thumb_func_start sub_80F06D0 -sub_80F06D0: @ 80F06D0 - push {lr} - adds r3, r0, 0 - movs r2, 0 -_080F06D6: - lsls r0, r2, 3 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r3 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080F06F6 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3B - bhi _080F06F6 - lsls r0, r2, 24 - asrs r0, 24 - b _080F0704 -_080F06F6: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x17 - bls _080F06D6 - movs r0, 0x1 - negs r0, r0 -_080F0704: - pop {r1} - bx r1 - thumb_func_end sub_80F06D0 - - thumb_func_start sub_80F0708 -sub_80F0708: @ 80F0708 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x8 - movs r0, 0 - mov r9, r0 -_080F0716: - ldr r3, =gSaveBlock1Ptr - ldr r1, [r3] - mov r4, r9 - lsls r2, r4, 3 - adds r0, r2, r4 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - adds r7, r2, 0 - cmp r0, 0x29 - bls _080F0732 - b _080F0AD8 -_080F0732: - lsls r0, 2 - ldr r1, =_080F0748 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0748: - .4byte _080F0AE2 - .4byte _080F0848 - .4byte _080F0AE2 - .4byte _080F0860 - .4byte _080F0878 - .4byte _080F0890 - .4byte _080F08BC - .4byte _080F08D4 - .4byte _080F07F0 - .4byte _080F0AE2 - .4byte _080F081C - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0AD8 - .4byte _080F0900 - .4byte _080F0AE2 - .4byte _080F0918 - .4byte _080F0944 - .4byte _080F095C - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0974 - .4byte _080F09A0 - .4byte _080F0AE2 - .4byte _080F09C0 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F09F4 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0AD8 - .4byte _080F0AE2 -_080F07F0: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x12] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x2] - b _080F09E6 - .pool -_080F081C: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x16] - lsls r5, r2, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x2] - b _080F09E6 - .pool -_080F0848: - ldr r0, [r3] - mov r4, r9 - adds r1, r7, r4 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrh r0, [r1, 0x2] - b _080F09B0 - .pool -_080F0860: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x2] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0878: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x6] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0890: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x2] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x1C] - b _080F09E6 - .pool -_080F08BC: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x2] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F08D4: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0xA] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x14] - b _080F09E6 - .pool -_080F0900: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x10] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F0918: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0xC] - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0xE] - b _080F09E6 - .pool -_080F0944: - ldr r0, [r3] - mov r2, r9 - adds r1, r7, r2 - lsls r1, 2 - adds r1, r0 - ldr r4, =0x000027cc - adds r1, r4 - ldrh r0, [r1, 0x4] - lsls r1, r2, 24 - b _080F09B2 - .pool -_080F095C: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x8] - b _080F09D0 - .pool -_080F0974: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x2] - lsls r5, r2, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0xA] - b _080F09E6 - .pool -_080F09A0: - ldr r0, [r3] - mov r4, r9 - adds r1, r7, r4 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x000027cc - adds r1, r0 - ldrh r0, [r1, 0x8] -_080F09B0: - lsls r1, r4, 24 -_080F09B2: - lsrs r1, 24 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F09C0: - ldr r0, [r3] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r6, =0x000027cc - adds r0, r6 - ldrh r0, [r0, 0x6] -_080F09D0: - lsls r5, r1, 24 - lsrs r5, 24 - adds r1, r5, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r6 - ldrh r0, [r4, 0x4] -_080F09E6: - adds r1, r5, 0 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F09F4: - ldr r0, [r3] - mov r2, r9 - adds r4, r7, r2 - lsls r4, 2 - adds r0, r4, r0 - ldr r5, =0x000027cc - adds r0, r5 - ldrh r0, [r0, 0x4] - lsls r2, 24 - mov r8, r2 - lsrs r6, r2, 24 - adds r1, r6, 0 - str r3, [sp, 0x4] - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r0, r4, r0 - adds r0, r5 - ldrh r0, [r0, 0x6] - adds r1, r6, 0 - bl sub_80F0B24 - ldr r3, [sp, 0x4] - ldr r0, [r3] - adds r4, r0 - adds r4, r5 - ldrb r0, [r4, 0xD] - subs r0, 0x1 - mov r6, r8 - cmp r0, 0xC - bhi _080F0AE2 - lsls r0, 2 - ldr r1, =_080F0A48 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0A48: - .4byte _080F0A7C - .4byte _080F0AA0 - .4byte _080F0AE2 - .4byte _080F0AE2 - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C - .4byte _080F0A7C -_080F0A7C: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - mov r4, r9 - adds r0, r7, r4 - lsls r0, 2 - adds r0, r1 - ldr r1, =0x000027cc - adds r0, r1 - ldrh r0, [r0, 0x8] - lsrs r1, r6, 24 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F0AA0: - ldr r2, =gSaveBlock1Ptr - ldr r0, [r2] - mov r1, r9 - adds r4, r7, r1 - lsls r4, 2 - adds r0, r4, r0 - ldr r5, =0x000027cc - adds r0, r5 - ldrh r0, [r0, 0x8] - lsrs r6, 24 - adds r1, r6, 0 - str r2, [sp] - bl sub_80F0B24 - ldr r2, [sp] - ldr r0, [r2] - adds r4, r0 - adds r4, r5 - ldrh r0, [r4, 0xA] - adds r1, r6, 0 - bl sub_80F0B24 - b _080F0AE2 - .pool -_080F0AD8: - mov r2, r9 - lsls r0, r2, 24 - lsrs r0, 24 - bl sub_80F0B00 -_080F0AE2: - mov r0, r9 - adds r0, 0x1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - cmp r0, 0x17 - bhi _080F0AF2 - b _080F0716 -_080F0AF2: - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80F0708 - - thumb_func_start sub_80F0B00 -sub_80F0B00: @ 80F0B00 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - adds r2, r1 - ldr r0, =0x000027cd - adds r2, r0 - movs r0, 0 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_80F0B00 - - thumb_func_start sub_80F0B24 -sub_80F0B24: @ 80F0B24 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - lsls r1, 24 - lsrs r4, r1, 24 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - movs r1, 0 - bl GetSetPokedexFlag - lsls r0, 24 - asrs r2, r0, 24 - cmp r2, 0 - bne _080F0B56 - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000027cd - adds r1, r0 - strb r2, [r1] -_080F0B56: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0B24 - - thumb_func_start sub_80F0B64 -sub_80F0B64: @ 80F0B64 - push {r4-r6,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0BA2 - movs r2, 0 - ldr r4, =0x000027cd - movs r3, 0 - ldr r5, =gSaveBlock1Ptr -_080F0B7C: - ldr r0, [r5] - lsls r1, r2, 3 - adds r1, r2 - lsls r1, 2 - adds r1, r0, r1 - ldr r6, =0x000027cc - adds r0, r1, r6 - ldrb r0, [r0] - cmp r0, 0x7 - beq _080F0B94 - cmp r0, 0x29 - bne _080F0B98 -_080F0B94: - adds r0, r1, r4 - strb r3, [r0] -_080F0B98: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x17 - bls _080F0B7C -_080F0BA2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0B64 - - thumb_func_start sub_80F0BB8 -sub_80F0BB8: @ 80F0BB8 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gSaveBlock1Ptr -_080F0BBE: - ldr r1, [r6] - lsls r0, r5, 3 - adds r0, r5 - lsls r4, r0, 2 - adds r1, r4 - ldr r0, =0x000027cc - adds r1, r0 - ldrb r0, [r1] - bl sub_80EFFE0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _080F0BE6 - ldr r0, [r6] - adds r0, r4 - ldr r1, =0x000027cd - adds r0, r1 - movs r1, 0 - strb r1, [r0] -_080F0BE6: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _080F0BBE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0BB8 - - thumb_func_start sub_80F0C04 -sub_80F0C04: @ 80F0C04 - push {r4,r5,lr} - movs r3, 0 - movs r2, 0x5 - ldr r0, =gSaveBlock1Ptr - ldr r4, [r0] - ldr r5, =0x000027cc -_080F0C10: - lsls r0, r2, 24 - asrs r1, r0, 24 - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r5 - ldrb r0, [r0] - cmp r0, 0 - bne _080F0C2E - lsls r0, r3, 24 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r3, r0, 24 -_080F0C2E: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x17 - ble _080F0C10 - movs r2, 0 - lsls r0, r3, 24 - asrs r0, 24 - movs r1, 0x5 - subs r0, r1, r0 - cmp r2, r0 - bge _080F0C6E - adds r5, r0, 0 -_080F0C4A: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x000027cc - adds r0, r1 - lsls r1, r2, 24 - asrs r4, r1, 24 - movs r2, 0xA0 - lsls r2, 19 - adds r1, r2 - lsrs r1, 24 - bl sub_80EF910 - adds r4, 0x1 - lsls r4, 24 - lsrs r2, r4, 24 - asrs r4, 24 - cmp r4, r5 - blt _080F0C4A -_080F0C6E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0C04 - - thumb_func_start sub_80F0C7C -sub_80F0C7C: @ 80F0C7C - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r0 - adds r7, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - movs r0, 0x80 - lsls r0, 1 - bl Alloc - adds r5, r0, 0 - cmp r5, 0 - beq _080F0D4C - movs r4, 0 -_080F0C9A: - lsls r0, r4, 6 - adds r0, r5 - adds r1, r4, 0 - muls r1, r7 - add r1, r8 - movs r2, 0x40 - bl memcpy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _080F0C9A - cmp r6, 0x1 - beq _080F0CF0 - cmp r6, 0x1 - bgt _080F0CC2 - cmp r6, 0 - beq _080F0CCC - b _080F0D3E -_080F0CC2: - cmp r6, 0x2 - beq _080F0D08 - cmp r6, 0x3 - beq _080F0D28 - b _080F0D3E -_080F0CCC: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002b50 - adds r0, r1 - adds r1, r5, 0 - adds r1, 0x40 - adds r2, r5, 0 - adds r2, 0x80 - adds r3, r5, 0 - adds r3, 0xC0 - bl sub_80F0D60 - b _080F0D3E - .pool -_080F0CF0: - ldr r0, =gSaveBlock1Ptr - ldr r1, [r0] - ldr r0, =0x00002b50 - adds r1, r0 - adds r2, r5, 0 - adds r2, 0x80 - b _080F0D14 - .pool -_080F0D08: - adds r1, r5, 0 - adds r1, 0x40 - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r0, =0x00002b50 - adds r2, r0 -_080F0D14: - adds r3, r5, 0 - adds r3, 0xC0 - adds r0, r5, 0 - bl sub_80F0D60 - b _080F0D3E - .pool -_080F0D28: - adds r1, r5, 0 - adds r1, 0x40 - adds r2, r5, 0 - adds r2, 0x80 - ldr r0, =gSaveBlock1Ptr - ldr r3, [r0] - ldr r0, =0x00002b50 - adds r3, r0 - adds r0, r5, 0 - bl sub_80F0D60 -_080F0D3E: - bl sub_80F0EEC - bl sub_80F0F24 - adds r0, r5, 0 - bl Free -_080F0D4C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0C7C - - thumb_func_start sub_80F0D60 -sub_80F0D60: @ 80F0D60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r0, [sp, 0x10] - str r1, [sp, 0x14] - str r2, [sp, 0x18] - str r3, [sp, 0x1C] - add r0, sp, 0x10 - str r0, [sp] - add r0, sp, 0x14 - str r0, [sp, 0x4] - add r0, sp, 0x18 - str r0, [sp, 0x8] - add r0, sp, 0x1C - str r0, [sp, 0xC] - bl sub_8009FCC - ldr r1, =gUnknown_03001175 - strb r0, [r1] - movs r0, 0 - mov r10, r0 -_080F0D90: - movs r7, 0 - mov r1, r10 - adds r1, 0x1 - str r1, [sp, 0x20] - b _080F0E28 - .pool -_080F0DA0: - lsls r4, r7, 2 - mov r1, sp - adds r0, r1, r4 - ldr r0, [r0] - ldr r0, [r0] - mov r1, r10 - bl sub_80F0ECC - ldr r1, =gUnknown_03001176 - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - mov r8, r4 - adds r1, r7, 0x1 - mov r9, r1 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0E22 - movs r5, 0 - ldr r1, =gUnknown_03001175 - ldrb r0, [r1] - subs r0, 0x1 - cmp r5, r0 - bge _080F0E22 - adds r6, r1, 0 -_080F0DD4: - adds r0, r7, r5 - adds r4, r0, 0x1 - ldrb r1, [r6] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - ldr r0, [r0] - bl sub_80EEE30 - ldr r1, =gUnknown_030060BC - strb r0, [r1] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - beq _080F0E14 - ldrb r1, [r6] - adds r0, r4, 0 - bl __modsi3 - lsls r0, 2 - add r0, sp - ldr r0, [r0] - mov r1, sp - add r1, r8 - ldr r1, [r1] - bl sub_80F0E58 -_080F0E14: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldrb r0, [r6] - subs r0, 0x1 - cmp r5, r0 - blt _080F0DD4 -_080F0E22: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 -_080F0E28: - ldr r0, =gUnknown_03001175 - ldrb r0, [r0] - cmp r7, r0 - bcc _080F0DA0 - ldr r1, [sp, 0x20] - lsls r0, r1, 24 - lsrs r0, 24 - mov r10, r0 - cmp r0, 0xF - bls _080F0D90 - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0D60 - - thumb_func_start sub_80F0E58 -sub_80F0E58: @ 80F0E58 - push {lr} - ldr r0, [r0] - ldr r1, [r1] - ldr r2, =gUnknown_03001176 - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - lsls r2, 2 - adds r1, r2 - ldr r2, =gUnknown_030060BC - ldrb r2, [r2] - lsls r2, 24 - asrs r2, 24 - bl sub_80F0E84 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0E58 - - thumb_func_start sub_80F0E84 -sub_80F0E84: @ 80F0E84 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r2, 24 - lsrs r6, r2, 24 - ldrb r3, [r5] - adds r0, r3, 0 - cmp r0, 0 - bne _080F0E9A -_080F0E96: - movs r0, 0 - b _080F0EC6 -_080F0E9A: - movs r1, 0 - adds r2, r3, 0 - adds r3, r0, 0 -_080F0EA0: - lsls r0, r1, 2 - adds r0, r4 - ldrb r0, [r0] - cmp r0, r3 - beq _080F0E96 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _080F0EA0 - lsls r0, r6, 24 - asrs r0, 22 - adds r0, r4 - strb r2, [r0] - movs r1, 0x1 - strb r1, [r0, 0x1] - ldrh r1, [r5, 0x2] - strh r1, [r0, 0x2] - movs r0, 0x1 -_080F0EC6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F0E84 - - thumb_func_start sub_80F0ECC -sub_80F0ECC: @ 80F0ECC - push {lr} - lsls r1, 24 - lsrs r2, r1, 24 - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080F0EE2 - lsls r0, r2, 24 - asrs r0, 24 - b _080F0EE6 -_080F0EE2: - movs r0, 0x1 - negs r0, r0 -_080F0EE6: - pop {r1} - bx r1 - thumb_func_end sub_80F0ECC - - thumb_func_start sub_80F0EEC -sub_80F0EEC: @ 80F0EEC - push {r4,lr} - movs r4, 0 -_080F0EF0: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - lsls r1, r4, 2 - adds r0, r1 - ldr r1, =0x00002b50 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bls _080F0F08 - adds r0, r4, 0 - bl sub_80EEE78 -_080F0F08: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _080F0EF0 - bl sub_80EEEB8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0EEC - - thumb_func_start sub_80F0F24 -sub_80F0F24: @ 80F0F24 - push {r4,r5,lr} - ldr r0, =0x00000864 - bl FlagGet - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080F0F50 - movs r2, 0 - ldr r5, =gSaveBlock1Ptr - ldr r4, =0x00002b51 - movs r3, 0 -_080F0F3C: - ldr r0, [r5] - lsls r1, r2, 2 - adds r0, r1 - adds r0, r4 - strb r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _080F0F3C -_080F0F50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80F0F24 - - thumb_func_start sub_80F0F64 -sub_80F0F64: @ 80F0F64 - push {r4-r7,lr} - adds r6, r0, 0 - adds r5, r1, 0 - movs r0, 0x2C - bl AllocZeroed - adds r4, r0, 0 - movs r7, 0 -_080F0F74: - lsls r0, r7, 3 - adds r1, r0, r7 - lsls r1, 2 - adds r1, r6 - ldrb r1, [r1] - subs r1, 0x1 - adds r2, r0, 0 - cmp r1, 0x28 - bls _080F0F88 - b _080F11F4 -_080F0F88: - lsls r0, r1, 2 - ldr r1, =_080F0F98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F0F98: - .4byte _080F103C - .4byte _080F103C - .4byte _080F105A - .4byte _080F11F4 - .4byte _080F1152 - .4byte _080F111E - .4byte _080F10E6 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F1092 - .4byte _080F10C6 - .4byte _080F118A - .4byte _080F11AA - .4byte _080F11CA - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11F4 - .4byte _080F11EA -_080F103C: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4] - adds r0, 0x10 - bl sub_8009228 - cmp r0, 0 - beq _080F1056 - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x18] - b _080F11F4 -_080F1056: - ldr r0, [r4] - b _080F11F2 -_080F105A: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x4] - adds r0, 0x5 - bl sub_8009228 - cmp r0, 0 - beq _080F1074 - ldr r1, [r4, 0x4] - movs r0, 0x1 - strb r0, [r1, 0xD] - b _080F1078 -_080F1074: - ldr r0, [r4, 0x4] - strb r5, [r0, 0xD] -_080F1078: - ldr r0, [r4, 0x4] - adds r0, 0x10 - bl sub_8009228 - cmp r0, 0 - beq _080F108C - ldr r1, [r4, 0x4] - movs r0, 0x1 - strb r0, [r1, 0xE] - b _080F11F4 -_080F108C: - ldr r0, [r4, 0x4] - strb r5, [r0, 0xE] - b _080F11F4 -_080F1092: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x18] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F10AC - ldr r1, [r4, 0x18] - movs r0, 0x1 - strb r0, [r1, 0x2] - b _080F10B0 -_080F10AC: - ldr r0, [r4, 0x18] - strb r5, [r0, 0x2] -_080F10B0: - ldr r0, [r4, 0x18] - adds r0, 0x4 - bl sub_8009228 - cmp r0, 0 - beq _080F10C0 - ldr r1, [r4, 0x18] - b _080F10DA -_080F10C0: - ldr r0, [r4, 0x18] - strb r5, [r0, 0x3] - b _080F11F4 -_080F10C6: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x1C] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F10E0 - ldr r1, [r4, 0x1C] -_080F10DA: - movs r0, 0x1 - strb r0, [r1, 0x3] - b _080F11F4 -_080F10E0: - ldr r0, [r4, 0x1C] - strb r5, [r0, 0x3] - b _080F11F4 -_080F10E6: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x14] - adds r0, 0x2 - bl sub_8009228 - cmp r0, 0 - beq _080F1100 - ldr r1, [r4, 0x14] - movs r0, 0x1 - strb r0, [r1, 0x1D] - b _080F1104 -_080F1100: - ldr r0, [r4, 0x14] - strb r5, [r0, 0x1D] -_080F1104: - ldr r0, [r4, 0x14] - adds r0, 0xC - bl sub_8009228 - cmp r0, 0 - beq _080F1118 - ldr r1, [r4, 0x14] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F11F4 -_080F1118: - ldr r0, [r4, 0x14] - strb r5, [r0, 0x1E] - b _080F11F4 -_080F111E: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x10] - adds r0, 0x16 - bl sub_8009228 - cmp r0, 0 - beq _080F1138 - ldr r1, [r4, 0x10] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F113C -_080F1138: - ldr r0, [r4, 0x10] - strb r5, [r0, 0x1E] -_080F113C: - ldr r0, [r4, 0x10] - adds r0, 0x8 - bl sub_8009228 - cmp r0, 0 - beq _080F114C - ldr r1, [r4, 0x10] - b _080F117E -_080F114C: - ldr r0, [r4, 0x10] - strb r5, [r0, 0x1F] - b _080F11F4 -_080F1152: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0xC] - adds r0, 0xF - bl sub_8009228 - cmp r0, 0 - beq _080F116C - ldr r1, [r4, 0xC] - movs r0, 0x1 - strb r0, [r1, 0x1E] - b _080F1170 -_080F116C: - ldr r0, [r4, 0xC] - strb r5, [r0, 0x1E] -_080F1170: - ldr r0, [r4, 0xC] - adds r0, 0x4 - bl sub_8009228 - cmp r0, 0 - beq _080F1184 - ldr r1, [r4, 0xC] -_080F117E: - movs r0, 0x1 - strb r0, [r1, 0x1F] - b _080F11F4 -_080F1184: - ldr r0, [r4, 0xC] - strb r5, [r0, 0x1F] - b _080F11F4 -_080F118A: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x8] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11A4 - ldr r1, [r4, 0x8] - movs r0, 0x1 - strb r0, [r1, 0x2] - b _080F11F4 -_080F11A4: - ldr r0, [r4, 0x8] - strb r5, [r0, 0x2] - b _080F11F4 -_080F11AA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x20] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11C4 - ldr r1, [r4, 0x20] - movs r0, 0x1 - strb r0, [r1, 0x6] - b _080F11F4 -_080F11C4: - ldr r0, [r4, 0x20] - strb r5, [r0, 0x6] - b _080F11F4 -_080F11CA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x24] - adds r0, 0x13 - bl sub_8009228 - cmp r0, 0 - beq _080F11E4 - ldr r1, [r4, 0x24] - movs r0, 0x1 - strb r0, [r1, 0xB] - b _080F11F4 -_080F11E4: - ldr r0, [r4, 0x24] - strb r5, [r0, 0xB] - b _080F11F4 -_080F11EA: - adds r0, r2, r7 - lsls r0, 2 - adds r0, r6, r0 - str r0, [r4, 0x28] -_080F11F2: - strb r5, [r0, 0x18] -_080F11F4: - adds r7, 0x1 - cmp r7, 0x17 - bgt _080F11FC - b _080F0F74 -_080F11FC: - adds r0, r4, 0 - bl Free - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80F0F64 - - thumb_func_start sub_80F1208 -sub_80F1208: @ 80F1208 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_80F14F8 - adds r4, r5, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcs _080F124C -_080F121C: - ldrb r0, [r4] - cmp r0, 0x7 - bne _080F1240 - ldrb r0, [r4, 0x1D] - cmp r0, 0x1 - bne _080F1230 - ldrb r0, [r4, 0x1E] - cmp r0, 0x1 - bne _080F1236 - b _080F1240 -_080F1230: - ldrb r0, [r4, 0x1E] - cmp r0, 0x1 - bne _080F1240 -_080F1236: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x24 - bl memset -_080F1240: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcc _080F121C -_080F124C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F1208 - - thumb_func_start sub_80F1254 -sub_80F1254: @ 80F1254 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r4, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcs _080F128A -_080F1264: - ldrb r0, [r4] - cmp r0, 0x7 - bne _080F127E - adds r0, r4, 0 - adds r0, 0xC - bl sub_8009228 - cmp r0, 0 - beq _080F127A - movs r0, 0x1 - b _080F127C -_080F127A: - movs r0, 0x2 -_080F127C: - strb r0, [r4, 0x1E] -_080F127E: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcc _080F1264 -_080F128A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F1254 - - thumb_func_start sub_80F1290 -sub_80F1290: @ 80F1290 - push {lr} - bl sub_8009228 - movs r1, 0x2 - cmp r0, 0 - beq _080F129E - movs r1, 0x1 -_080F129E: - adds r0, r1, 0 - pop {r1} - bx r1 - thumb_func_end sub_80F1290 - - thumb_func_start sub_80F12A4 -sub_80F12A4: @ 80F12A4 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r4, 0 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r4, r1 - cmp r4, r0 - bcc _080F12B6 - b _080F14F0 -_080F12B6: - ldrb r0, [r4] - subs r0, 0x1 - cmp r0, 0x28 - bls _080F12C0 - b _080F14E2 -_080F12C0: - lsls r0, 2 - ldr r1, =_080F12D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F12D0: - .4byte _080F1374 - .4byte _080F137A - .4byte _080F1380 - .4byte _080F138E - .4byte _080F139A - .4byte _080F13A8 - .4byte _080F13BE - .4byte _080F13CC - .4byte _080F13E0 - .4byte _080F13F4 - .4byte _080F1408 - .4byte _080F1416 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F14E2 - .4byte _080F142A - .4byte _080F1438 - .4byte _080F1444 - .4byte _080F1450 - .4byte _080F145C - .4byte _080F14AC - .4byte _080F1468 - .4byte _080F14B8 - .4byte _080F148C - .4byte _080F1474 - .4byte _080F14AC - .4byte _080F14B8 - .4byte _080F1480 - .4byte _080F148C - .4byte _080F1498 - .4byte _080F14AC - .4byte _080F14B8 - .4byte _080F14C4 - .4byte _080F14D8 - .4byte _080F14E2 - .4byte _080F14E2 -_080F1374: - adds r0, r4, 0 - adds r0, 0x10 - b _080F1422 -_080F137A: - adds r0, r4, 0 - adds r0, 0x10 - b _080F1422 -_080F1380: - adds r0, r4, 0x5 - bl sub_80F1290 - strb r0, [r4, 0xD] - adds r0, r4, 0 - adds r0, 0x10 - b _080F1478 -_080F138E: - adds r0, r4, 0 - adds r0, 0xB - bl sub_80F1290 - strb r0, [r4, 0x17] - b _080F14E2 -_080F139A: - adds r0, r4, 0 - adds r0, 0xF - bl sub_80F1290 - strb r0, [r4, 0x1E] - adds r0, r4, 0x4 - b _080F13B6 -_080F13A8: - adds r0, r4, 0 - adds r0, 0x16 - bl sub_80F1290 - strb r0, [r4, 0x1E] - adds r0, r4, 0 - adds r0, 0x8 -_080F13B6: - bl sub_80F1290 - strb r0, [r4, 0x1F] - b _080F14E2 -_080F13BE: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x1D] - adds r0, r4, 0 - adds r0, 0xC - b _080F13D8 -_080F13CC: - adds r0, r4, 0 - adds r0, 0x14 - bl sub_80F1290 - strb r0, [r4, 0x1D] - adds r0, r4, 0x4 -_080F13D8: - bl sub_80F1290 - strb r0, [r4, 0x1E] - b _080F14E2 -_080F13E0: - adds r0, r4, 0 - adds r0, 0xC - bl sub_80F1290 - strb r0, [r4, 0x14] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x15] - b _080F14E2 -_080F13F4: - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x19] - adds r0, r4, 0 - adds r0, 0xC - bl sub_80F1290 - strb r0, [r4, 0x1A] - b _080F14E2 -_080F1408: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x17] - adds r0, r4, 0 - adds r0, 0xC - b _080F1422 -_080F1416: - adds r0, r4, 0x2 - bl sub_80F1290 - strb r0, [r4, 0x17] - adds r0, r4, 0 - adds r0, 0xB -_080F1422: - bl sub_80F1290 - strb r0, [r4, 0x18] - b _080F14E2 -_080F142A: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x2] - adds r0, r4, 0x4 - b _080F143C -_080F1438: - adds r0, r4, 0 - adds r0, 0x13 -_080F143C: - bl sub_80F1290 - strb r0, [r4, 0x3] - b _080F14E2 -_080F1444: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x2] - b _080F14E2 -_080F1450: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x6] - b _080F14E2 -_080F145C: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xB] - b _080F14E2 -_080F1468: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x9] - b _080F14E2 -_080F1474: - adds r0, r4, 0 - adds r0, 0x13 -_080F1478: - bl sub_80F1290 - strb r0, [r4, 0xE] - b _080F14E2 -_080F1480: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x11] - b _080F14E2 -_080F148C: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x8] - b _080F14E2 -_080F1498: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xF] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x10] - b _080F14E2 -_080F14AC: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0xC] - b _080F14E2 -_080F14B8: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x5] - b _080F14E2 -_080F14C4: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x1B] - adds r0, r4, 0x4 - bl sub_80F1290 - strb r0, [r4, 0x1C] - b _080F14E2 -_080F14D8: - adds r0, r4, 0 - adds r0, 0x13 - bl sub_80F1290 - strb r0, [r4, 0x4] -_080F14E2: - adds r4, 0x24 - movs r1, 0xD8 - lsls r1, 2 - adds r0, r5, r1 - cmp r4, r0 - bcs _080F14F0 - b _080F12B6 -_080F14F0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80F12A4 - - thumb_func_start sub_80F14F8 -sub_80F14F8: @ 80F14F8 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - movs r6, 0x17 -_080F1500: - ldrb r0, [r4] - cmp r0, 0x17 - beq _080F151C - cmp r0, 0x19 - bne _080F152C - ldrb r0, [r4, 0xA] - cmp r0, 0x58 - bls _080F152C - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x24 - bl memset - b _080F152C -_080F151C: - ldrb r0, [r4, 0x12] - cmp r0, 0x58 - bls _080F152C - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x24 - bl memset -_080F152C: - adds r4, 0x24 - adds r5, 0x24 - subs r6, 0x1 - cmp r6, 0 - bge _080F1500 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80F14F8 - - thumb_func_start sub_80F153C -sub_80F153C: @ 80F153C - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x000027cd - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080F155A - b _080F16E6 -_080F155A: - subs r1, 0x1 - adds r0, r2, r1 - ldrb r0, [r0] - subs r0, 0x1 - cmp r0, 0x28 - bls _080F1568 - b _080F16E6 -_080F1568: - lsls r0, 2 - ldr r1, =_080F1584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1584: - .4byte _080F1628 - .4byte _080F162E - .4byte _080F1634 - .4byte _080F163A - .4byte _080F165E - .4byte _080F1646 - .4byte _080F164C - .4byte _080F1664 - .4byte _080F1670 - .4byte _080F166A - .4byte _080F16B8 - .4byte _080F16E2 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F16E6 - .4byte _080F1652 - .4byte _080F1658 - .4byte _080F1676 - .4byte _080F167C - .4byte _080F1682 - .4byte _080F1688 - .4byte _080F168E - .4byte _080F1694 - .4byte _080F169A - .4byte _080F16A0 - .4byte _080F16A6 - .4byte _080F16AC - .4byte _080F16B2 - .4byte _080F16BE - .4byte _080F16C4 - .4byte _080F16CA - .4byte _080F16D0 - .4byte _080F16D6 - .4byte _080F16DC - .4byte _080F16E6 - .4byte _080F1640 -_080F1628: - bl DoTVShowPokemonFanClubLetter - b _080F16E6 -_080F162E: - bl DoTVShowRecentHappenings - b _080F16E6 -_080F1634: - bl DoTVShowPokemonFanClubOpinions - b _080F16E6 -_080F163A: - bl DoTVShowDummiedOut - b _080F16E6 -_080F1640: - bl DoTVShowPokemonNewsMassOutbreak - b _080F16E6 -_080F1646: - bl DoTVShowBravoTrainerPokemonProfile - b _080F16E6 -_080F164C: - bl DoTVShowBravoTrainerBattleTower - b _080F16E6 -_080F1652: - bl DoTVShowPokemonTodaySuccessfulCapture - b _080F16E6 -_080F1658: - bl DoTVShowTodaysSmartShopper - b _080F16E6 -_080F165E: - bl DoTVShowTheNameRaterShow - b _080F16E6 -_080F1664: - bl DoTVShowPokemonContestLiveUpdates - b _080F16E6 -_080F166A: - bl DoTVShowPokemonBattleUpdate - b _080F16E6 -_080F1670: - bl DoTVShow3CheersForPokeblocks - b _080F16E6 -_080F1676: - bl DoTVShowPokemonTodayFailedCapture - b _080F16E6 -_080F167C: - bl DoTVShowPokemonAngler - b _080F16E6 -_080F1682: - bl DoTVShowTheWorldOfMasters - b _080F16E6 -_080F1688: - bl DoTVShowTodaysRivalTrainer - b _080F16E6 -_080F168E: - bl DoTVShowDewfordTrendWatcherNetwork - b _080F16E6 -_080F1694: - bl DoTVShowHoennTreasureInvestigators - b _080F16E6 -_080F169A: - bl DoTVShowFindThatGamer - b _080F16E6 -_080F16A0: - bl DoTVShowBreakingNewsTV - b _080F16E6 -_080F16A6: - bl DoTVShowSecretBaseVisit - b _080F16E6 -_080F16AC: - bl DoTVShowPokemonLotterWinnerFlashReport - b _080F16E6 -_080F16B2: - bl DoTVShowThePokemonBattleSeminar - b _080F16E6 -_080F16B8: - bl DoTVShowTrainerFanClubSpecial - b _080F16E6 -_080F16BE: - bl DoTVShowTrainerFanClub - b _080F16E6 -_080F16C4: - bl DoTVShowSpotTheCuties - b _080F16E6 -_080F16CA: - bl DoTVShowPokemonNewsBattleFrontier - b _080F16E6 -_080F16D0: - bl DoTVShowWhatsNo1InHoennToday - b _080F16E6 -_080F16D6: - bl DoTVShowSecretBaseSecrets - b _080F16E6 -_080F16DC: - bl DoTVShowSafariFanClub - b _080F16E6 -_080F16E2: - bl DoTVShowPokemonContestLiveUpdates2 -_080F16E6: - pop {r0} - bx r0 - thumb_func_end sub_80F153C - - thumb_func_start DoTVShowBravoTrainerPokemonProfile -DoTVShowBravoTrainerPokemonProfile: @ 80F16EC - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x8 - bls _080F1712 - b _080F1952 -_080F1712: - lsls r0, r5, 2 - ldr r1, =_080F1734 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1734: - .4byte _080F1758 - .4byte _080F17B0 - .4byte _080F17E8 - .4byte _080F1818 - .4byte _080F184C - .4byte _080F1880 - .4byte _080F18C4 - .4byte _080F190C - .4byte _080F193C -_080F1758: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - ldrb r1, [r4, 0x13] - lsls r1, 27 - lsrs r1, 30 - movs r0, 0x2 - bl sub_80EF1BC - ldrh r1, [r4, 0x2] - movs r0, 0xB - muls r0, r1 - ldr r1, =gSpeciesNames - adds r0, r1 - adds r1, r4, 0 - adds r1, 0x8 - bl StringCompare - cmp r0, 0 - bne _080F17A4 - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - b _080F1950 - .pool -_080F17A4: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - b _080F1950 - .pool -_080F17B0: - ldr r0, =gStringVar1 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0x8 - ldrb r2, [r4, 0x1F] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x2 - bl CopyContestCategoryToStringVar - b _080F194C - .pool -_080F17E8: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - bne _080F180C - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - b _080F1950 - .pool -_080F180C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - b _080F1950 - .pool -_080F1818: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldrb r1, [r4, 0x13] - lsls r1, 25 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - b _080F1950 - .pool -_080F184C: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldrb r1, [r4, 0x13] - lsls r1, 25 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - b _080F1950 - .pool -_080F1880: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrb r1, [r4, 0x13] - lsls r1, 29 - lsrs r1, 29 - movs r0, 0x1 - bl CopyContestCategoryToStringVar - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrh r0, [r4, 0x14] - cmp r0, 0 - beq _080F18B8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - b _080F1950 - .pool -_080F18B8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - b _080F1950 - .pool -_080F18C4: - ldr r0, =gStringVar1 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - b _080F1950 - .pool -_080F190C: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x16 - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone - b _080F1952 - .pool -_080F193C: - ldr r0, =gStringVar1 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy -_080F194C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 -_080F1950: - strb r0, [r1] -_080F1952: - ldr r0, =gUnknown_0858D204 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBravoTrainerPokemonProfile - - thumb_func_start DoTVShowBravoTrainerBattleTower -DoTVShowBravoTrainerBattleTower: @ 80F1974 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xE - bls _080F199C - b _080F1BEA -_080F199C: - lsls r0, r5, 2 - ldr r1, =_080F19C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F19C0: - .4byte _080F19FC - .4byte _080F1A40 - .4byte _080F1A90 - .4byte _080F1AB4 - .4byte _080F1AE0 - .4byte _080F1B28 - .4byte _080F1B38 - .4byte _080F1B48 - .4byte _080F1B4E - .4byte _080F1B4E - .4byte _080F1B4E - .4byte _080F1B68 - .4byte _080F1B94 - .4byte _080F1B94 - .4byte _080F1BCC -_080F19FC: - ldr r0, =gStringVar1 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrh r0, [r4, 0x16] - cmp r0, 0x6 - bls _080F1A34 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A34: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A40: - ldrb r0, [r4, 0x1A] - cmp r0, 0x32 - bne _080F1A58 - ldr r0, =gStringVar1 - ldr r1, =gText_Lv50 - bl StringCopy - b _080F1A60 - .pool -_080F1A58: - ldr r0, =gStringVar1 - ldr r1, =gText_OpenLevel - bl StringCopy -_080F1A60: - ldrh r1, [r4, 0x16] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x1C] - cmp r0, 0x1 - bne _080F1A84 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A84: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F1BEA - .pool -_080F1A90: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldrh r1, [r4, 0x16] - adds r1, 0x1 - movs r0, 0x1 - bl sub_80EF340 -_080F1AA6: - ldrb r0, [r4, 0x1B] - cmp r0, 0 - beq _080F1B02 - b _080F1B1C - .pool -_080F1AB4: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x14] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - b _080F1AA6 - .pool -_080F1AE0: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x14] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _080F1B1C -_080F1B02: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F1BEA - .pool -_080F1B1C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F1BEA - .pool -_080F1B28: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - b _080F1B54 - .pool -_080F1B38: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - b _080F1B54 - .pool -_080F1B48: - movs r0, 0xB - strb r0, [r2] - b _080F1BEA -_080F1B4E: - ldr r0, =gStringVar1 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] -_080F1B54: - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F1BEA - .pool -_080F1B68: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x18] - bl CopyEasyChatWord - ldrb r0, [r4, 0x1B] - cmp r0, 0 - bne _080F1B88 - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F1BEA - .pool -_080F1B88: - ldr r1, =gUnknown_0203A030 - movs r0, 0xD - strb r0, [r1] - b _080F1BEA - .pool -_080F1B94: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x18] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1E] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0xE - strb r0, [r1] - b _080F1BEA - .pool -_080F1BCC: - ldr r0, =gStringVar1 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x1D] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone -_080F1BEA: - ldr r0, =gUnknown_0858D240 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBravoTrainerBattleTower - - thumb_func_start DoTVShowTodaysSmartShopper -DoTVShowTodaysSmartShopper: @ 80F1C0C - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xC - bls _080F1C34 - b _080F1E2C -_080F1C34: - lsls r0, r6, 2 - ldr r1, =_080F1C58 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1C58: - .4byte _080F1C8C - .4byte _080F1CC8 - .4byte _080F1D10 - .4byte _080F1D22 - .4byte _080F1D10 - .4byte _080F1D10 - .4byte _080F1D4C - .4byte _080F1D7C - .4byte _080F1DAC - .4byte _080F1DB8 - .4byte _080F1DC6 - .4byte _080F1DD8 - .4byte _080F1E1C -_080F1C8C: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrb r1, [r5, 0x12] - movs r2, 0 - bl GetMapName - ldrh r0, [r5, 0xC] - cmp r0, 0xFE - bls _080F1CBC - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F1E2C - .pool -_080F1CBC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F1E2C - .pool -_080F1CC8: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =gStringVar2 - ldrh r0, [r5, 0x6] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrh r1, [r5, 0xC] - movs r0, 0x2 - bl sub_80EF340 - ldr r4, =gUnknown_0203A030 - bl Random - ldrb r2, [r4] - adds r2, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, r2 - strb r0, [r4] - b _080F1E2C - .pool -_080F1D10: - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _080F1D1C - movs r0, 0x6 - strb r0, [r2] - b _080F1E2C -_080F1D1C: - movs r0, 0xA - strb r0, [r2] - b _080F1E2C -_080F1D22: - ldrh r1, [r5, 0xC] - adds r1, 0x1 - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0x8] - cmp r0, 0 - beq _080F1D40 - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F1E2C - .pool -_080F1D40: - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F1E2C - .pool -_080F1D4C: - ldr r4, =gStringVar2 - ldrh r0, [r5, 0x8] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrh r1, [r5, 0xE] - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0xA] - cmp r0, 0 - beq _080F1D94 - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F1E2C - .pool -_080F1D7C: - ldr r4, =gStringVar2 - ldrh r0, [r5, 0xA] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrh r1, [r5, 0x10] - movs r0, 0x2 - bl sub_80EF340 -_080F1D94: - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - beq _080F1DFA - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F1E2C - .pool -_080F1DAC: - ldrh r0, [r5, 0xC] - cmp r0, 0xFE - bls _080F1DD2 - movs r0, 0xC - strb r0, [r2] - b _080F1E2C -_080F1DB8: - movs r0, 0x1 - adds r1, r5, 0 - bl sub_80EF40C - bl TVShowDone - b _080F1E2C -_080F1DC6: - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - bne _080F1DD2 - movs r0, 0x8 - strb r0, [r2] - b _080F1E2C -_080F1DD2: - movs r0, 0x9 - strb r0, [r2] - b _080F1E2C -_080F1DD8: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =gStringVar2 - ldrh r0, [r5, 0x6] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrb r0, [r5, 0x2] - cmp r0, 0x1 - bne _080F1E10 -_080F1DFA: - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F1E2C - .pool -_080F1E10: - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F1E2C - .pool -_080F1E1C: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - bl TVShowDone -_080F1E2C: - ldr r0, =gUnknown_0858D1D0 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTodaysSmartShopper - - thumb_func_start DoTVShowTheNameRaterShow -DoTVShowTheNameRaterShow: @ 80F1E48 - push {r4-r6,lr} - sub sp, 0x8 - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0x12 - bls _080F1E72 - b _080F20FE -_080F1E72: - lsls r0, r6, 2 - ldr r1, =_080F1E94 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F1E94: - .4byte _080F1EE0 - .4byte _080F1F28 - .4byte _080F1F4A - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F28 - .4byte _080F1F90 - .4byte _080F1F90 - .4byte _080F1F90 - .4byte _080F20EC - .4byte _080F1FCC - .4byte _080F200C - .4byte _080F202C - .4byte _080F2074 - .4byte _080F20A4 - .4byte _080F20F0 -_080F1EE0: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - ldr r4, =gUnknown_0203A030 - adds r0, r5, 0 - bl sub_80EFBA4 - adds r0, 0x1 - strb r0, [r4] - b _080F20FE - .pool -_080F1F28: - ldrb r0, [r5, 0x1A] - cmp r0, 0 - bne _080F1F34 - movs r0, 0x9 - strb r0, [r2] - b _080F20FE -_080F1F34: - cmp r0, 0x1 - bne _080F1F3E - movs r0, 0xA - strb r0, [r2] - b _080F20FE -_080F1F3E: - cmp r0, 0x2 - beq _080F1F44 - b _080F20FE -_080F1F44: - movs r0, 0xB - strb r0, [r2] - b _080F20FE -_080F1F4A: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - ldrb r0, [r5, 0x1A] - cmp r0, 0 - bne _080F1F6C - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F20FE - .pool -_080F1F6C: - cmp r0, 0x1 - bne _080F1F7C - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F20FE - .pool -_080F1F7C: - cmp r0, 0x2 - beq _080F1F82 - b _080F20FE -_080F1F82: - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F20FE - .pool -_080F1F90: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F20FE - .pool -_080F1FCC: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0xF - ldrb r2, [r5, 0x1E] - bl sub_81DB5E8 - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0x2 - movs r3, 0 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =gUnknown_0203A030 - movs r0, 0xE - strb r0, [r1] - b _080F20FE - .pool -_080F200C: - movs r4, 0 - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - str r4, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0 - b _080F20D2 -_080F202C: - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrh r0, [r5, 0x2] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 - bl sub_80EFBDC - ldr r1, =gUnknown_0203A030 - movs r0, 0x10 - strb r0, [r1] - b _080F20FE - .pool -_080F2074: - ldrh r0, [r5, 0x2] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x2 - bl sub_80EFBDC - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x1 - bl sub_80EFBDC - ldr r1, =gUnknown_0203A030 - movs r0, 0x11 - strb r0, [r1] - b _080F20FE - .pool -_080F20A4: - movs r0, 0 - str r0, [sp] - str r5, [sp, 0x4] - movs r1, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_80EFBDC - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x1C] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrh r0, [r5, 0x1C] - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x3 - movs r3, 0x2 -_080F20D2: - bl sub_80EFBDC - ldr r1, =gUnknown_0203A030 - movs r0, 0x12 - strb r0, [r1] - b _080F20FE - .pool -_080F20EC: - movs r6, 0x12 - strb r6, [r2] -_080F20F0: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1F] - bl sub_81DB5E8 - bl TVShowDone -_080F20FE: - ldr r0, =gUnknown_0858D338 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTheNameRaterShow - - thumb_func_start DoTVShowPokemonTodaySuccessfulCapture -DoTVShowPokemonTodaySuccessfulCapture: @ 80F211C - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xB - bls _080F2144 - b _080F2358 -_080F2144: - lsls r0, r6, 2 - ldr r1, =_080F2168 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2168: - .4byte _080F2198 - .4byte _080F21EC - .4byte _080F21F2 - .4byte _080F222C - .4byte _080F2264 - .4byte _080F226A - .4byte _080F22A0 - .4byte _080F22F4 - .4byte _080F22F4 - .4byte _080F2324 - .4byte _080F2324 - .4byte _080F2354 -_080F2198: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldrb r0, [r5, 0xF] - cmp r0, 0x1 - bne _080F21E0 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F2358 - .pool -_080F21E0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F2358 - .pool -_080F21EC: - movs r0, 0x2 - strb r0, [r2] - b _080F2358 -_080F21F2: - ldr r4, =gStringVar2 - ldrb r0, [r5, 0xF] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrb r1, [r5, 0x12] - movs r0, 0x2 - bl sub_80EF340 - ldrb r0, [r5, 0x12] - cmp r0, 0x3 - bhi _080F2220 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F2358 - .pool -_080F2220: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F2358 - .pool -_080F222C: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - b _080F2286 - .pool -_080F2264: - movs r0, 0x6 - strb r0, [r2] - b _080F2358 -_080F226A: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy -_080F2286: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F2358 - .pool -_080F22A0: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x10] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldr r4, =gUnknown_0203A030 - bl Random - ldrb r2, [r4] - adds r2, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, r2 - strb r0, [r4] - b _080F2358 - .pool -_080F22F4: - ldr r0, =gStringVar1 - ldrh r1, [r5, 0x10] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 - ldrh r1, [r5, 0x10] - movs r0, 0x2 - bl sub_80EF9E8 - b _080F233E - .pool -_080F2324: - ldr r0, =gStringVar1 - ldrh r1, [r5, 0x10] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x3] - bl sub_81DB5E8 -_080F233E: - ldr r0, =gUnknown_0203A030 - strb r4, [r0] - b _080F2358 - .pool -_080F2354: - bl TVShowDone -_080F2358: - ldr r0, =gUnknown_0858D1A0 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonTodaySuccessfulCapture - - thumb_func_start DoTVShowPokemonTodayFailedCapture -DoTVShowPokemonTodayFailedCapture: @ 80F2370 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x6 - bls _080F2396 - b _080F24C0 -_080F2396: - lsls r0, r5, 2 - ldr r1, =_080F23B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F23B8: - .4byte _080F23D4 - .4byte _080F2408 - .4byte _080F245C - .4byte _080F245C - .4byte _080F24A0 - .4byte _080F24A0 - .4byte _080F24BC -_080F23D4: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F24C0 - .pool -_080F2408: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrb r1, [r4, 0x12] - movs r2, 0 - bl GetMapName - ldr r0, =gStringVar3 - ldrh r2, [r4, 0xE] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r0, [r4, 0x11] - cmp r0, 0x1 - bne _080F2450 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F24C0 - .pool -_080F2450: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F24C0 - .pool -_080F245C: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldrb r1, [r4, 0x10] - movs r0, 0x1 - bl sub_80EF340 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _080F2494 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F24C0 - .pool -_080F2494: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F24C0 - .pool -_080F24A0: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x2] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F24C0 - .pool -_080F24BC: - bl TVShowDone -_080F24C0: - ldr r0, =gUnknown_0858D394 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonTodayFailedCapture - - thumb_func_start DoTVShowPokemonFanClubLetter -DoTVShowPokemonFanClubLetter: @ 80F24D8 - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - adds r6, r0, 0 - cmp r7, 0x33 - bls _080F2500 - b _080F26F0 -_080F2500: - lsls r0, r7, 2 - ldr r1, =_080F2524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2524: - .4byte _080F25F4 - .4byte _080F2628 - .4byte _080F2654 - .4byte _080F265A - .4byte _080F2672 - .4byte _080F2672 - .4byte _080F2672 - .4byte _080F2684 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26F0 - .4byte _080F26A6 - .4byte _080F26CC -_080F25F4: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x10 - ldrb r2, [r5, 0x18] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x32 - strb r0, [r1] - b _080F26F0 - .pool -_080F2628: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r2, r0, 0x1 - cmp r2, 0x1 - bne _080F2648 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F26F0 - .pool -_080F2648: - ldr r1, =gUnknown_0203A030 - adds r0, r2, 0x2 - strb r0, [r1] - b _080F26F0 - .pool -_080F2654: - movs r0, 0x33 - strb r0, [r6] - b _080F26F0 -_080F265A: - bl Random - ldrb r4, [r6] - adds r4, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, r4 - strb r0, [r6] - b _080F26F0 -_080F2672: - adds r0, r5, 0 - bl sub_80EFB58 - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F26F0 - .pool -_080F2684: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x1F - bl __umodsi3 - adds r0, 0x46 - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0x2 - adds r1, r2, 0 - bl sub_80EF340 - bl TVShowDone - b _080F26F0 -_080F26A6: - ldr r4, =gStringVar4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F26FC - .pool -_080F26CC: - ldr r4, =gStringVar4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F26FC - .pool -_080F26F0: - ldr r0, =gUnknown_0858D150 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_080F26FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonFanClubLetter - - thumb_func_start DoTVShowRecentHappenings -DoTVShowRecentHappenings: @ 80F2708 - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - adds r7, r0, 0 - cmp r6, 0x32 - bls _080F2730 - b _080F288C -_080F2730: - lsls r0, r6, 2 - ldr r1, =_080F2754 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2754: - .4byte _080F2820 - .4byte _080F2844 - .4byte _080F285C - .4byte _080F285C - .4byte _080F285C - .4byte _080F2862 - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F288C - .4byte _080F2868 -_080F2820: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x10 - ldrb r2, [r5, 0x18] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80EFB58 - ldr r1, =gUnknown_0203A030 - movs r0, 0x32 - strb r0, [r1] - b _080F288C - .pool -_080F2844: - bl Random - ldrb r4, [r7] - adds r4, 0x1 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - adds r0, r4 - strb r0, [r7] - b _080F288C -_080F285C: - movs r0, 0x5 - strb r0, [r7] - b _080F288C -_080F2862: - bl TVShowDone - b _080F288C -_080F2868: - ldr r4, =gStringVar4 - adds r1, r5, 0x4 - adds r0, r4, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertEasyChatWordsToString - adds r0, r4, 0 - bl box_related_two__2 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F2898 - .pool -_080F288C: - ldr r0, =gUnknown_0858D170 - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 -_080F2898: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowRecentHappenings - - thumb_func_start DoTVShowPokemonFanClubOpinions -DoTVShowPokemonFanClubOpinions: @ 80F28A4 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r6, =gUnknown_0203A030 - ldrb r5, [r6] - cmp r5, 0x3 - bgt _080F28E8 - cmp r5, 0x1 - bge _080F2930 - cmp r5, 0 - beq _080F28EE - b _080F297E - .pool -_080F28E8: - cmp r5, 0x4 - beq _080F2968 - b _080F297E -_080F28EE: - ldr r0, =gStringVar1 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0x10 - ldrb r2, [r4, 0xE] - bl sub_81DB5E8 - ldrb r0, [r4, 0x4] - lsrs r0, 4 - adds r0, 0x1 - strb r0, [r6] - b _080F297E - .pool -_080F2930: - ldr r0, =gStringVar1 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x1C] - bl CopyEasyChatWord - movs r0, 0x4 - strb r0, [r6] - b _080F297E - .pool -_080F2968: - ldr r0, =gStringVar1 - adds r1, r4, 0x5 - ldrb r2, [r4, 0xD] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x1E] - bl CopyEasyChatWord - bl TVShowDone -_080F297E: - ldr r0, =gUnknown_0858D188 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonFanClubOpinions - - thumb_func_start DoTVShowDummiedOut -DoTVShowDummiedOut: @ 80F299C - bx lr - thumb_func_end DoTVShowDummiedOut - - thumb_func_start DoTVShowPokemonNewsMassOutbreak -DoTVShowPokemonNewsMassOutbreak: @ 80F29A0 - push {r4,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r4, [r2] - adds r4, r0 - ldr r0, =gStringVar1 - ldrb r1, [r4, 0x10] - movs r2, 0 - bl GetMapName - ldr r0, =gStringVar2 - ldrh r2, [r4, 0xC] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone - bl StartMassOutbreak - ldr r1, =gUnknown_0858D19C - ldr r0, =gUnknown_0203A030 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonNewsMassOutbreak - - thumb_func_start DoTVShowPokemonContestLiveUpdates -DoTVShowPokemonContestLiveUpdates: @ 80F2A10 - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x20 - bls _080F2A38 - b _080F311C -_080F2A38: - lsls r0, r7, 2 - ldr r1, =_080F2A5C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2A5C: - .4byte _080F2AE0 - .4byte _080F2B54 - .4byte _080F2BA2 - .4byte _080F2BC8 - .4byte _080F2BF4 - .4byte _080F2D2C - .4byte _080F2D40 - .4byte _080F2D54 - .4byte _080F2D68 - .4byte _080F2DE8 - .4byte _080F2DFC - .4byte _080F2E10 - .4byte _080F2E24 - .4byte _080F2E38 - .4byte _080F2E4C - .4byte _080F2ECC - .4byte _080F2EE0 - .4byte _080F2EF4 - .4byte _080F2F08 - .4byte _080F2F1C - .4byte _080F2F30 - .4byte _080F2F44 - .4byte _080F2F58 - .4byte _080F2F94 - .4byte _080F3064 - .4byte _080F3080 - .4byte _080F30E0 - .4byte _080F30E0 - .4byte _080F30A8 - .4byte _080F30AE - .4byte _080F30E0 - .4byte _080F30E0 - .4byte _080F30FC -_080F2AE0: - ldr r0, =gStringVar1 - ldrb r1, [r6, 0x1C] - bl sub_818E868 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldrb r0, [r6, 0xD] - ldrb r1, [r6, 0xE] - cmp r0, r1 - bne _080F2B38 - cmp r0, 0 - bne _080F2B2C - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F311C - .pool -_080F2B2C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F311C - .pool -_080F2B38: - cmp r0, r1 - bls _080F2B48 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F311C - .pool -_080F2B48: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F311C - .pool -_080F2B54: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - bne _080F2B6C - b _080F2CF0 -_080F2B6C: - cmp r1, 0x8 - bgt _080F2B88 -_080F2B70: - cmp r1, 0x2 - bne _080F2B76 - b _080F2CD8 -_080F2B76: - cmp r1, 0x2 - bgt _080F2B7C - b _080F2C96 -_080F2B7C: - b _080F2CAC - .pool -_080F2B88: - cmp r1, 0x20 - bne _080F2B8E - b _080F2D08 -_080F2B8E: - cmp r1, 0x20 - bgt _080F2B94 - b _080F2CBA -_080F2B94: - cmp r1, 0x40 - bne _080F2B9A - b _080F2D14 -_080F2B9A: - cmp r1, 0x80 - beq _080F2BA0 - b _080F311C -_080F2BA0: - b _080F2D20 -_080F2BA2: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy -_080F2BB2: - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - bne _080F2BBA - b _080F2CF0 -_080F2BBA: - cmp r1, 0x8 - ble _080F2B70 - b _080F2B88 - .pool -_080F2BC8: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - b _080F2BB2 - .pool -_080F2BF4: - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bhi _080F2C74 - lsls r0, 2 - ldr r1, =_080F2C08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2C08: - .4byte _080F2C1C - .4byte _080F2C30 - .4byte _080F2C44 - .4byte _080F2C58 - .4byte _080F2C6C -_080F2C1C: - ldr r0, =gStringVar1 - ldr r1, =gText_Cool - bl StringCopy - b _080F2C74 - .pool -_080F2C30: - ldr r0, =gStringVar1 - ldr r1, =gText_Beauty - bl StringCopy - b _080F2C74 - .pool -_080F2C44: - ldr r0, =gStringVar1 - ldr r1, =gText_Cute - bl StringCopy - b _080F2C74 - .pool -_080F2C58: - ldr r0, =gStringVar1 - ldr r1, =gText_Smart - bl StringCopy - b _080F2C74 - .pool -_080F2C6C: - ldr r0, =gStringVar1 - ldr r1, =gText_Tough - bl StringCopy -_080F2C74: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r1, [r6, 0xF] - cmp r1, 0x8 - beq _080F2CF0 - cmp r1, 0x8 - bgt _080F2CB2 - cmp r1, 0x2 - beq _080F2CD8 - cmp r1, 0x2 - bgt _080F2CAC -_080F2C96: - cmp r1, 0x1 - beq _080F2CCA - b _080F311C - .pool -_080F2CAC: - cmp r1, 0x4 - beq _080F2CE4 - b _080F311C -_080F2CB2: - cmp r1, 0x20 - beq _080F2D08 - cmp r1, 0x20 - bgt _080F2CC0 -_080F2CBA: - cmp r1, 0x10 - beq _080F2CFC - b _080F311C -_080F2CC0: - cmp r1, 0x40 - beq _080F2D14 - cmp r1, 0x80 - beq _080F2D20 - b _080F311C -_080F2CCA: - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F311C - .pool -_080F2CD8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F311C - .pool -_080F2CE4: - ldr r1, =gUnknown_0203A030 - movs r0, 0xE - strb r0, [r1] - b _080F311C - .pool -_080F2CF0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F311C - .pool -_080F2CFC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F311C - .pool -_080F2D08: - ldr r1, =gUnknown_0203A030 - movs r0, 0x14 - strb r0, [r1] - b _080F311C - .pool -_080F2D14: - ldr r1, =gUnknown_0203A030 - movs r0, 0x15 - strb r0, [r1] - b _080F311C - .pool -_080F2D20: - ldr r1, =gUnknown_0203A030 - movs r0, 0x16 - strb r0, [r1] - b _080F311C - .pool -_080F2D2C: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D40: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D54: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2D68: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bls _080F2D80 - b _080F311C -_080F2D80: - lsls r0, 2 - ldr r1, =_080F2D98 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2D98: - .4byte _080F2DAC - .4byte _080F2DB8 - .4byte _080F2DC4 - .4byte _080F2DD0 - .4byte _080F2DDC -_080F2DAC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F311C - .pool -_080F2DB8: - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F311C - .pool -_080F2DC4: - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F311C - .pool -_080F2DD0: - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F311C - .pool -_080F2DDC: - ldr r1, =gUnknown_0203A030 - movs r0, 0xD - strb r0, [r1] - b _080F311C - .pool -_080F2DE8: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2DFC: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E10: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E24: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E38: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2E4C: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r0, [r6, 0x1C] - cmp r0, 0x4 - bls _080F2E64 - b _080F311C -_080F2E64: - lsls r0, 2 - ldr r1, =_080F2E7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F2E7C: - .4byte _080F2E90 - .4byte _080F2E9C - .4byte _080F2EA8 - .4byte _080F2EB4 - .4byte _080F2EC0 -_080F2E90: - ldr r1, =gUnknown_0203A030 - movs r0, 0xF - strb r0, [r1] - b _080F311C - .pool -_080F2E9C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x10 - strb r0, [r1] - b _080F311C - .pool -_080F2EA8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x11 - strb r0, [r1] - b _080F311C - .pool -_080F2EB4: - ldr r1, =gUnknown_0203A030 - movs r0, 0x12 - strb r0, [r1] - b _080F311C - .pool -_080F2EC0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x13 - strb r0, [r1] - b _080F311C - .pool -_080F2ECC: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2EE0: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2EF4: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F08: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F1C: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F30: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F44: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - b _080F2F72 - .pool -_080F2F58: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r2, [r6, 0x10] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames -_080F2F72: - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x17 - strb r0, [r1] - b _080F311C - .pool -_080F2F94: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x12] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrh r1, [r6, 0x2] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldrb r0, [r6, 0xC] - cmp r0, 0x8 - beq _080F3028 - cmp r0, 0x8 - bgt _080F2FEA - cmp r0, 0x2 - beq _080F3010 - cmp r0, 0x2 - bgt _080F2FE4 - cmp r0, 0x1 - beq _080F3002 - b _080F311C - .pool -_080F2FE4: - cmp r0, 0x4 - beq _080F301C - b _080F311C -_080F2FEA: - cmp r0, 0x20 - beq _080F3040 - cmp r0, 0x20 - bgt _080F2FF8 - cmp r0, 0x10 - beq _080F3034 - b _080F311C -_080F2FF8: - cmp r0, 0x40 - beq _080F304C - cmp r0, 0x80 - beq _080F3058 - b _080F311C -_080F3002: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1F - strb r0, [r1] - b _080F311C - .pool -_080F3010: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1E - strb r0, [r1] - b _080F311C - .pool -_080F301C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1D - strb r0, [r1] - b _080F311C - .pool -_080F3028: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1C - strb r0, [r1] - b _080F311C - .pool -_080F3034: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1B - strb r0, [r1] - b _080F311C - .pool -_080F3040: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1A - strb r0, [r1] - b _080F311C - .pool -_080F304C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x19 - strb r0, [r1] - b _080F311C - .pool -_080F3058: - ldr r1, =gUnknown_0203A030 - movs r0, 0x18 - strb r0, [r1] - b _080F311C - .pool -_080F3064: - ldr r0, =gStringVar1 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - b _080F30EA - .pool -_080F3080: - ldr r0, =gStringVar1 - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - b _080F30EA - .pool -_080F30A8: - movs r0, 0x20 - strb r0, [r2] - b _080F311C -_080F30AE: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - b _080F30E2 - .pool -_080F30E0: - ldr r0, =gStringVar1 -_080F30E2: - adds r1, r6, 0x4 - ldrb r2, [r6, 0x1E] - bl sub_81DB5E8 -_080F30EA: - ldr r1, =gUnknown_0203A030 - movs r0, 0x20 - strb r0, [r1] - b _080F311C - .pool -_080F30FC: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x14 - ldrb r2, [r6, 0x1D] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x12] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone -_080F311C: - ldr r0, =gUnknown_0858D27C - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonContestLiveUpdates - - thumb_func_start DoTVShowPokemonBattleUpdate -DoTVShowPokemonBattleUpdate: @ 80F3140 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0x7 - bls _080F3168 - b _080F3362 -_080F3168: - lsls r0, r5, 2 - ldr r1, =_080F318C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F318C: - .4byte _080F31AC - .4byte _080F31CA - .4byte _080F321C - .4byte _080F3268 - .4byte _080F329C - .4byte _080F32C0 - .4byte _080F32EC - .4byte _080F3338 -_080F31AC: - ldrb r1, [r4, 0x18] - cmp r1, 0 - bge _080F31B4 - b _080F3362 -_080F31B4: - cmp r1, 0x1 - ble _080F31BE - cmp r1, 0x2 - beq _080F31C4 - b _080F3362 -_080F31BE: - movs r0, 0x1 - strb r0, [r2] - b _080F3362 -_080F31C4: - movs r0, 0x5 - strb r0, [r2] - b _080F3362 -_080F31CA: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldrb r0, [r4, 0x18] - cmp r0, 0 - bne _080F3200 - ldr r0, =gStringVar3 - ldr r1, =gText_Single - bl StringCopy - b _080F3208 - .pool -_080F3200: - ldr r0, =gStringVar3 - ldr r1, =gText_Double - bl StringCopy -_080F3208: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F3362 - .pool -_080F321C: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x16] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F3362 - .pool -_080F3268: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F3362 - .pool -_080F329C: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - bl TVShowDone - b _080F3362 - .pool -_080F32C0: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F3362 - .pool -_080F32EC: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x16] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r2, [r4, 0x14] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F3362 - .pool -_080F3338: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x19] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x1A] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrh r2, [r4, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone -_080F3362: - ldr r0, =gUnknown_0858D300 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonBattleUpdate - - thumb_func_start DoTVShow3CheersForPokeblocks -DoTVShow3CheersForPokeblocks: @ 80F3388 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x5 - bls _080F33AE - b _080F3624 -_080F33AE: - lsls r0, r5, 2 - ldr r1, =_080F33D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F33D0: - .4byte _080F33E8 - .4byte _080F3418 - .4byte _080F3500 - .4byte _080F350C - .4byte _080F35F4 - .4byte _080F3620 -_080F33E8: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldrb r0, [r4, 0x2] - cmp r0, 0x14 - bls _080F340C - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F3624 - .pool -_080F340C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F3624 - .pool -_080F3418: - ldrb r0, [r4, 0x3] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0x4 - bhi _080F349C - lsls r0, 2 - ldr r1, =_080F3430 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3430: - .4byte _080F3444 - .4byte _080F3458 - .4byte _080F346C - .4byte _080F3480 - .4byte _080F3494 -_080F3444: - ldr r0, =gStringVar1 - ldr r1, =gText_Spicy2 - bl StringCopy - b _080F349C - .pool -_080F3458: - ldr r0, =gStringVar1 - ldr r1, =gText_Dry2 - bl StringCopy - b _080F349C - .pool -_080F346C: - ldr r0, =gStringVar1 - ldr r1, =gText_Sweet2 - bl StringCopy - b _080F349C - .pool -_080F3480: - ldr r0, =gStringVar1 - ldr r1, =gText_Bitter2 - bl StringCopy - b _080F349C - .pool -_080F3494: - ldr r0, =gStringVar1 - ldr r1, =gText_Sour2 - bl StringCopy -_080F349C: - ldrb r0, [r4, 0x2] - cmp r0, 0x18 - bls _080F34BC - ldr r0, =gStringVar2 - ldr r1, =gText_Excellent - bl StringCopy - b _080F34DC - .pool -_080F34BC: - cmp r0, 0x16 - bls _080F34D4 - ldr r0, =gStringVar2 - ldr r1, =gText_VeryGood - bl StringCopy - b _080F34DC - .pool -_080F34D4: - ldr r0, =gStringVar2 - ldr r1, =gText_Good - bl StringCopy -_080F34DC: - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F3624 - .pool -_080F3500: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x15] - b _080F3606 - .pool -_080F350C: - ldrb r0, [r4, 0x3] - lsls r0, 29 - lsrs r0, 29 - cmp r0, 0x4 - bhi _080F3590 - lsls r0, 2 - ldr r1, =_080F3524 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3524: - .4byte _080F3538 - .4byte _080F354C - .4byte _080F3560 - .4byte _080F3574 - .4byte _080F3588 -_080F3538: - ldr r0, =gStringVar1 - ldr r1, =gText_Spicy2 - bl StringCopy - b _080F3590 - .pool -_080F354C: - ldr r0, =gStringVar1 - ldr r1, =gText_Dry2 - bl StringCopy - b _080F3590 - .pool -_080F3560: - ldr r0, =gStringVar1 - ldr r1, =gText_Sweet2 - bl StringCopy - b _080F3590 - .pool -_080F3574: - ldr r0, =gStringVar1 - ldr r1, =gText_Bitter2 - bl StringCopy - b _080F3590 - .pool -_080F3588: - ldr r0, =gStringVar1 - ldr r1, =gText_Sour2 - bl StringCopy -_080F3590: - ldrb r0, [r4, 0x2] - cmp r0, 0x10 - bls _080F35B0 - ldr r0, =gStringVar2 - ldr r1, =gText_SoSo - bl StringCopy - b _080F35D0 - .pool -_080F35B0: - cmp r0, 0xD - bls _080F35C8 - ldr r0, =gStringVar2 - ldr r1, =gText_Bad - bl StringCopy - b _080F35D0 - .pool -_080F35C8: - ldr r0, =gStringVar2 - ldr r1, =gText_TheWorst - bl StringCopy -_080F35D0: - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F3624 - .pool -_080F35F4: - ldr r0, =gStringVar1 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x15] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x14] -_080F3606: - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F3624 - .pool -_080F3620: - bl TVShowDone -_080F3624: - ldr r0, =gUnknown_0858D228 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShow3CheersForPokeblocks - - thumb_func_start DoTVShowInSearchOfTrainers -DoTVShowInSearchOfTrainers: @ 80F363C - push {r4-r7,lr} - ldr r0, =gScriptResult - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x8 - bls _080F3650 - b _080F37EA -_080F3650: - lsls r0, r7, 2 - ldr r1, =_080F3668 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3668: - .4byte _080F368C - .4byte _080F36D4 - .4byte _080F36DA - .4byte _080F372C - .4byte _080F379C - .4byte _080F379C - .4byte _080F379C - .4byte _080F379C - .4byte _080F37A2 -_080F368C: - ldr r0, =gStringVar1 - ldr r4, =gSaveBlock1Ptr - ldr r1, [r4] - ldr r2, =0x00002bac - adds r1, r2 - ldrb r1, [r1] - movs r2, 0 - bl GetMapName - ldr r0, [r4] - ldr r1, =0x00002bad - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bls _080F36C8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F37EA - .pool -_080F36C8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F37EA - .pool -_080F36D4: - movs r0, 0x2 - strb r0, [r2] - b _080F37EA -_080F36DA: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00002bae - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080F36FC - movs r0, 0x4 - strb r0, [r2] - b _080F37EA - .pool -_080F36FC: - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _080F370A - movs r0, 0x5 - strb r0, [r2] - b _080F37EA -_080F370A: - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _080F3718 - movs r0, 0x6 - strb r0, [r2] - b _080F37EA -_080F3718: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080F3726 - movs r0, 0x7 - strb r0, [r2] - b _080F37EA -_080F3726: - movs r0, 0x3 - strb r0, [r2] - b _080F37EA -_080F372C: - ldr r0, =gStringVar1 - ldr r4, =gSaveBlock1Ptr - ldr r1, [r4] - ldr r2, =0x00002ba4 - adds r1, r2 - ldrh r1, [r1] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x00002ba8 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldr r1, [r4] - ldr r2, =0x00002ba6 - adds r1, r2 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F37EA - .pool -_080F379C: - movs r0, 0x8 - strb r0, [r2] - b _080F37EA -_080F37A2: - ldr r0, =gStringVar1 - ldr r4, =gSaveBlock1Ptr - ldr r1, [r4] - ldr r2, =0x00002baa - adds r1, r2 - ldrh r1, [r1] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x00002ba4 - adds r1, r2 - ldrh r1, [r1] - movs r6, 0xB - muls r1, r6 - ldr r5, =gSpeciesNames - adds r1, r5 - bl StringCopy - ldr r0, =gStringVar3 - ldr r1, [r4] - ldr r2, =0x00002ba6 - adds r1, r2 - ldrh r1, [r1] - muls r1, r6 - adds r1, r5 - bl StringCopy - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - ldr r1, =gUnknown_0203A030 - movs r0, 0 - strb r0, [r1] - bl TakeTVShowInSearchOfTrainersOffTheAir -_080F37EA: - ldr r0, =gUnknown_0858D66C - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowInSearchOfTrainers - - thumb_func_start DoTVShowPokemonAngler -DoTVShowPokemonAngler: @ 80F3828 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r0, =gScriptResult - movs r1, 0 - strh r1, [r0] - ldrb r0, [r4, 0x2] - ldrb r2, [r4, 0x3] - cmp r0, r2 - bcs _080F3868 - ldr r0, =gUnknown_0203A030 - strb r1, [r0] - b _080F3870 - .pool -_080F3868: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - adds r0, r1, 0 -_080F3870: - ldrb r5, [r0] - cmp r5, 0 - beq _080F3880 - cmp r5, 0x1 - beq _080F38B8 - b _080F38E0 - .pool -_080F3880: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x6] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r1, [r4, 0x3] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone - b _080F38E0 - .pool -_080F38B8: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x6] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone -_080F38E0: - ldr r0, =gUnknown_0858D3B0 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonAngler - - thumb_func_start DoTVShowTheWorldOfMasters -DoTVShowTheWorldOfMasters: @ 80F3904 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r6, =gUnknown_0203A030 - ldrb r5, [r6] - cmp r5, 0x1 - beq _080F3974 - cmp r5, 0x1 - bgt _080F3948 - cmp r5, 0 - beq _080F394E - b _080F39BE - .pool -_080F3948: - cmp r5, 0x2 - beq _080F3994 - b _080F39BE -_080F394E: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xB] - bl sub_81DB5E8 - ldrh r1, [r4, 0x6] - movs r0, 0x1 - bl sub_80EF340 - ldrh r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - movs r0, 0x1 - strb r0, [r6] - b _080F39BE - .pool -_080F3974: - ldr r0, =gStringVar1 - ldrh r2, [r4, 0x8] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - movs r0, 0x2 - strb r0, [r6] - b _080F39BE - .pool -_080F3994: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xB] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrb r1, [r4, 0xA] - movs r2, 0 - bl GetMapName - ldr r0, =gStringVar3 - ldrh r2, [r4, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - bl TVShowDone -_080F39BE: - ldr r0, =gUnknown_0858D3B8 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTheWorldOfMasters - - thumb_func_start DoTVShowTodaysRivalTrainer -DoTVShowTodaysRivalTrainer: @ 80F39E4 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xA - bls _080F3A0C - b _080F3BE8 -_080F3A0C: - lsls r0, r5, 2 - ldr r1, =_080F3A30 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3A30: - .4byte _080F3A5C - .4byte _080F3B30 - .4byte _080F3B58 - .4byte _080F3B90 - .4byte _080F3BA2 - .4byte _080F3BC4 - .4byte _080F3BD8 - .4byte _080F3A92 - .4byte _080F3AC0 - .4byte _080F3ADC - .4byte _080F3AF8 -_080F3A5C: - ldrb r0, [r4, 0x7] - cmp r0, 0x56 - beq _080F3A6C - cmp r0, 0x57 - beq _080F3A72 - movs r0, 0x7 - strb r0, [r2] - b _080F3BE8 -_080F3A6C: - movs r0, 0x8 - strb r0, [r2] - b _080F3BE8 -_080F3A72: - ldrh r1, [r4, 0xA] - ldr r0, =0x00000117 - cmp r1, r0 - bgt _080F3A8C - subs r0, 0x2 - cmp r1, r0 - blt _080F3A8C - movs r0, 0xA - strb r0, [r2] - b _080F3BE8 - .pool -_080F3A8C: - movs r0, 0x9 - strb r0, [r2] - b _080F3BE8 -_080F3A92: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r0, =gStringVar3 - ldrb r1, [r4, 0x7] - movs r2, 0 - bl GetMapName -_080F3AB0: - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _080F3B12 - b _080F3B24 - .pool -_080F3AC0: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - b _080F3AB0 - .pool -_080F3ADC: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - b _080F3AB0 - .pool -_080F3AF8: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x4] - cmp r0, 0 - beq _080F3B24 -_080F3B12: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B24: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B30: - ldrb r1, [r4, 0x4] - movs r0, 0 - bl sub_80EF340 - ldr r0, =0x000008a8 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080F3BCC - ldr r0, [r4, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - cmp r0, 0 - bne _080F3B6E - b _080F3B84 - .pool -_080F3B58: - ldr r0, =0x000008a8 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080F3BCC - ldr r0, [r4, 0x4] - ldr r1, =0x00ffff00 - ands r0, r1 - cmp r0, 0 - beq _080F3B84 -_080F3B6E: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B84: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3B90: - ldrh r0, [r4, 0x8] - cmp r0, 0 - bne _080F3B9C - movs r0, 0x6 - strb r0, [r2] - b _080F3BE8 -_080F3B9C: - movs r0, 0x5 - strb r0, [r2] - b _080F3BE8 -_080F3BA2: - ldrb r1, [r4, 0x6] - movs r0, 0 - bl sub_80EF340 - ldrb r1, [r4, 0x5] - movs r0, 0x1 - bl sub_80EF340 - ldrh r0, [r4, 0x8] - cmp r0, 0 - beq _080F3BCC - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3BC4: - ldrh r1, [r4, 0x8] - movs r0, 0 - bl sub_80EF340 -_080F3BCC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F3BE8 - .pool -_080F3BD8: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xC] - bl sub_81DB5E8 - bl TVShowDone -_080F3BE8: - ldr r0, =gUnknown_0858D3C4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTodaysRivalTrainer - - thumb_func_start DoTVShowDewfordTrendWatcherNetwork -DoTVShowDewfordTrendWatcherNetwork: @ 80F3C04 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x6 - bls _080F3C2A - b _080F3D54 -_080F3C2A: - lsls r0, r5, 2 - ldr r1, =_080F3C4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F3C4C: - .4byte _080F3C68 - .4byte _080F3CA0 - .4byte _080F3CA0 - .4byte _080F3CD4 - .4byte _080F3D0C - .4byte _080F3D0C - .4byte _080F3D40 -_080F3C68: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080F3C94 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F3D54 - .pool -_080F3C94: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F3D54 - .pool -_080F3CA0: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x9] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F3D54 - .pool -_080F3CD4: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldrb r0, [r4, 0x8] - cmp r0, 0 - bne _080F3D00 - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D00: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D0C: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - ldr r0, =gStringVar3 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x9] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F3D54 - .pool -_080F3D40: - ldr r0, =gStringVar1 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - bl TVShowDone -_080F3D54: - ldr r0, =gUnknown_0858D3F0 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowDewfordTrendWatcherNetwork - - thumb_func_start DoTVShowHoennTreasureInvestigators -DoTVShowHoennTreasureInvestigators: @ 80F3D74 - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r7, =gUnknown_0203A030 - ldrb r6, [r7] - cmp r6, 0x1 - beq _080F3E02 - cmp r6, 0x1 - bgt _080F3DB8 - cmp r6, 0 - beq _080F3DBE - b _080F3E5C - .pool -_080F3DB8: - cmp r6, 0x2 - beq _080F3E3C - b _080F3E5C -_080F3DBE: - ldr r4, =gStringVar1 - ldrh r0, [r5, 0x2] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldrb r0, [r5, 0x4] - cmp r0, 0x57 - bne _080F3DFC - ldrh r1, [r5, 0x6] - ldr r0, =0x00000117 - cmp r1, r0 - bgt _080F3DF0 - subs r0, 0x2 - cmp r1, r0 - blt _080F3DF0 - movs r0, 0x2 - strb r0, [r7] - b _080F3E5C - .pool -_080F3DF0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F3E5C - .pool -_080F3DFC: - movs r0, 0x1 - strb r0, [r7] - b _080F3E5C -_080F3E02: - ldr r4, =gStringVar1 - ldrh r0, [r5, 0x2] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrb r1, [r5, 0x4] - movs r2, 0 - bl GetMapName - bl TVShowDone - b _080F3E5C - .pool -_080F3E3C: - ldr r4, =gStringVar1 - ldrh r0, [r5, 0x2] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - bl TVShowDone -_080F3E5C: - ldr r0, =gUnknown_0858D40C - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowHoennTreasureInvestigators - - thumb_func_start DoTVShowFindThatGamer -DoTVShowFindThatGamer: @ 80F3E7C - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x1 - beq _080F3F28 - cmp r5, 0x1 - bgt _080F3EC0 - cmp r5, 0 - beq _080F3ECC - b _080F4008 - .pool -_080F3EC0: - cmp r5, 0x2 - beq _080F3F78 - cmp r5, 0x3 - bne _080F3ECA - b _080F3FCC -_080F3ECA: - b _080F4008 -_080F3ECC: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3EE8 - cmp r0, 0x1 - beq _080F3EFC - b _080F3F04 - .pool -_080F3EE8: - ldr r0, =gStringVar2 - ldr r1, =gText_Slots - bl StringCopy - b _080F3F04 - .pool -_080F3EFC: - ldr r0, =gStringVar2 - ldr r1, =gText_Roulette - bl StringCopy -_080F3F04: - ldrb r1, [r4, 0x2] - cmp r1, 0x1 - bne _080F3F1C - ldr r0, =gUnknown_0203A030 - strb r1, [r0] - b _080F4008 - .pool -_080F3F1C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4008 - .pool -_080F3F28: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3F44 - cmp r0, 0x1 - beq _080F3F58 - b _080F3F60 - .pool -_080F3F44: - ldr r0, =gStringVar2 - ldr r1, =gText_Slots - bl StringCopy - b _080F3F60 - .pool -_080F3F58: - ldr r0, =gStringVar2 - ldr r1, =gText_Roulette - bl StringCopy -_080F3F60: - ldrh r1, [r4, 0x4] - movs r0, 0x2 - bl sub_80EF340 - bl TVShowDone - b _080F4008 - .pool -_080F3F78: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F3F94 - cmp r0, 0x1 - beq _080F3FA8 - b _080F3FB0 - .pool -_080F3F94: - ldr r0, =gStringVar2 - ldr r1, =gText_Slots - bl StringCopy - b _080F3FB0 - .pool -_080F3FA8: - ldr r0, =gStringVar2 - ldr r1, =gText_Roulette - bl StringCopy -_080F3FB0: - ldrh r1, [r4, 0x4] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F4008 - .pool -_080F3FCC: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldrb r1, [r4, 0x3] - cmp r1, 0 - beq _080F3FE8 - cmp r1, 0x1 - beq _080F3FFC - b _080F4004 - .pool -_080F3FE8: - ldr r0, =gStringVar2 - ldr r1, =gText_Roulette - bl StringCopy - b _080F4004 - .pool -_080F3FFC: - ldr r0, =gStringVar2 - ldr r1, =gText_Slots - bl StringCopy -_080F4004: - bl TVShowDone -_080F4008: - ldr r0, =gUnknown_0858D418 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowFindThatGamer - - thumb_func_start DoTVShowBreakingNewsTV -DoTVShowBreakingNewsTV: @ 80F4028 - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0xC - bls _080F4050 - b _080F4344 -_080F4050: - lsls r0, r7, 2 - ldr r1, =_080F4074 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4074: - .4byte _080F40A8 - .4byte _080F40BA - .4byte _080F40FC - .4byte _080F4140 - .4byte _080F4168 - .4byte _080F418C - .4byte _080F41D0 - .4byte _080F4254 - .4byte _080F42C8 - .4byte _080F42F4 - .4byte _080F42F4 - .4byte _080F4334 - .4byte _080F4284 -_080F40A8: - ldrb r0, [r6, 0x5] - cmp r0, 0 - bne _080F40B4 - movs r0, 0x1 - strb r0, [r2] - b _080F4344 -_080F40B4: - movs r0, 0x5 - strb r0, [r2] - b _080F4344 -_080F40BA: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4344 - .pool -_080F40FC: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F4344 - .pool -_080F4140: - ldrh r1, [r6, 0x8] - movs r0, 0 - bl sub_80EF340 - ldr r4, =gStringVar2 - ldrh r0, [r6, 0x6] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F4344 - .pool -_080F4168: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - bl TVShowDone - b _080F4344 - .pool -_080F418C: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F4344 - .pool -_080F41D0: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldrb r0, [r6, 0x5] - cmp r0, 0x2 - beq _080F423C - cmp r0, 0x2 - bgt _080F4218 - cmp r0, 0x1 - beq _080F421E - b _080F4344 - .pool -_080F4218: - cmp r0, 0x3 - beq _080F4248 - b _080F4344 -_080F421E: - ldrh r0, [r6, 0xC] - cmp r0, 0 - bne _080F4230 - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F4344 - .pool -_080F4230: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F4344 - .pool -_080F423C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F4344 - .pool -_080F4248: - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F4344 - .pool -_080F4254: - ldr r0, =gStringVar1 - ldrh r2, [r6, 0xC] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r2, [r6, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - b _080F42A8 - .pool -_080F4284: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x2] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 -_080F42A8: - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F4344 - .pool -_080F42C8: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F4344 - .pool -_080F42F4: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x2] - movs r4, 0xB - muls r1, r4 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrb r1, [r6, 0x4] - movs r2, 0 - bl GetMapName - ldr r0, =gUnknown_0203A030 - strb r4, [r0] - b _080F4344 - .pool -_080F4334: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xE] - bl sub_81DB5E8 - bl TVShowDone -_080F4344: - ldr r0, =gUnknown_0858D428 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowBreakingNewsTV - - thumb_func_start DoTVShowSecretBaseVisit -DoTVShowSecretBaseVisit: @ 80F4360 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - adds r2, r0, 0 - cmp r6, 0xD - bls _080F4388 - b _080F4588 -_080F4388: - lsls r0, r6, 2 - ldr r1, =_080F43AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F43AC: - .4byte _080F43E4 - .4byte _080F4414 - .4byte _080F44E4 - .4byte _080F4448 - .4byte _080F44E4 - .4byte _080F449C - .4byte _080F44C0 - .4byte _080F44E4 - .4byte _080F44EA - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4538 - .4byte _080F4584 -_080F43E4: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldrb r0, [r5, 0x3] - cmp r0, 0 - bne _080F4408 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4588 - .pool -_080F4408: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F4588 - .pool -_080F4414: - ldr r0, =gStringVar2 - ldrb r1, [r5, 0x4] - lsls r1, 5 - ldr r2, =gDecorations + 1 - adds r1, r2 - bl StringCopy - ldrb r0, [r5, 0x3] - cmp r0, 0x1 - bne _080F443C - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F4588 - .pool -_080F443C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F4588 - .pool -_080F4448: - ldr r0, =gStringVar2 - ldrb r1, [r5, 0x5] - lsls r1, 5 - ldr r2, =gDecorations + 1 - adds r1, r2 - bl StringCopy - ldrb r1, [r5, 0x3] - cmp r1, 0x3 - beq _080F4484 - cmp r1, 0x3 - bgt _080F4470 - cmp r1, 0x2 - beq _080F4476 - b _080F4588 - .pool -_080F4470: - cmp r1, 0x4 - beq _080F4490 - b _080F4588 -_080F4476: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F4588 - .pool -_080F4484: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F4588 - .pool -_080F4490: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F4588 - .pool -_080F449C: - ldr r0, =gStringVar2 - ldrb r1, [r5, 0x6] - lsls r1, 5 - ldr r4, =gDecorations + 1 - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrb r1, [r5, 0x7] - lsls r1, 5 - adds r1, r4 - b _080F44CA - .pool -_080F44C0: - ldr r0, =gStringVar2 - ldrb r1, [r5, 0x6] - lsls r1, 5 - ldr r2, =gDecorations + 1 - adds r1, r2 -_080F44CA: - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F4588 - .pool -_080F44E4: - movs r0, 0x8 - strb r0, [r2] - b _080F4588 -_080F44EA: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldrb r1, [r5, 0x2] - cmp r1, 0x18 - bhi _080F450C - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F4588 - .pool -_080F450C: - cmp r1, 0x31 - bhi _080F451C - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F4588 - .pool -_080F451C: - cmp r1, 0x45 - bhi _080F452C - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F4588 - .pool -_080F452C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F4588 - .pool -_080F4538: - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0xC] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r5, 0x8] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r5, 0xA] - movs r4, 0xD - muls r1, r4 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r0, =gUnknown_0203A030 - strb r4, [r0] - b _080F4588 - .pool -_080F4584: - bl TVShowDone -_080F4588: - ldr r0, =gUnknown_0858D45C - lsls r1, r6, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSecretBaseVisit - - thumb_func_start DoTVShowPokemonLotterWinnerFlashReport -DoTVShowPokemonLotterWinnerFlashReport: @ 80F45A0 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r6, [r0] - ldr r0, =gStringVar1 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x5] - bl sub_81DB5E8 - ldrb r0, [r5, 0x4] - cmp r0, 0 - bne _080F45FC - ldr r0, =gStringVar2 - ldr r1, =gText_Jackpot - bl StringCopy - b _080F4634 - .pool -_080F45FC: - cmp r0, 0x1 - bne _080F4614 - ldr r0, =gStringVar2 - ldr r1, =gText_First - bl StringCopy - b _080F4634 - .pool -_080F4614: - cmp r0, 0x2 - bne _080F462C - ldr r0, =gStringVar2 - ldr r1, =gText_Second - bl StringCopy - b _080F4634 - .pool -_080F462C: - ldr r0, =gStringVar2 - ldr r1, =gText_Third - bl StringCopy -_080F4634: - ldr r4, =gStringVar3 - ldrh r0, [r5, 0x2] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - bl TVShowDone - ldr r1, =gUnknown_0858D494 - lsls r0, r6, 2 - adds r0, r1 - ldr r0, [r0] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonLotterWinnerFlashReport - - thumb_func_start DoTVShowThePokemonBattleSeminar -DoTVShowThePokemonBattleSeminar: @ 80F466C - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - cmp r7, 0x6 - bls _080F4692 - b _080F4858 -_080F4692: - lsls r0, r7, 2 - ldr r1, =_080F46B4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F46B4: - .4byte _080F46D0 - .4byte _080F4714 - .4byte _080F4760 - .4byte _080F47B4 - .4byte _080F47EC - .4byte _080F4814 - .4byte _080F4838 -_080F46D0: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0x11] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x6] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0x4] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F4858 - .pool -_080F4714: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0x11] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x4] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r2, [r6, 0x2] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4858 - .pool -_080F4760: - ldr r0, =gStringVar1 - ldrh r2, [r6, 0x6] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - ldrb r1, [r6, 0x10] - cmp r1, 0x2 - beq _080F479C - cmp r1, 0x2 - bgt _080F4788 - cmp r1, 0x1 - beq _080F478E - b _080F4824 - .pool -_080F4788: - cmp r1, 0x3 - beq _080F47A8 - b _080F4824 -_080F478E: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F4858 - .pool -_080F479C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F4858 - .pool -_080F47A8: - ldr r0, =gUnknown_0203A030 - strb r1, [r0] - b _080F4858 - .pool -_080F47B4: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x8] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0xC] - muls r1, r5 - adds r1, r4 - b _080F4820 - .pool -_080F47EC: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x8] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0xA] - muls r1, r5 - adds r1, r4 - b _080F4820 - .pool -_080F4814: - ldr r0, =gStringVar2 - ldrh r2, [r6, 0x8] - movs r1, 0xD - muls r1, r2 - ldr r2, =gMoveNames - adds r1, r2 -_080F4820: - bl StringCopy -_080F4824: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F4858 - .pool -_080F4838: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0xE] - movs r5, 0xD - muls r1, r5 - ldr r4, =gMoveNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x2] - muls r1, r5 - adds r1, r4 - bl StringCopy - bl TVShowDone -_080F4858: - ldr r0, =gUnknown_0858D498 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowThePokemonBattleSeminar - - thumb_func_start DoTVShowTrainerFanClubSpecial -DoTVShowTrainerFanClubSpecial: @ 80F487C - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x5 - bls _080F48A2 - b _080F499A -_080F48A2: - lsls r0, r5, 2 - ldr r1, =_080F48C4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F48C4: - .4byte _080F48DC - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4944 - .4byte _080F4978 -_080F48DC: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x14] - bl CopyEasyChatWord - ldrb r1, [r4, 0x16] - cmp r1, 0x59 - bls _080F4918 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F499A - .pool -_080F4918: - cmp r1, 0x45 - bls _080F4928 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F499A - .pool -_080F4928: - cmp r1, 0x1D - bls _080F4938 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F499A - .pool -_080F4938: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F499A - .pool -_080F4944: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldrb r1, [r4, 0x16] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F499A - .pool -_080F4978: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0xC - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x14] - bl CopyEasyChatWord - bl TVShowDone -_080F499A: - ldr r0, =gUnknown_0858D320 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTrainerFanClubSpecial - - thumb_func_start DoTVShowTrainerFanClub -DoTVShowTrainerFanClub: @ 80F49BC - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xB - bls _080F49E4 - b _080F4B3A -_080F49E4: - lsls r0, r5, 2 - ldr r1, =_080F4A08 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4A08: - .4byte _080F4A38 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B14 - .4byte _080F4B1A -_080F4A38: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - adds r0, r4, 0 - adds r0, 0x23 - ldrb r0, [r0] - lsls r0, 8 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r1, [r1] - adds r0, r1 - movs r1, 0xA - bl __umodsi3 - cmp r0, 0x9 - bls _080F4A60 - b _080F4B3A -_080F4A60: - lsls r0, 2 - ldr r1, =_080F4A74 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4A74: - .4byte _080F4A9C - .4byte _080F4AA8 - .4byte _080F4AB4 - .4byte _080F4AC0 - .4byte _080F4ACC - .4byte _080F4AD8 - .4byte _080F4AE4 - .4byte _080F4AF0 - .4byte _080F4AFC - .4byte _080F4B08 -_080F4A9C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AA8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AB4: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AC0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F4B3A - .pool -_080F4ACC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AD8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AE4: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AF0: - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F4B3A - .pool -_080F4AFC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F4B3A - .pool -_080F4B08: - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F4B3A - .pool -_080F4B14: - movs r0, 0xB - strb r0, [r2] - b _080F4B3A -_080F4B1A: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x8] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - ldrh r1, [r4, 0x4] - bl CopyEasyChatWord - ldr r0, =gStringVar3 - ldrh r1, [r4, 0x6] - bl CopyEasyChatWord - bl TVShowDone -_080F4B3A: - ldr r0, =gUnknown_0858D4B4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowTrainerFanClub - - thumb_func_start DoTVShowSpotTheCuties -DoTVShowSpotTheCuties: @ 80F4B5C - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0xF - bls _080F4B82 - b _080F4D84 -_080F4B82: - lsls r0, r5, 2 - ldr r1, =_080F4BA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4BA4: - .4byte _080F4BE4 - .4byte _080F4C30 - .4byte _080F4C30 - .4byte _080F4C30 - .4byte _080F4C64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D64 - .4byte _080F4D80 -_080F4BE4: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xF] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - cmp r1, 0x9 - bhi _080F4C14 - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C14: - cmp r1, 0x13 - bhi _080F4C24 - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C24: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C30: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0xF] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x2 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F4D84 - .pool -_080F4C64: - ldr r0, =gStringVar2 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0x18 - bls _080F4C76 - b _080F4D84 -_080F4C76: - lsls r0, 2 - ldr r1, =_080F4C88 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4C88: - .4byte _080F4CEC - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4CF8 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D04 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D10 - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D1C - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D28 - .4byte _080F4D34 - .4byte _080F4D40 - .4byte _080F4D4C - .4byte _080F4D58 -_080F4CEC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F4D84 - .pool -_080F4CF8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D04: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D10: - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D1C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F4D84 - .pool -_080F4D28: - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F4D84 - .pool -_080F4D34: - ldr r1, =gUnknown_0203A030 - movs r0, 0xB - strb r0, [r1] - b _080F4D84 - .pool -_080F4D40: - ldr r1, =gUnknown_0203A030 - movs r0, 0xC - strb r0, [r1] - b _080F4D84 - .pool -_080F4D4C: - ldr r1, =gUnknown_0203A030 - movs r0, 0xD - strb r0, [r1] - b _080F4D84 - .pool -_080F4D58: - ldr r1, =gUnknown_0203A030 - movs r0, 0xE - strb r0, [r1] - b _080F4D84 - .pool -_080F4D64: - ldr r0, =gStringVar2 - adds r1, r4, 0x4 - ldrb r2, [r4, 0x10] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0xF - strb r0, [r1] - b _080F4D84 - .pool -_080F4D80: - bl TVShowDone -_080F4D84: - ldr r0, =gUnknown_0858D4E4 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSpotTheCuties - - thumb_func_start DoTVShowPokemonNewsBattleFrontier -DoTVShowPokemonNewsBattleFrontier: @ 80F4D9C - push {r4-r7,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r6, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r7, [r0] - adds r2, r0, 0 - cmp r7, 0x12 - bls _080F4DC4 - b _080F5014 -_080F4DC4: - lsls r0, r7, 2 - ldr r1, =_080F4DE8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4DE8: - .4byte _080F4E34 - .4byte _080F4F18 - .4byte _080F4ECE - .4byte _080F4EF4 - .4byte _080F4EF4 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F18 - .4byte _080F4F3C - .4byte _080F4F74 - .4byte _080F4F9C - .4byte _080F4FE0 - .4byte _080F5004 -_080F4E34: - ldrb r0, [r6, 0xD] - subs r0, 0x1 - cmp r0, 0xC - bls _080F4E3E - b _080F5014 -_080F4E3E: - lsls r0, 2 - ldr r1, =_080F4E4C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F4E4C: - .4byte _080F4E80 - .4byte _080F4E86 - .4byte _080F4E8C - .4byte _080F4E92 - .4byte _080F4E98 - .4byte _080F4E9E - .4byte _080F4EA4 - .4byte _080F4EAA - .4byte _080F4EB0 - .4byte _080F4EB6 - .4byte _080F4EBC - .4byte _080F4EC2 - .4byte _080F4EC8 -_080F4E80: - movs r0, 0x1 - strb r0, [r2] - b _080F5014 -_080F4E86: - movs r0, 0x2 - strb r0, [r2] - b _080F5014 -_080F4E8C: - movs r0, 0x3 - strb r0, [r2] - b _080F5014 -_080F4E92: - movs r0, 0x4 - strb r0, [r2] - b _080F5014 -_080F4E98: - movs r0, 0x5 - strb r0, [r2] - b _080F5014 -_080F4E9E: - movs r0, 0x6 - strb r0, [r2] - b _080F5014 -_080F4EA4: - movs r0, 0x7 - strb r0, [r2] - b _080F5014 -_080F4EAA: - movs r0, 0x8 - strb r0, [r2] - b _080F5014 -_080F4EB0: - movs r0, 0x9 - strb r0, [r2] - b _080F5014 -_080F4EB6: - movs r0, 0xA - strb r0, [r2] - b _080F5014 -_080F4EBC: - movs r0, 0xB - strb r0, [r2] - b _080F5014 -_080F4EC2: - movs r0, 0xC - strb r0, [r2] - b _080F5014 -_080F4EC8: - movs r0, 0xD - strb r0, [r2] - b _080F5014 -_080F4ECE: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x10 - strb r0, [r1] - b _080F5014 - .pool -_080F4EF4: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0xF - strb r0, [r1] - b _080F5014 - .pool -_080F4F18: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - ldrh r1, [r6, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0xE - strb r0, [r1] - b _080F5014 - .pool -_080F4F3C: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0x8] - muls r1, r5 - adds r1, r4 - b _080F4FEC - .pool -_080F4F74: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - b _080F4FEC - .pool -_080F4F9C: - ldr r0, =gStringVar1 - ldrh r1, [r6, 0x4] - movs r5, 0xB - muls r1, r5 - ldr r4, =gSpeciesNames - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar2 - ldrh r1, [r6, 0x6] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r0, =gStringVar3 - ldrh r1, [r6, 0x8] - muls r1, r5 - adds r1, r4 - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x11 - strb r0, [r1] - b _080F5014 - .pool -_080F4FE0: - ldr r0, =gStringVar1 - ldrh r2, [r6, 0xA] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 -_080F4FEC: - bl StringCopy - ldr r1, =gUnknown_0203A030 - movs r0, 0x12 - strb r0, [r1] - b _080F5014 - .pool -_080F5004: - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x13 - ldrb r2, [r6, 0xC] - bl sub_81DB5E8 - bl TVShowDone -_080F5014: - ldr r0, =gUnknown_0858D524 - lsls r1, r7, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonNewsBattleFrontier - - thumb_func_start DoTVShowWhatsNo1InHoennToday -DoTVShowWhatsNo1InHoennToday: @ 80F5030 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - cmp r5, 0x8 - bls _080F5056 - b _080F5164 -_080F5056: - lsls r0, r5, 2 - ldr r1, =_080F5078 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5078: - .4byte _080F509C - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5130 - .4byte _080F5154 -_080F509C: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - ldrb r0, [r4, 0x4] - cmp r0, 0x6 - bhi _080F5164 - lsls r0, 2 - ldr r1, =_080F50C0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F50C0: - .4byte _080F50DC - .4byte _080F50E8 - .4byte _080F50F4 - .4byte _080F5100 - .4byte _080F510C - .4byte _080F5118 - .4byte _080F5124 -_080F50DC: - ldr r1, =gUnknown_0203A030 - movs r0, 0x1 - strb r0, [r1] - b _080F5164 - .pool -_080F50E8: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F5164 - .pool -_080F50F4: - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F5164 - .pool -_080F5100: - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F5164 - .pool -_080F510C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F5164 - .pool -_080F5118: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F5164 - .pool -_080F5124: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F5164 - .pool -_080F5130: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - ldrh r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F5164 - .pool -_080F5154: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x5] - bl sub_81DB5E8 - bl TVShowDone -_080F5164: - ldr r0, =gUnknown_0858D570 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowWhatsNo1InHoennToday - - thumb_func_start sub_80F5180 -sub_80F5180: @ 80F5180 - push {r4,lr} - movs r1, 0 - movs r2, 0 - ldr r3, [r0, 0xC] - movs r4, 0x1 -_080F518A: - adds r0, r3, 0 - lsrs r0, r1 - ands r0, r4 - cmp r0, 0 - beq _080F519A - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080F519A: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x1F - bls _080F518A - adds r0, r2, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80F5180 - - thumb_func_start sub_80F51AC -sub_80F51AC: @ 80F51AC - push {r4-r6,lr} - lsls r1, 24 - lsrs r4, r1, 24 - movs r2, 0 - movs r3, 0 - ldr r1, [r0, 0xC] - movs r5, 0x1 - ldr r6, =gUnknown_0858D690 -_080F51BC: - adds r0, r1, 0 - lsrs r0, r2 - ands r0, r5 - cmp r0, 0 - beq _080F51DA - cmp r3, r4 - bne _080F51D4 - adds r0, r2, r6 - ldrb r0, [r0] - b _080F51E6 - .pool -_080F51D4: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 -_080F51DA: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1F - bls _080F51BC - movs r0, 0 -_080F51E6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80F51AC - - thumb_func_start DoTVShowSecretBaseSecrets -DoTVShowSecretBaseSecrets: @ 80F51EC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r5, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r2, [r0] - mov r9, r2 - adds r2, r0, 0 - mov r0, r9 - cmp r0, 0x2B - bls _080F521E - b _080F552A -_080F521E: - lsls r0, 2 - ldr r1, =_080F5240 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5240: - .4byte _080F52F0 - .4byte _080F5348 - .4byte _080F53C4 - .4byte _080F5444 - .4byte _080F5498 - .4byte _080F5498 - .4byte _080F5498 - .4byte _080F54C4 - .4byte _080F54E8 - .4byte _080F54EC - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F54F0 - .4byte _080F5510 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 - .4byte _080F5526 -_080F52F0: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0 - bne _080F5328 - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F552A - .pool -_080F5328: - movs r0, 0x1 - strb r0, [r5, 0x12] - bl Random - ldr r4, =gUnknown_0203A031 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r4] - ldrb r1, [r4] - b _080F542A - .pool -_080F5348: - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - beq _080F53DE - cmp r6, 0x2 - beq _080F5370 - movs r4, 0 - b _080F538A - .pool -_080F5370: - strb r6, [r5, 0x12] - ldr r0, =gUnknown_0203A031 - ldrb r0, [r0] - cmp r0, 0 - bne _080F5384 - adds r0, r5, 0 - movs r1, 0x1 - b _080F542C - .pool -_080F5384: - adds r0, r5, 0 - movs r1, 0 - b _080F542C -_080F538A: - bl Random - ldr r7, =gUnknown_0203A031 - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r7, 0x1] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - cmp r0, r1 - bne _080F53B2 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000fffe - cmp r4, r0 - bls _080F538A -_080F53B2: - movs r0, 0x2 - strb r0, [r5, 0x12] - ldrb r1, [r7, 0x1] - b _080F542A - .pool -_080F53C4: - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - adds r0, r5, 0 - bl sub_80F5180 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x2 - bne _080F53F0 -_080F53DE: - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F552A - .pool -_080F53F0: - movs r4, 0 - ldr r7, =gUnknown_0203A031 - ldr r2, =0x0000fffe - mov r8, r2 -_080F53F8: - bl Random - lsls r0, 16 - lsrs r0, 16 - adds r1, r6, 0 - bl __modsi3 - strb r0, [r7, 0x2] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r7] - cmp r0, r1 - beq _080F5418 - ldrb r2, [r7, 0x1] - cmp r0, r2 - bne _080F5422 -_080F5418: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r8 - bls _080F53F8 -_080F5422: - movs r0, 0x3 - strb r0, [r5, 0x12] - ldr r0, =gUnknown_0203A031 - ldrb r1, [r0, 0x2] -_080F542A: - adds r0, r5, 0 -_080F542C: - bl sub_80F51AC - ldr r1, =gUnknown_0203A030 - strb r0, [r1] - b _080F552A - .pool -_080F5444: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - ldrh r1, [r5, 0x2] - movs r0, 0x2 - bl sub_80EF340 - ldrh r0, [r5, 0x2] - cmp r0, 0x1E - bhi _080F547C - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F552A - .pool -_080F547C: - cmp r0, 0x64 - bhi _080F548C - ldr r1, =gUnknown_0203A030 - movs r0, 0x5 - strb r0, [r1] - b _080F552A - .pool -_080F548C: - ldr r1, =gUnknown_0203A030 - movs r0, 0x6 - strb r0, [r1] - b _080F552A - .pool -_080F5498: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F552A - .pool -_080F54C4: - ldr r0, =gStringVar1 - adds r1, r5, 0x4 - ldrb r2, [r5, 0x1C] - bl sub_81DB5E8 - ldr r0, =gStringVar2 - adds r1, r5, 0 - adds r1, 0x13 - ldrb r2, [r5, 0x1B] - bl sub_81DB5E8 - bl TVShowDone - b _080F552A - .pool -_080F54E8: - movs r0, 0x3 - b _080F5528 -_080F54EC: - movs r0, 0x3 - b _080F5528 -_080F54F0: - ldr r4, =gStringVar2 - ldrh r0, [r5, 0x10] - bl ItemId_GetItem - adds r1, r0, 0 - adds r0, r4, 0 - bl StringCopy - ldr r1, =gUnknown_0203A030 - ldrb r0, [r5, 0x12] - strb r0, [r1] - b _080F552A - .pool -_080F5510: - adds r0, r5, 0 - adds r0, 0x22 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080F5522 - movs r0, 0x16 - b _080F5528 -_080F5522: - movs r0, 0x15 - b _080F5528 -_080F5526: - ldrb r0, [r5, 0x12] -_080F5528: - strb r0, [r2] -_080F552A: - ldr r0, =gUnknown_0858D594 - mov r2, r9 - lsls r1, r2, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSecretBaseSecrets - - thumb_func_start DoTVShowSafariFanClub -DoTVShowSafariFanClub: @ 80F5548 - push {r4,r5,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r0, =gUnknown_0203A030 - ldrb r5, [r0] - adds r2, r0, 0 - cmp r5, 0xA - bls _080F5570 - b _080F56BC -_080F5570: - lsls r0, r5, 2 - ldr r1, =_080F5594 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080F5594: - .4byte _080F55C0 - .4byte _080F55DC - .4byte _080F5614 - .4byte _080F5628 - .4byte _080F569A - .4byte _080F562E - .4byte _080F5650 - .4byte _080F5680 - .4byte _080F5694 - .4byte _080F569A - .4byte _080F56B8 -_080F55C0: - ldrb r1, [r4, 0x2] - cmp r1, 0 - bne _080F55CC - movs r0, 0x6 - strb r0, [r2] - b _080F56BC -_080F55CC: - cmp r1, 0x3 - bhi _080F55D6 - movs r0, 0x5 - strb r0, [r2] - b _080F56BC -_080F55D6: - movs r0, 0x1 - strb r0, [r2] - b _080F56BC -_080F55DC: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _080F5608 - ldr r1, =gUnknown_0203A030 - movs r0, 0x3 - strb r0, [r1] - b _080F56BC - .pool -_080F5608: - ldr r1, =gUnknown_0203A030 - movs r0, 0x2 - strb r0, [r1] - b _080F56BC - .pool -_080F5614: - ldrb r1, [r4, 0x3] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x4 - strb r0, [r1] - b _080F56BC - .pool -_080F5628: - movs r0, 0x4 - strb r0, [r2] - b _080F56BC -_080F562E: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r1, [r4, 0x2] - movs r0, 0x1 - bl sub_80EF340 - ldrb r0, [r4, 0x3] - cmp r0, 0 - beq _080F5662 - b _080F5674 - .pool -_080F5650: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldrb r0, [r4, 0x3] - cmp r0, 0 - bne _080F5674 -_080F5662: - ldr r1, =gUnknown_0203A030 - movs r0, 0x8 - strb r0, [r1] - b _080F56BC - .pool -_080F5674: - ldr r1, =gUnknown_0203A030 - movs r0, 0x7 - strb r0, [r1] - b _080F56BC - .pool -_080F5680: - ldrb r1, [r4, 0x3] - movs r0, 0x1 - bl sub_80EF340 - ldr r1, =gUnknown_0203A030 - movs r0, 0x9 - strb r0, [r1] - b _080F56BC - .pool -_080F5694: - movs r0, 0x9 - strb r0, [r2] - b _080F56BC -_080F569A: - ldr r0, =gStringVar1 - adds r1, r4, 0 - adds r1, 0x13 - ldrb r2, [r4, 0x4] - bl sub_81DB5E8 - ldr r1, =gUnknown_0203A030 - movs r0, 0xA - strb r0, [r1] - b _080F56BC - .pool -_080F56B8: - bl TVShowDone -_080F56BC: - ldr r0, =gUnknown_0858D640 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowSafariFanClub - - thumb_func_start DoTVShowPokemonContestLiveUpdates2 -DoTVShowPokemonContestLiveUpdates2: @ 80F56D4 - push {r4-r6,lr} - ldr r2, =gSaveBlock1Ptr - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =0x000027cc - adds r0, r1 - ldr r1, [r2] - adds r4, r1, r0 - ldr r1, =gScriptResult - movs r0, 0 - strh r0, [r1] - ldr r6, =gUnknown_0203A030 - ldrb r5, [r6] - cmp r5, 0x2 - bgt _080F5718 - cmp r5, 0x1 - bge _080F5744 - cmp r5, 0 - beq _080F571E - b _080F575E - .pool -_080F5718: - cmp r5, 0x3 - beq _080F574E - b _080F575E -_080F571E: - ldr r0, =gStringVar1 - ldrb r1, [r4, 0xA] - bl sub_818E868 - ldrb r1, [r4, 0x16] - cmp r1, 0x1 - bne _080F5734 - strb r1, [r6] - b _080F575E - .pool -_080F5734: - cmp r1, 0 - bne _080F573E - movs r0, 0x2 - strb r0, [r6] - b _080F575E -_080F573E: - movs r0, 0x3 - strb r0, [r6] - b _080F575E -_080F5744: - ldr r0, =gStringVar3 - adds r1, r4, 0x2 - ldrb r2, [r4, 0x17] - bl sub_81DB5E8 -_080F574E: - ldr r0, =gStringVar2 - adds r1, r4, 0 - adds r1, 0xB - ldrb r2, [r4, 0x18] - bl sub_81DB5E8 - bl TVShowDone -_080F575E: - ldr r0, =gUnknown_0858D384 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl box_related_two__2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end DoTVShowPokemonContestLiveUpdates2 - - thumb_func_start TVShowDone -TVShowDone: @ 80F577C - ldr r1, =gScriptResult - movs r0, 0x1 - strh r0, [r1] - ldr r1, =gUnknown_0203A030 - movs r0, 0 - strb r0, [r1] - ldr r0, =gSaveBlock1Ptr - ldr r2, [r0] - ldr r0, =gSpecialVar_0x8004 - ldrh r1, [r0] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r0, =0x000027cd - adds r2, r0 - movs r0, 0 - strb r0, [r2] - bx lr - .pool - thumb_func_end TVShowDone - - thumb_func_start ResetTVShowState -ResetTVShowState: @ 80F57B8 - ldr r1, =gUnknown_0203A030 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end ResetTVShowState - - .align 2, 0 @ Don't pad with nop. diff --git a/common_syms/tv.txt b/common_syms/tv.txt new file mode 100644 index 000000000..0370f65e1 --- /dev/null +++ b/common_syms/tv.txt @@ -0,0 +1,4 @@ +sCurTVShowSlot +sTV_SecretBaseVisitMovesTemp +sTV_DecorationsBuffer +sTV_SecretBaseVisitMonsTemp diff --git a/data/event_scripts.s b/data/event_scripts.s index 4dd5761e5..e700ad181 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -822,7 +822,15 @@ gUnknown_0827EE09:: @ 27EE09 .incbin "baserom.gba", 0x27ee09, 0x2 gUnknown_0827EE0B:: @ 827EE0B - .incbin "baserom.gba", 0x27ee0b, 0x118fa + .incbin "baserom.gba", 0x27ee0b, 0x46a + + .include "data/text/tv.inc" + + .incbin "baserom.gba", 0x0028c7e9, 0x90f + + .include "data/text/pokemon_news.inc" + + .incbin "baserom.gba", 0x28e066, 0x269f gUnknown_08290705:: @ 8290705 .incbin "baserom.gba", 0x290705, 0xeb diff --git a/data/text/pokemon_news.inc b/data/text/pokemon_news.inc new file mode 100644 index 000000000..5af4e2994 --- /dev/null +++ b/data/text/pokemon_news.inc @@ -0,0 +1,165 @@ + +gPokeNewsTextSlateport_Upcoming:: @ 0828D0F8 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "SLATEPORT’s most popular kind of guy,\n" + .string "the ENERGY GURU, is in the news again!\p" + .string "He promises to, “Stupendously go for\n" + .string "it in just this many days: {STR_VAR_1}!”\p" + .string "While he refused to elaborate on what\n" + .string "he will stupendously go for, the\l" + .string "ENERGY GURU advised, “Save up your\l" + .string "money. That’ll be good…”\p" + .string "It sounds like a trip to SLATEPORT\n" + .string "would be well worth your while that day.\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextSlateport_Ongoing:: @ 0828D2A1 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "This is the news you’ve all been\n" + .string "waiting for!\p" + .string "SLATEPORT’S ENERGY GURU is going\n" + .string "for it stupendously in the MARKET!\p" + .string "He promises unbeatable bargain\n" + .string "prices on CALCIUM and PROTEIN!\p" + .string "A trip to SLATEPORT CITY sounds\n" + .string "worthwhile. Why not visit and shop\l" + .string "to your heart’s content?\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextSlateport_Ending:: @ 0828D3F5 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "This is the news you’ve all been\n" + .string "waiting for!\p" + .string "SLATEPORT’S ENERGY GURU is going\n" + .string "for it stupendously in the MARKET!\p" + .string "He promises unbeatable bargain\n" + .string "prices on CALCIUM and PROTEIN!\p" + .string "According to the ENERGY GURU, he\n" + .string "still has ample merchandise left.\p" + .string "Why not visit SLATEPORT CITY for\n" + .string "a most enjoyable shopping trip?\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextGameCorner_Upcoming:: @ 0828D571 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "It’s approaching!\n" + .string "It’s finally coming!\p" + .string "The GAME CORNER’s service day will be\n" + .string "here in just this many days: {STR_VAR_1}!\p" + .string "Even those who are usually unlucky\n" + .string "may be lucky on this particular day!\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextGameCorner_Ongoing:: @ 0828D66F + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "It’s here!\n" + .string "It’s finally arrived!\p" + .string "GAME CORNER’s service day has finally\n" + .string "arrived!\p" + .string "Could you be lucky at the SLOTS \n" + .string "and ROULETTE?\p" + .string "The location is MAUVILLE CITY.\n" + .string "This is the place!\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextGameCorner_Ending:: @ 0828D768 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "It’s here!\n" + .string "It’s finally arrived!\p" + .string "GAME CORNER’s service day has finally\n" + .string "arrived!\p" + .string "Could you be lucky at the SLOTS\n" + .string "and ROULETTE?\p" + .string "Time is limited and has almost run out.\n" + .string "The location is MAUVILLE CITY.\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextLilycove_Upcoming:: @ 0828D875 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "We’ve just received wonderful news\n" + .string "from LILYCOVE DEPARTMENT STORE.\p" + .string "The DEPARTMENT STORE’s clear-out sale\n" + .string "will be in just this many days: {STR_VAR_1}!\p" + .string "That thingamajig or that doodad that\n" + .string "you’ve always wanted could be yours!\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextLilycove_Ongoing:: @ 0828D994 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "This is the news you’ve all been\n" + .string "waiting for!\p" + .string "LILYCOVE DEPARTMENT STORE’s clear-out\n" + .string "sale has finally arrived!\p" + .string "All the thingamajigs and doodads that\n" + .string "you’ve always dreamt about…\p" + .string "You may be in for fateful encounters\n" + .string "with them all!\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextLilycove_Ending:: @ 0828DAC0 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "This is the news you’ve all been\n" + .string "waiting for!\p" + .string "LILYCOVE DEPARTMENT STORE’s clear-out\n" + .string "sale has finally arrived!\p" + .string "All the thingamajigs and doodads that\n" + .string "you’ve always dreamt about…\p" + .string "You may be in for fateful encounters\n" + .string "with them all!\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextBlendMaster_Upcoming:: @ 0828DBEC + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "We have big news for everyone\n" + .string "involved in the making of {POKEBLOCK}S.\p" + .string "The legendary BLEND MASTER will be\n" + .string "appearing in LILYCOVE CITY with just\l" + .string "a mere {STR_VAR_1}-day wait to go!\p" + .string "The BLEND MASTER is said to be\n" + .string "the best in all HOENN when it comes to\l" + .string "spinning a BERRY BLENDER.\p" + .string "Those people who want to make great\n" + .string "{POKEBLOCK}S or see the MASTER in action\l" + .string "are urged to save their BERRIES.\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextBlendMaster_Ongoing:: @ 0828DD9E + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "We have big news for everyone\n" + .string "involved in the making of {POKEBLOCK}S.\p" + .string "The legendary BLEND MASTER has\n" + .string "finally appeared!\p" + .string "The BLEND MASTER is spinning\n" + .string "the BERRY BLENDER at the LILYCOVE\l" + .string "CONTEST HALL.\p" + .string "Those people who want to make great\n" + .string "{POKEBLOCK}S or see the MASTER in action\l" + .string "should hurry to LILYCOVE.\p" + .string "That’s the news on POKéMON NEWS.$" + +gPokeNewsTextBlendMaster_Ending:: @ 0828DF05 + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "It’s incredible!\n" + .string "Too incredible, even!\p" + .string "The BERRY BLENDER is spinning at\n" + .string "a dizzying pace!\p" + .string "The BLEND MASTER has lived up to\n" + .string "his reputation!\p" + .string "The BLEND MASTER will soon be\n" + .string "leaving LILYCOVE.\p" + .string "If you haven’t seen the MASTER in\n" + .string "action, don’t waste this chance!\l" + .string "Head to LILYCOVE right now!\p" + .string "That’s the news on POKéMON NEWS.$" diff --git a/data/text/tv.inc b/data/text/tv.inc new file mode 100644 index 000000000..fa2d0ac73 --- /dev/null +++ b/data/text/tv.inc @@ -0,0 +1,2891 @@ +gTVBravoTrainerText00:: @ 0827F275 + .string "Yeah!\n" + .string "It’s BRAVO TRAINER time!\p" + .string "Today, we’re going to profile a POKéMON\n" + .string "belonging to {STR_VAR_1}.\p" + .string "Now, this POKéMON boasts a {STR_VAR_3}\n" + .string "Rank in the {STR_VAR_2} Category.$" + +gTVBravoTrainerText01:: @ 0827F304 + .string "Introducing {STR_VAR_2} the\n" + .string "{STR_VAR_1}!\p" + .string "The nickname {STR_VAR_2}…\p" + .string "Even the nickname exudes an air that\n" + .string "proclaims “{STR_VAR_3}”!$" + +gTVBravoTrainerText02:: @ 0827F361 + .string "Anyway, when the TRAINER {STR_VAR_1}\n" + .string "entered the POKéMON in a CONTEST,\l" + .string "we managed to get a few impassioned\l" + .string "quotes about the trusty partner.$" + +gTVBravoTrainerText03:: @ 0827F3E4 + .string "Asked about the CONTEST afterwards,\n" + .string "{STR_VAR_1} happily replied with a huge\l" + .string "grin, “{STR_VAR_2}!”\p" + .string "Well, sure, {STR_VAR_1}’s POKéMON came in\n" + .string "number {STR_VAR_3} in the CONTEST.\p" + .string "That line perfectly suits {STR_VAR_1}\n" + .string "right now, I’d say!$" + +gTVBravoTrainerText04:: @ 0827F49F + .string "Asked about the CONTEST afterwards,\n" + .string "{STR_VAR_1} replied with a tinge of\l" + .string "bitterness, “{STR_VAR_2}.”\p" + .string "Well, sure, {STR_VAR_1}’s POKéMON came in\n" + .string "number {STR_VAR_3} in the CONTEST.\p" + .string "{STR_VAR_1}’s disappointment comes across\n" + .string "loud and clear, I’d say!$" + +gTVBravoTrainerText05:: @ 0827F565 + .string "Wouldn’t you also like to know what\n" + .string "{STR_VAR_1} imagines {STR_VAR_2} to be?\p" + .string "You bet we did!\n" + .string "So we asked, of course!\p" + .string "The answer is all perfectly condensed:\n" + .string "“{STR_VAR_3}!”\p" + .string "That’s what the concept of {STR_VAR_2}\n" + .string "represents to {STR_VAR_1}!$" + +gTVBravoTrainerText06:: @ 0827F624 + .string "The last move {STR_VAR_2} used by\n" + .string "the {STR_VAR_1} is entirely about\l" + .string "“{STR_VAR_3}”!$" + +gTVBravoTrainerText07:: @ 0827F65C + .string "Bravo, {STR_VAR_1}!\n" + .string "Bravo, {STR_VAR_2}!\p" + .string "I hope we can count on seeing\n" + .string "{STR_VAR_1} scale even greater heights!\p" + .string "That’s all the time we have!\n" + .string "Until next time, see you!$" + +gTVBravoTrainerText08:: @ 0827F6E6 + .string "Introducing the TRAINER’s {STR_VAR_1}!$" + + .string "Hello! You’re the TRAINER who just had\n" + .string "a battle, right?\p" + .string "I’m gathering interviews with TRAINERS\n" + .string "all over the place.\p" + .string "May I get a few words from you about\n" + .string "your impressions on battling?$" + + .string "You will? Really?\n" + .string "Thank you!\l" + .string "Then, uh…\p" + .string "How did things turn out in\n" + .string "the BATTLE TOWER today?\p" + .string "Were you satisfied with the battle?\n" + .string "Or are you unhappy?$" + + .string "Oh…\n" + .string "Sorry we disturbed you.\p" + .string "Please give us an interview the next\n" + .string "time you visit the BATTLE TOWER.$" + + .string "Well, of course!\p" + .string "That unmistakable look of satisfaction\n" + .string "on your face…\p" + .string "It’s obvious that you’ve had a great\n" + .string "battle.$" + + .string "Oh, I see…\p" + .string "Well, it certainly is difficult to make a\n" + .string "battle turn out exactly as planned.$" + + .string "Oh, oh, may I ask one more question?\p" + .string "If you were to describe your\n" + .string "impressions about this battle with\l" + .string "one saying, what would it be?$" + + .string "Oh, that is stunningly cool!\p" + .string "That’s a great line!\n" + .string "I hope you’ll do great next time, too.\p" + .string "I hope to see you again!$" + + .string "Oh, I see…\p" + .string "Still, being the silent type is also\n" + .string "cool, isn’t it?\p" + .string "I hope you’ll give me the opportunity\n" + .string "to share your thoughts again!$" + + .string "I’ll be looking forward to your\n" + .string "next battle!$" + +gTVBravoTrainerBattleTowerText00:: @ 0827FB20 + .string "Yeah!\n" + .string "It’s BRAVO TRAINER time!\p" + .string "Today, we’re going to profile {STR_VAR_1},\n" + .string "who took the BATTLE TOWER challenge!\p" + .string "For the challenge, {STR_VAR_1} entered\n" + .string "one wicked {STR_VAR_2}.$" + +gTVBravoTrainerBattleTowerText01:: @ 0827FBB3 + .string "The pair set a new record of {STR_VAR_2} wins\n" + .string "in a row in {STR_VAR_1} competition!\l" + .string "Bravo, TRAINER!$" + +gTVBravoTrainerBattleTowerText02:: @ 0827FC04 + .string "The twosome finally succumbed to\n" + .string "{STR_VAR_1} in match number {STR_VAR_2}.\l" + .string "Nice try, TRAINER!\p" + .string "But, hey, it’s just bad luck to run into\n" + .string "{STR_VAR_1} so early in the challenge.\p" + .string "We asked the TRAINER for impressions\n" + .string "on the match with {STR_VAR_1}.$" + +gTVBravoTrainerBattleTowerText03:: @ 0827FCD1 + .string "The twosome won it all by defeating\n" + .string "{STR_VAR_1}’s {STR_VAR_2} thoroughly.\l" + .string "Bravo, TRAINER!\p" + .string "Knocking off even {STR_VAR_1}…\n" + .string "It defies belief! Simply astounding!\p" + .string "We asked the TRAINER for impressions\n" + .string "on the moment of glory.$" + +gTVBravoTrainerBattleTowerText04:: @ 0827FD91 + .string "After a string of wins, the pair finally\n" + .string "succumbed to {STR_VAR_1}’s {STR_VAR_2},\l" + .string "their final hurdle.\p" + .string "Nice try, TRAINER!\p" + .string "Still, you have to give credit.\n" + .string "You don’t see many famous combinations\l" + .string "like {STR_VAR_1} and {STR_VAR_2}.\p" + .string "We asked the TRAINER for impressions\n" + .string "on battling the celebrity pair.$" + +gTVBravoTrainerBattleTowerText05:: @ 0827FE93 + .string "This is what the TRAINER had to say:\n" + .string "“I’m satisfied!”\p" + .string "Now isn’t that a refreshing reply?\n" + .string "Bravo, TRAINER!\p" + .string "Isn’t it out-and-out awesome to be\n" + .string "able to battle to full satisfaction?\p" + .string "I found out exactly how satisfied\n" + .string "when I heard the TRAINER say this:$" + +gTVBravoTrainerBattleTowerText06:: @ 0827FF89 + .string "This is what the TRAINER had to say:\n" + .string "“I’m not satisfied…”\p" + .string "Our TRAINER was obviously a little down\n" + .string "when that was uttered.\p" + .string "Still, it’s not easy to be able to battle\n" + .string "with complete satisfaction, am I right?\p" + .string "Anyway, I found out how dissatisfied\n" + .string "our TRAINER was when I heard this:$" + +gTVBravoTrainerBattleTowerText07:: @ 0828009C + .string "None$" + +gTVBravoTrainerBattleTowerText08:: @ 082800A1 + .string "None$" + +gTVBravoTrainerBattleTowerText09:: @ 082800A6 + .string "None$" + +gTVBravoTrainerBattleTowerText10:: @ 082800AB + .string "None$" + +gTVBravoTrainerBattleTowerText11:: @ 082800B0 + .string "“{STR_VAR_1}.”$" + +gTVBravoTrainerBattleTowerText12:: @ 082800B6 + .string "“{STR_VAR_1}.”\n" + .string "Now isn’t that great?\p" + .string "It really expresses {STR_VAR_2}’s joy,\n" + .string "I’d say.\p" + .string "That battle with {STR_VAR_3} at the\n" + .string "end… It really was what you’d call\l" + .string "“{STR_VAR_1}”!$" + +gTVBravoTrainerBattleTowerText13:: @ 0828013D + .string "“{STR_VAR_1}.”\n" + .string "Now isn’t that fitting?\p" + .string "That battle with {STR_VAR_3} at the\n" + .string "end… You can’t describe it as anything\l" + .string "else but “{STR_VAR_1}”!\p" + .string "{STR_VAR_2}’s disappointment comes across\n" + .string "loud and clear, I’d say!$" + +gTVBravoTrainerBattleTowerText14:: @ 082801E6 + .string "Bravo, {STR_VAR_1}!\n" + .string "Bravo, {STR_VAR_2}!\p" + .string "I hope we can count on seeing\n" + .string "{STR_VAR_1} scale even greater heights!\p" + .string "That’s all the time we have!\n" + .string "Until next time, see you!$" + + .string "Wow!\p" + .string "It’s plain to see that you lavish your\n" + .string "love on your {STR_VAR_1}.\p" + .string "Okay, it’s named {STR_VAR_2}.\p" + .string "Can I ask you a favor?\p" + .string "I’m a TV reporter, and I’m running\n" + .string "a survey on POKéMON.\p" + .string "Would you be willing to answer a few\n" + .string "simple questions for me?$" + + .string "Great! Thank you!\p" + .string "Okay, here goes.\n" + .string "I just need quick answers, okay?$" + + .string "When you first met {STR_VAR_1},\n" + .string "what did you feel?\p" + .string "How would you describe your feelings\n" + .string "at the time?$" + + .string "Your {STR_VAR_1} is cared for lovingly.\p" + .string "If you were to liken it to something\n" + .string "that you like, what would it be?$" + + .string "This question also relates to your\n" + .string "beloved {STR_VAR_1}.\p" + .string "What was it about {STR_VAR_1} that\n" + .string "attracted you?$" + + .string "Okay, that makes sense.\p" + .string "The next question might be a little\n" + .string "on the tough side.\p" + .string "Here goes…\p" + .string "What do POKéMON mean to you?$" + + .string "I see!\p" + .string "Hmhm…\p" + .string "Okay!\n" + .string "Thanks for helping me out.\p" + .string "It was fun and enlightening\n" + .string "chatting with you.\p" + .string "It’s possible that our interview will\n" + .string "end up on TV. Tune in and check!\p" + .string "Okay, that’s all.\n" + .string "Bye-bye!$" + + .string "Oh, okay…\p" + .string "Well, if you get the urge to tell me\n" + .string "about POKéMON, I’ll be here!$" + + .string "I enjoy this job--you get to learn\n" + .string "about POKéMON by doing interviews.$" + + .string "Hi, you seem to be very close to your\n" + .string "{STR_VAR_1}.\p" + .string "Do you know what?\n" + .string "I’m a TV reporter.\p" + .string "I travel around interviewing people\n" + .string "about POKéMON.\p" + .string "I’m wondering if you’d be willing to tell\n" + .string "me a little about your {STR_VAR_1}?$" + + .string "Wow, thank you!\p" + .string "Okay, then, please tell me anything\n" + .string "you’d like about your {STR_VAR_1}.$" + + .string "Wow…\n" + .string "That’s an interesting account.\p" + .string "You really are tight with {STR_VAR_1},\n" + .string "aren’t you?\p" + .string "I get the feeling that your account\n" + .string "will make a great TV story.\p" + .string "I promise that I’ll turn this into\n" + .string "an entertaining show.\l" + .string "Keep your eyes out for it.\p" + .string "Okay, that’s all.\n" + .string "Bye-bye!$" + +gTVFanClubOpinionsText00:: @ 08280886 + .string "WE ARE THE POKéMON FAN CLUB!\p" + .string "We’re on the air!\p" + .string "On this program, we get your opinions,\n" + .string "and I shout them out on your behalf!\l" + .string "Isn’t it a fantastic program concept?\p" + .string "Today, we bring you this report from\n" + .string "our reporter, who we sent out to the\l" + .string "POKéMON FAN CLUB.\p" + .string "So, just who is today’s featured\n" + .string "POKéMON fan?\p" + .string "… … … … … … … …\p" + .string "{STR_VAR_1}!\p" + .string "So, let’s hear what {STR_VAR_1} has to\n" + .string "say about {STR_VAR_3} the {STR_VAR_2}.\p" + .string "And, I will shout those words of love\n" + .string "out loud on TV!\p" + .string "Hoo-hah!\p" + .string "Let’s shout!$" + +gTVFanClubOpinionsText01:: @ 08280A44 + .string "We asked {STR_VAR_1}, “When you first\n" + .string "laid eyes on your {STR_VAR_2}, what was\l" + .string "your initial thought?”\p" + .string "“{STR_VAR_3}!”\p" + .string "Yeahah! That’s a mighty fine shout!\p" + .string "Doesn’t it bring back memories of those\n" + .string "days long gone by?$" + +gTVFanClubOpinionsText02:: @ 08280AFC + .string "We asked {STR_VAR_1}, “If you were to\n" + .string "liken your {STR_VAR_2} to something,\l" + .string "it would be…”\p" + .string "… … … … … … … …\p" + .string "“{STR_VAR_3}!”\p" + .string "Whoah-oh, now that’s an original idea!\p" + .string "You sure can sense the intensity of\n" + .string "feeling the TRAINER has for\l" + .string "{STR_VAR_2}.$" + +gTVFanClubOpinionsText03:: @ 08280BC4 + .string "And let’s see…\n" + .string "What was it about that {STR_VAR_2}\l" + .string "that so attracted {STR_VAR_1}?\p" + .string "… … … … … … … …\p" + .string "“{STR_VAR_3}!”\p" + .string "Whoa! Such a spectacular declaration!\p" + .string "The TRAINER’s love for the {STR_VAR_2}\n" + .string "comes across loud and clear!$" + +gTVFanClubOpinionsText04:: @ 08280C7A + .string "Hm? Oh, there’s still more.\n" + .string "Let’s check it out!\p" + .string "Let me see, now…\p" + .string "We asked {STR_VAR_1}, “What do POKéMON\n" + .string "mean to you?”\p" + .string "… … … … … …\p" + .string "“{STR_VAR_3}!”\p" + .string "Bravo!\p" + .string "That’s the best shout I’ve had all day!\p" + .string "“{STR_VAR_3}!”\p" + .string "It makes you want to shout it out loud\n" + .string "again and again!\p" + .string "Now that we’ve had a great shout, it’s\n" + .string "time to say good-bye until next time!\p" + .string "So, let’s all have one last shout!\n" + .string "All together now…\p" + .string "“{STR_VAR_3}!”$" + +gTVFanClubText00:: @ 08280DEE + .string "WE ARE THE POKéMON FAN CLUB!\p" + .string "We’re on the air!\p" + .string "Today, we’ll get rolling with the\n" + .string "POKéMON SURVEY CORNER.\p" + .string "Out of all the tales woven by POKéMON\n" + .string "and TRAINERS, what startling new drama\l" + .string "will grab our attention today?\p" + .string "Let me see…\p" + .string "This one!\p" + .string "We’ll start with this letter!\p" + .string "It’s a letter from {STR_VAR_1} about a\n" + .string "beloved {STR_VAR_2}.\p" + .string "Let’s see how passionately our writer\n" + .string "can express love for the {STR_VAR_2}!\l" + .string "Hmhm…$" + +gTVFanClubText01:: @ 08280F69 + .string "Whoah!\n" + .string "What an amazing letter!$" + +gTVFanClubText02:: @ 08280F88 + .string "I loved it, so here it is again!$" + +gTVFanClubText03:: @ 08280FA9 + .string "A great letter bears reading over\n" + .string "and over!$" + +gTVFanClubText04:: @ 08280FD5 + .string "The bit “{STR_VAR_3},” that really\n" + .string "accentuates emotional impact!\p" + .string "It’s a great letter that has real\n" + .string "heartfelt depth!$" + +gTVFanClubText05:: @ 08281040 + .string "Especially that “{STR_VAR_3}” bit!\p" + .string "I love how “{STR_VAR_3}” is used!$" + +gTVFanClubText06:: @ 08281073 + .string "By the way, and it’s not important,\n" + .string "but “{STR_VAR_3}” is a great saying.\p" + .string "I’ve been using “{STR_VAR_3}” a lot\n" + .string "in conversations lately.$" + +gTVFanClubText07:: @ 082810E7 + .string "If I had to score this letter,\n" + .string "I’d give it {STR_VAR_3} points.\p" + .string "Next time, I’ll be expecting an even\n" + .string "better letter, {STR_VAR_1}!\p" + .string "A-whoops, will you look at the time?\n" + .string "Time to say good-bye until next time!$" + + .string "Oh?\n" + .string "Do you perhaps like POKéMON?\p" + .string "I’m on assignment with the TV network.\p" + .string "I’m gathering stories on POKéMON and\n" + .string "TRAINERS that occurred recently.\p" + .string "If you don’t mind, could you tell me\n" + .string "something about yourself?$" + + .string "I’m gathering stories on POKéMON and\n" + .string "TRAINERS that occurred recently.\p" + .string "If you don’t mind, could you tell me\n" + .string "something about yourself?$" + + .string "Oh, you will?\n" + .string "Thank you!\p" + .string "Then, please, tell me anything of\n" + .string "interest that you experienced recently\l" + .string "involving POKéMON.$" + + .string "Oh, I see…\p" + .string "Well, if you do have an interesting\n" + .string "story to tell, please let me know.$" + + .string "Oh, what an uplifting story!\p" + .string "I’ll be sure to get your story told\n" + .string "on television.\p" + .string "It should be aired sometime, I think,\n" + .string "so please look forward to it.$" + + .string "Hmmm…\n" + .string "I’ve got a good story for a TV program.\p" + .string "I’d better write it up in a hurry!$" + +gTVRecentHappeningsText00:: @ 0828149E + .string "Hello, it’s time for RECENT HAPPENINGS.\p" + .string "For POKéMON TRAINERS, every day\n" + .string "is a storybook tale.\p" + .string "What we want to do is to introduce you\n" + .string "to some of these POKéMON tales.\p" + .string "Today, we bring you the story\n" + .string "of the TRAINER {STR_VAR_1}.\p" + .string "What did {STR_VAR_1} experience recently?\n" + .string "Let’s find out.\p" + .string "Let’s see…$" + +gTVRecentHappeningsText01:: @ 082815AF + .string "Wasn’t that enlightening?\p" + .string "The story gives you a clear idea of what\n" + .string "{STR_VAR_1} has experienced recently.\l" + .string "It’s as if we were there as witnesses!$" + +gTVRecentHappeningsText02:: @ 08281636 + .string "“{STR_VAR_3}.” That\n" + .string "accents the tale and gives it depth.$" + +gTVRecentHappeningsText03:: @ 08281666 + .string "“{STR_VAR_3}.”\n" + .string "That gives the tale a sense of place.\l" + .string "It lets us envision the tale’s setting.$" + +gTVRecentHappeningsText04:: @ 082816BA + .string "The “{STR_VAR_3}”\n" + .string "section of the tale is very expressive.$" + +gTVRecentHappeningsText05:: @ 082816EB + .string "{STR_VAR_1} has recounted a wonderful\n" + .string "tale involving POKéMON.\p" + .string "And now {STR_VAR_1}’s tale is indelibly\n" + .string "etched into your soul, too.\p" + .string "That’s it for today.\n" + .string "Please tune in next time.$" + +gTVMassOutbreakText00:: @ 0828178A + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "We’ve just received word of a very\n" + .string "rare occurrence.\p" + .string "There have been reports of a mass\n" + .string "outbreak of {STR_VAR_2} in the vicinity\l" + .string "of {STR_VAR_1}.\p" + .string "{STR_VAR_2}, as you’re probably aware,\n" + .string "is known as a POKéMON that’s rare\l" + .string "and hard to find.\p" + .string "It sounds like a rare opportunity to\n" + .string "see the mystifying outbreak of\l" + .string "{STR_VAR_2} in the wild.\p" + .string "That’s the news on POKéMON NEWS.$" + +gTV3CheersForPokeblocksText00:: @ 082818F4 + .string "MC: We hope you’re in good cheer,\n" + .string "“3 CHEERS FOR {POKEBLOCK}S” is here!\p" + .string "Today, we examine the {POKEBLOCK} blended\n" + .string "by {STR_VAR_1} and associates.\p" + .string "Without any delay, let me feed it\n" + .string "to my gourmet POKéMON GULPIN.\p" + .string "… … … … … …\n" + .string "… … … … … …$" + +gTV3CheersForPokeblocksText01:: @ 082819C7 + .string "GULPIN: Gubi! Gubii!\p" + .string "MC: And the verdict is very {STR_VAR_1}!\n" + .string "GULPIN says it tastes “{STR_VAR_2}!”\p" + .string "Thank you so much, {STR_VAR_3}!$" + +gTV3CheersForPokeblocksText02:: @ 08281A2F + .string "{STR_VAR_1}’s blending performance\n" + .string "left something to be desired.\p" + .string "If this TRAINER could blend better,\n" + .string "the {POKEBLOCK} would be much tastier.$" + +gTV3CheersForPokeblocksText03:: @ 08281AAC + .string "GULPIN: Gubi! Gubii!\p" + .string "MC: Hmm… It’s too {STR_VAR_1}.\n" + .string "GULPIN says it tastes “{STR_VAR_2}!”\p" + .string "It looks like {STR_VAR_3}’s errors\n" + .string "hurt the blending quality…$" + +gTV3CheersForPokeblocksText04:: @ 08281B28 + .string "It’s too bad that {STR_VAR_1}’s\n" + .string "leading effort went to waste.\p" + .string "Let’s hope {STR_VAR_2} can turn in\n" + .string "a better showing next time!$" + +gTV3CheersForPokeblocksText05:: @ 08281B93 + .string "Tune in next time!\n" + .string "Our slogan is “3 CHEERS FOR {POKEBLOCK}S!”$" + + .string "Hi, there!\p" + .string "I’m a big fan of {STR_VAR_1}.\n" + .string "What’s your opinion of {STR_VAR_1}?$" + + .string "I see, I see. That’s what you think\n" + .string "about the TRAINER.$" + + .string "Have you completely forgotten\n" + .string "about {STR_VAR_1}?$" + + .string "I’m a big fan of {STR_VAR_1}.\n" + .string "What’s your opinion of {STR_VAR_1}?$" + + .string "How strong would you rate {STR_VAR_1}\n" + .string "on a scale of one hundred?$" + + .string "Have you completely forgotten\n" + .string "about {STR_VAR_1}?$" + + .string "Oh, I see!\n" + .string "You should meet {STR_VAR_1} sometime.\l" + .string "I’m sure you’ll become a fan, too!$" + + .string "I see, I see.\p" + .string "Thank you!\n" + .string "That’s very useful to know.\p" + .string "I’ll share this information with other\n" + .string "{STR_VAR_1} fans and discuss it.$" + + .string "There’s going to be a TV special on\n" + .string "{STR_VAR_1} very soon.\p" + .string "I hope you catch it!$" + +gTVTrainerFanClubSpecialText00:: @ 08281DFB + .string "TRAINER FAN CLUB\n" + .string "{STR_VAR_1} SPECIAL!\p" + .string "This is a special presentation for\n" + .string "the fans of {STR_VAR_1} all over HOENN!\p" + .string "Today, we ask the question, “What do\n" + .string "people think of {STR_VAR_1}?”\p" + .string "We posed the question to {STR_VAR_2}\n" + .string "as the TRAINER representative.\p" + .string "We asked, “In one word, how would\n" + .string "you describe {STR_VAR_1}?”\p" + .string "The reply: “{STR_VAR_3}.”\p" + .string "Kudos to {STR_VAR_2}!\n" + .string "What a perceptive opinion!\p" + .string "“{STR_VAR_3} {STR_VAR_1}.”\n" + .string "It has such a nice ring to it!\p" + .string "{STR_VAR_2} also scored {STR_VAR_1}’s\n" + .string "strength from 0 to 100.$" + +gTVTrainerFanClubSpecialText01:: @ 08281F90 + .string "The score was {STR_VAR_3} points!\n" + .string "That is a very high score indeed!\p" + .string "{STR_VAR_2} must obviously hold\n" + .string "{STR_VAR_1} in very high esteem.$" + +gTVTrainerFanClubSpecialText02:: @ 08281FFA + .string "The score was {STR_VAR_3} points!\n" + .string "That is quite a good score.\p" + .string "{STR_VAR_2} must consider\n" + .string "{STR_VAR_1} to be a rival.$" + +gTVTrainerFanClubSpecialText03:: @ 08282052 + .string "The score was {STR_VAR_3} points!\n" + .string "That’s a rather weak score.\p" + .string "{STR_VAR_2} must consider\n" + .string "{STR_VAR_1} to be a mere sidekick.$" + +gTVTrainerFanClubSpecialText04:: @ 082820B2 + .string "The score was {STR_VAR_3} point(s)!\n" + .string "That’s a terrible score.\p" + .string "{STR_VAR_2} must consider\n" + .string "{STR_VAR_1} to be an underling.$" + +gTVTrainerFanClubSpecialText05:: @ 0828210E + .string "There you have it, folks!\p" + .string "I think we all learned something\n" + .string "new about {STR_VAR_1}.\p" + .string "In closing, I’ll leave you with\n" + .string "{STR_VAR_2}’s words.\p" + .string "{STR_VAR_3} {STR_VAR_1}!$" + +gTVNameRaterText00:: @ 0828218A + .string "And now, it’s time for…\n" + .string "THE NAME RATER SHOW.\p" + .string "I tell your POKéMON’s fortune from\n" + .string "the nickname you’ve bestowed.\p" + .string "Advice is what I have to give, and it is\n" + .string "helpful advice that I offer.\p" + .string "Today, I shall do a reading of\n" + .string "the nickname {STR_VAR_3} of {STR_VAR_1}’s\l" + .string "POKéMON {STR_VAR_2}.\p" + .string "Hmhm…\p" + .string "Hmm…\n" + .string "This nickname is…$" + +gTVNameRaterText01:: @ 0828229E + .string "A nickname that hints at talent in many\n" + .string "different ways.\p" + .string "I urge this TRAINER to take courage\n" + .string "and take on many challenges.$" + +gTVNameRaterText02:: @ 08282317 + .string "A nickname that perfectly complements\n" + .string "{STR_VAR_1}, the TRAINER’s name.\p" + .string "It suggests that you will forge a fine\n" + .string "partnership with precise timing.$" + +gTVNameRaterText03:: @ 0828239D + .string "A nickname fit for a unique individual\n" + .string "of a POKéMON!\p" + .string "If raised properly, this POKéMON’s\n" + .string "uniqueness will bloom excessively!$" + +gTVNameRaterText04:: @ 08282418 + .string "A nickname that will nurture the caring\n" + .string "and compassionate side of POKéMON.\p" + .string "If raised properly, this POKéMON will\n" + .string "come to exhibit real warmth!$" + +gTVNameRaterText05:: @ 082824A6 + .string "A very fine nickname that hints at\n" + .string "greatness to come.\p" + .string "I am intrigued about what the future\n" + .string "holds in store for this POKéMON.$" + +gTVNameRaterText06:: @ 08282522 + .string "A good nickname that should make the\n" + .string "POKéMON hale and hearty!\p" + .string "That POKéMON should remain fit and\n" + .string "robust for a long, long time.$" + +gTVNameRaterText07:: @ 082825A1 + .string "A good nickname that should make the\n" + .string "POKéMON very active!\p" + .string "I should think that this POKéMON will be\n" + .string "a strong performer in battles.$" + +gTVNameRaterText08:: @ 08282623 + .string "An appealing nickname that should make\n" + .string "the POKéMON very charming!\p" + .string "I don’t doubt that this POKéMON will be\n" + .string "quite the charmer in POKéMON CONTESTS.$" + +gTVNameRaterText09:: @ 082826B4 + .string "The nickname {STR_VAR_1} is rooted by\n" + .string "the letter “{STR_VAR_3}.”\p" + .string "That letter is supported by the first\n" + .string "letter “{STR_VAR_2},” which gives it a solid sense\l" + .string "of presence as a nickname.$" + +gTVNameRaterText10:: @ 0828274D + .string "The nickname {STR_VAR_1} is very\n" + .string "shapely in a pleasing manner.\p" + .string "The presence of the letters “{STR_VAR_2}” and\n" + .string "“{STR_VAR_3}”--now that is remarkably good!$" + +gTVNameRaterText11:: @ 082827CB + .string "The nickname {STR_VAR_1}--it has a\n" + .string "sublime, flowing feel to it.\p" + .string "The flow from the initial letter “{STR_VAR_2}” to\n" + .string "“{STR_VAR_3}” is especially wonderful.$" + +gTVNameRaterText12:: @ 08282849 + .string "Let’s examine other examples of fine\n" + .string "nicknames, shall we?$" + +gTVNameRaterText13:: @ 08282883 + .string "Try this example. Take a part of the\n" + .string "TRAINER name of {STR_VAR_1}, and end\l" + .string "up with the fine nickname {STR_VAR_2}{STR_VAR_3}.$" + +gTVNameRaterText14:: @ 082828E4 + .string "The nickname {STR_VAR_2}{STR_VAR_3} would also work\n" + .string "quite well.$" + +gTVNameRaterText15:: @ 08282912 + .string "The POKéMON’s species name of\n" + .string "{STR_VAR_2} could be used as the basis\l" + .string "for making the nickname {STR_VAR_1}{STR_VAR_3}.$" + +gTVNameRaterText16:: @ 0828296C + .string "{STR_VAR_1}{STR_VAR_3} would also be an effective\n" + .string "nickname.$" + +gTVNameRaterText17:: @ 08282996 + .string "What should always be avoided is using\n" + .string "another POKéMON species name.\p" + .string "For instance, avoid taking the name of\n" + .string "{STR_VAR_2} to make the nickname {STR_VAR_1}{STR_VAR_3}.\l" + .string "That is unacceptable.$" + +gTVNameRaterText18:: @ 08282A36 + .string "I must say that {STR_VAR_1} is quite\n" + .string "a good nickname.\p" + .string "I hope that the TRAINER will continue\n" + .string "to treat {STR_VAR_1} with love.\p" + .string "That’s it for today’s show.\n" + .string "May we meet again.$" + +gTVPokemonAnglerText00:: @ 08282ACF + .string "{STR_VAR_2} ANGLER\p" + .string "ANNOUNCER: Hello! Today, we’ll get tips\n" + .string "on fishing for {STR_VAR_2}.\p" + .string "GURU, what advice can you give for\n" + .string "catching {STR_VAR_2}?\p" + .string "GURU: Hm? Catching {STR_VAR_2}?\n" + .string "Well, let me tell you, be patient and\l" + .string "wait. That’s the bottom line.\p" + .string "Do you see {STR_VAR_1} over there?\n" + .string "That TRAINER makes a good example.\p" + .string "That TRAINER’s already had\n" + .string "{STR_VAR_3} POKéMON get away.\p" + .string "But there {STR_VAR_1} waits. No giving up.\n" + .string "That’s the law for catching {STR_VAR_2}.\p" + .string "ANNOUNCER: I see…\p" + .string "Oh! {STR_VAR_1} has finally landed an\n" + .string "elusive {STR_VAR_2}!\p" + .string "The TRAINER appears close to tears\n" + .string "out of sheer joy!\p" + .string "Seeing that elated look, I’m getting\n" + .string "the itch to go fishing, too!\p" + .string "Viewers, why not take this as a cue to\n" + .string "try some {STR_VAR_2} fishing?\p" + .string "Until our next broadcast, farewell and\n" + .string "good fishing to you all!$" + +gTVPokemonAnglerText01:: @ 08282D7C + .string "{STR_VAR_2} ANGLER\p" + .string "ANNOUNCER: Hello! Today, we’ll get tips\n" + .string "on fishing for {STR_VAR_2}.\p" + .string "GURU, what advice can you give for\n" + .string "catching {STR_VAR_2}?\p" + .string "GURU: Hm? Catching {STR_VAR_2}?\n" + .string "Well, let me tell you, use your fishing\l" + .string "ROD with vigor!\p" + .string "Do you see {STR_VAR_1} over there?\n" + .string "See how the ROD is handled?\p" + .string "That TRAINER’s already caught\n" + .string "{STR_VAR_3} in a row.\p" + .string "ANNOUNCER: It’s incredible!\n" + .string "It looks like a storm…\p" + .string "Seeing technique of that caliber, I’m\n" + .string "getting the itch to go fishing, too.\p" + .string "Viewers, why not take this as a cue to\n" + .string "try some {STR_VAR_2} fishing?\p" + .string "Until our next broadcast, farewell and\n" + .string "good fishing to you all!$" + +gTVPokemonTodayFailedText00:: @ 08282F9B + .string "Hello!\p" + .string "It’s time for POKéMON TODAY!\p" + .string "BIG SIS: Hi! Is everyone peachy and\n" + .string "perky today?\p" + .string "Today, we’re going to look at {STR_VAR_1}’s\n" + .string "POKéMON {STR_VAR_2}!\p" + .string "BIG BRO: Yeah! That’s what we’re going\n" + .string "to do!$" + +gTVPokemonTodayFailedText01:: @ 0828304D + .string "Oh!\n" + .string "Speaking of {STR_VAR_1}…\p" + .string "BIG SIS, I saw the TRAINER with my very\n" + .string "own eyes!\p" + .string "BIG SIS: Oh, what did you see?\p" + .string "BIG BRO: Well, I had to go on a trip to\n" + .string "{STR_VAR_2}.\p" + .string "That’s when I happened to come across\n" + .string "{STR_VAR_1}, who was trying to catch the\l" + .string "POKéMON {STR_VAR_3}, but…$" + +gTVPokemonTodayFailedText02:: @ 08283135 + .string "The POKéMON managed to get away!\p" + .string "It ended up wasting this many\n" + .string "POKé BALLS: {STR_VAR_2}!\p" + .string "You should have seen the expression\n" + .string "of frustration on {STR_VAR_1}’s face when\l" + .string "the POKéMON took off!$" + +gTVPokemonTodayFailedText03:: @ 082831DF + .string "But {STR_VAR_1} goofed and made the\n" + .string "POKéMON faint!\p" + .string "It ended up wasting this many\n" + .string "POKé BALLS: {STR_VAR_2}!\p" + .string "You should have seen the expression\n" + .string "of stunned dismay on {STR_VAR_1}’s face\l" + .string "when the POKéMON fainted!$" + +gTVPokemonTodayFailedText04:: @ 08283294 + .string "BIG SIS: Hey, there!\n" + .string "That’s not nice!\p" + .string "You shouldn’t be laughing at other\n" + .string "people’s misfortune!\p" + .string "Oh, poor {STR_VAR_1}.\n" + .string "What a shame!\p" + .string "BIG BRO: That’s true!\n" + .string "Sorry for laughing.$" + +gTVPokemonTodayFailedText05:: @ 08283337 + .string "BIG SIS: Bufufu…\p" + .string "BIG BRO: Hey!\n" + .string "You just laughed, too!\p" + .string "BIG SIS: Huh?!\p" + .string "I didn’t laugh!\n" + .string "Honestly, I didn’t!\p" + .string "Oh, poor {STR_VAR_1}.\n" + .string "What a shame!\p" + .string "BIG BRO: …$" + +gTVPokemonTodayFailedText06:: @ 082833C6 + .string "BIG SIS: That’s enough silliness!\n" + .string "Let’s look at today’s POKéMON…\p" + .string "Huh?\n" + .string "We’re out of time already?\p" + .string "Aww!\n" + .string "We couldn’t profile a POKéMON today!\p" + .string "BIG BRO: See you again next time!\p" + .string "BIG SIS: Hey, don’t end the show\n" + .string "without me!$" + +gTVPokemonTodaySuccessfulText00:: @ 082834A0 + .string "Hello!\p" + .string "It’s time for POKéMON TODAY!\p" + .string "BIG SIS: Hi! Is everyone peachy and\n" + .string "perky today?\p" + .string "Today, we’re going to look at {STR_VAR_1}’s\n" + .string "POKéMON {STR_VAR_2}!\p" + .string "BIG BRO: Yeah! That’s what we’re going\n" + .string "to do!$" + +gTVPokemonTodaySuccessfulText01:: @ 08283552 + .string "BIG SIS: {STR_VAR_1} gave the nickname\n" + .string "{STR_VAR_3} to the {STR_VAR_2}!\p" + .string "It sounds like {STR_VAR_3} is getting\n" + .string "good, loving care!$" + +gTVPokemonTodaySuccessfulText02:: @ 082835AE + .string "BIG BRO: The TRAINER had to throw this\n" + .string "many POKé BALLS to catch it: {STR_VAR_3}!\p" + .string "It finally took a single {STR_VAR_2}\n" + .string "to catch it!$" + +gTVPokemonTodaySuccessfulText03:: @ 0828361F + .string "BIG SIS: If it was that easy to catch,\n" + .string "it must have been destiny that brought\l" + .string "{STR_VAR_1} and the {STR_VAR_2} together!$" + +gTVPokemonTodaySuccessfulText04:: @ 08283685 + .string "BIG SIS: Wow! That’s so neat!\p" + .string "But you know what they say, a POKéMON\n" + .string "that takes a lot of effort to catch\l" + .string "earns the love of its TRAINER!$" + +gTVPokemonTodaySuccessfulText05:: @ 0828370C + .string "BIG SIS: {STR_VAR_1}’s {STR_VAR_2} is a\n" + .string "memorable POKéMON because it took an\l" + .string "invaluable MASTER BALL to catch!\p" + .string "BIG BRO: Wow! That’s mega-awesome!\p" + .string "BIG SIS: {STR_VAR_1} must have really\n" + .string "wanted that {STR_VAR_2}, for sure!$" + +gTVPokemonTodaySuccessfulText06:: @ 082837C2 + .string "BIG BRO: Then to give the nickname\n" + .string "{STR_VAR_3} to that {STR_VAR_2}…\p" + .string "You really get a good idea about\n" + .string "{STR_VAR_1}’s TRAINER sense.\p" + .string "BIG SIS: I second that notion!$" + +gTVPokemonTodaySuccessfulText07:: @ 08283848 + .string "If it were me, I’d give that nickname\n" + .string "to something like this {STR_VAR_3}!\p" + .string "BIG BRO: Whoa! That could be the start\n" + .string "of something new!$" + +gTVPokemonTodaySuccessfulText08:: @ 082838C2 + .string "{STR_VAR_2} the {STR_VAR_1}?\n" + .string "Doesn’t that sound perfect?\p" + .string "The letters and everything--they\n" + .string "sound just right for the POKéMON\l" + .string "{STR_VAR_1}!\p" + .string "BIG BRO: Yeah, true, that!$" + +gTVPokemonTodaySuccessfulText09:: @ 0828394A + .string "As far as I know, no TRAINER has ever\n" + .string "given the nickname {STR_VAR_2} to their\l" + .string "{STR_VAR_1}!\p" + .string "BIG BRO: That just goes to show what\n" + .string "great taste the TRAINER has in picking\l" + .string "nicknames!$" + +gTVPokemonTodaySuccessfulText10:: @ 082839EA + .string "The next time I catch a POKéMON,\n" + .string "I should give it the name {STR_VAR_2}.\p" + .string "BIG BRO: Huh? Me, too!\n" + .string "I’ll use the nickname {STR_VAR_2}, too!$" + +gTVPokemonTodaySuccessfulText11:: @ 08283A5F + .string "BIG SIS: Oh, no!\n" + .string "Look at the time!\p" + .string "Well, gang, this is it for today.\n" + .string "See you again next time!\p" + .string "BIG BRO: Remember, it could be your\n" + .string "POKéMON in the spotlight next time!$" + +gTVTodaysSmartShopperText00:: @ 08283B05 + .string "Hello!\p" + .string "It’s time for TODAY’S SMART SHOPPER.\p" + .string "INTERVIEWER: How are you, viewers?\p" + .string "Today we’re visiting a shop\n" + .string "in {STR_VAR_2}.\p" + .string "Let’s check on what the hot sellers\n" + .string "have been recently.$" + +gTVTodaysSmartShopperText01:: @ 08283BAF + .string "Let’s interview the clerk to get the\n" + .string "lowdown.\p" + .string "Hi, how’s your business?\p" + .string "CLERK: Oh, we’re doing excellent.\p" + .string "Recently, {STR_VAR_2} has been\n" + .string "selling especially strongly.\p" + .string "Why, just the other day a TRAINER\n" + .string "named {STR_VAR_1} bought {STR_VAR_3}.$" + +gTVTodaysSmartShopperText02:: @ 08283C81 + .string "INTERVIEWER: The TRAINER bought\n" + .string "{STR_VAR_3} {STR_VAR_2}S? That’s a haul!\p" + .string "If I may say so, {STR_VAR_1} must have\n" + .string "been stocking up for a long journey\l" + .string "to far-off places.\p" + .string "For traveling, {STR_VAR_2}S are so\n" + .string "important!$" + +gTVTodaysSmartShopperText03:: @ 08283D32 + .string "INTERVIEWER: Speaking of the item\n" + .string "{STR_VAR_2}, I just bought {STR_VAR_3} of\l" + .string "them recently.\p" + .string "After all, {STR_VAR_2}’s a great item!$" + +gTVTodaysSmartShopperText04:: @ 08283D99 + .string "INTERVIEWER: {STR_VAR_2}?!\n" + .string "But {STR_VAR_3} of them?!\p" + .string "I didn’t think there would be anyone\n" + .string "buying that many.\p" + .string "My goodness, I can only afford one or\n" + .string "two at a time…$" + +gTVTodaysSmartShopperText05:: @ 08283E28 + .string "INTERVIEWER: One time, I bought\n" + .string "a whole lot of the item {STR_VAR_2}.\p" + .string "But it turned out to be too many.\n" + .string "I ended up regretting it…\p" + .string "Since then, I only buy strictly what\n" + .string "I absolutely need…\p" + .string "Oops!\p" + .string "There’s no point talking about me!$" + +gTVTodaysSmartShopperText06:: @ 08283F01 + .string "CLERK: {STR_VAR_1} also bought the item\n" + .string "{STR_VAR_2} in bulk, taking {STR_VAR_3}.\p" + .string "INTERVIEWER: Oh, that’s smart.\n" + .string "{STR_VAR_2}’s a very good item, too.$" + +gTVTodaysSmartShopperText07:: @ 08283F72 + .string "CLERK: And, the TRAINER also bought\n" + .string "{STR_VAR_3} of the item {STR_VAR_2}.$" + +gTVTodaysSmartShopperText08:: @ 08283FA9 + .string "CLERK: Plus, it was during a big sale.\n" + .string "That’s smart shopping.$" + +gTVTodaysSmartShopperText09:: @ 08283FE7 + .string "INTERVIEWER: Hmm… {STR_VAR_1} sounds like\n" + .string "quite the shrewd bargain hunter!\p" + .string "In total, {STR_VAR_1}’s purchases came to…\p" + .string "¥{STR_VAR_2}?!\n" + .string "What an amazing sum!\p" + .string "Oops! We’re out of time!\n" + .string "See you on our next broadcast!$" + +gTVTodaysSmartShopperText10:: @ 0828409E + .string "CLERK: {STR_VAR_1} is a VIP customer,\n" + .string "no doubt about it.$" + +gTVTodaysSmartShopperText11:: @ 082840CE + .string "Let’s interview the clerk to get the\n" + .string "lowdown.\p" + .string "Hi, how’s your business?\p" + .string "CLERK: Oh, we’re doing unbelievable\n" + .string "business. It’s almost overwhelming.\p" + .string "Recently, a TRAINER named {STR_VAR_1}\n" + .string "bought the item {STR_VAR_2} in bulk.\p" + .string "The TRAINER almost cleared out our\n" + .string "entire stock of {STR_VAR_2}S.\p" + .string "I never dreamt that any customer\n" + .string "would ever need so many {STR_VAR_2}S.\l" + .string "It’s just unheard of!\p" + .string "INTERVIEWER: So that would be like 100\n" + .string "or 200 sold?\p" + .string "CLERK: Oh, no, much more than that!\p" + .string "INTERVIEWER: Oh, my goodness!\n" + .string "{STR_VAR_1} must be a special shopper!\p" + .string "CLERK: {STR_VAR_1} is a VIP customer,\n" + .string "no doubt about it.$" + +gTVTodaysSmartShopperText12:: @ 082842E6 + .string "INTERVIEWER: Hmm…\n" + .string "That is amazing.\p" + .string "But why would the TRAINER need to buy\n" + .string "so many?\p" + .string "… …\p" + .string "The mystery deepens, but this is all\n" + .string "the time we have today.\l" + .string "See you on our next broadcast!\p" + .string "Still, {STR_VAR_1} is certainly an enigma…$" + +gTVWorldOfMastersText00:: @ 082843BA + .string "THE WORLD OF MASTERS\p" + .string "Hello, viewers.\p" + .string "Perhaps you are aware of a TRAINER\n" + .string "named {STR_VAR_1}.\p" + .string "{STR_VAR_1} is famous as a master at\n" + .string "catching POKéMON.\p" + .string "{STR_VAR_1}’s quest for POKéMON depends\n" + .string "entirely on a careful search on foot.\p" + .string "On one memorable day, the TRAINER\n" + .string "walked some {STR_VAR_2} steps.\p" + .string "The total number of POKéMON caught\n" + .string "that day reached an impressive {STR_VAR_3}!$" + +gTVWorldOfMastersText01:: @ 082844FD + .string "That remarkable feat must have been\n" + .string "possible because of the trust between\l" + .string "the TRAINER and {STR_VAR_1}.$" + +gTVWorldOfMastersText02:: @ 0828455B + .string "The master caught the day’s last\n" + .string "{STR_VAR_3} near {STR_VAR_2}.\p" + .string "That POKéMON apparently enjoys\n" + .string "a special status as a record holder.\p" + .string "Skilled TRAINERS should be encouraged\n" + .string "to challenge this fine record.\p" + .string "That’s all for today.\n" + .string "Please tune in next time.$" + +gTVTodaysRivalTrainerText00:: @ 08284641 + .string "TODAY’S RIVAL TRAINER!\p" + .string "Hello, fellow POKéMON TRAINERS!\n" + .string "How are we all doing today?\p" + .string "Today, like every other day,\n" + .string "we’ll examine one of our rivals!$" + +gTVTodaysRivalTrainerText07:: @ 082846D2 + .string "Today’s rival TRAINER is {STR_VAR_1},\n" + .string "who’s around {STR_VAR_3} now.\p" + .string "{STR_VAR_1} has so far registered\n" + .string "{STR_VAR_2} POKéMON in the POKéDEX.$" + +gTVTodaysRivalTrainerText08:: @ 08284738 + .string "Today’s rival TRAINER is {STR_VAR_1},\n" + .string "who’s in a SECRET BASE now.\p" + .string "{STR_VAR_1} has so far registered\n" + .string "{STR_VAR_2} POKéMON in the POKéDEX.$" + +gTVTodaysRivalTrainerText09:: @ 082847A5 + .string "Today’s rival TRAINER is {STR_VAR_1}.\p" + .string "So far, {STR_VAR_1} has registered\n" + .string "{STR_VAR_2} POKéMON in the POKéDEX.$" + +gTVTodaysRivalTrainerText10:: @ 082847F7 + .string "Today’s rival TRAINER is {STR_VAR_1},\n" + .string "who’s on a ferry now.\p" + .string "{STR_VAR_1} has so far registered\n" + .string "{STR_VAR_2} POKéMON in the POKéDEX.$" + + .string "$" + +gTVTodaysRivalTrainerText01:: @ 0828485F + .string "And how many BADGES does our rival\n" + .string "have? The number is {STR_VAR_1}!$" + +gTVTodaysRivalTrainerText02:: @ 0828489A + .string "But our rival hasn’t obtained\n" + .string "a single BADGE yet!$" + +gTVTodaysRivalTrainerText03:: @ 082848CC + .string "Our rival hasn’t obtained a single\n" + .string "BATTLE FRONTIER Symbol yet.$" + +gTVTodaysRivalTrainerText04:: @ 0828490B + .string "Let’s see how many BATTLE FRONTIER\n" + .string "Symbols our rival has.\p" + .string "Gold Symbols: {STR_VAR_1}!\n" + .string "Silver Symbols: {STR_VAR_2}!$" + +gTVTodaysRivalTrainerText05:: @ 0828496B + .string "Our rival has collected {STR_VAR_1} Battle\n" + .string "Point(s) at the BATTLE FRONTIER.$" + +gTVTodaysRivalTrainerText06:: @ 082849AE + .string "So, how did you measure up in\n" + .string "comparison to {STR_VAR_1}?\p" + .string "The adventure rolls on!\p" + .string "Fellow TRAINERS!\p" + .string "Let’s all keep moving forward\n" + .string "and ahead of our rivals!$" + +gTVDewfordTrendWatcherNetworkText00:: @ 08284A3E + .string "DEWFORD TREND-WATCHER NETWORK!\p" + .string "MC: Wassup?\n" + .string "We’ll keep it real with the latest on\l" + .string "what’s hip and happening in DEWFORD.\p" + .string "Our guest today is this old cat whose\n" + .string "claim to fame is being the authority\l" + .string "on all things in DEWFORD.\p" + .string "Old man: Glad to be here.\p" + .string "MC: Let’s cut to the chase, right on.\p" + .string "What’s your word on what’s groovin’\n" + .string "the good folks of DEWFORD?\p" + .string "Old man: {STR_VAR_1} {STR_VAR_2}.\p" + .string "MC: {STR_VAR_1} {STR_VAR_2},\n" + .string "you say?\p" + .string "Old man: No.\p" + .string "{STR_VAR_1} {STR_VAR_2} never\n" + .string "did get popular at all.\p" + .string "Would you like to hear about it?\p" + .string "MC: Uh, no. What we want to know is\n" + .string "what’s the in thing of the moment…$" + +gTVDewfordTrendWatcherNetworkText01:: @ 08284C55 + .string "Old man: {STR_VAR_1} {STR_VAR_2}\n" + .string "was what {STR_VAR_3} from LITTLEROOT\l" + .string "taught me as being trendy…$" + +gTVDewfordTrendWatcherNetworkText02:: @ 08284C9B + .string "Old man: {STR_VAR_1} {STR_VAR_2}\n" + .string "was what {STR_VAR_3} from LITTLEROOT\l" + .string "taught me as being trendy…$" + +gTVDewfordTrendWatcherNetworkText03:: @ 08284CE1 + .string "But it was utterly hopeless.\p" + .string "{STR_VAR_1} {STR_VAR_2} festival!\p" + .string "{STR_VAR_1} {STR_VAR_2} contest!\p" + .string "I tried teaching everyone the best\n" + .string "I could, but…\p" + .string "Perhaps the {STR_VAR_1} part just\n" + .string "wasn’t right…\p" + .string "MC: Uh, excuse me, compadre, I need\n" + .string "to hear about what’s in now…$" + +gTVDewfordTrendWatcherNetworkText04:: @ 08284DB6 + .string "Old man: {STR_VAR_3}!\n" + .string "Please, tell me something bigger than\l" + .string "that {STR_VAR_1} {STR_VAR_2}!$" + +gTVDewfordTrendWatcherNetworkText05:: @ 08284DF5 + .string "Old man: {STR_VAR_3}!\n" + .string "Please, tell me something bigger than\l" + .string "that {STR_VAR_1} {STR_VAR_2}!$" + +gTVDewfordTrendWatcherNetworkText06:: @ 08284E34 + .string "MC: …Uh… So, there you have it,\n" + .string "all you trendy, hep cats out there!\p" + .string "{STR_VAR_1} {STR_VAR_2}…uh…\n" + .string "Didn’t get hip or happening in DEWFORD!\p" + .string "My time is up. Catch you on the fly!\p" + .string "Old man: {STR_VAR_1} {STR_VAR_2}!$" + +gTVHoennTreasureInvestigatorsText00:: @ 08284EDF + .string "HOENN TREASURE INVESTIGATORS!\p" + .string "Hi, gang!\n" + .string "Score any secret items lately?\p" + .string "As always, we’ll examine eyewitness\n" + .string "reports of secrets from all over!\p" + .string "Let’s start with a letter.\n" + .string "It says, “{STR_VAR_1} discovered!”$" + +gTVHoennTreasureInvestigatorsText01:: @ 08284FA1 + .string "Wow, we’d better check this letter\n" + .string "out! Let me read it to you.\p" + .string "…Dear INVESTIGATORS,\n" + .string "I hope you are well.\p" + .string "I recently saw {STR_VAR_2} somewhere\n" + .string "around {STR_VAR_3}.\p" + .string "The TRAINER found the item\n" + .string "{STR_VAR_1}. It made me envious.\p" + .string "…Well, good going, {STR_VAR_2}!\p" + .string "Viewers, let that motivate you to\n" + .string "fire up your ITEMFINDERS and search!\p" + .string "I’ll be waiting for exciting news\n" + .string "from all of you!$" + +gTVHoennTreasureInvestigatorsText02:: @ 082850F5 + .string "Wow, we’d better check this letter\n" + .string "out! Let me read it to you.\p" + .string "…Dear INVESTIGATORS,\n" + .string "I hope you are well.\p" + .string "I recently saw {STR_VAR_2} on a ferry.\p" + .string "The TRAINER found the item\n" + .string "{STR_VAR_1}. It made me envious.\p" + .string "…Well, good going, {STR_VAR_2}!\p" + .string "Viewers, let that motivate you to\n" + .string "fire up your ITEMFINDERS and search!\p" + .string "I’ll be waiting for exciting news\n" + .string "from all of you!$" + +gTVFindThatGamerText00:: @ 08285240 + .string "FIND THAT GAMER!\p" + .string "Hey, all you gamers!\n" + .string "How’s your {STR_VAR_2} spinning?\p" + .string "Like always, we’ll cast our spotlight\n" + .string "on a rare TRAINER who’s visited the\l" + .string "GAME CORNER!\p" + .string "Today, our no. 1 gamer is…\n" + .string "{STR_VAR_1}!$" + +gTVFindThatGamerText01:: @ 082852F4 + .string "{STR_VAR_1} played the {STR_VAR_2} game\n" + .string "and won a rare {STR_VAR_3} COINS.\p" + .string "“When {STR_VAR_1} comes, we need to\n" + .string "make sure we have enough COINS.”\p" + .string "That’s what the GAME CORNER clerks\n" + .string "mutter when our gamer is in play!\p" + .string "Viewers, it’s best to watch your COINS\n" + .string "like {STR_VAR_1} if you visit the GAME\l" + .string "CORNER and play the {STR_VAR_2} game.\p" + .string "This is live from the GAME CORNER--\n" + .string "where you can feel the excitement!\p" + .string "That’s all for today!$" + +gTVFindThatGamerText02:: @ 08285463 + .string "{STR_VAR_1} played the {STR_VAR_2} game\n" + .string "and lost {STR_VAR_3} COINS.\p" + .string "“When {STR_VAR_1} comes, our COIN\n" + .string "sales seem to increase.”\p" + .string "That’s what the GAME CORNER clerks\n" + .string "say when our gamer is in play!$" + +gTVFindThatGamerText03:: @ 08285500 + .string "Viewers, it’s best to watch your COINS\n" + .string "like {STR_VAR_1} if you visit the GAME\l" + .string "CORNER and play the {STR_VAR_2} game.\p" + .string "This is live from the GAME CORNER--\n" + .string "where you can feel the excitement!\p" + .string "That’s all for today!$" + +gTVBreakingNewsText00:: @ 082855BF + .string "BREAKING NEWS TV!$" + +gTVBreakingNewsText01:: @ 082855D1 + .string "Rare {STR_VAR_2} caught by\n" + .string "{STR_VAR_1}!\p" + .string "We’re live from the vicinity of\n" + .string "{STR_VAR_3}!\p" + .string "{STR_VAR_1} successfully captured\n" + .string "a rare {STR_VAR_2} earlier here!$" + +gTVBreakingNewsText02:: @ 0828563C + .string "When {STR_VAR_1} encountered the rare\n" + .string "{STR_VAR_2}, the TRAINER sent out\l" + .string "the POKéMON {STR_VAR_3}.$" + +gTVBreakingNewsText03:: @ 08285682 + .string "In the battle, the number of POKé\n" + .string "BALLS thrown by the TRAINER was {STR_VAR_1}.\p" + .string "Ultimately, the rare POKéMON was\n" + .string "caught by the {STR_VAR_2} used last.$" + +gTVBreakingNewsText04:: @ 08285705 + .string "In that instant, {STR_VAR_2}\n" + .string "echoed with {STR_VAR_1}’s roars of\l" + .string "triumphant joy.\p" + .string "I must say I’m a little envious of\n" + .string "{STR_VAR_1}. I’d love to roar, too.\p" + .string "…That ends the live feed from\n" + .string "the happy scene!$" + +gTVBreakingNewsText05:: @ 082857B0 + .string "{STR_VAR_1} fails to capture a rare\n" + .string "{STR_VAR_2}!\p" + .string "We’re live from the vicinity of\n" + .string "{STR_VAR_3}!\p" + .string "It was here that {STR_VAR_1} failed\n" + .string "to capture a rare {STR_VAR_2}!$" + +gTVBreakingNewsText06:: @ 08285824 + .string "When {STR_VAR_1} encountered the rare\n" + .string "{STR_VAR_2}, the TRAINER sent out\l" + .string "the POKéMON {STR_VAR_3}.$" + +gTVBreakingNewsText07:: @ 0828586A + .string "The TRAINER made the {STR_VAR_2}\n" + .string "use the move {STR_VAR_1}.\p" + .string "Without meaning to, the TRAINER\n" + .string "made the rare POKéMON faint…$" + +gTVBreakingNewsText12:: @ 082858D0 + .string "However, {STR_VAR_1} panicked at\n" + .string "the sight of the rare {STR_VAR_2}.\p" + .string "In confusion, the TRAINER ordered\n" + .string "{STR_VAR_3} to attack.\p" + .string "Without meaning to, the TRAINER\n" + .string "made the rare POKéMON faint.$" + +gTVBreakingNewsText08:: @ 0828596F + .string "In that instant, {STR_VAR_2}\n" + .string "echoed with {STR_VAR_1}’s shrieks of\l" + .string "frustration…$" + +gTVBreakingNewsText09:: @ 082859AC + .string "However, {STR_VAR_1} seemed to run\n" + .string "out of POKé BALLS.\p" + .string "The TRAINER had to break off\n" + .string "the battle with the rare {STR_VAR_2}.\p" + .string "In that instant, {STR_VAR_3}\n" + .string "echoed with {STR_VAR_1}’s shrieks of\l" + .string "frustration…$" + +gTVBreakingNewsText10:: @ 08285A50 + .string "However, the {STR_VAR_2} fled without\n" + .string "warning.\p" + .string "In that instant, {STR_VAR_3}\n" + .string "echoed with {STR_VAR_1}’s shrieks of\l" + .string "frustration…$" + +gTVBreakingNewsText11:: @ 08285AB3 + .string "I must say I feel for {STR_VAR_1}.\n" + .string "Why, it makes me want to shriek, too.\p" + .string "…That ends the live feed from\n" + .string "the melancholy scene!$" + +gTVSecretBaseVisitText00:: @ 08285B27 + .string "Hello, folks!\n" + .string "It’s time again for\l" + .string "a SECRET BASE VISIT.\p" + .string "Today, we visit the SECRET BASE\n" + .string "of {STR_VAR_1}.\p" + .string "How has {STR_VAR_1} personalized\n" + .string "the SECRET BASE?\p" + .string "Let’s find out!\n" + .string "… … … … … …$" + +gTVSecretBaseVisitText01:: @ 08285BCA + .string "Oh!\n" + .string "How marvelous!\p" + .string "This {STR_VAR_2}…\n" + .string "It’s not what one would expect to\l" + .string "find here!$" + +gTVSecretBaseVisitText02:: @ 08285C13 + .string "Oh!\n" + .string "How remarkable!\p" + .string "There isn’t a single piece\n" + .string "of furniture or interior goods!\p" + .string "Mere mortals couldn’t hope to\n" + .string "imitate this bold statement!\p" + .string "It’s simple, but it bursts, yes,\n" + .string "bursts with wildness!\p" + .string "My hat’s off to you, {STR_VAR_1}.\n" + .string "It had to be you!$" + +gTVSecretBaseVisitText03:: @ 08285CFF + .string "Oh! I see!\n" + .string "With perfect clarity, I see it!\p" + .string "This {STR_VAR_2} being here…\n" + .string "It sends an effective message!$" + +gTVSecretBaseVisitText04:: @ 08285D5D + .string "Oh! I see!\n" + .string "With perfect clarity, I see it!\p" + .string "This space is kept deliberately\n" + .string "clear of interior items!\p" + .string "It sends an effective message!$" + +gTVSecretBaseVisitText05:: @ 08285DE0 + .string "Wheeew!\p" + .string "The pairing of the {STR_VAR_2}\n" + .string "with the {STR_VAR_3}!\p" + .string "It’s a dream combination if there\n" + .string "ever was one!$" + +gTVSecretBaseVisitText06:: @ 08285E3B + .string "Wheeew!\p" + .string "The placement of this {STR_VAR_2}\n" + .string "right here…\p" + .string "It has a presence that fills\n" + .string "the entire SECRET BASE!$" + +gTVSecretBaseVisitText07:: @ 08285E9D + .string "Wheeew!\p" + .string "There’s nothing in place here.\p" + .string "This empty space has an effect on\n" + .string "the entire SECRET BASE.$" + +gTVSecretBaseVisitText08:: @ 08285EFE + .string "Oh!\n" + .string "Here comes {STR_VAR_1}!\l" + .string "Let’s challenge the TRAINER!\p" + .string "… … … … … …\n" + .string "… … … … … …$" + +gTVSecretBaseVisitText09:: @ 08285F46 + .string "Sigh…\n" + .string "I’ve got to hand it to {STR_VAR_1}.\p" + .string "The TRAINER’s POKéMON were truly\n" + .string "worthy of the CHAMPION’s title.\p" + .string "They gave ample proof of {STR_VAR_1}’s\n" + .string "toughness as a TRAINER.\p" + .string "That the {STR_VAR_2} knew the move\n" + .string "{STR_VAR_3}…\p" + .string "It shows you what sort of a TRAINER\n" + .string "{STR_VAR_1} is.\p" + .string "Certainly, it was quite a lesson!$" + +gTVSecretBaseVisitText10:: @ 08286049 + .string "Aiyeeh!\n" + .string "I’ve got to hand it to {STR_VAR_1}.\p" + .string "The TRAINER’s POKéMON were\n" + .string "monstrously tough!\p" + .string "They gave ample proof of {STR_VAR_1}’s\n" + .string "tenacity as a TRAINER.\p" + .string "That the {STR_VAR_2} knew the move\n" + .string "{STR_VAR_3}…\p" + .string "It shows you what sort of a TRAINER\n" + .string "{STR_VAR_1} is.\p" + .string "Certainly, it was quite a lesson!$" + +gTVSecretBaseVisitText11:: @ 0828613A + .string "Wheeew!\n" + .string "I’ve got to hand it to {STR_VAR_1}.\p" + .string "The TRAINER’s POKéMON were clearly\n" + .string "raised in a well-balanced manner.\p" + .string "They gave ample proof of {STR_VAR_1}’s\n" + .string "thoughtfulness as a TRAINER.\p" + .string "That the {STR_VAR_2} knew the move\n" + .string "{STR_VAR_3}…\p" + .string "It shows you what sort of a TRAINER\n" + .string "{STR_VAR_1} is.\p" + .string "Certainly, it was quite a lesson!$" + +gTVSecretBaseVisitText12:: @ 08286248 + .string "Well, well!\n" + .string "I’ve got to hand it to {STR_VAR_1}.\p" + .string "The TRAINER’s POKéMON showed\n" + .string "great promise for future growth.\p" + .string "They represented {STR_VAR_1}’s\n" + .string "hopes and dreams.\p" + .string "That the {STR_VAR_2} knew the move\n" + .string "{STR_VAR_3}…\p" + .string "It shows you what sort of a TRAINER\n" + .string "{STR_VAR_1} is.\p" + .string "Certainly, it was quite a lesson!$" + +gTVSecretBaseVisitText13:: @ 08286340 + .string "I must say, what a superb SECRET BASE\n" + .string "it was!\p" + .string "Viewers, if you have the chance,\n" + .string "do visit {STR_VAR_1}’s SECRET BASE.\p" + .string "Until next time, I bid you adieu!$" + +gTVPokemonLotteryWinnerFlashReportText00:: @ 082863CC + .string "It’s exciting!\n" + .string "It’s dramatic!\p" + .string "It’s the POKéMON LOTTERY\n" + .string "WINNER FLASH REPORT!\p" + .string "Hello! We’re coming at you live from\n" + .string "the POKéMON LOTTERY CORNER on\l" + .string "the ground floor of the LILYCOVE\l" + .string "DEPARTMENT STORE!\p" + .string "Like it always happens, another\n" + .string "lucky TRAINER appeared today!\p" + .string "That TRAINER’s name…\n" + .string "{STR_VAR_1}!\p" + .string "{STR_VAR_1} won the {STR_VAR_2} prize\n" + .string "and took home the {STR_VAR_3}!\p" + .string "{STR_VAR_1}!\n" + .string "Congratulations!\p" + .string "Viewers, don’t just watch,\n" + .string "get in on the action!\p" + .string "All of us at the LILYCOVE DEPARTMENT\n" + .string "STORE look forward to your next visit!\p" + .string "This has been a live broadcast from\n" + .string "the LILYCOVE DEPARTMENT STORE,\l" + .string "offering you the greatest selection\l" + .string "in all HOENN!$" + +gTVThePokemonBattleSeminarText00:: @ 08286616 + .string "THE POKéMON BATTLE SEMINAR!\p" + .string "We examine battles to see what\n" + .string "lessons we may learn from others.\p" + .string "Today’s case study is on {STR_VAR_1}’s\n" + .string "battle.\p" + .string "{STR_VAR_1}’s {STR_VAR_2} was\n" + .string "battling one {STR_VAR_3}…$" + +gTVThePokemonBattleSeminarText01:: @ 082866B6 + .string "And it used the move {STR_VAR_3}\n" + .string "on the {STR_VAR_2}…\p" + .string "Hmm… {STR_VAR_1}!\n" + .string "That’s the wrong thing to do!$" + +gTVThePokemonBattleSeminarText02:: @ 08286700 + .string "In addition to the doomed move,\n" + .string "the TRAINER’s {STR_VAR_1} also knew$" + +gTVThePokemonBattleSeminarText03:: @ 0828673B + .string "the moves {STR_VAR_1}, {STR_VAR_2},\n" + .string "and {STR_VAR_3}.$" + +gTVThePokemonBattleSeminarText04:: @ 08286755 + .string "the moves {STR_VAR_1} and\n" + .string "{STR_VAR_2}.$" + +gTVThePokemonBattleSeminarText05:: @ 0828676A + .string "the move {STR_VAR_2}.$" + +gTVThePokemonBattleSeminarText06:: @ 08286777 + .string "So, in this situation, what should\n" + .string "the TRAINER have used?\p" + .string "… … … … … …\n" + .string "The move {STR_VAR_1}!\p" + .string "The move {STR_VAR_1} would have been\n" + .string "absolutely better than {STR_VAR_2}.\p" + .string "Viewers, I urge you to learn from this\n" + .string "case and battle with intelligence!\p" + .string "Until next time, farewell!$" + +gTVTrainerFanClubText00:: @ 08286866 + .string "All together now!\n" + .string "TRAINER FAN CLUB!\p" + .string "MC: How’s everyone groovin’?\n" + .string "Today, we’ve rounded up the fans of\l" + .string "the hyper-popular TRAINER {STR_VAR_1}!\p" + .string "FANS: Wrooooooaaaaah!\p" + .string "FANS: {STR_VAR_1}!\p" + .string "MC: Everyone!\n" + .string "How do you like {STR_VAR_1}?!\p" + .string "FANS: We love {STR_VAR_1}!\p" + .string "MC: What do you love about\n" + .string "{STR_VAR_1}?!$" + +gTVTrainerFanClubText01:: @ 0828695E + .string "FANS: Their cool way of throwing\n" + .string "POKé BALLS!$" + +gTVTrainerFanClubText02:: @ 0828698B + .string "FANS: Their adorable way of running!$" + +gTVTrainerFanClubText03:: @ 082869B0 + .string "FANS: How the TRAINER turns tough\n" + .string "when the going gets tough!$" + +gTVTrainerFanClubText04:: @ 082869ED + .string "FANS: The TRAINER’s knowledge of\n" + .string "POKéMON!$" + +gTVTrainerFanClubText05:: @ 08286A17 + .string "FANS: The TRAINER’s kindness toward\n" + .string "all POKéMON!$" + +gTVTrainerFanClubText06:: @ 08286A48 + .string "FANS: The TRAINER’s amazing\n" + .string "BIKE-riding techniques!$" + +gTVTrainerFanClubText07:: @ 08286A7C + .string "FANS: The TRAINER’s impressive\n" + .string "item-buying style!$" + +gTVTrainerFanClubText08:: @ 08286AAE + .string "FANS: The TRAINER’s charming way\n" + .string "of nicknaming POKéMON!$" + +gTVTrainerFanClubText09:: @ 08286AE6 + .string "FANS: The TRAINER’s nifty style of\n" + .string "decorating a SECRET BASE!$" + +gTVTrainerFanClubText10:: @ 08286B23 + .string "FANS: The TRAINER’s bold ways of\n" + .string "using TMs!$" + +gTVTrainerFanClubText11:: @ 08286B4F + .string "MC: As you’ve just seen, {STR_VAR_1}\n" + .string "is hot! Like, too hot to touch, yow!\p" + .string "Among {STR_VAR_1}’s FANS\n" + .string "there’s a special slogan!\p" + .string "MC: When I say {STR_VAR_1},\n" + .string "you say…\p" + .string "FANS: {STR_VAR_2}!\p" + .string "FANS: {STR_VAR_3}!\p" + .string "FANS: {STR_VAR_2}!\p" + .string "FANS: {STR_VAR_3}!\p" + .string "MC: That’s right, when someone says,\n" + .string "“{STR_VAR_1}”…\p" + .string "Come back with, “{STR_VAR_2}\n" + .string "{STR_VAR_3}!”\p" + .string "That has such a unique ring to it!\n" + .string "I can see why people become FANS\l" + .string "of {STR_VAR_1}!\p" + .string "Okay, you, in front of the TV, join us!\n" + .string "All together now!\p" + .string "MC: When I say {STR_VAR_1},\n" + .string "you say…\p" + .string "FANS: {STR_VAR_2}!\p" + .string "FANS: {STR_VAR_3}!\p" + .string "FANS: {STR_VAR_2}!\p" + .string "FANS: {STR_VAR_3}!\p" + .string "MC: Thanks for joining us, all you\n" + .string "wild FANS of {STR_VAR_1}!\l" + .string "That’s the show! See you again!\p" + .string "MC: When I say {STR_VAR_1},\n" + .string "you say…\p" + .string "FANS: {STR_VAR_2}!\p" + .string "FANS: {STR_VAR_3}!$" + +gTVCutiesText00:: @ 08286D8F + .string "SPOT THE CUTIES!\n" + .string "POKéMON IN RIBBONS!\p" + .string "Hello, my sweet viewers!\p" + .string "I just know you’ll agree, but a POKéMON\n" + .string "wearing RIBBONS is simply divine!\p" + .string "Today, I want to share with you\n" + .string "a lovely POKéMON I spotted while\l" + .string "out on a stroll in town.\p" + .string "Today’s featured pretty POKéMON\n" + .string "is {STR_VAR_1}’s {STR_VAR_2}.$" + +gTVCutiesText01:: @ 08286E9D + .string "The number of RIBBONS that\n" + .string "{STR_VAR_2} wears is {STR_VAR_3}.\p" + .string "It says a lot about how much\n" + .string "{STR_VAR_1} adores the POKéMON.$" + +gTVCutiesText02:: @ 08286EFC + .string "{STR_VAR_2} wears an amazing\n" + .string "{STR_VAR_3} RIBBONS!\p" + .string "It speaks volumes about {STR_VAR_1}’s\n" + .string "commitment to the POKéMON!$" + +gTVCutiesText03:: @ 08286F54 + .string "{STR_VAR_2} wears an incredible\n" + .string "{STR_VAR_3} RIBBONS!\p" + .string "It shows you {STR_VAR_1}’s total\n" + .string "dedication as a collector!$" + +gTVCutiesText04:: @ 08286FAA + .string "Let us take a closer look at the many\n" + .string "RIBBONS worn by {STR_VAR_2}.$" + +gTVCutiesText05:: @ 08286FE4 + .string "The CHAMPION RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it upon entering\n" + .string "the HALL OF FAME.\p" + .string "It verily draws out the bravery\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the CHAMP RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText06:: @ 082870A3 + .string "The COOL RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for winning\n" + .string "a COOL CONTEST.\p" + .string "It verily draws out the coolness\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the COOL RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText07:: @ 0828715A + .string "The BEAUTY RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for winning\n" + .string "a BEAUTY CONTEST.\p" + .string "It verily draws out the beauty\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the BEAUTY RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText08:: @ 08287215 + .string "The CUTE RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for winning\n" + .string "a CUTE CONTEST.\p" + .string "It verily draws out the cuteness\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the CUTE RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText09:: @ 082872CC + .string "The SMART RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for winning\n" + .string "a SMART CONTEST.\p" + .string "It verily draws out the smartness\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the SMART RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText10:: @ 08287387 + .string "The TOUGH RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for winning\n" + .string "a TOUGH CONTEST.\p" + .string "It verily draws out the toughness\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the TOUGH RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText11:: @ 08287442 + .string "The WINNING RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for its feats\n" + .string "at the BATTLE TOWER.\p" + .string "It verily draws out the mightiness\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the WINNING RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText12:: @ 08287508 + .string "The VICTORY RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for its feats\n" + .string "at the BATTLE TOWER.\p" + .string "It verily draws out the incredible\n" + .string "mightiness of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the VICTORY RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText13:: @ 082875D9 + .string "The ARTIST RIBBON is especially\n" + .string "fetching.\p" + .string "{STR_VAR_2} received it for being\n" + .string "the model for an artist.\p" + .string "It verily draws out the pop-star charm\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the ARTIST RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText14:: @ 082876A1 + .string "The Hard Worker RIBBON is\n" + .string "especially fetching.\p" + .string "{STR_VAR_2} received it for being\n" + .string "an especially dedicated worker.\p" + .string "It verily draws out the determination\n" + .string "of {STR_VAR_2}.\p" + .string "{STR_VAR_2} and the Hard Worker RIBBON!\n" + .string "The combination is super effective!$" + +gTVCutiesText15:: @ 08287779 + .string "…Sigh…\p" + .string "RIBBONS and POKéMON…\n" + .string "They go so wonderfully together!\p" + .string "Before I swoon,\n" + .string "I bid you all farewell!$" + +gTVPokemonNewsBattleFrontierText00:: @ 082877DE + .string "Greetings!\n" + .string "It’s time for POKéMON NEWS.\p" + .string "We’ve got some uplifting news from\n" + .string "the BATTLE FRONTIER.$" + +gTVPokemonNewsBattleFrontierText01:: @ 0828783D + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE TOWER’s SINGLE BATTLE\l" + .string "ROOM challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText02:: @ 082878B3 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE TOWER’s DOUBLE BATTLE\l" + .string "ROOM challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText03:: @ 08287929 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE TOWER’s MULTI BATTLE\l" + .string "ROOM challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText04:: @ 0828799E + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE TOWER’s LINK MULTI BATTLE\l" + .string "ROOM challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText05:: @ 08287A18 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-championship-streak record\l" + .string "competing in the BATTLE DOME’s\l" + .string "SINGLE BATTLE Tournaments.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText06:: @ 08287A97 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-championship-streak record\l" + .string "competing in the BATTLE DOME’s\l" + .string "DOUBLE BATTLE Tournaments.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText07:: @ 08287B16 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE FACTORY’s Battle\l" + .string "Swap Single challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText08:: @ 08287B8E + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE FACTORY’s Battle\l" + .string "Swap Double challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText09:: @ 08287C06 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "record of clearing {STR_VAR_2} rooms\l" + .string "while on the BATTLE PIKE’s Battle\l" + .string "Choice challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText10:: @ 08287C7D + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while\l" + .string "competing in the BATTLE ARENA’s\l" + .string "Set KO Tournaments.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText11:: @ 08287CF3 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE PALACE’s SINGLE BATTLE\l" + .string "HALL challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText12:: @ 08287D6A + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "{STR_VAR_2}-win-streak record while on\l" + .string "the BATTLE PALACE’s DOUBLE BATTLE\l" + .string "HALL challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText13:: @ 08287DE1 + .string "The TRAINER {STR_VAR_1} set a new\n" + .string "record of clearing {STR_VAR_2} floors\l" + .string "while on the BATTLE PYRAMID’s\l" + .string "Battle Quest challenge.\p" + .string "Here’s to {STR_VAR_1}!$" + +gTVPokemonNewsBattleFrontierText14:: @ 08287E5B + .string "And to the three POKéMON, {STR_VAR_1},\n" + .string "{STR_VAR_2}, and {STR_VAR_3}!\p" + .string "Congratulations for your\n" + .string "record-breaking performance!$" + +gTVPokemonNewsBattleFrontierText15:: @ 08287EBB + .string "And to the two POKéMON, {STR_VAR_1}\n" + .string "and {STR_VAR_2}!\p" + .string "Congratulations for your\n" + .string "record-breaking performance!$" + +gTVPokemonNewsBattleFrontierText16:: @ 08287F14 + .string "And to the four POKéMON: {STR_VAR_1}!\p" + .string "{STR_VAR_2}!\p" + .string "{STR_VAR_3}!$" + +gTVPokemonNewsBattleFrontierText17:: @ 08287F39 + .string "And {STR_VAR_1}!\p" + .string "Congratulations for your\n" + .string "record-breaking performance!$" + +gTVPokemonNewsBattleFrontierText18:: @ 08287F77 + .string "Let’s hope for more record-setting\n" + .string "feats from {STR_VAR_1} and the loyal\l" + .string "POKéMON!\p" + .string "That’s the news on POKéMON NEWS!$" + +gTVWhatsNo1InHoennTodayText00:: @ 08287FE0 + .string "WHAT’S NO. 1 IN HOENN TODAY?\n" + .string "Yes, it’s that time again!\p" + .string "Hello, viewers! Are you giving your\n" + .string "best at whatever you do?\p" + .string "Let’s have a look at the TRAINER\n" + .string "who did the very best today!\p" + .string "Today’s no. 1 TRAINER is none other\n" + .string "than {STR_VAR_1}!$" + +gTVWhatsNo1InHoennTodayText01:: @ 082880C0 + .string "In one day, {STR_VAR_1} spun the SLOTS\n" + .string "at the GAME CORNER {STR_VAR_2} times.\p" + .string "While playing, {STR_VAR_1} was heard\n" + .string "murmuring, “For me, the reels don’t\l" + .string "even move…”\l" + .string "Isn’t that interesting?$" + +gTVWhatsNo1InHoennTodayText02:: @ 0828815F + .string "In one day, {STR_VAR_1} played\n" + .string "the ROULETTE game at the GAME\l" + .string "CORNER {STR_VAR_2} times.\p" + .string "While playing, {STR_VAR_1} shouted,\n" + .string "“Let the balls decide!”\p" + .string "The TRAINER’s eyes were focused and\n" + .string "the face showed concentration.$" + +gTVWhatsNo1InHoennTodayText03:: @ 0828821A + .string "In one day, {STR_VAR_1} battled\n" + .string "wild POKéMON {STR_VAR_2} times!\p" + .string "Apparently, {STR_VAR_1}’s POKéMON\n" + .string "have grown incomparably stronger.\p" + .string "They appear eager to battle anywhere,\n" + .string "anytime, and anyhow!$" + +gTVWhatsNo1InHoennTodayText04:: @ 082882BE + .string "In just one day, {STR_VAR_1} spun\n" + .string "the BERRY BLENDER {STR_VAR_2} times!\p" + .string "Toward the end, even {STR_VAR_1}\n" + .string "seemed to get dizzy.\p" + .string "The TRAINER appeared to totter\n" + .string "around like a SPINDA!$" + +gTVWhatsNo1InHoennTodayText05:: @ 08288355 + .string "In just one day, {STR_VAR_1} planted\n" + .string "{STR_VAR_2} BERRIES!\p" + .string "As a result, {STR_VAR_1}’s clothes\n" + .string "became filthy with dirt.\p" + .string "Where the TRAINER planted, countless\n" + .string "flowers have burst into bloom.\p" + .string "The flowers are said to soothe\n" + .string "the emotions of people.$" + +gTVWhatsNo1InHoennTodayText06:: @ 0828842B + .string "In just one day, {STR_VAR_1} picked\n" + .string "{STR_VAR_2} BERRIES!\p" + .string "{STR_VAR_1}’s BAG became so filled\n" + .string "with BERRIES, the TRAINER had trouble\l" + .string "walking afterward!$" + +gTVWhatsNo1InHoennTodayText07:: @ 082884A5 + .string "In just one day, {STR_VAR_1} obtained\n" + .string "{STR_VAR_2} Battle Points!\p" + .string "{STR_VAR_1} was later seen wrestling\n" + .string "with the choice of exchanging\l" + .string "the Battle Points for a cool item or\l" + .string "a nifty interior decoration.\p" + .string "The TRAINER reportedly was grinning\n" + .string "while mulling options.$" + +gTVWhatsNo1InHoennTodayText08:: @ 0828858B + .string "Well, isn’t that something!\p" + .string "{STR_VAR_1}!\n" + .string "You’re today’s no. 1 TRAINER!\p" + .string "Viewers, take heart from {STR_VAR_1}!\n" + .string "You, too, can be no. 1 every day!$" + +gTVSecretBaseSecretsText00:: @ 08288608 + .string "SECRET BASE SECRETS!\p" + .string "What do TRAINERS do in the secrecy\n" + .string "of SECRET BASES?\p" + .string "Today, we investigate {STR_VAR_1}’s\n" + .string "SECRET BASE.\p" + .string "Oh? It looks like {STR_VAR_2} has come\n" + .string "for a visit.\p" + .string "Let’s have a peek!\p" + .string "What will {STR_VAR_2} do?$" + +gTVSecretBaseSecretsText01:: @ 082886C8 + .string "What will {STR_VAR_2} do next?$" + +gTVSecretBaseSecretsText02:: @ 082886DE + .string "And now, what will {STR_VAR_2} do?$" + +gTVSecretBaseSecretsText03:: @ 082886F8 + .string "In the end, {STR_VAR_2} took {STR_VAR_3} steps\n" + .string "in {STR_VAR_1}’s SECRET BASE before\l" + .string "leaving.$" + +gTVSecretBaseSecretsText04:: @ 08288739 + .string "Hmm…\p" + .string "It appears as if {STR_VAR_1}’s SECRET\n" + .string "BASE failed to interest {STR_VAR_2}…$" + +gTVSecretBaseSecretsText05:: @ 08288777 + .string "{STR_VAR_2} appears to have enjoyed\n" + .string "{STR_VAR_1}’s SECRET BASE thoroughly.$" + +gTVSecretBaseSecretsText06:: @ 082887AF + .string "{STR_VAR_2} appears to have become\n" + .string "a huge fan of {STR_VAR_1}’s\l" + .string "SECRET BASE.$" + +gTVSecretBaseSecretsText07:: @ 082887E9 + .string "Viewers may want to check out\n" + .string "{STR_VAR_1}’s SECRET BASE, too.\p" + .string "Tune in next time as we visit another\n" + .string "SECRET BASE! Thanks for joining us!$" + +gTVSecretBaseSecretsText08:: @ 08288868 + .string "The visitor has stopped!\p" + .string "The visitor isn’t moving at all!\p" + .string "Was {STR_VAR_1}’s SECRET BASE\n" + .string "that unimpressive?$" + +gTVSecretBaseSecretsText09:: @ 082888CA + .string "The visitor has stopped!\p" + .string "The visitor isn’t moving at all!\p" + .string "Is it fatigue?\n" + .string "Has the visitor grown weary?$" + +gTVSecretBaseSecretsText10:: @ 08288930 + .string "The visitor sat down on a chair!\n" + .string "The visitor is seated!\p" + .string "Look at that look of delight!\p" + .string "That chair must be very comfortable\n" + .string "to get that response!$" + +gTVSecretBaseSecretsText11:: @ 082889C0 + .string "The visitor charged at a balloon!\p" + .string "It burst!\n" + .string "Oh, my goodness, it popped!\p" + .string "The visitor appears startled by\n" + .string "the sudden noise!$" + +gTVSecretBaseSecretsText12:: @ 08288A3A + .string "The visitor entered a TENT!\p" + .string "The visitor is running around!\p" + .string "Oh, my, the visitor is frolicking!\p" + .string "The visitor appears surprised by\n" + .string "the TENT’s size!$" + +gTVSecretBaseSecretsText13:: @ 08288ACA + .string "The visitor is examining\n" + .string "a potted plant!\p" + .string "The visitor has surprisingly\n" + .string "mature taste!$" + +gTVSecretBaseSecretsText14:: @ 08288B1E + .string "The visitor is examining\n" + .string "a GOLD SHIELD!\p" + .string "The visitor’s eyes appear to be\n" + .string "lit up with wonder!$" + +gTVSecretBaseSecretsText15:: @ 08288B7A + .string "The visitor is examining\n" + .string "a SILVER SHIELD!\p" + .string "The visitor appears to be wide-eyed!$" + +gTVSecretBaseSecretsText16:: @ 08288BC9 + .string "The visitor is examining\n" + .string "a GLASS ORNAMENT!\p" + .string "Oh, no!\p" + .string "The visitor is touching it!\p" + .string "It’s getting covered with\n" + .string "fingerprints…$" + +gTVSecretBaseSecretsText17:: @ 08288C40 + .string "The visitor is watching television!\p" + .string "Looks like we have a big fan of TV!$" + +gTVSecretBaseSecretsText18:: @ 08288C88 + .string "The visitor stomped on a MUD BALL!\p" + .string "The visitor looks delighted!$" + +gTVSecretBaseSecretsText19:: @ 08288CC8 + .string "…Oh?\p" + .string "The visitor is reaching for their own\n" + .string "BAG and rummaging about in it!\p" + .string "The visitor pulled out\n" + .string "one {STR_VAR_2}!\p" + .string "Look at the visitor smile while\n" + .string "holding up the {STR_VAR_2}!\p" + .string "It’s like a TV commercial!$" + +gTVSecretBaseSecretsText20:: @ 08288D7F + .string "The visitor grabs a cushion and…$" + +gTVSecretBaseSecretsText21:: @ 08288DA0 + .string "…begins hitting it!\p" + .string "Is the visitor under a lot of stress?$" + +gTVSecretBaseSecretsText22:: @ 08288DDA + .string "…hugs it tight!\p" + .string "Could the visitor be feeling happy\n" + .string "about something?$" + +gTVSecretBaseSecretsText23:: @ 08288E1E + .string "The visitor is chatting with\n" + .string "{STR_VAR_1}!\p" + .string "It looks like they’re going to\n" + .string "have a battle!\p" + .string "And…\p" + .string "It’s the visitor!\n" + .string "The visitor won an away match!\p" + .string "The visitor is doing\n" + .string "a victory dance!$" + +gTVSecretBaseSecretsText24:: @ 08288EC9 + .string "The visitor is chatting with\n" + .string "{STR_VAR_1}!\p" + .string "It looks like they’re going to\n" + .string "have a battle!\p" + .string "And…\p" + .string "It’s {STR_VAR_1}!\n" + .string "The visitor has lost!\p" + .string "The visitor looks dejected!$" + +gTVSecretBaseSecretsText25:: @ 08288F58 + .string "The visitor is chatting with\n" + .string "{STR_VAR_1}!\p" + .string "It looks like they’re going to\n" + .string "have a battle!\p" + .string "And…\p" + .string "No, the visitor has refused!\p" + .string "There won’t be a battle after all!\p" + .string "Did the visitor find {STR_VAR_1}\n" + .string "unappealing?$" + +gTVSecretBaseSecretsText26:: @ 08289011 + .string "The visitor is staring intently\n" + .string "at a poster!\p" + .string "Is the poster to the visitor’s\n" + .string "liking?\p" + .string "…But… There’s something disturbing\n" + .string "about the visitor’s stares.$" + +gTVSecretBaseSecretsText27:: @ 082890A4 + .string "The visitor stepped on a NOTE MAT!\p" + .string "…Hmm…\n" + .string "The visitor composed a funny tune!$" + +gTVSecretBaseSecretsText28:: @ 082890F0 + .string "The visitor is chatting with\n" + .string "{STR_VAR_1}!\p" + .string "It looks like they’re going to\n" + .string "have a battle!\p" + .string "And…\p" + .string "It’s a draw!\n" + .string "Nothing’s resolved!\p" + .string "Both TRAINERS appear to be very\n" + .string "disappointed!$" + +gTVSecretBaseSecretsText29:: @ 08289193 + .string "The visitor stepped on\n" + .string "a SPIN MAT!\p" + .string "It looks like the visitor is dizzy!\p" + .string "The visitor is tottering about!\n" + .string "Look out!$" + +gTVSecretBaseSecretsText30:: @ 08289204 + .string "The visitor is reaching for\n" + .string "a SAND ORNAMENT!\p" + .string "Oh!\p" + .string "It crumbled!\n" + .string "It’s fallen apart!\p" + .string "The visitor looks sheepish\n" + .string "and guilty!$" + +gTVSecretBaseSecretsText31:: @ 0828927C + .string "The visitor is rubbing a desktop\n" + .string "with their finger!\p" + .string "Apparently, the visitor disapproves\n" + .string "of dust!\p" + .string "The visitor is surprisingly concerned\n" + .string "about neatness!$" + +gTVSecretBaseSecretsText32:: @ 08289313 + .string "The visitor is staring at a BRICK!\p" + .string "Perhaps the visitor is thinking about\n" + .string "the object on the BRICK.$" + +gTVSecretBaseSecretsText33:: @ 08289375 + .string "The visitor is walking across\n" + .string "the SOLID BOARD.\p" + .string "The visitor keeps looking down.\p" + .string "The visitor appears to be surprisingly\n" + .string "timid and cautious!$" + +gTVSecretBaseSecretsText34:: @ 082893FF + .string "The visitor is looking intently\n" + .string "at a FENCE!\p" + .string "Has a new idea for a trap popped\n" + .string "into the visitor’s head?$" + +gTVSecretBaseSecretsText35:: @ 08289465 + .string "The visitor stepped on\n" + .string "a GLITTER MAT!\p" + .string "The visitor is striking a variety\n" + .string "of poses!\p" + .string "The visitor appears to be fantasizing\n" + .string "about being an idol!$" + +gTVSecretBaseSecretsText36:: @ 082894F2 + .string "The visitor is staring intently\n" + .string "at a TIRE!\p" + .string "Could the visitor be thinking about\n" + .string "the kind of car that would use it?$" + +gTVSecretBaseSecretsText37:: @ 08289564 + .string "The visitor climbed a STAND!\p" + .string "The visitor is looking out across\n" + .string "{STR_VAR_1}’s BASE from high up!\p" + .string "And…\p" + .string "Lets loose a roar!\n" + .string "The visitor is roaring!$" + +gTVSecretBaseSecretsText38:: @ 082895EB + .string "The visitor charged headlong into\n" + .string "a BREAKABLE DOOR!\p" + .string "The visitor is laughing uproariously!$" + +gTVSecretBaseSecretsText39:: @ 08289645 + .string "The visitor is talking to a DOLL!\p" + .string "…It’s a little creepy…$" + +gTVSecretBaseSecretsText40:: @ 0828967E + .string "The visitor is climbing the ladder\n" + .string "on a SLIDE!\p" + .string "And…\p" + .string "The visitor slid down!\p" + .string "Looks like the visitor is having\n" + .string "a grand old time!$" + +gTVSecretBaseSecretsText41:: @ 082896FC + .string "The visitor is climbing the ladder\n" + .string "on a SLIDE!\p" + .string "And…\p" + .string "The visitor went back down\n" + .string "the ladder!\p" + .string "Did the visitor suddenly chicken out?$" + +gTVSecretBaseSecretsText42:: @ 0828977D + .string "The visitor stepped on\n" + .string "a JUMP MAT!\p" + .string "The visitor jumped once!\p" + .string "Jumped twice!\p" + .string "And a successful landing!\p" + .string "The visitor is clapping!\n" + .string "What a solo performance!$" + +gTVSafariFanClubText00:: @ 08289813 + .string "SAFARI FAN CLUB!\p" + .string "REPORTER: All right, mates!\n" + .string "Tossing them SAFARI BALLS, are you?\p" + .string "You can bet I am here in the SAFARI\n" + .string "ZONE chock-full of amazing POKéMON!\p" + .string "Let’s get with it and have a chat with\n" + .string "this good fellow of a SAFARI GUIDE!\p" + .string "All right, mate, how are the visiting\n" + .string "TRAINERS looking?$" + +gTVSafariFanClubText01:: @ 0828992F + .string "GUIDE: Everyone seems to be going\n" + .string "hard at it.\p" + .string "{STR_VAR_1} is doing especially well.\p" + .string "Why, before, {STR_VAR_1} caught\n" + .string "{STR_VAR_2} POKéMON.$" + +gTVSafariFanClubText02:: @ 0828999D + .string "The TRAINER is clever with {POKEBLOCK}S.\n" + .string "Used {STR_VAR_2} that time, I think.$" + +gTVSafariFanClubText03:: @ 082899DC + .string "The TRAINER didn’t use a single\n" + .string "{POKEBLOCK}! Not a one!\p" + .string "There’s an expert for you.$" + +gTVSafariFanClubText04:: @ 08289A29 + .string "REPORTER: Is that right, then?\p" + .string "Sounds like our mate {STR_VAR_1}\n" + .string "is a stout SAFARI master!\p" + .string "GUIDE: I hope the TRAINER comes back\n" + .string "and shows us that great technique.$" + +gTVSafariFanClubText05:: @ 08289AC2 + .string "GUIDE: No one seems to be doing\n" + .string "very well.\p" + .string "{STR_VAR_1} had it especially bad.\p" + .string "Why, before, the TRAINER only\n" + .string "managed to catch {STR_VAR_2} POKéMON.$" + +gTVSafariFanClubText06:: @ 08289B42 + .string "GUIDE: No one seems to be doing\n" + .string "very well.\p" + .string "{STR_VAR_1} had it especially bad.\p" + .string "Why, before, the TRAINER didn’t\n" + .string "catch one POKéMON. Not a one!$" + +gTVSafariFanClubText07:: @ 08289BC5 + .string "The TRAINER does use {POKEBLOCK}S.\n" + .string "Used {STR_VAR_2} that time, I think.\p" + .string "But, boy, I wish the TRAINER would\n" + .string "get a bit better at this.$" + +gTVSafariFanClubText08:: @ 08289C3B + .string "I think the TRAINER would have better\n" + .string "luck using {POKEBLOCK}S, which weren’t\l" + .string "used at all that time.$" + +gTVSafariFanClubText09:: @ 08289C99 + .string "REPORTER: Is that right, then?\p" + .string "Sounds like our mate {STR_VAR_1}\n" + .string "needs more SAFARI seasoning.\p" + .string "GUIDE: I hope the TRAINER visits\n" + .string "over and over to get the hang of it.$" + +gTVSafariFanClubText10:: @ 08289D33 + .string "REPORTER: Quite right, it is!\n" + .string "Facing up to challenges is important!\p" + .string "Viewers, come on down to the SAFARI\n" + .string "and make the challenge yourself!\p" + .string "Until next time, cheerio!$" + +gTVContestLiveUpdatesText00:: @ 08289DD6 + .string "“POKéMON CONTEST LIVE UPDATES!”\p" + .string "MC: Thanks for joining us!\p" + .string "We’re live from the just-ended\n" + .string "{STR_VAR_1} site.\p" + .string "The hall is still filled with\n" + .string "an audience unwilling to leave.\p" + .string "Spectator: {STR_VAR_2}!\p" + .string "Spectator: {STR_VAR_3}!\p" + .string "MC: As you’ve just heard, the CONTEST\n" + .string "was won by the POKéMON {STR_VAR_2}\l" + .string "of {STR_VAR_3}.\p" + .string "Spectator: {STR_VAR_2}!\n" + .string "You’re the best!\p" + .string "Spectator: {STR_VAR_3}!\n" + .string "Way to go!\p" + .string "MC: Let’s hear what the fans have\n" + .string "to say about this CONTEST.$" + +gTVContestLiveUpdatesText01:: @ 08289F53 + .string "Spectator: The {STR_VAR_2} was tops in\n" + .string "both primary and secondary judging!\p" + .string "That {STR_VAR_2} will keep winning!$" + +gTVContestLiveUpdatesText02:: @ 08289FB0 + .string "Spectator: The {STR_VAR_2} didn’t do\n" + .string "well in the primary judging, but it\l" + .string "cleaned up in the secondary judging!\p" + .string "It was a miraculous comeback\n" + .string "for that {STR_VAR_2}. Yippee!$" + +gTVContestLiveUpdatesText03:: @ 0828A047 + .string "Spectator: The {STR_VAR_2} remained\n" + .string "consistent throughout both primary\l" + .string "and secondary judging.\p" + .string "{STR_VAR_3} and the {STR_VAR_2},\n" + .string "they’re no ordinary combo!$" + +gTVContestLiveUpdatesText04:: @ 0828A0C6 + .string "Spectator: In terms of being {STR_VAR_1},\n" + .string "that {STR_VAR_2} was outstanding.\p" + .string "I hope it makes better appeals\n" + .string "next time, though.$" + +gTVContestLiveUpdatesText05:: @ 0828A132 + .string "Spectator: When the {STR_VAR_2} got\n" + .string "nervous, I couldn’t stop myself from\l" + .string "shouting encouragement.\p" + .string "I’d like to say this to that\n" + .string "{STR_VAR_2}, “Congratulations!”$" + +gTVContestLiveUpdatesText06:: @ 0828A1BE + .string "Spectator: That {STR_VAR_2}’s appeal\n" + .string "startled even me!\p" + .string "{STR_VAR_2}, you were awesome!$" + +gTVContestLiveUpdatesText07:: @ 0828A202 + .string "Spectator: That {STR_VAR_2}’s combo\n" + .string "appeal was stunning!\p" + .string "It’s shaken me to the core!$" + +gTVContestLiveUpdatesText08:: @ 0828A24E + .string "Spectator: The winning {STR_VAR_2}’s\n" + .string "appeal got my heart pounding!$" + +gTVContestLiveUpdatesText09:: @ 0828A288 + .string "{STR_VAR_2}!\n" + .string "You were cool!$" + +gTVContestLiveUpdatesText10:: @ 0828A29B + .string "{STR_VAR_2}!\n" + .string "You were beautiful!$" + +gTVContestLiveUpdatesText11:: @ 0828A2B3 + .string "{STR_VAR_2}!\n" + .string "You were cute!$" + +gTVContestLiveUpdatesText12:: @ 0828A2C6 + .string "{STR_VAR_2}!\n" + .string "You were smart!$" + +gTVContestLiveUpdatesText13:: @ 0828A2DA + .string "{STR_VAR_2}!\n" + .string "You were tough!$" + +gTVContestLiveUpdatesText14:: @ 0828A2EE + .string "Spectator: The winning {STR_VAR_2}’s\n" + .string "appeal still has my heart pounding!$" + +gTVContestLiveUpdatesText15:: @ 0828A32E + .string "{STR_VAR_2}!\n" + .string "You’re the last word in cool!$" + +gTVContestLiveUpdatesText16:: @ 0828A350 + .string "{STR_VAR_2}!\n" + .string "You’re the most beautiful!$" + +gTVContestLiveUpdatesText17:: @ 0828A36F + .string "{STR_VAR_2}!\n" + .string "You’re simply the cutest!$" + +gTVContestLiveUpdatesText18:: @ 0828A38D + .string "{STR_VAR_2}!\n" + .string "You’re the smartest among the smart!$" + +gTVContestLiveUpdatesText19:: @ 0828A3B6 + .string "{STR_VAR_2}!\n" + .string "You’re the toughest of the tough!$" + +gTVContestLiveUpdatesText20:: @ 0828A3DC + .string "Spectator: Even when the {STR_VAR_2}\n" + .string "took a break from making appeals,\l" + .string "I couldn’t take my eyes off it.\p" + .string "I’m captivated by that {STR_VAR_2}.$" + +gTVContestLiveUpdatesText21:: @ 0828A455 + .string "Spectator: When the {STR_VAR_2} was\n" + .string "startled by another POKéMON’s appeal,\l" + .string "I was close to tears.\p" + .string "{STR_VAR_2}, you were resilient!\n" + .string "Way to go!$" + +gTVContestLiveUpdatesText22:: @ 0828A4CF + .string "Spectator: Oh…\n" + .string "That {STR_VAR_2}’s {STR_VAR_3}!\l" + .string "{STR_VAR_2}’s {STR_VAR_3}!\l" + .string "{STR_VAR_2}’s {STR_VAR_3}!\l" + .string "How could it be so wonderful?$" + +gTVContestLiveUpdatesText23:: @ 0828A51C + .string "MC: Well, there you have it. This place\n" + .string "is full of the {STR_VAR_1}’s fans!\p" + .string "I should also mention that another\n" + .string "POKéMON, {STR_VAR_2}’s {STR_VAR_3}, \l" + .string "caught my eye.\p" + .string "{STR_VAR_2}’s {STR_VAR_3}…$" + +gTVContestLiveUpdatesText24:: @ 0828A5AC + .string "It failed to make a single appeal during\n" + .string "secondary judging out of nervousness.\p" + .string "Next time, I would like to see this\n" + .string "{STR_VAR_1} make even one appeal.$" + +gTVContestLiveUpdatesText25:: @ 0828A638 + .string "It came dead last in both primary\n" + .string "and secondary judging.\p" + .string "I hope that {STR_VAR_1} will retrain this\n" + .string "{STR_VAR_2} and erase the shame of\l" + .string "this undisputed last-place finish.$" + +gTVContestLiveUpdatesText26:: @ 0828A6CF + .string "It failed to take advantage of\n" + .string "the audience’s excitement and make\l" + .string "an appropriate appeal.\p" + .string "We hope {STR_VAR_1} will learn how to get\n" + .string "a feel for the audience and whip their\l" + .string "excitement to a fever pitch next time.$" + +gTVContestLiveUpdatesText27:: @ 0828A797 + .string "While finishing first in the primary\n" + .string "judging, its appeals in the secondary\l" + .string "judging failed to click.\p" + .string "It suffered a humiliating come-from-\n" + .string "behind loss.\p" + .string "I’m sure {STR_VAR_1} is studying how to\n" + .string "make more effective appeals now.$" + +gTVContestLiveUpdatesText28:: @ 0828A86D + .string "The audience never got excited by its\n" + .string "appeals during the secondary judging.\p" + .string "We hope it will stop worrying about\n" + .string "other POKéMON and learn to pitch\l" + .string "its appeals to the audience more.$" + +gTVContestLiveUpdatesText29:: @ 0828A920 + .string "It lost to {STR_VAR_1}’s {STR_VAR_2}\n" + .string "by only a small margin.\p" + .string "It must be heartbreaking to come\n" + .string "so close to victory only to fail.\p" + .string "I wouldn’t be surprised if {STR_VAR_3}\n" + .string "were weeping over this outcome.$" + +gTVContestLiveUpdatesText30:: @ 0828A9CC + .string "It disappointed the JUDGE by\n" + .string "repeating the same appeals.\p" + .string "It’s an unforgivable error in any\n" + .string "CONTEST, and the POKéMON paid.\p" + .string "{STR_VAR_1} should feel guilty for\n" + .string "this sorry showing.$" + +gTVContestLiveUpdatesText31:: @ 0828AA74 + .string "{STR_VAR_1} turned in a valiant effort,\n" + .string "but…\p" + .string "It was all for naught, finishing last.\p" + .string "{STR_VAR_1} should learn from this loss\n" + .string "and put the knowledge to good use.$" + +gTVContestLiveUpdatesText32:: @ 0828AB01 + .string "I’d like to end this program with our\n" + .string "usual farewell to the winners.\p" + .string "This time, it’s {STR_VAR_1} and\n" + .string "the {STR_VAR_2}!\p" + .string "MC: Is everyone ready?\n" + .string "All together now!\p" + .string "Audience: {STR_VAR_1}! {STR_VAR_2}!\n" + .string "Congratulations!\l" + .string "You’re the CONTEST winner!$" + +gTVPokemonBattleUpdateText00:: @ 0828ABCC + .string "“POKéMON BATTLE UPDATE!”\p" + .string "Bringing you the results of POKéMON\n" + .string "battles as they come in!$" + +gTVPokemonBattleUpdateText01:: @ 0828AC22 + .string "The TRAINERS {STR_VAR_1} and\n" + .string "{STR_VAR_2} faced each other in\l" + .string "a {STR_VAR_3} BATTLE.\p" + .string "This match ended in victory for\n" + .string "{STR_VAR_1}!$" + +gTVPokemonBattleUpdateText02:: @ 0828AC7E + .string "In the battle, {STR_VAR_1}’s\n" + .string "{STR_VAR_2} was a formidable force\l" + .string "using {STR_VAR_3}!$" + +gTVPokemonBattleUpdateText03:: @ 0828ACB6 + .string "{STR_VAR_1}’s {STR_VAR_2} had a weak\n" + .string "showing that really hurt.$" + +gTVPokemonBattleUpdateText04:: @ 0828ACE3 + .string "Congratulations on your victory,\n" + .string "{STR_VAR_1}!\p" + .string "And for the defeated {STR_VAR_2},\n" + .string "we hope for a better result next time!\p" + .string "This concludes this episode of\n" + .string "“POKéMON BATTLE UPDATE!”$" + +gTVPokemonBattleUpdateText05:: @ 0828AD80 + .string "The teams of TRAINERS {STR_VAR_1} and\n" + .string "{STR_VAR_2} met in a MULTI BATTLE.\p" + .string "This match ended in victory for\n" + .string "{STR_VAR_1}’s team.$" + +gTVPokemonBattleUpdateText06:: @ 0828ADE2 + .string "In the battle, the {STR_VAR_2} on\n" + .string "{STR_VAR_1}’s team was a formidable\l" + .string "force using {STR_VAR_3}.$" + +gTVPokemonBattleUpdateText07:: @ 0828AE26 + .string "The weak showing by the {STR_VAR_3}\n" + .string "on {STR_VAR_2}’s team really hurt.\p" + .string "Congratulations on your team’s\n" + .string "victory, {STR_VAR_1}!\p" + .string "As for the defeated {STR_VAR_2}’s team,\n" + .string "we hope for a better result next time!\p" + .string "This concludes this episode of\n" + .string "“POKéMON BATTLE UPDATE!”$" + + .string "GABBY: Oh! We’ve just spotted a tough-\n" + .string "looking TRAINER here of all places!\p" + .string "Okay, roll camera!\n" + .string "Let’s get this interview.$" + + .string "GABBY: Oh! You’re {PLAYER}! Hi!\n" + .string "Do you remember us from last time?\p" + .string "Can you show us how much stronger\n" + .string "you’ve become? Okay, cue interview!$" + + .string "GABBY: My eyes didn’t lie!\n" + .string "I did discover an astonishing TRAINER!$" + + .string "GABBY: Awesome! Awesome!\n" + .string "Who are you?!\p" + .string "I knew we were onto something wild\n" + .string "when we spotted you!\p" + .string "Oh, please let me explain. We travel\n" + .string "around everywhere interviewing all\l" + .string "sorts of TRAINERS.\p" + .string "So, would you give us a bit of your time\n" + .string "for an interview?$" + + .string "GABBY: “{STR_VAR_1}!”\p" + .string "Remember? That’s the quote you gave\n" + .string "us as the battle clincher last time.\p" + .string "I never, ever forget stuff like that!$" + + .string "The last time we battled, you stomped\n" + .string "us before we could brace ourselves…\p" + .string "Anyway, what do you think?\n" + .string "Do you want to be interviewed again?$" + + .string "The last time we battled, didn’t you\n" + .string "throw a POKé BALL at us?\p" + .string "We were shocked! So we told everyone,\n" + .string "just everyone, about it!\p" + .string "Anyway, what do you think?\n" + .string "Do you want to be interviewed again?$" + + .string "The last time we battled, your item\n" + .string "skills cleverly did us in.\p" + .string "Anyway, what do you think?\n" + .string "Do you want to be interviewed again?$" + + .string "The last time we battled, we managed\n" + .string "to look respectable.\p" + .string "Anyway, what do you think?\n" + .string "Do you want to be interviewed again?$" + + .string "Anyway, what do you think?\n" + .string "Do you want to be interviewed again?$" + + .string "You will?\n" + .string "Thank you!\p" + .string "Okay, I need you to describe your\n" + .string "feelings about our battle, but it\l" + .string "has to be short and sweet. Go!$" + + .string "GABBY: Mmm, yeah!\n" + .string "That’s the perfect clincher!\p" + .string "I get the feeling that this will make\n" + .string "a great TV show.\p" + .string "There’s a chance that they’ll air this\n" + .string "on TV, so make sure to look for us!\p" + .string "Okay!\n" + .string "We’ll be seeing you!$" + + .string "GABBY: Oh…\p" + .string "Okay, but don’t give up!\n" + .string "We’ll be keeping an eye out for you!$" + + .string "GABBY: We’ll be keeping an eye out\n" + .string "for you!$" + + .string "GABBY: Is there a strong TRAINER\n" + .string "anywhere with a lot of POKéMON?$" + + .string "GABBY: Wow, you are something!\p" + .string "You’ve gotten a lot stronger--a lot--\n" + .string "since we last battled.\p" + .string "We were right about you when we\n" + .string "spotted you as a hot TRAINER.\p" + .string "So, anyway, what do you think?\n" + .string "Are you willing to give us an interview\l" + .string "this time?$" + + .string "GABBY: That was an intense battle!\n" + .string "Did you get all that on camera?$" + + .string "TY: Hey, lookie here! A tough-looking\n" + .string "TRAINER here, of all places!\l" + .string "Camera’s rolling!$" + + .string "TY: Hey, lookie here!\n" + .string "I remember you!\p" + .string "I’ll get this battle all on this\n" + .string "here camera!$" + + .string "TY: You’re a natural!\n" + .string "Got me some prime footage right here!$" + + .string "TY: Do you only have the one POKéMON\n" + .string "and that’s it?\p" + .string "If you had more POKéMON, it’d make for\n" + .string "better footage, but…$" + + .string "TY: Yep, we sure spotted a hot TRAINER.\n" + .string "This is a huge scoop for us!$" + + .string "TY: Yep, I got it all.\n" + .string "That whole battle’s on camera.$" + +gTVInSearchOfTrainersText00:: @ 0828B92C + .string "IN SEARCH OF TRAINERS…\p" + .string "GABBY: Hi! Today I’m visiting an area\n" + .string "near {STR_VAR_1}.\p" + .string "We’re trying to spot some up-and-\n" + .string "coming new talent in the field.\p" + .string "Today, we turned our lens on the\n" + .string "TRAINER {PLAYER}.\p" + .string "There’s something about this TRAINER\n" + .string "that piqued our interest.$" + +gTVInSearchOfTrainersText01:: @ 0828BA20 + .string "We’ve battled {PLAYER} before, but we\n" + .string "can attest that the TRAINER has most\l" + .string "definitely improved from before.\p" + .string "I knew we were onto someone special\n" + .string "when we spotted this TRAINER!$" + +gTVInSearchOfTrainersText02:: @ 0828BAC8 + .string "The best way to determine how strong\n" + .string "a TRAINER is…\p" + .string "Well, the fastest way is to battle.\n" + .string "And so we began our investigation!\p" + .string "… …\p" + .string "That’s how we ended up in battle\n" + .string "with {PLAYER}.\p" + .string "In a dominating performance, we were\n" + .string "flattened, rolled up, and tossed aside!\p" + .string "{PLAYER} is ruthlessly strong…\p" + .string "Here’s our impressions after having\n" + .string "battled our featured TRAINER.$" + +gTVInSearchOfTrainersText03:: @ 0828BC18 + .string "The combination of {STR_VAR_1} and\n" + .string "{STR_VAR_3} was divine!\p" + .string "The sight of them--{STR_VAR_1} and\n" + .string "{STR_VAR_3}--selflessly supporting\l" + .string "each other in the thick of battle…\p" + .string "It was a marvelous sight to behold!\p" + .string "{STR_VAR_2} was the move the TRAINER\n" + .string "used last in our battle.\p" + .string "The move {STR_VAR_2} is {STR_VAR_1}\n" + .string "and {STR_VAR_3}’s sign of friendship!$" + +gTVInSearchOfTrainersText04:: @ 0828BD20 + .string "…I lost confidence in myself as\n" + .string "a result of our encounter.\p" + .string "We were beaten before we could launch\n" + .string "a single attack.\l" + .string "Ohhh… Snivel…\p" + .string "In spite of that, {PLAYER}’s battles\n" + .string "are worth seeing.\p" + .string "I recommend confident TRAINERS to\n" + .string "challenge {PLAYER}.$" + +gTVInSearchOfTrainersText05:: @ 0828BE01 + .string "There’s only one thing to be said.\n" + .string "Don’t you dare throw a POKé BALL during\l" + .string "a TRAINER battle!\p" + .string "{PLAYER} is certainly strong, but has\n" + .string "no clue about the basic rules.\p" + .string "To our TV audience, I have a request.\p" + .string "If you see {PLAYER}, please caution\n" + .string "the TRAINER!$" + +gTVInSearchOfTrainersText06:: @ 0828BEEE + .string "{PLAYER} is adept at reading the\n" + .string "opponent’s actions.\p" + .string "The timing of item usage was remarkably\n" + .string "effective!$" + +gTVInSearchOfTrainersText07:: @ 0828BF50 + .string "Honestly speaking, I thought that\n" + .string "I might even be pretty good.\p" + .string "While we did end up losing, we did have\n" + .string "a hotly contested battle.\p" + .string "But if you’re struggling against me,\n" + .string "you have a ways to go, {PLAYER}!$" + +gTVInSearchOfTrainersText08:: @ 0828C011 + .string "After our battle, we asked {PLAYER} for\n" + .string "a succinct summary.\p" + .string "The TRAINER replied, “{STR_VAR_1}.”\p" + .string "{PLAYER}’s POKéMON {STR_VAR_2} and\n" + .string "{STR_VAR_3}…\l" + .string "And “{STR_VAR_1}”…\p" + .string "Mmm! That’s deep! There’s deep\n" + .string "significance behind that quote!\p" + .string "It’s no surprise--a good TRAINER has\n" + .string "good things to say.\p" + .string "That’s all for today!\n" + .string "See you again on our next broadcast!$" + +gTVPokemonContestLiveUpdates2Text00:: @ 0828C137 + .string "“POKéMON CONTEST LIVE UPDATES!”\p" + .string "MC: Sorry to interrupt the regular\n" + .string "programming, and thanks for joining us!\p" + .string "We bring you this live from\n" + .string "the scene of a just-completed\l" + .string "{STR_VAR_1}!\p" + .string "Spectators: ?!!!!\p" + .string "MC: Oh! It looks like the CONTEST\n" + .string "participants are headed this way!\p" + .string "I’ll try to get an impromptu interview\n" + .string "for you folks at home!\p" + .string "Spectators: ?!!!!\n" + .string "?!!!!$" + +gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C + .string "MC: Excuse me!\n" + .string "Thanks for joining us on live TV!\p" + .string "May I congratulate you on your win?\p" + .string "What was the key factor in today’s\n" + .string "stunning victory?\p" + .string "BEAUTY: We gave it our best effort\n" + .string "today, my {STR_VAR_2} and I!\p" + .string "But I’m sure we wouldn’t have made it\n" + .string "if it weren’t for all the help we\l" + .string "received leading up to the CONTEST!\p" + .string "MC: Do you have a special someone\n" + .string "with whom you’d like to share your joy?\l" + .string "Let’s hear it live!\p" + .string "BEAUTY: Hey, out there!\p" + .string "{STR_VAR_3}! Are you watching?\n" + .string "We did it!\l" + .string "Thank you!$" + +gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B + .string "MC: Excuse me!\n" + .string "Thanks for joining us on live TV!\p" + .string "You must be disappointed by that turn\n" + .string "of events. Do you have any comments?\p" + .string "BEAUTY: It’s heartbreaking…\n" + .string "My {STR_VAR_2} and I, we did our best…\p" + .string "But I feel like I’ve let down everyone\n" + .string "who has supported us through this.\p" + .string "MC: I hate to say it, but the POKéMON’s\n" + .string "coloration is a little wanting.\p" + .string "BEAUTY: {STR_VAR_3}, I’m so sorry…\n" + .string "I’ll do better next time, I swear…\l" + .string "…Sniff… Waaaaah!\p" + .string "Spectators: See that?\n" + .string "The poor girl!\p" + .string "MC: Uh… Uh-oh…\p" + .string "Uh… That’s all the time we have today!\n" + .string "Thanks for tuning in!$" + +gTVPokemonContestLiveUpdates2Text03:: @ 0828C662 + .string "MC: Excuse me!\n" + .string "Thanks for joining us on live TV!\p" + .string "How did your CONTEST appearance go?\p" + .string "BEAUTY: Nothing went right…\n" + .string "For some reason, my {STR_VAR_2}\l" + .string "couldn’t attract any popularity.\p" + .string "MC: I hate to say it, but the POKéMON’s\n" + .string "coloration is a little wanting.\p" + .string "BEAUTY: … … … … … …\n" + .string "…Sniff… Waaaaah!\p" + .string "Spectators: See that?\n" + .string "The poor girl!\p" + .string "MC: Uh… Uh-oh…\p" + .string "Uh… That’s all the time we have today!\n" + .string "Thanks for tuning in!$" diff --git a/data/tv.s b/data/tv.s deleted file mode 100644 index 4d2a608c4..000000000 --- a/data/tv.s +++ /dev/null @@ -1,128 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2, 0 - -gUnknown_0858D094:: @ 858D094 - .incbin "baserom.gba", 0x58d094, 0x3c - -gUnknown_0858D0D0:: @ 858D0D0 - .incbin "baserom.gba", 0x58d0d0, 0xe - -gUnknown_0858D0DE:: @ 858D0DE - .incbin "baserom.gba", 0x58d0de, 0xe - -gUnknown_0858D0EC:: @ 858D0EC - .incbin "baserom.gba", 0x58d0ec, 0x1c - -gUnknown_0858D108:: @ 858D108 - .incbin "baserom.gba", 0x58d108, 0x14 - -gUnknown_0858D11C:: @ 858D11C - .incbin "baserom.gba", 0x58d11c, 0x14 - -gUnknown_0858D130:: @ 858D130 - .incbin "baserom.gba", 0x58d130, 0x14 - -gUnknown_0858D144:: @ 858D144 - .incbin "baserom.gba", 0x58d144, 0xc - -gUnknown_0858D150:: @ 858D150 - .incbin "baserom.gba", 0x58d150, 0x20 - -gUnknown_0858D170:: @ 858D170 - .incbin "baserom.gba", 0x58d170, 0x18 - -gUnknown_0858D188:: @ 858D188 - .incbin "baserom.gba", 0x58d188, 0x14 - -gUnknown_0858D19C:: @ 858D19C - .incbin "baserom.gba", 0x58d19c, 0x4 - -gUnknown_0858D1A0:: @ 858D1A0 - .incbin "baserom.gba", 0x58d1a0, 0x30 - -gUnknown_0858D1D0:: @ 858D1D0 - .incbin "baserom.gba", 0x58d1d0, 0x34 - -gUnknown_0858D204:: @ 858D204 - .incbin "baserom.gba", 0x58d204, 0x24 - -gUnknown_0858D228:: @ 858D228 - .incbin "baserom.gba", 0x58d228, 0x18 - -gUnknown_0858D240:: @ 858D240 - .incbin "baserom.gba", 0x58d240, 0x3c - -gUnknown_0858D27C:: @ 858D27C - .incbin "baserom.gba", 0x58d27c, 0x84 - -gUnknown_0858D300:: @ 858D300 - .incbin "baserom.gba", 0x58d300, 0x20 - -gUnknown_0858D320:: @ 858D320 - .incbin "baserom.gba", 0x58d320, 0x18 - -gUnknown_0858D338:: @ 858D338 - .incbin "baserom.gba", 0x58d338, 0x4c - -gUnknown_0858D384:: @ 858D384 - .incbin "baserom.gba", 0x58d384, 0x10 - -gUnknown_0858D394:: @ 858D394 - .incbin "baserom.gba", 0x58d394, 0x1c - -gUnknown_0858D3B0:: @ 858D3B0 - .incbin "baserom.gba", 0x58d3b0, 0x8 - -gUnknown_0858D3B8:: @ 858D3B8 - .incbin "baserom.gba", 0x58d3b8, 0xc - -gUnknown_0858D3C4:: @ 858D3C4 - .incbin "baserom.gba", 0x58d3c4, 0x2c - -gUnknown_0858D3F0:: @ 858D3F0 - .incbin "baserom.gba", 0x58d3f0, 0x1c - -gUnknown_0858D40C:: @ 858D40C - .incbin "baserom.gba", 0x58d40c, 0xc - -gUnknown_0858D418:: @ 858D418 - .incbin "baserom.gba", 0x58d418, 0x10 - -gUnknown_0858D428:: @ 858D428 - .incbin "baserom.gba", 0x58d428, 0x34 - -gUnknown_0858D45C:: @ 858D45C - .incbin "baserom.gba", 0x58d45c, 0x38 - -gUnknown_0858D494:: @ 858D494 - .incbin "baserom.gba", 0x58d494, 0x4 - -gUnknown_0858D498:: @ 858D498 - .incbin "baserom.gba", 0x58d498, 0x1c - -gUnknown_0858D4B4:: @ 858D4B4 - .incbin "baserom.gba", 0x58d4b4, 0x30 - -gUnknown_0858D4E4:: @ 858D4E4 - .incbin "baserom.gba", 0x58d4e4, 0x40 - -gUnknown_0858D524:: @ 858D524 - .incbin "baserom.gba", 0x58d524, 0x4c - -gUnknown_0858D570:: @ 858D570 - .incbin "baserom.gba", 0x58d570, 0x24 - -gUnknown_0858D594:: @ 858D594 - .incbin "baserom.gba", 0x58d594, 0xac - -gUnknown_0858D640:: @ 858D640 - .incbin "baserom.gba", 0x58d640, 0x2c - -gUnknown_0858D66C:: @ 858D66C - .incbin "baserom.gba", 0x58d66c, 0x24 - -gUnknown_0858D690:: @ 858D690 - .incbin "baserom.gba", 0x58d690, 0x20 diff --git a/include/battle.h b/include/battle.h index a60f450ce..a3a51db71 100644 --- a/include/battle.h +++ b/include/battle.h @@ -78,6 +78,7 @@ #define BATTLE_PLAYER_TELEPORTED 0x5 #define BATTLE_POKE_FLED 0x6 #define BATTLE_CAUGHT 0x7 +#define BATTLE_SAFARI_OUT_OF_BALLS 0x8 #define BATTLE_FORFEITED 0x9 #define BATTLE_OPPONENT_TELEPORTED 0xA @@ -528,11 +529,11 @@ struct BattleResults u8 playerSwitchesCounter; // 0x2 u8 unk3; // 0x3 u8 unk4; // 0x4 - u8 unk5_0:1; // 0x5 , 0x1 - u8 unk5_1:1; // 0x5 , 0x2 - u8 caughtMonBall:4; // 0x5 , 0x4/0x8/0x10/0x20 - u8 unk5_6:1; // 0x5 , 0x40 - u8 unk5_7:1; // 0x5 , 0x80 + u8 unk5_0:1; // 0x5 + u8 usedMasterBall:1; // 0x5 + u8 caughtMonBall:4; // 0x5 + u8 unk5_6:1; // 0x5 + u8 unk5_7:1; // 0x5 u16 playerMon1Species; // 0x6 u8 playerMon1Name[11]; // 0x8 u8 battleTurnCounter; // 0x13 @@ -545,7 +546,7 @@ struct BattleResults u16 caughtMonSpecies; // 0x28 u8 caughtMonNick[10]; // 0x2A u8 filler34[2]; - u8 catchAttempts[12]; // 0x36 + u8 catchAttempts[11]; // 0x36 }; extern struct BattleResults gBattleResults; @@ -902,6 +903,10 @@ struct MonSpritesGfx struct SpriteTemplate templates[4]; }; +extern struct BattleSpritesGfx* gMonSpritesGfx; +extern u8 gBattleOutcome; +extern u16 gLastUsedItem; +extern u32 gBattleTypeFlags; extern struct MonSpritesGfx* gMonSpritesGfxPtr; #endif // GUARD_BATTLE_H diff --git a/include/battle_tower.h b/include/battle_tower.h new file mode 100644 index 000000000..25b439c1b --- /dev/null +++ b/include/battle_tower.h @@ -0,0 +1,6 @@ +#ifndef GUARD_BATTLE_TOWER_H +#define GUARD_BATTLE_TOWER_H + +u16 sub_8164FCC(u8, u8); + +#endif //GUARD_BATTLE_TOWER_H diff --git a/include/contest.h b/include/contest.h new file mode 100644 index 000000000..6eda956b4 --- /dev/null +++ b/include/contest.h @@ -0,0 +1,18 @@ +#ifndef GUARD_CONTEST_H +#define GUARD_CONTEST_H + +struct ContestStruct_02039E00 { + u16 unk_00; + u8 unk_02[11]; + u8 unk_0d[8]; + u8 filler_15[9]; + u8 filler_1E[34]; +}; + +extern struct ContestStruct_02039E00 gUnknown_02039E00[4]; +extern u8 gUnknown_02039F24; +extern EWRAM_DATA u16 gUnknown_02039F2C; +extern EWRAM_DATA u8 gUnknown_02039F2E; +extern EWRAM_DATA u8 gUnknown_02039F30; + +#endif //GUARD_CONTEST_H diff --git a/include/decoration.h b/include/decoration.h new file mode 100644 index 000000000..c089bdc83 --- /dev/null +++ b/include/decoration.h @@ -0,0 +1,147 @@ +#ifndef GUARD_DECORATION_H +#define GUARD_DECORATION_H + +enum DecoId { + /*000*/ DECOR_NONE, + /*001*/ DECOR_SMALL_DESK, + /*002*/ DECOR_POKEMON_DESK, + /*003*/ DECOR_HEAVY_DESK, + /*004*/ DECOR_RAGGED_DESK, + /*005*/ DECOR_COMFORT_DESK, + /*006*/ DECOR_PRETTY_DESK, + /*007*/ DECOR_BRICK_DESK, + /*008*/ DECOR_CAMP_DESK, + /*009*/ DECOR_HARD_DESK, + /*010*/ DECOR_SMALL_CHAIR, + /*011*/ DECOR_POKEMON_CHAIR, + /*012*/ DECOR_HEAVY_CHAIR, + /*013*/ DECOR_PRETTY_CHAIR, + /*014*/ DECOR_COMFORT_CHAIR, + /*015*/ DECOR_RAGGED_CHAIR, + /*016*/ DECOR_BRICK_CHAIR, + /*017*/ DECOR_CAMP_CHAIR, + /*018*/ DECOR_HARD_CHAIR, + /*019*/ DECOR_RED_PLANT, + /*020*/ DECOR_TROPICAL_PLANT, + /*021*/ DECOR_PRETTY_FLOWERS, + /*022*/ DECOR_COLORFUL_PLANT, + /*023*/ DECOR_BIG_PLANT, + /*024*/ DECOR_GORGEOUS_PLANT, + /*025*/ DECOR_RED_BRICK, + /*026*/ DECOR_YELLOW_BRICK, + /*027*/ DECOR_BLUE_BRICK, + /*028*/ DECOR_RED_BALLOON, + /*029*/ DECOR_BLUE_BALLOON, + /*030*/ DECOR_YELLOW_BALLOON, + /*031*/ DECOR_RED_TENT, + /*032*/ DECOR_BLUE_TENT, + /*033*/ DECOR_SOLID_BOARD, + /*034*/ DECOR_SLIDE, + /*035*/ DECOR_FENCE_LENGTH, + /*036*/ DECOR_FENCE_WIDTH, + /*037*/ DECOR_TIRE, + /*038*/ DECOR_STAND, + /*039*/ DECOR_MUD_BALL, + /*040*/ DECOR_BREAKABLE_DOOR, + /*041*/ DECOR_SAND_ORNAMENT, + /*042*/ DECOR_SILVER_SHIELD, + /*043*/ DECOR_GOLD_SHIELD, + /*044*/ DECOR_GLASS_ORNAMENT, + /*045*/ DECOR_TV, + /*046*/ DECOR_ROUND_TV, + /*047*/ DECOR_CUTE_TV, + /*048*/ DECOR_GLITTER_MAT, + /*049*/ DECOR_JUMP_MAT, + /*050*/ DECOR_SPIN_MAT, + /*051*/ DECOR_C_LOW_NOTE_MAT, + /*052*/ DECOR_D_NOTE_MAT, + /*053*/ DECOR_E_NOTE_MAT, + /*054*/ DECOR_F_NOTE_MAT, + /*055*/ DECOR_G_NOTE_MAT, + /*056*/ DECOR_A_NOTE_MAT, + /*057*/ DECOR_B_NOTE_MAT, + /*058*/ DECOR_C_HIGH_NOTE_MAT, + /*059*/ DECOR_SURF_MAT, + /*060*/ DECOR_THUNDER_MAT, + /*061*/ DECOR_FIRE_BLAST_MAT, + /*062*/ DECOR_POWDER_SNOW_MAT, + /*063*/ DECOR_ATTRACT_MAT, + /*064*/ DECOR_FISSURE_MAT, + /*065*/ DECOR_SPIKES_MAT, + /*066*/ DECOR_BALL_POSTER, + /*067*/ DECOR_GREEN_POSTER, + /*068*/ DECOR_RED_POSTER, + /*069*/ DECOR_BLUE_POSTER, + /*070*/ DECOR_CUTE_POSTER, + /*071*/ DECOR_PIKA_POSTER, + /*072*/ DECOR_LONG_POSTER, + /*073*/ DECOR_SEA_POSTER, + /*074*/ DECOR_SKY_POSTER, + /*075*/ DECOR_KISS_POSTER, + /*076*/ DECOR_PICHU_DOLL, + /*077*/ DECOR_PIKACHU_DOLL, + /*078*/ DECOR_MARILL_DOLL, + /*079*/ DECOR_TOGEPI_DOLL, + /*080*/ DECOR_CYNDAQUIL_DOLL, + /*081*/ DECOR_CHIKORITA_DOLL, + /*082*/ DECOR_TOTODILE_DOLL, + /*083*/ DECOR_JIGGLYPUFF_DOLL, + /*084*/ DECOR_MEOWTH_DOLL, + /*085*/ DECOR_CLEFAIRY_DOLL, + /*086*/ DECOR_DITTO_DOLL, + /*087*/ DECOR_SMOOCHUM_DOLL, + /*088*/ DECOR_TREECKO_DOLL, + /*089*/ DECOR_TORCHIC_DOLL, + /*090*/ DECOR_MUDKIP_DOLL, + /*091*/ DECOR_DUSKULL_DOLL, + /*092*/ DECOR_WYNAUT_DOLL, + /*093*/ DECOR_BALTOY_DOLL, + /*094*/ DECOR_KECLEON_DOLL, + /*095*/ DECOR_AZURILL_DOLL, + /*096*/ DECOR_SKITTY_DOLL, + /*097*/ DECOR_SWABLU_DOLL, + /*098*/ DECOR_GULPIN_DOLL, + /*099*/ DECOR_LOTAD_DOLL, + /*100*/ DECOR_SEEDOT_DOLL, + /*101*/ DECOR_PIKA_CUSHION, + /*102*/ DECOR_ROUND_CUSHION, + /*103*/ DECOR_KISS_CUSHION, + /*104*/ DECOR_ZIGZAG_CUSHION, + /*105*/ DECOR_SPIN_CUSHION, + /*106*/ DECOR_DIAMOND_CUSHION, + /*107*/ DECOR_BALL_CUSHION, + /*108*/ DECOR_GRASS_CUSHION, + /*109*/ DECOR_FIRE_CUSHION, + /*110*/ DECOR_WATER_CUSHION, + /*111*/ DECOR_SNORLAX_DOLL, + /*112*/ DECOR_RHYDON_DOLL, + /*113*/ DECOR_LAPRAS_DOLL, + /*114*/ DECOR_VENUSAUR_DOLL, + /*115*/ DECOR_CHARIZARD_DOLL, + /*116*/ DECOR_BLASTOISE_DOLL, + /*117*/ DECOR_WAILMER_DOLL, + /*118*/ DECOR_REGIROCK_DOLL, + /*119*/ DECOR_REGICE_DOLL, + /*120*/ DECOR_REGISTEEL_DOLL +}; + +// Exported type declarations + +struct Decoration +{ + /*0x00*/ u8 id; + /*0x01*/ u8 name[16]; + /*0x11*/ u8 permission; + /*0x12*/ u8 shape; + /*0x13*/ u8 category; + /*0x14*/ u16 price; + /*0x18*/ const u8 *description; + /*0x1c*/ const u16 *tiles; +}; + +// Exported RAM declarations + +// Exported ROM declarations +extern const struct Decoration gDecorations[]; + +#endif //GUARD_DECORATION_H diff --git a/include/easy_chat.h b/include/easy_chat.h index fc44b6a8a..b0a217320 100644 --- a/include/easy_chat.h +++ b/include/easy_chat.h @@ -30,7 +30,9 @@ enum void InitEasyChatPhrases(void); void easy_chat_input_maybe(void); -void CopyEasyChatWord(u8 *, u16); -bool32 sub_811F8D8(u16); +void CopyEasyChatWord(u8 *dest, u16 word); +bool32 sub_811F8D8(u16 word); +void InitializeEasyChatWordArray(u16 *words, u16 length); +void ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 length1, u16 length2); #endif // GUARD_EASYCHAT_H diff --git a/include/event_scripts.h b/include/event_scripts.h index f1abdd6f6..bb0d6731b 100755 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -8,4 +8,353 @@ extern const u8 gUnknown_082766A2[]; extern const u8 gUnknown_082766A6[]; +extern const u8 gTVBravoTrainerText00[]; +extern const u8 gTVBravoTrainerText01[]; +extern const u8 gTVBravoTrainerText02[]; +extern const u8 gTVBravoTrainerText03[]; +extern const u8 gTVBravoTrainerText04[]; +extern const u8 gTVBravoTrainerText05[]; +extern const u8 gTVBravoTrainerText06[]; +extern const u8 gTVBravoTrainerText07[]; +extern const u8 gTVBravoTrainerText08[]; +extern const u8 gTVBravoTrainerBattleTowerText00[]; +extern const u8 gTVBravoTrainerBattleTowerText01[]; +extern const u8 gTVBravoTrainerBattleTowerText02[]; +extern const u8 gTVBravoTrainerBattleTowerText03[]; +extern const u8 gTVBravoTrainerBattleTowerText04[]; +extern const u8 gTVBravoTrainerBattleTowerText05[]; +extern const u8 gTVBravoTrainerBattleTowerText06[]; +extern const u8 gTVBravoTrainerBattleTowerText07[]; +extern const u8 gTVBravoTrainerBattleTowerText08[]; +extern const u8 gTVBravoTrainerBattleTowerText09[]; +extern const u8 gTVBravoTrainerBattleTowerText10[]; +extern const u8 gTVBravoTrainerBattleTowerText11[]; +extern const u8 gTVBravoTrainerBattleTowerText12[]; +extern const u8 gTVBravoTrainerBattleTowerText13[]; +extern const u8 gTVBravoTrainerBattleTowerText14[]; +extern const u8 gTVFanClubOpinionsText00[]; +extern const u8 gTVFanClubOpinionsText01[]; +extern const u8 gTVFanClubOpinionsText02[]; +extern const u8 gTVFanClubOpinionsText03[]; +extern const u8 gTVFanClubOpinionsText04[]; +extern const u8 gTVFanClubText00[]; +extern const u8 gTVFanClubText01[]; +extern const u8 gTVFanClubText02[]; +extern const u8 gTVFanClubText03[]; +extern const u8 gTVFanClubText04[]; +extern const u8 gTVFanClubText05[]; +extern const u8 gTVFanClubText06[]; +extern const u8 gTVFanClubText07[]; +extern const u8 gTVRecentHappeningsText00[]; +extern const u8 gTVRecentHappeningsText01[]; +extern const u8 gTVRecentHappeningsText02[]; +extern const u8 gTVRecentHappeningsText03[]; +extern const u8 gTVRecentHappeningsText04[]; +extern const u8 gTVRecentHappeningsText05[]; +extern const u8 gTVMassOutbreakText00[]; +extern const u8 gTV3CheersForPokeblocksText00[]; +extern const u8 gTV3CheersForPokeblocksText01[]; +extern const u8 gTV3CheersForPokeblocksText02[]; +extern const u8 gTV3CheersForPokeblocksText03[]; +extern const u8 gTV3CheersForPokeblocksText04[]; +extern const u8 gTV3CheersForPokeblocksText05[]; +extern const u8 gTVTrainerFanClubSpecialText00[]; +extern const u8 gTVTrainerFanClubSpecialText01[]; +extern const u8 gTVTrainerFanClubSpecialText02[]; +extern const u8 gTVTrainerFanClubSpecialText03[]; +extern const u8 gTVTrainerFanClubSpecialText04[]; +extern const u8 gTVTrainerFanClubSpecialText05[]; +extern const u8 gTVNameRaterText00[]; +extern const u8 gTVNameRaterText01[]; +extern const u8 gTVNameRaterText02[]; +extern const u8 gTVNameRaterText03[]; +extern const u8 gTVNameRaterText04[]; +extern const u8 gTVNameRaterText05[]; +extern const u8 gTVNameRaterText06[]; +extern const u8 gTVNameRaterText07[]; +extern const u8 gTVNameRaterText08[]; +extern const u8 gTVNameRaterText09[]; +extern const u8 gTVNameRaterText10[]; +extern const u8 gTVNameRaterText11[]; +extern const u8 gTVNameRaterText12[]; +extern const u8 gTVNameRaterText13[]; +extern const u8 gTVNameRaterText14[]; +extern const u8 gTVNameRaterText15[]; +extern const u8 gTVNameRaterText16[]; +extern const u8 gTVNameRaterText17[]; +extern const u8 gTVNameRaterText18[]; +extern const u8 gTVPokemonAnglerText00[]; +extern const u8 gTVPokemonAnglerText01[]; +extern const u8 gTVPokemonTodayFailedText00[]; +extern const u8 gTVPokemonTodayFailedText01[]; +extern const u8 gTVPokemonTodayFailedText02[]; +extern const u8 gTVPokemonTodayFailedText03[]; +extern const u8 gTVPokemonTodayFailedText04[]; +extern const u8 gTVPokemonTodayFailedText05[]; +extern const u8 gTVPokemonTodayFailedText06[]; +extern const u8 gTVPokemonTodaySuccessfulText00[]; +extern const u8 gTVPokemonTodaySuccessfulText01[]; +extern const u8 gTVPokemonTodaySuccessfulText02[]; +extern const u8 gTVPokemonTodaySuccessfulText03[]; +extern const u8 gTVPokemonTodaySuccessfulText04[]; +extern const u8 gTVPokemonTodaySuccessfulText05[]; +extern const u8 gTVPokemonTodaySuccessfulText06[]; +extern const u8 gTVPokemonTodaySuccessfulText07[]; +extern const u8 gTVPokemonTodaySuccessfulText08[]; +extern const u8 gTVPokemonTodaySuccessfulText09[]; +extern const u8 gTVPokemonTodaySuccessfulText10[]; +extern const u8 gTVPokemonTodaySuccessfulText11[]; +extern const u8 gTVTodaysSmartShopperText00[]; +extern const u8 gTVTodaysSmartShopperText01[]; +extern const u8 gTVTodaysSmartShopperText02[]; +extern const u8 gTVTodaysSmartShopperText03[]; +extern const u8 gTVTodaysSmartShopperText04[]; +extern const u8 gTVTodaysSmartShopperText05[]; +extern const u8 gTVTodaysSmartShopperText06[]; +extern const u8 gTVTodaysSmartShopperText07[]; +extern const u8 gTVTodaysSmartShopperText08[]; +extern const u8 gTVTodaysSmartShopperText09[]; +extern const u8 gTVTodaysSmartShopperText10[]; +extern const u8 gTVTodaysSmartShopperText11[]; +extern const u8 gTVTodaysSmartShopperText12[]; +extern const u8 gTVWorldOfMastersText00[]; +extern const u8 gTVWorldOfMastersText01[]; +extern const u8 gTVWorldOfMastersText02[]; +extern const u8 gTVTodaysRivalTrainerText00[]; +extern const u8 gTVTodaysRivalTrainerText07[]; +extern const u8 gTVTodaysRivalTrainerText08[]; +extern const u8 gTVTodaysRivalTrainerText09[]; +extern const u8 gTVTodaysRivalTrainerText10[]; +extern const u8 gTVTodaysRivalTrainerText01[]; +extern const u8 gTVTodaysRivalTrainerText02[]; +extern const u8 gTVTodaysRivalTrainerText03[]; +extern const u8 gTVTodaysRivalTrainerText04[]; +extern const u8 gTVTodaysRivalTrainerText05[]; +extern const u8 gTVTodaysRivalTrainerText06[]; +extern const u8 gTVDewfordTrendWatcherNetworkText00[]; +extern const u8 gTVDewfordTrendWatcherNetworkText01[]; +extern const u8 gTVDewfordTrendWatcherNetworkText02[]; +extern const u8 gTVDewfordTrendWatcherNetworkText03[]; +extern const u8 gTVDewfordTrendWatcherNetworkText04[]; +extern const u8 gTVDewfordTrendWatcherNetworkText05[]; +extern const u8 gTVDewfordTrendWatcherNetworkText06[]; +extern const u8 gTVHoennTreasureInvestigatorsText00[]; +extern const u8 gTVHoennTreasureInvestigatorsText01[]; +extern const u8 gTVHoennTreasureInvestigatorsText02[]; +extern const u8 gTVFindThatGamerText00[]; +extern const u8 gTVFindThatGamerText01[]; +extern const u8 gTVFindThatGamerText02[]; +extern const u8 gTVFindThatGamerText03[]; +extern const u8 gTVBreakingNewsText00[]; +extern const u8 gTVBreakingNewsText01[]; +extern const u8 gTVBreakingNewsText02[]; +extern const u8 gTVBreakingNewsText03[]; +extern const u8 gTVBreakingNewsText04[]; +extern const u8 gTVBreakingNewsText05[]; +extern const u8 gTVBreakingNewsText06[]; +extern const u8 gTVBreakingNewsText07[]; +extern const u8 gTVBreakingNewsText12[]; +extern const u8 gTVBreakingNewsText08[]; +extern const u8 gTVBreakingNewsText09[]; +extern const u8 gTVBreakingNewsText10[]; +extern const u8 gTVBreakingNewsText11[]; +extern const u8 gTVSecretBaseVisitText00[]; +extern const u8 gTVSecretBaseVisitText01[]; +extern const u8 gTVSecretBaseVisitText02[]; +extern const u8 gTVSecretBaseVisitText03[]; +extern const u8 gTVSecretBaseVisitText04[]; +extern const u8 gTVSecretBaseVisitText05[]; +extern const u8 gTVSecretBaseVisitText06[]; +extern const u8 gTVSecretBaseVisitText07[]; +extern const u8 gTVSecretBaseVisitText08[]; +extern const u8 gTVSecretBaseVisitText09[]; +extern const u8 gTVSecretBaseVisitText10[]; +extern const u8 gTVSecretBaseVisitText11[]; +extern const u8 gTVSecretBaseVisitText12[]; +extern const u8 gTVSecretBaseVisitText13[]; +extern const u8 gTVPokemonLotteryWinnerFlashReportText00[]; +extern const u8 gTVThePokemonBattleSeminarText00[]; +extern const u8 gTVThePokemonBattleSeminarText01[]; +extern const u8 gTVThePokemonBattleSeminarText02[]; +extern const u8 gTVThePokemonBattleSeminarText03[]; +extern const u8 gTVThePokemonBattleSeminarText04[]; +extern const u8 gTVThePokemonBattleSeminarText05[]; +extern const u8 gTVThePokemonBattleSeminarText06[]; +extern const u8 gTVTrainerFanClubText00[]; +extern const u8 gTVTrainerFanClubText01[]; +extern const u8 gTVTrainerFanClubText02[]; +extern const u8 gTVTrainerFanClubText03[]; +extern const u8 gTVTrainerFanClubText04[]; +extern const u8 gTVTrainerFanClubText05[]; +extern const u8 gTVTrainerFanClubText06[]; +extern const u8 gTVTrainerFanClubText07[]; +extern const u8 gTVTrainerFanClubText08[]; +extern const u8 gTVTrainerFanClubText09[]; +extern const u8 gTVTrainerFanClubText10[]; +extern const u8 gTVTrainerFanClubText11[]; +extern const u8 gTVCutiesText00[]; +extern const u8 gTVCutiesText01[]; +extern const u8 gTVCutiesText02[]; +extern const u8 gTVCutiesText03[]; +extern const u8 gTVCutiesText04[]; +extern const u8 gTVCutiesText05[]; +extern const u8 gTVCutiesText06[]; +extern const u8 gTVCutiesText07[]; +extern const u8 gTVCutiesText08[]; +extern const u8 gTVCutiesText09[]; +extern const u8 gTVCutiesText10[]; +extern const u8 gTVCutiesText11[]; +extern const u8 gTVCutiesText12[]; +extern const u8 gTVCutiesText13[]; +extern const u8 gTVCutiesText14[]; +extern const u8 gTVCutiesText15[]; +extern const u8 gTVPokemonNewsBattleFrontierText00[]; +extern const u8 gTVPokemonNewsBattleFrontierText01[]; +extern const u8 gTVPokemonNewsBattleFrontierText02[]; +extern const u8 gTVPokemonNewsBattleFrontierText03[]; +extern const u8 gTVPokemonNewsBattleFrontierText04[]; +extern const u8 gTVPokemonNewsBattleFrontierText05[]; +extern const u8 gTVPokemonNewsBattleFrontierText06[]; +extern const u8 gTVPokemonNewsBattleFrontierText07[]; +extern const u8 gTVPokemonNewsBattleFrontierText08[]; +extern const u8 gTVPokemonNewsBattleFrontierText09[]; +extern const u8 gTVPokemonNewsBattleFrontierText10[]; +extern const u8 gTVPokemonNewsBattleFrontierText11[]; +extern const u8 gTVPokemonNewsBattleFrontierText12[]; +extern const u8 gTVPokemonNewsBattleFrontierText13[]; +extern const u8 gTVPokemonNewsBattleFrontierText14[]; +extern const u8 gTVPokemonNewsBattleFrontierText15[]; +extern const u8 gTVPokemonNewsBattleFrontierText16[]; +extern const u8 gTVPokemonNewsBattleFrontierText17[]; +extern const u8 gTVPokemonNewsBattleFrontierText18[]; +extern const u8 gTVWhatsNo1InHoennTodayText00[]; +extern const u8 gTVWhatsNo1InHoennTodayText01[]; +extern const u8 gTVWhatsNo1InHoennTodayText02[]; +extern const u8 gTVWhatsNo1InHoennTodayText03[]; +extern const u8 gTVWhatsNo1InHoennTodayText04[]; +extern const u8 gTVWhatsNo1InHoennTodayText05[]; +extern const u8 gTVWhatsNo1InHoennTodayText06[]; +extern const u8 gTVWhatsNo1InHoennTodayText07[]; +extern const u8 gTVWhatsNo1InHoennTodayText08[]; +extern const u8 gTVSecretBaseSecretsText00[]; +extern const u8 gTVSecretBaseSecretsText01[]; +extern const u8 gTVSecretBaseSecretsText02[]; +extern const u8 gTVSecretBaseSecretsText03[]; +extern const u8 gTVSecretBaseSecretsText04[]; +extern const u8 gTVSecretBaseSecretsText05[]; +extern const u8 gTVSecretBaseSecretsText06[]; +extern const u8 gTVSecretBaseSecretsText07[]; +extern const u8 gTVSecretBaseSecretsText08[]; +extern const u8 gTVSecretBaseSecretsText09[]; +extern const u8 gTVSecretBaseSecretsText10[]; +extern const u8 gTVSecretBaseSecretsText11[]; +extern const u8 gTVSecretBaseSecretsText12[]; +extern const u8 gTVSecretBaseSecretsText13[]; +extern const u8 gTVSecretBaseSecretsText14[]; +extern const u8 gTVSecretBaseSecretsText15[]; +extern const u8 gTVSecretBaseSecretsText16[]; +extern const u8 gTVSecretBaseSecretsText17[]; +extern const u8 gTVSecretBaseSecretsText18[]; +extern const u8 gTVSecretBaseSecretsText19[]; +extern const u8 gTVSecretBaseSecretsText20[]; +extern const u8 gTVSecretBaseSecretsText21[]; +extern const u8 gTVSecretBaseSecretsText22[]; +extern const u8 gTVSecretBaseSecretsText23[]; +extern const u8 gTVSecretBaseSecretsText24[]; +extern const u8 gTVSecretBaseSecretsText25[]; +extern const u8 gTVSecretBaseSecretsText26[]; +extern const u8 gTVSecretBaseSecretsText27[]; +extern const u8 gTVSecretBaseSecretsText28[]; +extern const u8 gTVSecretBaseSecretsText29[]; +extern const u8 gTVSecretBaseSecretsText30[]; +extern const u8 gTVSecretBaseSecretsText31[]; +extern const u8 gTVSecretBaseSecretsText32[]; +extern const u8 gTVSecretBaseSecretsText33[]; +extern const u8 gTVSecretBaseSecretsText34[]; +extern const u8 gTVSecretBaseSecretsText35[]; +extern const u8 gTVSecretBaseSecretsText36[]; +extern const u8 gTVSecretBaseSecretsText37[]; +extern const u8 gTVSecretBaseSecretsText38[]; +extern const u8 gTVSecretBaseSecretsText39[]; +extern const u8 gTVSecretBaseSecretsText40[]; +extern const u8 gTVSecretBaseSecretsText41[]; +extern const u8 gTVSecretBaseSecretsText42[]; +extern const u8 gTVSafariFanClubText00[]; +extern const u8 gTVSafariFanClubText01[]; +extern const u8 gTVSafariFanClubText02[]; +extern const u8 gTVSafariFanClubText03[]; +extern const u8 gTVSafariFanClubText04[]; +extern const u8 gTVSafariFanClubText05[]; +extern const u8 gTVSafariFanClubText06[]; +extern const u8 gTVSafariFanClubText07[]; +extern const u8 gTVSafariFanClubText08[]; +extern const u8 gTVSafariFanClubText09[]; +extern const u8 gTVSafariFanClubText10[]; +extern const u8 gTVContestLiveUpdatesText00[]; +extern const u8 gTVContestLiveUpdatesText01[]; +extern const u8 gTVContestLiveUpdatesText02[]; +extern const u8 gTVContestLiveUpdatesText03[]; +extern const u8 gTVContestLiveUpdatesText04[]; +extern const u8 gTVContestLiveUpdatesText05[]; +extern const u8 gTVContestLiveUpdatesText06[]; +extern const u8 gTVContestLiveUpdatesText07[]; +extern const u8 gTVContestLiveUpdatesText08[]; +extern const u8 gTVContestLiveUpdatesText09[]; +extern const u8 gTVContestLiveUpdatesText10[]; +extern const u8 gTVContestLiveUpdatesText11[]; +extern const u8 gTVContestLiveUpdatesText12[]; +extern const u8 gTVContestLiveUpdatesText13[]; +extern const u8 gTVContestLiveUpdatesText14[]; +extern const u8 gTVContestLiveUpdatesText15[]; +extern const u8 gTVContestLiveUpdatesText16[]; +extern const u8 gTVContestLiveUpdatesText17[]; +extern const u8 gTVContestLiveUpdatesText18[]; +extern const u8 gTVContestLiveUpdatesText19[]; +extern const u8 gTVContestLiveUpdatesText20[]; +extern const u8 gTVContestLiveUpdatesText21[]; +extern const u8 gTVContestLiveUpdatesText22[]; +extern const u8 gTVContestLiveUpdatesText23[]; +extern const u8 gTVContestLiveUpdatesText24[]; +extern const u8 gTVContestLiveUpdatesText25[]; +extern const u8 gTVContestLiveUpdatesText26[]; +extern const u8 gTVContestLiveUpdatesText27[]; +extern const u8 gTVContestLiveUpdatesText28[]; +extern const u8 gTVContestLiveUpdatesText29[]; +extern const u8 gTVContestLiveUpdatesText30[]; +extern const u8 gTVContestLiveUpdatesText31[]; +extern const u8 gTVContestLiveUpdatesText32[]; +extern const u8 gTVPokemonBattleUpdateText00[]; +extern const u8 gTVPokemonBattleUpdateText01[]; +extern const u8 gTVPokemonBattleUpdateText02[]; +extern const u8 gTVPokemonBattleUpdateText03[]; +extern const u8 gTVPokemonBattleUpdateText04[]; +extern const u8 gTVPokemonBattleUpdateText05[]; +extern const u8 gTVPokemonBattleUpdateText06[]; +extern const u8 gTVPokemonBattleUpdateText07[]; +extern const u8 gTVInSearchOfTrainersText00[]; +extern const u8 gTVInSearchOfTrainersText01[]; +extern const u8 gTVInSearchOfTrainersText02[]; +extern const u8 gTVInSearchOfTrainersText03[]; +extern const u8 gTVInSearchOfTrainersText04[]; +extern const u8 gTVInSearchOfTrainersText05[]; +extern const u8 gTVInSearchOfTrainersText06[]; +extern const u8 gTVInSearchOfTrainersText07[]; +extern const u8 gTVInSearchOfTrainersText08[]; +extern const u8 gTVPokemonContestLiveUpdates2Text00[]; +extern const u8 gTVPokemonContestLiveUpdates2Text01[]; +extern const u8 gTVPokemonContestLiveUpdates2Text02[]; +extern const u8 gTVPokemonContestLiveUpdates2Text03[]; +extern const u8 gPokeNewsTextSlateport_Upcoming[]; +extern const u8 gPokeNewsTextSlateport_Ongoing[]; +extern const u8 gPokeNewsTextSlateport_Ending[]; +extern const u8 gPokeNewsTextGameCorner_Upcoming[]; +extern const u8 gPokeNewsTextGameCorner_Ongoing[]; +extern const u8 gPokeNewsTextGameCorner_Ending[]; +extern const u8 gPokeNewsTextLilycove_Upcoming[]; +extern const u8 gPokeNewsTextLilycove_Ongoing[]; +extern const u8 gPokeNewsTextLilycove_Ending[]; +extern const u8 gPokeNewsTextBlendMaster_Upcoming[]; +extern const u8 gPokeNewsTextBlendMaster_Ongoing[]; +extern const u8 gPokeNewsTextBlendMaster_Ending[]; + #endif //GUARD_EVENT_SCRIPTS_H diff --git a/include/field_camera.h b/include/field_camera.h index 9fbaac6a2..f74fadd86 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -22,4 +22,6 @@ extern u16 gUnknown_03005DE8; // Exported ROM declarations +void DrawWholeMapView(void); + #endif //GUARD_FIELD_CAMERA_H diff --git a/include/field_message_box.h b/include/field_message_box.h new file mode 100644 index 000000000..e33d52ccf --- /dev/null +++ b/include/field_message_box.h @@ -0,0 +1,12 @@ +#ifndef GUARD_field_message_box_H +#define GUARD_field_message_box_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +void ShowFieldMessage(const u8 *); + +#endif //GUARD_field_message_box_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 7174d98cc..e95e4e0ce 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -8,9 +8,14 @@ // Exported type declarations // Exported RAM declarations +extern struct MapCoords { + int width; + int height; +} gUnknown_03005DC0; // Exported ROM declarations -u8 MapGridGetMetatileBehaviorAt(s16, s16); +u32 MapGridGetMetatileBehaviorAt(int, int); +void MapGridSetMetatileIdAt(int, int, u16); void GetCameraCoords(u16*, u16*); bool8 MapGridIsImpassableAt(s16, s16); s32 GetMapBorderIdAt(s16, s16); diff --git a/include/flags.h b/include/flags.h index 020fc59cb..7d825feba 100644 --- a/include/flags.h +++ b/include/flags.h @@ -3,7 +3,7 @@ #define TRAINER_FLAG_START 0x500 #define TRAINERS_FLAG_NO 0x356 -#define CODE_FLAGS (TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) +#define CODE_FLAGS (TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860 // SYSTEM FLAGS @@ -84,6 +84,20 @@ #define SYS_CTRL_OBJ_DELETE CODE_FLAGS + 0x61 #define SYS_RESET_RTC_ENABLE CODE_FLAGS + 0x62 +#define SYS_TOWER_SILVER CODE_FLAGS + 0x64 +#define SYS_TOWER_GOLD CODE_FLAGS + 0x65 +#define SYS_DOME_SILVER CODE_FLAGS + 0x66 +#define SYS_DOME_GOLD CODE_FLAGS + 0x67 +#define SYS_PALACE_SILVER CODE_FLAGS + 0x68 +#define SYS_PALACE_GOLD CODE_FLAGS + 0x69 +#define SYS_ARENA_SILVER CODE_FLAGS + 0x6A +#define SYS_ARENA_GOLD CODE_FLAGS + 0x6B +#define SYS_FACTORY_SILVER CODE_FLAGS + 0x6C +#define SYS_FACTORY_GOLD CODE_FLAGS + 0x6D +#define SYS_PIKE_SILVER CODE_FLAGS + 0x6E +#define SYS_PIKE_GOLD CODE_FLAGS + 0x6F +#define SYS_PYRAMID_SILVER CODE_FLAGS + 0x70 +#define SYS_PYRAMID_GOLD CODE_FLAGS + 0x71 #define SYS_FRONTIER_PASS CODE_FLAGS + 0x72 #define SYS_STORAGE_UNKNOWN_FLAG CODE_FLAGS + 0x77 diff --git a/include/game_stat.h b/include/game_stat.h index b8a5c3232..5979c531c 100644 --- a/include/game_stat.h +++ b/include/game_stat.h @@ -56,4 +56,7 @@ #define NUM_GAME_STATS 64 +void IncrementGameStat(u8); +u32 GetGameStat(u8); + #endif // GUARD_GAME_STAT_H diff --git a/include/global.h b/include/global.h index e98b01ee2..58a0d79dc 100644 --- a/include/global.h +++ b/include/global.h @@ -197,7 +197,13 @@ struct SaveBlock2 // All below could be a one giant struct - /*0x64C*/ u8 field_64C[1629]; + /*0x64C*/ u8 field_64C[0x588]; + /*0xBD4*/ u16 field_BD4; + /*0xBD6*/ u16 field_BD6; + /*0xBD8*/ u8 field_BD8[11]; + /*0xBE3*/ u8 filler_BE3[8]; + /*0xBEB*/ u8 field_BEB; + /*0xBE3*/ u8 filler_BEC[189]; /*0xCA9*/ u8 frontierChosenLvl : 2; // 0x1, 0x2 -> 0x3 /*0xCA9*/ u8 field_CA9_a : 1; // 0x4 /*0xCA9*/ u8 field_CA9_b : 1; // 0x8 @@ -205,7 +211,10 @@ struct SaveBlock2 /*0xCA9*/ u8 field_CA9_d : 1; // 0x20 /*0xCA9*/ u8 field_CA9_e : 1; // 0x40 /*0xCA9*/ u8 field_CA9_f : 1; // 0x80 - /*0xCAA*/ u8 field_CAA[368]; + /*0xCAA*/ u16 field_CAA[0x2e]; + /*0xD06*/ u8 field_D06; + /*0xD07*/ u8 field_D07; + /*0xd08*/ u8 filler_D08[0x112]; /*0xE1A*/ u16 battlePyramidFloor; // possibly? /*0xE1C*/ u8 field_E1C[16]; /*0xE2C*/ struct PyramidBag pyramidBag; @@ -225,30 +234,31 @@ extern struct SaveBlock2 *gSaveBlock2Ptr; struct SecretBaseRecord { - u8 sbr_field_0; - u8 sbr_field_1_0:4; - u8 gender:1; - u8 sbr_field_1_5:1; - u8 sbr_field_1_6:2; - u8 trainerName[7]; - u8 trainerId[4]; // byte 0 is used for determining trainer class - u8 language; - u16 sbr_field_e; - u8 sbr_field_10; - u8 sbr_field_11; - u8 decorations[16]; - u8 decorationPos[16]; - u32 partyPersonality[6]; - u16 partyMoves[6 * 4]; - u16 partySpecies[6]; - u16 partyHeldItems[6]; - u8 partyLevels[6]; - u8 partyEVs[6]; + /*ID?*/ /*0x1A9C*/ u8 sbr_field_0; + /*0x1A9D*/ u8 sbr_field_1_0:4; + /*0x1A9D*/ u8 gender:1; + /*0x1A9D*/ u8 sbr_field_1_5:1; + /*0x1A9D*/ u8 sbr_field_1_6:2; + /*0x1A9E*/ u8 trainerName[7]; // 0xFF bytes? + /*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class + /*0x1AA9*/ u8 language; + /*0x1AAA*/ u16 sbr_field_e; + /*0x1AAC*/ u8 sbr_field_10; + /*0x1AAD*/ u8 sbr_field_11; + /*0x1AAE*/ u8 decorations[16]; + /*0x1ABE*/ u8 decorationPos[16]; + /*0x1ACE*/ u32 partyPersonality[6]; + /*0x1AE6*/ u16 partyMoves[6 * 4]; + /*0x1B16*/ u16 partySpecies[6]; + /*0x1B22*/ u16 partyHeldItems[6]; + /*0x1B2E*/ u8 partyLevels[6]; + /*0x1B34*/ u8 partyEVs[6]; }; #include "game_stat.h" #include "global.fieldmap.h" #include "global.berry.h" +#include "global.tv.h" #include "pokemon.h" struct WarpData @@ -317,218 +327,6 @@ struct EasyChatPair u16 words[2]; }; /*size = 0x8*/ -struct TVShowCommon -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 pad02[20]; - /*0x16*/ u16 var16[3]; - /*0x1C*/ u8 srcTrainerId3Lo; - /*0x1D*/ u8 srcTrainerId3Hi; - /*0x1E*/ u8 srcTrainerId2Lo; - /*0x1F*/ u8 srcTrainerId2Hi; - /*0x20*/ u8 srcTrainerIdLo; - /*0x21*/ u8 srcTrainerIdHi; - /*0x22*/ u8 trainerIdLo; - /*0x23*/ u8 trainerIdHi; -}; - -struct TVShowFanClubLetter -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u16 pad04[6]; - /*0x10*/ u8 playerName[8]; - /*0x18*/ u8 language; -}; - -struct TVShowRecentHappenings -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u16 var04[6]; - /*0x10*/ u8 playerName[8]; - /*0x18*/ u8 language; - /*0x19*/ u8 pad19[10]; -}; - -struct TVShowFanclubOpinions -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u8 var04A:4; - /*0x04*/ u8 var04B:4; - /*0x05*/ u8 playerName[8]; - /*0x0D*/ u8 language; - /*0x0E*/ u8 var0E; - /*0x0F*/ u8 var0F; - /*0x10*/ u8 var10[8]; - /*0x18*/ u16 var18[2]; - /*0x1C*/ u16 var1C[4]; -}; - -struct TVShowUnknownType04 -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 pad02[4]; - /*0x06*/ u16 var06; -}; - -struct TVShowNameRaterShow -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u8 pokemonName[11]; - /*0x0F*/ u8 trainerName[11]; - /*0x1A*/ u8 random; - /*0x1B*/ u8 random2; - /*0x1C*/ u16 var1C; - /*0x1E*/ u8 language; - /*0x1F*/ u8 pokemonNameLanguage; -}; - -struct TVShowBravoTrainerPokemonProfiles -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 species; - /*0x04*/ u16 var04[2]; - /*0x08*/ u8 pokemonNickname[11]; - /*0x13*/ u8 contestCategory:3; - /*0x13*/ u8 contestRank:2; - /*0x13*/ u8 contestResult:2; - /*0x13*/ u8 var13_7:1; - /*0x14*/ u16 var14; - /*0x16*/ u8 playerName[8]; - /*0x1E*/ u8 language; - /*0x1F*/ u8 var1f; -}; - -struct TVShowBravoTrainerBattleTowerSpotlight -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 trainerName[8]; - /*0x0A*/ u16 species; - /*0x0C*/ u8 pokemonName[8]; - /*0x14*/ u16 defeatedSpecies; - /*0x16*/ u16 var16; - /*0x18*/ u16 var18[1]; - /*0x1A*/ u8 btLevel; - /*0x1B*/ u8 var1b; - /*0x1C*/ u8 var1c; - /*0x1D*/ u8 language; -}; - -struct TVShowPokemonToday -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 language; - /*0x03*/ u8 language2; - /*0x04*/ u8 nickname[11]; - /*0x0F*/ u8 ball; - /*0x10*/ u16 species; - /*0x12*/ u8 var12; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowSmartShopper -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 priceReduced; - /*0x03*/ u8 language; - /*0x04*/ u8 pad04[2]; - /*0x06*/ u16 itemIds[3]; - /*0x0C*/ u16 itemAmounts[3]; - /*0x12*/ u8 shopLocation; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowPokemonTodayFailed -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 language; - /*0x03*/ u8 pad03[9]; - /*0x0c*/ u16 species; - /*0x0e*/ u16 species2; - /*0x10*/ u8 var10; - /*0x11*/ u8 var11; - /*0x12*/ u8 var12; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowPokemonAngler -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 var02; - /*0x03*/ u8 var03; - /*0x04*/ u16 var04; - /*0x06*/ u8 language; - u8 pad07[12]; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowWorldOfMasters -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u16 var02; - /*0x04*/ u16 var04; - /*0x06*/ u16 var06; - /*0x08*/ u16 var08; - /*0x0a*/ u8 var0a; - /*0x0b*/ u8 language; - u8 pad0c[7]; - /*0x13*/ u8 playerName[8]; -}; - -struct TVShowMassOutbreak -{ - /*0x00*/ u8 var00; - /*0x01*/ u8 var01; - /*0x02*/ u8 var02; - /*0x03*/ u8 var03; - /*0x04*/ u16 moves[4]; - /*0x0C*/ u16 species; - /*0x0E*/ u16 var0E; - /*0x10*/ u8 locationMapNum; - /*0x11*/ u8 locationMapGroup; - /*0x12*/ u8 var12; - /*0x13*/ u8 probability; - /*0x14*/ u8 level; - /*0x15*/ u8 var15; - /*0x16*/ u16 var16; - /*0x18*/ u8 language; - u8 pad19[11]; -}; - -typedef union TVShow -{ - struct TVShowCommon common; - struct TVShowFanClubLetter fanclubLetter; - struct TVShowRecentHappenings recentHappenings; - struct TVShowFanclubOpinions fanclubOpinions; - struct TVShowUnknownType04 unkShow04; - struct TVShowNameRaterShow nameRaterShow; - struct TVShowBravoTrainerPokemonProfiles bravoTrainer; - struct TVShowBravoTrainerBattleTowerSpotlight bravoTrainerTower; - struct TVShowPokemonToday pokemonToday; - struct TVShowSmartShopper smartshopperShow; - struct TVShowPokemonTodayFailed pokemonTodayFailed; - struct TVShowPokemonAngler pokemonAngler; - struct TVShowWorldOfMasters worldOfMasters; - struct TVShowMassOutbreak massOutbreak; -} TVShow; - struct MailStruct { /*0x00*/ u16 words[9]; @@ -576,35 +374,6 @@ typedef union OldMan u8 filler[0x40]; } OldMan; -struct UnknownSaveStruct2ABC -{ - u8 val0; - u8 val1; - u16 val2; -}; - -struct GabbyAndTyData -{ - /*2b10*/ u16 mon1; - /*2b12*/ u16 mon2; - /*2b14*/ u16 lastMove; - /*2b16*/ u16 quote; - /*2b18*/ u8 mapnum; - /*2b19*/ u8 battleNum; - /*2b1a*/ u8 valA_0:1; - /*2b1a*/ u8 valA_1:1; - /*2b1a*/ u8 valA_2:1; - /*2b1a*/ u8 valA_3:1; - /*2b1a*/ u8 valA_4:1; - /*2b1a*/ u8 valA_5:3; - /*2b1b*/ u8 valB_0:1; - /*2b1b*/ u8 valB_1:1; - /*2b1b*/ u8 valB_2:1; - /*2b1b*/ u8 valB_3:1; - /*2b1b*/ u8 valB_4:1; - /*2b1b*/ u8 valB_5:3; -}; - struct RecordMixing_UnknownStructSub { u32 unk0; @@ -781,22 +550,22 @@ struct SaveBlock1 /*0x????*/ u8 decorCushion[10]; /*0x27CA*/ u8 padding_27CA[2]; /*0x27CC*/ TVShow tvShows[25]; - /*0x2B50*/ struct UnknownSaveStruct2ABC pokeNews[16]; + /*0x2B50*/ PokeNews pokeNews[16]; /*0x2B90*/ u16 outbreakPokemonSpecies; - /*0x????*/ u8 outbreakLocationMapNum; - /*0x????*/ u8 outbreakLocationMapGroup; - /*0x????*/ u8 outbreakPokemonLevel; - /*0x????*/ u8 outbreakUnk1; - /*0x????*/ u16 outbreakUnk2; - /*0x????*/ u16 outbreakPokemonMoves[4]; - /*0x????*/ u8 outbreakUnk4; - /*0x????*/ u8 outbreakPokemonProbability; - /*0x????*/ u16 outbreakUnk5; + /*0x2B92*/ u8 outbreakLocationMapNum; + /*0x2B93*/ u8 outbreakLocationMapGroup; + /*0x2B94*/ u8 outbreakPokemonLevel; + /*0x2B95*/ u8 outbreakUnk1; + /*0x2B96*/ u16 outbreakUnk2; + /*0x2B98*/ u16 outbreakPokemonMoves[4]; + /*0x2BA0*/ u8 outbreakUnk4; + /*0x2BA1*/ u8 outbreakPokemonProbability; + /*0x2BA2*/ u16 outbreakDaysLeft; /*0x2BA4*/ struct GabbyAndTyData gabbyAndTyData; - /*0x????*/ u16 unk2B1C[6]; - /*0x????*/ u16 unk2B28[6]; - /*0x????*/ u16 unk2B34[6]; - /*0x????*/ u16 unk2B3A[3]; + /*0x2BB0*/ u16 unk2BB0[6]; + /*0x2BBC*/ u16 unk2BBC[6]; + /*0x2BC8*/ u16 unk2BC8[6]; + /*0x2BD4*/ u16 unk2BD4[3]; /*0x2BE0*/ struct MailStruct mail[16]; /*0x2E20*/ u8 additionalPhrases[5]; // bitfield for 33 additional phrases in easy chat system /*0x2E25*/ u8 unk2E25[3]; // possibly padding? @@ -806,7 +575,8 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum /*0x3030*/ struct DaycareData daycare; /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5]; - /*0x31A0*/ u8 filler_31A0[8]; + /*0x31A0*/ u8 unk_31A0; + /*0x31A1*/ u8 filler_31A1[7]; /*0x31A8*/ u8 giftRibbons[52]; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; diff --git a/include/global.tv.h b/include/global.tv.h new file mode 100644 index 000000000..5f65aa8e0 --- /dev/null +++ b/include/global.tv.h @@ -0,0 +1,535 @@ +#ifndef GUARD_GLOBAL_TV_H +#define GUARD_GLOBAL_TV_H + +enum +{ + TVSHOW_OFF_AIR, + + TVSHOW_FAN_CLUB_LETTER = 1, + TVSHOW_RECENT_HAPPENINGS, + TVSHOW_PKMN_FAN_CLUB_OPINIONS, + TVSHOW_UNKN_SHOWTYPE_04, + TVSHOW_NAME_RATER_SHOW, + TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE, + TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE, + TVSHOW_CONTEST_LIVE_UPDATES, + TVSHOW_3_CHEERS_FOR_POKEBLOCKS, + TVSHOW_BATTLE_UPDATE, + TVSHOW_FAN_CLUB_SPECIAL, + TVSHOW_CONTEST_LIVE_UPDATES_2, + + TVSHOW_POKEMON_TODAY_CAUGHT = 21, + TVSHOW_SMART_SHOPPER, + TVSHOW_POKEMON_TODAY_FAILED, + TVSHOW_FISHING_ADVICE, + TVSHOW_WORLD_OF_MASTERS, + TVSHOW_TODAYS_RIVAL_TRAINER, + TVSHOW_TREND_WATCHER, + TVSHOW_TREASURE_INVESTIGATORS, + TVSHOW_FIND_THAT_GAMER, + TVSHOW_BREAKING_NEWS, + TVSHOW_SECRET_BASE_VISIT, + TVSHOW_LOTTO_WINNER, + TVSHOW_BATTLE_SEMINAR, + TVSHOW_TRAINER_FAN_CLUB, + TVSHOW_CUTIES, + TVSHOW_FRONTIER, + TVSHOW_NUMBER_ONE, + TVSHOW_SECRET_BASE_SECRETS, + TVSHOW_SAFARI_FAN_CLUB, + + TVSHOW_MASS_OUTBREAK = 41, +}; + +typedef union // size = 0x24 +{ + // Common + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 pad02[26]; + /*0x1C*/ u8 srcTrainerId3Lo; + /*0x1D*/ u8 srcTrainerId3Hi; + /*0x1E*/ u8 srcTrainerId2Lo; + /*0x1F*/ u8 srcTrainerId2Hi; + /*0x20*/ u8 srcTrainerIdLo; + /*0x21*/ u8 srcTrainerIdHi; + /*0x22*/ u8 trainerIdLo; + /*0x23*/ u8 trainerIdHi; + } common; + + // Local shows + // TVSHOW_FAN_CLUB_LETTER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u16 words[6]; + /*0x10*/ u8 playerName[8]; + /*0x18*/ u8 language; + } fanclubLetter; + + // TVSHOW_RECENT_HAPPENINGS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 var02; + /*0x04*/ u16 words[6]; + /*0x10*/ u8 playerName[8]; + /*0x18*/ u8 language; + } recentHappenings; + + // TVSHOW_PKMN_FAN_CLUB_OPINIONS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 friendshipHighNybble:4; + /*0x04*/ u8 questionAsked:4; + /*0x05*/ u8 playerName[8]; + /*0x0D*/ u8 language; + /*0x0E*/ u8 pokemonNameLanguage; + /*0x0F*/ u8 filler_0F[1]; + /*0x10*/ u8 nickname[8]; + /*0x18*/ u8 filler_18[4]; + /*0x1C*/ u16 words[4]; + } fanclubOpinions; + + // TVSHOW_UNKN_SHOWTYPE_04 (dummied out) + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 pad02[4]; + /*0x06*/ u16 var06; + /*0x08*/ u8 pad_08[3]; + /*0x0b*/ u8 string_0b[12]; + /*0x17*/ u8 language; + } unkShow04; + + // TVSHOW_NAME_RATER_SHOW + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 pokemonName[11]; + /*0x0F*/ u8 trainerName[11]; + /*0x1A*/ u8 random; + /*0x1B*/ u8 random2; + /*0x1C*/ u16 randomSpecies; + /*0x1E*/ u8 language; + /*0x1F*/ u8 pokemonNameLanguage; + } nameRaterShow; + + // TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE (contest) + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 pokemonNickname[11]; + /*0x13*/ u8 contestCategory:3; + /*0x13*/ u8 contestRank:2; + /*0x13*/ u8 contestResult:2; + /*0x14*/ u16 move; + /*0x16*/ u8 playerName[8]; + /*0x1E*/ u8 language; + /*0x1F*/ u8 pokemonNameLanguage; + } bravoTrainer; + + // TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 trainerName[8]; + /*0x0A*/ u16 species; + /*0x0C*/ u8 pokemonName[8]; + /*0x14*/ u16 defeatedSpecies; + /*0x16*/ u16 numFights; + /*0x18*/ u16 words[1]; + /*0x1A*/ u8 btLevel; + /*0x1B*/ u8 interviewResponse; + /*0x1C*/ bool8 wonTheChallenge; + /*0x1D*/ u8 language; + /*0x1E*/ u8 pokemonNameLanguage; + } bravoTrainerTower; + + // TVSHOW_CONTEST_LIVE_UPDATES + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 winningSpecies; + /*0x04*/ u8 winningTrainerName[8]; + /*0x0C*/ u8 appealFlags2; + /*0x0D*/ u8 round1Rank; + /*0x0e*/ u8 round2Rank; + /*0x0f*/ u8 appealFlags1; + /*0x10*/ u16 move; + /*0x12*/ u16 species; + /*0x14*/ u8 playerName[8]; + /*0x1C*/ u8 category; + /*0x1D*/ u8 language; + /*0x1E*/ u8 winningTrainerLanguage; + } contestLiveUpdates; + + // TVSHOW_3_CHEERS_FOR_POKEBLOCKS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 sheen; + /*0x03*/ u8 flavor:3; + /*0x03*/ u8 unk_03_3:2; + /*0x04*/ u8 worstBlenderName[8]; + /*0x0C*/ u8 playerName[8]; + /*0x14*/ u8 language; + /*0x15*/ u8 worstBlenderLanguage; + } threeCheers; + + // TVSHOW_BATTLE_UPDATE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 species; + /*0x04*/ u8 playerName[8]; + /*0x0C*/ u8 linkOpponentName[8]; + /*0x14*/ u16 move; + /*0x16*/ u16 species2; + /*0x18*/ u8 battleType; + /*0x19*/ u8 language; + /*0x1A*/ u8 linkOpponentLanguage; + } battleUpdate; + + // TVSHOW_FAN_CLUB_SPECIAL + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 playerName[8]; + /*0x0a*/ u8 idLo; + /*0x0b*/ u8 idHi; + /*0x0c*/ u8 idolName[8]; + /*0x14*/ u16 words[1]; + /*0x16*/ u8 score; + /*0x17*/ u8 language; + /*0x18*/ u8 idolNameLanguage; + } fanClubSpecial; + + // TVSHOW_CONTEST_LIVE_UPDATES_2 + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 playerName[8]; + /*0x0a*/ u8 contestCategory; + /*0x0b*/ u8 nickname[11]; + /*0x16*/ u8 pokeblockState; + /*0x17*/ u8 language; + /*0x18*/ u8 pokemonNameLanguage; + } contestLiveUpdates2; + + // Record Mixing Shows + // TVSHOW_POKEMON_TODAY_CAUGHT + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 language; + /*0x03*/ u8 language2; + /*0x04*/ u8 nickname[11]; + /*0x0F*/ u8 ball; + /*0x10*/ u16 species; + /*0x12*/ u8 nBallsUsed; + /*0x13*/ u8 playerName[8]; + } pokemonToday; + + // TVSHOW_SMART_SHOPPER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 priceReduced; + /*0x03*/ u8 language; + /*0x04*/ u8 pad04[2]; + /*0x06*/ u16 itemIds[3]; + /*0x0C*/ u16 itemAmounts[3]; + /*0x12*/ u8 shopLocation; + /*0x13*/ u8 playerName[8]; + } smartshopperShow; + + // TVSHOW_POKEMON_TODAY_FAILED + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 language; + /*0x03*/ u8 pad03[9]; + /*0x0c*/ u16 species; + /*0x0e*/ u16 species2; + /*0x10*/ u8 nBallsUsed; + /*0x11*/ u8 outcome; + /*0x12*/ u8 location; + /*0x13*/ u8 playerName[8]; + } pokemonTodayFailed; + + // TVSHOW_FISHING_ADVICE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nBites; + /*0x03*/ u8 nFails; + /*0x04*/ u16 species; + /*0x06*/ u8 language; + /*0x07*/ u8 pad07[12]; + /*0x13*/ u8 playerName[8]; + } pokemonAngler; + + // TVSHOW_WORLD_OF_MASTERS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 numPokeCaught; + /*0x04*/ u16 caughtPoke; + /*0x06*/ u16 steps; + /*0x08*/ u16 species; + /*0x0a*/ u8 location; + /*0x0b*/ u8 language; + /*0x0c*/ u8 pad0c[7]; + /*0x13*/ u8 playerName[8]; + } worldOfMasters; + + // TVSHOW_TODAYS_RIVAL_TRAINER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 dexCount; + /*0x04*/ u8 badgeCount; + /*0x05*/ u8 nSilverSymbols; + /*0x06*/ u8 nGoldSymbols; + /*0x07*/ u8 location; + /*0x08*/ u16 battlePoints; + /*0x0a*/ u16 mapDataId; + /*0x0c*/ u8 language; + /*0x0d*/ u8 filler_0d[6]; + /*0x13*/ u8 playerName[8]; + } rivalTrainer; + + // TVSHOW_TREND_WATCHER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 filler_02[2]; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 gender; + /*0x09*/ u8 language; + /*0x0a*/ u8 filler_0a[9]; + /*0x13*/ u8 playerName[8]; + } trendWatcher; + + // TVSHOW_TREASURE_INVESTIGATORS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 item; + /*0x04*/ u8 location; + /*0x05*/ u8 language; + /*0x06*/ u16 mapDataId; + /*0x08*/ u8 filler_08[11]; + /*0x13*/ u8 playerName[8]; + } treasureInvestigators; + + // TVSHOW_FIND_THAT_GAMER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 won; + /*0x03*/ u8 whichGame; + /*0x04*/ u16 nCoins; + /*0x06*/ u8 filler_06[2]; + /*0x08*/ u8 language; + /*0x09*/ u8 filler_09[10]; + /*0x13*/ u8 playerName[8]; + } findThatGamer; + + // TVSHOW_BREAKING_NEWS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 lastOpponentSpecies; + /*0x04*/ u8 location; + /*0x05*/ u8 outcome; + /*0x06*/ u16 caughtMonBall; + /*0x08*/ u16 balls; + /*0x0a*/ u16 poke1Species; + /*0x0c*/ u16 lastUsedMove; + /*0x0e*/ u8 language; + /*0x0f*/ u8 filler_0f[4]; + /*0x13*/ u8 playerName[8]; + } breakingNews; + + // TVSHOW_SECRET_BASE_VISIT + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 avgLevel; + /*0x03*/ u8 nDecorations; + /*0x04*/ u8 decorations[4]; + /*0x08*/ u16 species; + /*0x0a*/ u16 move; + /*0x0c*/ u8 language; + /*0x0d*/ u8 filler_0d[6]; + /*0x13*/ u8 playerName[8]; + } secretBaseVisit; + + // TVSHOW_LOTTO_WINNER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 item; + /*0x04*/ u8 whichPrize; + /*0x05*/ u8 language; + /*0x06*/ u8 filler_06[13]; + /*0x13*/ u8 playerName[8]; + } lottoWinner; + + // TVSHOW_BATTLE_SEMINAR + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 move; + /*0x04*/ u16 foeSpecies; + /*0x06*/ u16 species; + /*0x08*/ u16 otherMoves[3]; + /*0x0e*/ u16 betterMove; + /*0x10*/ u8 nOtherMoves; + /*0x11*/ u8 language; + /*0x12*/ u8 filler_12[1]; + /*0x13*/ u8 playerName[8]; + } battleSeminar; + + // TVSHOW_TRAINER_FAN_CLUB + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 filler_02[2]; + /*0x04*/ u16 words[2]; + /*0x08*/ u8 language; + /*0x09*/ u8 filler_09[10]; + /*0x13*/ u8 playerName[8]; + } trainerFanClub; + + // TVSHOW_CUTIES + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nRibbons; + /*0x03*/ u8 selectedRibbon; + /*0x04*/ u8 nickname[11]; + /*0x0f*/ u8 language; + /*0x10*/ u8 pokemonNameLanguage; + /*0x11*/ u8 filler_12[2]; + /*0x13*/ u8 playerName[8]; + } cuties; + + // TVSHOW_FRONTIER + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 winStreak; + /*0x04*/ u16 species1; + /*0x06*/ u16 species2; + /*0x08*/ u16 species3; + /*0x0a*/ u16 species4; + /*0x0c*/ u8 language; + /*0x0d*/ u8 facility; + /*0x0e*/ u8 filler_0e[5]; + /*0x13*/ u8 playerName[8]; + } frontier; + + // TVSHOW_NUMBER_ONE + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 count; + /*0x04*/ u8 actionIdx; + /*0x05*/ u8 language; + /*0x06*/ u8 filler_06[13]; + /*0x13*/ u8 playerName[8]; + } numberOne; + + // TVSHOW_SECRET_BASE_SECRETS + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u16 stepsInBase; + /*0x04*/ u8 baseOwnersName[8]; + /*0x0c*/ u32 flags; + /*0x10*/ u16 item; + /*0x12*/ u8 savedState; + /*0x13*/ u8 playerName[8]; + /*0x1b*/ u8 language; + /*0x1c*/ u8 baseOwnersNameLanguage; + } secretBaseSecrets; + + // TVSHOW_SAFARI_FAN_CLUB + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 nMonsCaught; + /*0x03*/ u8 nPkblkUsed; + /*0x04*/ u8 language; + /*0x05*/ u8 filler_05[14]; + /*0x13*/ u8 playerName[8]; + } safariFanClub; + + // Mass Outbreak + // TVSHOW_MASS_OUTBREAK + struct { + /*0x00*/ u8 kind; + /*0x01*/ bool8 active; + /*0x02*/ u8 var02; + /*0x03*/ u8 var03; + /*0x04*/ u16 moves[4]; + /*0x0C*/ u16 species; + /*0x0E*/ u16 var0E; + /*0x10*/ u8 locationMapNum; + /*0x11*/ u8 locationMapGroup; + /*0x12*/ u8 var12; + /*0x13*/ u8 probability; + /*0x14*/ u8 level; + /*0x15*/ u8 var15; + /*0x16*/ u16 daysLeft; + /*0x18*/ u8 language; + } massOutbreak; +} TVShow; + +enum { + POKENEWS_NONE, + POKENEWS_SLATEPORT, + POKENEWS_GAME_CORNER, + POKENEWS_LILYCOVE, + POKENEWS_BLENDMASTER +}; + +typedef struct // 2b50 +{ + u8 kind; + u8 state; + u16 days; +} PokeNews; + +struct GabbyAndTyData +{ + /*2ba4*/ u16 mon1; + /*2ba6*/ u16 mon2; + /*2ba8*/ u16 lastMove; + /*2baa*/ u16 quote[1]; + /*2bac*/ u8 mapnum; + /*2bad*/ u8 battleNum; + /*2bae*/ u8 battleTookMoreThanOneTurn:1; + /*2bae*/ u8 playerLostAMon:1; + /*2bae*/ u8 playerUsedAnItem:1; + /*2bae*/ u8 playerThrewABall:1; + /*2bae*/ u8 onAir:1; + /*2bae*/ u8 valA_5:3; + /*2baf*/ u8 battleTookMoreThanOneTurn2:1; + /*2baf*/ u8 playerLostAMon2:1; + /*2baf*/ u8 playerUsedAnItem2:1; + /*2baf*/ u8 playerThrewABall2:1; + /*2baf*/ u8 valB_4:4; +}; + +#endif //GUARD_GLOBAL_TV_H diff --git a/include/international_string_util.h b/include/international_string_util.h new file mode 100644 index 000000000..0eb12a535 --- /dev/null +++ b/include/international_string_util.h @@ -0,0 +1,13 @@ +#ifndef GUARD_international_string_util_H +#define GUARD_international_string_util_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +void TVShowConvertInternationalString(void *dest, const void *src, u8 language); +u32 sub_81DB604(const u8 *); + +#endif //GUARD_international_string_util_H diff --git a/include/item.h b/include/item.h index eaefa0298..e642ca608 100644 --- a/include/item.h +++ b/include/item.h @@ -58,5 +58,6 @@ ItemUseFunc ItemId_GetFieldFunc(u16 itemId); u8 ItemId_GetBattleUsage(u16 itemId); ItemUseFunc ItemId_GetBattleFunc(u16 itemId); u8 ItemId_GetSecondaryId(u16 itemId); +u16 itemid_get_market_price(u16 itemId); #endif // ITEM_H diff --git a/include/link.h b/include/link.h index 012c90480..5f5654e4d 100644 --- a/include/link.h +++ b/include/link.h @@ -177,12 +177,12 @@ u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]); void LinkVSync(void); void Timer3Intr(void); void SerialCB(void); +u8 GetLinkPlayerCount(void); void sub_800E0E8(void); bool8 sub_800A520(void); bool8 sub_8010500(void); void sub_800DFB4(u8, u8); void sub_800ADF8(void); -u8 sub_8009FCC(void); #endif // GUARD_LINK_H diff --git a/include/malloc.h b/include/malloc.h index 4568e244a..f3a731797 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -2,7 +2,7 @@ #define GUARD_MALLOC_H #define malloc Alloc -#define calloc AllocZeroed +#define calloc(ct, sz) AllocZeroed((ct) * (sz)) #define free Free extern u8 gHeap[]; diff --git a/include/moves.h b/include/moves.h index bc213cbc7..682f59506 100644 --- a/include/moves.h +++ b/include/moves.h @@ -359,6 +359,7 @@ enum MOVE_DOOM_DESIRE, MOVE_PSYCHO_BOOST, }; +extern const u8 gMoveNames[][13]; #define LAST_MOVE_INDEX MOVE_PSYCHO_BOOST diff --git a/include/pokedex.h b/include/pokedex.h index 38aca0915..79721899f 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -16,6 +16,8 @@ enum FLAG_SET_CAUGHT }; -u8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); +s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); +u16 pokedex_count(u8); +u16 sub_80C0844(u8); #endif // GUARD_POKEDEX_H diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 5216e8450..49680793d 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -2,5 +2,7 @@ #define GUARD_POKEMON_STORAGE_SYSTEM_H u8* GetBoxNamePtr(u8 boxNumber); +struct BoxPokemon *GetBoxedMonPtr(u8, u8); +void SetBoxMonNickFromAnyBox(u8, u8, u8 *); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/include/region_map.h b/include/region_map.h new file mode 100644 index 000000000..52e7376be --- /dev/null +++ b/include/region_map.h @@ -0,0 +1,227 @@ +#ifndef GUARD_REGION_MAP_H +#define GUARD_REGION_MAP_H + +// Exported type declarations + +enum { + REGION_MAP_LITTLEROOT_TOWN, + REGION_MAP_OLDALE_TOWN, + REGION_MAP_DEWFORD_TOWN, + REGION_MAP_LAVARIDGE_TOWN, + REGION_MAP_FALLARBOR_TOWN, + REGION_MAP_VERDANTURF_TOWN, + REGION_MAP_PACIFIDLOG_TOWN, + REGION_MAP_PETALBURG_CITY, + REGION_MAP_SLATEPORT_CITY, + REGION_MAP_MAUVILLE_CITY, + REGION_MAP_RUSTBORO_CITY, + REGION_MAP_FORTREE_CITY, + REGION_MAP_LILYCOVE_CITY, + REGION_MAP_MOSSDEEP_CITY, + REGION_MAP_SOOTOPOLIS_CITY, + REGION_MAP_EVER_GRANDE_CITY, + REGION_MAP_ROUTE_101, + REGION_MAP_ROUTE_102, + REGION_MAP_ROUTE_103, + REGION_MAP_ROUTE_104, + REGION_MAP_ROUTE_105, + REGION_MAP_ROUTE_106, + REGION_MAP_ROUTE_107, + REGION_MAP_ROUTE_108, + REGION_MAP_ROUTE_109, + REGION_MAP_ROUTE_110, + REGION_MAP_ROUTE_111, + REGION_MAP_ROUTE_112, + REGION_MAP_ROUTE_113, + REGION_MAP_ROUTE_114, + REGION_MAP_ROUTE_115, + REGION_MAP_ROUTE_116, + REGION_MAP_ROUTE_117, + REGION_MAP_ROUTE_118, + REGION_MAP_ROUTE_119, + REGION_MAP_ROUTE_120, + REGION_MAP_ROUTE_121, + REGION_MAP_ROUTE_122, + REGION_MAP_ROUTE_123, + REGION_MAP_ROUTE_124, + REGION_MAP_ROUTE_125, + REGION_MAP_ROUTE_126, + REGION_MAP_ROUTE_127, + REGION_MAP_ROUTE_128, + REGION_MAP_ROUTE_129, + REGION_MAP_ROUTE_130, + REGION_MAP_ROUTE_131, + REGION_MAP_ROUTE_132, + REGION_MAP_ROUTE_133, + REGION_MAP_ROUTE_134, + REGION_MAP_UNDERWATER_124, + REGION_MAP_UNDERWATER_125, + REGION_MAP_UNDERWATER_126, + REGION_MAP_UNDERWATER_127, + REGION_MAP_UNDERWATER_128, + REGION_MAP_GRANITE_CAVE, + REGION_MAP_MT_CHIMNEY, + REGION_MAP_SAFARI_ZONE, + REGION_MAP_BATTLE_FRONTIER, + REGION_MAP_PETALBURG_WOODS, + REGION_MAP_RUSTURF_TUNNEL, + REGION_MAP_ABANDONED_SHIP, + REGION_MAP_NEW_MAUVILLE, + REGION_MAP_METEOR_FALLS, + REGION_MAP_METEOR_FALLS2, + REGION_MAP_MT_PYRE, + REGION_MAP_AQUA_HIDEOUT_OLD, + REGION_MAP_SHOAL_CAVE, + REGION_MAP_SEAFLOOR_CAVERN, + REGION_MAP_UNDERWATER, + REGION_MAP_VICTORY_ROAD, + REGION_MAP_MIRAGE_ISLAND, + REGION_MAP_CAVE_OF_ORIGIN, + REGION_MAP_SOUTHERN_ISLAND, + REGION_MAP_FIERY_PATH, + REGION_MAP_FIERY_PATH2, + REGION_MAP_JAGGED_PASS, + REGION_MAP_JAGGED_PASS2, + REGION_MAP_SEALED_CHAMBER, + REGION_MAP_UNDERWATER_SEALED_CHAMBER, + REGION_MAP_SCORCHED_SLAB, + REGION_MAP_ISLAND_CAVE, + REGION_MAP_DESERT_RUINS, + REGION_MAP_ANCIENT_TOMB, + REGION_MAP_INSIDE_OF_TRUCK, + REGION_MAP_SKY_PILLAR, + REGION_MAP_SECRET_BASE, + REGION_MAP_NONE, + REGION_MAP_PALLET_TOWN, + REGION_MAP_VIRIDIAN_CITY, + REGION_MAP_PEWTER_CITY, + REGION_MAP_CERULEAN_CITY, + REGION_MAP_LAVENDER_TOWN, + REGION_MAP_VERMILION_CITY, + REGION_MAP_CELADON_CITY, + REGION_MAP_FUCHSIA_CITY, + REGION_MAP_CINNABAR_ISLAND, + REGION_MAP_INDIGO_PLATEAU, + REGION_MAP_SAFFRON_CITY, + REGION_MAP_ROUTE_4, + REGION_MAP_ROUTE_10, + REGION_MAP_ROUTE_1, + REGION_MAP_ROUTE_2, + REGION_MAP_ROUTE_3, + REGION_MAP_ROUTE_4_2, + REGION_MAP_ROUTE_5, + REGION_MAP_ROUTE_6, + REGION_MAP_ROUTE_7, + REGION_MAP_ROUTE_8, + REGION_MAP_ROUTE_9, + REGION_MAP_ROUTE_10_2, + REGION_MAP_ROUTE_11, + REGION_MAP_ROUTE_12, + REGION_MAP_ROUTE_13, + REGION_MAP_ROUTE_14, + REGION_MAP_ROUTE_15, + REGION_MAP_ROUTE_16, + REGION_MAP_ROUTE_17, + REGION_MAP_ROUTE_18, + REGION_MAP_ROUTE_19, + REGION_MAP_ROUTE_20, + REGION_MAP_ROUTE_21, + REGION_MAP_ROUTE_22, + REGION_MAP_ROUTE_23, + REGION_MAP_ROUTE_24, + REGION_MAP_ROUTE_25, + REGION_MAP_VIRIDIAN_FOREST, + REGION_MAP_MT_MOON, + REGION_MAP_S_S_ANNE, + REGION_MAP_UNDERGROUND_PATH, + REGION_MAP_UNDERGROUND_PATH_2, + REGION_MAP_DIGLETTS_CAVE, + REGION_MAP_KANTO_VICTORY_ROAD, + REGION_MAP_ROCKET_HIDEOUT, + REGION_MAP_SILPH_CO, + REGION_MAP_POKEMON_MANSION, + REGION_MAP_KANTO_SAFARI_ZONE, + REGION_MAP_POKEMON_LEAGUE, + REGION_MAP_ROCK_TUNNEL, + REGION_MAP_SEAFOAM_ISLANDS, + REGION_MAP_POKEMON_TOWER, + REGION_MAP_CERULEAN_CAVE, + REGION_MAP_POWER_PLANT, + REGION_MAP_ONE_ISLAND, + REGION_MAP_TWO_ISLAND, + REGION_MAP_THREE_ISLAND, + REGION_MAP_FOUR_ISLAND, + REGION_MAP_FIVE_ISLAND, + REGION_MAP_SEVEN_ISLAND, + REGION_MAP_SIX_ISLAND, + REGION_MAP_KINDLE_ROAD, + REGION_MAP_TREASURE_BEACH, + REGION_MAP_CAPE_BRINK, + REGION_MAP_BOND_BRIDGE, + REGION_MAP_THREE_ISLE_PORT, + REGION_MAP_SEVII_ISLE_6, + REGION_MAP_SEVII_ISLE_7, + REGION_MAP_SEVII_ISLE_8, + REGION_MAP_SEVII_ISLE_9, + REGION_MAP_RESORT_GORGEOUS, + REGION_MAP_WATER_LABYRINTH, + REGION_MAP_FIVE_ISLE_MEADOW, + REGION_MAP_MEMORIAL_PILLAR, + REGION_MAP_OUTCAST_ISLAND, + REGION_MAP_GREEN_PATH, + REGION_MAP_WATER_PATH, + REGION_MAP_RUIN_VALLEY, + REGION_MAP_TRAINER_TOWER, + REGION_MAP_CANYON_ENTRANCE, + REGION_MAP_SEVAULT_CANYON, + REGION_MAP_TANOBY_RUINS, + REGION_MAP_SEVII_ISLE_22, + REGION_MAP_SEVII_ISLE_23, + REGION_MAP_SEVII_ISLE_24, + REGION_MAP_NAVEL_ROCK, + REGION_MAP_MT_EMBER, + REGION_MAP_BERRY_FOREST, + REGION_MAP_ICEFALL_CAVE, + REGION_MAP_ROCKET_WAREHOUSE, + REGION_MAP_TRAINER_TOWER_2, + REGION_MAP_DOTTED_HOLE, + REGION_MAP_LOST_CAVE, + REGION_MAP_PATTERN_BUSH, + REGION_MAP_ALTERING_CAVE, + REGION_MAP_TANOBY_CHAMBERS, + REGION_MAP_THREE_ISLE_PATH, + REGION_MAP_TANOBY_KEY, + REGION_MAP_BIRTH_ISLAND, + REGION_MAP_MONEAN_CHAMBER, + REGION_MAP_LIPTOO_CHAMBER, + REGION_MAP_WEEPTH_CHAMBER, + REGION_MAP_DILFORD_CHAMBER, + REGION_MAP_SCUFIB_CHAMBER, + REGION_MAP_RIXY_CHAMBER, + REGION_MAP_VIAPOIS_CHAMBER, + REGION_MAP_EMBER_SPA, + REGION_MAP_SPECIAL_AREA, + REGION_MAP_AQUA_HIDEOUT, + REGION_MAP_MAGMA_HIDEOUT, + REGION_MAP_MIRAGE_TOWER, + REGION_MAP_BIRTH_ISLAND_2, + REGION_MAP_FARAWAY_ISLAND, + REGION_MAP_ARTISAN_CAVE, + REGION_MAP_MARINE_CAVE, + REGION_MAP_UNDERWATER_MARINE_CAVE, + REGION_MAP_TERRA_CAVE, + REGION_MAP_UNDERWATER_TERRA_CAVE, + REGION_MAP_UNDERWATER_UNK1, + REGION_MAP_UNDERWATER_UNK2, + REGION_MAP_DESERT_UNDERPASS, + REGION_MAP_ALTERING_CAVE_2, + REGION_MAP_NAVEL_ROCK2, + REGION_MAP_TRAINER_HILL +}; + +// Exported RAM declarations + +// Exported ROM declarations +void GetMapName(u8 *, u16, u16); + +#endif //GUARD_REGION_MAP_H diff --git a/include/rom4.h b/include/rom4.h index e19d277a6..c7e46eecb 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -29,5 +29,6 @@ const struct MapHeader *get_mapheader_by_bank_and_number(u8, u8); void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *); void sub_8086230(void); void c2_exit_to_overworld_2_switch(void); +void c2_exit_to_overworld_1_continue_scripts_restart_music(void); #endif //GUARD_ROM4_H diff --git a/include/rom6.h b/include/rom6.h index 15070616d..006e93910 100644 --- a/include/rom6.h +++ b/include/rom6.h @@ -2,5 +2,6 @@ #define GUARD_ROM6_H void sub_81357FC(u8, void(void)); +u8 GetIdxOfFirstPartyMemberThatIsNotAnEgg(void); #endif //GUARD_ROM6_H diff --git a/include/script_menu.h b/include/script_menu.h new file mode 100644 index 000000000..de80d28d4 --- /dev/null +++ b/include/script_menu.h @@ -0,0 +1,11 @@ +#ifndef GUARD_SCRIPT_MENU_H +#define GUARD_SCRIPT_MENU_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +extern const u8 *const gUnknown_0858BAF0[9]; + +#endif //GUARD_SCRIPT_MENU_H diff --git a/include/secret_base.h b/include/secret_base.h new file mode 100644 index 000000000..4f7b411da --- /dev/null +++ b/include/secret_base.h @@ -0,0 +1,11 @@ +#ifndef GUARD_SECRET_BASE_H +#define GUARD_SECRET_BASE_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations +void sub_80E980C(void); + +#endif //GUARD_SECRET_BASE_H diff --git a/include/shop.h b/include/shop.h new file mode 100644 index 000000000..ac5b512ca --- /dev/null +++ b/include/shop.h @@ -0,0 +1,12 @@ +#ifndef GUARD_SHOP_H +#define GUARD_SHOP_H + +// Exported type declarations + +// Exported RAM declarations + +extern EWRAM_DATA struct ItemSlot gUnknown_02039F80[3]; + +// Exported ROM declarations + +#endif //GUARD_SHOP_H diff --git a/include/species.h b/include/species.h index 9ab0565cb..ac0797418 100644 --- a/include/species.h +++ b/include/species.h @@ -449,5 +449,6 @@ enum }; #define NUM_SPECIES SPECIES_EGG +extern const u8 gSpeciesNames[][11]; #endif // GUARD_SPECIES_H diff --git a/include/string_util.h b/include/string_util.h index 382f52251..f26646082 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -31,7 +31,7 @@ u8 *StringFillWithTerminator(u8 *dest, u16 n); u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); u32 StringLength_Multibyte(u8 *str); u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); -bool32 sub_8009228(u8 *str); +bool32 IsStringJapanese(u8 *str); bool32 sub_800924C(u8 *str, s32 n); u8 GetExtCtrlCodeLength(u8 code); static const u8 *SkipExtCtrlCode(const u8 *s); diff --git a/include/strings.h b/include/strings.h new file mode 100644 index 000000000..5d1a9bba0 --- /dev/null +++ b/include/strings.h @@ -0,0 +1,33 @@ +#ifndef GUARD_strings_H +#define GUARD_strings_H + +extern const u8 gText_Lv50[]; +extern const u8 gText_OpenLevel[]; +extern const u8 gText_Mom[]; +extern const u8 gText_Dad[]; +extern const u8 gText_Cool[]; +extern const u8 gText_Beauty[]; +extern const u8 gText_Cute[]; +extern const u8 gText_Smart[]; +extern const u8 gText_Tough[]; +extern const u8 gText_Single[]; +extern const u8 gText_Double[]; +extern const u8 gText_Spicy2[]; +extern const u8 gText_Dry2[]; +extern const u8 gText_Sweet2[]; +extern const u8 gText_Bitter2[]; +extern const u8 gText_Sour2[]; +extern const u8 gText_Excellent[]; +extern const u8 gText_VeryGood[]; +extern const u8 gText_Good[]; +extern const u8 gText_SoSo[]; +extern const u8 gText_Bad[]; +extern const u8 gText_TheWorst[]; +extern const u8 gText_Slots[]; +extern const u8 gText_Roulette[]; +extern const u8 gText_Jackpot[]; +extern const u8 gText_First[]; +extern const u8 gText_Second[]; +extern const u8 gText_Third[]; + +#endif //GUARD_strings_H diff --git a/include/tv.h b/include/tv.h new file mode 100644 index 000000000..b85cac82a --- /dev/null +++ b/include/tv.h @@ -0,0 +1,21 @@ +#ifndef GUARD_TV_H +#define GUARD_TV_H + +// Exported type declarations + +// Exported RAM declarations + +// Exported ROM declarations + +extern u8 *const gTVStringVarPtrs[3]; + +void ClearTVShowData(void); +void PutPokemonTodayCaughtOnAir(void); +u32 GetPlayerIDAsU32(void); +bool8 GetPriceReduction(u8 newsKind); +u8 GetRibbonCount(struct Pokemon *pokemon); +void sub_80EE184(void); +void sub_80F14F8(TVShow *shows); +int sub_80EF370(int value); + +#endif //GUARD_TV_H diff --git a/include/vars.h b/include/vars.h index 7c0edeb77..67c0b67fc 100644 --- a/include/vars.h +++ b/include/vars.h @@ -53,4 +53,14 @@ #define VAR_0x40BC 0x40BC #define VAR_0x40C2 0x40C2 +#define VAR_FRONTIER_FACILITY 0x40CF + +#define VAR_DAILY_SLOTS 0x40E6 +#define VAR_DAILY_WILDS 0x40E7 +#define VAR_DAILY_BLENDER 0x40E8 +#define VAR_DAILY_PLANTED_BERRIES 0x40E9 +#define VAR_DAILY_PICKED_BERRIES 0x40EA +#define VAR_DAILY_ROULETTE 0x40EB +#define VAR_DAILY_BP 0x40F1 + #endif // GUARD_VARS_H diff --git a/ld_script.txt b/ld_script.txt index 887f24811..d1acf4f99 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -148,7 +148,7 @@ SECTIONS { asm/contest_effect.o(.text); asm/record_mixing.o(.text); asm/secret_base.o(.text); - asm/tv.o(.text); + src/tv.o(.text); asm/contest_link_80F57C4.o(.text); asm/script_pokemon_util_80F87D8.o(.text); asm/field_poison.o(.text); @@ -387,7 +387,7 @@ SECTIONS { data/contest_effect.o(.rodata); data/record_mixing.o(.rodata); data/secret_base.o(.rodata); - data/tv.o(.rodata); + src/tv.o(.rodata); data/contest_link_80F57C4.o(.rodata); data/script_pokemon_util_80F87D8.o(.rodata); src/pokemon_size_record.o(.rodata) diff --git a/src/battle_2.c b/src/battle_2.c index c4da02e36..306008cdb 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -40,6 +40,7 @@ #include "trainer_classes.h" #include "evolution_scene.h" #include "roamer.h" +#include "tv.h" #include "safari_zone.h" #include "battle_string_ids.h" @@ -64,7 +65,6 @@ struct UnknownPokemonStruct2 /*0x1D*/ u8 language; }; -extern u32 gBattleTypeFlags; extern u8 gBattleCommunication[]; extern u8 gBattleTerrain; extern u16 gBattle_BG0_X; @@ -88,7 +88,6 @@ extern void (*gBattleMainFunc)(void); extern void (*gUnknown_030061E8)(void); extern struct UnknownPokemonStruct2 gUnknown_02022FF8[3]; // what is it used for? extern struct UnknownPokemonStruct2* gUnknown_02023058; // what is it used for? -extern u8 gBattleOutcome; extern u8 gUnknown_02039B28[]; // possibly a struct? extern struct UnknownStruct6 gUnknown_02038C28; // todo: identify & document extern struct MusicPlayerInfo gMPlay_SE1; @@ -139,7 +138,6 @@ extern u8 gActionForBanks[BATTLE_BANKS_COUNT]; extern u16 gChosenMovesByBanks[BATTLE_BANKS_COUNT]; extern u8 gCurrentActionFuncId; extern u8 gLastUsedAbility; -extern u16 gLastUsedItem; extern u8 gUnknown_0203CF00[]; extern const u8* gBattlescriptPtrsForSelection[BATTLE_BANKS_COUNT]; extern const u8* gBattlescriptCurrInstr; @@ -152,7 +150,6 @@ extern u8 gCurrMovePos; extern u8 gUnknown_020241E9; extern u16 gLastUsedMove; -extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; extern const struct BattleMove gBattleMoves[]; extern const u16 gUnknown_08C004E0[]; // battle textbox palette extern const struct BgTemplate gUnknown_0831AA08[]; @@ -226,8 +223,6 @@ extern u8 sub_81A9E28(void); // battle frontier 2 extern void sub_81A56E8(u8 bank); // battle frontier 2 extern void sub_81B8FB0(u8, u8); // party menu extern u8 pokemon_order_func(u8); // party menu -extern void sub_80EC728(void); // tv -extern void sub_80EE184(void); // tv extern bool8 InBattlePyramid(void); // this file's functions @@ -859,7 +854,7 @@ static void CB2_HandleStartBattle(void) { s32 i; - for (i = 0; i < 2 && (gLinkPlayers[i].version & 0xFF) == 3; i++); + for (i = 0; i < 2 && (gLinkPlayers[i].version & 0xFF) == VERSION_EMERALD; i++); if (i == 2) gBattleCommunication[MULTIUSE_STATE] = 16; @@ -2073,7 +2068,7 @@ static void sub_8038F34(void) else monsCount = 2; - for (i = 0; i < monsCount && (gLinkPlayers[i].version & 0xFF) == 3; i++); + for (i = 0; i < monsCount && (gLinkPlayers[i].version & 0xFF) == VERSION_EMERALD; i++); if (!gSaveBlock2Ptr->field_CA9_b && i == monsCount) { @@ -4927,7 +4922,7 @@ static void HandleEndTurn_FinishBattle(void) } } } - sub_80EC728(); + PutPokemonTodayCaughtOnAir(); } if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 50ae5bafe..fb6a8272b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -11087,7 +11087,7 @@ static void atkEF_pokeball_catch_calculation(void) { if (gLastUsedItem == ITEM_MASTER_BALL) { - gBattleResults.unk5_1 = 1; + gBattleResults.usedMasterBall = TRUE; } else { diff --git a/src/battle_util.c b/src/battle_util.c index c6762dd99..636e27bdf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -353,7 +353,7 @@ void sub_803F850(u8 arg0) { s32 i; - for (i = 0; i < sub_8009FCC(); i++) + for (i = 0; i < GetLinkPlayerCount(); i++) gBattleExecBuffer |= gBitTable[arg0] << (i << 2); gBattleExecBuffer &= ~(0x10000000 << arg0); diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 4e4c10090..a1f187b85 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -59,7 +59,7 @@ extern u8* GetMonNick(struct Pokemon* mon, u8* dst); extern u8* GetBoxMonNick(struct BoxPokemon* boxMon, u8* dst); extern u8 sav1_map_get_name(void); extern s8 sub_8198C58(void); -extern void sub_81DB5E8(u8* str1, u8* str2, u8); +extern void TVShowConvertInternationalString(u8* str1, u8* str2, u8); extern void sub_806A068(u16, u8); extern void fade_screen(u8, u8); extern void overworld_free_bg_tilemaps(void); @@ -404,8 +404,8 @@ static bool8 sub_807158C(struct DaycareData* daycare, u8 daycareId) || StringCompareWithoutExtCtrlCodes(gSaveBlock2Ptr->playerName, daycareMon->OT_name) != 0)) { StringCopy(gStringVar1, nick); - sub_81DB5E8(gStringVar2, daycareMon->OT_name, daycareMon->language_maybe); - sub_81DB5E8(gStringVar3, daycareMon->monName, daycareMon->unknown); + TVShowConvertInternationalString(gStringVar2, daycareMon->OT_name, daycareMon->language_maybe); + TVShowConvertInternationalString(gStringVar3, daycareMon->monName, daycareMon->unknown); return TRUE; } return FALSE; diff --git a/src/new_game.c b/src/new_game.c index 5a482c593..d01aa69d4 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -17,6 +17,7 @@ #include "easy_chat.h" #include "event_data.h" #include "money.h" +#include "tv.h" #include "coins.h" #include "text.h" @@ -36,7 +37,6 @@ extern void sub_813624C(void); // clears something pokeblock related extern void ResetPokedex(void); extern void sub_8084400(void); extern void ClearMailData(void); -extern void ClearTVShowData(void); extern void ResetGabbyAndTy(void); extern void ResetSecretBases(void); extern void ResetLinkContestBoolean(void); diff --git a/src/safari_zone.c b/src/safari_zone.c index 3e25468bf..f7ef28577 100644 --- a/src/safari_zone.c +++ b/src/safari_zone.c @@ -114,7 +114,7 @@ void sub_80FC190(void) { SetMainCallback2(c2_exit_to_overworld_2_switch); } - else if (gBattleOutcome == 8) + else if (gBattleOutcome == BATTLE_SAFARI_OUT_OF_BALLS) { ScriptContext2_RunNewScript(gUnknown_082A4B4C); warp_in(); diff --git a/src/start_menu.c b/src/start_menu.c index ac393ce2e..be30d0e53 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -170,13 +170,13 @@ extern const u8 gText_BattlePyramidFloor[]; void DisplayPyramidFloorWindow(void) { // TODO: fix location - if (*(u16*)(&gSaveBlock2Ptr->field_CAA[8]) == 7) + if (gSaveBlock2Ptr->field_CAA[4] == 7) sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_1); else sBattlePyramidFloorWindowId = AddWindow(&gPyramidFloorWindowTemplate_2); PutWindowTilemap(sBattlePyramidFloorWindowId); sub_81973FC(sBattlePyramidFloorWindowId, 0); - StringCopy(gStringVar1, gUnknown_08510510[*(u16*)(&gSaveBlock2Ptr->field_CAA[8])]); + StringCopy(gStringVar1, gUnknown_08510510[gSaveBlock2Ptr->field_CAA[4]]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); PrintTextOnWindow(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); CopyWindowToVram(sBattlePyramidFloorWindowId, 2); diff --git a/src/string_util.c b/src/string_util.c index 92e9f19e8..ea50ba5a5 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -625,7 +625,7 @@ u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color) return dest; } -bool32 sub_8009228(u8 *str) +bool32 IsStringJapanese(u8 *str) { while (*str != EOS) { diff --git a/src/tv.c b/src/tv.c new file mode 100644 index 000000000..73b346068 --- /dev/null +++ b/src/tv.c @@ -0,0 +1,7927 @@ + +// Includes +#include "global.h" +#include "rtc.h" +#include "rom4.h" +#include "map_constants.h" +#include "rng.h" +#include "event_data.h" +#include "fieldmap.h" +#include "field_camera.h" +#include "strings.h" +#include "string_util.h" +#include "international_string_util.h" +#include "pokemon_storage_system.h" +#include "field_message_box.h" +#include "easy_chat.h" +#include "species.h" +#include "moves.h" +#include "battle.h" +#include "battle_tower.h" +#include "contest.h" +#include "items.h" +#include "item.h" +#include "link.h" +#include "main.h" +#include "event_scripts.h" +#include "shop.h" +#include "lilycove_lady.h" +#include "rom6.h" +#include "pokedex.h" +#include "field_map_obj.h" +#include "text.h" +#include "script_menu.h" +#include "naming_screen.h" +#include "malloc.h" +#include "region_map.h" +#include "decoration.h" +#include "secret_base.h" +#include "tv.h" + +// Static type declarations + +#define rbernoulli(num, den) TV_BernoulliTrial(0xFFFF * (num) / (den)) + +// Static RAM declarations + +s8 sCurTVShowSlot; +u16 sTV_SecretBaseVisitMovesTemp[8]; +u8 sTV_DecorationsBuffer[16]; +struct { + u8 level; + u16 species; + u16 move; +} sTV_SecretBaseVisitMonsTemp[10]; + +IWRAM_DATA u8 sTVShowMixingNumPlayers; +IWRAM_DATA u8 sTVShowNewsMixingNumPlayers; +IWRAM_DATA s8 sTVShowMixingCurSlot; + +EWRAM_DATA u16 sPokemonAnglerSpecies = 0; +EWRAM_DATA u16 sPokemonAnglerAttemptCounters = 0; +EWRAM_DATA u16 sFindThatGamerCoinsSpent = 0; +EWRAM_DATA bool8 sFindThatGamerWhichGame = FALSE; +EWRAM_DATA ALIGNED(4) u8 sRecordMixingPartnersWithoutShowsToShare = 0; +EWRAM_DATA ALIGNED(4) u8 sTVShowState = 0; +EWRAM_DATA u8 sTVSecretBaseSecretsRandomValues[3] = {}; + +// Static ROM declarations + +extern const u8 *const sTVBravoTrainerTextGroup[]; +extern const u8 *const sTVBravoTrainerBattleTowerTextGroup[]; + +void ClearPokemonNews(void); +u8 GetTVChannelByShowType(u8 kind); +u8 FindFirstActiveTVShowThatIsNotAMassOutbreak(void); +u8 CheckForBigMovieOrEmergencyNewsOnTV(void); +void SetTVMetatilesOnMap(int width, int height, u16 tileId); +u8 FindAnyTVNewsOnTheAir(void); +bool8 IsTVShowInSearchOfTrainersAiring(void); +void TakeTVShowInSearchOfTrainersOffTheAir(void); +bool8 TV_BernoulliTrial(u16 ratio); +s8 FindEmptyTVSlotBeyondFirstFiveShowsOfArray(TVShow *shows); +bool8 HasMixableShowAlreadyBeenSpawnedWithPlayerID(u8 kind, bool8 flag); +void tv_store_id_3x(TVShow *show); +void DeleteTVShowInArrayByIdx(TVShow *shows, u8 idx); +s8 FindEmptyTVSlotWithinFirstFiveShowsOfArray(TVShow *shows); +void FindActiveBroadcastByShowType_SetScriptResult(u8 kind); +void InterviewBefore_BravoTrainerPkmnProfile(void); +void InterviewBefore_NameRater(void); +u16 TV_GetSomeOtherSpeciesAlreadySeenByPlayer(u16 passedSpecies); +void sub_80EFA88(void); +void sub_80EF93C(TVShow *shows); +s8 sub_80EEE30(PokeNews *pokeNews); +bool8 sub_80EF0E4(u8 newsKind); +void ClearPokemonNewsI(u8 i); +void sub_80F1254(TVShow *shows); +void sub_80F12A4(TVShow *shows); +void sub_80F0358(TVShow *player1, TVShow *player2, TVShow *player3, TVShow *player4); +void sub_80F0C04(void); +void sub_80F0708(void); +void sub_80F0B64(void); +s8 sub_80F06D0(TVShow *tvShows); +bool8 sub_80F049C(TVShow *dest[], TVShow *src[], u8 idx); +bool8 sub_80F0580(TVShow *tv1, TVShow *tv2, u8 idx); +bool8 sub_80F05E8(TVShow *tv1, TVShow *tv2, u8 idx); +bool8 sub_80F0668(TVShow *tv1, TVShow *tv2, u8 idx); +void sub_80F0B00(u8 showIdx); +void sub_80F0B24(u16 species, u8 showIdx); +void sub_80F0D60(PokeNews *player1, PokeNews *player2, PokeNews *player3, PokeNews *player4); +void sub_80F0EEC(void); +void sub_80F0F24(void); +s8 sub_80F0ECC(PokeNews *pokeNews, u8 idx); +void sub_80F0E58(PokeNews *dest[], PokeNews *src[]); +bool8 sub_80F0E84(PokeNews *dest, PokeNews *src, s8 slot); +void TVShowDone(void); +void InterviewAfter_FanClubLetter(void); +void InterviewAfter_RecentHappenings(void); +void InterviewAfter_PkmnFanClubOpinions(void); +void InterviewAfter_DummyShow4(void); +void InterviewAfter_BravoTrainerPokemonProfile(void); +void InterviewAfter_BravoTrainerBattleTowerProfile(void); +void InterviewAfter_ContestLiveUpdates(void); +void UpdateWorldOfMastersAndPutItOnTheAir(void); +void PutPokemonTodayFailedOnTheAir(void); +void sub_80ED718(void); +void sub_80EED88(void); +void TV_SortPurchasesByQuantity(void); +void sub_80ED8B4(u16 days); +void UpdateMassOutbreakTimeLeft(u16 days); +void sub_80EF120(u16 days); +void sub_80EDA48(u16 days); +void sub_80EEB98(u16 days); +void PutFishingAdviceShowOnTheAir(void); +void sub_80EDA80(void); +u8 TV_MonDataIdxToRibbon(u8 monDataIdx); +void sub_80EEBF4(u8 actionIdx); +bool8 IsPriceDiscounted(u8 newsKind); +void InterviewBefore_FanClubLetter(void); +void InterviewBefore_RecentHappenings(void); +void InterviewBefore_PkmnFanClubOpinions(void); +void InterviewBefore_Dummy(void); +void InterviewBefore_BravoTrainerBTProfile(void); +void InterviewBefore_ContestLiveUpdates(void); +void InterviewBefore_3CheersForPokeblocks(void); +void InterviewBefore_FanClubSpecial(void); +void ChangeBoxPokemonNickname_CB(void); +void DoTVShowPokemonFanClubLetter(void); +void DoTVShowRecentHappenings(void); +void DoTVShowPokemonFanClubOpinions(void); +void DoTVShowDummiedOut(void); +void DoTVShowPokemonNewsMassOutbreak(void); +void DoTVShowBravoTrainerPokemonProfile(void); +void DoTVShowBravoTrainerBattleTower(void); +void DoTVShowPokemonTodaySuccessfulCapture(void); +void DoTVShowTodaysSmartShopper(void); +void DoTVShowTheNameRaterShow(void); +void DoTVShowPokemonContestLiveUpdates(void); +void DoTVShowPokemonBattleUpdate(void); +void DoTVShow3CheersForPokeblocks(void); +void DoTVShowPokemonTodayFailedCapture(void); +void DoTVShowPokemonAngler(void); +void DoTVShowTheWorldOfMasters(void); +void DoTVShowTodaysRivalTrainer(void); +void DoTVShowDewfordTrendWatcherNetwork(void); +void DoTVShowHoennTreasureInvestigators(void); +void DoTVShowFindThatGamer(void); +void DoTVShowBreakingNewsTV(void); +void DoTVShowSecretBaseVisit(void); +void DoTVShowPokemonLotteryWinnerFlashReport(void); +void DoTVShowThePokemonBattleSeminar(void); +void DoTVShowTrainerFanClubSpecial(void); +void DoTVShowTrainerFanClub(void); +void DoTVShowSpotTheCuties(void); +void DoTVShowPokemonNewsBattleFrontier(void); +void DoTVShowWhatsNo1InHoennToday(void); +void DoTVShowSecretBaseSecrets(void); +void DoTVShowSafariFanClub(void); +void DoTVShowPokemonContestLiveUpdates2(void); + +// .rodata + +const struct { + u16 species; + u16 moves[4]; + u8 level; + u8 location; +} sPokeOutbreakSpeciesList[] = { + { + SPECIES_SEEDOT, + {MOVE_BIDE, MOVE_HARDEN, MOVE_LEECH_SEED}, + 3, 0x11 // Route 102 + }, + { + SPECIES_NUZLEAF, + {MOVE_HARDEN, MOVE_GROWTH, MOVE_NATURE_POWER, MOVE_LEECH_SEED}, + 15, 0x1D // Route 114 + }, + { + SPECIES_SEEDOT, + {MOVE_HARDEN, MOVE_GROWTH, MOVE_NATURE_POWER, MOVE_LEECH_SEED}, + 13, 0x20 // Route 117 + }, + { + SPECIES_SEEDOT, + {MOVE_GIGA_DRAIN, MOVE_FRUSTRATION, MOVE_SOLAR_BEAM, MOVE_LEECH_SEED}, + 25, 0x23 // Route 110 + }, + { + SPECIES_SKITTY, + {MOVE_GROWL, MOVE_TACKLE, MOVE_TAIL_WHIP, MOVE_ATTRACT}, + 8, 0x1F // Route 116 + } +}; + +// TODO: Figure out what these are, and define constants in include/flags.h +const u16 sGoldSymbolFlags[] = { + SYS_TOWER_GOLD, + SYS_DOME_GOLD, + SYS_PALACE_GOLD, + SYS_ARENA_GOLD, + SYS_FACTORY_GOLD, + SYS_PIKE_GOLD, + SYS_PYRAMID_GOLD +}; + +const u16 sSilverSymbolFlags[] = { + SYS_TOWER_SILVER, + SYS_DOME_SILVER, + SYS_PALACE_SILVER, + SYS_ARENA_SILVER, + SYS_FACTORY_SILVER, + SYS_PIKE_SILVER, + SYS_PYRAMID_SILVER +}; + +// TODO: Figure out what these are, and define constants in include/vars.h +const u16 sNumberOneVarsAndThresholds[][2] = { + {VAR_DAILY_SLOTS, 100}, + {VAR_DAILY_ROULETTE, 50}, + {VAR_DAILY_WILDS, 100}, + {VAR_DAILY_BLENDER, 20}, + {VAR_DAILY_PLANTED_BERRIES, 20}, + {VAR_DAILY_PICKED_BERRIES, 20}, + {VAR_DAILY_BP, 30} +}; + +const u8 *const sPokeNewsTextGroup_Upcoming[] = { + NULL, + gPokeNewsTextSlateport_Upcoming, + gPokeNewsTextGameCorner_Upcoming, + gPokeNewsTextLilycove_Upcoming, + gPokeNewsTextBlendMaster_Upcoming +}; + +const u8 *const sPokeNewsTextGroup_Ongoing[] = { + NULL, + gPokeNewsTextSlateport_Ongoing, + gPokeNewsTextGameCorner_Ongoing, + gPokeNewsTextLilycove_Ongoing, + gPokeNewsTextBlendMaster_Ongoing +}; + +const u8 *const sPokeNewsTextGroup_Ending[] = { + NULL, + gPokeNewsTextSlateport_Ending, + gPokeNewsTextGameCorner_Ending, + gPokeNewsTextLilycove_Ending, + gPokeNewsTextBlendMaster_Ending +}; + +u8 *const gTVStringVarPtrs[] = { + gStringVar1, + gStringVar2, + gStringVar3 +}; + +const u8 *const sTVFanClubTextGroup[] = { + gTVFanClubText00, + gTVFanClubText01, + gTVFanClubText02, + gTVFanClubText03, + gTVFanClubText04, + gTVFanClubText05, + gTVFanClubText06, + gTVFanClubText07 +}; + +const u8 *const sTVRecentHappeninssTextGroup[] = { + gTVRecentHappeningsText00, + gTVRecentHappeningsText01, + gTVRecentHappeningsText02, + gTVRecentHappeningsText03, + gTVRecentHappeningsText04, + gTVRecentHappeningsText05 +}; + +const u8 *const sTVFanClubOpinionsTextGroup[] = { + gTVFanClubOpinionsText00, + gTVFanClubOpinionsText01, + gTVFanClubOpinionsText02, + gTVFanClubOpinionsText03, + gTVFanClubOpinionsText04 +}; + +const u8 *const sTVMassOutbreakTextGroup[] = { + gTVMassOutbreakText00 +}; + +const u8 *const sTVPokemonTodaySuccessfulTextGroup[] = { + gTVPokemonTodaySuccessfulText00, + gTVPokemonTodaySuccessfulText01, + gTVPokemonTodaySuccessfulText02, + gTVPokemonTodaySuccessfulText03, + gTVPokemonTodaySuccessfulText04, + gTVPokemonTodaySuccessfulText05, + gTVPokemonTodaySuccessfulText06, + gTVPokemonTodaySuccessfulText07, + gTVPokemonTodaySuccessfulText08, + gTVPokemonTodaySuccessfulText09, + gTVPokemonTodaySuccessfulText10, + gTVPokemonTodaySuccessfulText11 +}; + +const u8 *const sTVTodaysSmartShopperTextGroup[] = { + gTVTodaysSmartShopperText00, + gTVTodaysSmartShopperText01, + gTVTodaysSmartShopperText02, + gTVTodaysSmartShopperText03, + gTVTodaysSmartShopperText04, + gTVTodaysSmartShopperText05, + gTVTodaysSmartShopperText06, + gTVTodaysSmartShopperText07, + gTVTodaysSmartShopperText08, + gTVTodaysSmartShopperText09, + gTVTodaysSmartShopperText10, + gTVTodaysSmartShopperText11, + gTVTodaysSmartShopperText12 +}; + +const u8 *const sTVBravoTrainerTextGroup[] = { + gTVBravoTrainerText00, + gTVBravoTrainerText01, + gTVBravoTrainerText02, + gTVBravoTrainerText03, + gTVBravoTrainerText04, + gTVBravoTrainerText05, + gTVBravoTrainerText06, + gTVBravoTrainerText07, + gTVBravoTrainerText08 +}; + +const u8 *const sTV3CheersForPokeblocksTextGroup[] = { + gTV3CheersForPokeblocksText00, + gTV3CheersForPokeblocksText01, + gTV3CheersForPokeblocksText02, + gTV3CheersForPokeblocksText03, + gTV3CheersForPokeblocksText04, + gTV3CheersForPokeblocksText05 +}; + +const u8 *const sTVBravoTrainerBattleTowerTextGroup[] = { + gTVBravoTrainerBattleTowerText00, + gTVBravoTrainerBattleTowerText01, + gTVBravoTrainerBattleTowerText02, + gTVBravoTrainerBattleTowerText03, + gTVBravoTrainerBattleTowerText04, + gTVBravoTrainerBattleTowerText05, + gTVBravoTrainerBattleTowerText06, + gTVBravoTrainerBattleTowerText07, + gTVBravoTrainerBattleTowerText08, + gTVBravoTrainerBattleTowerText09, + gTVBravoTrainerBattleTowerText10, + gTVBravoTrainerBattleTowerText11, + gTVBravoTrainerBattleTowerText12, + gTVBravoTrainerBattleTowerText13, + gTVBravoTrainerBattleTowerText14 +}; + +const u8 *const sTVContestLiveUpdatesTextGroup[] = { + gTVContestLiveUpdatesText00, + gTVContestLiveUpdatesText01, + gTVContestLiveUpdatesText02, + gTVContestLiveUpdatesText03, + gTVContestLiveUpdatesText04, + gTVContestLiveUpdatesText05, + gTVContestLiveUpdatesText06, + gTVContestLiveUpdatesText07, + gTVContestLiveUpdatesText08, + gTVContestLiveUpdatesText09, + gTVContestLiveUpdatesText10, + gTVContestLiveUpdatesText11, + gTVContestLiveUpdatesText12, + gTVContestLiveUpdatesText13, + gTVContestLiveUpdatesText14, + gTVContestLiveUpdatesText15, + gTVContestLiveUpdatesText16, + gTVContestLiveUpdatesText17, + gTVContestLiveUpdatesText18, + gTVContestLiveUpdatesText19, + gTVContestLiveUpdatesText20, + gTVContestLiveUpdatesText21, + gTVContestLiveUpdatesText22, + gTVContestLiveUpdatesText23, + gTVContestLiveUpdatesText24, + gTVContestLiveUpdatesText25, + gTVContestLiveUpdatesText26, + gTVContestLiveUpdatesText27, + gTVContestLiveUpdatesText28, + gTVContestLiveUpdatesText29, + gTVContestLiveUpdatesText30, + gTVContestLiveUpdatesText31, + gTVContestLiveUpdatesText32 +}; + +const u8 *const sTVPokemonBattleUpdateTextGroup[] = { + gTVPokemonBattleUpdateText00, + gTVPokemonBattleUpdateText01, + gTVPokemonBattleUpdateText02, + gTVPokemonBattleUpdateText03, + gTVPokemonBattleUpdateText04, + gTVPokemonBattleUpdateText05, + gTVPokemonBattleUpdateText06, + gTVPokemonBattleUpdateText07 +}; + +const u8 *const sTVTrainerFanClubSpecialTextGroup[] = { + gTVTrainerFanClubSpecialText00, + gTVTrainerFanClubSpecialText01, + gTVTrainerFanClubSpecialText02, + gTVTrainerFanClubSpecialText03, + gTVTrainerFanClubSpecialText04, + gTVTrainerFanClubSpecialText05 +}; + +const u8 *const sTVNameRaterTextGroup[] = { + gTVNameRaterText00, + gTVNameRaterText01, + gTVNameRaterText02, + gTVNameRaterText03, + gTVNameRaterText04, + gTVNameRaterText05, + gTVNameRaterText06, + gTVNameRaterText07, + gTVNameRaterText08, + gTVNameRaterText09, + gTVNameRaterText10, + gTVNameRaterText11, + gTVNameRaterText12, + gTVNameRaterText13, + gTVNameRaterText14, + gTVNameRaterText15, + gTVNameRaterText16, + gTVNameRaterText17, + gTVNameRaterText18 +}; + +const u8 *const sTVPokemonContestLiveUpdates2TextGroup[] = { + gTVPokemonContestLiveUpdates2Text00, + gTVPokemonContestLiveUpdates2Text01, + gTVPokemonContestLiveUpdates2Text02, + gTVPokemonContestLiveUpdates2Text03 +}; + +const u8 *const sTVPokemonTodayFailedTextGroup[] = { + gTVPokemonTodayFailedText00, + gTVPokemonTodayFailedText01, + gTVPokemonTodayFailedText02, + gTVPokemonTodayFailedText03, + gTVPokemonTodayFailedText04, + gTVPokemonTodayFailedText05, + gTVPokemonTodayFailedText06 +}; + +const u8 *const sTVPokemonAnslerTextGroup[] = { + gTVPokemonAnglerText00, + gTVPokemonAnglerText01 +}; + +const u8 *const sTVWorldOfMastersTextGroup[] = { + gTVWorldOfMastersText00, + gTVWorldOfMastersText01, + gTVWorldOfMastersText02 +}; + +const u8 *const sTVTodaysRivalTrainerTextGroup[] = { + gTVTodaysRivalTrainerText00, + gTVTodaysRivalTrainerText01, + gTVTodaysRivalTrainerText02, + gTVTodaysRivalTrainerText03, + gTVTodaysRivalTrainerText04, + gTVTodaysRivalTrainerText05, + gTVTodaysRivalTrainerText06, + gTVTodaysRivalTrainerText07, + gTVTodaysRivalTrainerText08, + gTVTodaysRivalTrainerText09, + gTVTodaysRivalTrainerText10 +}; + +const u8 *const sTVDewfordTrendWatcherNetworkTextGroup[] = { + gTVDewfordTrendWatcherNetworkText00, + gTVDewfordTrendWatcherNetworkText01, + gTVDewfordTrendWatcherNetworkText02, + gTVDewfordTrendWatcherNetworkText03, + gTVDewfordTrendWatcherNetworkText04, + gTVDewfordTrendWatcherNetworkText05, + gTVDewfordTrendWatcherNetworkText06 +}; + +const u8 *const sTVHoennTreasureInvestisatorsTextGroup[] = { + gTVHoennTreasureInvestigatorsText00, + gTVHoennTreasureInvestigatorsText01, + gTVHoennTreasureInvestigatorsText02 +}; + +const u8 *const sTVFindThatGamerTextGroup[] = { + gTVFindThatGamerText00, + gTVFindThatGamerText01, + gTVFindThatGamerText02, + gTVFindThatGamerText03 +}; + +const u8 *const sTVBreakinsNewsTextGroup[] = { + gTVBreakingNewsText00, + gTVBreakingNewsText01, + gTVBreakingNewsText02, + gTVBreakingNewsText03, + gTVBreakingNewsText04, + gTVBreakingNewsText05, + gTVBreakingNewsText06, + gTVBreakingNewsText07, + gTVBreakingNewsText08, + gTVBreakingNewsText09, + gTVBreakingNewsText10, + gTVBreakingNewsText11, + gTVBreakingNewsText12 +}; + +const u8 *const sTVSecretBaseVisitTextGroup[] = { + gTVSecretBaseVisitText00, + gTVSecretBaseVisitText01, + gTVSecretBaseVisitText02, + gTVSecretBaseVisitText03, + gTVSecretBaseVisitText04, + gTVSecretBaseVisitText05, + gTVSecretBaseVisitText06, + gTVSecretBaseVisitText07, + gTVSecretBaseVisitText08, + gTVSecretBaseVisitText09, + gTVSecretBaseVisitText10, + gTVSecretBaseVisitText11, + gTVSecretBaseVisitText12, + gTVSecretBaseVisitText13 +}; + +const u8 *const sTVPokemonLotteryWinnerFlashReportTextGroup[] = { + gTVPokemonLotteryWinnerFlashReportText00 +}; + +const u8 *const sTVThePokemonBattleSeminarTextGroup[] = { + gTVThePokemonBattleSeminarText00, + gTVThePokemonBattleSeminarText01, + gTVThePokemonBattleSeminarText02, + gTVThePokemonBattleSeminarText03, + gTVThePokemonBattleSeminarText04, + gTVThePokemonBattleSeminarText05, + gTVThePokemonBattleSeminarText06 +}; + +const u8 *const sTVTrainerFanClubTextGroup[] = { + gTVTrainerFanClubText00, + gTVTrainerFanClubText01, + gTVTrainerFanClubText02, + gTVTrainerFanClubText03, + gTVTrainerFanClubText04, + gTVTrainerFanClubText05, + gTVTrainerFanClubText06, + gTVTrainerFanClubText07, + gTVTrainerFanClubText08, + gTVTrainerFanClubText09, + gTVTrainerFanClubText10, + gTVTrainerFanClubText11 +}; + +const u8 *const sTVCutiesTextGroup[] = { + gTVCutiesText00, + gTVCutiesText01, + gTVCutiesText02, + gTVCutiesText03, + gTVCutiesText04, + gTVCutiesText05, + gTVCutiesText06, + gTVCutiesText07, + gTVCutiesText08, + gTVCutiesText09, + gTVCutiesText10, + gTVCutiesText11, + gTVCutiesText12, + gTVCutiesText13, + gTVCutiesText14, + gTVCutiesText15 +}; + +const u8 *const sTVPokemonNewsBattleFrontierTextGroup[] = { + gTVPokemonNewsBattleFrontierText00, + gTVPokemonNewsBattleFrontierText01, + gTVPokemonNewsBattleFrontierText02, + gTVPokemonNewsBattleFrontierText03, + gTVPokemonNewsBattleFrontierText04, + gTVPokemonNewsBattleFrontierText05, + gTVPokemonNewsBattleFrontierText06, + gTVPokemonNewsBattleFrontierText07, + gTVPokemonNewsBattleFrontierText08, + gTVPokemonNewsBattleFrontierText09, + gTVPokemonNewsBattleFrontierText10, + gTVPokemonNewsBattleFrontierText11, + gTVPokemonNewsBattleFrontierText12, + gTVPokemonNewsBattleFrontierText13, + gTVPokemonNewsBattleFrontierText14, + gTVPokemonNewsBattleFrontierText15, + gTVPokemonNewsBattleFrontierText16, + gTVPokemonNewsBattleFrontierText17, + gTVPokemonNewsBattleFrontierText18 +}; + +const u8 *const sTVWhatsNo1InHoennTodayTextGroup[] = { + gTVWhatsNo1InHoennTodayText00, + gTVWhatsNo1InHoennTodayText01, + gTVWhatsNo1InHoennTodayText02, + gTVWhatsNo1InHoennTodayText03, + gTVWhatsNo1InHoennTodayText04, + gTVWhatsNo1InHoennTodayText05, + gTVWhatsNo1InHoennTodayText06, + gTVWhatsNo1InHoennTodayText07, + gTVWhatsNo1InHoennTodayText08 +}; + +const u8 *const sTVSecretBaseSecretsTextGroup[] = { + gTVSecretBaseSecretsText00, + gTVSecretBaseSecretsText01, + gTVSecretBaseSecretsText02, + gTVSecretBaseSecretsText03, + gTVSecretBaseSecretsText04, + gTVSecretBaseSecretsText05, + gTVSecretBaseSecretsText06, + gTVSecretBaseSecretsText07, + gTVSecretBaseSecretsText08, + gTVSecretBaseSecretsText09, + gTVSecretBaseSecretsText10, + gTVSecretBaseSecretsText11, + gTVSecretBaseSecretsText12, + gTVSecretBaseSecretsText13, + gTVSecretBaseSecretsText14, + gTVSecretBaseSecretsText15, + gTVSecretBaseSecretsText16, + gTVSecretBaseSecretsText17, + gTVSecretBaseSecretsText18, + gTVSecretBaseSecretsText19, + gTVSecretBaseSecretsText20, + gTVSecretBaseSecretsText21, + gTVSecretBaseSecretsText22, + gTVSecretBaseSecretsText23, + gTVSecretBaseSecretsText24, + gTVSecretBaseSecretsText25, + gTVSecretBaseSecretsText26, + gTVSecretBaseSecretsText27, + gTVSecretBaseSecretsText28, + gTVSecretBaseSecretsText29, + gTVSecretBaseSecretsText30, + gTVSecretBaseSecretsText31, + gTVSecretBaseSecretsText32, + gTVSecretBaseSecretsText33, + gTVSecretBaseSecretsText34, + gTVSecretBaseSecretsText35, + gTVSecretBaseSecretsText36, + gTVSecretBaseSecretsText37, + gTVSecretBaseSecretsText38, + gTVSecretBaseSecretsText39, + gTVSecretBaseSecretsText40, + gTVSecretBaseSecretsText41, + gTVSecretBaseSecretsText42 +}; + +const u8 *const sTVSafariFanClubTextGroup[] = { + gTVSafariFanClubText00, + gTVSafariFanClubText01, + gTVSafariFanClubText02, + gTVSafariFanClubText03, + gTVSafariFanClubText04, + gTVSafariFanClubText05, + gTVSafariFanClubText06, + gTVSafariFanClubText07, + gTVSafariFanClubText08, + gTVSafariFanClubText09, + gTVSafariFanClubText10 +}; + +const u8 *const sTVInSearchOfTrainersTextGroup[] = { + gTVInSearchOfTrainersText00, + gTVInSearchOfTrainersText01, + gTVInSearchOfTrainersText02, + gTVInSearchOfTrainersText03, + gTVInSearchOfTrainersText04, + gTVInSearchOfTrainersText05, + gTVInSearchOfTrainersText06, + gTVInSearchOfTrainersText07, + gTVInSearchOfTrainersText08 +}; + +const u8 sTVSecretBaseSecretsStateLookup[] = { + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f, + 0x10, + 0x11, + 0x12, + 0x13, + 0x14, + 0x17, + 0x18, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f, + 0x20, + 0x21, + 0x22, + 0x23, + 0x24, + 0x25, + 0x26, + 0x27, + 0x28, + 0x29, + 0x2a, + 0x2b +}; + +// .text + +void ClearTVShowData(void) +{ + u8 i; + u8 j; + + for (i = 0; i < ARRAY_COUNT(gSaveBlock1Ptr->tvShows); i ++) + { + gSaveBlock1Ptr->tvShows[i].common.kind = 0; + gSaveBlock1Ptr->tvShows[i].common.active = 0; + for (j = 0; j < sizeof(TVShow) - 2; j ++) + { + gSaveBlock1Ptr->tvShows[i].common.pad02[j] = 0; + } + } + ClearPokemonNews(); +} + +u8 special_0x44(void) +{ + u8 i; + u8 j; + u8 selIdx; + TVShow *show; + + for (i = 5; i < ARRAY_COUNT(gSaveBlock1Ptr->tvShows) - 1; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == 0) + { + break; + } + } + j = Random() % i; + selIdx = j; + do + { + if (GetTVChannelByShowType(gSaveBlock1Ptr->tvShows[j].common.kind) != 4) + { + if (gSaveBlock1Ptr->tvShows[j].common.active == TRUE) + { + return j; + } + } + else + { + show = &gSaveBlock1Ptr->tvShows[j]; + if (show->massOutbreak.daysLeft == 0 && show->massOutbreak.active == TRUE) + { + return j; + } + } + if (j == 0) + { + j = ARRAY_COUNT(gSaveBlock1Ptr->tvShows) - 2; + } + else + { + j --; + } + } while (j != selIdx); + return 0xFF; +} + +u8 FindAnyTVShowOnTheAir(void) +{ + u8 response; + + response = special_0x44(); + if (response == 0xFF) + { + return 0xFF; + } + if (gSaveBlock1Ptr->outbreakPokemonSpecies != SPECIES_NONE && gSaveBlock1Ptr->tvShows[response].common.kind == TVSHOW_MASS_OUTBREAK) + { + return FindFirstActiveTVShowThatIsNotAMassOutbreak(); + } + return response; +} + +void UpdateTVScreensOnMap(int width, int height) +{ + FlagSet(SYS_TV_WATCH); + switch (CheckForBigMovieOrEmergencyNewsOnTV()) + { + case 1: + SetTVMetatilesOnMap(width, height, 0x3); + break; + case 2: + break; + default: + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F && gSaveBlock1Ptr->location.mapNum == MAP_ID_LILYCOVE_CITY_COVE_LILY_MOTEL_1F) + { + SetTVMetatilesOnMap(width, height, 0x3); + } + else if (FlagGet(SYS_TV_START) && (FindAnyTVShowOnTheAir() != 0xff || FindAnyTVNewsOnTheAir() != 0xff || IsTVShowInSearchOfTrainersAiring())) + { + FlagReset(SYS_TV_WATCH); + SetTVMetatilesOnMap(width, height, 0x3); + } + break; + } +} + +void SetTVMetatilesOnMap(int width, int height, u16 tileId) +{ + int x; + int y; + + for (y = 0; y < height; y ++) + { + for (x = 0; x < width; x ++) + { + if (MapGridGetMetatileBehaviorAt(x, y) == 0x86) // is this tile a TV? + { + MapGridSetMetatileIdAt(x, y, tileId | 0xc00); + } + } + } +} + +void TurnOffTVScreen(void) +{ + SetTVMetatilesOnMap(gUnknown_03005DC0.width, gUnknown_03005DC0.height, 0x0002); + DrawWholeMapView(); +} + +void TurnOnTVScreen(void) +{ + SetTVMetatilesOnMap(gUnknown_03005DC0.width, gUnknown_03005DC0.height, 0x0003); + DrawWholeMapView(); +} + +u8 special_0x45(void) +{ + return gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004].common.kind; +} + +u8 FindFirstActiveTVShowThatIsNotAMassOutbreak(void) +{ + u8 i; + + for (i = 0; i < ARRAY_COUNT(gSaveBlock1Ptr->tvShows) - 1; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind != 0 && gSaveBlock1Ptr->tvShows[i].common.kind != TVSHOW_MASS_OUTBREAK && gSaveBlock1Ptr->tvShows[i].common.active == TRUE) + { + return i; + } + } + return 0xFF; +} + +u8 special_0x4a(void) +{ + TVShow *tvShow; + + tvShow = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + if (tvShow->common.kind == TVSHOW_MASS_OUTBREAK && gSaveBlock1Ptr->outbreakPokemonSpecies != SPECIES_NONE) + { + return FindFirstActiveTVShowThatIsNotAMassOutbreak(); + } + return gSpecialVar_0x8004; +} + +// IN SEARCH OF TRAINERS + +void ResetGabbyAndTy(void) +{ + gSaveBlock1Ptr->gabbyAndTyData.mon1 = SPECIES_NONE; + gSaveBlock1Ptr->gabbyAndTyData.mon2 = SPECIES_NONE; + gSaveBlock1Ptr->gabbyAndTyData.lastMove = MOVE_NONE; + gSaveBlock1Ptr->gabbyAndTyData.quote[0] = -1; + gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.onAir = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.valA_5 = 0; + gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn2 = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon2 = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem2 = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall2 = FALSE; + gSaveBlock1Ptr->gabbyAndTyData.valB_4 = 0; + gSaveBlock1Ptr->gabbyAndTyData.mapnum = 0; + gSaveBlock1Ptr->gabbyAndTyData.battleNum = 0; +} + +void GabbyAndTyBeforeInterview(void) +{ + u8 i; + + gSaveBlock1Ptr->gabbyAndTyData.mon1 = gBattleResults.playerMon1Species; + gSaveBlock1Ptr->gabbyAndTyData.mon2 = gBattleResults.playerMon2Species; + gSaveBlock1Ptr->gabbyAndTyData.lastMove = gBattleResults.lastUsedMovePlayer; + if (gSaveBlock1Ptr->gabbyAndTyData.battleNum != 0xFF) + { + gSaveBlock1Ptr->gabbyAndTyData.battleNum ++; + } + gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn = gBattleResults.unk5_0; + if (gBattleResults.playerFaintCounter != 0) + { + gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon = TRUE; + } + else + { + gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon = FALSE; + } + if (gBattleResults.unk3 != 0) + { + gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem = TRUE; + } + else + { + gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem = FALSE; + } + if (!gBattleResults.usedMasterBall) + { + for (i = 0; i < 11; i ++) + { + if (gBattleResults.catchAttempts[i]) + { + gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = TRUE; + break; + } + } + } + else + { + gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall = TRUE; + } + TakeTVShowInSearchOfTrainersOffTheAir(); + if (gSaveBlock1Ptr->gabbyAndTyData.lastMove == MOVE_NONE) + { + FlagSet(0x0001); + } +} + +void GabbyAndTyAfterInterview(void) +{ + gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn2 = gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn; + gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon2 = gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon; + gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem2 = gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem; + gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall2 = gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall; + gSaveBlock1Ptr->gabbyAndTyData.onAir = TRUE; + gSaveBlock1Ptr->gabbyAndTyData.mapnum = gMapHeader.regionMapSectionId; + IncrementGameStat(GAME_STAT_GOT_INTERVIEWED); +} + +void TakeTVShowInSearchOfTrainersOffTheAir(void) +{ + gSaveBlock1Ptr->gabbyAndTyData.onAir = FALSE; +} + +u8 GabbyAndTyGetBattleNum(void) +{ + if (gSaveBlock1Ptr->gabbyAndTyData.battleNum > 5) + { + return (gSaveBlock1Ptr->gabbyAndTyData.battleNum % 3) + 6; + } + return gSaveBlock1Ptr->gabbyAndTyData.battleNum; +} + +bool8 IsTVShowInSearchOfTrainersAiring(void) +{ + return gSaveBlock1Ptr->gabbyAndTyData.onAir; +} + +bool8 GabbyAndTyGetLastQuote(void) +{ + if (gSaveBlock1Ptr->gabbyAndTyData.quote[0] == 0xFFFF) + { + return FALSE; + } + CopyEasyChatWord(gStringVar1, gSaveBlock1Ptr->gabbyAndTyData.quote[0]); + gSaveBlock1Ptr->gabbyAndTyData.quote[0] = -1; + return TRUE; +} + +u8 GabbyAndTyGetLastBattleTrivia(void) +{ + if (!gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn2) + { + return 1; + } + if (gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall2) + { + return 2; + } + if (gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem2) + { + return 3; + } + if (gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon2) + { + return 4; + } + return 0; +} + +void GabbyAndTySetScriptVarsToFieldObjectLocalIds(void) +{ + switch (GabbyAndTyGetBattleNum()) + { + case 1: + gSpecialVar_0x8004 = 14; + gSpecialVar_0x8005 = 13; + break; + case 2: + gSpecialVar_0x8004 = 5; + gSpecialVar_0x8005 = 6; + break; + case 3: + gSpecialVar_0x8004 = 18; + gSpecialVar_0x8005 = 17; + break; + case 4: + gSpecialVar_0x8004 = 21; + gSpecialVar_0x8005 = 22; + break; + case 5: + gSpecialVar_0x8004 = 8; + gSpecialVar_0x8005 = 9; + break; + case 6: + gSpecialVar_0x8004 = 19; + gSpecialVar_0x8005 = 20; + break; + case 7: + gSpecialVar_0x8004 = 23; + gSpecialVar_0x8005 = 24; + break; + case 8: + gSpecialVar_0x8004 = 10; + gSpecialVar_0x8005 = 11; + break; + } +} + +void InterviewAfter(void) +{ + switch (gSpecialVar_0x8005) + { + case TVSHOW_FAN_CLUB_LETTER: + InterviewAfter_FanClubLetter(); + break; + case TVSHOW_RECENT_HAPPENINGS: + InterviewAfter_RecentHappenings(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + InterviewAfter_PkmnFanClubOpinions(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + InterviewAfter_DummyShow4(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + InterviewAfter_BravoTrainerPokemonProfile(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + InterviewAfter_BravoTrainerBattleTowerProfile(); + break; + case TVSHOW_CONTEST_LIVE_UPDATES: + InterviewAfter_ContestLiveUpdates(); + break; + } +} + +void PutPokemonTodayCaughtOnAir(void) +{ + u8 i; + u16 ct; + TVShow *show; + u32 language2; + u16 itemLastUsed; + + ct = 0; + sub_80EED88(); + sub_80ED718(); + if (gBattleResults.caughtMonSpecies == SPECIES_NONE) + { + PutPokemonTodayFailedOnTheAir(); + } + else + { + UpdateWorldOfMastersAndPutItOnTheAir(); + if (!rbernoulli(1, 1) && StringCompare(gSpeciesNames[gBattleResults.caughtMonSpecies], gBattleResults.caughtMonNick)) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_POKEMON_TODAY_CAUGHT, FALSE) != TRUE) + { + for (i = 0; i < 11; i ++) + { + ct += gBattleResults.catchAttempts[i]; + } + if (ct != 0 || gBattleResults.usedMasterBall) + { + ct = 0; + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->pokemonToday.kind = TVSHOW_POKEMON_TODAY_CAUGHT; + show->pokemonToday.active = FALSE; + if (gBattleResults.usedMasterBall) + { + ct = 1; + itemLastUsed = ITEM_MASTER_BALL; + } + else + { + for (i = 0; i < 11; i ++) + { + ct += gBattleResults.catchAttempts[i]; + } + if (ct > 0xFF) + { + ct = 0xFF; + } + itemLastUsed = gLastUsedItem; + } + show->pokemonToday.nBallsUsed = ct; + show->pokemonToday.ball = itemLastUsed; + StringCopy(show->pokemonToday.playerName, gSaveBlock2Ptr->playerName); + StringCopy(show->pokemonToday.nickname, gBattleResults.caughtMonNick); + language2 = sub_81DB604(show->pokemonToday.nickname); + StripExtCtrlCodes(show->pokemonToday.nickname); + show->pokemonToday.species = gBattleResults.caughtMonSpecies; + tv_store_id_3x(show); + show->pokemonToday.language = gGameLanguage; + show->pokemonToday.language2 = language2; + } + } + } + } +} + +void UpdateWorldOfMastersAndPutItOnTheAir(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + if (show->worldOfMasters.kind != TVSHOW_WORLD_OF_MASTERS) + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + show->worldOfMasters.steps = GetGameStat(GAME_STAT_STEPS); + show->worldOfMasters.kind = TVSHOW_WORLD_OF_MASTERS; + } + show->worldOfMasters.numPokeCaught ++; + show->worldOfMasters.caughtPoke = gBattleResults.caughtMonSpecies; + show->worldOfMasters.species = gBattleResults.playerMon1Species; + show->worldOfMasters.location = gMapHeader.regionMapSectionId; +} + +void PutPokemonTodayFailedOnTheAir(void) +{ + u16 ct; + u8 i; + TVShow *show; + + if (!rbernoulli(1, 1)) + { + for (i = 0, ct = 0; i < 11; i ++) + { + ct += gBattleResults.catchAttempts[i]; + } + if (ct > 0xFF) + { + ct = 0xFF; + } + if (ct > 2 && (gBattleOutcome == BATTLE_POKE_FLED || gBattleOutcome == BATTLE_WON)) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_POKEMON_TODAY_FAILED, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->pokemonTodayFailed.kind = TVSHOW_POKEMON_TODAY_FAILED; + show->pokemonTodayFailed.active = FALSE; + show->pokemonTodayFailed.species = gBattleResults.playerMon1Species; + show->pokemonTodayFailed.species2 = gBattleResults.lastOpponentSpecies; + show->pokemonTodayFailed.nBallsUsed = ct; + show->pokemonTodayFailed.outcome = gBattleOutcome; + show->pokemonTodayFailed.location = gMapHeader.regionMapSectionId; + StringCopy(show->pokemonTodayFailed.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->pokemonTodayFailed.language = gGameLanguage; + } + } + } +} + +void tv_store_id_3x(TVShow *show) +{ + u32 id; + + id = GetPlayerIDAsU32(); + show->common.srcTrainerId2Lo = id; + show->common.srcTrainerId2Hi = id >> 8; + show->common.srcTrainerIdLo = id; + show->common.srcTrainerIdHi = id >> 8; + show->common.trainerIdLo = id; + show->common.trainerIdHi = id >> 8; +} + +void tv_store_id_2x(TVShow *show) +{ + u32 id; + + id = GetPlayerIDAsU32(); + show->common.srcTrainerIdLo = id; + show->common.srcTrainerIdHi = id >> 8; + show->common.trainerIdLo = id; + show->common.trainerIdHi = id >> 8; +} + +void InterviewAfter_ContestLiveUpdates(void) +{ + TVShow *show; + TVShow *show2; + + show = &gSaveBlock1Ptr->tvShows[24]; + if (show->contestLiveUpdates.kind == TVSHOW_CONTEST_LIVE_UPDATES) + { + show2 = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show2->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES; + show2->contestLiveUpdates.active = TRUE; + StringCopy(show2->contestLiveUpdates.playerName, gSaveBlock2Ptr->playerName); + show2->contestLiveUpdates.category = gUnknown_02039F2C; + show2->contestLiveUpdates.species = GetMonData(&gPlayerParty[gUnknown_02039F24], MON_DATA_SPECIES, NULL); + show2->contestLiveUpdates.winningSpecies = show->contestLiveUpdates.winningSpecies; + show2->contestLiveUpdates.appealFlags2 = show->contestLiveUpdates.appealFlags2; + show2->contestLiveUpdates.round1Rank = show->contestLiveUpdates.round1Rank; + show2->contestLiveUpdates.round2Rank = show->contestLiveUpdates.round2Rank; + show2->contestLiveUpdates.move = show->contestLiveUpdates.move; + show2->contestLiveUpdates.appealFlags1 = show->contestLiveUpdates.appealFlags1; + StringCopy(show2->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerName); + tv_store_id_2x(show2); + show2->contestLiveUpdates.language = gGameLanguage; + show2->contestLiveUpdates.winningTrainerLanguage = show->contestLiveUpdates.winningTrainerLanguage; + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + } +} + +void PutBattleUpdateOnTheAir(u8 a0, u16 a1, u16 a2, u16 a3) +{ + TVShow *show; + u8 name[32]; + + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BATTLE_UPDATE); + if (gScriptResult != 1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->battleUpdate.kind = TVSHOW_BATTLE_UPDATE; + show->battleUpdate.active = TRUE; + StringCopy(show->battleUpdate.playerName, gSaveBlock2Ptr->playerName); + if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + show->battleUpdate.battleType = 2; + } + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + show->battleUpdate.battleType = 1; + } + else + { + show->battleUpdate.battleType = 0; + } + show->battleUpdate.move = a1; + show->battleUpdate.species2 = a2; + show->battleUpdate.species = a3; + StringCopy(name, gLinkPlayers[a0].name); + StripExtCtrlCodes(name); + StringCopy(show->battleUpdate.linkOpponentName, name); + tv_store_id_2x(show); + show->battleUpdate.language = gGameLanguage; + if (show->battleUpdate.language == LANGUAGE_JAPANESE || gLinkPlayers[a0].language == LANGUAGE_JAPANESE) + { + show->battleUpdate.linkOpponentLanguage = LANGUAGE_JAPANESE; + } + else + { + show->battleUpdate.linkOpponentLanguage = gLinkPlayers[a0].language; + } + } + } +} + +bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language) +{ + TVShow *show; + u8 name[32]; + + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot == -1) + { + return FALSE; + } + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_3_CHEERS_FOR_POKEBLOCKS); + if (gScriptResult == 1) + { + return FALSE; + } + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->threeCheers.kind = TVSHOW_3_CHEERS_FOR_POKEBLOCKS; + show->threeCheers.active = TRUE; + StringCopy(show->threeCheers.playerName, gSaveBlock2Ptr->playerName); + StringCopy(name, partnersName); + StripExtCtrlCodes(name); + StringCopy(show->threeCheers.worstBlenderName, name); + show->threeCheers.flavor = flavor; + show->threeCheers.unk_03_3 = unused; + show->threeCheers.sheen = sheen; + tv_store_id_2x(show); + show->threeCheers.language = gGameLanguage; + if (show->threeCheers.language == LANGUAGE_JAPANESE || language == LANGUAGE_JAPANESE) + { + show->threeCheers.worstBlenderLanguage = LANGUAGE_JAPANESE; + } + else + { + show->threeCheers.worstBlenderLanguage = language; + } + return TRUE; +} + +void PutFanClubSpecialOnTheAir(void) +{ + TVShow *show; + u8 name[32]; + u32 id; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8006]; + show->fanClubSpecial.score = gSpecialVar_0x8005 * 10; + StringCopy(show->fanClubSpecial.playerName, gSaveBlock2Ptr->playerName); + show->fanClubSpecial.kind = TVSHOW_FAN_CLUB_SPECIAL; + show->fanClubSpecial.active = TRUE; + id = GetPlayerIDAsU32(); + show->fanClubSpecial.idLo = id; + show->fanClubSpecial.idHi = id >> 8; + StringCopy(name, gStringVar1); + StripExtCtrlCodes(name); + StringCopy(show->fanClubSpecial.idolName, name); + tv_store_id_2x(show); + show->fanClubSpecial.language = gGameLanguage; + if (show->fanClubSpecial.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->unk_31A0 == LANGUAGE_JAPANESE) + { + show->fanClubSpecial.idolNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show->fanClubSpecial.idolNameLanguage = gSaveBlock1Ptr->unk_31A0; + } +} + +void ContestLiveUpdates_BeforeInterview_1(u8 a0) +{ + TVShow *show; + + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[24]; + show->contestLiveUpdates.round1Rank = a0; + show->contestLiveUpdates.kind = TVSHOW_CONTEST_LIVE_UPDATES; + } +} + +void ContestLiveUpdates_BeforeInterview_2(u8 a0) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show->contestLiveUpdates.round2Rank = a0; + } +} + +void ContestLiveUpdates_BeforeInterview_3(u8 a0) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show->contestLiveUpdates.appealFlags1 = a0; + } +} + +void ContestLiveUpdates_BeforeInterview_4(u16 a0) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show->contestLiveUpdates.move = a0; + } +} + +void ContestLiveUpdates_BeforeInterview_5(u8 a0, u8 a1) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show->contestLiveUpdates.winningSpecies = gUnknown_02039E00[a1].unk_00; + StringCopy(show->contestLiveUpdates.winningTrainerName, gUnknown_02039E00[a1].unk_0d); + StripExtCtrlCodes(show->contestLiveUpdates.winningTrainerName); + show->contestLiveUpdates.appealFlags2 = a0; + if (a1 + 1 > gUnknown_02039F30) + { + show->contestLiveUpdates.winningTrainerLanguage = gLinkPlayers[0].language; + } + else if (gGameLanguage == LANGUAGE_JAPANESE || gLinkPlayers[a1].language == LANGUAGE_JAPANESE) + { + show->contestLiveUpdates.winningTrainerLanguage = LANGUAGE_JAPANESE; + } + else + { + show->contestLiveUpdates.winningTrainerLanguage = gLinkPlayers[a1].language; + } + } +} + +void InterviewAfter_BravoTrainerPokemonProfile(void) +{ + TVShow *show; + TVShow *show2; + + show = &gSaveBlock1Ptr->tvShows[24]; + if (show->bravoTrainer.kind == TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE) + { + show2 = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show2->bravoTrainer.kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; + show2->bravoTrainer.active = TRUE; + show2->bravoTrainer.species = show->bravoTrainer.species; + StringCopy(show2->bravoTrainer.playerName, gSaveBlock2Ptr->playerName); + StringCopy(show2->bravoTrainer.pokemonNickname, show->bravoTrainer.pokemonNickname); + show2->bravoTrainer.contestCategory = show->bravoTrainer.contestCategory; + show2->bravoTrainer.contestRank = show->bravoTrainer.contestRank; + show2->bravoTrainer.move = show->bravoTrainer.move; + show2->bravoTrainer.contestResult = show->bravoTrainer.contestResult; + show2->bravoTrainer.contestCategory = show->bravoTrainer.contestCategory; + tv_store_id_2x(show2); + show2->bravoTrainer.language = gGameLanguage; + if (show2->bravoTrainer.language == LANGUAGE_JAPANESE || show->bravoTrainer.pokemonNameLanguage == LANGUAGE_JAPANESE) + { + show2->bravoTrainer.pokemonNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show2->bravoTrainer.pokemonNameLanguage = show->bravoTrainer.pokemonNameLanguage; + } + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + } +} + +void BravoTrainerPokemonProfile_BeforeInterview1(u16 a0) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + InterviewBefore_BravoTrainerPkmnProfile(); + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + show->bravoTrainer.move = a0; + show->bravoTrainer.kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; + } +} + +void BravoTrainerPokemonProfile_BeforeInterview2(u8 a0) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show->bravoTrainer.contestResult = a0; + show->bravoTrainer.contestCategory = gUnknown_02039F2C; + show->bravoTrainer.contestRank = gUnknown_02039F2E; + show->bravoTrainer.species = GetMonData(&gPlayerParty[gUnknown_02039F24], MON_DATA_SPECIES, NULL); + GetMonData(&gPlayerParty[gUnknown_02039F24], MON_DATA_NICKNAME, show->bravoTrainer.pokemonNickname); + StripExtCtrlCodes(show->bravoTrainer.pokemonNickname); + show->bravoTrainer.pokemonNameLanguage = GetMonData(&gPlayerParty[gUnknown_02039F24], MON_DATA_LANGUAGE); + } +} + +void InterviewAfter_BravoTrainerBattleTowerProfile(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->bravoTrainerTower.kind = TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE; + show->bravoTrainerTower.active = TRUE; + StringCopy(show->bravoTrainerTower.trainerName, gSaveBlock2Ptr->playerName); + StringCopy(show->bravoTrainerTower.pokemonName, gSaveBlock2Ptr->field_BD8); + show->bravoTrainerTower.species = gSaveBlock2Ptr->field_BD4; + show->bravoTrainerTower.defeatedSpecies = gSaveBlock2Ptr->field_BD6; + show->bravoTrainerTower.numFights = sub_8164FCC(gSaveBlock2Ptr->field_D07, 0); + show->bravoTrainerTower.wonTheChallenge = gSaveBlock2Ptr->field_D06; + if (gSaveBlock2Ptr->field_D07 == 0) + { + show->bravoTrainerTower.btLevel = 50; + } + else + { + show->bravoTrainerTower.btLevel = 100; + } + show->bravoTrainerTower.interviewResponse = gSpecialVar_0x8004; + tv_store_id_2x(show); + show->bravoTrainerTower.language = gGameLanguage; + if (show->bravoTrainerTower.language == LANGUAGE_JAPANESE || gSaveBlock2Ptr->field_BEB == LANGUAGE_JAPANESE) + { + show->bravoTrainerTower.pokemonNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show->bravoTrainerTower.pokemonNameLanguage = gSaveBlock2Ptr->field_BEB; + } +} + +void SaveRecordedItemPurchasesForTVShow(void) +{ + TVShow *show; + u8 i; + + if (!(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_TRAINER_HILL_LOBBY && gSaveBlock1Ptr->location.mapNum == MAP_ID_TRAINER_HILL_LOBBY) && !(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_BATTLE_FRONTIER_MART && gSaveBlock1Ptr->location.mapNum == MAP_ID_BATTLE_FRONTIER_MART) && !rbernoulli(1, 3)) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SMART_SHOPPER, FALSE) != TRUE) + { + TV_SortPurchasesByQuantity(); + if (gUnknown_02039F80[0].quantity >= 20) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->smartshopperShow.kind = TVSHOW_SMART_SHOPPER; + show->smartshopperShow.active = FALSE; + show->smartshopperShow.shopLocation = gMapHeader.regionMapSectionId; + for (i = 0; i < 3; i ++) + { + show->smartshopperShow.itemIds[i] = gUnknown_02039F80[i].itemId; + show->smartshopperShow.itemAmounts[i] = gUnknown_02039F80[i].quantity; + } + show->smartshopperShow.priceReduced = GetPriceReduction(1); + StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->smartshopperShow.language = gGameLanguage; + } + } + } +} + +void PutNameRaterShowOnTheAir(void) +{ + TVShow *show; + + InterviewBefore_NameRater(); + if (gScriptResult != 1) + { + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); + if (StringLength(gSaveBlock2Ptr->playerName) > 1 && StringLength(gStringVar1) > 1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->nameRaterShow.kind = TVSHOW_NAME_RATER_SHOW; + show->nameRaterShow.active = TRUE; + show->nameRaterShow.species = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL); + show->nameRaterShow.random = Random() % 3; + show->nameRaterShow.random2 = Random() % 2; + show->nameRaterShow.randomSpecies = TV_GetSomeOtherSpeciesAlreadySeenByPlayer(show->nameRaterShow.species); + StringCopy(show->nameRaterShow.trainerName, gSaveBlock2Ptr->playerName); + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, show->nameRaterShow.pokemonName); + StripExtCtrlCodes(show->nameRaterShow.pokemonName); + tv_store_id_2x(show); + show->nameRaterShow.language = gGameLanguage; + show->nameRaterShow.pokemonNameLanguage = GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_LANGUAGE); + } + } +} + +void StartMassOutbreak(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gSaveBlock1Ptr->outbreakPokemonSpecies = show->massOutbreak.species; + gSaveBlock1Ptr->outbreakLocationMapNum = show->massOutbreak.locationMapNum; + gSaveBlock1Ptr->outbreakLocationMapGroup = show->massOutbreak.locationMapGroup; + gSaveBlock1Ptr->outbreakPokemonLevel = show->massOutbreak.level; + gSaveBlock1Ptr->outbreakUnk1 = show->massOutbreak.var02; + gSaveBlock1Ptr->outbreakUnk2 = show->massOutbreak.var0E; + gSaveBlock1Ptr->outbreakPokemonMoves[0] = show->massOutbreak.moves[0]; + gSaveBlock1Ptr->outbreakPokemonMoves[1] = show->massOutbreak.moves[1]; + gSaveBlock1Ptr->outbreakPokemonMoves[2] = show->massOutbreak.moves[2]; + gSaveBlock1Ptr->outbreakPokemonMoves[3] = show->massOutbreak.moves[3]; + gSaveBlock1Ptr->outbreakUnk4 = show->massOutbreak.var03; + gSaveBlock1Ptr->outbreakPokemonProbability = show->massOutbreak.probability; + gSaveBlock1Ptr->outbreakDaysLeft = 2; +} + +void PutLilycoveContestLadyShowOnTheAir(void) +{ + TVShow *show; + + sub_80EFA88(); + if (gScriptResult != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + sub_818E848(&show->contestLiveUpdates2.language); + show->contestLiveUpdates2.pokemonNameLanguage = LANGUAGE_ENGLISH; + show->contestLiveUpdates2.kind = TVSHOW_CONTEST_LIVE_UPDATES_2; + show->contestLiveUpdates2.active = TRUE; + sub_818E81C(show->contestLiveUpdates2.playerName); + sub_818E7E0(&show->contestLiveUpdates2.contestCategory, show->contestLiveUpdates2.nickname); + show->contestLiveUpdates2.pokeblockState = sub_818E880(); + tv_store_id_2x(show); + } +} + +void InterviewAfter_FanClubLetter(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->fanclubLetter.kind = TVSHOW_FAN_CLUB_LETTER; + show->fanclubLetter.active = TRUE; + StringCopy(show->fanclubLetter.playerName, gSaveBlock2Ptr->playerName); + show->fanclubLetter.species = GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_SPECIES, NULL); + tv_store_id_2x(show); + show->fanclubLetter.language = gGameLanguage; +} + +void InterviewAfter_RecentHappenings(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->recentHappenings.kind = TVSHOW_RECENT_HAPPENINGS; + show->recentHappenings.active = TRUE; + StringCopy(show->recentHappenings.playerName, gSaveBlock2Ptr->playerName); + show->recentHappenings.var02 = 0; + tv_store_id_2x(show); + show->recentHappenings.language = gGameLanguage; +} + +void InterviewAfter_PkmnFanClubOpinions(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->fanclubOpinions.kind = TVSHOW_PKMN_FAN_CLUB_OPINIONS; + show->fanclubOpinions.active = TRUE; + show->fanclubOpinions.friendshipHighNybble = GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_FRIENDSHIP, NULL) >> 4; + show->fanclubOpinions.questionAsked = gSpecialVar_0x8007; + StringCopy(show->fanclubOpinions.playerName, gSaveBlock2Ptr->playerName); + GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_NICKNAME, show->fanclubOpinions.nickname); + StripExtCtrlCodes(show->fanclubOpinions.nickname); + show->fanclubOpinions.species = GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_SPECIES, NULL); + tv_store_id_2x(show); + show->fanclubOpinions.language = gGameLanguage; + if (gGameLanguage == LANGUAGE_JAPANESE || GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE) + { + show->fanclubOpinions.pokemonNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show->fanclubOpinions.pokemonNameLanguage = GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_LANGUAGE); + } +} + +void InterviewAfter_DummyShow4() +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; +} + +void sub_80ED718(void) +{ + u8 i; + u16 outbreakIdx; + TVShow *show; + + if (FlagGet(SYS_GAME_CLEAR)) + { + for (i = 0; i < 24; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == TVSHOW_MASS_OUTBREAK) + { + return; + } + } + if (!rbernoulli(1, 200)) + { + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + outbreakIdx = Random() % ARRAY_COUNT(sPokeOutbreakSpeciesList); + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->massOutbreak.kind = TVSHOW_MASS_OUTBREAK; + show->massOutbreak.active = TRUE; + show->massOutbreak.level = sPokeOutbreakSpeciesList[outbreakIdx].level; + show->massOutbreak.var02 = 0; + show->massOutbreak.var03 = 0; + show->massOutbreak.species = sPokeOutbreakSpeciesList[outbreakIdx].species; + show->massOutbreak.var0E = 0; + show->massOutbreak.moves[0] = sPokeOutbreakSpeciesList[outbreakIdx].moves[0]; + show->massOutbreak.moves[1] = sPokeOutbreakSpeciesList[outbreakIdx].moves[1]; + show->massOutbreak.moves[2] = sPokeOutbreakSpeciesList[outbreakIdx].moves[2]; + show->massOutbreak.moves[3] = sPokeOutbreakSpeciesList[outbreakIdx].moves[3]; + show->massOutbreak.locationMapNum = sPokeOutbreakSpeciesList[outbreakIdx].location; + show->massOutbreak.locationMapGroup = 0; + show->massOutbreak.var12 = 0; + show->massOutbreak.probability = 50; + show->massOutbreak.var15 = 0; + show->massOutbreak.daysLeft = 1; + tv_store_id_2x(show); + show->massOutbreak.language = gGameLanguage; + } + } + } +} + +void EndMassOutbreak(void) +{ + gSaveBlock1Ptr->outbreakPokemonSpecies = SPECIES_NONE; + gSaveBlock1Ptr->outbreakLocationMapNum = 0; + gSaveBlock1Ptr->outbreakLocationMapGroup = 0; + gSaveBlock1Ptr->outbreakPokemonLevel = 0; + gSaveBlock1Ptr->outbreakUnk1 = 0; + gSaveBlock1Ptr->outbreakUnk2 = 0; + gSaveBlock1Ptr->outbreakPokemonMoves[0] = MOVE_NONE; + gSaveBlock1Ptr->outbreakPokemonMoves[1] = MOVE_NONE; + gSaveBlock1Ptr->outbreakPokemonMoves[2] = MOVE_NONE; + gSaveBlock1Ptr->outbreakPokemonMoves[3] = MOVE_NONE; + gSaveBlock1Ptr->outbreakUnk4 = 0; + gSaveBlock1Ptr->outbreakPokemonProbability = 0; + gSaveBlock1Ptr->outbreakDaysLeft = 0; +} + +void sub_80ED888(u16 days) +{ + + sub_80ED8B4(days); + UpdateMassOutbreakTimeLeft(days); + sub_80EF120(days); + sub_80EDA48(days); + sub_80EEB98(days); +} + +void sub_80ED8B4(u16 days) +{ + u8 i; + TVShow *show; + + if (gSaveBlock1Ptr->outbreakPokemonSpecies == SPECIES_NONE) + { + for (i = 0; i < 24; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].massOutbreak.kind == TVSHOW_MASS_OUTBREAK && gSaveBlock1Ptr->tvShows[i].massOutbreak.active == TRUE) + { + show = &gSaveBlock1Ptr->tvShows[i]; + if (show->massOutbreak.daysLeft < days) + { + show->massOutbreak.daysLeft = 0; + } + else + { + show->massOutbreak.daysLeft -= days; + } + break; + } + } + } +} + +void UpdateMassOutbreakTimeLeft(u16 days) +{ + if (gSaveBlock1Ptr->outbreakDaysLeft <= days) + { + EndMassOutbreak(); + } + else + { + gSaveBlock1Ptr->outbreakDaysLeft -= days; + } +} + +void sub_80ED950(bool8 flag) +{ + if (flag) + { + if (sPokemonAnglerAttemptCounters >> 8 > 4) + { + PutFishingAdviceShowOnTheAir(); + } + sPokemonAnglerAttemptCounters &= 0xFF; + if (sPokemonAnglerAttemptCounters != 0xFF) + { + sPokemonAnglerAttemptCounters += 0x01; + } + } + else + { + if ((u8)sPokemonAnglerAttemptCounters > 4) + { + PutFishingAdviceShowOnTheAir(); + } + sPokemonAnglerAttemptCounters &= 0xFF00; + if (sPokemonAnglerAttemptCounters >> 8 != 0xFF) + { + sPokemonAnglerAttemptCounters += 0x0100; + } + } +} + +void PutFishingAdviceShowOnTheAir(void) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_FISHING_ADVICE, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->pokemonAngler.kind = TVSHOW_FISHING_ADVICE; + show->pokemonAngler.active = FALSE; + show->pokemonAngler.nBites = sPokemonAnglerAttemptCounters; + show->pokemonAngler.nFails = sPokemonAnglerAttemptCounters >> 8; + show->pokemonAngler.species = sPokemonAnglerSpecies; + StringCopy(show->pokemonAngler.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->pokemonAngler.language = gGameLanguage; + } +} + +void sub_80EDA3C(u16 species) +{ + sPokemonAnglerSpecies = species; +} + +void sub_80EDA48(u16 days) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[24]; + if (show->worldOfMasters.kind == TVSHOW_WORLD_OF_MASTERS) + { + if (show->worldOfMasters.numPokeCaught >= 20) + { + sub_80EDA80(); + } + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + } +} + +void sub_80EDA80(void) +{ + TVShow *show; + TVShow *show2; + + show = &gSaveBlock1Ptr->tvShows[24]; + if (!rbernoulli(1, 1)) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_WORLD_OF_MASTERS, FALSE) != TRUE) + { + show2 = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show2->worldOfMasters.kind = TVSHOW_WORLD_OF_MASTERS; + show2->worldOfMasters.active = FALSE; + show2->worldOfMasters.numPokeCaught = show->worldOfMasters.numPokeCaught; + show2->worldOfMasters.steps = GetGameStat(GAME_STAT_STEPS) - show->worldOfMasters.steps; + show2->worldOfMasters.caughtPoke = show->worldOfMasters.caughtPoke; + show2->worldOfMasters.species = show->worldOfMasters.species; + show2->worldOfMasters.location = show->worldOfMasters.location; + StringCopy(show2->worldOfMasters.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show2); + show2->worldOfMasters.language = gGameLanguage; + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, 24); + } + } +} + +void sub_80EDB44(void) +{ + TVShow *show; + u32 i; + u8 nBadges; + + HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_TODAYS_RIVAL_TRAINER, TRUE); + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->rivalTrainer.kind = TVSHOW_TODAYS_RIVAL_TRAINER; + show->rivalTrainer.active = FALSE; + for (i = BADGE01_GET, nBadges = 0; i < BADGE01_GET + 8; i ++) + { + if (FlagGet(i)) + { + nBadges ++; + } + } + show->rivalTrainer.badgeCount = nBadges; + if (IsNationalPokedexEnabled()) + { + show->rivalTrainer.dexCount = pokedex_count(0x01); + } + else + { + show->rivalTrainer.dexCount = sub_80C0844(0x01); + } + show->rivalTrainer.location = gMapHeader.regionMapSectionId; + show->rivalTrainer.mapDataId = gMapHeader.mapDataId; + show->rivalTrainer.nSilverSymbols = 0; + show->rivalTrainer.nGoldSymbols = 0; + for (i = 0; i < 7; i ++) + { + if (FlagGet(sSilverSymbolFlags[i]) == TRUE) + { + show->rivalTrainer.nSilverSymbols ++; + } + if (FlagGet(sGoldSymbolFlags[i]) == TRUE) + { + show->rivalTrainer.nGoldSymbols ++; + } + } + show->rivalTrainer.battlePoints = gSaveBlock2Ptr->frontierBattlePoints; + StringCopy(show->rivalTrainer.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->rivalTrainer.language = gGameLanguage; + } +} + +void sub_80EDC60(const u16 *words) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_TREND_WATCHER, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->trendWatcher.kind = TVSHOW_TREND_WATCHER; + show->trendWatcher.active = FALSE; + show->trendWatcher.gender = gSaveBlock2Ptr->playerGender; + show->trendWatcher.words[0] = words[0]; + show->trendWatcher.words[1] = words[1]; + StringCopy(show->trendWatcher.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->trendWatcher.language = gGameLanguage; + } +} + +void sub_80EDCE8(void) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_TREASURE_INVESTIGATORS, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->treasureInvestigators.kind = TVSHOW_TREASURE_INVESTIGATORS; + show->treasureInvestigators.active = FALSE; + show->treasureInvestigators.item = gSpecialVar_0x8005; + show->treasureInvestigators.location = gMapHeader.regionMapSectionId; + show->treasureInvestigators.mapDataId = gMapHeader.mapDataId; + StringCopy(show->treasureInvestigators.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->treasureInvestigators.language = gGameLanguage; + } +} + +void sub_80EDD78(u16 nCoinsPaidOut) +{ + TVShow *show; + bool8 flag; + u16 nCoinsWon; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_FIND_THAT_GAMER, FALSE) != TRUE) + { + flag = FALSE; + switch (sFindThatGamerWhichGame) + { + case FALSE: + if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 200) + { + flag = TRUE; + nCoinsWon = nCoinsPaidOut - sFindThatGamerCoinsSpent; + break; + } + if (sFindThatGamerCoinsSpent >= 100 && nCoinsPaidOut <= sFindThatGamerCoinsSpent - 100) + { + nCoinsWon = sFindThatGamerCoinsSpent - nCoinsPaidOut; + break; + } + return; + case TRUE: + if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 50) + { + flag = TRUE; + nCoinsWon = nCoinsPaidOut - sFindThatGamerCoinsSpent; + break; + } + if (sFindThatGamerCoinsSpent >= 50 && nCoinsPaidOut <= sFindThatGamerCoinsSpent - 50) + { + nCoinsWon = sFindThatGamerCoinsSpent - nCoinsPaidOut; + break; + } + return; + default: + return; + } + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->findThatGamer.kind = TVSHOW_FIND_THAT_GAMER; + show->findThatGamer.active = FALSE; + show->findThatGamer.nCoins = nCoinsWon; + show->findThatGamer.whichGame = sFindThatGamerWhichGame; + show->findThatGamer.won = flag; + StringCopy(show->findThatGamer.playerName, gSaveBlock2Ptr->playerName); + tv_store_id_3x(show); + show->findThatGamer.language = gGameLanguage; + } +} + +void sub_80EDE70(u16 nCoinsSpent) +{ + sFindThatGamerWhichGame = FALSE; + sFindThatGamerCoinsSpent = nCoinsSpent; +} + +void sub_80EDE84(u16 nCoinsSpent) +{ + sFindThatGamerWhichGame = TRUE; + sFindThatGamerCoinsSpent = nCoinsSpent; +} + +#ifdef NONMATCHING // FIXME: Register allocation shenanigans +void sub_80EDE98(TVShow *show) +{ + u8 i; + u8 j; + u16 k; + u8 n; + u8 deco; + u8 x; + + for (i = 0; i < 16; i ++) + { + sTV_DecorationsBuffer[i] = 0; + } + for (i = 0, n = 0; i < 16; i ++) + { + deco = gSaveBlock1Ptr->secretBases[0].decorations[i]; + if (deco) + { + for (j = 0; j < 16; j ++) + { + if (sTV_DecorationsBuffer[j] == 0) + { + sTV_DecorationsBuffer[j] = deco; + n ++; + break; + } + if (sTV_DecorationsBuffer[j] == deco) + { + break; + } + } + } + } + if (n > 4) + { + show->secretBaseVisit.nDecorations = 4; + } + else + { + show->secretBaseVisit.nDecorations = n; + } + switch (show->secretBaseVisit.nDecorations) + { + case 0: + break; + case 1: + show->secretBaseVisit.decorations[0] = sTV_DecorationsBuffer[0]; + break; + default: + for (k = 0; k < n * n; k ++) + { + i = Random() % n; + j = Random() % n; + x = sTV_DecorationsBuffer[i]; + sTV_DecorationsBuffer[i] = sTV_DecorationsBuffer[j]; + sTV_DecorationsBuffer[j] = x; + } + for (i = 0; i < show->secretBaseVisit.nDecorations; i ++) + { + show->secretBaseVisit.decorations[i] = sTV_DecorationsBuffer[i]; + } + break; + } +} +#else +__attribute__((naked)) +void sub_80EDE98(TVShow *show) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tmov r7, r9\n" + "\tmov r6, r8\n" + "\tpush {r6,r7}\n" + "\tmov r8, r0\n" + "\tmovs r3, 0\n" + "\tldr r6, =sTV_DecorationsBuffer\n" + "\tldr r7, =gSaveBlock1Ptr\n" + "\tadds r2, r6, 0\n" + "\tmovs r1, 0\n" + "_080EDEAC:\n" + "\tadds r0, r3, r2\n" + "\tstrb r1, [r0]\n" + "\tadds r0, r3, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r3, r0, 24\n" + "\tcmp r3, 0xF\n" + "\tbls _080EDEAC\n" + "\tmovs r3, 0\n" + "\tmovs r5, 0\n" + "_080EDEBE:\n" + "\tldr r0, [r7]\n" + "\tldr r1, =0x00001aae\n" + "\tadds r0, r1\n" + "\tadds r0, r3\n" + "\tldrb r4, [r0]\n" + "\tadds r3, 0x1\n" + "\tcmp r4, 0\n" + "\tbeq _080EDF0A\n" + "\tmovs r1, 0\n" + "\tldrb r0, [r6]\n" + "\tcmp r0, 0\n" + "\tbne _080EDEE8\n" + "\tstrb r4, [r6]\n" + "\tb _080EDF04\n" + "\t.pool\n" + "_080EDEE8:\n" + "\tadds r0, r1, r6\n" + "\tldrb r0, [r0]\n" + "\tcmp r0, r4\n" + "\tbeq _080EDF0A\n" + "\tadds r0, r1, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r1, r0, 24\n" + "\tcmp r1, 0xF\n" + "\tbhi _080EDF0A\n" + "\tadds r2, r1, r6\n" + "\tldrb r0, [r2]\n" + "\tcmp r0, 0\n" + "\tbne _080EDEE8\n" + "\tstrb r4, [r2]\n" + "_080EDF04:\n" + "\tadds r0, r5, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r5, r0, 24\n" + "_080EDF0A:\n" + "\tlsls r0, r3, 24\n" + "\tlsrs r3, r0, 24\n" + "\tcmp r3, 0xF\n" + "\tbls _080EDEBE\n" + "\tcmp r5, 0x4\n" + "\tbls _080EDF1E\n" + "\tmovs r0, 0x4\n" + "\tmov r1, r8\n" + "\tstrb r0, [r1, 0x3]\n" + "\tb _080EDF22\n" + "_080EDF1E:\n" + "\tmov r0, r8\n" + "\tstrb r5, [r0, 0x3]\n" + "_080EDF22:\n" + "\tmov r1, r8\n" + "\tldrb r0, [r1, 0x3]\n" + "\tcmp r0, 0\n" + "\tbeq _080EDFA4\n" + "\tcmp r0, 0x1\n" + "\tbne _080EDF34\n" + "\tldrb r0, [r6]\n" + "\tstrb r0, [r1, 0x4]\n" + "\tb _080EDFA4\n" + "_080EDF34:\n" + "\tmovs r6, 0\n" + "\tadds r7, r5, 0\n" + "\tmuls r7, r5\n" + "\tcmp r6, r7\n" + "\tbge _080EDF7E\n" + "\tldr r0, =sTV_DecorationsBuffer\n" + "\tmov r9, r0\n" + "_080EDF42:\n" + "\tbl Random\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tadds r1, r5, 0\n" + "\tbl __modsi3\n" + "\tlsls r0, 24\n" + "\tlsrs r4, r0, 24\n" + "\tbl Random\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tadds r1, r5, 0\n" + "\tbl __modsi3\n" + "\tlsls r0, 24\n" + "\tlsrs r1, r0, 24\n" + "\tmov r0, r9\n" + "\tadds r2, r4, r0\n" + "\tldrb r3, [r2]\n" + "\tadd r1, r9\n" + "\tldrb r0, [r1]\n" + "\tstrb r0, [r2]\n" + "\tstrb r3, [r1]\n" + "\tadds r0, r6, 0x1\n" + "\tlsls r0, 16\n" + "\tlsrs r6, r0, 16\n" + "\tcmp r6, r7\n" + "\tblt _080EDF42\n" + "_080EDF7E:\n" + "\tmovs r3, 0\n" + "\tmov r1, r8\n" + "\tldrb r1, [r1, 0x3]\n" + "\tcmp r3, r1\n" + "\tbcs _080EDFA4\n" + "\tmov r2, r8\n" + "\tadds r2, 0x4\n" + "\tldr r4, =sTV_DecorationsBuffer\n" + "_080EDF8E:\n" + "\tadds r1, r2, r3\n" + "\tadds r0, r3, r4\n" + "\tldrb r0, [r0]\n" + "\tstrb r0, [r1]\n" + "\tadds r0, r3, 0x1\n" + "\tlsls r0, 24\n" + "\tlsrs r3, r0, 24\n" + "\tmov r0, r8\n" + "\tldrb r0, [r0, 0x3]\n" + "\tcmp r3, r0\n" + "\tbcc _080EDF8E\n" + "_080EDFA4:\n" + "\tpop {r3,r4}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0\n" + "\t.pool"); +} +#endif + +void sub_80EDFB4(TVShow *show) +{ + u8 i; + u16 move; + u16 j; + u8 nMoves; + u8 nPokemon; + u16 sum; + + for (i = 0, nPokemon = 0; i < PARTY_SIZE; i ++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + { + sTV_SecretBaseVisitMonsTemp[nPokemon].level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + sTV_SecretBaseVisitMonsTemp[nPokemon].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); + nMoves = 0; + move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1); + if (move != MOVE_NONE) + { + sTV_SecretBaseVisitMovesTemp[nMoves] = move; + nMoves ++; + } + move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE2); + if (move != MOVE_NONE) + { + sTV_SecretBaseVisitMovesTemp[nMoves] = move; + nMoves ++; + } + move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE3); + if (move != MOVE_NONE) + { + sTV_SecretBaseVisitMovesTemp[nMoves] = move; + nMoves ++; + } + move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE4); + if (move != MOVE_NONE) + { + sTV_SecretBaseVisitMovesTemp[nMoves] = move; + nMoves ++; + } + sTV_SecretBaseVisitMonsTemp[nPokemon].move = sTV_SecretBaseVisitMovesTemp[Random() % nMoves]; + nPokemon ++; + } + } + for (i = 0, sum = 0; i < nPokemon; i ++) + { + sum += sTV_SecretBaseVisitMonsTemp[i].level; + } + show->secretBaseVisit.avgLevel = sum / nPokemon; + j = Random() % nPokemon; + show->secretBaseVisit.species = sTV_SecretBaseVisitMonsTemp[j].species; + show->secretBaseVisit.move = sTV_SecretBaseVisitMonsTemp[j].move; +} + +void sub_80EE104(void) +{ + TVShow *show; + + HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SECRET_BASE_VISIT, TRUE); + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->secretBaseVisit.kind = TVSHOW_SECRET_BASE_VISIT; + show->secretBaseVisit.active = FALSE; + StringCopy(show->secretBaseVisit.playerName, gSaveBlock2Ptr->playerName); + sub_80EDE98(show); + sub_80EDFB4(show); + tv_store_id_3x(show); + show->secretBaseVisit.language = gGameLanguage; + } +} + +void sub_80EE184(void) +{ + TVShow *show; + u8 i; + u16 balls; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_BREAKING_NEWS, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->breakingNews.kind = TVSHOW_BREAKING_NEWS; + show->breakingNews.active = FALSE; + balls = 0; + for (i = 0; i < 11; i ++) + { + balls += gBattleResults.catchAttempts[i]; + } + if (gBattleResults.usedMasterBall) + { + balls ++; + } + show->breakingNews.location = gMapHeader.regionMapSectionId; + StringCopy(show->breakingNews.playerName, gSaveBlock2Ptr->playerName); + show->breakingNews.poke1Species = gBattleResults.playerMon1Species; + switch (gBattleOutcome) + { + case BATTLE_LOST: + case BATTLE_DREW: + show->breakingNews.kind = TVSHOW_OFF_AIR; + return; + case BATTLE_CAUGHT: + show->breakingNews.outcome = 0; + break; + case BATTLE_WON: + show->breakingNews.outcome = 1; + break; + case BATTLE_RAN: + case BATTLE_PLAYER_TELEPORTED: + case BATTLE_SAFARI_OUT_OF_BALLS: + show->breakingNews.outcome = 2; + break; + case BATTLE_POKE_FLED: + case BATTLE_OPPONENT_TELEPORTED: + show->breakingNews.outcome = 3; + break; + } + show->breakingNews.lastOpponentSpecies = gBattleResults.lastOpponentSpecies; + switch (show->breakingNews.outcome) + { + case 0: + if (gBattleResults.usedMasterBall) + { + show->breakingNews.caughtMonBall = ITEM_MASTER_BALL; + } + else + { + show->breakingNews.caughtMonBall = gBattleResults.caughtMonBall; + } + show->breakingNews.balls = balls; + break; + case 1: + show->breakingNews.lastUsedMove = gBattleResults.lastUsedMovePlayer; + break; + case 2: + break; + case 3: + break; + } + tv_store_id_3x(show); + show->breakingNews.language = gGameLanguage; + } +} + +void sub_80EE2CC(void) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_LOTTO_WINNER, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->lottoWinner.kind = TVSHOW_LOTTO_WINNER; + show->lottoWinner.active = FALSE; + StringCopy(show->lottoWinner.playerName, gSaveBlock2Ptr->playerName); + show->lottoWinner.whichPrize = 4 - gSpecialVar_0x8004; + show->lottoWinner.item = gSpecialVar_0x8005; + tv_store_id_3x(show); + show->lottoWinner.language = gGameLanguage; + } +} + +void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove) +{ + TVShow *show; + u8 i; + u8 j; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_BATTLE_SEMINAR, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->battleSeminar.kind = TVSHOW_BATTLE_SEMINAR; + show->battleSeminar.active = FALSE; + StringCopy(show->battleSeminar.playerName, gSaveBlock2Ptr->playerName); + show->battleSeminar.foeSpecies = foeSpecies; + show->battleSeminar.species = species; + show->battleSeminar.move = movePtr[moveIdx]; + for (i = 0, j = 0; i < 4; i ++) + { + if (i != moveIdx && movePtr[i]) + { + show->battleSeminar.otherMoves[j] = movePtr[i]; + j ++; + } + } + show->battleSeminar.nOtherMoves = j; + show->battleSeminar.betterMove = betterMove; + tv_store_id_3x(show); + show->battleSeminar.language = gGameLanguage; + } +} + +void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SAFARI_FAN_CLUB, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->safariFanClub.kind = TVSHOW_SAFARI_FAN_CLUB; + show->safariFanClub.active = FALSE; + StringCopy(show->safariFanClub.playerName, gSaveBlock2Ptr->playerName); + show->safariFanClub.nMonsCaught = nMonsCaught; + show->safariFanClub.nPkblkUsed = nPkblkUsed; + tv_store_id_3x(show); + show->safariFanClub.language = gGameLanguage; + } +} + +void sub_80EE4DC(struct Pokemon *pokemon, u8 ribbonMonDataIdx) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_CUTIES, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->cuties.kind = TVSHOW_CUTIES; + show->cuties.active = FALSE; + StringCopy(show->cuties.playerName, gSaveBlock2Ptr->playerName); + GetMonData(pokemon, MON_DATA_NICKNAME, show->cuties.nickname); + StripExtCtrlCodes(show->cuties.nickname); + show->cuties.nRibbons = GetRibbonCount(pokemon); + show->cuties.selectedRibbon = TV_MonDataIdxToRibbon(ribbonMonDataIdx); + tv_store_id_3x(show); + show->cuties.language = gGameLanguage; + if (show->cuties.language == LANGUAGE_JAPANESE || GetMonData(pokemon, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE) + { + show->cuties.pokemonNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show->cuties.pokemonNameLanguage = GetMonData(pokemon, MON_DATA_LANGUAGE); + } + } +} + +u8 GetRibbonCount(struct Pokemon *pokemon) +{ + u8 nRibbons; + + nRibbons = 0; + nRibbons += GetMonData(pokemon, MON_DATA_COOL_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_BEAUTY_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_CUTE_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_SMART_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_TOUGH_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_CHAMPION_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_WINNING_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_VICTORY_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_ARTIST_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_EFFORT_RIBBON); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_1); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_2); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_3); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_4); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_5); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_6); + nRibbons += GetMonData(pokemon, MON_DATA_GIFT_RIBBON_7); + return nRibbons; +} + +u8 TV_MonDataIdxToRibbon(u8 monDataIdx) +{ + if (monDataIdx == MON_DATA_CHAMPION_RIBBON) return 0; + if (monDataIdx == MON_DATA_COOL_RIBBON) return 1; + if (monDataIdx == MON_DATA_BEAUTY_RIBBON) return 5; + if (monDataIdx == MON_DATA_CUTE_RIBBON) return 9; + if (monDataIdx == MON_DATA_SMART_RIBBON) return 13; + if (monDataIdx == MON_DATA_TOUGH_RIBBON) return 17; + if (monDataIdx == MON_DATA_WINNING_RIBBON) return 21; + if (monDataIdx == MON_DATA_VICTORY_RIBBON) return 22; + if (monDataIdx == MON_DATA_ARTIST_RIBBON) return 23; + if (monDataIdx == MON_DATA_EFFORT_RIBBON) return 24; + if (monDataIdx == MON_DATA_GIFT_RIBBON_1) return 25; + if (monDataIdx == MON_DATA_GIFT_RIBBON_2) return 26; + if (monDataIdx == MON_DATA_GIFT_RIBBON_3) return 27; + if (monDataIdx == MON_DATA_GIFT_RIBBON_4) return 28; + if (monDataIdx == MON_DATA_GIFT_RIBBON_5) return 29; + if (monDataIdx == MON_DATA_GIFT_RIBBON_6) return 30; + if (monDataIdx == MON_DATA_GIFT_RIBBON_7) return 31; + return 0; +} + +void sub_80EE72C(void) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_TRAINER_FAN_CLUB, FALSE) != TRUE) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->trainerFanClub.kind = TVSHOW_TRAINER_FAN_CLUB; + show->trainerFanClub.active = FALSE; + StringCopy(show->trainerFanClub.playerName, gSaveBlock2Ptr->playerName); + show->trainerFanClub.words[0] = gSaveBlock1Ptr->unk2BB0[0]; + show->trainerFanClub.words[1] = gSaveBlock1Ptr->unk2BB0[1]; + tv_store_id_3x(show); + show->trainerFanClub.language = gGameLanguage; + } +} + +bool8 sub_80EE7C0(void) +{ + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot == -1) + { + return TRUE; + } + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_SPECIAL); + if (gScriptResult == TRUE) + { + return TRUE; + } + if (gSaveBlock1Ptr->linkBattleRecords[0].name[0] == EOS) + { + return TRUE; + } + return FALSE; +} + +bool8 sub_80EE818(void) +{ + u32 playerId; + u8 showIdx; + TVShow *shows; + + if (HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_FRONTIER, FALSE) == TRUE) + { + shows = gSaveBlock1Ptr->tvShows; + playerId = GetPlayerIDAsU32(); + for (showIdx = 5; showIdx < 24; showIdx ++) + { + if (shows[showIdx].common.kind == TVSHOW_FRONTIER && (playerId & 0xFF) == shows[showIdx].common.trainerIdLo && ((playerId >> 8) & 0xFF) == shows[showIdx].common.trainerIdHi) + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, showIdx); + sub_80EF93C(gSaveBlock1Ptr->tvShows); + return TRUE; + } + } + } + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot == -1) + { + return FALSE; + } + return TRUE; +} + +void sub_80EE8C8(u16 winStreak, u8 facility) +{ + TVShow *show; + + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->frontier.kind = TVSHOW_FRONTIER; + show->frontier.active = FALSE; + StringCopy(show->frontier.playerName, gSaveBlock2Ptr->playerName); + show->frontier.winStreak = winStreak; + show->frontier.facility = facility; + switch (facility) + { + case 1: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + show->frontier.species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL); + show->frontier.species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL); + show->frontier.species3 = GetMonData(&gPlayerParty[2], MON_DATA_SPECIES, NULL); + break; + case 2: + show->frontier.species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL); + show->frontier.species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL); + show->frontier.species3 = GetMonData(&gPlayerParty[2], MON_DATA_SPECIES, NULL); + show->frontier.species4 = GetMonData(&gPlayerParty[3], MON_DATA_SPECIES, NULL); + break; + case 3: + show->frontier.species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL); + show->frontier.species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL); + break; + case 4: + show->frontier.species1 = GetMonData(&gSaveBlock1Ptr->playerParty[gSaveBlock2Ptr->field_CAA[0] - 1], MON_DATA_SPECIES, NULL); + show->frontier.species2 = GetMonData(&gSaveBlock1Ptr->playerParty[gSaveBlock2Ptr->field_CAA[1] - 1], MON_DATA_SPECIES, NULL); + break; + } + tv_store_id_3x(show); + show->frontier.language = gGameLanguage; + } +} + +void sub_80EEA70(void) +{ + TVShow *show; + u8 strbuf[32]; + + if (HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SECRET_BASE_SECRETS, FALSE) != TRUE) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->secretBaseSecrets.kind = TVSHOW_SECRET_BASE_SECRETS; + show->secretBaseSecrets.active = FALSE; + StringCopy(show->secretBaseSecrets.playerName, gSaveBlock2Ptr->playerName); + show->secretBaseSecrets.stepsInBase = VarGet(0x40ec); + sub_80E980C(); + StringCopy(strbuf, gStringVar1); + StripExtCtrlCodes(strbuf); + StringCopy(show->secretBaseSecrets.baseOwnersName, strbuf); + show->secretBaseSecrets.item = VarGet(0x40ed); + show->secretBaseSecrets.flags = VarGet(0x40ee) + (VarGet(0x40ef) << 16); + tv_store_id_3x(show); + show->secretBaseSecrets.language = gGameLanguage; + if (show->secretBaseSecrets.language == LANGUAGE_JAPANESE || gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].language == LANGUAGE_JAPANESE) + { + show->secretBaseSecrets.baseOwnersNameLanguage = LANGUAGE_JAPANESE; + } + else + { + show->secretBaseSecrets.baseOwnersNameLanguage = gSaveBlock1Ptr->secretBases[VarGet(VAR_0x4054)].language; + } + } + } +} + +void sub_80EEB98(u16 days) +{ + u8 i; + + for (i = 0; i < ARRAY_COUNT(sNumberOneVarsAndThresholds); i ++) + { + if (VarGet(sNumberOneVarsAndThresholds[i][0]) >= sNumberOneVarsAndThresholds[i][1]) + { + sub_80EEBF4(i); + break; + } + } + for (i = 0; i < ARRAY_COUNT(sNumberOneVarsAndThresholds); i ++) + { + VarSet(sNumberOneVarsAndThresholds[i][0], 0); + } +} + +void sub_80EEBF4(u8 actionIdx) +{ + TVShow *show; + + HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_NUMBER_ONE, TRUE); + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + if (sCurTVShowSlot != -1) + { + show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; + show->numberOne.kind = TVSHOW_NUMBER_ONE; + show->numberOne.active = FALSE; + StringCopy(show->numberOne.playerName, gSaveBlock2Ptr->playerName); + show->numberOne.actionIdx = actionIdx; + show->numberOne.count = VarGet(sNumberOneVarsAndThresholds[actionIdx][0]); + tv_store_id_3x(show); + show->numberOne.language = gGameLanguage; + } +} + +void sub_80EEC80(void) +{ + VarSet(VAR_DAILY_SLOTS, VarGet(VAR_DAILY_SLOTS) + 1); +} + +void sub_80EECA4(void) +{ + VarSet(VAR_DAILY_ROULETTE, VarGet(VAR_DAILY_ROULETTE) + 1); +} + +void sub_80EECC8(void) +{ + VarSet(VAR_DAILY_WILDS, VarGet(VAR_DAILY_WILDS) + 1); +} + +void sub_80EECEC(void) +{ + VarSet(VAR_DAILY_BLENDER, VarGet(VAR_DAILY_BLENDER) + 1); +} + +void sub_80EED10(void) +{ + VarSet(VAR_DAILY_PLANTED_BERRIES, VarGet(VAR_DAILY_PLANTED_BERRIES) + 1); +} + +void sub_80EED34(void) +{ + VarSet(VAR_DAILY_PICKED_BERRIES, VarGet(VAR_DAILY_PICKED_BERRIES) + gSpecialVar_0x8006); +} + +void sub_80EED60(u16 delta) +{ + VarSet(VAR_DAILY_BP, VarGet(VAR_DAILY_BP) + delta); +} + +// PokeNews + +void sub_80EED88(void) +{ + u8 newsKind; + + if (FlagGet(SYS_GAME_CLEAR)) + { + sCurTVShowSlot = sub_80EEE30(gSaveBlock1Ptr->pokeNews); + if (sCurTVShowSlot != -1 && rbernoulli(1, 100) != TRUE) + { + newsKind = (Random() % 4) + POKENEWS_SLATEPORT; + if (sub_80EF0E4(newsKind) != TRUE) + { + gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].kind = newsKind; + gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].days = 4; + gSaveBlock1Ptr->pokeNews[sCurTVShowSlot].state = TRUE; + } + } + } +} + +s8 sub_80EEE30(PokeNews *pokeNews) +{ + s8 i; + + for (i = 0; i < 16; i ++) + { + if (pokeNews[i].kind == 0) + { + return i; + } + } + return -1; +} + +void ClearPokemonNews(void) +{ + u8 i; + + for (i = 0; i < 16; i ++) + { + ClearPokemonNewsI(i); + } +} + +void ClearPokemonNewsI(u8 i) +{ + gSaveBlock1Ptr->pokeNews[i].kind = POKENEWS_NONE; + gSaveBlock1Ptr->pokeNews[i].state = FALSE; + gSaveBlock1Ptr->pokeNews[i].days = 0; +} + +void sub_80EEEB8(void) +{ + u8 i; + u8 j; + + for (i = 0; i < 15; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind == POKENEWS_NONE) + { + for (j = i + 1; j < 16; j ++) + { + if (gSaveBlock1Ptr->pokeNews[j].kind != POKENEWS_NONE) + { + gSaveBlock1Ptr->pokeNews[i] = gSaveBlock1Ptr->pokeNews[j]; + ClearPokemonNewsI(j); + break; + } + } + } + } +} + +u8 FindAnyTVNewsOnTheAir(void) +{ + u8 i; + + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind != POKENEWS_NONE && gSaveBlock1Ptr->pokeNews[i].state == TRUE && gSaveBlock1Ptr->pokeNews[i].days < 3) + { + return i; + } + } + return -1; +} + +void DoPokeNews(void) +{ + u8 i; + u16 n; + + i = FindAnyTVNewsOnTheAir(); + if (i == 0xFF) + { + gScriptResult = FALSE; + } + else + { + if (gSaveBlock1Ptr->pokeNews[i].days == 0) + { + gSaveBlock1Ptr->pokeNews[i].state = 2; + if (gLocalTime.hours < 20) + { + ShowFieldMessage(sPokeNewsTextGroup_Ongoing[gSaveBlock1Ptr->pokeNews[i].kind]); + } + else + { + ShowFieldMessage(sPokeNewsTextGroup_Ending[gSaveBlock1Ptr->pokeNews[i].kind]); + } + } + else + { + n = gSaveBlock1Ptr->pokeNews[i].days; + ConvertIntToDecimalStringN(gStringVar1, n, STR_CONV_MODE_LEFT_ALIGN, 1); + gSaveBlock1Ptr->pokeNews[i].state = 0; + ShowFieldMessage(sPokeNewsTextGroup_Upcoming[gSaveBlock1Ptr->pokeNews[i].kind]); + } + gScriptResult = TRUE; + } +} + +bool8 GetPriceReduction(u8 newsKind) +{ + u8 i; + + if (newsKind == 0) + { + return FALSE; + } + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind) + { + if (gSaveBlock1Ptr->pokeNews[i].state == 2 && IsPriceDiscounted(newsKind)) + { + return TRUE; + } + return FALSE; + } + } + return FALSE; +} + +bool8 IsPriceDiscounted(u8 newsKind) +{ + switch (newsKind) + { + case POKENEWS_SLATEPORT: + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1Ptr->location.mapNum == MAP_ID_SLATEPORT_CITY && gScriptLastTalked == 25) + { + return TRUE; + } + return FALSE; + case POKENEWS_LILYCOVE: + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP && gSaveBlock1Ptr->location.mapNum == MAP_ID_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) + { + return TRUE; + } + return FALSE; + } + return TRUE; +} + +bool8 sub_80EF0E4(u8 newsKind) +{ + u8 i; + if (newsKind == POKENEWS_NONE) + { + return TRUE; + } + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind) + { + return TRUE; + } + } + return FALSE; +} + +void sub_80EF120(u16 days) +{ + u8 i; + + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind != POKENEWS_NONE) + { + if (gSaveBlock1Ptr->pokeNews[i].days < days) + { + ClearPokemonNewsI(i); + } + else + { + if (gSaveBlock1Ptr->pokeNews[i].state == 0 && FlagGet(SYS_GAME_CLEAR) == TRUE) + { + gSaveBlock1Ptr->pokeNews[i].state = 1; + } + gSaveBlock1Ptr->pokeNews[i].days -= days; + } + } + } + sub_80EEEB8(); +} + +void CopyContestRankToStringVar(u8 varIdx, u8 rank) +{ + switch (rank) + { + case 0: // NORMAL + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[5]); + break; + case 1: // SUPER + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[6]); + break; + case 2: // HYPER + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[7]); + break; + case 3: // MASTER + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[8]); + break; + } +} + +void CopyContestCategoryToStringVar(u8 varIdx, u8 category) +{ + switch (category) + { + case 0: // COOL + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[0]); + break; + case 1: // BEAUTY + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[1]); + break; + case 2: // CUTE + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[2]); + break; + case 3: // SMART + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[3]); + break; + case 4: // TOUGH + StringCopy(gTVStringVarPtrs[varIdx], gUnknown_0858BAF0[4]); + break; + } +} + +void SetContestCategoryStringVarForInterview(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + CopyContestCategoryToStringVar(1, show->bravoTrainer.contestCategory); +} + +void TV_PrintIntToStringVar(u8 varIdx, int value) +{ + int nDigits; + + nDigits = sub_80EF370(value); + ConvertIntToDecimalStringN(gTVStringVarPtrs[varIdx], value, STR_CONV_MODE_LEFT_ALIGN, nDigits); +} + +int sub_80EF370(int value) +{ + if (value / 10 == 0) + { + return 1; + } + if (value / 100 == 0) + { + return 2; + } + if (value / 1000 == 0) + { + return 3; + } + if (value / 10000 == 0) + { + return 4; + } + if (value / 100000 == 0) + { + return 5; + } + if (value / 1000000 == 0) + { + return 6; + } + if (value / 10000000 == 0) + { + return 7; + } + if (value / 100000000 == 0) + { + return 8; + } + return 1; +} + +void sub_80EF40C(u8 varIdx, TVShow *show) +{ + u8 i; + int price; + + price = 0; + for (i = 0; i < 3; i ++) + { + if (show->smartshopperShow.itemIds[i] != ITEM_NONE) + { + price += itemid_get_market_price(show->smartshopperShow.itemIds[i]) * show->smartshopperShow.itemAmounts[i]; + } + } + if (show->smartshopperShow.priceReduced == TRUE) + { + TV_PrintIntToStringVar(varIdx, price >> 1); + } + else + { + TV_PrintIntToStringVar(varIdx, price); + } +} + +bool8 HasMixableShowAlreadyBeenSpawnedWithPlayerID(u8 kind, bool8 flag) +{ + u32 playerId; + TVShow *shows; + u8 i; + + shows = gSaveBlock1Ptr->tvShows; + playerId = GetPlayerIDAsU32(); + for (i = 5; i < 24; i ++) + { + if (shows[i].common.kind == kind && (playerId & 0xFF) == shows[i].common.trainerIdLo && ((playerId >> 8) & 0xFF) == shows[i].common.trainerIdHi) + { + if (flag == TRUE) + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, i); + sub_80EF93C(gSaveBlock1Ptr->tvShows); + } + return TRUE; + } + } + return FALSE; +} + +void TV_SortPurchasesByQuantity(void) +{ + u8 i; + u8 j; + u16 tmpId; + u16 tmpQn; + + for (i = 0; i < 2; i ++) + { + for (j = i + 1; j < 3; j ++) + { + if (gUnknown_02039F80[i].quantity < gUnknown_02039F80[j].quantity) + { + tmpId = gUnknown_02039F80[i].itemId; + tmpQn = gUnknown_02039F80[i].quantity; + gUnknown_02039F80[i].itemId = gUnknown_02039F80[j].itemId; + gUnknown_02039F80[i].quantity = gUnknown_02039F80[j].quantity; + gUnknown_02039F80[j].itemId = tmpId; + gUnknown_02039F80[j].quantity = tmpQn; + } + } + } +} + +void FindActiveBroadcastByShowType_SetScriptResult(u8 kind) +{ + u8 i; + for (i = 0; i < 5; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == kind) + { + if (gSaveBlock1Ptr->tvShows[i].common.active == TRUE) + { + gScriptResult = TRUE; + } + else + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, i); + sub_80EF93C(gSaveBlock1Ptr->tvShows); + sub_80EFA88(); + } + return; + } + } + sub_80EFA88(); +} + +void InterviewBefore(void) +{ + gScriptResult = FALSE; + switch (gSpecialVar_0x8005) + { + case TVSHOW_FAN_CLUB_LETTER: + InterviewBefore_FanClubLetter(); + break; + case TVSHOW_RECENT_HAPPENINGS: + InterviewBefore_RecentHappenings(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + InterviewBefore_PkmnFanClubOpinions(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + InterviewBefore_Dummy(); + break; + case TVSHOW_NAME_RATER_SHOW: + InterviewBefore_NameRater(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + InterviewBefore_BravoTrainerPkmnProfile(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + InterviewBefore_BravoTrainerBTProfile(); + break; + case TVSHOW_CONTEST_LIVE_UPDATES: + InterviewBefore_ContestLiveUpdates(); + break; + case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: + InterviewBefore_3CheersForPokeblocks(); + break; + case TVSHOW_FAN_CLUB_SPECIAL: + InterviewBefore_FanClubSpecial(); + break; + } +} + +void InterviewBefore_FanClubLetter(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_LETTER); + if (!gScriptResult) + { + StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_SPECIES, NULL)]); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words, 6); + } +} + +void InterviewBefore_RecentHappenings(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_RECENT_HAPPENINGS); + if (!gScriptResult) + { + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].recentHappenings.words, 6); + } +} + +void InterviewBefore_PkmnFanClubOpinions(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_PKMN_FAN_CLUB_OPINIONS); + if (!gScriptResult) + { + StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_SPECIES, NULL)]); + GetMonData(&gPlayerParty[GetIdxOfFirstPartyMemberThatIsNotAnEgg()], MON_DATA_NICKNAME, gStringVar2); + StringGetEnd10(gStringVar2); + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words, 2); + } +} + +void InterviewBefore_Dummy(void) +{ + gScriptResult = TRUE; +} + +void InterviewBefore_NameRater(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_NAME_RATER_SHOW); +} + +void InterviewBefore_BravoTrainerPkmnProfile(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE); + if (!gScriptResult) + { + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainer.words, 2); + } +} + +void InterviewBefore_ContestLiveUpdates(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_CONTEST_LIVE_UPDATES); +} + +void InterviewBefore_3CheersForPokeblocks(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_3_CHEERS_FOR_POKEBLOCKS); +} + +void InterviewBefore_BravoTrainerBTProfile(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE); + if (!gScriptResult) + { + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].bravoTrainerTower.words, 1); + } +} + +void InterviewBefore_FanClubSpecial(void) +{ + FindActiveBroadcastByShowType_SetScriptResult(TVSHOW_FAN_CLUB_SPECIAL); + if (!gScriptResult) + { + InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanClubSpecial.words, 1); + } +} + +bool8 sub_80EF88C(u8 monIdx) +{ + struct Pokemon *pokemon; + u8 language; + + pokemon = &gPlayerParty[monIdx]; + GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1); + language = GetMonData(pokemon, MON_DATA_LANGUAGE, &language); + if (language == LANGUAGE_ENGLISH && !StringCompare(gSpeciesNames[GetMonData(pokemon, MON_DATA_SPECIES, NULL)], gStringVar1)) + { + return FALSE; + } + return TRUE; +} + +bool8 sub_80EF8F8(void) +{ + return sub_80EF88C(GetIdxOfFirstPartyMemberThatIsNotAnEgg()); +} + +void DeleteTVShowInArrayByIdx(TVShow *shows, u8 idx) +{ + u8 i; + + shows[idx].common.kind = TVSHOW_OFF_AIR; + shows[idx].common.active = FALSE; + for (i = 0; i < 34; i ++) + { + shows[idx].common.pad02[i] = 0; + } +} + +void sub_80EF93C(TVShow *shows) +{ + u8 i; + u8 j; + + for (i = 0; i < 4; i ++) + { + if (shows[i].common.kind == TVSHOW_OFF_AIR) + { + for (j = i + 1; j < 5; j ++) + { + if (shows[j].common.kind != TVSHOW_OFF_AIR) + { + shows[i] = shows[j]; + DeleteTVShowInArrayByIdx(shows, j); + break; + } + } + } + } + for (i = 5; i < 24; i ++) + { + if (shows[i].common.kind == TVSHOW_OFF_AIR) + { + for (j = i + 1; j < 24; j ++) + { + if (shows[j].common.kind != TVSHOW_OFF_AIR) + { + shows[i] = shows[j]; + DeleteTVShowInArrayByIdx(shows, j); + break; + } + } + } + } +} + +u16 TV_GetSomeOtherSpeciesAlreadySeenByPlayer_AndPrintName(u8 varIdx, u16 passedSpecies) +{ + u16 species; + + species = TV_GetSomeOtherSpeciesAlreadySeenByPlayer(passedSpecies); + StringCopy(gTVStringVarPtrs[varIdx], gSpeciesNames[species]); + return species; +} + +u16 TV_GetSomeOtherSpeciesAlreadySeenByPlayer(u16 passedSpecies) +{ + u16 species; + u16 initSpecies; + + species = (Random() % (NUM_SPECIES - 1)) + 1; + initSpecies = species; + while (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), 0) != 1 || species == passedSpecies) + { + if (species == 1) + { + species = NUM_SPECIES - 1; + } + else + { + species --; + } + if (species == initSpecies) + { + species = passedSpecies; + return species; + } + }; + return species; +} + +void sub_80EFA88(void) +{ + sCurTVShowSlot = FindEmptyTVSlotWithinFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows); + gSpecialVar_0x8006 = sCurTVShowSlot; + if (sCurTVShowSlot == -1) + { + gScriptResult = TRUE; + } + else + { + gScriptResult = FALSE; + } +} + +s8 FindEmptyTVSlotWithinFirstFiveShowsOfArray(TVShow *shows) +{ + u8 i; + + for (i = 0; i < 5; i ++) + { + if (shows[i].common.kind == TVSHOW_OFF_AIR) + { + return i; + } + } + return -1; +} + +s8 FindEmptyTVSlotBeyondFirstFiveShowsOfArray(TVShow *shows) +{ + s8 i; + + for (i = 5; i < 24; i ++) + { + if (shows[i].common.kind == TVSHOW_OFF_AIR) + { + return i; + } + } + return -1; +} + +bool8 TV_BernoulliTrial(u16 ratio) +{ + if (Random() <= ratio) + { + return FALSE; + } + return TRUE; +} + +void TV_FanClubLetter_RandomWordToStringVar3(TVShow *show) +{ + u8 i; + + i = Random() % 6; + while (TRUE) + { + if (i == 6) + { + i = 0; + } + if (show->fanclubLetter.words[i] != 0xFFFF) + { + break; + } + i ++; + } + CopyEasyChatWord(gStringVar3, show->fanclubLetter.words[i]); +} + +u8 TV_GetNicknameSumMod8(TVShow *show) +{ + u8 i; + u16 ct; + + ct = 0; + for (i = 0; i < 11; i ++) + { + if (show->nameRaterShow.pokemonName[i] == EOS) + { + break; + } + ct += show->nameRaterShow.pokemonName[i]; + } + return ct & 7; +} + +void TV_GetNicknameSubstring(u8 varIdx, u8 whichPosition, u8 charParam, u16 whichString, u16 species, TVShow *show) +{ + u8 buff[16]; + u8 i; + u16 strlen; + + for (i = 0; i < 3; i ++) + { + buff[i] = EOS; + } + if (whichString == 0) + { + strlen = StringLength(show->nameRaterShow.trainerName); + if (charParam == 0) + { + buff[0] = show->nameRaterShow.trainerName[whichPosition]; + } + else if (charParam == 1) + { + buff[0] = show->nameRaterShow.trainerName[strlen - whichPosition]; + } + else if (charParam == 2) + { + buff[0] = show->nameRaterShow.trainerName[whichPosition]; + buff[1] = show->nameRaterShow.trainerName[whichPosition + 1]; + } + else + { + buff[0] = show->nameRaterShow.trainerName[strlen - (whichPosition + 2)]; + buff[1] = show->nameRaterShow.trainerName[strlen - (whichPosition + 1)]; + } + ConvertInternationalString(buff, show->nameRaterShow.language); + } + else if (whichString == 1) + { + strlen = StringLength(show->nameRaterShow.pokemonName); + if (charParam == 0) + { + buff[0] = show->nameRaterShow.pokemonName[whichPosition]; + } + else if (charParam == 1) + { + buff[0] = show->nameRaterShow.pokemonName[strlen - whichPosition]; + } + else if (charParam == 2) + { + buff[0] = show->nameRaterShow.pokemonName[whichPosition]; + buff[1] = show->nameRaterShow.pokemonName[whichPosition + 1]; + } + else + { + buff[0] = show->nameRaterShow.pokemonName[strlen - (whichPosition + 2)]; + buff[1] = show->nameRaterShow.pokemonName[strlen - (whichPosition + 1)]; + } + ConvertInternationalString(buff, show->nameRaterShow.pokemonNameLanguage); + } + else + { + strlen = StringLength(gSpeciesNames[species]); + if (charParam == 0) + { + buff[0] = gSpeciesNames[species][whichPosition]; + } + else if (charParam == 1) + { + buff[0] = gSpeciesNames[species][strlen - whichPosition]; + } + else if (charParam == 2) + { + buff[0] = gSpeciesNames[species][whichPosition]; + buff[1] = gSpeciesNames[species][whichPosition + 1]; + } + else + { + buff[0] = gSpeciesNames[species][strlen - (whichPosition + 2)]; + buff[1] = gSpeciesNames[species][strlen - (whichPosition + 1)]; + } + } + StringCopy(gTVStringVarPtrs[varIdx], buff); +} + +bool8 TV_IsScriptShowKindAlreadyInQueue(void) +{ + u8 i; + + for (i = 0; i < 5; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == gSpecialVar_0x8004) + { + return TRUE; + } + } + return FALSE; +} + +bool8 TV_PutNameRaterShowOnTheAirIfNicnkameChanged(void) +{ + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); + if (!StringCompare(gStringVar3, gStringVar1)) + { + return FALSE; + } + PutNameRaterShowOnTheAir(); + return TRUE; +} + +void ChangePokemonNickname(void) +{ + void ChangePokemonNickname_CB(void); + + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3); + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2); + DoNamingScreen(3, gStringVar2, GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_SPECIES, NULL), GetMonGender(&gPlayerParty[gSpecialVar_0x8004]), GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_PERSONALITY, NULL), ChangePokemonNickname_CB); +} + +void ChangePokemonNickname_CB(void) +{ + SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2); + c2_exit_to_overworld_1_continue_scripts_restart_music(); +} + +void ChangeBoxPokemonNickname(void) +{ + struct BoxPokemon *boxMon; + + boxMon = GetBoxedMonPtr(gSpecialVar_0x8012, gSpecialVar_0x8013); + GetBoxMonData(boxMon, MON_DATA_NICKNAME, gStringVar3); + GetBoxMonData(boxMon, MON_DATA_NICKNAME, gStringVar2); + DoNamingScreen(3, gStringVar2, GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL), GetBoxMonGender(boxMon), GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL), ChangeBoxPokemonNickname_CB); +} + +void ChangeBoxPokemonNickname_CB(void) +{ + SetBoxMonNickFromAnyBox(gSpecialVar_0x8012, gSpecialVar_0x8013, gStringVar2); + c2_exit_to_overworld_1_continue_scripts_restart_music(); +} + +void TV_CopyNicknameToStringVar1AndEnsureTerminated(void) +{ + GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); + StringGetEnd10(gStringVar1); +} + +void TV_CheckMonOTIDEqualsPlayerID(void) +{ + if (GetPlayerIDAsU32() == GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_OT_ID, NULL)) + { + gScriptResult = FALSE; + } + else + { + gScriptResult = TRUE; + } +} + +u8 GetTVChannelByShowType(u8 kind) +{ + if (kind == TVSHOW_OFF_AIR) + { + return 0; + } + if (kind >= TVSHOW_FAN_CLUB_LETTER && kind < TVSHOW_POKEMON_TODAY_CAUGHT) + { + return 2; + } + if (kind >= TVSHOW_POKEMON_TODAY_CAUGHT && kind < TVSHOW_MASS_OUTBREAK) + { + return 3; + } + if (kind >= TVSHOW_MASS_OUTBREAK && kind < 61) + { + return 4; + } + return 0; +} + +u32 GetPlayerIDAsU32(void) +{ + return (gSaveBlock2Ptr->playerTrainerId[3] << 24) | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[1] << 8) | gSaveBlock2Ptr->playerTrainerId[0]; +} + +u8 CheckForBigMovieOrEmergencyNewsOnTV(void) +{ + if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F) + { + return 0; + } + if (gSaveBlock2Ptr->playerGender == MALE) + { + if (gSaveBlock1Ptr->location.mapNum != MAP_ID_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F) + { + return 0; + } + } + else + { + if (gSaveBlock1Ptr->location.mapNum != MAP_ID_LITTLEROOT_TOWN_MAYS_HOUSE_1F) + { + return 0; + } + } + if (FlagGet(SYS_TV_LATI) == TRUE) + { + return 1; + } + if (FlagGet(SYS_TV_HOME) == TRUE) + { + return 2; + } + return 1; +} + +void GetMomOrDadStringForTVMessage(void) +{ + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F) + { + if (gSaveBlock2Ptr->playerGender == MALE) + { + if (gSaveBlock1Ptr->location.mapNum == MAP_ID_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F) + { + StringCopy(gStringVar1, gText_Mom); + VarSet(VAR_0x4003, 1); + } + } + else + { + if (gSaveBlock1Ptr->location.mapNum == MAP_ID_LITTLEROOT_TOWN_MAYS_HOUSE_1F) + { + StringCopy(gStringVar1, gText_Mom); + VarSet(VAR_0x4003, 1); + } + } + } + if (VarGet(VAR_0x4003) == 1) + { + StringCopy(gStringVar1, gText_Mom); + } + else if (VarGet(VAR_0x4003) == 2) + { + StringCopy(gStringVar1, gText_Dad); + } + else if (VarGet(VAR_0x4003) > 2) + { + if (VarGet(VAR_0x4003) % 2 == 0) + StringCopy(gStringVar1, gText_Mom); + else + StringCopy(gStringVar1, gText_Dad); + } + else + { + if (Random() % 2 != 0) + { + StringCopy(gStringVar1, gText_Mom); + VarSet(VAR_0x4003, 1); + } + else + { + StringCopy(gStringVar1, gText_Dad); + VarSet(VAR_0x4003, 2); + } + } +} + +void sub_80F01B8(void) +{ + VarSet(VAR_0x40BC, 0); + RemoveFieldObjectByLocalIdAndMap(5, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup); + FlagSet(0x396); +} + +void sub_80F01E8(void *src, u32 size, u8 masterIdx) +{ + u8 i; + u16 version; + TVShow (*rmBuffer2)[4][25]; + TVShow (*rmBuffer)[4][25]; + + rmBuffer2 = malloc(4 * 25 * sizeof(TVShow)); + if (rmBuffer2 != NULL) + { + for (i = 0; i < 4; i ++) + { + memcpy((*rmBuffer2)[i], src + i * size, sizeof((*rmBuffer2)[i])); + } + rmBuffer = rmBuffer2; + for (i = 0; i < GetLinkPlayerCount(); i ++) + { + version = (u8)gLinkPlayers[i].version; + if (version == VERSION_RUBY || version == VERSION_SAPPHIRE) + { + sub_80F1254((*rmBuffer)[i]); + } + else if (version == VERSION_EMERALD && gLinkPlayers[i].language == LANGUAGE_JAPANESE) + { + sub_80F12A4((*rmBuffer)[i]); + } + } + switch (masterIdx) + { + case 0: + sub_80F0358(gSaveBlock1Ptr->tvShows, (*rmBuffer)[1], (*rmBuffer)[2], (*rmBuffer)[3]); + break; + case 1: + sub_80F0358((*rmBuffer)[0], gSaveBlock1Ptr->tvShows, (*rmBuffer)[2], (*rmBuffer)[3]); + break; + case 2: + sub_80F0358((*rmBuffer)[0], (*rmBuffer)[1], gSaveBlock1Ptr->tvShows, (*rmBuffer)[3]); + break; + case 3: + sub_80F0358((*rmBuffer)[0], (*rmBuffer)[1], (*rmBuffer)[2], gSaveBlock1Ptr->tvShows); + break; + } + sub_80EF93C(gSaveBlock1Ptr->tvShows); + sub_80F0C04(); + sub_80EF93C(gSaveBlock1Ptr->tvShows); + sub_80F0708(); + sub_80F0B64(); + free(rmBuffer2); + } +} + +void sub_80F0358(TVShow player1[25], TVShow player2[25], TVShow player3[25], TVShow player4[25]) +{ + u8 i; + u8 j; + TVShow **argslist[4]; + + argslist[0] = &player1; + argslist[1] = &player2; + argslist[2] = &player3; + argslist[3] = &player4; + sTVShowMixingNumPlayers = GetLinkPlayerCount(); + while (1) + { + for (i = 0; i < sTVShowMixingNumPlayers; i ++) + { + if (i == 0) + { + sRecordMixingPartnersWithoutShowsToShare = i; + } + sTVShowMixingCurSlot = sub_80F06D0(argslist[i][0]); + if (sTVShowMixingCurSlot == -1) + { + sRecordMixingPartnersWithoutShowsToShare ++; + if (sRecordMixingPartnersWithoutShowsToShare == sTVShowMixingNumPlayers) + { + return; + } + } + else + { + for (j = 0; j < sTVShowMixingNumPlayers - 1; j ++) + { + sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(argslist[(i + j + 1) % sTVShowMixingNumPlayers][0]); + if (sCurTVShowSlot != -1 + && sub_80F049C(&argslist[(i + j + 1) % sTVShowMixingNumPlayers][0], &argslist[i][0], (i + j + 1) % sTVShowMixingNumPlayers) == 1) + { + break; + } + } + if (j == sTVShowMixingNumPlayers - 1) + { + DeleteTVShowInArrayByIdx(argslist[i][0], sTVShowMixingCurSlot); + } + } + } + } +} + +bool8 sub_80F049C(TVShow *dest[25], TVShow *src[25], u8 idx) +{ + u8 value; + u8 switchval; + TVShow *tv1; + TVShow *tv2; + + tv1 = *dest; + tv2 = *src; + value = FALSE; + switchval = GetTVChannelByShowType(tv2[sTVShowMixingCurSlot].common.kind); + switch (switchval) + { + case 2: + value = sub_80F0580(&tv1[sCurTVShowSlot], &tv2[sTVShowMixingCurSlot], idx); + break; + case 3: + value = sub_80F05E8(&tv1[sCurTVShowSlot], &tv2[sTVShowMixingCurSlot], idx); + break; + case 4: + value = sub_80F0668(&tv1[sCurTVShowSlot], &tv2[sTVShowMixingCurSlot], idx); + break; + } + if (value == TRUE) + { + DeleteTVShowInArrayByIdx(tv2, sTVShowMixingCurSlot); + return TRUE; + } + return FALSE; +} + +u8 sub_80F0580(TVShow *tv1, TVShow *tv2, u8 idx) +{ + u32 linkTrainerId = GetLinkPlayerTrainerId(idx); + + if ((linkTrainerId & 0xFF) == tv2->common.trainerIdLo && ((linkTrainerId >> 8) & 0xFF) == tv2->common.trainerIdHi) + { + return FALSE; + } + tv2->common.trainerIdLo = tv2->common.srcTrainerIdLo; + tv2->common.trainerIdHi = tv2->common.srcTrainerIdHi; + tv2->common.srcTrainerIdLo = linkTrainerId & 0xFF; + tv2->common.srcTrainerIdHi = linkTrainerId >> 8; + *tv1 = *tv2; + tv1->common.active = TRUE; + return TRUE; +} + +u8 sub_80F05E8(TVShow *tv1, TVShow *tv2, u8 idx) +{ + u32 linkTrainerId = GetLinkPlayerTrainerId(idx); + if ((linkTrainerId & 0xFF) == tv2->common.srcTrainerIdLo && ((linkTrainerId >> 8) & 0xFF) == tv2->common.srcTrainerIdHi) + { + return FALSE; + } + if ((linkTrainerId & 0xFF) == tv2->common.trainerIdLo && ((linkTrainerId >> 8) & 0xFF) == tv2->common.trainerIdHi) + { + return FALSE; + } + tv2->common.srcTrainerIdLo = tv2->common.srcTrainerId2Lo; + tv2->common.srcTrainerIdHi = tv2->common.srcTrainerId2Hi; + tv2->common.srcTrainerId2Lo = linkTrainerId & 0xFF; + tv2->common.srcTrainerId2Hi = linkTrainerId >> 8; + *tv1 = *tv2; + tv1->common.active = TRUE; + return TRUE; +} + +u8 sub_80F0668(TVShow *tv1, TVShow *tv2, u8 idx) +{ + u32 linkTrainerId = GetLinkPlayerTrainerId(idx); + if ((linkTrainerId & 0xFF) == tv2->common.trainerIdLo && ((linkTrainerId >> 8) & 0xFF) == tv2->common.trainerIdHi) + { + return FALSE; + } + tv2->common.trainerIdLo = tv2->common.srcTrainerIdLo; + tv2->common.trainerIdHi = tv2->common.srcTrainerIdHi; + tv2->common.srcTrainerIdLo = linkTrainerId & 0xFF; + tv2->common.srcTrainerIdHi = linkTrainerId >> 8; + *tv1 = *tv2; + tv1->common.active = TRUE; + tv1->massOutbreak.daysLeft = 1; + return TRUE; +} + +s8 sub_80F06D0(TVShow *tvShows) +{ + u8 i; + + for (i = 0; i < 24; i ++) + { + if (tvShows[i].common.active == FALSE && (u8)(tvShows[i].common.kind - 1) < 60) + { + return i; + } + } + return -1; +} + +#ifdef NONMATCHING +void sub_80F0708(void) // FIXME: register allocation shenanigans +{ + u16 i; + TVShow *show; + + for (i = 0; i < 24; i ++) + { + switch (gSaveBlock1Ptr->tvShows[i].common.kind) + { + case TVSHOW_CONTEST_LIVE_UPDATES: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->contestLiveUpdates.winningSpecies, i); + break; + case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: + break; + case TVSHOW_BATTLE_UPDATE: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->battleUpdate.species2, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->battleUpdate.species, i); + break; + case TVSHOW_FAN_CLUB_SPECIAL: + break; + case TVSHOW_CONTEST_LIVE_UPDATES_2: + break; + + case TVSHOW_OFF_AIR: + break; + case TVSHOW_FAN_CLUB_LETTER: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->fanclubLetter.species, i); + break; + case TVSHOW_RECENT_HAPPENINGS: + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->fanclubOpinions.species, i); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->unkShow04.var06, i); + break; + case TVSHOW_NAME_RATER_SHOW: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->nameRaterShow.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->nameRaterShow.randomSpecies, i); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->bravoTrainer.species, i); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->bravoTrainerTower.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->bravoTrainerTower.defeatedSpecies, i); + break; + + case TVSHOW_POKEMON_TODAY_CAUGHT: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->pokemonToday.species, i); + break; + case TVSHOW_SMART_SHOPPER: + break; + case TVSHOW_POKEMON_TODAY_FAILED: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->pokemonTodayFailed.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->pokemonTodayFailed.species2, i); + break; + case TVSHOW_FISHING_ADVICE: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->pokemonAngler.species, i); + break; + case TVSHOW_WORLD_OF_MASTERS: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->worldOfMasters.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->worldOfMasters.caughtPoke, i); + break; + + case TVSHOW_TODAYS_RIVAL_TRAINER: + break; + case TVSHOW_TREND_WATCHER: + break; + case TVSHOW_TREASURE_INVESTIGATORS: + break; + case TVSHOW_FIND_THAT_GAMER: + break; + case TVSHOW_BREAKING_NEWS: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->breakingNews.lastOpponentSpecies, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->breakingNews.poke1Species, i); + break; + case TVSHOW_SECRET_BASE_VISIT: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->secretBaseVisit.species, i); + break; + case TVSHOW_LOTTO_WINNER: + break; + case TVSHOW_BATTLE_SEMINAR: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->battleSeminar.species, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->battleSeminar.foeSpecies, i); + break; + case TVSHOW_TRAINER_FAN_CLUB: + break; + case TVSHOW_CUTIES: + break; + case TVSHOW_FRONTIER: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->frontier.species1, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->frontier.species2, i); + switch ((&gSaveBlock1Ptr->tvShows[i])->frontier.facility) + { + case 3: + case 4: + break; + case 1: + case 5 ... 13: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->frontier.species3, i); + break; + case 2: + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->frontier.species3, i); + sub_80F0B24((&gSaveBlock1Ptr->tvShows[i])->frontier.species4, i); + break; + } + break; + case TVSHOW_NUMBER_ONE: + break; + case TVSHOW_SECRET_BASE_SECRETS: + break; + case TVSHOW_SAFARI_FAN_CLUB: + break; + + case TVSHOW_MASS_OUTBREAK: + break; + + default: + sub_80F0B00(i); + break; + } + } +} +#else +__attribute__((naked)) void sub_80F0708(void) +{ + asm_unified("\tpush {r4-r7,lr}\n" + "\tmov r7, r9\n" + "\tmov r6, r8\n" + "\tpush {r6,r7}\n" + "\tsub sp, 0x8\n" + "\tmovs r0, 0\n" + "\tmov r9, r0\n" + "_080F0716:\n" + "\tldr r3, =gSaveBlock1Ptr\n" + "\tldr r1, [r3]\n" + "\tmov r4, r9\n" + "\tlsls r2, r4, 3\n" + "\tadds r0, r2, r4\n" + "\tlsls r0, 2\n" + "\tadds r1, r0\n" + "\tldr r0, =0x000027cc\n" + "\tadds r1, r0\n" + "\tldrb r0, [r1]\n" + "\tadds r7, r2, 0\n" + "\tcmp r0, 0x29\n" + "\tbls _080F0732\n" + "\tb _080F0AD8\n" + "_080F0732:\n" + "\tlsls r0, 2\n" + "\tldr r1, =_080F0748\n" + "\tadds r0, r1\n" + "\tldr r0, [r0]\n" + "\tmov pc, r0\n" + "\t.pool\n" + "\t.align 2, 0\n" + "_080F0748:\n" + "\t.4byte _080F0AE2_break @ TVSHOW_OFF_AIR\n" + "\t.4byte _080F0848 @ TVSHOW_FAN_CLUB_LETTER\n" + "\t.4byte _080F0AE2_break @ TVSHOW_RECENT_HAPPENINGS\n" + "\t.4byte _080F0860 @ TVSHOW_PKMN_FAN_CLUB_OPINIONS\n" + "\t.4byte _080F0878 @ TVSHOW_UNKN_SHOWTYPE_04\n" + "\t.4byte _080F0890 @ TVSHOW_NAME_RATER_SHOW\n" + "\t.4byte _080F08BC @ TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE\n" + "\t.4byte _080F08D4 @ TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE\n" + "\t.4byte _080F07F0 @ TVSHOW_CONTEST_LIVE_UPDATES\n" + "\t.4byte _080F0AE2_break @ TVSHOW_3_CHEERS_FOR_POKEBLOCKS\n" + "\t.4byte _080F081C @ TVSHOW_BATTLE_UPDATE\n" + "\t.4byte _080F0AE2_break @ TVSHOW_FAN_CLUB_SPECIAL\n" + "\t.4byte _080F0AE2_break @ TVSHOW_CONTEST_LIVE_UPDATES_2\n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0900 @ TVSHOW_POKEMON_TODAY_CAUGHT\n" + "\t.4byte _080F0AE2_break @ TVSHOW_SMART_SHOPPER\n" + "\t.4byte _080F0918 @ TVSHOW_POKEMON_TODAY_FAILED\n" + "\t.4byte _080F0944 @ TVSHOW_FISHING_ADVICE\n" + "\t.4byte _080F095C @ TVSHOW_WORLD_OF_MASTERS\n" + "\t.4byte _080F0AE2_break @ TVSHOW_TODAYS_RIVAL_TRAINER\n" + "\t.4byte _080F0AE2_break @ TVSHOW_TREND_WATCHER\n" + "\t.4byte _080F0AE2_break @ TVSHOW_TREASURE_INVESTIGATORS\n" + "\t.4byte _080F0AE2_break @ TVSHOW_FIND_THAT_GAMER\n" + "\t.4byte _080F0974 @ TVSHOW_BREAKING_NEWS\n" + "\t.4byte _080F09A0 @ TVSHOW_SECRET_BASE_VISIT\n" + "\t.4byte _080F0AE2_break @ TVSHOW_LOTTO_WINNER\n" + "\t.4byte _080F09C0 @ TVSHOW_BATTLE_SEMINAR\n" + "\t.4byte _080F0AE2_break @ TVSHOW_TRAINER_FAN_CLUB\n" + "\t.4byte _080F0AE2_break @ TVSHOW_CUTIES\n" + "\t.4byte _080F09F4 @ TVSHOW_FRONTIER\n" + "\t.4byte _080F0AE2_break @ TVSHOW_NUMBER_ONE\n" + "\t.4byte _080F0AE2_break @ TVSHOW_SECRET_BASE_SECRETS\n" + "\t.4byte _080F0AE2_break @ TVSHOW_SAFARI_FAN_CLUB\n" + "\t.4byte _080F0AD8 @ \n" + "\t.4byte _080F0AE2_break @ TVSHOW_MASS_OUTBREAK\n" + "_080F07F0:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x12]\n" + "\tlsls r5, r1, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0x2]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F081C:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r4, r7, r2\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x16]\n" + "\tlsls r5, r2, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0x2]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F0848:\n" + "\tldr r0, [r3]\n" + "\tmov r4, r9\n" + "\tadds r1, r7, r4\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r0, =0x000027cc\n" + "\tadds r1, r0\n" + "\tldrh r0, [r1, 0x2]\n" + "\tb _080F09B0\n" + "\t.pool\n" + "_080F0860:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r1, r7, r2\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r4, =0x000027cc\n" + "\tadds r1, r4\n" + "\tldrh r0, [r1, 0x2]\n" + "\tlsls r1, r2, 24\n" + "\tb _080F09B2\n" + "\t.pool\n" + "_080F0878:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r1, r7, r2\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r4, =0x000027cc\n" + "\tadds r1, r4\n" + "\tldrh r0, [r1, 0x6]\n" + "\tlsls r1, r2, 24\n" + "\tb _080F09B2\n" + "\t.pool\n" + "_080F0890:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x2]\n" + "\tlsls r5, r1, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0x1C]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F08BC:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r1, r7, r2\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r4, =0x000027cc\n" + "\tadds r1, r4\n" + "\tldrh r0, [r1, 0x2]\n" + "\tlsls r1, r2, 24\n" + "\tb _080F09B2\n" + "\t.pool\n" + "_080F08D4:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0xA]\n" + "\tlsls r5, r1, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0x14]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F0900:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r1, r7, r2\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r4, =0x000027cc\n" + "\tadds r1, r4\n" + "\tldrh r0, [r1, 0x10]\n" + "\tlsls r1, r2, 24\n" + "\tb _080F09B2\n" + "\t.pool\n" + "_080F0918:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0xC]\n" + "\tlsls r5, r1, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0xE]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F0944:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r1, r7, r2\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r4, =0x000027cc\n" + "\tadds r1, r4\n" + "\tldrh r0, [r1, 0x4]\n" + "\tlsls r1, r2, 24\n" + "\tb _080F09B2\n" + "\t.pool\n" + "_080F095C:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x8]\n" + "\tb _080F09D0\n" + "\t.pool\n" + "_080F0974:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r4, r7, r2\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x2]\n" + "\tlsls r5, r2, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0xA]\n" + "\tb _080F09E6\n" + "\t.pool\n" + "_080F09A0:\n" + "\tldr r0, [r3]\n" + "\tmov r4, r9\n" + "\tadds r1, r7, r4\n" + "\tlsls r1, 2\n" + "\tadds r1, r0\n" + "\tldr r0, =0x000027cc\n" + "\tadds r1, r0\n" + "\tldrh r0, [r1, 0x8]\n" + "_080F09B0:\n" + "\tlsls r1, r4, 24\n" + "_080F09B2:\n" + "\tlsrs r1, 24\n" + "\tbl sub_80F0B24\n" + "\tb _080F0AE2_break\n" + "\t.pool\n" + "_080F09C0:\n" + "\tldr r0, [r3]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r6, =0x000027cc\n" + "\tadds r0, r6\n" + "\tldrh r0, [r0, 0x6]\n" + "_080F09D0:\n" + "\tlsls r5, r1, 24\n" + "\tlsrs r5, 24\n" + "\tadds r1, r5, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r6\n" + "\tldrh r0, [r4, 0x4]\n" + "_080F09E6:\n" + "\tadds r1, r5, 0\n" + "\tbl sub_80F0B24\n" + "\tb _080F0AE2_break\n" + "\t.pool\n" + "_080F09F4:\n" + "\tldr r0, [r3]\n" + "\tmov r2, r9\n" + "\tadds r4, r7, r2\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r5, =0x000027cc\n" + "\tadds r0, r5\n" + "\tldrh r0, [r0, 0x4]\n" + "\tlsls r2, 24\n" + "\tmov r8, r2\n" + "\tlsrs r6, r2, 24\n" + "\tadds r1, r6, 0\n" + "\tstr r3, [sp, 0x4]\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r0, r4, r0\n" + "\tadds r0, r5\n" + "\tldrh r0, [r0, 0x6]\n" + "\tadds r1, r6, 0\n" + "\tbl sub_80F0B24\n" + "\tldr r3, [sp, 0x4]\n" + "\tldr r0, [r3]\n" + "\tadds r4, r0\n" + "\tadds r4, r5\n" + "\tldrb r0, [r4, 0xD]\n" + "\tsubs r0, 0x1\n" + "\tmov r6, r8\n" + "\tcmp r0, 0xC\n" + "\tbhi _080F0AE2_break\n" + "\tlsls r0, 2\n" + "\tldr r1, =_080F0A48\n" + "\tadds r0, r1\n" + "\tldr r0, [r0]\n" + "\tmov pc, r0\n" + "\t.pool\n" + "\t.align 2, 0\n" + "_080F0A48:\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0AA0\n" + "\t.4byte _080F0AE2_break\n" + "\t.4byte _080F0AE2_break\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "\t.4byte _080F0A7C\n" + "_080F0A7C:\n" + "\tldr r0, =gSaveBlock1Ptr\n" + "\tldr r1, [r0]\n" + "\tmov r4, r9\n" + "\tadds r0, r7, r4\n" + "\tlsls r0, 2\n" + "\tadds r0, r1\n" + "\tldr r1, =0x000027cc\n" + "\tadds r0, r1\n" + "\tldrh r0, [r0, 0x8]\n" + "\tlsrs r1, r6, 24\n" + "\tbl sub_80F0B24\n" + "\tb _080F0AE2_break\n" + "\t.pool\n" + "_080F0AA0:\n" + "\tldr r2, =gSaveBlock1Ptr\n" + "\tldr r0, [r2]\n" + "\tmov r1, r9\n" + "\tadds r4, r7, r1\n" + "\tlsls r4, 2\n" + "\tadds r0, r4, r0\n" + "\tldr r5, =0x000027cc\n" + "\tadds r0, r5\n" + "\tldrh r0, [r0, 0x8]\n" + "\tlsrs r6, 24\n" + "\tadds r1, r6, 0\n" + "\tstr r2, [sp]\n" + "\tbl sub_80F0B24\n" + "\tldr r2, [sp]\n" + "\tldr r0, [r2]\n" + "\tadds r4, r0\n" + "\tadds r4, r5\n" + "\tldrh r0, [r4, 0xA]\n" + "\tadds r1, r6, 0\n" + "\tbl sub_80F0B24\n" + "\tb _080F0AE2_break\n" + "\t.pool\n" + "_080F0AD8:\n" + "\tmov r2, r9\n" + "\tlsls r0, r2, 24\n" + "\tlsrs r0, 24\n" + "\tbl sub_80F0B00\n" + "_080F0AE2_break:\n" + "\tmov r0, r9\n" + "\tadds r0, 0x1\n" + "\tlsls r0, 16\n" + "\tlsrs r0, 16\n" + "\tmov r9, r0\n" + "\tcmp r0, 0x17\n" + "\tbhi _080F0AF2\n" + "\tb _080F0716\n" + "_080F0AF2:\n" + "\tadd sp, 0x8\n" + "\tpop {r3,r4}\n" + "\tmov r8, r3\n" + "\tmov r9, r4\n" + "\tpop {r4-r7}\n" + "\tpop {r0}\n" + "\tbx r0"); +} +#endif + +void sub_80F0B00(u8 showIdx) +{ + gSaveBlock1Ptr->tvShows[showIdx].common.active = FALSE; +} + +void sub_80F0B24(u16 species, u8 showIdx) +{ + if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), 0) == 0) + { + gSaveBlock1Ptr->tvShows[showIdx].common.active = FALSE; + } +} + +void sub_80F0B64(void) +{ + u16 i; + + if (FlagGet(SYS_GAME_CLEAR) != TRUE) + { + for (i = 0; i < 24; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE) + { + gSaveBlock1Ptr->tvShows[i].common.active = FALSE; + } + else if (gSaveBlock1Ptr->tvShows[i].common.kind == TVSHOW_MASS_OUTBREAK) + { + gSaveBlock1Ptr->tvShows[i].common.active = FALSE; + } + } + } +} + +void sub_80F0BB8(void) +{ + u8 i; + + for (i = 0; i < 5; i ++) + { + if (GetTVChannelByShowType(gSaveBlock1Ptr->tvShows[i].common.kind) == 2) + { + gSaveBlock1Ptr->tvShows[i].common.active = FALSE; + } + } +} + +void sub_80F0C04(void) +{ + s8 i; + s8 ct; + + ct = 0; + for (i = 5; i < 24; i ++) + { + if (gSaveBlock1Ptr->tvShows[i].common.kind == TVSHOW_OFF_AIR) + { + ct ++; + } + } + for (i = 0; i < 5 - ct; i ++) + { + DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, i + 5); + } +} + +void sub_80F0C7C(void *src, u32 size, u8 masterIdx) +{ + u8 i; + PokeNews (*rmBuffer2)[4][16]; + PokeNews (*rmBuffer)[4][16]; + + rmBuffer2 = malloc(4 * 16 * sizeof(PokeNews)); + if (rmBuffer2 != NULL) + { + for (i = 0; i < 4; i ++) + { + memcpy((*rmBuffer2)[i], src + i * size, sizeof((*rmBuffer2)[i])); + } + rmBuffer = rmBuffer2; + switch (masterIdx) + { + case 0: + sub_80F0D60(gSaveBlock1Ptr->pokeNews, (*rmBuffer)[1], (*rmBuffer)[2], (*rmBuffer)[3]); + break; + case 1: + sub_80F0D60((*rmBuffer)[0], gSaveBlock1Ptr->pokeNews, (*rmBuffer)[2], (*rmBuffer)[3]); + break; + case 2: + sub_80F0D60((*rmBuffer)[0], (*rmBuffer)[1], gSaveBlock1Ptr->pokeNews, (*rmBuffer)[3]); + break; + case 3: + sub_80F0D60((*rmBuffer)[0], (*rmBuffer)[1], (*rmBuffer)[2], gSaveBlock1Ptr->pokeNews); + break; + } + sub_80F0EEC(); + sub_80F0F24(); + free(rmBuffer2); + } +} + +void sub_80F0D60(PokeNews player1[16], PokeNews player2[16], PokeNews player3[16], PokeNews player4[16]) +{ + u8 i; + u8 j; + u8 k; + PokeNews **argslist[4]; + + argslist[0] = &player1; + argslist[1] = &player2; + argslist[2] = &player3; + argslist[3] = &player4; + sTVShowNewsMixingNumPlayers = GetLinkPlayerCount(); + for (i = 0; i < 16; i ++) + { + for (j = 0; j < sTVShowNewsMixingNumPlayers; j ++) + { + sTVShowMixingCurSlot = sub_80F0ECC(*argslist[j], i); + if (sTVShowMixingCurSlot != -1) + { + for (k = 0; k < sTVShowNewsMixingNumPlayers - 1; k++) + { + sCurTVShowSlot = sub_80EEE30(*argslist[(j + k + 1) % sTVShowNewsMixingNumPlayers]); + if (sCurTVShowSlot != -1) + { + sub_80F0E58(argslist[(j + k + 1) % sTVShowNewsMixingNumPlayers], argslist[j]); + } + } + } + } + } +} + +void sub_80F0E58(PokeNews *dest[16], PokeNews *src[16]) +{ + PokeNews *ptr1; + PokeNews *ptr2; + + ptr1 = *dest; + ptr2 = *src; + ptr2 += sTVShowMixingCurSlot; + sub_80F0E84(ptr1, ptr2, sCurTVShowSlot); +} + +bool8 sub_80F0E84(PokeNews *dest, PokeNews *src, s8 slot) +{ + u8 i; + u8 kind; + + if (src->kind == POKENEWS_NONE) + { + return FALSE; + } + for (i = 0; i < 16; i ++) + { + if (dest[i].kind == src->kind) + { + return FALSE; + } + } + dest[slot].kind = src->kind; + dest[slot].state = 1; + dest[slot].days = src->days; + return TRUE; +} + +s8 sub_80F0ECC(PokeNews *pokeNews, u8 idx) +{ + if (pokeNews[idx].kind == POKENEWS_NONE) + { + return -1; + } + return idx; +} + +void sub_80F0EEC(void) +{ + u8 i; + + for (i = 0; i < 16; i ++) + { + if (gSaveBlock1Ptr->pokeNews[i].kind > POKENEWS_BLENDMASTER) + { + ClearPokemonNewsI(i); + } + } + sub_80EEEB8(); +} + +void sub_80F0F24(void) +{ + u8 i; + + if (FlagGet(SYS_GAME_CLEAR) != TRUE) + { + for (i = 0; i < 16; i ++) + { + gSaveBlock1Ptr->pokeNews[i].state = 0; + } + } +} + +#define tvlangfix(strptr, langptr, langfix) \ +if (IsStringJapanese(strptr)) \ +{ \ + (langptr) = LANGUAGE_JAPANESE; \ +} \ +else \ +{ \ + (langptr) = langfix; \ +} + +void sub_80F0F64(TVShow *show, u32 language) +{ + int i; + TVShow **r4; + + r4 = calloc(11, sizeof(TVShow *)); + for (i = 0; i < 24; i ++) + { + switch (show[i].common.kind) + { + case TVSHOW_FAN_CLUB_LETTER: + case TVSHOW_RECENT_HAPPENINGS: + r4[0] = &show[i]; + tvlangfix(r4[0]->fanclubLetter.playerName, r4[0]->fanclubLetter.language, language); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + r4[1] = &show[i]; + tvlangfix(r4[1]->fanclubOpinions.playerName, r4[1]->fanclubOpinions.language, language); + tvlangfix(r4[1]->fanclubOpinions.nickname, r4[1]->fanclubOpinions.pokemonNameLanguage, language); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + r4[6] = &show[i]; + tvlangfix(r4[6]->pokemonToday.playerName, r4[6]->pokemonToday.language, language); + tvlangfix(r4[6]->pokemonToday.nickname, r4[6]->pokemonToday.language2, language); + break; + case TVSHOW_SMART_SHOPPER: + r4[7] = &show[i]; + tvlangfix(r4[7]->smartshopperShow.playerName, r4[7]->smartshopperShow.language, language); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + r4[5] = &show[i]; + tvlangfix(r4[5]->bravoTrainerTower.trainerName, r4[5]->bravoTrainerTower.language, language); + tvlangfix(r4[5]->bravoTrainerTower.pokemonName, r4[5]->bravoTrainerTower.pokemonNameLanguage, language); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + r4[4] = &show[i]; + tvlangfix(r4[4]->bravoTrainer.playerName, r4[4]->bravoTrainer.language, language); + tvlangfix(r4[4]->bravoTrainer.pokemonNickname, r4[4]->bravoTrainer.pokemonNameLanguage, language); + break; + case TVSHOW_NAME_RATER_SHOW: + r4[3] = &show[i]; + tvlangfix(r4[3]->nameRaterShow.trainerName, r4[3]->nameRaterShow.language, language); + tvlangfix(r4[3]->nameRaterShow.pokemonName, r4[3]->nameRaterShow.pokemonNameLanguage, language); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + r4[2] = &show[i]; + tvlangfix(r4[2]->pokemonTodayFailed.playerName, r4[2]->pokemonTodayFailed.language, language); + break; + case TVSHOW_FISHING_ADVICE: + r4[8] = &show[i]; + tvlangfix(r4[8]->pokemonAngler.playerName, r4[8]->pokemonAngler.language, language); + break; + case TVSHOW_WORLD_OF_MASTERS: + r4[9] = &show[i]; + tvlangfix(r4[9]->worldOfMasters.playerName, r4[9]->worldOfMasters.language, language); + break; + case TVSHOW_MASS_OUTBREAK: + r4[10] = &show[i]; + r4[10]->massOutbreak.language = language; + break; + } + } + free(r4); +} + +void sub_80F1208(TVShow *shows) +{ + TVShow *curShow; + + sub_80F14F8(shows); + for (curShow = shows; curShow < shows + 24; curShow ++) + { + if (curShow->bravoTrainerTower.kind == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE) + { + if ((curShow->bravoTrainerTower.language == LANGUAGE_JAPANESE && curShow->bravoTrainerTower.pokemonNameLanguage != LANGUAGE_JAPANESE) || (curShow->bravoTrainerTower.language != LANGUAGE_JAPANESE && curShow->bravoTrainerTower.pokemonNameLanguage == LANGUAGE_JAPANESE)) + { + memset(curShow, 0, sizeof(TVShow)); + } + } + } +} + +void sub_80F1254(TVShow *shows) +{ + TVShow *curShow; + + for (curShow = shows; curShow < shows + 24; curShow ++) + { + if (curShow->bravoTrainerTower.kind == TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE) + { + if (IsStringJapanese(curShow->bravoTrainerTower.pokemonName)) + { + curShow->bravoTrainerTower.pokemonNameLanguage = LANGUAGE_JAPANESE; + } + else + { + curShow->bravoTrainerTower.pokemonNameLanguage = LANGUAGE_ENGLISH; + } + } + } +} + +u8 TV_GetStringLanguage(u8 *str) +{ + return IsStringJapanese(str) ? LANGUAGE_JAPANESE : LANGUAGE_ENGLISH; +} + +void sub_80F12A4(TVShow *shows) +{ + TVShow *curShow; + + for (curShow = shows; curShow < shows + 24; curShow ++) + { + switch(curShow->common.kind) + { + case TVSHOW_FAN_CLUB_LETTER: + curShow->fanclubLetter.language = TV_GetStringLanguage(curShow->fanclubLetter.playerName); + break; + case TVSHOW_RECENT_HAPPENINGS: + curShow->recentHappenings.language = TV_GetStringLanguage(curShow->recentHappenings.playerName); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + curShow->fanclubOpinions.language = TV_GetStringLanguage(curShow->fanclubOpinions.playerName); + curShow->fanclubOpinions.pokemonNameLanguage = TV_GetStringLanguage(curShow->fanclubOpinions.nickname); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + curShow->unkShow04.language = TV_GetStringLanguage(curShow->unkShow04.string_0b); + break; + case TVSHOW_NAME_RATER_SHOW: + curShow->nameRaterShow.language = TV_GetStringLanguage(curShow->nameRaterShow.trainerName); + curShow->nameRaterShow.pokemonNameLanguage = TV_GetStringLanguage(curShow->nameRaterShow.pokemonName); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + curShow->bravoTrainer.language = TV_GetStringLanguage(curShow->bravoTrainer.playerName); + curShow->bravoTrainer.pokemonNameLanguage = TV_GetStringLanguage(curShow->bravoTrainer.pokemonNickname); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + curShow->bravoTrainerTower.language = TV_GetStringLanguage(curShow->bravoTrainerTower.trainerName); + curShow->bravoTrainerTower.pokemonNameLanguage = TV_GetStringLanguage(curShow->bravoTrainerTower.pokemonName); + break; + case TVSHOW_CONTEST_LIVE_UPDATES: + curShow->contestLiveUpdates.language = TV_GetStringLanguage(curShow->contestLiveUpdates.playerName); + curShow->contestLiveUpdates.winningTrainerLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates.winningTrainerName); + break; + case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: + curShow->threeCheers.language = TV_GetStringLanguage(curShow->threeCheers.playerName); + curShow->threeCheers.worstBlenderLanguage = TV_GetStringLanguage(curShow->threeCheers.worstBlenderName); + break; + case TVSHOW_BATTLE_UPDATE: + curShow->battleUpdate.language = TV_GetStringLanguage(curShow->battleUpdate.playerName); + curShow->battleUpdate.linkOpponentLanguage = TV_GetStringLanguage(curShow->battleUpdate.linkOpponentName); + break; + case TVSHOW_FAN_CLUB_SPECIAL: + curShow->fanClubSpecial.language = TV_GetStringLanguage(curShow->fanClubSpecial.playerName); + curShow->fanClubSpecial.idolNameLanguage = TV_GetStringLanguage(curShow->fanClubSpecial.idolName); + break; + case TVSHOW_CONTEST_LIVE_UPDATES_2: + curShow->contestLiveUpdates2.language = TV_GetStringLanguage(curShow->contestLiveUpdates2.playerName); + curShow->contestLiveUpdates2.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates2.nickname); + break; + + case TVSHOW_POKEMON_TODAY_CAUGHT: + curShow->pokemonToday.language = TV_GetStringLanguage(curShow->pokemonToday.playerName); + curShow->pokemonToday.language2 = TV_GetStringLanguage(curShow->pokemonToday.nickname); + break; + case TVSHOW_SMART_SHOPPER: + curShow->smartshopperShow.language = TV_GetStringLanguage(curShow->smartshopperShow.playerName); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + curShow->pokemonTodayFailed.language = TV_GetStringLanguage(curShow->pokemonTodayFailed.playerName); + break; + case TVSHOW_FISHING_ADVICE: + curShow->pokemonAngler.language = TV_GetStringLanguage(curShow->pokemonAngler.playerName); + break; + case TVSHOW_WORLD_OF_MASTERS: + curShow->worldOfMasters.language = TV_GetStringLanguage(curShow->worldOfMasters.playerName); + break; + case TVSHOW_TREND_WATCHER: + curShow->trendWatcher.language = TV_GetStringLanguage(curShow->trendWatcher.playerName); + break; + case TVSHOW_BREAKING_NEWS: + curShow->breakingNews.language = TV_GetStringLanguage(curShow->breakingNews.playerName); + break; + case TVSHOW_BATTLE_SEMINAR: + curShow->battleSeminar.language = TV_GetStringLanguage(curShow->battleSeminar.playerName); + break; + case TVSHOW_FIND_THAT_GAMER: + case TVSHOW_TRAINER_FAN_CLUB: + curShow->trainerFanClub.language = TV_GetStringLanguage(curShow->trainerFanClub.playerName); + break; + case TVSHOW_CUTIES: + curShow->cuties.language = TV_GetStringLanguage(curShow->cuties.playerName); + curShow->cuties.pokemonNameLanguage = TV_GetStringLanguage(curShow->cuties.nickname); + break; + case TVSHOW_TODAYS_RIVAL_TRAINER: + case TVSHOW_SECRET_BASE_VISIT: + case TVSHOW_FRONTIER: + curShow->rivalTrainer.language = TV_GetStringLanguage(curShow->rivalTrainer.playerName); + break; + case TVSHOW_TREASURE_INVESTIGATORS: + case TVSHOW_LOTTO_WINNER: + case TVSHOW_NUMBER_ONE: + curShow->treasureInvestigators.language = TV_GetStringLanguage(curShow->treasureInvestigators.playerName); + break; + case TVSHOW_SECRET_BASE_SECRETS: + curShow->secretBaseSecrets.language = TV_GetStringLanguage(curShow->secretBaseSecrets.playerName); + curShow->secretBaseSecrets.baseOwnersNameLanguage = TV_GetStringLanguage(curShow->secretBaseSecrets.baseOwnersName); + break; + case TVSHOW_SAFARI_FAN_CLUB: + curShow->safariFanClub.language = TV_GetStringLanguage(curShow->safariFanClub.playerName); + break; + case TVSHOW_MASS_OUTBREAK: + break; + } + } +} + +void sub_80F14F8(TVShow *shows) +{ + int i; + + for (i = 0; i < 24; i ++) + { + switch (shows[i].common.kind) + { + case TVSHOW_WORLD_OF_MASTERS: + if (shows[i].worldOfMasters.location > 0x58) + { + memset(&shows[i], 0, sizeof(TVShow)); + } + break; + case TVSHOW_POKEMON_TODAY_FAILED: + if (shows[i].pokemonTodayFailed.location > 0x58) + { + memset(&shows[i], 0, sizeof(TVShow)); + } + break; + } + } +} + +void DoTVShow(void) +{ + if (gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004].common.active) + { + switch (gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004].common.kind) + { + case TVSHOW_FAN_CLUB_LETTER: + DoTVShowPokemonFanClubLetter(); + break; + case TVSHOW_RECENT_HAPPENINGS: + DoTVShowRecentHappenings(); + break; + case TVSHOW_PKMN_FAN_CLUB_OPINIONS: + DoTVShowPokemonFanClubOpinions(); + break; + case TVSHOW_UNKN_SHOWTYPE_04: + DoTVShowDummiedOut(); + break; + case TVSHOW_MASS_OUTBREAK: + DoTVShowPokemonNewsMassOutbreak(); + break; + case TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE: + DoTVShowBravoTrainerPokemonProfile(); + break; + case TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE: + DoTVShowBravoTrainerBattleTower(); + break; + case TVSHOW_POKEMON_TODAY_CAUGHT: + DoTVShowPokemonTodaySuccessfulCapture(); + break; + case TVSHOW_SMART_SHOPPER: + DoTVShowTodaysSmartShopper(); + break; + case TVSHOW_NAME_RATER_SHOW: + DoTVShowTheNameRaterShow(); + break; + case TVSHOW_CONTEST_LIVE_UPDATES: + DoTVShowPokemonContestLiveUpdates(); + break; + case TVSHOW_BATTLE_UPDATE: + DoTVShowPokemonBattleUpdate(); + break; + case TVSHOW_3_CHEERS_FOR_POKEBLOCKS: + DoTVShow3CheersForPokeblocks(); + break; + case TVSHOW_POKEMON_TODAY_FAILED: + DoTVShowPokemonTodayFailedCapture(); + break; + case TVSHOW_FISHING_ADVICE: + DoTVShowPokemonAngler(); + break; + case TVSHOW_WORLD_OF_MASTERS: + DoTVShowTheWorldOfMasters(); + break; + case TVSHOW_TODAYS_RIVAL_TRAINER: + DoTVShowTodaysRivalTrainer(); + break; + case TVSHOW_TREND_WATCHER: + DoTVShowDewfordTrendWatcherNetwork(); + break; + case TVSHOW_TREASURE_INVESTIGATORS: + DoTVShowHoennTreasureInvestigators(); + break; + case TVSHOW_FIND_THAT_GAMER: + DoTVShowFindThatGamer(); + break; + case TVSHOW_BREAKING_NEWS: + DoTVShowBreakingNewsTV(); + break; + case TVSHOW_SECRET_BASE_VISIT: + DoTVShowSecretBaseVisit(); + break; + case TVSHOW_LOTTO_WINNER: + DoTVShowPokemonLotteryWinnerFlashReport(); + break; + case TVSHOW_BATTLE_SEMINAR: + DoTVShowThePokemonBattleSeminar(); + break; + case TVSHOW_FAN_CLUB_SPECIAL: + DoTVShowTrainerFanClubSpecial(); + break; + case TVSHOW_TRAINER_FAN_CLUB: + DoTVShowTrainerFanClub(); + break; + case TVSHOW_CUTIES: + DoTVShowSpotTheCuties(); + break; + case TVSHOW_FRONTIER: + DoTVShowPokemonNewsBattleFrontier(); + break; + case TVSHOW_NUMBER_ONE: + DoTVShowWhatsNo1InHoennToday(); + break; + case TVSHOW_SECRET_BASE_SECRETS: + DoTVShowSecretBaseSecrets(); + break; + case TVSHOW_SAFARI_FAN_CLUB: + DoTVShowSafariFanClub(); + break; + case TVSHOW_CONTEST_LIVE_UPDATES_2: + DoTVShowPokemonContestLiveUpdates2(); + break; + } + } +} + +void DoTVShowBravoTrainerPokemonProfile(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + CopyContestCategoryToStringVar(1, show->bravoTrainer.contestCategory); + CopyContestRankToStringVar(2, show->bravoTrainer.contestRank); + if (!StringCompare(gSpeciesNames[show->bravoTrainer.species], show->bravoTrainer.pokemonNickname)) + sTVShowState = 8; + else + sTVShowState = 1; + break; + case 1: + StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + TVShowConvertInternationalString(gStringVar2, show->bravoTrainer.pokemonNickname, show->bravoTrainer.pokemonNameLanguage); + CopyContestCategoryToStringVar(2, show->bravoTrainer.contestCategory); + sTVShowState = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + if (show->bravoTrainer.contestResult == 0) // placed first + sTVShowState = 3; + else + sTVShowState = 4; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + CopyEasyChatWord(gStringVar2, show->bravoTrainer.words[0]); + TV_PrintIntToStringVar(2, show->bravoTrainer.contestResult + 1); + sTVShowState = 5; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + CopyEasyChatWord(gStringVar2, show->bravoTrainer.words[0]); + TV_PrintIntToStringVar(2, show->bravoTrainer.contestResult + 1); + sTVShowState = 5; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + CopyContestCategoryToStringVar(1, show->bravoTrainer.contestCategory); + CopyEasyChatWord(gStringVar3, show->bravoTrainer.words[1]); + if (show->bravoTrainer.move) + sTVShowState = 6; + else + sTVShowState = 7; + break; + case 6: + StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + StringCopy(gStringVar2, gMoveNames[show->bravoTrainer.move]); + CopyEasyChatWord(gStringVar3, show->bravoTrainer.words[1]); + sTVShowState = 7; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); + StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainer.species]); + TVShowDone(); + break; + case 8: + StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + sTVShowState = 2; + break; + } + ShowFieldMessage(sTVBravoTrainerTextGroup[state]); +} + +void DoTVShowBravoTrainerBattleTower(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch(state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); + if (show->bravoTrainerTower.numFights >= 7) + sTVShowState = 1; + else + sTVShowState = 2; + break; + case 1: + if (show->bravoTrainerTower.btLevel == 50) + { + StringCopy(gStringVar1, gText_Lv50); + } + else + { + StringCopy(gStringVar1, gText_OpenLevel); + } + TV_PrintIntToStringVar(1, show->bravoTrainerTower.numFights); + if (show->bravoTrainerTower.wonTheChallenge == TRUE) + sTVShowState = 3; + else + sTVShowState = 4; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + TV_PrintIntToStringVar(1, show->bravoTrainerTower.numFights + 1); + if (show->bravoTrainerTower.interviewResponse == 0) + sTVShowState = 5; + else + sTVShowState = 6; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); + if (show->bravoTrainerTower.interviewResponse == 0) + sTVShowState = 5; + else + sTVShowState = 6; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); + if (show->bravoTrainerTower.interviewResponse == 0) + sTVShowState = 5; + else + sTVShowState = 6; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + sTVShowState = 11; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + sTVShowState = 11; + break; + case 7: + sTVShowState = 11; + break; + case 8: + case 9: + case 10: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); + sTVShowState = 11; + break; + case 11: + CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); + if (show->bravoTrainerTower.interviewResponse == 0) + sTVShowState = 12; + else + sTVShowState = 13; + break; + case 12: + case 13: + CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); + TVShowConvertInternationalString(gStringVar2, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); + TVShowConvertInternationalString(gStringVar3, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); + sTVShowState = 14; + break; + case 14: + TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); + StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVBravoTrainerBattleTowerTextGroup[state]); +} + +void DoTVShowTodaysSmartShopper(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch(state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language); + GetMapName(gStringVar2, show->smartshopperShow.shopLocation, 0); + if (show->smartshopperShow.itemAmounts[0] >= 255) + { + sTVShowState = 11; + } + else + { + sTVShowState = 1; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language); + StringCopy(gStringVar2, ItemId_GetItem(show->smartshopperShow.itemIds[0])->name); + TV_PrintIntToStringVar(2, show->smartshopperShow.itemAmounts[0]); + sTVShowState += 1 + (Random() % 4); + break; + case 2: + case 4: + case 5: + if (show->smartshopperShow.itemIds[1] != ITEM_NONE) + { + sTVShowState = 6; + } + else + { + sTVShowState = 10; + } + break; + case 3: + TV_PrintIntToStringVar(2, show->smartshopperShow.itemAmounts[0] + 1); + if (show->smartshopperShow.itemIds[1] != ITEM_NONE) + { + sTVShowState = 6; + } + else + { + sTVShowState = 10; + } + break; + case 6: + StringCopy(gStringVar2, ItemId_GetItem(show->smartshopperShow.itemIds[1])->name); + TV_PrintIntToStringVar(2, show->smartshopperShow.itemAmounts[1]); + if (show->smartshopperShow.itemIds[2] != ITEM_NONE) + { + sTVShowState = 7; + } + else if (show->smartshopperShow.priceReduced == TRUE) + { + sTVShowState = 8; + } + else + { + sTVShowState = 9; + } + break; + case 7: + StringCopy(gStringVar2, ItemId_GetItem(show->smartshopperShow.itemIds[2])->name); + TV_PrintIntToStringVar(2, show->smartshopperShow.itemAmounts[2]); + if (show->smartshopperShow.priceReduced == TRUE) + { + sTVShowState = 8; + } + else + { + sTVShowState = 9; + } + break; + case 8: + if (show->smartshopperShow.itemAmounts[0] >= 255) + { + sTVShowState = 12; + } + else + { + sTVShowState = 9; + } + break; + case 9: + sub_80EF40C(1, show); + TVShowDone(); + break; + case 10: + if (show->smartshopperShow.priceReduced == TRUE) + { + sTVShowState = 8; + } + else + { + sTVShowState = 9; + } + break; + case 11: + TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language); + StringCopy(gStringVar2, ItemId_GetItem(show->smartshopperShow.itemIds[0])->name); + if (show->smartshopperShow.priceReduced == TRUE) + { + sTVShowState = 8; + } + else + { + sTVShowState = 12; + } + break; + case 12: + TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language); + TVShowDone(); + break; + } + ShowFieldMessage(sTVTodaysSmartShopperTextGroup[state]); +} + +void DoTVShowTheNameRaterShow(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.trainerName, show->nameRaterShow.language); + StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.species]); + TVShowConvertInternationalString(gStringVar3, show->nameRaterShow.pokemonName, show->nameRaterShow.pokemonNameLanguage); + sTVShowState = TV_GetNicknameSumMod8(show) + 1; + break; + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + if (show->nameRaterShow.random == 0) + { + sTVShowState = 9; + } + else if (show->nameRaterShow.random == 1) + { + sTVShowState = 10; + } + else if (show->nameRaterShow.random == 2) + { + sTVShowState = 11; + } + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.trainerName, show->nameRaterShow.language); + if (show->nameRaterShow.random == 0) + { + sTVShowState = 9; + } + else if (show->nameRaterShow.random == 1) + { + sTVShowState = 10; + } + else if (show->nameRaterShow.random == 2) + { + sTVShowState = 11; + } + break; + case 9: + case 10: + case 11: + TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.pokemonName, show->nameRaterShow.pokemonNameLanguage); + TV_GetNicknameSubstring(1, 0, 0, 1, 0, show); + TV_GetNicknameSubstring(2, 1, 0, 1, 0, show); + sTVShowState = 12; + break; + case 13: + TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.trainerName, show->nameRaterShow.language); + TV_GetNicknameSubstring(1, 0, 2, 0, 0, show); + TV_GetNicknameSubstring(2, 0, 3, 1, 0, show); + sTVShowState = 14; + break; + case 14: + TV_GetNicknameSubstring(1, 0, 2, 1, 0, show); + TV_GetNicknameSubstring(2, 0, 3, 0, 0, show); + sTVShowState = 18; + break; + case 15: + TV_GetNicknameSubstring(0, 0, 2, 1, 0, show); + StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.species]); + TV_GetNicknameSubstring(2, 0, 3, 2, show->nameRaterShow.species, show); + sTVShowState = 16; + break; + case 16: + TV_GetNicknameSubstring(0, 0, 2, 2, show->nameRaterShow.species, show); + TV_GetNicknameSubstring(2, 0, 3, 1, 0, show); + sTVShowState = 17; + break; + case 17: + TV_GetNicknameSubstring(0, 0, 2, 1, 0, show); + StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.randomSpecies]); + TV_GetNicknameSubstring(2, 0, 3, 2, show->nameRaterShow.randomSpecies, show); + sTVShowState = 18; + break; + case 12: + state = 18; + sTVShowState = 18; + case 18: + TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.pokemonName, show->nameRaterShow.pokemonNameLanguage); + TVShowDone(); + break; + } + ShowFieldMessage(sTVNameRaterTextGroup[state]); +} + +void DoTVShowPokemonTodaySuccessfulCapture(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); + if (show->pokemonToday.ball == ITEM_MASTER_BALL) + { + sTVShowState = 5; + } + else + { + sTVShowState = 1; + } + break; + case 1: + sTVShowState = 2; + break; + case 2: + StringCopy(gStringVar2, ItemId_GetItem(show->pokemonToday.ball)->name); + TV_PrintIntToStringVar(2, show->pokemonToday.nBallsUsed); + if (show->pokemonToday.nBallsUsed < 4) + { + sTVShowState = 3; + } + else + { + sTVShowState = 4; + } + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); + sTVShowState = 6; + break; + case 4: + sTVShowState = 6; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + sTVShowState = 6; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); + sTVShowState += 1 + (Random() % 4); + break; + case 7: + case 8: + StringCopy(gStringVar1, gSpeciesNames[show->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar2, show->pokemonToday.nickname, show->pokemonToday.language2); + TV_GetSomeOtherSpeciesAlreadySeenByPlayer_AndPrintName(2, show->pokemonToday.species); + sTVShowState = 11; + break; + case 9: + case 10: + StringCopy(gStringVar1, gSpeciesNames[show->pokemonToday.species]); + TVShowConvertInternationalString(gStringVar2, show->pokemonToday.nickname, show->pokemonToday.language2); + sTVShowState = 11; + break; + case 11: + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonTodaySuccessfulTextGroup[state]); +} + +void DoTVShowPokemonTodayFailedCapture(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonTodayFailed.species]); + sTVShowState = 1; + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); + GetMapName(gStringVar2, show->pokemonTodayFailed.location, 0); + StringCopy(gStringVar3, gSpeciesNames[show->pokemonTodayFailed.species2]); + if (show->pokemonTodayFailed.outcome == 1) + { + sTVShowState = 3; + } + else + { + sTVShowState = 2; + } + break; + case 2: + case 3: + TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); + TV_PrintIntToStringVar(1, show->pokemonTodayFailed.nBallsUsed); + if (Random() % 3 == 0) + { + sTVShowState = 5; + } + else + { + sTVShowState = 4; + } + break; + case 4: + case 5: + TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); + sTVShowState = 6; + break; + case 6: + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonTodayFailedTextGroup[state]); +} + +void DoTVShowPokemonFanClubLetter(void) +{ + TVShow *show; + u8 state; + u16 rval; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->fanclubLetter.playerName, show->fanclubLetter.language); + StringCopy(gStringVar2, gSpeciesNames[show->fanclubLetter.species]); + sTVShowState = 50; + break; + case 1: + rval = (Random() % 4) + 1; + if (rval == 1) + sTVShowState = 2; + else + sTVShowState = rval + 2; + break; + case 2: + sTVShowState = 51; + break; + case 3: + sTVShowState += (Random() % 3) + 1; + break; + case 4: + case 5: + case 6: + TV_FanClubLetter_RandomWordToStringVar3(show); + sTVShowState = 7; + break; + case 7: + rval = (Random() % 0x1f) + 0x46; + TV_PrintIntToStringVar(2, rval); + TVShowDone(); + break; + case 50: + ConvertEasyChatWordsToString(gStringVar4, show->fanclubLetter.words, 2, 2); + ShowFieldMessage(gStringVar4); + sTVShowState = 1; + return; + case 51: + ConvertEasyChatWordsToString(gStringVar4, show->fanclubLetter.words, 2, 2); + ShowFieldMessage(gStringVar4); + sTVShowState = 3; + return; + } + ShowFieldMessage(sTVFanClubTextGroup[state]); +} + +void DoTVShowRecentHappenings(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->recentHappenings.playerName, show->recentHappenings.language); + TV_FanClubLetter_RandomWordToStringVar3(show); + sTVShowState = 50; + break; + case 1: + sTVShowState += 1 + (Random() % 3); + break; + case 2: + case 3: + case 4: + sTVShowState = 5; + break; + case 5: + TVShowDone(); + break; + case 50: + ConvertEasyChatWordsToString(gStringVar4, show->recentHappenings.words, 2, 2); + ShowFieldMessage(gStringVar4); + sTVShowState = 1; + return; + } + ShowFieldMessage(sTVRecentHappeninssTextGroup[state]); +} + +void DoTVShowPokemonFanClubOpinions(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->fanclubOpinions.playerName, show->fanclubOpinions.language); + StringCopy(gStringVar2, gSpeciesNames[show->fanclubOpinions.species]); + TVShowConvertInternationalString(gStringVar3, show->fanclubOpinions.nickname, show->fanclubOpinions.pokemonNameLanguage); + sTVShowState = show->fanclubOpinions.questionAsked + 1; + break; + case 1: + case 2: + case 3: + TVShowConvertInternationalString(gStringVar1, show->fanclubOpinions.playerName, show->fanclubOpinions.language); + StringCopy(gStringVar2, gSpeciesNames[show->fanclubOpinions.species]); + CopyEasyChatWord(gStringVar3, show->fanclubOpinions.words[0]); + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->fanclubOpinions.playerName, show->fanclubOpinions.language); + CopyEasyChatWord(gStringVar3, show->fanclubOpinions.words[1]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVFanClubOpinionsTextGroup[state]); +} + +void DoTVShowDummiedOut(void) +{ + +} + +void DoTVShowPokemonNewsMassOutbreak(void) +{ + TVShow *show; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + GetMapName(gStringVar1, show->massOutbreak.locationMapNum, 0); + StringCopy(gStringVar2, gSpeciesNames[show->massOutbreak.species]); + TVShowDone(); + StartMassOutbreak(); + ShowFieldMessage(sTVMassOutbreakTextGroup[sTVShowState]); +} + +void DoTVShowPokemonContestLiveUpdates(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + sub_818E868(gStringVar1, show->contestLiveUpdates.category); + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); + if (show->contestLiveUpdates.round1Rank == show->contestLiveUpdates.round2Rank) + { + if (show->contestLiveUpdates.round1Rank == 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 3; + } + } + else if (show->contestLiveUpdates.round1Rank > show->contestLiveUpdates.round2Rank) + { + sTVShowState = 2; + } + else + { + sTVShowState = 4; + } + break; + case 1: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + switch (show->contestLiveUpdates.appealFlags1) + { + case 0x01: + sTVShowState = 8; + break; + case 0x02: + sTVShowState = 5; + break; + case 0x04: + sTVShowState = 14; + break; + case 0x08: + sTVShowState = 7; + break; + case 0x10: + sTVShowState = 6; + break; + case 0x20: + sTVShowState = 20; + break; + case 0x40: + sTVShowState = 21; + break; + case 0x80: + sTVShowState = 22; + break; + } + break; + case 2: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + switch (show->contestLiveUpdates.appealFlags1) + { + case 0x01: + sTVShowState = 8; + break; + case 0x02: + sTVShowState = 5; + break; + case 0x04: + sTVShowState = 14; + break; + case 0x08: + sTVShowState = 7; + break; + case 0x10: + sTVShowState = 6; + break; + case 0x20: + sTVShowState = 20; + break; + case 0x40: + sTVShowState = 21; + break; + case 0x80: + sTVShowState = 22; + break; + } + break; + case 3: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); + switch (show->contestLiveUpdates.appealFlags1) + { + case 0x01: + sTVShowState = 8; + break; + case 0x02: + sTVShowState = 5; + break; + case 0x04: + sTVShowState = 14; + break; + case 0x08: + sTVShowState = 7; + break; + case 0x10: + sTVShowState = 6; + break; + case 0x20: + sTVShowState = 20; + break; + case 0x40: + sTVShowState = 21; + break; + case 0x80: + sTVShowState = 22; + break; + } + break; + case 4: + switch (show->contestLiveUpdates.category) + { + case 0: + StringCopy(gStringVar1, gText_Cool); + break; + case 1: + StringCopy(gStringVar1, gText_Beauty); + break; + case 2: + StringCopy(gStringVar1, gText_Cute); + break; + case 3: + StringCopy(gStringVar1, gText_Smart); + break; + case 4: + StringCopy(gStringVar1, gText_Tough); + break; + } + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + switch (show->contestLiveUpdates.appealFlags1) + { + case 0x01: + sTVShowState = 8; + break; + case 0x02: + sTVShowState = 5; + break; + case 0x04: + sTVShowState = 14; + break; + case 0x08: + sTVShowState = 7; + break; + case 0x10: + sTVShowState = 6; + break; + case 0x20: + sTVShowState = 20; + break; + case 0x40: + sTVShowState = 21; + break; + case 0x80: + sTVShowState = 22; + break; + } + break; + case 5: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 6: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 7: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 8: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + switch (show->contestLiveUpdates.category) + { + case 0: + sTVShowState = 9; + break; + case 1: + sTVShowState = 10; + break; + case 2: + sTVShowState = 11; + break; + case 3: + sTVShowState = 12; + break; + case 4: + sTVShowState = 13; + break; + } + break; + case 9: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 10: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 11: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 12: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 13: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 14: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + switch (show->contestLiveUpdates.category) + { + case 0: + sTVShowState = 15; + break; + case 1: + sTVShowState = 16; + break; + case 2: + sTVShowState = 17; + break; + case 3: + sTVShowState = 18; + break; + case 4: + sTVShowState = 19; + break; + } + break; + case 15: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 16: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 17: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 18: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 19: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 20: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 21: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + sTVShowState = 23; + break; + case 22: + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + StringCopy(gStringVar3, gMoveNames[show->contestLiveUpdates.move]); + sTVShowState = 23; + break; + case 23: + StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.species]); + TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); + StringCopy(gStringVar3, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + switch (show->contestLiveUpdates.appealFlags2) + { + case 0x01: + sTVShowState = 31; + break; + case 0x02: + sTVShowState = 30; + break; + case 0x04: + sTVShowState = 29; + break; + case 0x08: + sTVShowState = 28; + break; + case 0x10: + sTVShowState = 27; + break; + case 0x20: + sTVShowState = 26; + break; + case 0x40: + sTVShowState = 25; + break; + case 0x80: + sTVShowState = 24; + break; + } + break; + case 24: + StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + sTVShowState = 32; + break; + case 25: + TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + sTVShowState = 32; + break; + case 28: + sTVShowState = 32; + break; + case 29: + TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); + sTVShowState = 32; + break; + case 26: + case 27: + case 30: + case 31: + TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); + sTVShowState = 32; + break; + case 32: + + TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.playerName, show->contestLiveUpdates.language); + StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.species]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVContestLiveUpdatesTextGroup[state]); +} + +void DoTVShowPokemonBattleUpdate(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + switch (show->battleUpdate.battleType) + { + case 0: + case 1: + sTVShowState = 1; + break; + case 2: + sTVShowState = 5; + break; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + TVShowConvertInternationalString(gStringVar2, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); + if (show->battleUpdate.battleType == 0) + { + StringCopy(gStringVar3, gText_Single); + } + else + { + StringCopy(gStringVar3, gText_Double); + } + sTVShowState = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.species2]); + StringCopy(gStringVar3, gMoveNames[show->battleUpdate.move]); + sTVShowState = 3; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); + StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.species]); + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + TVShowConvertInternationalString(gStringVar2, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); + TVShowDone(); + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + TVShowConvertInternationalString(gStringVar2, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); + sTVShowState = 6; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.species2]); + StringCopy(gStringVar3, gMoveNames[show->battleUpdate.move]); + sTVShowState = 7; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); + TVShowConvertInternationalString(gStringVar2, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); + StringCopy(gStringVar3, gSpeciesNames[show->battleUpdate.species]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonBattleUpdateTextGroup[state]); +} + +void DoTVShow3CheersForPokeblocks(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->threeCheers.playerName, show->threeCheers.language); + if (show->threeCheers.sheen > 20) + { + sTVShowState = 1; + } + else + { + sTVShowState = 3; + } + break; + case 1: + switch (show->threeCheers.flavor) + { + case 0: + StringCopy(gStringVar1, gText_Spicy2); + break; + case 1: + StringCopy(gStringVar1, gText_Dry2); + break; + case 2: + StringCopy(gStringVar1, gText_Sweet2); + break; + case 3: + StringCopy(gStringVar1, gText_Bitter2); + break; + case 4: + StringCopy(gStringVar1, gText_Sour2); + break; + } + if (show->threeCheers.sheen > 24) + { + StringCopy(gStringVar2, gText_Excellent); + } else if (show->threeCheers.sheen > 22) + { + StringCopy(gStringVar2, gText_VeryGood); + } + else + { + StringCopy(gStringVar2, gText_Good); + } + TVShowConvertInternationalString(gStringVar3, show->threeCheers.playerName, show->threeCheers.language); + sTVShowState = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->threeCheers.worstBlenderName, show->threeCheers.worstBlenderLanguage); + sTVShowState = 5; + break; + case 3: + switch (show->threeCheers.flavor) + { + case 0: + StringCopy(gStringVar1, gText_Spicy2); + break; + case 1: + StringCopy(gStringVar1, gText_Dry2); + break; + case 2: + StringCopy(gStringVar1, gText_Sweet2); + break; + case 3: + StringCopy(gStringVar1, gText_Bitter2); + break; + case 4: + StringCopy(gStringVar1, gText_Sour2); + break; + } + if (show->threeCheers.sheen > 16) + { + StringCopy(gStringVar2, gText_SoSo); + } else if (show->threeCheers.sheen > 13) + { + StringCopy(gStringVar2, gText_Bad); + } + else + { + StringCopy(gStringVar2, gText_TheWorst); + } + TVShowConvertInternationalString(gStringVar3, show->threeCheers.playerName, show->threeCheers.language); + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->threeCheers.worstBlenderName, show->threeCheers.worstBlenderLanguage); + TVShowConvertInternationalString(gStringVar2, show->threeCheers.playerName, show->threeCheers.language); + sTVShowState = 5; + break; + case 5: + TVShowDone(); + break; + } + ShowFieldMessage(sTV3CheersForPokeblocksTextGroup[state]); +} + +void DoTVShowInSearchOfTrainers(void) +{ + u8 state; + + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + GetMapName(gStringVar1, gSaveBlock1Ptr->gabbyAndTyData.mapnum, 0); + if (gSaveBlock1Ptr->gabbyAndTyData.battleNum > 1) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 1: + sTVShowState = 2; + break; + case 2: + if (!gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn) + { + sTVShowState = 4; + } + else if (gSaveBlock1Ptr->gabbyAndTyData.playerThrewABall) + { + sTVShowState = 5; + } + else if (gSaveBlock1Ptr->gabbyAndTyData.playerUsedAnItem) + { + sTVShowState = 6; + } + else if (gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon) + { + sTVShowState = 7; + } + else + { + sTVShowState = 3; + } + break; + case 3: + StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon1]); + StringCopy(gStringVar2, gMoveNames[gSaveBlock1Ptr->gabbyAndTyData.lastMove]); + StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon2]); + sTVShowState = 8; + break; + case 4: + case 5: + case 6: + case 7: + sTVShowState = 8; + break; + case 8: + CopyEasyChatWord(gStringVar1, gSaveBlock1Ptr->gabbyAndTyData.quote[0]); + StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon1]); + StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon2]); + gScriptResult = TRUE; + sTVShowState = 0; + TakeTVShowInSearchOfTrainersOffTheAir(); + break; + } + ShowFieldMessage(sTVInSearchOfTrainersTextGroup[state]); +} + +void DoTVShowPokemonAngler(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + if (show->pokemonAngler.nBites < show->pokemonAngler.nFails) + { + sTVShowState = 0; + } + else + { + sTVShowState = 1; + } + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->pokemonAngler.playerName, show->pokemonAngler.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonAngler.species]); + TV_PrintIntToStringVar(2, show->pokemonAngler.nFails); + TVShowDone(); + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->pokemonAngler.playerName, show->pokemonAngler.language); + StringCopy(gStringVar2, gSpeciesNames[show->pokemonAngler.species]); + TV_PrintIntToStringVar(2, show->pokemonAngler.nBites); + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonAnslerTextGroup[state]); +} + +void DoTVShowTheWorldOfMasters(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->worldOfMasters.playerName, show->worldOfMasters.language); + TV_PrintIntToStringVar(1, show->worldOfMasters.steps); + TV_PrintIntToStringVar(2, show->worldOfMasters.numPokeCaught); + sTVShowState = 1; + break; + case 1: + StringCopy(gStringVar1, gSpeciesNames[show->worldOfMasters.species]); + sTVShowState = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->worldOfMasters.playerName, show->worldOfMasters.language); + GetMapName(gStringVar2, show->worldOfMasters.location, 0); + StringCopy(gStringVar3, gSpeciesNames[show->worldOfMasters.caughtPoke]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVWorldOfMastersTextGroup[state]); +} + +void DoTVShowTodaysRivalTrainer(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + switch (show->rivalTrainer.location) + { + default: + sTVShowState = 7; + break; + case REGION_MAP_SECRET_BASE: + sTVShowState = 8; + break; + case REGION_MAP_NONE: + switch (show->rivalTrainer.mapDataId) + { + case 0x115 ... 0x117: + sTVShowState = 10; + break; + default: + sTVShowState = 9; + break; + } + break; + } + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->rivalTrainer.playerName, show->rivalTrainer.language); + TV_PrintIntToStringVar(1, show->rivalTrainer.dexCount); + GetMapName(gStringVar3, show->rivalTrainer.location, 0); + if (show->rivalTrainer.badgeCount != 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 8: + TVShowConvertInternationalString(gStringVar1, show->rivalTrainer.playerName, show->rivalTrainer.language); + TV_PrintIntToStringVar(1, show->rivalTrainer.dexCount); + if (show->rivalTrainer.badgeCount != 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 9: + TVShowConvertInternationalString(gStringVar1, show->rivalTrainer.playerName, show->rivalTrainer.language); + TV_PrintIntToStringVar(1, show->rivalTrainer.dexCount); + if (show->rivalTrainer.badgeCount != 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 10: + TVShowConvertInternationalString(gStringVar1, show->rivalTrainer.playerName, show->rivalTrainer.language); + TV_PrintIntToStringVar(1, show->rivalTrainer.dexCount); + if (show->rivalTrainer.badgeCount != 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 1: + TV_PrintIntToStringVar(0, show->rivalTrainer.badgeCount); + if (FlagGet(CODE_FLAGS + 0x48)) + { + if (show->rivalTrainer.nSilverSymbols || show->rivalTrainer.nGoldSymbols) + { + sTVShowState = 4; + } + else + { + sTVShowState = 3; + } + } + else + { + sTVShowState = 6; + } + break; + case 2: + if (FlagGet(CODE_FLAGS + 0x48)) + { + if (show->rivalTrainer.nSilverSymbols || show->rivalTrainer.nGoldSymbols) + { + sTVShowState = 4; + } + else + { + sTVShowState = 3; + } + } + else + { + sTVShowState = 6; + } + break; + case 3: + if (show->rivalTrainer.battlePoints == 0) + { + sTVShowState = 6; + } + else + { + sTVShowState = 5; + } + break; + case 4: + TV_PrintIntToStringVar(0, show->rivalTrainer.nGoldSymbols); + TV_PrintIntToStringVar(1, show->rivalTrainer.nSilverSymbols); + if (show->rivalTrainer.battlePoints == 0) + { + sTVShowState = 6; + } + else + { + sTVShowState = 5; + } + break; + case 5: + TV_PrintIntToStringVar(0, show->rivalTrainer.battlePoints); + sTVShowState = 6; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->rivalTrainer.playerName, show->rivalTrainer.language); + TVShowDone(); + } + ShowFieldMessage(sTVTodaysRivalTrainerTextGroup[state]); +} + +void DoTVShowDewfordTrendWatcherNetwork(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]); + CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]); + if (show->trendWatcher.gender == MALE) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 1: + case 2: + CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]); + CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]); + TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language); + sTVShowState = 3; + break; + case 3: + CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]); + CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]); + if (show->trendWatcher.gender == MALE) + { + sTVShowState = 4; + } + else + { + sTVShowState = 5; + } + break; + case 4: + case 5: + CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]); + CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]); + TVShowConvertInternationalString(gStringVar3, show->trendWatcher.playerName, show->trendWatcher.language); + sTVShowState = 6; + break; + case 6: + CopyEasyChatWord(gStringVar1, show->trendWatcher.words[0]); + CopyEasyChatWord(gStringVar2, show->trendWatcher.words[1]); + TVShowDone(); + } + ShowFieldMessage(sTVDewfordTrendWatcherNetworkTextGroup[state]); +} + +void DoTVShowHoennTreasureInvestigators(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + StringCopy(gStringVar1, ItemId_GetItem(show->treasureInvestigators.item)->name); + if (show->treasureInvestigators.location == REGION_MAP_NONE) + { + switch (show->treasureInvestigators.mapDataId) + { + case 0x115 ... 0x117: + sTVShowState = 2; + break; + default: + sTVShowState = 1; + break; + } + } + else + { + sTVShowState = 1; + } + break; + case 1: + StringCopy(gStringVar1, ItemId_GetItem(show->treasureInvestigators.item)->name); + TVShowConvertInternationalString(gStringVar2, show->treasureInvestigators.playerName, show->treasureInvestigators.language); + GetMapName(gStringVar3, show->treasureInvestigators.location, 0); + TVShowDone(); + break; + case 2: + StringCopy(gStringVar1, ItemId_GetItem(show->treasureInvestigators.item)->name); + TVShowConvertInternationalString(gStringVar2, show->treasureInvestigators.playerName, show->treasureInvestigators.language); + TVShowDone(); + break; + } + ShowFieldMessage(sTVHoennTreasureInvestisatorsTextGroup[state]); +} + +void DoTVShowFindThatGamer(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->findThatGamer.playerName, show->findThatGamer.language); + switch (show->findThatGamer.whichGame) + { + case 0: + StringCopy(gStringVar2, gText_Slots); + break; + case 1: + StringCopy(gStringVar2, gText_Roulette); + break; + } + if (show->findThatGamer.won == TRUE) + { + sTVShowState = 1; + } + else + { + sTVShowState = 2; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->findThatGamer.playerName, show->findThatGamer.language); + switch (show->findThatGamer.whichGame) + { + case 0: + StringCopy(gStringVar2, gText_Slots); + break; + case 1: + StringCopy(gStringVar2, gText_Roulette); + break; + } + TV_PrintIntToStringVar(2, show->findThatGamer.nCoins); + TVShowDone(); break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->findThatGamer.playerName, show->findThatGamer.language); + switch (show->findThatGamer.whichGame) + { + case 0: + StringCopy(gStringVar2, gText_Slots); + break; + case 1: + StringCopy(gStringVar2, gText_Roulette); + break; + } + TV_PrintIntToStringVar(2, show->findThatGamer.nCoins); + sTVShowState = 3; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->findThatGamer.playerName, show->findThatGamer.language); + switch (show->findThatGamer.whichGame) + { + case 0: + StringCopy(gStringVar2, gText_Roulette); + break; + case 1: + StringCopy(gStringVar2, gText_Slots); + break; + } + TVShowDone(); + break; + } + ShowFieldMessage(sTVFindThatGamerTextGroup[state]); +} + +void DoTVShowBreakingNewsTV(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + if (show->breakingNews.outcome == 0) + { + sTVShowState = 1; + } + else + { + sTVShowState = 5; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + GetMapName(gStringVar3, show->breakingNews.location, 0); + sTVShowState = 2; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + sTVShowState = 3; + break; + case 3: + TV_PrintIntToStringVar(0, show->breakingNews.balls); + StringCopy(gStringVar2, ItemId_GetItem(show->breakingNews.caughtMonBall)->name); + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + GetMapName(gStringVar2, show->breakingNews.location, 0); + TVShowDone(); + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + GetMapName(gStringVar3, show->breakingNews.location, 0); + sTVShowState = 6; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + switch (show->breakingNews.outcome) + { + case 1: + if (show->breakingNews.lastUsedMove == MOVE_NONE) + { + sTVShowState = 12; + } + else + { + sTVShowState = 7; + } + break; + case 2: + sTVShowState = 9; + break; + case 3: + sTVShowState = 10; + break; + } + break; + case 7: + StringCopy(gStringVar1, gMoveNames[show->breakingNews.lastUsedMove]); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.poke1Species]); + sTVShowState = 8; + break; + case 12: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + sTVShowState = 8; + break; + case 8: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + GetMapName(gStringVar2, show->breakingNews.location, 0); + sTVShowState = 11; + break; + case 9: + case 10: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + GetMapName(gStringVar3, show->breakingNews.location, 0); + sTVShowState = 11; + break; + case 11: + TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); + TVShowDone(); + break; + } + ShowFieldMessage(sTVBreakinsNewsTextGroup[state]); +} + +void DoTVShowSecretBaseVisit(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->secretBaseVisit.playerName, show->secretBaseVisit.language); + if (show->secretBaseVisit.nDecorations == 0) + { + sTVShowState = 2; + } + else + { + sTVShowState = 1; + } + break; + case 1: + StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[0]].name); + if (show->secretBaseVisit.nDecorations == 1) + { + sTVShowState = 4; + } + else + { + sTVShowState = 3; + } + break; + case 3: + StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[1]].name); + switch (show->secretBaseVisit.nDecorations) + { + case 2: + sTVShowState = 7; + break; + case 3: + sTVShowState = 6; + break; + case 4: + sTVShowState = 5; + break; + } + break; + case 5: + StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[2]].name); + StringCopy(gStringVar3, gDecorations[show->secretBaseVisit.decorations[3]].name); + sTVShowState = 8; + break; + case 6: + StringCopy(gStringVar2, gDecorations[show->secretBaseVisit.decorations[2]].name); + sTVShowState = 8; + break; + case 2: + case 4: + case 7: + sTVShowState = 8; + break; + case 8: + TVShowConvertInternationalString(gStringVar1, show->secretBaseVisit.playerName, show->secretBaseVisit.language); + if (show->secretBaseVisit.avgLevel < 25) + { + sTVShowState = 12; + } + else if (show->secretBaseVisit.avgLevel < 50) + { + sTVShowState = 11; + } + else if (show->secretBaseVisit.avgLevel < 70) + { + sTVShowState = 10; + } + else + { + sTVShowState = 9; + } + break; + case 9: + case 10: + case 11: + case 12: + TVShowConvertInternationalString(gStringVar1, show->secretBaseVisit.playerName, show->secretBaseVisit.language); + StringCopy(gStringVar2, gSpeciesNames[show->secretBaseVisit.species]); + StringCopy(gStringVar3, gMoveNames[show->secretBaseVisit.move]); + sTVShowState = 13; + break; + case 13: + TVShowDone(); + break; + } + ShowFieldMessage(sTVSecretBaseVisitTextGroup[state]); +} + +void DoTVShowPokemonLotteryWinnerFlashReport(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + TVShowConvertInternationalString(gStringVar1, show->lottoWinner.playerName, show->lottoWinner.language); + if (show->lottoWinner.whichPrize == 0) + { + StringCopy(gStringVar2, gText_Jackpot); + } + else if (show->lottoWinner.whichPrize == 1) + { + StringCopy(gStringVar2, gText_First); + } + else if (show->lottoWinner.whichPrize == 2) + { + StringCopy(gStringVar2, gText_Second); + } + else + { + StringCopy(gStringVar2, gText_Third); + } + StringCopy(gStringVar3, ItemId_GetItem(show->lottoWinner.item)->name); + TVShowDone(); + ShowFieldMessage(sTVPokemonLotteryWinnerFlashReportTextGroup[state]); +} + +void DoTVShowThePokemonBattleSeminar(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->battleSeminar.playerName, show->battleSeminar.language); + StringCopy(gStringVar2, gSpeciesNames[show->battleSeminar.species]); + StringCopy(gStringVar3, gSpeciesNames[show->battleSeminar.foeSpecies]); + sTVShowState = 1; + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->battleSeminar.playerName, show->battleSeminar.language); + StringCopy(gStringVar2, gSpeciesNames[show->battleSeminar.foeSpecies]); + StringCopy(gStringVar3, gMoveNames[show->battleSeminar.move]); + sTVShowState = 2; + break; + case 2: + StringCopy(gStringVar1, gSpeciesNames[show->battleSeminar.species]); + switch (show->battleSeminar.nOtherMoves) + { + case 1: + sTVShowState = 5; + break; + case 2: + sTVShowState = 4; + break; + case 3: + sTVShowState = 3; + break; + default: + sTVShowState = 6; + break; + } + break; + case 3: + StringCopy(gStringVar1, gMoveNames[show->battleSeminar.otherMoves[0]]); + StringCopy(gStringVar2, gMoveNames[show->battleSeminar.otherMoves[1]]); + StringCopy(gStringVar3, gMoveNames[show->battleSeminar.otherMoves[2]]); + sTVShowState = 6; + break; + case 4: + StringCopy(gStringVar1, gMoveNames[show->battleSeminar.otherMoves[0]]); + StringCopy(gStringVar2, gMoveNames[show->battleSeminar.otherMoves[1]]); + sTVShowState = 6; + break; + case 5: + StringCopy(gStringVar2, gMoveNames[show->battleSeminar.otherMoves[0]]); + sTVShowState = 6; + break; + case 6: + StringCopy(gStringVar1, gMoveNames[show->battleSeminar.betterMove]); + StringCopy(gStringVar2, gMoveNames[show->battleSeminar.move]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVThePokemonBattleSeminarTextGroup[state]); +} + +void DoTVShowTrainerFanClubSpecial(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + CopyEasyChatWord(gStringVar3, show->fanClubSpecial.words[0]); + if (show->fanClubSpecial.score >= 90) + { + sTVShowState = 1; + } + else if (show->fanClubSpecial.score >= 70) + { + sTVShowState = 2; + } + else if (show->fanClubSpecial.score >= 30) + { + sTVShowState = 3; + } + else + { + sTVShowState = 4; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + TV_PrintIntToStringVar(2, show->fanClubSpecial.score); + sTVShowState = 5; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + TV_PrintIntToStringVar(2, show->fanClubSpecial.score); + sTVShowState = 5; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + TV_PrintIntToStringVar(2, show->fanClubSpecial.score); + sTVShowState = 5; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + TV_PrintIntToStringVar(2, show->fanClubSpecial.score); + sTVShowState = 5; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->fanClubSpecial.idolName, show->fanClubSpecial.idolNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->fanClubSpecial.playerName, show->fanClubSpecial.language); + CopyEasyChatWord(gStringVar3, show->fanClubSpecial.words[0]); + TVShowDone(); + break; + } + ShowFieldMessage(sTVTrainerFanClubSpecialTextGroup[state]); +} + +void DoTVShowTrainerFanClub(void) +{ + TVShow *show; + u8 state; + u32 playerId; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->trainerFanClub.playerName, show->trainerFanClub.language); + playerId = ((show->common.trainerIdHi << 8) + show->common.trainerIdLo); + switch (playerId % 10) + { + case 0: + sTVShowState = 1; + break; + case 1: + sTVShowState = 2; + break; + case 2: + sTVShowState = 3; + break; + case 3: + sTVShowState = 4; + break; + case 4: + sTVShowState = 5; + break; + case 5: + sTVShowState = 6; + break; + case 6: + sTVShowState = 7; + break; + case 7: + sTVShowState = 8; + break; + case 8: + sTVShowState = 9; + break; + case 9: + sTVShowState = 10; + break; + } + break; + case 1: + sTVShowState = 11; + break; + case 2: + sTVShowState = 11; + break; + case 3: + sTVShowState = 11; + break; + case 4: + sTVShowState = 11; + break; + case 5: + sTVShowState = 11; + break; + case 6: + sTVShowState = 11; + break; + case 7: + sTVShowState = 11; + break; + case 8: + sTVShowState = 11; + break; + case 9: + sTVShowState = 11; + break; + case 10: + sTVShowState = 11; + break; + case 11: + TVShowConvertInternationalString(gStringVar1, show->trainerFanClub.playerName, show->trainerFanClub.language); + CopyEasyChatWord(gStringVar2, show->trainerFanClub.words[0]); + CopyEasyChatWord(gStringVar3, show->trainerFanClub.words[1]); + TVShowDone(); + } + ShowFieldMessage(sTVTrainerFanClubTextGroup[state]); +} + +void DoTVShowSpotTheCuties(void) +{ + TVShow *show; + u8 state; + u32 playerId; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->cuties.playerName, show->cuties.language); + TVShowConvertInternationalString(gStringVar2, show->cuties.nickname, show->cuties.pokemonNameLanguage); + if (show->cuties.nRibbons < 10) + { + sTVShowState = 1; + } + else if (show->cuties.nRibbons < 20) + { + sTVShowState = 2; + } + else + { + sTVShowState = 3; + } + break; + case 1: + case 2: + case 3: + TVShowConvertInternationalString(gStringVar1, show->cuties.playerName, show->cuties.language); + TVShowConvertInternationalString(gStringVar2, show->cuties.nickname, show->cuties.pokemonNameLanguage); + TV_PrintIntToStringVar(2, show->cuties.nRibbons); + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar2, show->cuties.nickname, show->cuties.pokemonNameLanguage); + switch (show->cuties.selectedRibbon) + { + case 0: + sTVShowState = 5; + break; + case 1: + case 2: + case 3: + case 4: + sTVShowState = 6; + break; + case 5: + case 6: + case 7: + case 8: + sTVShowState = 7; + break; + case 9: + case 10: + case 11: + case 12: + sTVShowState = 8; + break; + case 13: + case 14: + case 15: + case 16: + sTVShowState = 9; + break; + case 17: + case 18: + case 19: + case 20: + sTVShowState = 10; + break; + case 21: + sTVShowState = 11; + break; + case 22: + sTVShowState = 12; + break; + case 23: + sTVShowState = 13; + break; + case 24: + sTVShowState = 14; + break; + } + break; + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + TVShowConvertInternationalString(gStringVar2, show->cuties.nickname, show->cuties.pokemonNameLanguage); + sTVShowState = 15; + break; + case 15: + TVShowDone(); + } + ShowFieldMessage(sTVCutiesTextGroup[state]); +} + +void DoTVShowPokemonNewsBattleFrontier(void) +{ + TVShow *show; + u8 state; + u32 playerId; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + switch (show->frontier.facility) + { + case 1: + sTVShowState = 1; + break; + case 2: + sTVShowState = 2; + break; + case 3: + sTVShowState = 3; + break; + case 4: + sTVShowState = 4; + break; + case 5: + sTVShowState = 5; + break; + case 6: + sTVShowState = 6; + break; + case 7: + sTVShowState = 7; + break; + case 8: + sTVShowState = 8; + break; + case 9: + sTVShowState = 9; + break; + case 10: + sTVShowState = 10; + break; + case 11: + sTVShowState = 11; + break; + case 12: + sTVShowState = 12; + break; + case 13: + sTVShowState = 13; + break; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 16; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 15; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 15; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 8: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 9: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 10: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 11: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 12: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 13: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TV_PrintIntToStringVar(1, show->frontier.winStreak); + sTVShowState = 14; + break; + case 14: + StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); + StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); + StringCopy(gStringVar3, gSpeciesNames[show->frontier.species3]); + sTVShowState = 18; + break; + case 15: + StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); + StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); + sTVShowState = 18; + break; + case 16: + StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); + StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); + StringCopy(gStringVar3, gSpeciesNames[show->frontier.species3]); + sTVShowState = 17; + break; + case 17: + StringCopy(gStringVar1, gSpeciesNames[show->frontier.species4]); + sTVShowState = 18; + break; + case 18: + TVShowConvertInternationalString(gStringVar1, show->frontier.playerName, show->frontier.language); + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonNewsBattleFrontierTextGroup[state]); +} + +void DoTVShowWhatsNo1InHoennToday(void) +{ + TVShow *show; + u8 state; + u32 playerId; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + switch (show->numberOne.actionIdx) + { + case 0: + sTVShowState = 1; + break; + case 1: + sTVShowState = 2; + break; + case 2: + sTVShowState = 3; + break; + case 3: + sTVShowState = 4; + break; + case 4: + sTVShowState = 5; + break; + case 5: + sTVShowState = 6; + break; + case 6: + sTVShowState = 7; + break; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 2: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TV_PrintIntToStringVar(1, show->numberOne.count); + sTVShowState = 8; + break; + case 8: + TVShowConvertInternationalString(gStringVar1, show->numberOne.playerName, show->numberOne.language); + TVShowDone(); + break; + } + ShowFieldMessage(sTVWhatsNo1InHoennTodayTextGroup[state]); +} + +u8 sub_80F5180(TVShow *show) +{ + u8 i; + u8 tot; + + for (i = 0, tot = 0; i < 32; i ++) + { + if ((show->secretBaseSecrets.flags >> i) & 1) + { + tot ++; + } + } + return tot; +} + +u8 sub_80F51AC(TVShow *show, u8 a1) +{ + u8 i; + u8 tot; + + for (i = 0, tot = 0; i < 32; i ++) + { + if ((show->secretBaseSecrets.flags >> i) & 1) + { + if (tot == a1) + { + return sTVSecretBaseSecretsStateLookup[i]; + } + tot ++; + } + } + return 0; +} + +void DoTVShowSecretBaseSecrets(void) +{ + TVShow *show; + u8 state; + u8 bitCount; + u16 i; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + bitCount = sub_80F5180(show); + if (bitCount == 0) + { + sTVShowState = 8; + } + else + { + show->secretBaseSecrets.savedState = 1; + sTVSecretBaseSecretsRandomValues[0] = Random() % bitCount; + sTVShowState = sub_80F51AC(show, sTVSecretBaseSecretsRandomValues[0]); + } + break; + case 1: + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + bitCount = sub_80F5180(show); + switch (bitCount) + { + case 1: + sTVShowState = 9; + break; + case 2: + show->secretBaseSecrets.savedState = 2; + if (sTVSecretBaseSecretsRandomValues[0] == 0) + { + sTVShowState = sub_80F51AC(show, 1); + } + else + { + sTVShowState = sub_80F51AC(show, 0); + } + break; + default: + for (i = 0; i < 0xFFFF; i ++) + { + sTVSecretBaseSecretsRandomValues[1] = Random() % bitCount; + if (sTVSecretBaseSecretsRandomValues[1] != sTVSecretBaseSecretsRandomValues[0]) + { + break; + } + } + show->secretBaseSecrets.savedState = 2; + sTVShowState = sub_80F51AC(show, sTVSecretBaseSecretsRandomValues[1]); + break; + } + break; + case 2: + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + bitCount = sub_80F5180(show); + if (bitCount == 2) + { + sTVShowState = 9; + } + else + { + for (i = 0; i < 0xFFFF; i ++) + { + sTVSecretBaseSecretsRandomValues[2] = Random() % bitCount; + if (sTVSecretBaseSecretsRandomValues[2] != sTVSecretBaseSecretsRandomValues[0] && sTVSecretBaseSecretsRandomValues[2] != sTVSecretBaseSecretsRandomValues[1]) + { + break; + } + } + show->secretBaseSecrets.savedState = 3; + sTVShowState = sub_80F51AC(show, sTVSecretBaseSecretsRandomValues[2]); + } + break; + case 3: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + TV_PrintIntToStringVar(2, show->secretBaseSecrets.stepsInBase); + if (show->secretBaseSecrets.stepsInBase <= 30) + { + sTVShowState = 4; + } + else if (show->secretBaseSecrets.stepsInBase <= 100) + { + sTVShowState = 5; + } + else + { + sTVShowState = 6; + } + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + sTVShowState = 7; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + sTVShowState = 7; + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + sTVShowState = 7; + break; + case 7: + TVShowConvertInternationalString(gStringVar1, show->secretBaseSecrets.baseOwnersName, show->secretBaseSecrets.baseOwnersNameLanguage); + TVShowConvertInternationalString(gStringVar2, show->secretBaseSecrets.playerName, show->secretBaseSecrets.language); + TVShowDone(); + break; + case 8: + sTVShowState = 3; + break; + case 9: + sTVShowState = 3; + break; + case 10: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 11: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 12: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 13: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 14: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 15: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 16: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 17: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 18: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 19: + StringCopy(gStringVar2, ItemId_GetItem(show->secretBaseSecrets.item)->name); + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 20: + if (show->common.trainerIdLo & 1) + { + sTVShowState = 22; + } + else + { + sTVShowState = 21; + } + break; + case 21: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 22: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 23: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 24: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 25: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 26: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 27: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 28: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 29: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 30: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 31: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 32: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 33: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 34: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 35: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 36: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 37: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 38: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 39: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 40: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 41: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 42: + sTVShowState = show->secretBaseSecrets.savedState; + break; + case 43: + sTVShowState = show->secretBaseSecrets.savedState; + break; + } + ShowFieldMessage(sTVSecretBaseSecretsTextGroup[state]); +} + +void DoTVShowSafariFanClub(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + if (show->safariFanClub.nMonsCaught == 0) + { + sTVShowState = 6; + } + else if (show->safariFanClub.nMonsCaught < 4) + { + sTVShowState = 5; + } + else + { + sTVShowState = 1; + } + break; + case 1: + TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); + TV_PrintIntToStringVar(1, show->safariFanClub.nMonsCaught); + if (show->safariFanClub.nPkblkUsed == 0) + { + sTVShowState = 3; + } + else + { + sTVShowState = 2; + } + break; + case 2: + TV_PrintIntToStringVar(1, show->safariFanClub.nPkblkUsed); + sTVShowState = 4; + break; + case 3: + sTVShowState = 4; + break; + case 4: + TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); + sTVShowState = 10; + break; + case 5: + TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); + TV_PrintIntToStringVar(1, show->safariFanClub.nMonsCaught); + if (show->safariFanClub.nPkblkUsed == 0) + { + sTVShowState = 8; + } + else + { + sTVShowState = 7; + } + break; + case 6: + TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); + if (show->safariFanClub.nPkblkUsed == 0) + { + sTVShowState = 8; + } + else + { + sTVShowState = 7; + } + break; + case 7: + TV_PrintIntToStringVar(1, show->safariFanClub.nPkblkUsed); + sTVShowState = 9; + break; + case 8: + sTVShowState = 9; + break; + case 9: + TVShowConvertInternationalString(gStringVar1, show->safariFanClub.playerName, show->safariFanClub.language); + sTVShowState = 10; + break; + case 10: + TVShowDone(); + } + ShowFieldMessage(sTVSafariFanClubTextGroup[state]); +} + +void DoTVShowPokemonContestLiveUpdates2(void) +{ + TVShow *show; + u8 state; + + show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; + gScriptResult = FALSE; + state = sTVShowState; + switch (state) + { + case 0: + sub_818E868(gStringVar1, show->contestLiveUpdates2.contestCategory); + if (show->contestLiveUpdates2.pokeblockState == 1) + { + sTVShowState = 1; + } + else if (show->contestLiveUpdates2.pokeblockState == 0) + { + sTVShowState = 2; + } + else + { + sTVShowState = 3; + } + break; + case 1: + case 2: + TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates2.playerName, show->contestLiveUpdates2.language); + case 3: + TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates2.nickname, show->contestLiveUpdates2.pokemonNameLanguage); + TVShowDone(); + break; + } + ShowFieldMessage(sTVPokemonContestLiveUpdates2TextGroup[state]); +} + +void TVShowDone(void) +{ + gScriptResult = TRUE; + sTVShowState = 0; + gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004].common.active = FALSE; +} + +void ResetTVShowState(void) +{ + sTVShowState = 0; +} diff --git a/sym_bss.txt b/sym_bss.txt index f32300b15..db7495182 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -25,16 +25,9 @@ .include "src/fldeff_cut.o" .include "src/script_menu.o" .include "src/record_mixing.o" + .include "src/tv.o" -gUnknown_03001174: @ 3001174 - .space 0x1 - -gUnknown_03001175: @ 3001175 - .space 0x1 - -gUnknown_03001176: @ 3001176 - .space 0x2 - + .space 1 @ TODO: define this u32 in mauville_old_man gUnknown_03001178: @ 3001178 .space 0x4 diff --git a/sym_common.txt b/sym_common.txt index 7ba414cab..acc6cf862 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -210,13 +210,7 @@ gBattleMainFunc: @ 3005D04 .space 0xC gBattleResults: @ 3005D10 - .space 0x2A - -gUnknown_03005D3A: @ 3005D3A - .space 0xC - -gUnknown_03005D46: @ 3005D46 - .space 0xE + .space 0x44 gLeveledUpInBattle: @ 3005D54 .space 0xC @@ -326,17 +320,7 @@ gUnknown_030060B4: @ 30060B4 gUnknown_030060B8: @ 30060B8 .space 0x4 -gUnknown_030060BC: @ 30060BC - .space 0x4 - -gUnknown_030060C0: @ 30060C0 - .space 0x10 - -gUnknown_030060D0: @ 30060D0 - .space 0x10 - -gUnknown_030060E0: @ 30060E0 - .space 0x50 + .include "tv.o" gUnknown_03006130: @ 3006130 .space 0x34 @@ -393,7 +377,7 @@ gUnknown_030061EC: @ 30061EC .space 0x4 .include"save.o" - + .space 0x8 gRamSaveSectionLocations: @ 3006220 diff --git a/sym_ewram.txt b/sym_ewram.txt index 944a51b62..6f7b4b4d8 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1029,16 +1029,7 @@ gBagPockets: @ 2039DD8 .space 0x28 gUnknown_02039E00: @ 2039E00 - .space 0x2 - -gUnknown_02039E02: @ 2039E02 - .space 0xB - -gUnknown_02039E0D: @ 2039E0D - .space 0x11 - -gUnknown_02039E1E: @ 2039E1E - .space 0xE2 + .space 0x100 gUnknown_02039F00: @ 2039F00 .space 0x8 @@ -1145,26 +1136,7 @@ gUnknown_0203A01D: @ 203A01D gUnknown_0203A020: @ 203A020 .space 0x4 -gUnknown_0203A024: @ 203A024 - .space 0x2 - -gUnknown_0203A026: @ 203A026 - .space 0x2 - -gUnknown_0203A028: @ 203A028 - .space 0x2 - -gUnknown_0203A02A: @ 203A02A - .space 0x2 - -gUnknown_0203A02C: @ 203A02C - .space 0x4 - -gUnknown_0203A030: @ 203A030 - .space 0x1 - -gUnknown_0203A031: @ 203A031 - .space 0x3 + .include "src/tv.o" gUnknown_0203A034: @ 203A034 .space 0x4