Merge pull request #149 from Kermalis/kermalis-text-cleanup

Text, Filename, .h, extern, and Debug cleanup
This commit is contained in:
Cheng Hann Gan 2023-08-10 23:44:49 -04:00 committed by GitHub
commit 20ad405a46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
133 changed files with 4593 additions and 5819 deletions

View File

@ -1,230 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_800B720
sub_800B720:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x14
str r1, [sp]
lsls r0, 16
asrs r0, 16
str r0, [sp, 0xC]
bl DisableInterrupts
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x4]
ldr r0, _0800B780
mov r8, r0
ldr r1, _0800B784
mov r10, r1
ldr r2, _0800B788
mov r9, r2
ldr r5, _0800B78C
mov r12, r5
_0800B74E:
movs r7, 0
str r7, [sp, 0x10]
movs r4, 0
ldr r3, _0800B784
mov r1, r8
movs r2, 0
ldrsh r0, [r1, r2]
ldr r6, _0800B78C
ldr r5, [sp, 0xC]
lsls r5, 16
str r5, [sp, 0x8]
cmp r4, r0
bge _0800B7BA
movs r7, 0
ldrsh r1, [r3, r7]
ldrh r2, [r6]
movs r5, 0
ldrsh r0, [r6, r5]
cmp r1, r0
bne _0800B790
adds r0, r2, 0x1
mov r7, r9
ands r0, r7
strh r0, [r6]
b _0800B74E
.align 2, 0
_0800B780: .4byte gUnknown_203B0AA
_0800B784: .4byte gUnknown_202D608
_0800B788: .4byte 0x00007fff
_0800B78C: .4byte gUnknown_203B0A8
_0800B790:
adds r4, 0x1
adds r3, 0x8
mov r1, r8
movs r2, 0
ldrsh r0, [r1, r2]
cmp r4, r0
bge _0800B7BA
movs r5, 0
ldrsh r1, [r3, r5]
mov r7, r12
ldrh r2, [r7]
movs r5, 0
ldrsh r0, [r7, r5]
cmp r1, r0
bne _0800B790
adds r0, r2, 0x1
mov r7, r9
ands r0, r7
strh r0, [r6]
movs r0, 0x1
str r0, [sp, 0x10]
_0800B7BA:
ldr r1, [sp, 0x10]
cmp r1, 0
bne _0800B74E
movs r4, 0
mov r3, r10
ldr r2, _0800B84C
movs r5, 0
ldrsh r1, [r2, r5]
cmp r4, r1
bge _0800B7EA
movs r7, 0x2
ldrsh r0, [r3, r7]
ldr r2, [sp, 0xC]
cmp r0, r2
bgt _0800B7EA
_0800B7D8:
adds r4, 0x1
adds r3, 0x8
cmp r4, r1
bge _0800B7EA
movs r5, 0x2
ldrsh r0, [r3, r5]
ldr r7, [sp, 0xC]
cmp r0, r7
ble _0800B7D8
_0800B7EA:
ldr r1, _0800B84C
movs r2, 0
ldrsh r0, [r1, r2]
subs r2, r0, 0x1
lsls r0, r2, 3
mov r5, r10
adds r3, r0, r5
lsls r5, r4, 3
cmp r2, r4
blt _0800B80E
_0800B7FE:
ldr r0, [r3]
ldr r1, [r3, 0x4]
str r0, [r3, 0x8]
str r1, [r3, 0xC]
subs r2, 0x1
subs r3, 0x8
cmp r2, r4
bge _0800B7FE
_0800B80E:
ldr r7, _0800B84C
ldrh r0, [r7]
adds r0, 0x1
strh r0, [r7]
mov r0, r10
adds r1, r5, r0
ldrh r0, [r6]
strh r0, [r1]
ldr r2, [sp, 0x8]
lsrs r0, r2, 16
strh r0, [r1, 0x2]
mov r0, r10
adds r0, 0x4
adds r0, r5, r0
ldr r5, [sp]
str r5, [r0]
ldr r7, [sp, 0x4]
cmp r7, 0
beq _0800B838
bl EnableInterrupts
_0800B838:
movs r1, 0
ldrsh r0, [r6, r1]
add sp, 0x14
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.align 2, 0
_0800B84C: .4byte gUnknown_203B0AA
thumb_func_end sub_800B720
thumb_func_start sub_800B850
sub_800B850:
push {r4-r7,lr}
lsls r0, 16
asrs r6, r0, 16
bl DisableInterrupts
lsls r0, 24
lsrs r5, r0, 24
movs r2, 0
ldr r4, _0800B8A0
ldr r3, _0800B8A4
movs r1, 0
ldrsh r0, [r3, r1]
cmp r2, r0
bge _0800B8B4
adds r1, r3, 0
_0800B86E:
movs r7, 0
ldrsh r0, [r4, r7]
cmp r0, r6
bne _0800B8A8
ldrh r0, [r1]
subs r0, 0x1
strh r0, [r1]
movs r3, 0
ldrsh r0, [r1, r3]
cmp r2, r0
bge _0800B896
ldr r3, _0800B8A4
_0800B886:
ldr r0, [r4, 0x8]
ldr r1, [r4, 0xC]
stm r4!, {r0,r1}
adds r2, 0x1
movs r7, 0
ldrsh r0, [r3, r7]
cmp r2, r0
blt _0800B886
_0800B896:
cmp r5, 0
beq _0800B8BC
bl EnableInterrupts
b _0800B8BC
.align 2, 0
_0800B8A0: .4byte gUnknown_202D608
_0800B8A4: .4byte gUnknown_203B0AA
_0800B8A8:
adds r2, 0x1
adds r4, 0x8
movs r7, 0
ldrsh r0, [r3, r7]
cmp r2, r0
blt _0800B86E
_0800B8B4:
cmp r5, 0
beq _0800B8BC
bl EnableInterrupts
_0800B8BC:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_800B850
.align 2, 0 @ Don't pad with nop.

View File

@ -1,207 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_801D220
sub_801D220:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
ldr r4, _0801D248
ldr r0, [r4]
adds r0, 0xB8
bl sub_8006518
ldr r0, [r4]
ldr r0, [r0, 0x10]
cmp r0, 0
beq _0801D250
cmp r0, 0x1
beq _0801D2C0
movs r2, 0
adds r7, r4, 0
ldr r3, _0801D24C
b _0801D368
.align 2, 0
_0801D248: .4byte gUnknown_203B250
_0801D24C: .4byte gUnknown_80DBE7C
_0801D250:
bl sub_801D4C0
ldr r0, [r4]
ldr r0, [r0]
cmp r0, 0
beq _0801D290
adds r7, r4, 0
ldr r0, _0801D288
mov r9, r0
mov r12, r7
ldr r2, _0801D28C
mov r8, r2
movs r3, 0
movs r2, 0x3
_0801D26C:
mov r4, r12
ldr r1, [r4]
adds r1, r3
adds r1, 0xB8
mov r0, r8
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
adds r3, 0x18
subs r2, 0x1
cmp r2, 0
bge _0801D26C
b _0801D2F6
.align 2, 0
_0801D288: .4byte gUnknown_80DBE98
_0801D28C: .4byte gUnknown_80DBE7C
_0801D290:
adds r7, r4, 0
mov r8, r7
ldr r6, _0801D2BC
mov r9, r6
movs r3, 0
movs r2, 0x3
_0801D29C:
mov r0, r8
ldr r1, [r0]
adds r1, r3
adds r1, 0xB8
mov r0, r9
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
movs r0, 0x18
add r9, r0
adds r3, 0x18
subs r2, 0x1
cmp r2, 0
bge _0801D29C
b _0801D34E
.align 2, 0
_0801D2BC: .4byte gUnknown_80DBEB0
_0801D2C0:
bl sub_801D4C0
ldr r0, [r4]
ldr r0, [r0]
cmp r0, 0
beq _0801D324
adds r7, r4, 0
ldr r2, _0801D31C
mov r9, r2
mov r8, r7
ldr r3, _0801D320
mov r12, r3
movs r3, 0
movs r2, 0x3
_0801D2DC:
mov r4, r8
ldr r1, [r4]
adds r1, r3
adds r1, 0xB8
mov r0, r12
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
adds r3, 0x18
subs r2, 0x1
cmp r2, 0
bge _0801D2DC
_0801D2F6:
ldr r1, [r7]
adds r1, 0xB8
mov r0, r9
ldm r0!, {r2,r5,r6}
stm r1!, {r2,r5,r6}
ldm r0!, {r3-r5}
stm r1!, {r3-r5}
ldr r1, [r7]
adds r0, r1, 0
adds r0, 0xB8
adds r1, 0x68
bl sub_8012CAC
ldr r0, [r7]
adds r0, 0xC4
movs r1, 0x9
strh r1, [r0]
b _0801D384
.align 2, 0
_0801D31C: .4byte gUnknown_80DBE98
_0801D320: .4byte gUnknown_80DBE7C
_0801D324:
adds r7, r4, 0
mov r8, r7
ldr r6, _0801D364
mov r9, r6
movs r3, 0
movs r2, 0x3
_0801D330:
mov r0, r8
ldr r1, [r0]
adds r1, r3
adds r1, 0xB8
mov r0, r9
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
ldm r0!, {r4-r6}
stm r1!, {r4-r6}
movs r0, 0x18
add r9, r0
adds r3, 0x18
subs r2, 0x1
cmp r2, 0
bge _0801D330
_0801D34E:
ldr r1, [r7]
adds r0, r1, 0
adds r0, 0xB8
adds r1, 0x68
bl sub_8012CAC
ldr r0, [r7]
adds r0, 0xC4
movs r1, 0x8
strh r1, [r0]
b _0801D384
.align 2, 0
_0801D364: .4byte gUnknown_80DBEB0
_0801D368:
ldr r0, [r7]
lsls r1, r2, 1
adds r1, r2
lsls r1, 3
adds r0, r1
adds r0, 0xB8
adds r1, r3, 0
ldm r1!, {r4-r6}
stm r0!, {r4-r6}
ldm r1!, {r4-r6}
stm r0!, {r4-r6}
adds r2, 0x1
cmp r2, 0x3
ble _0801D368
_0801D384:
bl ResetUnusedInputStruct
ldr r0, _0801D3A4
ldr r0, [r0]
adds r0, 0xB8
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0801D3A4: .4byte gUnknown_203B250
thumb_func_end sub_801D220
.align 2,0

View File

@ -1,57 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_803ABC8
sub_803ABC8:
push {r4-r6,lr}
movs r5, 0
movs r6, 0x1
_0803ABCE:
ldr r2, _0803AC08
movs r0, 0x58
adds r1, r5, 0
muls r1, r0
ldr r0, [r2]
adds r2, r0, r1
ldrh r1, [r2]
adds r0, r6, 0
ands r0, r1
cmp r0, 0
beq _0803AC10
lsrs r0, r1, 1
ands r0, r6
cmp r0, 0
beq _0803AC10
ldr r0, _0803AC0C
ldr r4, [r0]
movs r1, 0x8
ldrsh r0, [r2, r1]
bl GetFriendArea
ldrb r1, [r4, 0x4]
lsls r0, 24
lsrs r0, 24
cmp r1, r0
bne _0803AC10
movs r0, 0
b _0803AC1C
.align 2, 0
_0803AC08: .4byte gRecruitedPokemonRef
_0803AC0C: .4byte gUnknown_203B3F4
_0803AC10:
adds r5, 0x1
movs r0, 0xCE
lsls r0, 1
cmp r5, r0
ble _0803ABCE
movs r0, 0x1
_0803AC1C:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_803ABC8
.align 2,0

3093
asm/text.s

File diff suppressed because it is too large Load Diff

View File

@ -1823,12 +1823,15 @@ gUnknown_80B853C: @ 80B853C
.global gUnknown_80B857C
gUnknown_80B857C: @ 80B857C
.4byte 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0
@ Type: UnkTextStruct2[4]
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.4byte 0, 3, 0, 0, 0, 0
.global gUnknown_80B85DC
gUnknown_80B85DC: @ 80B85DC
@ Some kind of bit shifting and masking table
@ byte1, byte2, shift_left, shift_right
@ Type: unkShiftData[8]
.4byte 0xFFFFFFFF, 0x00000000, 0x00, 0x20
.4byte 0x0FFFFFFF, 0xF0000000, 0x04, 0x1C
.4byte 0x00FFFFFF, 0xFF000000, 0x08, 0x18
@ -1911,6 +1914,7 @@ gUnknown_80B8814: @ 80B8814
.global gUnknown_80B8824
gUnknown_80B8824: @ 80B8824
@ Type: unkStruct_80B8824
.byte 0x00, 0x00, 0x00, 0x00
.byte 0x0f, 0x00, 0x00, 0x00
.byte 0xff, 0x00, 0x00, 0x00
@ -1923,6 +1927,7 @@ gUnknown_80B8824: @ 80B8824
.global gUnknown_80B8848
gUnknown_80B8848: @ 80B8848
@ Type: unkStruct_80B8848
.byte 0x0F, 0x00, 0x00, 0x00
.byte 0xF0, 0x00, 0x00, 0x00
.byte 0x00, 0x0F, 0x00, 0x00

View File

@ -0,0 +1,6 @@
#ifndef GUARD_BG_PALETTE_BUFFER_H
#define GUARD_BG_PALETTE_BUFFER_H
void InitBGPaletteBuffer(void);
#endif // GUARD_BG_PALETTE_BUFFER_H

View File

@ -1,6 +0,0 @@
#ifndef GUARD_CODE_800B540_H
#define GUARD_CODE_800B540_H
void sub_800CDA8(int a0);
#endif //GUARD_CODE_800B540_H

8
include/code_8012A18_1.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CODE_8012A18_H
#define GUARD_CODE_8012A18_H
u32 sub_801602C(u32, u8 *);
u32 sub_8016080(void);
void sub_80160D8(void);
#endif // GUARD_CODE_8012A18_H

16
include/code_80130A8.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef GUARD_CODE_80130A8_H
#define GUARD_CODE_80130A8_H
#include "file_system.h"
#include "menu.h"
// code_80130A8.s
extern void sub_8013AA0(u32 *);
extern u32 sub_8013BBC(u32 *);
extern void sub_8013C68(u32 *);
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern s32 sub_80144A4(s32 *);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
#endif // GUARD_CODE_80130A8_H

28
include/code_801B3C0.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef GUARD_CODE_801B3C0_H
#define GUARD_CODE_801B3C0_H
#include "input.h"
#include "item.h"
#include "subStruct_203B240.h"
#include "text.h"
// size: 0x94
struct unkStruct_203B230
{
s32 state;
struct Item item;
s32 unk8;
s32 unkC;
struct subStruct_203B240 *unk10[2];
u8 fill18[0x20 - 0x18];
u32 unk20;
u32 unk24;
struct UnkTextStruct2 unk28[4];
struct MenuInputStructSub unk88;
};
u32 sub_801B3C0(struct Item *);
u32 sub_801B410(void);
void sub_801B450(void);
#endif // GUARD_CODE_801B3C0_H

18
include/code_801C620.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef GUARD_CODE_801C620_H
#define GUARD_CODE_801C620_H
#include "text.h"
bool8 sub_801C8C4(s32, s32, struct UnkTextStruct2_sub *, u32);
extern u32 sub_801CA08(bool8);
u8 sub_801CB24(void);
void sub_801CB5C(bool8);
void sub_801CBB8(void);
void sub_801CCD8(void);
bool8 sub_801CF14(s32);
bool8 sub_801CF50(s32);
void sub_801CF94(void);
s32 sub_801CFB8(void);
u32 sub_801CFE0(u8);
#endif // GUARD_CODE_801C620_H

View File

@ -1,6 +1,10 @@
#ifndef CODE_801EE10_H
#define CODE_801EE10_H
#include "input.h"
#include "pokemon.h"
#include "text.h"
struct unkStruct_203B270
{
// size 0xBC

12
include/code_801EE10_1.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef GUARD_CODE_801EE10_1_H
#define GUARD_CODE_801EE10_1_H
// code_801EE10_1.s
extern void sub_8023868(u32, u32, u32, u32);
extern u32 sub_8023A94(bool8);
extern s16 sub_8023B44(void);
extern void sub_8023B7C(u32);
extern void sub_8023C60(void);
extern void sub_8023DA4(void);
#endif // GUARD_CODE_801EE10_1_H

View File

@ -0,0 +1,7 @@
#ifndef GUARD_CODE_801EE10_MID_H
#define GUARD_CODE_801EE10_MID_H
// code_801EE10_mid.s
extern void sub_8021494(void);
#endif // GUARD_CODE_801EE10_MID_H

8
include/code_8021774.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CODE_8021774_H
#define GUARD_CODE_8021774_H
bool8 sub_8021774(u8, u8, s32);
u32 sub_80217EC(void);
void sub_8021830(void);
#endif // GUARD_CODE_8021774_H

View File

@ -0,0 +1,10 @@
#ifndef GUARD_CODE_8021774_PRE_H
#define GUARD_CODE_8021774_PRE_H
bool8 sub_80211AC(u32, u32);
u32 sub_8021274(bool8);
u8 sub_802132C(void);
void sub_8021354(bool8);
void sub_80213A0(void);
#endif // GUARD_CODE_8021774_PRE_H

View File

@ -67,5 +67,4 @@ s32 GetFirstIndexofMailType(u8 mailType);
void sub_8095824(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b);
void sub_8095774(struct unkStruct_8094924 * a, struct unkStruct_203B480 *b);
#endif
#endif

25
include/code_8097670.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef GUARD_CODE_8097670_H
#define GUARD_CODE_8097670_H
#include "dungeon_global_data.h"
// size: 0xC4
struct unkStruct_203B494
{
u32 unk0; // 32 bit bitfield, I think
/* 0x4 */ s32 numAdventures;
s32 unk8;
s32 unkC;
/* 0x10 */ struct DungeonLocation dungeonLocation;
s16 unk14;
s16 unk16;
s16 unk18;
u32 unk1C[14];
u32 unk54[14];
u32 unk8C[13];
s32 unkC0;
};
void sub_80976F8(u8);
#endif // GUARD_CODE_8097670_H

8
include/cpu.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CPU_H
#define GUARD_CPU_H
void VBlank_CB(void);
void sub_800CDA8(u32);
#endif //GUARD_CPU_H

View File

@ -1,60 +0,0 @@
#ifndef GUARD_DEBUG_MENU_H
#define GUARD_DEBUG_MENU_H
#include "text.h"
#include "menu.h"
#include "menu_input.h"
enum DebugMenuOptions
{
MENU_DEBUG_MENU_DUNGEONS = 0,
MENU_DEBUG_MENU_FIELD,
MENU_DEBUG_MENU_FIELD_MAP,
MENU_DEBUG_MENU_FIELD_SCRIPT,
MENU_DEBUG_MENU_DEBUG_MENU,
MENU_DEBUG_MENU_UNKNOWN_1,
MENU_DEBUG_MENU_STORAGE,
MENU_DEBUG_MENU_H_OPEN = 9,
};
struct DebugMenu
{
// size: 0x1A4
struct MenuStruct unk0[4];
/* 0x140 */ struct UnkTextStruct2 unk140[4];
u32 fill1A0;
};
struct unkStruct_203B3F8
{
// size: 0x140
u32 state;
s16 unk4;
u16 unk6;
struct PokemonStruct *pokemon;
u32 menuAction;
struct MenuStruct unk10;
u32 unk60;
u32 unk64;
u32 unk68;
u32 unk6C;
u32 unk70;
u32 unk74;
struct UnkTextStruct2 *unk78;
u32 unk7C;
u32 unk80;
u8 fill84[0x90 - 0x84];
struct MenuItem unk90[8];
u16 unkD0[8];
struct UnkTextStruct2 unkE0[4];
};
void CreateDebugMenu(void);
void DeleteDebugMenu(void);
u32 UpdateDebugMenu(void);
void SetDebugMenuItems(void);
void sub_803A3A0(void);
#endif

31
include/debug_menu1.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef GUARD_DEBUG_MENU1_H
#define GUARD_DEBUG_MENU1_H
#include "menu.h"
#include "text.h"
// size: 0x1A4
struct DebugMenu
{
struct MenuStruct unk0[4];
struct UnkTextStruct2 unk140[4];
u32 fill1A0;
};
enum DebugMenuOptions
{
MENU_DEBUG_MENU_DUNGEONS = 0,
MENU_DEBUG_MENU_FIELD,
MENU_DEBUG_MENU_FIELD_MAP,
MENU_DEBUG_MENU_FIELD_SCRIPT,
MENU_DEBUG_MENU_DEBUG_MENU,
MENU_DEBUG_MENU_UNKNOWN_1,
MENU_DEBUG_MENU_STORAGE,
MENU_DEBUG_MENU_H_OPEN = 9,
};
void CreateDebugMenu(void);
void DeleteDebugMenu(void);
u32 UpdateDebugMenu(void);
#endif // GUARD_DEBUG_MENU1_H

28
include/debug_menu2.h Normal file
View File

@ -0,0 +1,28 @@
#ifndef GUARD_DEBUG_MENU2_H
#define GUARD_DEBUG_MENU2_H
#include "menu.h"
#include "text.h"
// size: 0x138
struct unkStruct_203B3F0
{
/* 0x0 */ u32 state;
/* 0x4 */ u8 id;
/* 0x8 */ u32 menuAction;
/* 0xC */ struct MenuItem menuItems[8];
struct MenuStruct unk4C;
u32 unk9C;
u32 unkA0;
u32 unkA4;
u32 unkA8;
u32 unkAC;
u32 unkB0;
struct UnkTextStruct2 *unkB4;
u32 unkB8;
u32 unkBC;
u8 fill4[0xD8 - 0xC0];
struct UnkTextStruct2 unkD8[4];
};
#endif // GUARD_DEBUG_MENU2_H

18
include/debug_menu3.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef GUARD_DEBUG_MENU3_H
#define GUARD_DEBUG_MENU3_H
#include "menu.h"
#include "text.h"
// size: 0xFC
struct unkStruct_203B3F4
{
/* 0x0 */ u32 state;
/* 0x4 */ u8 friendArea;
/* 0x8 */ u32 menuAction;
/* 0xC */ struct MenuItem menuItems[8];
struct MenuStruct unk4C;
struct UnkTextStruct2 unk9C[4];
};
#endif // GUARD_DEBUG_MENU3_H

32
include/debug_menu4.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef GUARD_DEBUG_MENU4_H
#define GUARD_DEBUG_MENU4_H
#include "pokemon.h"
#include "menu.h"
#include "text.h"
// size: 0x140
struct unkStruct_203B3F8
{
/* 0x0 */ u32 state;
s16 unk4;
u16 unk6;
/* 0x8 */ struct PokemonStruct *pokemon;
/* 0xC */ u32 menuAction;
struct MenuStruct unk10;
u32 unk60;
u32 unk64;
u32 unk68;
u32 unk6C;
u32 unk70;
u32 unk74;
struct UnkTextStruct2 *unk78;
u32 unk7C;
u32 unk80;
u8 fill84[0x90 - 0x84];
struct MenuItem unk90[8];
u16 unkD0[8];
struct UnkTextStruct2 unkE0[4];
};
#endif // GUARD_DEBUG_MENU4_H

View File

@ -32,6 +32,7 @@ struct UnkFileStruct1
/* 0x4 */ u32 unk4;
};
void InitFileSystem(void);
struct OpenedFile *OpenFile(const char *filename, const struct FileArchive *arc);
u8 *GetFileDataPtr(struct OpenedFile *openedFile, int unused);
struct OpenedFile *OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);

View File

@ -17,6 +17,8 @@ struct unkStruct_8092638
s32 unk8;
};
extern bool8 *gFriendAreas;
void LoadFriendAreas(void);
bool8 *GetBoughtFriendAreas(void);
void InitializeFriendAreas(void);
@ -28,6 +30,7 @@ u8 *GetFriendAreaDescription(u8 index);
u8 GetFriendAreaUnlockCondition(u8 index);
s32 GetFriendAreaPrice(u8 index);
const char *GetFriendAreaName(u8 index);
void sub_809249C(u8 friendArea, u8 clear);
void sub_8092638(u8 friendArea, struct unkStruct_8092638 *param_2, u8 param_3, u8 param_4);
u32 SaveFriendAreas(u8 *r0, u32 r1);

View File

@ -1,5 +1,5 @@
#ifndef GUARD_INPUT_H
#define GUARD_INPUT_H
#define GUARD_INPUT_H
// size: 0x10
struct Inputs

12
include/main.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef GUARD_MAIN_H
#define GUARD_MAIN_H
typedef void (*IntrCallback)(void);
extern IntrCallback gIntrCallbacks[6];
void AckInterrupt(u16);
bool8 EnableInterrupts(void);
bool8 DisableInterrupts(void);
#endif // GUARD_MAIN_H

View File

@ -1,6 +1,9 @@
#ifndef GUARD_MAIN_MENU_H
#define GUARD_MAIN_MENU_H
#include "menu.h"
#include "text.h"
enum MainMenuScreens
{
MENU_MAIN_SCREEN = 1,
@ -30,12 +33,12 @@ enum MainMenuScreens
MENU_DEBUG_FIELD_SCRIPT,
MENU_DEBUG_DEBUG_MENU,
MENU_DEBUG_UNKNOWN_1,
MENU_NO_SCREEN_CHANGE = 0xffdc
MENU_NO_SCREEN_CHANGE = 65500
};
// size: 0x8
struct unkStruct_8035D94
{
union {
u8 itemIndex_u8;
u32 itemIndex_u32;
@ -43,6 +46,7 @@ struct unkStruct_8035D94
s32 numItems;
};
// size: 0x4
struct MainMenuSub
{
u8 unk2C;
@ -50,6 +54,7 @@ struct MainMenuSub
u8 unk2E;
};
// size: 0x40
struct MainMenu
{
/* 0x0 */ s32 currMenu;
@ -57,23 +62,24 @@ struct MainMenu
/* 0x8 */ s32 lastMenu;
u8 padding[0x20];
/* 0x2C */ struct MainMenuSub sub;
/* 0x30 */ struct unkStruct_8035D94 unk30;
struct unkStruct_8035D94 unk30;
s16 unk38;
u8 unk3A;
u8 unk3B;
s32 unk3C;
};
void InitMainMenu(void);
void DeleteMainMenu(void);
void SetUpMenu(void);
s32 UpdateMenu(void);
void CleanUpMenu(void);
bool8 sub_80363E0(void);
void DeleteMainMenu(void);
struct MainMenu *GetMainMenu(void);
void InitMainMenu(void);
void SetMenuItems(struct MenuStruct *, struct UnkTextStruct2 *, s32, const struct UnkTextStruct2 *, const struct MenuItem *, u8, u32, u32);
void SetUpMenu(void);
void sub_8035CC0(struct UnkTextStruct2 *, u32);
void sub_8035CF4(struct MenuStruct*, u32, bool8);
struct unkStruct_8035D94 *sub_8035D94(void);
void sub_8035DA0(void);
struct MainMenu *GetMainMenu(void);
bool8 sub_80363E0(void);
s32 UpdateMenu(void);
#endif // GUARD_MAIN_MENU_H

View File

@ -1,4 +1,8 @@
#ifndef GUARD_MENU_INPUT_H
#define GUARD_MENU_INPUT_H
#include "menu.h"
#include "text.h"
u32 sub_8012A64(struct MenuInputStructSub *r0, s32 r1);
s32 GetKeyPress(struct MenuInputStruct *r0);
@ -36,3 +40,5 @@ bool8 sub_8013938(struct MenuInputStruct *param_1);
void sub_8013984(struct MenuInputStruct * param_1);
void sub_8013A54(struct MenuInputStruct *param_1);
void sub_8013A7C(struct MenuInputStruct *param_1);
#endif // GUARD_MENU_INPUT_H

View File

@ -242,5 +242,8 @@ void SavePokemonStruct(struct unkStruct_8094924* a1, struct PokemonStruct* pokem
void RestorePokemonStruct(struct unkStruct_8094924*, struct PokemonStruct*);
s32 sub_808E218(struct unkStruct_808E218_arg* a1, struct PokemonStruct* pokemon);
// pokemon.s
extern void sub_808CFD0(u8 *, s16, u8 *, u8, u32 *, u16 *);
extern u32 sub_808D1DC(u8 *);
#endif // GUARD_POKEMON_H

22
include/reg_control.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef GUARD_CODE_800B5F0_H
#define GUARD_CODE_800B5F0_H
#include "main.h"
// size: 0x8
struct unkStruct_202D648
{
s16 unk0;
s16 unk2; // Vcount??
IntrCallback unk4; // some function... just making it IntrCallback for now
};
extern s16 gUnknown_203B0A8;
extern s16 gUnknown_203B0AA;
extern s16 gUnknown_203B0AC;
extern s16 gUnknown_203B0AE;
void nullsub_17(void);
void xxx_update_bg_sound_input(void);
#endif // GUARD_CODE_800B5F0_H

11
include/sprite.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_SPRITE_H
#define GUARD_SPRITE_H
void InitSprites(void);
// sprite.s
extern void BlinkSavingIcon(void);
extern void ResetSprites(bool32);
extern void SetSavingIconCoords(u32);
#endif // GUARD_SPRITE_H

View File

@ -4,6 +4,8 @@
#define MAX_KECLEON_ITEM_SHOP_ITEMS 8
#define MAX_KECLEON_WARE_SHOP_ITEMS 4
#include "item.h"
// size: 0x268
struct TeamInventory
{
@ -15,6 +17,7 @@ struct TeamInventory
/* 0x264 */ s32 teamSavings;
};
// Declared in items.c
extern struct TeamInventory *gTeamInventoryRef;
#define MAX_TEAM_MONEY 99999

View File

@ -12,16 +12,18 @@ struct UnkTextStruct1
u32 unkC;
u32 unk10;
u32 unk14;
u8 *unk18;
u8 *unk1C;
u32 *unk18;
u32 *unk1C;
s32 unk20;
s32 unk24;
void *unk28; // Somewhere in VRAM
u32 *unk28; // Somewhere in VRAM
s32 unk2C;
s32 unk30;
s32 unk34;
u32 *unk30; // Somewhere in VRAM?
u32 *unk34;
s32 unk38;
u8 fill3C[0x45 - 0x3C];
u32 *unk3C;
u32 *unk40;
u8 unk44;
bool8 unk45;
u8 unk46;
};
@ -32,7 +34,7 @@ struct UnkTextStruct2_sub
// I haven't found a func that reads these separately yet, but simply making an arr[2] will cause assignments to break.
// Some funcs only match with this union for some reason even though they don't access the variables separately...
// The first func to break is currently sub_801A5D8 in kecleon_bros.c
// The first func I matched that uses the array is sub_8006554 in text_1.c (using the separated fields doesn't match or get even close)
// The first func I matched that uses the array is sub_8006554 in text2.c (using the separated fields doesn't match or get even close)
union {
struct {
s16 unk0;
@ -56,17 +58,4 @@ struct UnkTextStruct2
const u8 *unk14;
};
void LoadCharmaps(void);
void SelectCharmap(u32);
u32 xxx_update_some_bg_tiles(u32 a0);
void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2);
void sub_8006438(const struct UnkTextStruct2 *, u8, u8, struct UnkTextStruct2_sub *);
void sub_8006518(struct UnkTextStruct2 *);
void sub_8006554(struct UnkTextStruct1 *, void *, u8 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8);
void sub_800898C(void);
void sub_80089AC(const struct UnkTextStruct2 *, struct UnkTextStruct2_sub *);
void sub_8009388(void);
extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32);
#endif

17
include/text1.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef GUARD_TEXT1_H
#define GUARD_TEXT1_H
#include "text.h"
extern struct UnkTextStruct1 gUnknown_2027370[4];
extern struct UnkTextStruct2 gUnknown_202AFC0[4];
extern u32 gUnknown_202B030;
extern u16 gUnknown_202B038[4][32][32];
void LoadCharmaps(void);
void SelectCharmap(u32);
u32 xxx_update_some_bg_tiles(u32 a0);
void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2);
#endif // GUARD_TEXT1_H

53
include/text2.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef GUARD_TEXT2_H
#define GUARD_TEXT2_H
#include "text.h"
// size: 0x10
struct unkShiftData
{
u32 bytesA;
u32 bytesB;
u32 shift_left;
u32 shift_right;
};
// size: 0x8
struct unkChar
{
u32 *unk0;
s16 unk4;
s16 unk6;
};
struct unkStruct_80B8824
{
u32 arr[9];
};
struct unkStruct_80B8848
{
u32 arr[8];
};
u32 xxx_call_draw_char(s32, s32, u32, u32, u32);
void sub_8006518(struct UnkTextStruct2 *);
void sub_8006554(struct UnkTextStruct1 *, u32 *, u32 *, u16 *, u32, const struct UnkTextStruct2 *, u8, u32, struct UnkTextStruct2_sub *, u8);
void sub_80073B8(s32);
void sub_80073E0(s32);
void sub_80078A4(u32, s32, s32, s32, u32);
void sub_800792C(u32, s32, s32, s32, u32);
void sub_8007A78(u32, s32, s32, s32, u32);
void sub_8007B7C(u32, s32, s32, s32, u32);
void sub_8007E20(u32, u32, u32, u32, u32, u8 *, u32);
// text.s
extern struct unkChar *GetCharacter(u32);
extern void InitGraphics(void);
extern void sub_800898C(void);
extern void sub_80089AC(const struct UnkTextStruct2 *, struct UnkTextStruct2_sub *);
extern void sub_8008C54(u32);
extern void sub_8009388(void);
extern void xxx_call_draw_string(s32 x, u32 y, const u8 *str, u32 , u32);
#endif // GUARD_TEXT2_H

View File

@ -1,9 +1,13 @@
#ifndef GUARD_WIGGLYTUFF_SHOP_H
#define GUARD_WIGGLYTUFF_SHOP_H
struct WigglytuffShop
#include "file_system.h"
#include "menu.h"
#include "text.h"
// size: 0x138
struct WigglytuffShop
{
// size: 0x138
bool32 isAsleep;
s32 state;
s32 fallbackState;
@ -23,14 +27,12 @@ struct WigglytuffShop
u8 unkC9;
u8 unkCA;
u8 fillCB;
u8 *unkCC;
struct OpenedFile **unkCC;
struct UnkTextStruct2 unkD0[4];
u32 unk130;
u32 unk134;
};
extern struct WigglytuffShop *gWigglytuffShop;
enum WigglytuffStates
{
WIGGLYTUFF_INIT = 0,

View File

@ -67,15 +67,15 @@ SECTIONS {
asm/code_8005838.o(.text);
src/code_800558C.o(.text);
src/random.o(.text);
src/text.o(.text);
src/text_1.o(.text);
src/text1.o(.text);
src/text2.o(.text);
asm/text.o(.text);
src/code_8009804.o(.text);
asm/code_8009804.o(.text);
src/file_system.o(.text);
src/main.o(.text);
asm/code_800B5F0.o(.text);
src/code_800B5F0.o(.text);
src/unused_vblank.o(.text);
src/reg_control.o(.text);
src/music.o(.text);
src/code_800C9CC.o(.text);
src/bg_control.o(.text);
@ -101,7 +101,6 @@ SECTIONS {
src/code_801AFA4.o(.text);
src/code_801B3C0.o(.text);
src/code_801C620.o(.text);
asm/code_801C620.o(.text);
src/code_801D760.o(.text);
asm/code_801D760.o(.text);
src/options_menu.o(.text);
@ -160,10 +159,10 @@ SECTIONS {
src/load_screen.o(.text);
src/wonder_mail_main_menu.o(.text);
src/ds_menus.o(.text);
src/debug_menu.o(.text);
src/debug_menu_mid.o(.text);
asm/debug_menu_1.o(.text);
src/debug_menu_1.o(.text);
src/debug_menu1.o(.text);
src/debug_menu2.o(.text);
src/debug_menu3.o(.text);
src/debug_menu4.o(.text);
asm/code_803B050.o(.text);
src/code_803B050.o(.text);
src/pokemon_mail.o(.text);
@ -428,9 +427,10 @@ SECTIONS {
src/rescue_password_menu.o(.rodata);
src/load_screen.o(.rodata);
src/wonder_mail_main_menu.o(.rodata);
src/debug_menu.o(.rodata);
src/debug_menu_mid.o(.rodata);
src/debug_menu_1.o(.rodata);
src/debug_menu1.o(.rodata);
src/debug_menu2.o(.rodata);
src/debug_menu3.o(.rodata);
src/debug_menu4.o(.rodata);
data/data_80E7D40.o(.rodata);
src/pokemon_mail.o(.rodata);
data/personality_test.o(.rodata);

View File

@ -1,9 +1,10 @@
#include "global.h"
#include "code_80130A8.h"
#include "constants/input.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "menu_input.h"
#include "text1.h"
#include "text2.h"
struct AdventureLog
{
@ -50,10 +51,6 @@ extern s16 sub_8097838();
extern s16 sub_8097870();
extern s32 sub_80977B8();
extern s32 sub_80977F8();
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void xxx_format_and_draw(u32, u32, const char *, u32, u32);
const u8 *GetAdventureLogLine(u8 index);
extern u32 gUnknown_202DE30;

View File

@ -1,12 +1,12 @@
#include "global.h"
#include "adventure_log.h"
#include "input.h"
#include "main_menu.h"
#include "adventure_log.h"
#include "text.h"
#include "text1.h"
extern void CreateAdventureLogScreen(u32);
extern u32 HandleAdventureLogInput(u32);
extern void CleanAdventureLogScreen();
extern void CleanAdventureLogScreen(void);
void CreateAdventureLogMenu(void)
{
@ -24,8 +24,7 @@ u32 UpdateAdventureLogMenu(void)
u32 nextMenu;
nextMenu = MENU_NO_SCREEN_CHANGE;
switch(HandleAdventureLogInput(1))
{
switch (HandleAdventureLogInput(1)) {
case 0:
case 1:
break;
@ -37,4 +36,4 @@ u32 UpdateAdventureLogMenu(void)
break;
}
return nextMenu;
}
}

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "bg_palette_buffer.h"
#define BG_PALETTE_BUFFER_SIZE 512
#define BG_PALETTE_BUFFER_CHUNK_SIZE 16

View File

@ -12,11 +12,14 @@
#include "play_time.h"
#include "save.h"
#include "game_options.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "exclusive_pokemon.h"
#include "pokemon.h"
#include "rescue_team_info.h"
#include "cpu.h"
#include "code_8094F88.h"
#include "sprite.h"
extern void sub_801180C(void);
extern void NDS_LoadOverlay_GroundMain(void);
@ -29,15 +32,12 @@ extern void LoadMailInfo(void);
extern void sub_800CD64(u32, u32);
extern void SetWindowTitle(char *);
extern void sub_800DAAC(void);
extern void SetSavingIconCoords(u32);
extern void sub_800135C(void);
extern void xxx_script_related_8001334(u32);
extern void sub_80015C0(u32, u32);
extern u32 sub_8001658(u32, u32);
extern void sub_800A8F8(u32);
extern void ResetSprites(u32);
extern void sub_80097B0(void);
extern void sub_800CDA8(u32);
extern void LoadTitleScreen(void);
extern void SetBGPaletteBufferColorRGB(s32, u8 *, s32, u8 *);
extern void sub_80095CC(u32, u32);
@ -112,7 +112,7 @@ void GameLoop(void)
while (1) {
gUnknown_203B03C = 0; // ???
sub_800A8F8(2);
ResetSprites(1);
ResetSprites(TRUE);
xxx_update_some_bg_tiles(0);
sub_80097B0();
sub_800CDA8(2);
@ -211,5 +211,5 @@ void xxx_update_stuff(u32 r0)
xxx_call_update_bg_vram();
sub_8009908();
xxx_call_update_bg_sound_input();
ResetSprites(0);
ResetSprites(FALSE);
}

View File

@ -1,9 +1,9 @@
#include "global.h"
#include "file_system.h"
#include "text1.h"
extern u8 gUnknown_202D238[4];
extern s32 gUnknown_202D23C;
extern u16 gUnknown_202B038[4][32][32];
extern u8 gUnknown_80B88CC[];
extern struct FileArchive gSystemFileArchive;

View File

@ -1,9 +1,9 @@
#include "global.h"
#include "input.h"
#include "random.h"
#include "reg_control.h"
void sub_800BA5C();
void xxx_update_bg_sound_input();
extern u32 gUnknown_203B0B8;
extern u16 gRawKeyInput;

View File

@ -8,6 +8,7 @@
#include "input.h"
#include "config.h"
#include "game_options.h"
#include "sprite.h"
void xxx_call_stop_bgm(void);
@ -47,7 +48,6 @@ extern void sub_8005180(void);
extern void sub_80060EC(void);
extern void sub_8011860(void);
extern void sub_800CB20(void);
extern void ResetSprites(u32);
extern void sub_8004AF0(u8, u32 *r1, u32, u32, u32 *r2, u32);
extern u8 sub_80111C4();
extern void sub_8010F28();
@ -75,7 +75,7 @@ void sub_801169C(void)
sub_8009908();
xxx_call_update_bg_sound_input();
sub_8011860();
ResetSprites(0);
ResetSprites(FALSE);
}
void sub_8011760(void)

View File

@ -2,6 +2,7 @@
#include "code_800558C.h"
#include "input.h"
#include "game_options.h"
#include "sprite.h"
extern void sub_8011860();
extern void xxx_draw_string_80144C4();
@ -14,7 +15,6 @@ extern void TransferBGPaletteBuffer();
extern void xxx_call_update_bg_vram();
extern void sub_8009908();
extern void xxx_call_update_bg_sound_input();
extern void ResetSprites(u8 r0);
extern struct GameOptions *gGameOptionsRef;
@ -34,6 +34,6 @@ void sub_8012A18()
xxx_call_update_bg_vram();
sub_8009908();
xxx_call_update_bg_sound_input();
ResetSprites(0);
ResetSprites(FALSE);
}

View File

@ -1,9 +1,10 @@
#include "global.h"
#include "menu.h"
#include "file_system.h"
#include "code_8012A18_1.h"
#include "code_80130A8.h"
#include "memory.h"
#include "input.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "text_util.h"
struct unkStruct_203B200
@ -25,10 +26,6 @@ extern const char gUnknown_80DB6BC;
extern const char gUnknown_80DB688;
extern u8 gAvailablePokemonNames[0x58];
extern void sub_80141B4(const char *r0, u32, struct OpenedFile **r1, u32);
extern void sub_8014248(const char *r0, u32, u32, const struct MenuItem *r4, u32, u32, u32, struct OpenedFile **r5, u32);
extern s32 sub_80144A4(s32 *);
extern void sub_80151C0(u32, u8 *);
extern void CreateConfirmNameMenu(void);
extern void sub_80160F4(u32);
@ -53,15 +50,6 @@ enum
extern u32 ReturnIntFromChar2(u8);
struct unkChar
{
u32 unk0;
s16 unk4;
s16 unk6;
};
struct unkChar *GetCharacter(u32);
s32 sub_8015FEC(u8 *buffer, s32 size)
{

View File

@ -6,6 +6,7 @@
#include "menu.h"
#include "pokemon.h"
#include "gulpin_shop.h"
#include "code_80130A8.h"
extern void sub_8092C84(u8 *, u16);
extern void sub_8099690(u32);
@ -19,9 +20,9 @@ extern void sub_801B2D8(void);
extern void nullsub_37();
extern void sub_801B080();
extern u32 gUnknown_80DB9BC;
extern u32 gUnknown_80DB9E4;
extern u32 gUnknown_80DBA0C;
extern const u8 gUnknown_80DB9BC[];
extern const u8 gUnknown_80DB9E4[];
extern const u8 gUnknown_80DBA0C[];
extern u8 gUnknown_202E1C8[0x50];
extern u8 gAvailablePokemonNames[0x50];
@ -33,10 +34,7 @@ extern bool8 IsHMItem(u8);
extern void sub_801B178(void);
extern void sub_8094060(void *, struct Move *);
extern void PlaySound(u32);
extern void sub_80141B4(u32 *, u32, u32 ,u32);
extern void sub_8014248(u32 *, u32, u32, struct MenuItem *, u32, u32, u32, u32, u32);
extern void PrintPokeNameToBuffer(u8 *buffer, struct PokemonStruct *pokemon);
extern s32 sub_80144A4(s32 *);
extern u32 sub_801E8C0(void);
extern bool8 CanMonLearnMove(u16 moveID, s16 _species);
@ -126,7 +124,7 @@ void sub_801B080(void)
sub_801B178();
// {CENTER_ALIGN}Who will learn the move
// {CENTER_ALIGN}{COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}?
sub_8014248(&gUnknown_80DB9BC, 0, gUnknown_203B22C->unk60, gUnknown_203B22C->menuItems, 0, 4, 0, 0, 0x20);
sub_8014248(gUnknown_80DB9BC, 0, gUnknown_203B22C->unk60, gUnknown_203B22C->menuItems, 0, 4, 0, 0, 0x20);
break;
case 1:
CreateGulpinShop(2, gUnknown_203B22C->chosenPokemon, gUnknown_203B22C->moves);
@ -141,12 +139,12 @@ void sub_801B080(void)
PlaySound(0x9C << 1);
// {CENTER_ALIGN}CM{ARG_POKEMON_8}{END_COLOR_TEXT_1} learned
// {CENTER_ALIGN}the move {COLOR_1 CYAN}{ARG_POKEMON_7}{END_COLOR_TEXT_1}!
sub_80141B4(&gUnknown_80DB9E4, 0, 0, 0x121);
sub_80141B4(gUnknown_80DB9E4, 0, 0, 0x121);
break;
case 3:
// {CENTER_ALIGN}No one in the current team
// {CENTER_ALIGN}can learn this move.
sub_80141B4(&gUnknown_80DBA0C, 0, 0, 0x121);
sub_80141B4(gUnknown_80DBA0C, 0, 0, 0x121);
break;
default:
case 4:

View File

@ -1,31 +1,17 @@
#include "global.h"
#include "code_801B3C0.h"
#include "constants/colors.h"
#include "text.h"
#include "input.h"
#include "text1.h"
#include "text2.h"
#include "item.h"
#include "memory.h"
#include "menu.h"
#include "pokemon.h"
#include "team_inventory.h"
#include "menu_input.h"
#include "subStruct_203B240.h"
#include "kecleon_bros.h"
#include "sprite.h"
#include "code_80130A8.h"
// based off of 203B240..
struct unkStruct_203B230
{
// size: 0x94
s32 state;
struct Item item;
s32 unk8;
s32 unkC;
struct subStruct_203B240 *unk10[2];
u8 fill14[0x20 - 0x18];
u32 unk20;
u32 unk24;
struct UnkTextStruct2 unk28[4];
struct MenuInputStructSub unk88;
};
extern struct unkStruct_203B230 *gUnknown_203B230;
struct unkStruct_203B234
@ -72,7 +58,6 @@ extern u8 gUnknown_202DEA8[];
extern u8 *gUnknown_80D4920[];
extern u8 *gUnknown_80D4928[];
extern s32 sub_80144A4(s32 *);
extern void sub_8099690(u32);
extern struct UnkTextStruct2 gUnknown_80DBA58;
@ -82,18 +67,11 @@ extern struct UnkTextStruct2 gUnknown_80DBA70;
extern void sub_801BB5C(void);
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern void sub_801B748(u32);
extern void sub_8008C54(u32);
extern void sub_80073E0(u32);
extern void sub_80073B8(u32);
extern void xxx_format_and_draw(u32, u32, u8 *, u32, u32);
extern void PlayMenuSoundEffect(u32);
extern void sub_8013F84(void);
extern s32 sub_80913E0(struct Item *, u32, struct subStruct_203B240 **);
extern void sub_80141B4(u8 *, u32, u32 *, u32);
extern void sub_8014248(const char *, u32, u32, struct MenuItem *, u32, u32, u32, u32, u32);
extern void sub_80140B4(struct UnkTextStruct2 *);
extern void sub_801B46C(u32);
extern void ResetSprites(u32);
extern void sub_801BC64(void);
extern void sub_801BC94(void);
extern void sub_801BCCC(void);
@ -117,7 +95,7 @@ void sub_801BC24(void);
u32 sub_801B3C0(struct Item *item)
{
ResetSprites(1);
ResetSprites(TRUE);
gUnknown_203B230 = MemoryAlloc(sizeof(struct unkStruct_203B230),8);
gUnknown_203B230->item = *item;
sub_801317C(&gUnknown_203B230->unk88);

View File

@ -1,15 +1,18 @@
#include "constants/item.h"
#include "global.h"
#include "code_801C620.h"
#include "constants/item.h"
#include "constants/iq_skill.h"
#include "input.h"
#include "item.h"
#include "memory.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "team_inventory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "subStruct_203B240.h"
#include "menu_input.h"
#include "sprite.h"
#include "code_80130A8.h"
struct unkStruct_203B238
{
@ -27,28 +30,28 @@ struct unkStruct_203B238
struct UnkTextStruct2 unkC4[4];
};
// size: 0xC4
struct unkStruct_203B23C
{
// size: 0xC4
{
/* 0x0 */ s16 species;
/* 0x4 */ struct PokemonStruct *pokeStruct;
/* 0x8 */ u8 iqSkills[NUM_IQ_SKILLS];
/* 0x20 */ s32 numIQSkills;
/* 0x24 */ struct MenuInputStruct input;
u32 unk58;
/* 0x5C */ struct UnkTextStruct2 *unk5C;
/* 0x60 */ struct UnkTextStruct2 unk60[4];
struct UnkTextStruct2 *unk5C;
struct UnkTextStruct2 unk60[4];
u8 unkC0;
u8 unkC1;
u8 unkC2;
u8 unkC3;
};
// size: 0x94
struct unkStruct_203B240
{
// size: 0x94
s32 state;
u8 chosenIQSkill;
/* 0x0 */ s32 state;
/* 0x4 */ u8 chosenIQSkill;
s32 unk8;
s32 unkC;
struct subStruct_203B240 *unk10[2];
@ -59,30 +62,31 @@ struct unkStruct_203B240
struct MenuInputStructSub unk88;
};
// size: 0x554
struct unkStruct_203B244
{
// size: 0x554
u32 unk0;
u8 itemIDs[NUMBER_OF_ITEM_IDS];
/* 0x4 */ u8 itemIDs[NUMBER_OF_ITEM_IDS];
u32 unkF4[NUMBER_OF_ITEM_IDS];
struct MenuInputStruct input;
/* 0x4B4 */ struct MenuInputStruct input;
u32 unk4E8;
struct UnkTextStruct2 * unk4EC;
struct UnkTextStruct2 unk4F0[4];
u8 unk550[4];
};
// size: 118
struct unk_203B250
{
struct PokemonStruct *pokeStruct;
s16 index;
/* 0x0 */ struct PokemonStruct *pokeStruct;
/* 0x4 */ s16 index;
/* 0x6 */ u8 currFriendAreaLocation; // 0 when not in a friend area
u8 unk7;
u8 unk8;
u8 unk9;
struct PokemonStruct *unkC;
u32 state;
u32 menuAction;
/* 0x10 */ u32 state;
/* 0x14 */ u32 menuAction;
struct MenuStruct unk18;
struct MenuItem unk68[8];
u16 unkA8[8];
@ -96,6 +100,7 @@ extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern u8 sub_8002658(s16);
extern s16 sub_80A5728(void);
extern void sub_801D208(u32);
extern void sub_801D4C0(void);
extern void sub_801D680(void);
extern void sub_801D760(void);
extern void sub_801D77C(void);
@ -110,11 +115,14 @@ s16 sub_80A7AE8(s32);
extern struct PokemonStruct *sub_808D3F8(void);
extern const struct UnkTextStruct2 gUnknown_80DBE54;
extern struct UnkTextStruct2 gUnknown_80DBDD8;
extern struct UnkTextStruct2 gUnknown_80DBDF0;
extern struct UnkTextStruct2 gUnknown_80DBDB0;
extern struct UnkTextStruct2 gUnknown_80DBD98;
extern struct UnkTextStruct2 gUnknown_80DBE3C;
extern const struct UnkTextStruct2 gUnknown_80DBDD8;
extern const struct UnkTextStruct2 gUnknown_80DBDF0;
extern const struct UnkTextStruct2 gUnknown_80DBDB0;
extern const struct UnkTextStruct2 gUnknown_80DBD98;
extern const struct UnkTextStruct2 gUnknown_80DBE3C;
extern const struct UnkTextStruct2 gUnknown_80DBE7C;
extern const struct UnkTextStruct2 gUnknown_80DBE98;
extern const struct UnkTextStruct2 gUnknown_80DBEB0[4];
extern struct unkStruct_203B238 *gUnknown_203B238;
extern struct unkStruct_203B23C *gUnknown_203B23C;
@ -139,22 +147,15 @@ extern char gUnknown_80DBE30[]; // {ARG_POKEMON_0}
extern u8 gUnknown_80DBDC8[];
extern u8 *gUnknown_80D4970[];
extern void sub_8007B7C(s32, s32, s32, s32, s32);
extern u32 sub_801CE58(void);
extern void sub_801CC38(void);
extern void ResetSprites(u32);
extern void sub_80140B4(struct UnkTextStruct2 *);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern void sub_8013F84(void);
extern void PlayMenuSoundEffect(u32);
extern char * GetIQSkillDescription(u8 r0);
extern s32 GetNumAvailableIQSkills(u8 *param_1, s32 pokeIQ);
extern void sub_8013C68(u32 *);
extern char * GetIQSkillName(u8 r0);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
extern u32 sub_80095E4(s16, u32);
extern void sub_801C440(void);
extern void sub_801C4C8(void);
@ -167,9 +168,6 @@ void sub_801C6D0(s32);
void sub_801C7D4(void);
void sub_801C6E4(void);
void sub_801C848(void);
void sub_801CCD8(void);
bool8 sub_801CF14(s32);
void sub_801CF94(void);
u32 sub_801C308(u8);
extern void PlaySound(u32);
@ -187,11 +185,8 @@ void sub_801C03C(void);
void sub_801C118(void);
void sub_801C1A0(void);
void sub_801C228(void);
u8 sub_801CB24(void);
u32 sub_801CFE0(u8);
s32 sub_801CFB8(void);
extern void sub_801D220(void);
void sub_801D220(void);
extern void sub_801D3A8(void);
@ -618,7 +613,7 @@ bool8 HasNoAvailIQSkills(s16 species)
u32 sub_801C620(u8 iqSkill)
{
ResetSprites(1);
ResetSprites(TRUE);
gUnknown_203B240 = MemoryAlloc(sizeof(struct unkStruct_203B240),8);
gUnknown_203B240->chosenIQSkill = iqSkill;
sub_801317C(&gUnknown_203B240->unk88);
@ -788,13 +783,13 @@ bool8 sub_801C8C4(s32 param_1, s32 param_2, struct UnkTextStruct2_sub *param_3,
}
}
bool8 sub_801CA08(u8 param_1)
u32 sub_801CA08(bool8 param_1)
{
u32 index;
u32 temp;
u32 flag;
if (param_1 == 0) {
if (param_1 == FALSE) {
sub_8013660(&gUnknown_203B244->input);
return 0;
}
@ -843,7 +838,7 @@ u8 sub_801CB24(void) {
return gUnknown_203B244->itemIDs[(gUnknown_203B244->input.unk1E * gUnknown_203B244->input.unk1C) + gUnknown_203B244->input.menuIndex];
}
void sub_801CB5C(u8 r0) {
void sub_801CB5C(bool8 r0) {
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B244->unk4F0, 0, 0);
gUnknown_203B244->input.unk22 = sub_801CE58();
@ -1218,3 +1213,58 @@ void sub_801D208(u32 newState)
sub_801D220();
sub_801D3A8();
}
void sub_801D220(void)
{
s32 i;
sub_8006518(gUnknown_203B250->unkB8);
switch (gUnknown_203B250->state) {
case 0:
sub_801D4C0();
if (gUnknown_203B250->pokeStruct != NULL) {
for (i = 0; i < 4; i++)
gUnknown_203B250->unkB8[i] = gUnknown_80DBE7C;
gUnknown_203B250->unkB8[0] = gUnknown_80DBE98;
sub_8012CAC(gUnknown_203B250->unkB8, gUnknown_203B250->unk68);
gUnknown_203B250->unkB8[0].unkC = 9;
}
else {
for (i = 0; i < 4; i++)
gUnknown_203B250->unkB8[i] = gUnknown_80DBEB0[i];
sub_8012CAC(gUnknown_203B250->unkB8, gUnknown_203B250->unk68);
gUnknown_203B250->unkB8[0].unkC = 8;
}
break;
case 1:
sub_801D4C0();
if (gUnknown_203B250->pokeStruct != NULL) {
for (i = 0; i < 4; i++)
gUnknown_203B250->unkB8[i] = gUnknown_80DBE7C;
gUnknown_203B250->unkB8[0] = gUnknown_80DBE98;
sub_8012CAC(gUnknown_203B250->unkB8, gUnknown_203B250->unk68);
gUnknown_203B250->unkB8[0].unkC = 9;
}
else {
for (i = 0; i < 4; i++)
gUnknown_203B250->unkB8[i] = gUnknown_80DBEB0[i];
sub_8012CAC(gUnknown_203B250->unkB8, gUnknown_203B250->unk68);
gUnknown_203B250->unkB8[0].unkC = 8;
}
break;
default:
for (i = 0; i < 4; i++)
gUnknown_203B250->unkB8[i] = gUnknown_80DBE7C;
break;
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B250->unkB8, 1, 1);
}

View File

@ -10,10 +10,12 @@
#include "team_inventory.h"
#include "memory.h"
#include "input.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "rescue_team_info.h"
#include "code_800D090.h"
#include "menu_input.h"
#include "code_8021774.h"
struct unkStruct_203B258
{
@ -38,8 +40,6 @@ extern void sub_801BF98(void);
extern void sub_801D208(u8);
extern u32 sub_801DCE8(void);
extern void sub_801DD50(void);
extern u32 sub_80217EC(void);
extern void sub_8021830(void);
extern u32 sub_8022860();
extern void sub_8022908();
extern u32 sub_80244E4(void);
@ -56,12 +56,8 @@ extern void InitializeJobListMenu(u32);
extern const char *sub_8098FB4();
extern void xxx_format_string(const char *, u8 *, u32 **, u32);
extern s32 sub_8008ED0(u8 *);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
void LoadTeamRankBadge(u32, u32, u32);
extern void SetBGPaletteBufferColorArray(s32 index, u8 *colorArray);
extern void sub_8007E20(u32, u32, u32, u32, u32, u8 *, u32);
extern struct FileArchive gTitleMenuFileArchive;
extern const char gTeamRankBadgeFileName;
@ -113,7 +109,6 @@ extern u32 sub_8027074(void);
extern void sub_80227B8(struct PokemonStruct *);
extern bool8 sub_8024458(s16, u32);
extern bool8 sub_801BEEC(s16);
extern void sub_8021774(u8, u32, u32);
void sub_801D894(void);
u32 sub_8025EF4(struct PokemonStruct *);

View File

@ -1,8 +1,7 @@
#include "global.h"
#include "pokemon.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "memory.h"
#include "input.h"
#include "code_801EE10.h"
#include "menu_input.h"

View File

@ -4,7 +4,8 @@
#include "pokemon.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "text_util.h"
#include "menu_input.h"

View File

@ -1,13 +1,16 @@
#include "global.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "pokemon.h"
#include "input.h"
#include "code_800D090.h"
#include "moves.h"
#include "code_801EE10.h"
#include "menu_input.h"
#include "subStruct_203B240.h"
#include "sprite.h"
#include "code_80130A8.h"
#include "code_801EE10_mid.h"
extern struct unkStruct_203B270 *gUnknown_203B270;
@ -54,10 +57,6 @@ extern u8 gUnknown_80DC310[];
extern u8 gUnknown_80DC2DC[];
extern void PlayMenuSoundEffect(u32);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void ResetSprites(u32);
extern void sub_80140B4(struct UnkTextStruct2 *);
extern void sub_801F918(s32);
extern void sub_801FA58(void);
@ -65,7 +64,6 @@ extern void sub_801FAD4(void);
extern void sub_801F930(void);
extern void sub_801F9A4(void);
int unk_MoveIDPrintMoveDescription(int a1, u16 moveID, int a3, struct subStruct_203B240** a4);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
void sub_8013F84(void);
@ -259,7 +257,7 @@ bool8 sub_801F808(u16 *moveIDs)
{
s32 index;
ResetSprites(1);
ResetSprites(TRUE);
gUnknown_203B278 = MemoryAlloc(sizeof(struct unkStruct_203B278), 8);
gUnknown_203B278->unk5C = 0;
gUnknown_203B278->unk60 = gUnknown_203B278->unk64;

View File

@ -2,12 +2,14 @@
#include "global.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "pokemon.h"
#include "exclusive_pokemon.h"
#include "friend_area.h"
#include "code_800D090.h"
#include "menu_input.h"
#include "code_8021774.h"
struct unkStruct_203B28C
{
@ -48,18 +50,13 @@ extern u8 gUnknown_80DC4F0[];
extern u8 *gUnknown_80D49BC[];
extern u8 gUnknown_80DC524[];
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8092578(u8 *buffer, u8 index, u8 r2);
void sub_800792C(u32, u32, u32, u32, u32);
void sub_8007A78(u32, u32, u32, u32, u32);
extern void sub_8021878(void);
extern void sub_8021894(void);
extern void PlayMenuSoundEffect(u32);
extern void sub_8021A60(void);
void sub_8021820(void);
extern u8 *gFriendAreas;
u8 sub_80023E4(u32);
s32 sub_8021664(void)

View File

@ -1,14 +1,18 @@
#include "global.h"
#include "code_801EE10_mid.h"
#include "code_8021774_pre.h"
#include "constants/friend_area.h"
#include "constants/input.h"
#include "friend_area.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "item.h"
#include "team_inventory.h"
#include "menu_input.h"
// size: 0xE0
struct unkStruct_203B280
{
u8 unk0[NUM_FRIEND_AREAS];
@ -19,6 +23,7 @@ struct unkStruct_203B280
struct UnkTextStruct2 unk7C[4];
u8 unkDC[4];
};
extern struct unkStruct_203B280 *gUnknown_203B280;
extern u32 gUnknown_203B284;
extern u16 gUnknown_203B288;
@ -29,9 +34,7 @@ extern struct UnkTextStruct2 gUnknown_80DC464;
u8 sub_8021700(u32 mode);
s32 sub_8021664(void);
extern u8 sub_802132C(void);
extern void sub_8021410(void);
extern void sub_8021494(void);
extern void PlayMenuSoundEffect(u32);
bool8 sub_80211AC(u32 param_1, u32 param_2)
@ -63,7 +66,7 @@ bool8 sub_80211AC(u32 param_1, u32 param_2)
}
}
u32 sub_8021274(u8 param_1)
u32 sub_8021274(bool8 param_1)
{
if (param_1 == 0) {
sub_8013660(&gUnknown_203B280->unk40);
@ -104,7 +107,7 @@ u8 sub_802132C(void)
return gUnknown_203B280->unk0[gUnknown_203B280->unk40.unk1E * gUnknown_203B280->unk40.unk1C + gUnknown_203B280->unk40.menuIndex];
}
void sub_8021354(u8 param_1)
void sub_8021354(bool8 param_1)
{
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B280->unk7C,0,0);

View File

@ -3,18 +3,19 @@
#include "constants/input.h"
#include "constants/iq_skill.h"
#include "memory.h"
#include "menu.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "team_inventory.h"
#include "text.h"
#include "input.h"
#include "text1.h"
#include "text2.h"
#include "item.h"
#include "menu_input.h"
#include "code_8023144.h"
#include "code_800D090.h"
#include "friend_area.h"
#include "kecleon_bros.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
struct unkStruct_3001B5C
{
@ -61,11 +62,8 @@ extern u8 gUnknown_80DC8F8[];
extern u8 *gUnknown_80D4940[];
extern u8 *gUnknown_80D4970[];
extern void sub_8022924(s32);
extern s32 sub_80144A4(s32 *);
extern u32 sub_801B00C(void);
extern void sub_801B048(void);
extern u32 sub_801B410(void);
extern void sub_801B450(void);
void GetGummiItemStatBoost(struct PokemonStruct* pokemon, u8 id, bool8 checkBoostFlags, struct Gummi* gummi);
@ -462,9 +460,6 @@ void sub_8023420(void)
extern u8 gUnknown_80DC934[];
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
bool8 HasRecruitedMon(s16 species_);
extern u8 gUnknown_80DC93C[];

View File

@ -7,12 +7,12 @@
#include "pokemon.h"
#include "pokemon_3.h"
#include "team_inventory.h"
#include "text.h"
#include "text1.h"
#include "input.h"
#include "item.h"
#include "menu_input.h"
#include "code_8023144.h"
#include "text.h"
#include "text2.h"
struct unkStruct_203B294 *gUnknown_203B294;
extern u8 gAvailablePokemonNames[];

View File

@ -3,7 +3,8 @@
#include "constants/colors.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "dungeon_global_data.h"
#include "pokemon.h"
#include "code_8094F88.h"
@ -46,10 +47,6 @@ const struct UnkTextStruct2 gUnknown_80E1FC4 = {
ALIGNED(4) const u8 gUnknown_80E1FDC[] = "Password";
ALIGNED(4) static const u8 fill0[] = "pksdir0";
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_80078A4(u32, u32, u32, u32, u32);
extern void sub_803D2C0(u8 *, struct unkStruct_203B480 *);
extern void PlayMenuSoundEffect(u32);

View File

@ -359,7 +359,6 @@ void LugiaScreenFlash2();
extern void sub_80861B8(struct Entity *, u32, u32);
void nullsub_99();
extern bool8 *gFriendAreas;
extern void sub_8049884();
extern void sub_8049B8C();

View File

@ -1,10 +1,12 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_8092334.h"
#include "code_809447C.h"
#include "item.h"
#include "moves.h"
#include "dungeon_global_data.h"
#include "text_util.h"
#include "text2.h"
struct unkStruct_8113080
{
@ -39,10 +41,7 @@ extern struct unkStruct_8113080 gUnknown_8113080[];
void sub_80928C0(u8 *buffer, struct Move *move, struct unkStruct_80928C0 *param_3);
extern void xxx_format_string(const char *, u8 *, void *, u32);
void PrintYellowDungeonNametoBuffer(u8 *buffer, struct DungeonLocation *dungeonLocation);
extern void sub_80073B8(u32);
extern void xxx_format_and_draw(s32, s32, const u8 *, ...);
extern s32 sub_8008ED0(u8 *);
extern void sub_80073E0(u32);
void sub_809447C(struct unkStruct_8094924 *r0, u8 *r1)
{

View File

@ -19,7 +19,6 @@ extern u8 IsJobSlotEmpty(u8);
extern struct WonderMail * GetJobSlotInfo(u8);
extern bool8 IsValidWonderMail(struct WonderMail *WonderMailData);
extern u8 sub_8095E38(struct WonderMail *, u8, u8, bool8);
extern void sub_808CFD0(s32, s16, u8, u8, u32 *, u32);
extern void ResetJobSlot(u8);
extern void sub_8096C80(void);
extern void sub_8096D24(void);
@ -212,7 +211,7 @@ s32 CountJobsinDungeon(u8 dungeon)
return count;
}
bool8 sub_8096A08(u8 dungeon, s32 param_2)
bool8 sub_8096A08(u8 dungeon, u8 *param_2)
{
struct WonderMail *mail;
s32 index;
@ -236,7 +235,7 @@ bool8 sub_8096A08(u8 dungeon, s32 param_2)
temp = 0x100;
local_14 |= temp;
sub_808CFD0(param_2,mail->clientSpecies,0,0,&local_14,0);
sub_808CFD0(param_2,mail->clientSpecies,NULL,0,&local_14,NULL);
return TRUE;
}
}

View File

@ -7,7 +7,6 @@
#include "friend_area.h"
#include "code_80958E8.h"
extern u8 *gFriendAreas;
bool8 sub_8095E38(struct WonderMail *mail, u8 dungeon, u32 floor, u8 param_4);
extern s32 sub_80A29B0(u8 *param_1);
extern s32 GetDungeonFloorCount(u8);

View File

@ -1,27 +1,12 @@
#include "global.h"
#include "code_8097670.h"
#include "pokemon.h"
struct unkStruct_203B494
{
// size: 0xC4
u32 unk0; // 32 bit bitfield, I think
s32 numAdventures;
s32 unk8;
s32 unkC;
struct DungeonLocation dungeonLocation;
s16 unk14;
s16 unk16;
s16 unk18;
u32 unk1C[0xE];
u32 unk54[0xE];
u32 unk8C[0xD];
s32 unkC0;
};
#include "pokemon_3.h"
EWRAM_DATA_2 struct unkStruct_203B494 *gUnknown_203B494 = {0};
EWRAM_DATA struct unkStruct_203B494 gUnknown_2039778 = {0};
extern const u8 *gAdventureLogText[];
s16 GetBaseSpeciesNoUnown(s16 index);
void sub_8097670(void)
{

View File

@ -1,17 +1,16 @@
#include "global.h"
#include "text1.h"
extern void sub_8272774(u32 *r0, u32 r1);
extern void sub_8272884(u32 *r0, u32 r1);
extern u32 gUnknown_2027370; // TODO defined in text.c and join later
extern void sub_8272774(struct UnkTextStruct1 *r0, u32 r1);
extern void sub_8272884(struct UnkTextStruct1 *r0, u32 r1);
void sub_8272760(u32 r0)
{
sub_8272774(&gUnknown_2027370, r0);
sub_8272774(gUnknown_2027370, r0);
}
// TODO once sub_8272774 is decomped
//void sub_8272870(u32 r0)
//{
// sub_8272884(&gUnknown_2027370, r0);
// sub_8272884(gUnknown_2027370, r0);
//}

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "cpu.h"
extern u32 gUnknown_202D800;
extern u16 gBldCnt; // used to update Blend Count Reg

View File

@ -1,7 +1,8 @@
#include "global.h"
#include "input.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
// size: 0x6C
struct unkCreditsStruct_203B340
@ -39,8 +40,6 @@ extern u16 gUnknown_80E5990[];
extern void sub_80015C0(u32, u32);
extern s32 sub_8001658(u32, u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8099690(u32);
extern void sub_8099A5C(u32, u32, u32);
extern void sub_8099AFC(u32, u32, u32);

View File

@ -1,197 +0,0 @@
#include "global.h"
#include "constants/friend_area.h"
#include "debug_menu.h"
#include "friend_area.h"
#include "input.h"
#include "main_menu.h"
#include "menu.h"
#include "memory.h"
#include "pokemon.h"
#include "save.h"
#include "text_util.h"
#include "menu_input.h"
EWRAM_DATA_2 struct DebugMenu *gUnknown_203B3EC = {0};
const struct UnkTextStruct2 gUnknown_80E7D40 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7D58 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x02, 0x02,
0x09, 0x0b,
0x0b, 0x00,
NULL
};
const struct MenuItem gDebugMenuItems[8] =
{
{"Dungeons", MENU_DEBUG_MENU_DUNGEONS},
{"Field", MENU_DEBUG_MENU_FIELD},
{"Field Map", MENU_DEBUG_MENU_FIELD_MAP},
{"Field Script", MENU_DEBUG_MENU_FIELD_SCRIPT},
{"Debug Menu", MENU_DEBUG_MENU_DEBUG_MENU},
{"Storage", MENU_DEBUG_MENU_STORAGE},
{"h-open", MENU_DEBUG_MENU_H_OPEN},
{NULL, 10},
};
ALIGNED(4) static const char debug_menu_fill0[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill1[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill2[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill3[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill4[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill5[] = "pksdir0";
ALIGNED(4) static const char debug_menu_fill6[] = "pksdir0";
extern void sub_80976F8(u8);
extern void sub_803A3BC(void);
extern void sub_803A3A0(void);
extern void SetMenuItems(struct MenuStruct *menu, struct UnkTextStruct2 *, u32, const struct UnkTextStruct2 *, const struct MenuItem *entries, u32, u32, u32);
extern void sub_8035CF4(struct MenuStruct*, u32, u32);
extern void sub_8035CC0(struct UnkTextStruct2 *, u32);
extern void sub_808D1DC(u8 *);
extern void sub_808CFD0(u8 *, s32, u8 *, u32, u32 *, u16 *);
void CreateDebugMenu(void)
{
int index;
if (gUnknown_203B3EC == NULL) {
gUnknown_203B3EC = MemoryAlloc(sizeof(struct DebugMenu), 8);
MemoryFill8((u8 *)gUnknown_203B3EC, 0, sizeof(struct DebugMenu));
}
for(index = 0; index < 4; index++){
gUnknown_203B3EC->unk140[index] = gUnknown_80E7D40;
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B3EC->unk140, 1, 1);
SetDebugMenuItems();
}
void DeleteDebugMenu(void)
{
ResetUnusedInputStruct();
sub_800641C(NULL, 1, 1);
if(gUnknown_203B3EC != NULL)
{
MemoryFree(gUnknown_203B3EC);
gUnknown_203B3EC = NULL;
}
}
u32 UpdateDebugMenu(void)
{
u32 nextMenu;
s32 counter;
s32 debugMenuAction;
nextMenu = MENU_NO_SCREEN_CHANGE;
debugMenuAction = 11;
if (sub_8012FD8(&gUnknown_203B3EC->unk0[0]) == 0) {
sub_8013114(&gUnknown_203B3EC->unk0[0], &debugMenuAction);
}
switch(debugMenuAction) {
case MENU_DEBUG_MENU_DUNGEONS:
nextMenu = MENU_DEBUG_DUNGEON;
break;
case MENU_DEBUG_MENU_FIELD:
nextMenu = MENU_DEBUG_FIELD;
break;
case MENU_DEBUG_MENU_FIELD_MAP:
nextMenu = MENU_DEBUG_FIELD_MAP;
break;
case MENU_DEBUG_MENU_FIELD_SCRIPT:
nextMenu = MENU_DEBUG_FIELD_SCRIPT;
break;
case MENU_DEBUG_MENU_DEBUG_MENU:
nextMenu = MENU_DEBUG_DEBUG_MENU;
break;
case MENU_DEBUG_MENU_UNKNOWN_1: // No option that correponds to this one
nextMenu = MENU_DEBUG_UNKNOWN_1;
break;
case MENU_DEBUG_MENU_STORAGE:
sub_803A3BC();
nextMenu = MENU_MAIN_SCREEN;
break;
case MENU_DEBUG_MENU_H_OPEN:
for(counter = 0; counter < 0x20; counter++){
sub_80976F8(counter);
}
nextMenu = MENU_MAIN_SCREEN;
break;
case 10:
sub_803A3A0();
nextMenu = MENU_MAIN_SCREEN;
break;
case 11:
nextMenu = MENU_NO_SCREEN_CHANGE;
}
return nextMenu;
}
void SetDebugMenuItems(void)
{
SetMenuItems(gUnknown_203B3EC->unk0, gUnknown_203B3EC->unk140, 0, &gUnknown_80E7D58, gDebugMenuItems, 1, 0xd, 0);
sub_8035CF4(gUnknown_203B3EC->unk0,0,1);
}
void sub_803A3A0(void)
{
sub_8035CC0(gUnknown_203B3EC->unk140, 0);
}
void sub_803A3BC(void)
{
s32 speciesIndex;
u8 sp_0x8 [88];
u16 r7 [4]; // r7
u8 buffer [20]; // r6
u32 sp_0x7C;
s32 sp_0x80;
#ifndef NONMATCHING
register s32 index asm("r5");
register u32 r9 asm("r9");
#else
s32 index;
u32 r9;
#endif
index = 1;
do {
UnlockFriendArea(index);
index++;
} while (index < NUM_FRIEND_AREAS);
index = 0;
do {
r9 = 0;
sp_0x7C = 0x1006;
index = index + 1;
speciesIndex = index * 0x10000 >> 0x10; // dumb way to force s16
memset(r7,0,8);
r7[0] = 0x27;
CopyMonsterNametoBuffer(buffer, speciesIndex);
CopyStringtoBuffer(buffer, buffer);
buffer[0] = 0x40;
sub_808CFD0(sp_0x8,speciesIndex,buffer,0x43,&sp_0x7C,r7);
sub_808D1DC(sp_0x8);
} while (index < 300);
sp_0x80 = r9;
WriteSavetoPak(&sp_0x80,1);
}

190
src/debug_menu1.c Normal file
View File

@ -0,0 +1,190 @@
#include "global.h"
#include "code_8097670.h"
#include "constants/friend_area.h"
#include "debug_menu1.h"
#include "friend_area.h"
#include "main_menu.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon.h"
#include "save.h"
#include "text_util.h"
#include "text1.h"
EWRAM_DATA_2 static struct DebugMenu *sDebugMenu = {0};
static const struct UnkTextStruct2 sUnknown_80E7D40 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7D58 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x02, 0x02,
0x09, 0x0b,
0x0b, 0x00,
NULL
};
static const struct MenuItem sDebugMenuItems[8] =
{
{"Dungeons", MENU_DEBUG_MENU_DUNGEONS},
{"Field", MENU_DEBUG_MENU_FIELD},
{"Field Map", MENU_DEBUG_MENU_FIELD_MAP},
{"Field Script", MENU_DEBUG_MENU_FIELD_SCRIPT},
{"Debug Menu", MENU_DEBUG_MENU_DEBUG_MENU},
{"Storage", MENU_DEBUG_MENU_STORAGE},
{"h-open", MENU_DEBUG_MENU_H_OPEN},
{NULL, 10},
};
ALIGNED(4) static const u8 sDebugMenuFill1[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill2[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill3[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill4[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill5[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill6[] = "pksdir0";
ALIGNED(4) static const u8 sDebugMenuFill7[] = "pksdir0";
void SetDebugMenuItems(void);
void sub_803A3A0(void);
void sub_803A3BC(void);
void CreateDebugMenu(void)
{
s32 i;
if (sDebugMenu == NULL) {
sDebugMenu = MemoryAlloc(sizeof(struct DebugMenu), 8);
MemoryFill8((u8 *)sDebugMenu, 0, sizeof(struct DebugMenu));
}
for (i = 0; i < 4; i++)
sDebugMenu->unk140[i] = sUnknown_80E7D40;
ResetUnusedInputStruct();
sub_800641C(sDebugMenu->unk140, 1, 1);
SetDebugMenuItems();
}
void DeleteDebugMenu(void)
{
ResetUnusedInputStruct();
sub_800641C(NULL, 1, 1);
if (sDebugMenu != NULL) {
MemoryFree(sDebugMenu);
sDebugMenu = NULL;
}
}
u32 UpdateDebugMenu(void)
{
u32 nextMenu;
s32 counter;
s32 debugMenuAction;
nextMenu = MENU_NO_SCREEN_CHANGE;
debugMenuAction = 11;
if (sub_8012FD8(&sDebugMenu->unk0[0]) == 0)
sub_8013114(&sDebugMenu->unk0[0], &debugMenuAction);
switch (debugMenuAction) {
case MENU_DEBUG_MENU_DUNGEONS:
nextMenu = MENU_DEBUG_DUNGEON;
break;
case MENU_DEBUG_MENU_FIELD:
nextMenu = MENU_DEBUG_FIELD;
break;
case MENU_DEBUG_MENU_FIELD_MAP:
nextMenu = MENU_DEBUG_FIELD_MAP;
break;
case MENU_DEBUG_MENU_FIELD_SCRIPT:
nextMenu = MENU_DEBUG_FIELD_SCRIPT;
break;
case MENU_DEBUG_MENU_DEBUG_MENU:
nextMenu = MENU_DEBUG_DEBUG_MENU;
break;
case MENU_DEBUG_MENU_UNKNOWN_1: // No option that correponds to this one
nextMenu = MENU_DEBUG_UNKNOWN_1;
break;
case MENU_DEBUG_MENU_STORAGE:
sub_803A3BC();
nextMenu = MENU_MAIN_SCREEN;
break;
case MENU_DEBUG_MENU_H_OPEN:
for (counter = 0; counter < 0x20; counter++)
sub_80976F8(counter);
nextMenu = MENU_MAIN_SCREEN;
break;
case 10:
sub_803A3A0();
nextMenu = MENU_MAIN_SCREEN;
break;
case 11:
nextMenu = MENU_NO_SCREEN_CHANGE;
break;
}
return nextMenu;
}
void SetDebugMenuItems(void)
{
SetMenuItems(sDebugMenu->unk0, sDebugMenu->unk140, 0, &sUnknown_80E7D58, sDebugMenuItems, 1, 13, 0);
sub_8035CF4(sDebugMenu->unk0, 0, 1);
}
void sub_803A3A0(void)
{
sub_8035CC0(sDebugMenu->unk140, 0);
}
void sub_803A3BC(void)
{
s32 speciesIndex;
u8 sp_0x8 [88];
u16 r7 [4]; // r7
u8 buffer [20]; // r6
u32 sp_0x7C;
s32 sp_0x80;
#ifndef NONMATCHING
register s32 index asm("r5");
register u32 r9 asm("r9");
#else
s32 index;
u32 r9;
#endif
index = 1;
do {
UnlockFriendArea(index);
index++;
} while (index < NUM_FRIEND_AREAS);
index = 0;
do {
r9 = 0;
sp_0x7C = 0x1006;
index++;
speciesIndex = index * 0x10000 >> 0x10; // dumb way to force s16
memset(r7, 0, 8);
r7[0] = 0x27;
CopyMonsterNametoBuffer(buffer, speciesIndex);
CopyStringtoBuffer(buffer, buffer);
buffer[0] = 0x40;
sub_808CFD0(sp_0x8, speciesIndex, buffer, 0x43, &sp_0x7C, r7);
sub_808D1DC(sp_0x8);
} while (index < 300);
sp_0x80 = r9;
WriteSavetoPak(&sp_0x80, 1);
}

274
src/debug_menu2.c Normal file
View File

@ -0,0 +1,274 @@
#include "global.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "debug_menu2.h"
#include "memory.h"
#include "menu_input.h"
#include "team_inventory.h"
#include "text1.h"
#include "text2.h"
EWRAM_DATA_2 static struct unkStruct_203B3F0 *sUnknown_203B3F0 = {0};
static const struct UnkTextStruct2 sUnknown_80E7E34 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7E4C =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x14, 0x04,
0x06, 0x03,
0x03, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7E64 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x14, 0x0e,
0x06, 0x04,
0x04, 0x00,
NULL
};
ALIGNED(4) static const u8 sNumberPrompt[] = "Number?";
ALIGNED(4) static const u8 sFill[] = "pksdir0";
// data_80D47B8.s
extern const u8 *gUnknown_80D4970[];
void sub_803A504(u32);
void sub_803A51C(void);
void sub_803A5A0(void);
void sub_803A690(void);
void sub_803A6F0(void);
void sub_803A740(void);
void sub_803A7B0(void);
void sub_803A810(void);
void sub_803A86C(void);
// Unused
u32 sub_803A45C(void)
{
ResetUnusedInputStruct();
sub_800641C(0, 1, 1);
sUnknown_203B3F0 = MemoryAlloc(sizeof(struct unkStruct_203B3F0), 8);
sub_803A504(0);
return 1;
}
// Unused
u32 sub_803A48C(void)
{
switch (sUnknown_203B3F0->state) {
case 0:
case 1:
sub_803A740();
break;
case 2:
sub_803A7B0();
break;
case 3:
sub_803A810();
break;
case 4:
sub_803A86C();
break;
case 5:
return 3;
}
return 0;
}
// Unused
void sub_803A4E8(void)
{
if (sUnknown_203B3F0 != NULL) {
MemoryFree(sUnknown_203B3F0);
sUnknown_203B3F0 = NULL;
}
}
void sub_803A504(u32 newState)
{
sUnknown_203B3F0->state = newState;
sub_803A51C();
sub_803A5A0();
}
void sub_803A51C(void)
{
s32 i;
sub_8006518(sUnknown_203B3F0->unkD8);
switch (sUnknown_203B3F0->state) {
case 3:
sUnknown_203B3F0->unkD8[1] = sUnknown_80E7E64;
break;
case 2:
sUnknown_203B3F0->unkD8[2] = sUnknown_80E7E4C;
break;
default:
for (i = 0; i < 4; i++)
sUnknown_203B3F0->unkD8[i] = sUnknown_80E7E34;
break;
}
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B3F0->unkD8, 1, 1);
}
void sub_803A5A0(void)
{
struct Item item;
switch (sUnknown_203B3F0->state) {
case 0:
sub_801C8C4(2, 3, 0, 10);
break;
case 1:
sub_801CB5C(TRUE);
break;
case 2:
sub_801CCD8();
sub_803A6F0();
sub_8012D60(&sUnknown_203B3F0->unk4C, sUnknown_203B3F0->menuItems, 0, 0, sUnknown_203B3F0->menuAction, 2);
break;
case 3:
sUnknown_203B3F0->unkAC = 3;
sUnknown_203B3F0->unkA4 = 0;
sUnknown_203B3F0->unkA8 = 999;
sUnknown_203B3F0->unkA0 = gTeamInventoryRef->teamStorage[sUnknown_203B3F0->id];
sUnknown_203B3F0->unkB0 = 1;
sUnknown_203B3F0->unkB4 = &sUnknown_203B3F0->unkD8[1];
sUnknown_203B3F0->unkB8 = 44;
sUnknown_203B3F0->unkBC = 18;
sub_8013AA0(&sUnknown_203B3F0->unk9C);
sub_803A690();
break;
case 4:
xxx_init_itemslot_8090A8C(&item, sUnknown_203B3F0->id, 0);
sub_801B3C0(&item);
break;
case 5:
break;
}
}
void sub_803A690(void)
{
sub_8008C54(sUnknown_203B3F0->unkB0);
sub_80073B8(sUnknown_203B3F0->unkB0);
xxx_call_draw_string(4, 0, sNumberPrompt, sUnknown_203B3F0->unkB0, 0);
sub_8013C68(&sUnknown_203B3F0->unk9C);
sub_80073E0(sUnknown_203B3F0->unkB0);
sub_801CCD8();
sub_8012EA4(&sUnknown_203B3F0->unk4C, 0);
}
void sub_803A6F0(void)
{
s32 loopMax = 0;
sUnknown_203B3F0->menuItems[loopMax].text = sNumberPrompt;
sUnknown_203B3F0->menuItems[loopMax].menuAction = 2;
sUnknown_203B3F0->menuAction = 2;
if (!IsNotMoneyOrUsedTMItem(sUnknown_203B3F0->id)) {
sUnknown_203B3F0->menuItems[loopMax].menuAction = -1;
sUnknown_203B3F0->menuAction = 3;
}
loopMax += 1;
sUnknown_203B3F0->menuItems[loopMax].text = *gUnknown_80D4970;
sUnknown_203B3F0->menuItems[loopMax].menuAction = 3;
loopMax += 1;
sUnknown_203B3F0->menuItems[loopMax].text = NULL;
sUnknown_203B3F0->menuItems[loopMax].menuAction = 1;
}
void sub_803A740(void)
{
switch (sub_801CA08(TRUE)) {
case 0:
case 1:
break;
case 3:
sUnknown_203B3F0->id = sub_801CB24();
sub_803A504(2);
break;
case 4:
sUnknown_203B3F0->id = sub_801CB24();
sub_803A504(4);
break;
case 2:
sub_801CBB8();
sub_803A504(5);
break;
}
}
void sub_803A7B0(void)
{
s32 menuAction;
menuAction = 0;
sub_801CA08(FALSE);
if (sub_8012FD8(&sUnknown_203B3F0->unk4C) == 0)
sub_8013114(&sUnknown_203B3F0->unk4C, &menuAction);
switch (menuAction) {
case 2:
sub_803A504(3);
break;
case 3:
sub_803A504(4);
break;
case 1:
sub_803A504(1);
break;
}
}
void sub_803A810(void)
{
sub_801CA08(FALSE);
sub_8012FD8(&sUnknown_203B3F0->unk4C);
switch (sub_8013BBC(&sUnknown_203B3F0->unk9C)) {
case 3:
gTeamInventoryRef->teamStorage[sUnknown_203B3F0->id] = sUnknown_203B3F0->unk9C;
// Fallthrough needed to match
case 2:
sub_803A504(1);
break;
case 1:
sub_803A690();
break;
}
}
void sub_803A86C(void)
{
switch (sub_801B410()) {
case 1:
case 0:
break;
case 2:
case 3:
sub_801B450();
sub_803A504(1);
break;
}
}

254
src/debug_menu3.c Normal file
View File

@ -0,0 +1,254 @@
#include "global.h"
#include "code_801EE10_mid.h"
#include "code_8021774.h"
#include "code_8021774_pre.h"
#include "debug_menu3.h"
#include "friend_area.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon.h"
#include "text1.h"
#include "text2.h"
EWRAM_DATA_2 static struct unkStruct_203B3F4 *sUnknown_203B3F4 = {0};
static const struct UnkTextStruct2 sUnknown_80E7E8C =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7EA4 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x15, 0x04,
0x06, 0x03,
0x03, 0x00,
NULL
};
ALIGNED(4) static const u8 sClose[] = "CLOSE";
ALIGNED(4) static const u8 sOpen[] = "OPEN";
ALIGNED(4) static const u8 sFill[] = "pksdir0";
// data_80D47B8.s
extern const u8 *gUnknown_80D4970[];
void sub_803A924(u32);
void sub_803A93C(void);
void sub_803A9AC(void);
void sub_803AA34(void);
void sub_803AAC4(void);
void sub_803AB34(void);
void sub_803ABAC(void);
bool8 sub_803ABC8(void);
// Unused
u32 sub_803A888(void)
{
ResetUnusedInputStruct();
sub_800641C(0, 1, 1);
sUnknown_203B3F4 = MemoryAlloc(sizeof(struct unkStruct_203B3F4), 8);
sub_803A924(0);
return 1;
}
// Unused
u32 sub_803A8B8(void)
{
switch (sUnknown_203B3F4->state) {
case 0:
case 1:
sub_803AAC4();
break;
case 2:
sub_803AB34();
break;
case 3:
sub_803ABAC();
break;
case 4:
return 3;
}
return 0;
}
// Unused
void sub_803A908(void)
{
if (sUnknown_203B3F4 != NULL) {
MemoryFree(sUnknown_203B3F4);
sUnknown_203B3F4 = NULL;
}
}
void sub_803A924(u32 newState)
{
sUnknown_203B3F4->state = newState;
sub_803A93C();
sub_803A9AC();
}
void sub_803A93C(void)
{
s32 i;
sub_8006518(sUnknown_203B3F4->unk9C);
if (sUnknown_203B3F4->state == 2)
sUnknown_203B3F4->unk9C[2] = sUnknown_80E7EA4;
else {
for(i = 0; i < 4; i++)
sUnknown_203B3F4->unk9C[i] = sUnknown_80E7E8C;
}
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B3F4->unk9C, 1, 1);
}
void sub_803A9AC(void)
{
switch (sUnknown_203B3F4->state) {
case 0:
sub_80211AC(0, 3);
break;
case 1:
sub_8021354(TRUE);
break;
case 2:
sub_8021494();
sub_803AA34();
sub_8012D60(&sUnknown_203B3F4->unk4C, sUnknown_203B3F4->menuItems, 0, 0, sUnknown_203B3F4->menuAction, 2);
break;
case 3:
sub_8021774(sUnknown_203B3F4->friendArea, 1, 0);
break;
case 4:
break;
}
}
void sub_803AA34(void)
{
s32 index;
u8 *FriendAreas;
index = 0;
// So dumb that it matches...
FriendAreas = gFriendAreas;
if (FriendAreas[sUnknown_203B3F4->friendArea]) {
sUnknown_203B3F4->menuItems[0].text = sClose;
if (sub_803ABC8())
sUnknown_203B3F4->menuItems[0].menuAction = 3;
else
sUnknown_203B3F4->menuItems[0].menuAction = -1;
}
else {
sUnknown_203B3F4->menuItems[0].text = sOpen;
sUnknown_203B3F4->menuItems[0].menuAction = 2;
}
index++;
sUnknown_203B3F4->menuItems[index].text = *gUnknown_80D4970;
sUnknown_203B3F4->menuItems[index].menuAction = 4;
index++;
sUnknown_203B3F4->menuItems[index].text = NULL;
sUnknown_203B3F4->menuItems[index].menuAction = 1;
sUnknown_203B3F4->menuAction = sUnknown_203B3F4->menuItems[0].menuAction;
}
void sub_803AAC4(void)
{
switch (sub_8021274(TRUE)) {
case 0:
case 1:
break;
case 3:
sUnknown_203B3F4->friendArea = sub_802132C();
sub_803A924(2);
break;
case 4:
sUnknown_203B3F4->friendArea = sub_802132C();
sub_803A924(3);
break;
case 2:
sub_80213A0();
sub_803A924(4);
break;
}
}
void sub_803AB34(void)
{
s32 menuAction;
menuAction = 0;
sub_8021274(0);
if (!sub_8012FD8(&sUnknown_203B3F4->unk4C))
sub_8013114(&sUnknown_203B3F4->unk4C, &menuAction);
switch (menuAction) {
case 2:
UnlockFriendArea(sUnknown_203B3F4->friendArea);
sub_803A924(1);
break;
case 3:
sub_809249C(sUnknown_203B3F4->friendArea, 1);
sub_803A924(1);
break;
case 4:
sub_803A924(3);
break;
case 1:
sub_803A924(1);
break;
}
}
void sub_803ABAC(void)
{
switch (sub_80217EC()) {
case 2:
case 3:
sub_8021830();
sub_803A924(1);
break;
case 0:
case 1:
break;
}
}
bool8 sub_803ABC8(void)
{
struct PokemonStruct *mon;
s32 i;
s32 mask;
for (i = 0, mask = 1; i < NUM_MONSTERS; i++) {
// Some check was optimized out. Needed for matching. Thanks kaz
if (i) {
u8 unk = -unk;
}
mon = &gRecruitedPokemonRef->pokemon[i];
if ((mask & mon->unk0) != 0
&& ((mon->unk0 >> 1) & mask) != 0
&& sUnknown_203B3F4->friendArea == GetFriendArea(mon->speciesNum))
return FALSE;
}
return TRUE;
}

279
src/debug_menu4.c Normal file
View File

@ -0,0 +1,279 @@
#include "global.h"
#include "code_8012A18_1.h"
#include "code_80130A8.h"
#include "code_801EE10_1.h"
#include "debug_menu4.h"
#include "memory.h"
#include "menu_input.h"
#include "text1.h"
#include "text2.h"
EWRAM_DATA_2 static struct unkStruct_203B3F8 *sUnknown_203B3F8 = {0};
static const struct UnkTextStruct2 sUnknown_80E7ED4 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7EEC =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x13, 0x04,
0x09, 0x03,
0x03, 0x00,
NULL
};
static const struct UnkTextStruct2 sUnknown_80E7F04 =
{
0x00, 0x00, 0x00, 0x00,
0x03,
0x13, 0x0e,
0x06, 0x04,
0x04, 0x00,
NULL
};
ALIGNED(4) static const u8 sNumberPrompt[] = "Number?";
ALIGNED(4) static const u8 sLevel[] = "LEVEL";
ALIGNED(4) static const u8 sName[] = "Name";
static const u8 sFill[] = "pksdir0";
void sub_803ACD0(u32);
void sub_803ACE8(void);
void sub_803AD88(void);
void sub_803AE58(void);
void sub_803AEB0(void);
void sub_803AF38(void);
void sub_803AF88(void);
void sub_803AFE8(void);
void sub_803B034(void);
// Unused
u32 sub_803AC24(void)
{
sUnknown_203B3F8 = MemoryAlloc(sizeof(struct unkStruct_203B3F8), 8);
sub_803ACD0(0);
return 1;
}
// Unused
u32 sub_803AC48(void)
{
switch (sUnknown_203B3F8->state) {
case 0:
sub_803ACD0(1);
break;
case 1:
case 2:
sub_803AF38();
break;
case 3:
sub_803AF88();
break;
case 5:
sub_803AFE8();
break;
case 6:
sub_803B034();
break;
case 4:
case 7:
default:
return 3;
}
return 0;
}
// Unused
void sub_803ACB4(void)
{
if (sUnknown_203B3F8 != NULL) {
MemoryFree(sUnknown_203B3F8);
sUnknown_203B3F8 = NULL;
}
}
void sub_803ACD0(u32 newState)
{
sUnknown_203B3F8->state = newState;
sub_803ACE8();
sub_803AD88();
}
void sub_803ACE8(void)
{
s32 i;
sub_8006518(sUnknown_203B3F8->unkE0);
switch (sUnknown_203B3F8->state) {
case 3:
sub_803AEB0();
sUnknown_203B3F8->unkE0[2] = sUnknown_80E7EEC;
sub_8012CAC(&sUnknown_203B3F8->unkE0[2], sUnknown_203B3F8->unk90);
break;
case 5:
sUnknown_203B3F8->unkE0[3] = sUnknown_80E7F04;
break;
default:
for (i = 0; i < 4; i++)
sUnknown_203B3F8->unkE0[i] = sUnknown_80E7ED4;
break;
}
ResetUnusedInputStruct();
sub_800641C(sUnknown_203B3F8->unkE0, 1, 1);
}
void sub_803AD88(void)
{
switch (sUnknown_203B3F8->state) {
case 1:
sub_8023868(1, 0, 0, 10);
break;
case 2:
sub_8023B7C(1);
break;
case 3:
sub_8023DA4();
sub_8012D60(&sUnknown_203B3F8->unk10, sUnknown_203B3F8->unk90, 0, sUnknown_203B3F8->unkD0, sUnknown_203B3F8->menuAction, 2);
break;
case 5:
sUnknown_203B3F8->unk70 = 3;
sUnknown_203B3F8->unk68 = 1;
sUnknown_203B3F8->unk6C = 100;
sUnknown_203B3F8->unk64 = sUnknown_203B3F8->pokemon->unkHasNextStage;
sUnknown_203B3F8->unk74 = 3;
sUnknown_203B3F8->unk78 = &sUnknown_203B3F8->unkE0[3];
sUnknown_203B3F8->unk7C = 44;
sUnknown_203B3F8->unk80 = 18;
sub_8013AA0(&sUnknown_203B3F8->unk60);
sub_803AE58();
break;
case 6:
sub_801602C(2, sUnknown_203B3F8->pokemon->name);
case 0:
case 4:
case 7:
default:
break;
}
}
void sub_803AE58(void)
{
sub_8008C54(sUnknown_203B3F8->unk74);
sub_80073B8(sUnknown_203B3F8->unk74);
xxx_call_draw_string(4, 0, sNumberPrompt, sUnknown_203B3F8->unk74, 0);
sub_8013C68(&sUnknown_203B3F8->unk60);
sub_80073E0(sUnknown_203B3F8->unk74);
sub_8023DA4();
sub_8012EA4(&sUnknown_203B3F8->unk10, 0);
}
void sub_803AEB0(void)
{
s32 i;
s32 loopMax;
MemoryFill16(sUnknown_203B3F8->unkD0, 0, sizeof(sUnknown_203B3F8->unkD0));
loopMax = 0;
sUnknown_203B3F8->unk90[loopMax].text = sLevel;
sUnknown_203B3F8->unk90[loopMax].menuAction = 4;
loopMax++;
sUnknown_203B3F8->unk90[loopMax].text = sName;
sUnknown_203B3F8->unk90[loopMax].menuAction = 5;
loopMax++;
sUnknown_203B3F8->unk90[loopMax].text = NULL;
sUnknown_203B3F8->unk90[loopMax].menuAction = 1;
for (i = 0; i < loopMax; i++) {
if (sUnknown_203B3F8->unkD0[i] == 0) {
sUnknown_203B3F8->menuAction = sUnknown_203B3F8->unk90[i].menuAction;
break;
}
}
}
void sub_803AF38(void)
{
switch (sub_8023A94(TRUE)) {
case 3:
sUnknown_203B3F8->unk4 = sub_8023B44();
sUnknown_203B3F8->pokemon = &gRecruitedPokemonRef->pokemon[sUnknown_203B3F8->unk4];
sub_803ACD0(3);
break;
case 2:
sub_8023C60();
sub_803ACD0(7);
break;
case 1:
case 0:
break;
}
}
void sub_803AF88(void)
{
s32 menuAction;
menuAction = 0;
sub_8023A94(FALSE);
if (sub_8012FD8(&sUnknown_203B3F8->unk10) == 0)
sub_8013114(&sUnknown_203B3F8->unk10, &menuAction);
switch (menuAction) {
case 4:
sub_803ACD0(5);
break;
case 5:
sub_803ACD0(6);
break;
case 1:
sub_803ACD0(2);
break;
default:
break;
}
}
void sub_803AFE8(void)
{
sub_8023A94(FALSE);
sub_8012FD8(&sUnknown_203B3F8->unk10);
switch (sub_8013BBC(&sUnknown_203B3F8->unk60)) {
default:
break;
case 3:
sUnknown_203B3F8->pokemon->unkHasNextStage = sUnknown_203B3F8->unk60;
// Fallthrough is needed to match
case 2:
sub_803ACD0(2);
break;
case 1:
sub_803AE58();
break;
}
}
void sub_803B034(void)
{
switch (sub_8016080()) {
case 2:
case 3:
sub_80160D8();
sub_803ACD0(2);
break;
}
}

View File

@ -1,291 +0,0 @@
#include "global.h"
#include "pokemon.h"
#include "debug_menu.h"
#include "memory.h"
#include "text.h"
#include "input.h"
#include "menu.h"
#include "menu_input.h"
extern struct unkStruct_203B3F8 *gUnknown_203B3F8;
const struct UnkTextStruct2 gUnknown_80E7ED4 = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7EEC = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x13, 0x04,
0x09, 0x03,
0x03, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7F04 = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x13, 0x0e,
0x06, 0x04,
0x04, 0x00,
NULL
};
ALIGNED(4) const u8 gDebug_NumberText2[] = "Number?";
ALIGNED(4) const u8 gDebug_LevelText[] = "LEVEL";
ALIGNED(4) const u8 gDebug_Name[] = "Name";
static const u8 fill0[] = "pksdir0";
extern u32 sub_8013BBC(u32 *);
extern void sub_803AE58(void);
extern u32 sub_8016080(void);
extern void sub_803ACD0(u32);
extern void sub_80160D8(void);
extern u32 sub_8023A94(u32);
extern s16 sub_8023B44(void);
extern void sub_8023C60(void);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_8013C68(u32 *);
extern void sub_80073E0(u32);
extern void sub_8023DA4(void);
extern void sub_803ACE8();
extern void sub_803AD88();
extern void sub_803AF38();
extern void sub_803AF88();
extern void sub_803AFE8();
extern void sub_803B034();
extern void sub_8023868(u32, u32, u32, u32);
extern void sub_8023B7C(u32);
extern void sub_8013AA0(u32 *);
extern void sub_801602C(u32, u8 *);
extern void sub_803AEB0();
u32 sub_803AC24(void)
{
gUnknown_203B3F8 = MemoryAlloc(sizeof(struct unkStruct_203B3F8), 8);
sub_803ACD0(0);
return 1;
}
u32 sub_803AC48(void)
{
switch(gUnknown_203B3F8->state)
{
case 0:
sub_803ACD0(1);
break;
case 1:
case 2:
sub_803AF38();
break;
case 3:
sub_803AF88();
break;
case 5:
sub_803AFE8();
break;
case 6:
sub_803B034();
break;
case 4:
case 7:
default:
return 3;
}
return 0;
}
void sub_803ACB4(void)
{
if(gUnknown_203B3F8 != NULL)
{
MemoryFree(gUnknown_203B3F8);
gUnknown_203B3F8 = NULL;
}
}
void sub_803ACD0(u32 newState)
{
gUnknown_203B3F8->state = newState;
sub_803ACE8();
sub_803AD88();
}
void sub_803ACE8(void)
{
s32 index;
sub_8006518(gUnknown_203B3F8->unkE0);
switch(gUnknown_203B3F8->state)
{
case 3:
sub_803AEB0();
gUnknown_203B3F8->unkE0[2] = gUnknown_80E7EEC;
sub_8012CAC(&gUnknown_203B3F8->unkE0[2], gUnknown_203B3F8->unk90);
break;
case 5:
gUnknown_203B3F8->unkE0[3] = gUnknown_80E7F04;
break;
default:
for(index = 0; index < 4; index++)
{
gUnknown_203B3F8->unkE0[index] = gUnknown_80E7ED4;
}
break;
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B3F8->unkE0, 1, 1);
}
void sub_803AD88(void)
{
switch(gUnknown_203B3F8->state)
{
case 1:
sub_8023868(1, 0, 0, 10);
break;
case 2:
sub_8023B7C(1);
break;
case 3:
sub_8023DA4();
sub_8012D60(&gUnknown_203B3F8->unk10, gUnknown_203B3F8->unk90, 0, gUnknown_203B3F8->unkD0, gUnknown_203B3F8->menuAction, 2);
break;
case 5:
gUnknown_203B3F8->unk70 = 3;
gUnknown_203B3F8->unk68 = 1;
gUnknown_203B3F8->unk6C = 0x64;
gUnknown_203B3F8->unk64 = gUnknown_203B3F8->pokemon->unkHasNextStage;
gUnknown_203B3F8->unk74 = 3;
gUnknown_203B3F8->unk78 = &gUnknown_203B3F8->unkE0[3];
gUnknown_203B3F8->unk7C = 0x2C;
gUnknown_203B3F8->unk80 = 0x12;
sub_8013AA0(&gUnknown_203B3F8->unk60);
sub_803AE58();
break;
case 6:
sub_801602C(2, gUnknown_203B3F8->pokemon->name);
case 0:
case 4:
case 7:
default:
break;
}
}
void sub_803AE58(void)
{
sub_8008C54(gUnknown_203B3F8->unk74);
sub_80073B8(gUnknown_203B3F8->unk74);
xxx_call_draw_string(4, 0, gDebug_NumberText2, gUnknown_203B3F8->unk74, 0);
sub_8013C68(&gUnknown_203B3F8->unk60);
sub_80073E0(gUnknown_203B3F8->unk74);
sub_8023DA4();
sub_8012EA4(&gUnknown_203B3F8->unk10, 0);
}
void sub_803AEB0(void)
{
s32 index;
s32 loopMax;
MemoryFill16(gUnknown_203B3F8->unkD0,0,sizeof(gUnknown_203B3F8->unkD0));
loopMax = 0;
gUnknown_203B3F8->unk90[loopMax].text = gDebug_LevelText;
gUnknown_203B3F8->unk90[loopMax].menuAction = 4;
loopMax += 1;
gUnknown_203B3F8->unk90[loopMax].text = gDebug_Name;
gUnknown_203B3F8->unk90[loopMax].menuAction = 5;
loopMax += 1;
gUnknown_203B3F8->unk90[loopMax].text = NULL;
gUnknown_203B3F8->unk90[loopMax].menuAction = 1;
for(index = 0; index < loopMax; index++)
{
if (gUnknown_203B3F8->unkD0[index] == 0)
{
gUnknown_203B3F8->menuAction = gUnknown_203B3F8->unk90[index].menuAction;
break;
}
}
}
void sub_803AF38(void)
{
switch(sub_8023A94(1))
{
case 3:
gUnknown_203B3F8->unk4 = sub_8023B44();
gUnknown_203B3F8->pokemon = &gRecruitedPokemonRef->pokemon[gUnknown_203B3F8->unk4];
sub_803ACD0(3);
break;
case 2:
sub_8023C60();
sub_803ACD0(7);
break;
case 1:
case 0:
break;
}
}
void sub_803AF88(void)
{
s32 menuAction;
menuAction = 0;
sub_8023A94(0);
if (sub_8012FD8(&gUnknown_203B3F8->unk10) == 0) {
sub_8013114(&gUnknown_203B3F8->unk10, &menuAction);
}
switch(menuAction)
{
case 4:
sub_803ACD0(5);
break;
case 5:
sub_803ACD0(6);
break;
case 1:
sub_803ACD0(2);
break;
default:
break;
}
}
void sub_803AFE8(void)
{
sub_8023A94(0);
sub_8012FD8(&gUnknown_203B3F8->unk10);
switch(sub_8013BBC(&gUnknown_203B3F8->unk60))
{
default:
break;
case 3:
gUnknown_203B3F8->pokemon->unkHasNextStage = gUnknown_203B3F8->unk60;
// Fallthrough is needed to match
case 2:
sub_803ACD0(2);
break;
case 1:
sub_803AE58();
break;
}
}
void sub_803B034(void)
{
switch(sub_8016080())
{
case 2:
case 3:
sub_80160D8();
sub_803ACD0(2);
break;
}
}

View File

@ -1,544 +0,0 @@
#include "global.h"
#include "input.h"
#include "item.h"
#include "team_inventory.h"
#include "memory.h"
#include "menu.h"
#include "text.h"
#include "menu_input.h"
#include "friend_area.h"
struct unkStruct_203B3F0
{
// size: 0x138
u32 state;
u8 id;
u32 menuAction;
struct MenuItem menuItems[8];
struct MenuStruct unk4C;
u32 unk9C;
u32 unkA0;
u32 unkA4;
u32 unkA8;
u32 unkAC;
u32 unkB0;
struct UnkTextStruct2 *unkB4;
u32 unkB8;
u32 unkBC;
u8 fill4[0xD8 - 0xC0];
struct UnkTextStruct2 unkD8[4];
};
extern struct unkStruct_203B3F0 *gUnknown_203B3F0;
struct unkStruct_203B3F4
{
// size: 0xFC
u32 state;
u8 friendArea;
u8 fill5[0x8 - 5];
u32 menuAction;
struct MenuItem menuItems[8];
struct MenuStruct unk4C;
struct UnkTextStruct2 unk9C[4];
};
extern struct unkStruct_203B3F4 *gUnknown_203B3F4;
const struct UnkTextStruct2 gUnknown_80E7E34 = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7E4C = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x14, 0x04,
0x06, 0x03,
0x03, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7E64 = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x14, 0x0e,
0x06, 0x04,
0x04, 0x00,
NULL
};
ALIGNED(4) const char gDebug_NumberText[] = "Number?";
ALIGNED(4) static const u8 fill0[] = "pksdir0";
const struct UnkTextStruct2 gUnknown_80E7E8C = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x00, 0x00,
0x00, 0x00,
0x00, 0x00,
NULL
};
const struct UnkTextStruct2 gUnknown_80E7EA4 = {
0x00, 0x00, 0x00, 0x00,
0x03,
0x15, 0x04,
0x06, 0x03,
0x03, 0x00,
NULL
};
ALIGNED(4) const u8 gDebug_CloseText[] = "CLOSE";
ALIGNED(4) const u8 gDebug_OpenText[] = "OPEN";
ALIGNED(4) static const u8 fill1[] = "pksdir0";
extern bool8 *gFriendAreas;
extern const char *gUnknown_80D4970[];
extern void sub_801B3C0(struct Item *);
extern void sub_8013AA0(u32 *);
extern void sub_801C8C4(u32, u32, u32, u32);
extern void sub_801CB5C(u32);
extern void sub_801CCD8();
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8013C68(u32 *);
extern u32 sub_801CA08(u32);
extern u8 sub_801CB24();
extern void sub_801CBB8();
extern u32 sub_8013BBC(u32 *);
extern u32 sub_801B410();
extern void sub_801B450();
extern void sub_80211AC(u32, u32);
extern void sub_8021354(u32);
extern void sub_8021494();
extern void sub_803AA34();
extern void sub_8021774(u8,u32, u32);
extern void sub_809249C(u8, u32);
extern void sub_8021830(void);
extern u32 sub_80217EC(void);
extern u8 sub_803ABC8(void);
extern u32 sub_8021274(u32);
extern u8 sub_802132C(void);
extern void sub_80213A0(void);
extern void sub_803AAC4();
extern void sub_803AB34();
extern void sub_803ABAC();
void sub_803A924(u32);
void sub_803A93C();
void sub_803A9AC();
void sub_803A504(u32);
void sub_803A51C();
void sub_803A5A0();
void sub_803A690();
void sub_803A6F0();
void sub_803A740();
void sub_803A7B0();
void sub_803A810();
void sub_803A86C();
u32 sub_803A45C(void)
{
ResetUnusedInputStruct();
sub_800641C(0,1,1);
gUnknown_203B3F0 = MemoryAlloc(sizeof(struct unkStruct_203B3F0), 8);
sub_803A504(0);
return 1;
}
u32 sub_803A48C(void)
{
switch(gUnknown_203B3F0->state) {
case 0:
case 1:
sub_803A740();
break;
case 2:
sub_803A7B0();
break;
case 3:
sub_803A810();
break;
case 4:
sub_803A86C();
break;
case 5:
return 3;
}
return 0;
}
void sub_803A4E8(void)
{
if(gUnknown_203B3F0 != NULL)
{
MemoryFree(gUnknown_203B3F0);
gUnknown_203B3F0 = NULL;
}
}
void sub_803A504(u32 newState)
{
gUnknown_203B3F0->state = newState;
sub_803A51C();
sub_803A5A0();
}
void sub_803A51C(void)
{
s32 index;
sub_8006518(gUnknown_203B3F0->unkD8);
switch(gUnknown_203B3F0->state)
{
case 3:
gUnknown_203B3F0->unkD8[1] = gUnknown_80E7E64;
break;
case 2:
gUnknown_203B3F0->unkD8[2] = gUnknown_80E7E4C;
break;
default:
for(index = 0; index < 4; index++)
{
gUnknown_203B3F0->unkD8[index] = gUnknown_80E7E34;
}
break;
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B3F0->unkD8, 1, 1);
}
void sub_803A5A0(void)
{
struct Item item;
switch(gUnknown_203B3F0->state) {
case 0:
sub_801C8C4(2,3,0,10);
break;
case 1:
sub_801CB5C(1);
break;
case 2:
sub_801CCD8();
sub_803A6F0();
sub_8012D60(&gUnknown_203B3F0->unk4C, gUnknown_203B3F0->menuItems, 0, 0, gUnknown_203B3F0->menuAction, 2);
break;
case 3:
gUnknown_203B3F0->unkAC = 3;
gUnknown_203B3F0->unkA4 = 0;
gUnknown_203B3F0->unkA8 = 0x3e7;
gUnknown_203B3F0->unkA0 = gTeamInventoryRef->teamStorage[gUnknown_203B3F0->id];
gUnknown_203B3F0->unkB0 = 1;
gUnknown_203B3F0->unkB4 = &gUnknown_203B3F0->unkD8[1];
gUnknown_203B3F0->unkB8 = 0x2C;
gUnknown_203B3F0->unkBC = 0x12;
sub_8013AA0(&gUnknown_203B3F0->unk9C);
sub_803A690();
break;
case 4:
xxx_init_itemslot_8090A8C(&item,gUnknown_203B3F0->id,0);
sub_801B3C0(&item);
break;
case 5:
break;
}
}
void sub_803A690(void)
{
sub_8008C54(gUnknown_203B3F0->unkB0);
sub_80073B8(gUnknown_203B3F0->unkB0);
xxx_call_draw_string(4, 0, gDebug_NumberText, gUnknown_203B3F0->unkB0, 0);
sub_8013C68(&gUnknown_203B3F0->unk9C);
sub_80073E0(gUnknown_203B3F0->unkB0);
sub_801CCD8();
sub_8012EA4(&gUnknown_203B3F0->unk4C,0);
}
void sub_803A6F0(void)
{
s32 loopMax = 0;
gUnknown_203B3F0->menuItems[loopMax].text = gDebug_NumberText;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 2;
gUnknown_203B3F0->menuAction = 2;
if (!IsNotMoneyOrUsedTMItem(gUnknown_203B3F0->id)) {
gUnknown_203B3F0->menuItems[loopMax].menuAction = -1;
gUnknown_203B3F0->menuAction = 3;
}
loopMax += 1;
gUnknown_203B3F0->menuItems[loopMax].text = *gUnknown_80D4970;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 3;
loopMax += 1;
gUnknown_203B3F0->menuItems[loopMax].text = NULL;
gUnknown_203B3F0->menuItems[loopMax].menuAction = 1;
}
void sub_803A740(void)
{
switch(sub_801CA08(1)) {
case 0:
case 1:
break;
case 3:
gUnknown_203B3F0->id = sub_801CB24();
sub_803A504(2);
break;
case 4:
gUnknown_203B3F0->id = sub_801CB24();
sub_803A504(4);
break;
case 2:
sub_801CBB8();
sub_803A504(5);
break;
}
}
void sub_803A7B0(void)
{
s32 menuAction;
menuAction = 0;
sub_801CA08(0);
if (sub_8012FD8(&gUnknown_203B3F0->unk4C) == '\0') {
sub_8013114(&gUnknown_203B3F0->unk4C,&menuAction);
}
switch(menuAction)
{
case 2:
sub_803A504(3);
break;
case 3:
sub_803A504(4);
break;
case 1:
sub_803A504(1);
break;
}
}
void sub_803A810(void)
{
sub_801CA08(0);
sub_8012FD8(&gUnknown_203B3F0->unk4C);
switch(sub_8013BBC(&gUnknown_203B3F0->unk9C))
{
case 3:
gTeamInventoryRef->teamStorage[gUnknown_203B3F0->id] = gUnknown_203B3F0->unk9C;
// Fallthrough needed to match
case 2:
sub_803A504(1);
break;
case 1:
sub_803A690();
break;
}
}
void sub_803A86C(void)
{
switch(sub_801B410())
{
case 1:
case 0:
break;
case 2:
case 3:
sub_801B450();
sub_803A504(1);
break;
}
}
//////////////////////////////////////////
u32 sub_803A888(void)
{
ResetUnusedInputStruct();
sub_800641C(0, 1, 1);
gUnknown_203B3F4 = MemoryAlloc(sizeof(struct unkStruct_203B3F4), 8);
sub_803A924(0);
return 1;
}
u32 sub_803A8B8(void)
{
switch(gUnknown_203B3F4->state) {
case 0:
case 1:
sub_803AAC4();
break;
case 2:
sub_803AB34();
break;
case 3:
sub_803ABAC();
break;
case 4:
return 3;
}
return 0;
}
void sub_803A908(void)
{
if(gUnknown_203B3F4 != NULL)
{
MemoryFree(gUnknown_203B3F4);
gUnknown_203B3F4 = NULL;
}
}
void sub_803A924(u32 newState)
{
gUnknown_203B3F4->state = newState;
sub_803A93C();
sub_803A9AC();
}
void sub_803A93C(void)
{
s32 index;
sub_8006518(gUnknown_203B3F4->unk9C);
if(gUnknown_203B3F4->state == 2)
{
gUnknown_203B3F4->unk9C[2] = gUnknown_80E7EA4;
}
else
{
for(index = 0; index < 4; index++)
{
gUnknown_203B3F4->unk9C[index] = gUnknown_80E7E8C;
}
}
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B3F4->unk9C, 1, 1);
}
void sub_803A9AC(void)
{
switch(gUnknown_203B3F4->state) {
case 0:
sub_80211AC(0,3);
break;
case 1:
sub_8021354(1);
break;
case 2:
sub_8021494();
sub_803AA34();
sub_8012D60(&gUnknown_203B3F4->unk4C,gUnknown_203B3F4->menuItems,0,0,gUnknown_203B3F4->menuAction,2);
break;
case 3:
sub_8021774(gUnknown_203B3F4->friendArea,1,0);
break;
case 4:
break;
}
}
void sub_803AA34(void)
{
s32 index;
u8 *FriendAreas;
index = 0;
// So dumb that it matches...
FriendAreas = gFriendAreas;
if(FriendAreas[gUnknown_203B3F4->friendArea])
{
gUnknown_203B3F4->menuItems[0].text = gDebug_CloseText;
if(sub_803ABC8())
gUnknown_203B3F4->menuItems[0].menuAction = 3;
else
gUnknown_203B3F4->menuItems[0].menuAction = -1;
}
else
{
gUnknown_203B3F4->menuItems[0].text = gDebug_OpenText;
gUnknown_203B3F4->menuItems[0].menuAction = 2;
}
index++;
gUnknown_203B3F4->menuItems[index].text = *gUnknown_80D4970;
gUnknown_203B3F4->menuItems[index].menuAction = 4;
index++;
gUnknown_203B3F4->menuItems[index].text = NULL;
gUnknown_203B3F4->menuItems[index].menuAction = 1;
gUnknown_203B3F4->menuAction = gUnknown_203B3F4->menuItems[0].menuAction;
}
void sub_803AAC4(void)
{
switch(sub_8021274(1))
{
case 0:
case 1:
break;
case 3:
gUnknown_203B3F4->friendArea = sub_802132C();
sub_803A924(2);
break;
case 4:
gUnknown_203B3F4->friendArea = sub_802132C();
sub_803A924(3);
break;
case 2:
sub_80213A0();
sub_803A924(4);
break;
}
}
void sub_803AB34(void)
{
s32 menuAction;
menuAction = 0;
sub_8021274(0);
if(!sub_8012FD8(&gUnknown_203B3F4->unk4C))
sub_8013114(&gUnknown_203B3F4->unk4C, &menuAction);
switch(menuAction)
{
case 2:
UnlockFriendArea(gUnknown_203B3F4->friendArea);
sub_803A924(1);
break;
case 3:
sub_809249C(gUnknown_203B3F4->friendArea, 1);
sub_803A924(1);
break;
case 4:
sub_803A924(3);
break;
case 1:
sub_803A924(1);
break;
}
}
void sub_803ABAC(void)
{
switch(sub_80217EC())
{
case 2:
case 3:
sub_8021830();
sub_803A924(1);
break;
case 0:
case 1:
break;
}
}

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "input.h"
#include "text.h"
#include "text1.h"
u32 CreateDualSlotMenu(void)
{

View File

@ -1,13 +1,11 @@
#include "global.h"
#include "dungeon_map_access.h"
#include "dungeon_global_data.h"
#include "file_system.h"
#include "tile_types.h"
#include "random.h"
#include "dungeon_engine.h"
extern u16 gUnknown_202B038[4][32][32];
#include "text1.h"
extern void sub_80402AC(s32, s32);
extern void sub_80098F8(u32);

View File

@ -10,7 +10,7 @@
#include "other_random.h"
#include "friend_area.h"
#include "team_inventory.h"
#include "code_8097670.h"
extern u8 gUnknown_2000A88[0x400];
@ -52,7 +52,6 @@ extern void sub_80018D8(u32, u32, u32);
extern void sub_809733C(u32, u32);
extern void sub_80973A8(u32, u32);
extern u8 HasRecruitedMon(u32);
extern void sub_80976F8(u32);
extern void sub_800199C(u32, s32, u32, s32);
extern s32 sub_8001784(u32, s32, u16);

View File

@ -1,12 +1,12 @@
#include "global.h"
#include "pokemon.h"
#include "file_system.h"
#include "input.h"
#include "code_80130A8.h"
#include "felicity_bank.h"
#include "memory.h"
#include "team_inventory.h"
#include "text.h"
#include "menu_input.h"
#include "pokemon.h"
#include "team_inventory.h"
#include "text1.h"
#include "text2.h"
EWRAM_DATA_2 struct FelicityBankWork *gFelicityBankWork = {0};
@ -29,15 +29,6 @@ extern u8 gFelicityMoney[];
extern u8 gUnknown_80DB738;
extern void PlaySound(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8008C54(u32);
extern void sub_8013AA0(u32 *);
extern u32 sub_8013BBC(u32 *);
extern void sub_8013C68(u32 *);
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern s32 sub_80144A4(s32 *);
extern void sub_801645C();
extern void sub_80169BC();
extern void sub_8016B00();

View File

@ -1,8 +1,7 @@
#include "global.h"
#include "constants/friend_area.h"
#include "code_8092334.h"
extern bool8 *gFriendAreas;
#include "friend_area.h"
u32 SaveFriendAreas(u8 *r0, u32 size)
{

View File

@ -1,35 +1,31 @@
#include "global.h"
#include "memory.h"
#include "text.h"
#include "input.h"
#include "menu.h"
#include "text1.h"
#include "text2.h"
#include "item.h"
#include "pokemon.h"
#include "team_inventory.h"
#include "friend_area_action_menu.h"
#include "menu_input.h"
#include "kecleon_bros.h"
#include "sprite.h"
#include "code_80130A8.h"
#include "code_801EE10_1.h"
#include "code_801B3C0.h"
extern struct unkStruct_203B2BC *gUnknown_203B2BC;
extern void sub_80141B4(const char *r0, u32, u32 *r1, u32);
extern void sub_8014248(const char *r0, u32, u32, struct MenuItem *r4, u32, u32, u32, u32 *r5, u32);
extern void sub_8027D40(u32, struct BulkItem *);
extern void sub_8023868(u32, u32, u32, u32);
extern void sub_8023B7C(u32);
extern void sub_8023DA4();
extern void sub_8024458(s16, u32);
extern void sub_801BEEC(s16);
extern void GetLinkedSequence(u32, struct Move *, u16*);
extern void sub_801F808(u16*);
extern void sub_8027794();
extern void sub_801F1B0(u32, u32);
extern void sub_801B3C0(struct Item *);
extern void unk_CopyMoves4To8(struct Move *, struct Move *);
extern void sub_801EE10(u32, s16, struct Move *, u32, u32, u32);
extern void SetFriendAreaActionMenuState(u32);
extern void ResetSprites(u8 );
extern void sub_802719C();
extern void sub_8027274();
extern void sub_80277FC();
@ -123,7 +119,7 @@ ALIGNED(4) const u8 gUnknown_80DD8D0[] = _(
u32 sub_8027074(void)
{
ResetSprites(0);
ResetSprites(FALSE);
gUnknown_203B2BC = MemoryAlloc(sizeof(struct unkStruct_203B2BC), 8);
gUnknown_203B2BC->menuAction1 = 0;
gUnknown_203B2BC->menuAction2 = 0;

View File

@ -1,21 +1,20 @@
#include "global.h"
#include "constants/dungeon.h"
#include "memory.h"
#include "text.h"
#include "input.h"
#include "menu.h"
#include "text2.h"
#include "item.h"
#include "team_inventory.h"
#include "pokemon.h"
#include "friend_area_action_menu.h"
#include "menu_input.h"
#include "kecleon_bros.h"
#include "code_80130A8.h"
#include "code_801EE10_1.h"
#include "code_801B3C0.h"
extern struct unkStruct_203B2BC *gUnknown_203B2BC;
extern struct TeamInventory *gTeamInventoryRef;
extern u32 sub_801B410();
extern void sub_801B450();
extern u32 sub_801EF38(u8 r0);
extern void sub_801F214();
@ -24,7 +23,6 @@ extern void PlaySound(u32);
extern void nullsub_104();
extern void sub_8099690(u32);
extern s32 sub_80144A4(s32 *);
extern void sub_8027EB8();
extern void sub_808D31C(struct PokemonStruct *);
extern bool8 sub_80023E4(u32);
@ -32,10 +30,6 @@ extern struct PokemonStruct *sub_808D3F8(void);
extern struct PokemonStruct *sub_808D3BC(void);
extern u32 sub_801F890(void);
extern void sub_801F8D0(void);
extern void xxx_format_and_draw(u32, u32, const u8 *, ...);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern u8 gUnknown_202DE58[];
extern u32 sub_801F194(void);
@ -47,12 +41,9 @@ extern void sub_801BF98(void);
extern u32 sub_80244E4(void);
extern void sub_802453C(void);
extern u32 sub_8023A94(u32);
extern bool8 sub_808D750(s16 index_);
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern void sub_808ED00();
extern s16 sub_8023B44(void);
extern void sub_8023C60(void);
ALIGNED(4) const u8 gFriendActionStandby[] = "Stand By";
ALIGNED(4) const u8 gFriendActionMakeLeader[] = "Make Leader";
@ -130,7 +121,7 @@ void sub_80277FC(void)
{
struct PokemonStruct *pokeStruct;
switch(sub_8023A94(1)) {
switch(sub_8023A94(TRUE)) {
case 0:
case 1:
break;
@ -165,7 +156,7 @@ void sub_80278B4(void)
u32 menuAction;
menuAction = 0;
sub_8023A94(0);
sub_8023A94(FALSE);
if ((sub_8012FD8(&gUnknown_203B2BC->unk7C) == 0) && (sub_8013114(&gUnknown_203B2BC->unk7C,&menuAction), menuAction != 1)) {
gUnknown_203B2BC->menuAction1 = menuAction;
}

View File

@ -1,15 +1,18 @@
#include "global.h"
#include "constants/dungeon.h"
#include "memory.h"
#include "text.h"
#include "input.h"
#include "menu.h"
#include "text1.h"
#include "text2.h"
#include "item.h"
#include "pokemon.h"
#include "moves.h"
#include "menu_input.h"
#include "team_inventory.h"
#include "kecleon_bros.h"
#include "code_80130A8.h"
#include "code_801EE10_1.h"
#include "code_8012A18_1.h"
#include "code_801B3C0.h"
// there might be more overlap with unkStruct_203B2BC
// I was working on the moves and put the data that seemed to correspond to that
@ -112,46 +115,28 @@ ALIGNED(4) const u8 gFriendListCheckIQ[] = "Check IQ";
ALIGNED(4) const u8 gFriendListItem[] = _("Item: {COLOR_1 GREEN}{ARG_MOVE_ITEM_0}{END_COLOR_TEXT_1} ");
ALIGNED(4) static const u8 fill0[] = "pksdir0";
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void xxx_format_and_draw(s32, s32, const u8 *, ...);
extern u32 sub_8023A94(u32);
extern s16 sub_8023B44(void);
extern void sub_8023C60(void);
extern void sub_80141B4(const char *r0, u32, struct OpenedFile **r1, u32);
extern s16 sub_80A5728(void);
extern u8 sub_8002658(s16);
extern bool8 sub_8024108(u32);
extern u32 sub_801B3C0(struct Item *param_1);
extern void sub_8023868(u32, u32, u32, u32);
extern void sub_801F1B0(u32, u32);
extern void PlaySound(u32);
extern void sub_8024458(s16, u32);
extern void sub_801BEEC(s16);
extern void sub_8023B7C(u32);
extern void sub_8023DA4(void);
extern void nullsub_104(void);
extern void sub_808ED00(void);
extern u32 sub_80244E4(void);
extern void sub_802453C(void);
extern u32 sub_801BF48(void);
extern void sub_801BF98(void);
extern void sub_801B450(void);
extern u32 sub_801B410(void);
extern u32 sub_801EF38(u32);
extern u32 sub_801F194(void);
extern void sub_801F214(void);
extern void sub_801EE10(u32, s16, struct Move *, u32, u32, u32);
extern void sub_801F808(u16 *);
extern u32 sub_801602C(u32 r0, u8 *name);
extern void sub_8099690(u32);
extern void sub_801F8D0(void);
extern u32 sub_801F890(void);
extern void sub_80160D8(void);
extern u32 sub_8016080(void);
extern s32 sub_80144A4(s32 *);
extern bool8 sub_80023E4(u32);
void sub_8025434(s32);
@ -493,7 +478,7 @@ void sub_802591C(void)
void sub_80259F0(void)
{
switch(sub_8023A94(1))
switch(sub_8023A94(TRUE))
{
case 3:
gUnknown_203B2B4->species = sub_8023B44();
@ -518,7 +503,7 @@ void sub_8025A84(void)
{
s32 menuAction = 0;
sub_8023A94(0);
sub_8023A94(FALSE);
if(!sub_8012FD8(&gUnknown_203B2B4->unk78))
{
sub_8013114(&gUnknown_203B2B4->unk78, &menuAction);

View File

@ -2,23 +2,26 @@
#include "constants/communication_error_codes.h"
#include "constants/monster.h"
#include "constants/wonder_mail.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "text_util.h"
#include "input.h"
#include "item.h"
#include "team_inventory.h"
#include "pokemon.h"
#include "friend_rescue.h"
#include "memory.h"
#include "save.h"
#include "menu.h"
#include "rescue_password_menu.h"
#include "menu_input.h"
#include "code_8094F88.h"
#include "code_80130A8.h"
#include "main_menu.h"
#include "code_801EE10_1.h"
#include "code_801C620.h"
#include "code_801B3C0.h"
extern void SetFriendRescueMenuState(u32);
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern s32 sub_80144A4(s32 *);
extern void sub_802F2C0();
extern u32 sub_802F298();
@ -251,15 +254,6 @@ extern void sub_8034848(void);
extern u32 sub_80154F0();
extern void sub_80155F0();
extern u32 sub_801CA08(u32);
extern void sub_801CBB8(void);
extern void sub_801CB5C(u32);
extern void sub_8035CC0(struct UnkTextStruct2 *, u32);
extern void sub_801B3C0(struct Item *);
extern u32 sub_801B410(void);
extern void sub_801B450(void);
extern void sub_8035CF4(struct MenuStruct *, u32, u32);
extern u8 sub_801CB24(void);
extern u32 sub_8030DA0(void);
extern void sub_8030DE4(void);
extern void sub_803092C(void);
@ -275,45 +269,26 @@ extern u8 sub_8024108(u32);
extern void sub_802452C(void);
extern u32 sub_80244E4(void);
extern void sub_802453C(void);
extern void sub_8023B7C(u32);
extern u32 sub_8023A94(u32);
extern void sub_8023C60(void);
extern void sub_8024458(s16, u32);
extern void sub_8023DA4(void);
extern void sub_8035D1C(void);
extern u16 sub_8023B44(void);
extern u32 sub_8039068(u32, u8 *passwordBuffer, struct unkStruct_203B480 *r0);
extern bool8 sub_801CF14(s32);
extern void sub_803084C(void);
extern void sub_8031E10(void);
extern void sub_8023C60(void);
extern void sub_80155F0(void);
extern void sub_801CBB8(void);
extern void sub_802F2C0(void);
extern void sub_8030DE4(void);
extern void sub_802453C(void);
extern void sub_801B450(void);
extern void sub_800641C(struct UnkTextStruct2 *a0, u8 a1, u8 a2);
extern void sub_8006518(struct UnkTextStruct2 *);
extern u8 sub_800D588(void);
extern void sub_8011830(void);
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern void sub_80151C0(u32, u8 *);
extern void sub_801C8C4(u32, u32, s32 * , u32);
extern void sub_801CCD8(void);
extern u32 sub_801D008(void);
extern void sub_8023868(u32, u32, u32, u32);
extern void sub_8023C60(void);
extern u32 sub_8023CE8(void);
extern void sub_8023DA4(void);
extern void sub_802F204(struct unkStruct_802F204 *, u32);
extern u32 sub_80306A8(u32 wonderMailType, u32, struct UnkTextStruct2_sub *, u32);
extern u32 sub_8030894(void);
extern void sub_803092C(void);
extern bool8 sub_8031D70(u32 mailIndex, s32);
extern void sub_8035CF4(struct MenuStruct *, u32, u32);
extern s32 sub_8037B28(u32);
extern s32 sub_8037D64(u32, void *, void *);
extern s32 sub_80381F4(u32, void *, void *);
@ -327,7 +302,6 @@ extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern void MemoryFill8(u8 *dest, u8 value, s32 size);
extern void nullsub_23(u32);
extern void ResetUnusedInputStruct(void);
extern void SetMenuItems(struct MenuStruct *param_1, struct UnkTextStruct2 *unkData, s32 index, const struct UnkTextStruct2 *param_4, const struct MenuItem *menuItems, u8 param_6, u32 menuAction, u32 unused_8);
extern void sprintfStatic(char *buffer, const char *text, ...);
extern void xxx_call_start_bg_music(void);
@ -1096,8 +1070,8 @@ void sub_8032828(void)
ResetUnusedInputStruct();
sub_800641C(0,1,1);
{
struct {u16 a; u16 b;} local_x = {3, 2};
sub_801C8C4(0, 1, (s32 *)&local_x, 9);
struct UnkTextStruct2_sub local_x = {3, 2};
sub_801C8C4(0, 1, &local_x, 9);
}
}
break;
@ -1872,7 +1846,7 @@ void sub_8034130(void)
void sub_803418C(void)
{
switch(sub_8023A94(1))
switch(sub_8023A94(TRUE))
{
case 2:
sub_8023C60();
@ -1904,7 +1878,7 @@ void sub_8034254(void)
s32 menuAction;
menuAction = -1;
sub_8023A94(0);
sub_8023A94(FALSE);
if(!sub_8012FD8(&gUnknown_203B33C->unk21C[3]))
sub_8013114(&gUnknown_203B33C->unk21C[3], &menuAction);
switch(menuAction)
@ -2477,7 +2451,7 @@ void sub_8034B88(void)
gUnknown_203B33C->item.id = ITEM_NOTHING;
gUnknown_203B33C->item.quantity = 1;
gUnknown_203B33C->item.flags = 0;
switch(sub_801CA08(1))
switch(sub_801CA08(TRUE))
{
case 2:
sub_801CBB8();
@ -2508,7 +2482,7 @@ void sub_8034C38(void)
sub_801B450();
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B33C->unk3BC, 1, 1);
sub_801CB5C(1);
sub_801CB5C(TRUE);
if(gUnknown_203B33C->fallbackState == FRIEND_RESCUE_MENU_DEFAULT_FALLBACK)
{
sub_8035CF4(gUnknown_203B33C->unk21C, 3, 1);
@ -2528,7 +2502,7 @@ void sub_8034C98(void)
s32 menuAction;
menuAction = -1;
sub_801CA08(0);
sub_801CA08(FALSE);
if(!sub_8012FD8(&gUnknown_203B33C->unk21C[3]))
sub_8013114(&gUnknown_203B33C->unk21C[3], &menuAction);
switch(menuAction)
@ -2548,7 +2522,7 @@ void sub_8034C98(void)
case 5:
case 8:
sub_8035CC0(gUnknown_203B33C->unk35C, 3);
sub_801CB5C(0x1);
sub_801CB5C(TRUE);
SetFriendRescueMenuState(0x5F);
break;
}
@ -2788,7 +2762,7 @@ void sub_80350F4(void)
switch(menuAction)
{
case 0x15:
if(sub_801CF14(0) != 0)
if(sub_801CF14(0))
SetFriendRescueMenuState(0x56);
else
SetFriendRescueMenuState(0x57);

View File

@ -1,11 +1,10 @@
#include "global.h"
#include "file_system.h"
#include "code_80130A8.h"
#include "pokemon.h"
#include "memory.h"
#include "moves.h"
#include "text.h"
#include "input.h"
#include "menu.h"
#include "text1.h"
#include "text2.h"
#include "gulpin_shop.h"
#include "menu_input.h"
@ -22,8 +21,6 @@ extern const u8 gUnknown_80DC230[];
extern u8 gAvailablePokemonNames[0x50 * 2];
extern const u8 *gGulpinDialogue[2][25];
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern u32 sub_80144A4(s32 *);
void sub_801EC7C(void);
void sub_801ECBC(void);
void sub_801ED28(void);

View File

@ -1,16 +1,16 @@
#include "global.h"
#include "memory.h"
#include "menu.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "file_system.h"
#include "input.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "team_inventory.h"
#include "menu_input.h"
#include "gulpin_shop.h"
#include "moves.h"
#include "felicity_bank.h"
#include "code_80130A8.h"
#include "code_801EE10_1.h"
// size: 0x1E0
struct unkStruct_203B27C
@ -84,22 +84,16 @@ extern u8 gUnknown_80DC438[];
extern u8 gUnknown_80DC448[];
extern u8 gUnknown_202E128[];
extern s32 sub_80144A4(s32 *);
void PlayMenuSoundEffect(u32);
void PlaySound(u32);
bool8 sub_8021178(void);
void CreateGulpinShopMenu(void);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
void sub_8020950(void);
void sub_8020900(void);
bool8 sub_801F808(u16 *moveIDs);
void sub_801F700(void);
bool8 sub_801F428(s16 index, s32 param_2);
void sub_801F5F0(u8 r0);
extern void sub_8023DA4(void);
extern void sub_8023868(u32, u32, u32, u32);
extern void sub_8023B7C(u32);
extern void sub_801F1B0(u32, u32);
extern void sub_801F280(u32);
void sub_8024458(u32, u32);
@ -128,9 +122,6 @@ extern void sub_80209FC(void);
extern void sub_8020A34(void);
extern void sub_801FDC0(void);
extern void sub_801FF28(void);
u32 sub_8023A94(u32);
void sub_8023C60(void);
extern s16 sub_8023B44(void);
extern u32 sub_80244E4(void);
extern u32 sub_801BF48(void);
extern void sub_802453C(void);
@ -763,7 +754,7 @@ void sub_8020A34(void)
void sub_8020A80(void)
{
switch(sub_8023A94(1))
switch(sub_8023A94(TRUE))
{
case 3:
gUnknown_203B27C->speciesNum = sub_8023B44();
@ -794,7 +785,7 @@ void sub_8020B38(void)
s32 menuAction;
menuAction = 0;
sub_8023A94(0);
sub_8023A94(FALSE);
if (!sub_8012FD8(&gUnknown_203B27C->unkCC)) {
sub_8013114(&gUnknown_203B27C->unkCC,&menuAction);
if (menuAction != 1) {

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "input.h"
#include "menu_input.h"
@ -47,9 +48,6 @@ extern void PlayMenuSoundEffect(u32);
extern void sub_801E714(void);
extern void sub_801E76C(void);
extern void DisplayChosenHint(void);
extern void sub_80073E0(u32);
extern void sub_80073B8(u32);
extern void sub_8008C54(u32);
void DrawHintSelectionMenu(void);
void sub_801E594(void);

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "constants/colors.h"
#include "file_system.h"
#include "item.h"
#include "moves.h"
#include "team_inventory.h"
@ -11,7 +10,8 @@
#include "team_inventory.h"
#include "code_800D090.h"
#include "text_util.h"
#include "text2.h"
#include "code_80130A8.h"
#include <stddef.h>
extern struct FileArchive gSystemFileArchive;
@ -39,11 +39,7 @@ EWRAM_DATA struct TeamInventory gTeamInventory = {0};
EWRAM_DATA_2 struct TeamInventory *gTeamInventoryRef = {0};
extern s32 sub_8090FEC(s32 a1, u8* a2, u8 a3);
extern void sub_80073B8(u32);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern void sub_80078A4(u32, u32, u32, u32, u32);
extern void sub_80073E0(u32);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
extern s32 sub_8091E94(s32 a1, s32 a2, s32 a3);
extern void SortKecleonShopInventory();
bool8 AddKecleonWareItem(u8);

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "input.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "code_801C620.h"
#include "item.h"
#include "kangaskhan_storage.h"
#include "kecleon_bros.h"
@ -7,6 +9,8 @@
#include "menu_input.h"
#include "pokemon.h"
#include "team_inventory.h"
#include "text1.h"
#include "text2.h"
extern u8 gUnknown_202DE58[];
extern u8 gUnknown_202E1C8[];
@ -35,35 +39,6 @@ extern const u8 gUnknown_80DB830[]; // "Number?\0"
extern const u8 *gKangaskhanStorageDialogue[2][20];
// text.s
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8008C54(u32);
// code_80130A8.s
extern void sub_8013AA0(u32 *);
extern u32 sub_8013BBC(u32 *);
extern void sub_8013C68(u32 *);
extern void sub_80141B4(const u8 *r0, u32, struct OpenedFile **r1, u32);
extern void sub_8014248(const u8 *r0, u32, u32, const struct MenuItem *r4, u16 *, u32, u32, struct OpenedFile **r5, u32);
extern s32 sub_80144A4(s32 *);
// code_801B3C0.c
extern void sub_801B3C0(struct Item *);
extern u32 sub_801B410(void);
extern void sub_801B450(void);
extern void sub_801BB20(void);
extern void sub_801BC24(void);
// code_801C620.c
extern void sub_801C8C4(u32, u32, u32, u32);
extern u32 sub_801CA08(u32);
extern u8 sub_801CB24(void);
extern void sub_801CB5C(u32);
extern void sub_801CBB8(void);
extern void sub_801CCD8(void);
extern bool8 sub_801CF14(u32);
extern bool8 sub_801CF50(u32);
extern void sub_801CF94(void);
extern u32 sub_801CFB8(void);
extern u32 sub_801CFE0(u8);
// code_8098BDC.s
extern void sub_8099690(u32);
@ -360,7 +335,7 @@ void sub_8016FF8(void)
sub_801AD34(0);
break;
case 23:
sub_801CB5C(1);
sub_801CB5C(TRUE);
sub_801AD34(0);
break;
case 24:
@ -728,7 +703,7 @@ void sub_8017AF8(void)
void sub_8017B88(void)
{
switch (sub_801CA08(1)) {
switch (sub_801CA08(TRUE)) {
case 3:
if (sub_801CFB8() != 0)
UpdateKangaskhanStorageState(28);
@ -757,7 +732,7 @@ void sub_8017B88(void)
void sub_8017C28(void)
{
sub_801CA08(0);
sub_801CA08(FALSE);
sub_8012FD8(&gKangaskhanStorageWork->unk58);
switch (sub_8013BBC(&gKangaskhanStorageWork->unkA8)) {
@ -814,7 +789,7 @@ void sub_8017D24(void)
s32 menuAction;
menuAction = 0;
sub_801CA08(0);
sub_801CA08(FALSE);
if (sub_8012FD8(&gKangaskhanStorageWork->unk58) == 0) {
sub_8013114(&gKangaskhanStorageWork->unk58, &menuAction);
if (menuAction != 1)
@ -1014,7 +989,7 @@ void sub_8018100(void)
sub_801AD34(0);
break;
case 11:
sub_801CB5C(1);
sub_801CB5C(TRUE);
sub_801AD34(0);
break;
case 12:
@ -1253,7 +1228,7 @@ void sub_80186F8(void)
struct BulkItem item;
s32 itemID;
switch (sub_801CA08(1)) {
switch (sub_801CA08(TRUE)) {
case 3:
if (sub_801CFB8() != 0) {
for (itemID = 0; itemID < NUMBER_OF_ITEM_IDS; itemID++) {
@ -1311,7 +1286,7 @@ void sub_8018854(void)
{
struct BulkItem item;
sub_801CA08(0);
sub_801CA08(FALSE);
sub_8012FD8(&gUnknown_203B20C->unk70);
switch (sub_8013BBC(&gUnknown_203B20C->unkC0)) {
@ -1398,7 +1373,7 @@ void sub_80189C8(void)
menuAction = 0;
sub_801CA08(0);
sub_801CA08(FALSE);
if (sub_8012FD8(&gUnknown_203B20C->unk70) == 0) {
sub_8013114(&gUnknown_203B20C->unk70, &menuAction);
if (menuAction != 1)

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "code_800D090.h"
#include "code_80130A8.h"
#include "code_801B3C0.h"
#include "constants/input.h"
#include "felicity_bank.h"
#include "kecleon_bros.h"
@ -7,6 +9,8 @@
#include "menu_input.h"
#include "pokemon.h"
#include "team_inventory.h"
#include "text1.h"
#include "text2.h"
extern struct KecleonBrosWork *gKecleonBrosWork;
extern struct unkStruct_203B214 *gUnknown_203B214;
@ -51,27 +55,12 @@ extern const u8 *gKecleonShopDialogue[KECLEON_BROS_MODE_COUNT][23];
extern const u8 gTeamToolboxA[];
extern const u8 gTeamToolboxB[];
// text.s
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8007B7C(s32, s32, s32, s32, s32);
extern void sub_8008C54(u32);
// code_80130A8.s
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern s32 sub_80144A4(s32 *);
// code_801B3C0.c
extern u32 sub_801B3C0(struct Item *);
extern u32 sub_801B410(void);
extern void sub_801B450(void);
// code_8098BDC.s
extern void sub_8099690(u32);
// code_80118A4.c
extern void PlayMenuSoundEffect(u32);
extern void PlaySound(u16 songIndex);
// code_80130A8.s
extern void xxx_format_and_draw(u32, u32, u8 *, u32, u32);
void sub_8018D30(void);
void sub_80194F8(void);

View File

@ -6,7 +6,8 @@
#include "file_system.h"
#include "memory.h"
#include "menu.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "text_util.h"
#include "pokemon.h"
#include "save.h"
@ -41,9 +42,6 @@ u8 IsQuickSave(void);
void DrawLoadScreenText(void);
void sub_80397B4(void);
extern void sub_8035CF4(struct MenuStruct *, u32, u32);
extern void SetMenuItems(struct MenuStruct *, struct UnkTextStruct2 *, u32, const struct UnkTextStruct2 *, const struct MenuItem *, u32, u32, u32);
extern void sub_80920D8(u8 *);
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern bool8 sub_80023E4(u32);
@ -52,14 +50,10 @@ extern u8 *GetDungeonLocationInfo(void);
extern u32 GetNumAdventures(void);
extern void PrintDungeonLocationtoBuffer(u8 *, u8 *);
extern u32 sub_8001658(u32, u32);
extern void sub_80073E0(u32);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void xxx_format_string(u8 *, u8 *, u8 *, u32);
extern void SetBGPaletteBufferColorArray(s32, s32);
extern void sub_8007E20(s32, s32, s32, u32, u32, s32, u32);
const struct UnkTextStruct2 gUnknown_80E75F8 = {
0x00, 0x00, 0x00, 0x00,
@ -398,8 +392,7 @@ void sub_80397B4(void)
for(index = 0; index < 12; index++)
{
if (sub_80023E4(gUnknown_203B3B8[index])) {
sub_8007E20(0,x,y,0x10,0x10,*(int *)(clmkFile->data) + index * 0x80,
gUnknown_203B388[index]);
sub_8007E20(0,x,y,0x10,0x10,(u8 *)(*((s32*)clmkFile->data) + index * 0x80), gUnknown_203B388[index]);
x += 16;
}
}

View File

@ -1,17 +1,19 @@
#include "global.h"
#include "constants/bg_music.h"
#include "constants/colors.h"
#include "input.h"
#include "item.h"
#include "memory.h"
#include "menu.h"
#include "pokemon.h"
#include "random.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "text_util.h"
#include "team_inventory.h"
#include "menu_input.h"
#include "kecleon_bros.h"
#include "code_80130A8.h"
#include "code_8012A18_1.h"
#include "code_801B3C0.h"
struct unkStruct_203B2B0
{
@ -184,8 +186,6 @@ extern void LuminousCave_AdvancetoFallbackState(void);
extern void sub_8024804(void);
extern void UpdateLuminousCaveDialogue(void);
extern void sub_80141B4(const char *r0, u32, struct OpenedFile **r1, u32);
extern void sub_8014248(const char *r0, u32, u32, struct MenuItem *r4, u16 *, u32, u32, struct OpenedFile **r5, u32);
void xxx_call_fade_out_bgm(u16 speed);
void xxx_call_stop_fanfare_se(u16 songIndex);
void xxx_call_fade_in_new_bgm(u16 songIndex, u16 speed);
@ -194,20 +194,13 @@ void PlaySound(u32);
void sub_8024CFC(void);
void sub_8025254(void);
void sub_8024D48(void);
extern void sub_801B3C0(struct Item *);
extern void nullsub_104();
void sub_8024DBC(void);
void sub_8024E30(void);
void sub_801AEE4(u32, u32);
void sub_808F734(struct PokemonStruct *, s16);
u32 sub_801602C(u32 r0, u8 *name);
extern s32 sub_80144A4(s32 *);
extern void sub_8099690(u32);
extern void PlayMenuSoundEffect(u32);
extern u32 sub_801B410(void);
extern void sub_801B450(void);
extern u32 sub_8016080(void);
extern void sub_80160D8(void);
extern void sub_808F468(struct PokemonStruct *, u8 *, u32);
bool8 LuminousCave_HasOnly1Member(void);

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "memory.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "menu.h"
#include "input.h"
#include "mailbox.h"
@ -86,9 +87,6 @@ extern void InitializeJobListMenu(u32);
extern void sub_802B640(u32, u32, u32);
extern void sub_802B7D0(u32);
extern void sub_802B9FC(u8);
extern void sub_8008C54(u32);
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern u32 sub_802BA8C(void);
extern void sub_802BACC(void);
extern u8 GetPokemonNewsIndex(void);

View File

@ -1,66 +1,61 @@
#include "global.h"
#include "bg_palette_buffer.h"
#include "cpu.h"
#include "crt0.h"
#include "random.h"
#include "file_system.h"
#include "flash.h"
#include "text.h"
extern char ewram_start[];
typedef void (*IntrCallback)(void);
#include "input.h"
#include "main.h"
#include "random.h"
#include "reg_control.h"
#include "sprite.h"
#include "text1.h"
#include "text2.h"
EWRAM_DATA u8 IntrMain_Buffer[0x120] = {0};
EWRAM_DATA IntrCallback gIntrTable[6] = {0};
EWRAM_DATA IntrCallback gIntrCallbacks[6] = {0};
extern char ewram_start[];
extern u16 gBldCnt;
extern u8 gUnknown_202D7FE;
EWRAM_DATA_2 u8 gInterruptsEnabled = {0};
extern u16 gUnknown_203B0AC;
extern s16 gUnknown_203B0AE;
extern char alt_203B038[];
extern char gTitlePaletteFile[];
extern char gUnknown_203BC04[];
extern char iwram_start[];
extern char alt_3001B58[];
extern char unk_code[];
extern char unk_code_ram[];
extern char unk_code_ram_end[];
extern u8 gUnknown_80B9BF1[];
extern IntrCallback gInitialIntrTable[6];
EWRAM_DATA_2 u8 gInterruptsEnabled = {0};
extern char gUnknown_8270000[];
// data_8270000.s
extern const char gUnknown_8270000[];
// data_80B9BB8.s
extern const u8 gUnknown_80B9BF1[];
extern const IntrCallback gInitialIntrTable[6];
extern char unk_code[];
extern void sub_800CDA8(int);
extern void sub_800B540(void);
extern void InitSprites(void);
// code_800558C_1.c
extern void nullsub_9(void);
extern void nullsub_6(void);
extern void InitInput(void);
extern void InitBGPaletteBuffer(void);
extern void sub_80057E8(void);
extern void InitFileSystem(void);
// code_8009804.c
extern void sub_80098A0(void);
extern void InitGraphics(void);
// code_2.c
extern void GameLoop(void);
// code_800D090.c
extern void Hang(void);
extern void VBlank_CB(void);
extern void nullsub_17(void);
extern void InitMusic(void); // music initializer
extern void sub_800D6AC(void);
extern void sub_800D7D0(void);
// music.c
extern void InitMusic(void); // music initializer
// code_8004AA0.s
extern void nullsub_6(void);
bool8 EnableInterrupts(void);
void InitIntrTable(const IntrCallback *interrupt_table);
IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback);
void sub_800B540(void);
void AgbMain(void)
{
@ -77,8 +72,7 @@ void AgbMain(void)
if (gUnknown_203BC04 - gTitlePaletteFile > 0)
CpuCopy32(gUnknown_8270000, gTitlePaletteFile, gUnknown_203BC04 - gTitlePaletteFile);
if (alt_203B038 - ewram_start > 0)
{
if (alt_203B038 - ewram_start > 0) {
memset(value, 0, 4);
CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_203B038 - ewram_start) / 4) & 0x1FFFFF));
}
@ -86,8 +80,7 @@ void AgbMain(void)
if (unk_code_ram_end - unk_code_ram > 0)
CpuCopy32(unk_code, unk_code_ram, unk_code_ram_end - unk_code_ram);
if (alt_3001B58 - iwram_start > 0)
{
if (alt_3001B58 - iwram_start > 0) {
memset(value, 0, 4);
CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_3001B58 - iwram_start) / 4) & 0x1FFFFF));
}
@ -121,7 +114,7 @@ void AgbMain(void)
LoadCharmaps();
sub_80098A0();
InitGraphics();
SetInterruptCallback(1, (IntrCallback)VBlank_CB);
SetInterruptCallback(1, VBlank_CB);
REG_DISPCNT = DISPCNT_WIN1_ON | DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP; // 32576
GameLoop();
Hang();
@ -130,14 +123,14 @@ void AgbMain(void)
void sub_800B540(void)
{
s32 i;
for (i = 0; i < 6; i++) {
for (i = 0; i < 6; i++)
gIntrCallbacks[i] = NULL;
}
nullsub_17();
InitMusic(); // initialize music and stop DMAs
while(REG_VCOUNT < 160){}
while (REG_VCOUNT < 160){}
REG_IE ^= INTR_FLAG_TIMER3 | INTR_FLAG_VBLANK | INTR_FLAG_VCOUNT; // 0x45
@ -161,64 +154,43 @@ void sub_800B540(void)
bool8 EnableInterrupts(void)
{
if(!gInterruptsEnabled)
{
if (!gInterruptsEnabled)
return FALSE;
}
if(REG_IME & 1)
{
if (REG_IME & 1)
return FALSE;
}
else
{
REG_IME = 1;
return TRUE;
}
REG_IME = 1;
return TRUE;
}
bool8 DisableInterrupts(void)
{
if(!gInterruptsEnabled)
{
if (!gInterruptsEnabled)
return FALSE;
}
if(!(REG_IME & 1))
{
if (!(REG_IME & 1))
return FALSE;
}
else
{
REG_IME = 0;
return TRUE;
}
REG_IME = 0;
return TRUE;
}
bool8 sub_800B650(void)
{
if(!gInterruptsEnabled)
{
if (!gInterruptsEnabled)
return FALSE;
}
if(REG_IME & 1)
{
if (REG_IME & 1)
return FALSE;
}
else
{
return TRUE;
}
return TRUE;
}
void AckInterrupt(u16 flag)
{
if(!gInterruptsEnabled)
{
if (!gInterruptsEnabled)
return;
}
REG_IME = 0;
INTR_CHECK |= flag;
@ -227,8 +199,8 @@ void AckInterrupt(u16 flag)
void InitIntrTable(const IntrCallback *interrupt_table)
{
CpuCopy32(interrupt_table, gIntrTable, sizeof(gIntrTable)); // 0x18 = 0x6 * 4 (0x4f00 is 32 bits)
CpuCopy32(IntrMain, IntrMain_Buffer, sizeof(IntrMain_Buffer)); // 0x120 = 0x48 * 4 (0x4f00 is 32 bits)
CpuCopy32(interrupt_table, gIntrTable, sizeof(gIntrTable)); // 0x18 = 0x6 * 4 (0x4F00 is 32 bits)
CpuCopy32(IntrMain, IntrMain_Buffer, sizeof(IntrMain_Buffer)); // 0x120 = 0x48 * 4 (0x4F00 is 32 bits)
INTR_VECTOR = IntrMain_Buffer;
}
@ -245,9 +217,9 @@ IntrCallback SetInterruptCallback(u32 index, IntrCallback new_callback)
interrupt_var = DisableInterrupts();
old_callback = gIntrCallbacks[index];
gIntrCallbacks[index] = new_callback;
if(interrupt_var){
EnableInterrupts();
}
return old_callback;
}
if (interrupt_var)
EnableInterrupts();
return old_callback;
}

View File

@ -1,11 +1,9 @@
#include "global.h"
#include "text.h"
#include "menu.h"
#include "input.h"
#include "text1.h"
#include "text2.h"
#include "menu_input.h"
#include "adventure_log.h"
#include "debug_menu.h"
#include "debug_menu1.h"
#include "ds_menus.h"
#include "pokemon.h"
#include "friend_rescue.h"
@ -17,12 +15,12 @@
#include "trade_items_menu.h"
#include "constants/wonder_mail.h"
// NOTE: 0x13 and 0x14
// NOTE: 0x13 and 0x14
// Communication Screen?
// Got Communication warning when I wrote them to the struct
// NOTE: 0x29, 0x2A, 0x2B, 0x2C
// Triggers a save
// Triggers a save
// NOTE: 0x2D
// Triggers a save and then goes to 0x13 (comms warning)
@ -622,8 +620,8 @@ void sub_8035C1C(void)
gMainMenu->sub.unk2D = 0;
}
void
SetMenuItems(struct MenuStruct *param_1, struct UnkTextStruct2 *unkData, s32 index, const struct UnkTextStruct2 *param_4, const struct MenuItem *menuItems, u8 param_6 ,u32 menuAction, u32 unused_8)
void SetMenuItems(struct MenuStruct *param_1, struct UnkTextStruct2 *unkData, s32 index,
const struct UnkTextStruct2 *param_4, const struct MenuItem *menuItems, u8 param_6, u32 menuAction, u32 unused_8)
{
unkData[index] = *param_4;
ResetUnusedInputStruct();
@ -777,10 +775,10 @@ void DrawMainMenu(void)
if(SetMainMenuText())
{
sub_8035CF4(gUnknown_203B34C->unk4,2,0);
sub_8035CF4(gUnknown_203B34C->unk4,2,FALSE);
}
sub_8035CF4(gUnknown_203B34C->unk4,0,1);
sub_8035CF4(gUnknown_203B34C->unk4,0,TRUE);
gUnknown_203B34C->unk0 = 1;
}
@ -807,8 +805,8 @@ u32 UpdateMainMenu(void)
if(SetMainMenuText())
{
sub_8035CF4(gUnknown_203B34C->unk4, 0, 1);
sub_8035CF4(gUnknown_203B34C->unk4, 2, 0);
sub_8035CF4(gUnknown_203B34C->unk4, 0, TRUE);
sub_8035CF4(gUnknown_203B34C->unk4, 2, FALSE);
}
switch(nextMenu)
{
@ -819,8 +817,8 @@ u32 UpdateMainMenu(void)
gUnknown_203B34C->unk0 = 1;
nextMenu = MENU_NO_SCREEN_CHANGE;
ResetUnusedInputStruct();
sub_8035CF4(gUnknown_203B34C->unk4, 0, 1);
sub_8035CF4(gUnknown_203B34C->unk4, 2, 0);
sub_8035CF4(gUnknown_203B34C->unk4, 0, TRUE);
sub_8035CF4(gUnknown_203B34C->unk4, 2, FALSE);
break;
case MENU_TRADE_ITEMS:
sub_8035DA0();
@ -949,9 +947,9 @@ void sub_803623C(void)
SetMainMenuItems();
gUnknown_203B34C->currMenuChoice = -1;
if (SetMainMenuText()) {
sub_8035CF4(gUnknown_203B34C->unk4,2,0);
sub_8035CF4(gUnknown_203B34C->unk4,2,FALSE);
}
sub_8035CF4(gUnknown_203B34C->unk4,0,1);
sub_8035CF4(gUnknown_203B34C->unk4,0,TRUE);
}
void SetMainMenuItems(void)

View File

@ -1,12 +1,15 @@
#include "global.h"
#include "code_800D090.h"
#include "code_80130A8.h"
#include "constants/colors.h"
#include "constants/input.h"
#include "code_800D090.h"
#include "dungeon.h"
#include "makuhita_dojo.h"
#include "memory.h"
#include "menu_input.h"
#include "pokemon.h"
#include "text1.h"
#include "text2.h"
extern u8 gUnknown_202E5D8[];
extern u8 gUnknown_202E1C8[];
@ -64,13 +67,7 @@ ALIGNED(4) const u8 gUnknown_80E0824[] = _("{STAR_BULLET}");
ALIGNED(4) const u8 gMakuhitaCoursePlaceholder[] = _("{COLOR_2}%c%s{END_COLOR_TEXT_2}");
static const u8 makuhita_dojo_fill3[] = "pksdir0";
extern void sub_80073B8(u32);
extern void sub_80073E0(u32);
extern void sub_8008C54(u32);
extern u32 sub_80095E4(s16, u32);
extern void sub_80141B4(const u8 *, u32, struct OpenedFile **, u32);
extern void sub_8014248(const u8 *, u32, u32, const struct MenuItem *, void *, u32, u32, struct OpenedFile **, u32);
extern s32 sub_80144A4(s32 *);
extern u32 sub_801B60C(u32, u8, u8);
extern u32 sub_801B6AC(void);
extern void sub_801B72C(void);

View File

@ -1,33 +1,22 @@
#include "global.h"
#include "constants/colors.h"
#include "constants/input.h"
#include "menu.h"
#include "text.h"
#include "text1.h"
#include "text2.h"
#include "util.h"
#include "code_800D090.h"
#include "menu_input.h"
#include "code_80130A8.h"
struct unkChar
{
u32 unk0;
s16 unk4;
s16 unk6;
};
extern struct UnkTextStruct1 gUnknown_2027370[4];
extern u8 gUnknown_80D4828[];
extern void PlayMenuSoundEffect(u32);
extern void sub_80073B8(u32);
extern s32 sub_8008ED0(const u8 *);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
extern void sub_80073E0(u32);
void AddMenuCursorSprite_(struct MenuInputStruct *, u32);
void sub_8012EBC(struct MenuStruct *param_1);
extern void sub_8013134(struct MenuInputStruct *, u32, u32);
extern s16 sub_8009614(u32, u32);
extern u32 ReturnIntFromChar2(u8);
struct unkChar *GetCharacter(u32);
extern void xxx_call_draw_char(u32, u32, u32, u32, u32);
extern void nullsub_7(u16 *);
extern void nullsub_34(struct MenuInputStructSub *r0);

View File

@ -1,10 +1,9 @@
#include "global.h"
#include "constants/input.h"
#include "input.h"
#include "text.h"
#include "text1.h"
#include "menu_input.h"
extern struct UnkTextStruct1 gUnknown_2027370[4];
extern void PlayMenuSoundEffect(u32);
void sub_801332C(u16 *);

View File

@ -6,11 +6,11 @@
#include "subStruct_203B240.h"
#include "code_809447C.h"
#include "text_util.h"
#include "text2.h"
#include "constants/colors.h"
#include "constants/monster.h"
#include "file_system.h"
#include "code_800D090.h"
#include "code_80130A8.h"
struct MoveLearnset {
u8 *levelUpMoves;
@ -57,14 +57,10 @@ bool8 DoesMoveCharge(u16 move);
int unk_PrintMoveDescription(int, struct Move*, int, struct subStruct_203B240**);
extern void sub_80073B8(u32);
void sub_80928C0(u8 *buffer, struct Move *move, struct unkStruct_80928C0 *param_3);
extern void xxx_format_and_draw(u32, u32, const u8 *, u32, u32);
extern void unk_MovePrintData(struct Move*, int); // print something
extern void sub_80073E0(u32);
extern u32 sub_8097DF0(char *, struct subStruct_203B240 **);
extern void sub_80078A4(u32, u32, u32, u32, u32);
extern u8 sub_8092B00(struct Move*);
extern u32 sub_8092BC0(struct Move*);
extern u32 gUnknown_202DE30;

View File

@ -1,7 +1,8 @@
#include "global.h"
#include "m4a.h"
#include "music.h"
#include "constants/bg_music.h"
#include "m4a.h"
#include "main.h"
#include "music.h"
EWRAM_DATA u16 gBGMusicPlayerState = {0};
EWRAM_DATA u16 gCurrentBGSong = {0};
@ -14,8 +15,6 @@ EWRAM_DATA bool8 gRestartBGM = {0};
IWRAM_DATA struct PMDMusicPlayer gBGMusicPlayers[NUM_BG_PLAYERS] = {0};
IWRAM_DATA struct PMDMusicPlayer gSEMusicPlayers[NUM_SE_PLAYERS] = {0};
extern bool8 EnableInterrupts(void);
extern bool8 DisableInterrupts(void);
void nullsub_21(u16);
void InitMusic(void)

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