merge master

This commit is contained in:
DizzyEggg 2025-05-29 11:47:01 +02:00
commit 48d65fa29f
29 changed files with 1252 additions and 3227 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,69 +5,6 @@
.text
thumb_func_start GroundEffect_CancelBlank
GroundEffect_CancelBlank:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x8
ldr r1, _080ACD7C
movs r0, 0
bl Log
movs r6, 0
ldr r0, _080ACD80
ldr r4, [r0]
movs r0, 0x1
negs r0, r0
mov r8, r0
movs r1, 0x92
lsls r1, 1
adds r5, r4, r1
mov r7, sp
_080ACD2C:
movs r1, 0x6
ldrsh r0, [r4, r1]
cmp r0, r8
beq _080ACD5C
ldr r0, [r5]
ldr r1, [r4, 0x14]
adds r0, r1
str r0, [sp]
ldr r0, [r5, 0x4]
ldr r1, [r4, 0x18]
adds r0, r1
str r0, [r7, 0x4]
movs r1, 0xA2
lsls r1, 1
adds r0, r4, r1
mov r1, sp
bl IsOnscreen_80A675C
lsls r0, 24
cmp r0, 0
bne _080ACD5C
adds r0, r6, 0
bl GroundEffect_Delete
_080ACD5C:
adds r0, r6, 0x1
lsls r0, 16
asrs r6, r0, 16
movs r0, 0xE2
lsls r0, 1
adds r5, r0
adds r4, r0
cmp r6, 0xF
ble _080ACD2C
add sp, 0x8
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080ACD7C: .4byte gUnknown_8118658
_080ACD80: .4byte gGroundEffects
thumb_func_end GroundEffect_CancelBlank
thumb_func_start sub_80ACD84
sub_80ACD84:
push {r4-r7,lr}

View File

@ -234,4 +234,7 @@ const ScriptCommand *FindLabel(Action *action, s32 r1);
const ScriptCommand *ResolveJump(Action *action, s32 r1);
void InitActionWithParams(Action *action, const CallbackData *callbacks, void *parent, s32 group, s32 sector);
// For gScriptLocks, gScriptLockConds, gUnlockBranchLabels
#define SCRIPT_LOCKS_ARR_COUNT 129
#endif // GUARD_GROUND_SCRIPT_H

View File

@ -40,6 +40,7 @@ void InitializeRecruitedPokemon(void);
u8 GetBodySize(s32 index);
void CopyMonsterNameToBuffer(u8 * buffer, s32 index);
void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index);
void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index_);
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum);
void sub_808D930(u8 *buffer, s32 index);
void sub_808D9DC(u8 *buffer, PokemonStruct2 *, s32 colorNum);

View File

@ -1,10 +0,0 @@
#ifndef GUARD_POKEMON_MID_H
#define GUARD_POKEMON_MID_H
#include "pokemon.h"
// NOTE: this is kept separate since TransferOrbAction needs index to be s32
// and I haven't had the time to fix matching
void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index);
#endif // GUARD_POKEMON_MID_H

View File

@ -48,7 +48,7 @@ SECTIONS {
{
asm/crt0.o(.text);
src/code_80001DC.o(.text);
asm/arm_func.o(.text);
src/arm_funcs.o(.text);
src/main_loops.o(.text);
src/event_flag.o(.text);
src/code_8002774.o(.text);
@ -80,7 +80,6 @@ SECTIONS {
src/cpu.o(.text);
src/flash.o(.text);
src/code_800D090.o(.text);
asm/code_800D090.o(.text);
src/code_800D090_1.o(.text);
src/code_800DAC0.o(.text);
asm/code_800DAC0.o(.text);
@ -330,7 +329,6 @@ SECTIONS {
src/ground_main.o(.text);
src/code_8099328.o(.text);
src/code_8099360.o(.text);
asm/code_8099360.o(.text);
src/code_809A560.o(.text);
src/code_809C5C4.o(.text);
src/code_809D148.o(.text);

View File

@ -48,7 +48,6 @@ SECTIONS {
{
asm/crt0.o(.text);
src/code_80001DC.o(.text);
asm/arm_func.o(.text);
src/main_loops.o(.text);
src/*.o(.text*);
asm/*.o(.text*);

View File

@ -1,11 +1,11 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
arm_func_start sub_80001E8
arm_func_start sub_80001E8
sub_80001E8:
stmdb sp!, {r4-r11}
mov r12, 0x4000000 @ REG_BASE

View File

@ -1,8 +1,7 @@
#include "global.h"
#include "music.h"
extern u32 gUnknown_202DB60[2];
extern u16 gUnknown_202DB30[2][8];
#include "memory.h"
#include "cpu.h"
void Hang(void)
{
@ -113,16 +112,75 @@ void nullsub_187(void)
{
}
u32 sub_800D1C0(void)
// New file?
union PtrU16U8
{
u16 *asU16;
u8 *asU8;
};
// Important note: This struct is used in arm_funcs.s, which means the offsets of this struct's memebers CANNOT be changed, unless sub_80001E8 and sub_8000228 are accordingly changed.
struct UnkStruct_202DCF8
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
s32 unk4;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
u8 fillC[0x14-0xC];
s32 unk14;
s32 unk18[4];
union PtrU16U8 unk28;
u16 *unk2C;
u16 *unk30[4];
u16 *unk40[4];
u16 *unk50[4];
u16 unk60[12];
u16 unk78[12];
u16 unk90[2][3][12];
};
EWRAM_DATA static u16 gUnknown_202D808[132] = {0};
EWRAM_DATA static u16 gUnknown_202D910[2][132] = {0};
EWRAM_DATA static u16 gUnknown_202DB20[8] = {0};
EWRAM_DATA static u16 gUnknown_202DB30[2][8] = {0};
EWRAM_DATA static u32 gUnknown_202DB50[2] = {0}; // Only first index used
EWRAM_DATA static u32 gUnknown_202DB58[2] = {0};
EWRAM_DATA static u32 gUnknown_202DB60[2] = {0};
EWRAM_DATA static u32 gUnknown_202DB68 = 0;
EWRAM_DATA static s32 gUnknown_202DB6C = 0;
EWRAM_DATA static u8 gUnknown_202DB70 = 0;
EWRAM_DATA static u32 gUnknown_202DB74 = 0;
// These should not be in EWRAM, but in IWRAM...
EWRAM_DATA u32 gUnknown_202DB78[16] = {0};
EWRAM_DATA u32 gUnknown_202DBB8[80] = {0};
EWRAM_DATA struct UnkStruct_202DCF8 gUnknown_202DCF8 = {0};
extern u32 sub_80001E8(void);
extern void sub_8000228(void);
void sub_800D6AC(void);
void sub_800D7D0(void);
static u32 sub_800D820(u16 *a0, u16 a1[2][8]);
static void sub_800D7B8(void);
static void sub_800D944(u16 *a0);
static u32 sub_800D9B8(u16 dst[2][8]);
bool8 sub_800D1C0(u32 unused)
{
if(gUnknown_202DB60[0] != 2)
return 0;
return FALSE;
if(gUnknown_202DB60[1] != 2)
return 0;
return 1;
return FALSE;
return TRUE;
}
void sub_800D1E0(void)
static void sub_800D1E0(void)
{
s32 iVar1;
u32 iVar2;
@ -137,3 +195,362 @@ void sub_800D1E0(void)
}
}
}
static void sub_800D224(s32 a0)
{
s32 i;
for (i = 0; i < 2; i++) {
if (((a0 >> i) & 1) && gUnknown_202DB60[i] == 1) {
u32 j;
u16 *ptr = gUnknown_202D910[i];
for (j = 0; j < 8; j++) {
if (gUnknown_202DB58[i] + j >= gUnknown_202DB74 / 2) {
gUnknown_202DB60[i] = 2;
break;
}
ptr[gUnknown_202DB58[i] + j] = gUnknown_202DB30[i][j];
}
gUnknown_202DB58[i] += 8;
}
}
}
static void sub_800D2EC(u32 unused)
{
u32 i;
u16 *ptr = gUnknown_202D808;
for (i = 0; i < 8; i++) {
if (gUnknown_202DB50[0] < (gUnknown_202DB74 / 2)) {
gUnknown_202DB20[i] = ptr[gUnknown_202DB50[0]++];
}
else {
gUnknown_202DB20[i] = 0xFCFC;
}
}
}
s32 sub_800D33C(void)
{
s32 ret = 0;
gUnknown_202DB6C = gUnknown_202DB68;
gUnknown_202DB68 = sub_800D820(gUnknown_202DB20, gUnknown_202DB30);
if (gUnknown_202DB70 == 0) {
if (gUnknown_202DB68 & 0x100) {
gUnknown_202DB70 = 1;
}
return 0;
}
else if (gUnknown_202DB68 & 0x1000) {
return 3;
}
else if (gUnknown_202DB68 & 0x2000) {
return 4;
}
else if (gUnknown_202DB68 & 0x8000) {
u32 bits1, bits2;
bits1 = gUnknown_202DB68 << 28;
bits1 >>= 28;
bits2 = gUnknown_202DB68 << 20;
bits2 >>= 28;
if (bits1 != bits2)
return 5;
}
if (((gUnknown_202DB68 | gUnknown_202DB6C) & 0xE)) {
u32 si0Cnt = (*(vu32 *)REG_ADDR_SIOCNT);
si0Cnt <<= 26;
si0Cnt >>= 30;
if ((gUnknown_202DB68 & (1 << si0Cnt))) {
sub_800D1E0();
sub_800D224(gUnknown_202DB68);
if (sub_800D1C0(gUnknown_202DB68)) {
return 2;
}
sub_800D2EC(gUnknown_202DB68);
ret = 1;
}
}
return ret;
}
static inline void ClearUnkMemory(void)
{
gUnknown_202DB68 = 0;
gUnknown_202DB6C = 0;
gUnknown_202DB70 = 0;
gUnknown_202DB74 = 0;
gUnknown_202DB60[0] = 0;
gUnknown_202DB60[1] = 0;
MemoryClear16(gUnknown_202DB20, sizeof(gUnknown_202DB20));
MemoryClear16(gUnknown_202DB30[0], sizeof(gUnknown_202DB30));
gUnknown_202DB50[0] = 0;
gUnknown_202DB58[0] = 0;
gUnknown_202DB58[1] = 0;
MemoryClear16(gUnknown_202D808, sizeof(gUnknown_202D808));
MemoryClear16(gUnknown_202D910[0], sizeof(gUnknown_202D910));
}
// These two are the same, except sub_800D414 calls an additional func
void sub_800D414(void)
{
ClearUnkMemory();
sub_800D6AC();
}
void sub_800D494(void)
{
ClearUnkMemory();
}
void sub_800D510(void)
{
REG_RCNT = 0x8000;
}
void sub_800D520(void)
{
vu16 var = 1; // Has to be u16, not s16
u8 si0Cnt = (*(vu8 *)REG_ADDR_SIOCNT); // First 8 bits
if (!(si0Cnt & 0x30)) {
while (--var != (u16) -1) {
VBlankIntrWait();
}
}
sub_800D7D0();
}
void sub_800D570(void)
{
sub_800D7B8();
}
UNUSED static u8 sub_800D57C(void)
{
return gUnknown_202DB70;
}
u8 sub_800D588(void)
{
return (gUnknown_202DB68 & 0x80);
}
void sub_800D59C(u16 *src, u32 size)
{
u32 i;
u16 bits;
s32 count = 0;
u16 *dst = gUnknown_202D808;
gUnknown_202DB74 = ((size + 1) & ~(1)) + 8;
CpuCopy(&dst[2], src, size);
bits = 0xFDFD;
dst[0] = bits;
dst[1] = 0;
for (i = 0; i < (gUnknown_202DB74 / 2) - 2; i++) {
count += dst[i];
}
gUnknown_202D808[1] = ~count - (gUnknown_202DB74 / 2);
}
bool8 sub_800D600(void)
{
u32 i, j;
for (i = 0; i < 2; i++) {
s32 count = 0;
u16 *ptr = gUnknown_202D910[i];
for (j = 0; j < (gUnknown_202DB74 / 2) - 2; j++) {
count += ptr[j];
}
// Interesting casts and arithmetics here.
if ((s16) count != (s16) (-1 - (gUnknown_202DB74 / 2)))
return FALSE;
}
return TRUE;
}
void sub_800D670(u32 id, void *dst, u32 size)
{
CpuCopy(dst, &gUnknown_202D910[id][2], size);
}
void sub_800D68C(u32 id)
{
MemoryFill8(gUnknown_202D910[id], 0, sizeof(gUnknown_202D910[0]));
}
void sub_800D6AC(void)
{
s32 i;
REG_IME = 0;
REG_IE &= 0xFF3F;
REG_IME = 1;
REG_RCNT = 0;
(*(vu32 *)REG_ADDR_SIOCNT) = 0x2000;
REG_SIOCNT |= 0x4003;
CpuFill32(0, &gUnknown_202DCF8, 0x120);
CpuCopy32(sub_80001E8, gUnknown_202DB78, sizeof(gUnknown_202DB78));
CpuCopy32(sub_8000228, gUnknown_202DBB8, sizeof(gUnknown_202DBB8));
gUnknown_202DCF8.unk14 = -1;
gUnknown_202DCF8.unk28.asU16 = gUnknown_202DCF8.unk60;
gUnknown_202DCF8.unk2C = gUnknown_202DCF8.unk78;
for (i = 0; i < 2; i++) {
gUnknown_202DCF8.unk30[i] = gUnknown_202DCF8.unk90[i][0];
gUnknown_202DCF8.unk40[i] = gUnknown_202DCF8.unk90[i][1];
gUnknown_202DCF8.unk50[i] = gUnknown_202DCF8.unk90[i][2];
}
REG_IME = 0;
REG_IE |= 0x80;
REG_IME = 1;
}
static void sub_800D7B8(void)
{
if (gUnknown_202DCF8.unk0 != 0) {
gUnknown_202DCF8.unk8 = 1;
}
}
void sub_800D7D0(void)
{
REG_IME = 0;
REG_IE &= 0xFF3F;
REG_IME = 1;
REG_SIOCNT = 0x2003;
REG_TM3CNT = 0xB1FC;
REG_IF = 0xC0;
gUnknown_202DCF8.unk8 = 0;
}
static u32 sub_800D820(u16 *a0, u16 a1[2][8])
{
u32 ret, var;
u32 bits1, bits2, b;
u32 r3, r2;
u32 si0cnt = (*(vu32 *)REG_ADDR_SIOCNT);
switch (gUnknown_202DCF8.unk1) {
case 0:
if (gUnknown_202DCF8.unk14 == -1) {
u16 bits = si0cnt & 0x88;
if (bits != 8)
break;
if (!((u8)(si0cnt & 0x4))) {
vu8 *sioPtru8;
u32 sioBits;
REG_IME = 0;
REG_IE &= 0xFF7F;
REG_IE |= 0x40;
REG_IME = 1;
sioPtru8 = ((vu8 *)REG_ADDR_SIOCNT);
sioBits = sioPtru8[1] & ~0x40;
sioPtru8[1] = sioBits;
REG_IF = 0xC0;
REG_TM3CNT = 0xB1FC;
gUnknown_202DCF8.unk0 = 8;
}
}
gUnknown_202DCF8.unk1 = 1;
// fallthrough
case 1:
if (gUnknown_202DCF8.unk2 != 0) {
if (gUnknown_202DCF8.unkA < 8) {
gUnknown_202DCF8.unkA++;
}
else {
gUnknown_202DCF8.unk1 = 2;
}
}
// fallthrough
case 2:
sub_800D9B8(a1);
sub_800D944(a0);
break;
}
gUnknown_202DCF8.unkB++;
r3 = gUnknown_202DCF8.unk3;
r2 = gUnknown_202DCF8.unk2 << 8;
b = ((gUnknown_202DCF8.unk0 == 8) ? 0x80 : 0) | r3 | r2;
var = b;
if (gUnknown_202DCF8.unk9 != 0) {
var |= 0x1000;
}
bits1 = (gUnknown_202DCF8.unkA >> 3) << 15;
bits2 = (si0cnt << 26) >> 30;
if (bits2 >= 2) {
ret = 0x2000 | var | bits1;
}
else {
ret = var | bits1;
}
return ret;
}
static void sub_800D944(u16 *src)
{
u32 i;
s32 count = 0;
gUnknown_202DCF8.unk28.asU8[0] = gUnknown_202DCF8.unkB;
gUnknown_202DCF8.unk28.asU8[1] = gUnknown_202DCF8.unk2 ^ gUnknown_202DCF8.unk3;
gUnknown_202DCF8.unk28.asU16[1] = 0;
CpuCopy32(src, &gUnknown_202DCF8.unk28.asU16[2], 0x10);
for (i = 0; i < 10; i++) {
count += gUnknown_202DCF8.unk28.asU16[i];
}
gUnknown_202DCF8.unk28.asU16[1] = ~count - 12;
if (gUnknown_202DCF8.unk0 != 0) {
REG_TM3CNT_H = 0;
}
gUnknown_202DCF8.unk14 = -1;
if (gUnknown_202DCF8.unk0 != 0 && gUnknown_202DCF8.unk8 != 0) {
REG_TM3CNT_H = 0xC0;
}
}
static u32 sub_800D9B8(u16 dst[2][8])
{
s32 i;
u8 sp0[4];
u32 (*func)(void) = (void *)gUnknown_202DB78;
u32 *spAsU32 = (u32 *)sp0;
*spAsU32 = func();
gUnknown_202DCF8.unk3 = 0;
for (i = 0; i < 2; i++) {
u32 j;
s32 count = 0;
for (j = 0; j < 10; j++) {
count += gUnknown_202DCF8.unk50[i][j];
}
if (sp0[i] != 0 && (s16)(count) == (s16)(-13)) {
CpuCopy32(&gUnknown_202DCF8.unk50[i][2], dst[i], 0x10);
gUnknown_202DCF8.unk3 |= (1 << i);
}
CpuFill32(0, &gUnknown_202DCF8.unk50[i][2], 0x10);
}
gUnknown_202DCF8.unk2 |= gUnknown_202DCF8.unk3;
return gUnknown_202DCF8.unk3;
}

View File

@ -18,7 +18,6 @@
#include "friend_area.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "position_util.h"
#include "text_util.h"
#include "dungeon_util_1.h"

View File

@ -21,7 +21,6 @@
#include "code_803E668.h"
#include "code_806CD90.h"
#include "moves.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/map.h"
#include "structs/str_pokemon.h"

View File

@ -19,7 +19,6 @@
#include "math.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"

View File

@ -389,3 +389,743 @@ void sub_8099690(u32 param_1)
}
CloseFile(temp);
}
// TODO: figure out if a new file starts here...
typedef struct unkStruct_3000400
{
// size: 0x4
u8 unk0[0x4];
} unkStruct_3000400;
extern void sub_8003810(u16 idx, unkStruct_3000400 param_2);
extern void sub_80039B8(void);
extern void TransferBGPaletteBuffer(void);
extern void sub_80037C8(u16, u32, unkStruct_3000400);
extern void sub_8003664(u16 param_1, u16 param_2);
extern void sub_80036AC(u16, u32, unkStruct_3000400);
extern void sub_80036F4(u16, u32, unkStruct_3000400);
extern void sub_8003780(u16, u32, unkStruct_3000400);
void sub_809977C(void);
UNUSED static void sub_8099708(u16 a0, unkStruct_3000400 a1)
{
sub_8003810(a0, a1);
}
void sub_809971C(u16 idx, unkStruct_3000400 *strPtrs, s32 n)
{
s32 i;
for (i = 0; i < n; i++) {
sub_8003810(idx++, *strPtrs++);
}
}
void sub_8099744(void)
{
sub_80039B8();
}
void sub_8099750(void)
{
TransferBGPaletteBuffer();
}
void sub_809975C(void)
{
sub_809977C();
}
void sub_8099768(void)
{
sub_809977C();
sub_8099744();
sub_8099750();
}
struct UnkStruct_2039958
{
s32 unk0;
s16 unk4;
s16 unk6;
u16 unk8;
u16 unkA;
u16 unkC;
};
struct UnkStruct_2039978
{
u32 unk0;
unkStruct_3000400 unk4;
struct UnkStruct_2039958 unk8;
};
static EWRAM_DATA struct UnkStruct_2039958 gUnknown_2039958 = {0};
static EWRAM_DATA struct UnkStruct_2039958 gUnknown_2039968 = {0};
static EWRAM_DATA struct UnkStruct_2039978 gUnknown_2039978 = {0};
static EWRAM_DATA u8 gUnknown_2039990 = FALSE;
static EWRAM_DATA s16 gUnknown_2039992 = 0;
UNUSED static EWRAM_DATA s32 sUnused = 0;
#define ARR_COUNT_2039998 33
static EWRAM_DATA u16 gUnknown_2039998[ARR_COUNT_2039998] = {0};
void sub_8099838(struct UnkStruct_2039958 *a0);
void sub_8099848(struct UnkStruct_2039958 *a0);
void sub_8099DD0(u16 a0);
void sub_8099E58(u16 a0);
void sub_8099E80(u16 a0, unkStruct_3000400 a1);
void sub_809977C(void)
{
s32 i;
gUnknown_2039990 = FALSE;
gUnknown_2039992 = 0;
sub_8099838(&gUnknown_2039958);
sub_8099838(&gUnknown_2039968);
sub_8099838(&gUnknown_2039978.unk8);
gUnknown_2039978.unk0 = 0;
gUnknown_2039978.unk8.unkC = 0x100;
gUnknown_2039958.unkC = 0;
sub_8099DD0(0);
gUnknown_2039968.unkC = 0x100;
sub_8099E58(0x100);
for (i = 0; i < ARR_COUNT_2039998; i++) {
gUnknown_2039998[i] = 0;
}
}
void sub_80997F4(u16 a0, u32 a1)
{
gUnknown_2039998[a0] = a1;
sub_8099848(&gUnknown_2039958);
sub_8099848(&gUnknown_2039968);
sub_8099848(&gUnknown_2039978.unk8);
}
UNUSED static u32 sub_8099828(u16 a0)
{
return gUnknown_2039998[a0];
}
void sub_8099838(struct UnkStruct_2039958 *a0)
{
a0->unk0 = 1;
a0->unkC = 0;
a0->unk4 = 0;
a0->unk6 = 0;
}
void sub_8099848(struct UnkStruct_2039958 *a0)
{
if (a0->unk0 == 0) {
a0->unk0 = 1;
}
}
void sub_809985C(struct UnkStruct_2039958 *a0, s32 a1)
{
if (a1 >= 0) {
if (a1 == 0) {
a0->unkC = 0x100;
a0->unk0 = 1;
}
else {
a0->unk0 = 2;
}
}
else {
a1 = 30;
a0->unk0 = 2;
}
a0->unk4 = a1;
a0->unk6 = a1;
}
void sub_8099880(struct UnkStruct_2039958 *a0, s32 a1)
{
if (a1 >= 0) {
if (a1 == 0) {
a0->unkC = a1;
a0->unk0 = 1;
}
else {
a0->unk0 = 3;
}
}
else {
a1 = 30;
a0->unk0 = 3;
}
a0->unk4 = a1;
a0->unk6 = a1;
}
void sub_80998A0(struct UnkStruct_2039958 *a0, s32 a1, u16 a2, u16 a3)
{
if (a1 < 0) a1 = 30;
if (a2 > a3) {
a0->unk0 = 5;
a0->unkA = a2 - a3;
}
else if (a2 < a3) {
a0->unk0 = 4;
a0->unkA = a3 - a2;
}
else {
a0->unk0 = 1;
a0->unkA = 0;
}
a0->unk4 = a1;
a0->unk6 = a1;
a0->unkC = a2;
a0->unk8 = a3;
}
bool8 sub_80998E0(struct UnkStruct_2039958 *a0)
{
switch (a0->unk0) {
case 0:
break;
case 1:
a0->unk0 = 0;
return TRUE;
case 2:
if (--a0->unk4 > 0) {
u16 var = 0x100 - ((a0->unk4 << 8) / a0->unk6);
if (a0->unkC < var) {
a0->unkC = var;
}
}
else {
a0->unkC = 0x100;
a0->unk0 = 0;
}
return TRUE;
case 3:
if (--a0->unk4 > 0) {
u16 var = (a0->unk4 << 8) / a0->unk6;
if (a0->unkC > var) {
a0->unkC = var;
}
}
else {
a0->unkC = 0;
a0->unk0 = 0;
}
return TRUE;
case 4:
if (--a0->unk4 > 0) {
a0->unkC = a0->unk8 - ((a0->unk4 * a0->unkA) / a0->unk6);
}
else {
a0->unkC = a0->unk8;
a0->unk0 = 0;
}
return TRUE;
case 5:
if (--a0->unk4 > 0) {
a0->unkC = a0->unk8 + ((a0->unk4 * a0->unkA) / a0->unk6);
}
else {
a0->unkC = a0->unk8;
a0->unk0 = 0;
}
return TRUE;
}
return FALSE;
}
void sub_80999D4(s32 a0)
{
gUnknown_2039990 = TRUE;
gUnknown_2039992 = a0;
}
void sub_80999E8(s32 a0)
{
sub_809985C(&gUnknown_2039958, a0);
}
void sub_80999FC(s32 a0)
{
sub_8099880(&gUnknown_2039958, a0);
}
void sub_8099A10(s32 a1, u16 a2, u16 a3)
{
sub_80998A0(&gUnknown_2039958, a1, a2, a3);
}
void sub_8099A34(s32 a0)
{
sub_809985C(&gUnknown_2039968, a0);
}
void sub_8099A48(s32 a0)
{
sub_8099880(&gUnknown_2039968, a0);
}
void sub_8099A5C(s32 a0, s32 a1, unkStruct_3000400 a2)
{
gUnknown_2039978.unk0 = a0;
gUnknown_2039978.unk4 = a2;
gUnknown_2039978.unk8.unkC = 0;
sub_809985C(&gUnknown_2039978.unk8, a1);
switch (a0) {
case 1:
case 3:
gUnknown_2039968.unkC = 0x100;
gUnknown_2039958.unkC = 0x100;
break;
case 9:
case 11:
gUnknown_2039968.unkC = 0x100;
break;
case 5:
case 7:
case 13:
case 14:
gUnknown_2039958.unkC = 0x100;
break;
}
}
void sub_8099AFC(s32 a0, s32 a1, unkStruct_3000400 a2)
{
gUnknown_2039978.unk0 = a0;
gUnknown_2039978.unk4 = a2;
gUnknown_2039978.unk8.unkC = 0x100;
sub_8099880(&gUnknown_2039978.unk8, a1);
switch (a0) {
case 2:
case 4:
gUnknown_2039968.unkC = 0;
gUnknown_2039958.unkC = 0;
break;
case 10:
case 12:
gUnknown_2039968.unkC = 0;
break;
case 6:
case 8:
case 13:
case 14:
gUnknown_2039958.unkC = 0;
break;
}
}
bool8 sub_8099B94(void)
{
if (gUnknown_2039990)
return TRUE;
if (gUnknown_2039978.unk0 != 0) {
return (gUnknown_2039978.unk8.unk0 != 0);
}
return (gUnknown_2039958.unk0 != 0 || gUnknown_2039968.unk0 != 0);
}
void sub_8099BE4(void)
{
if (gUnknown_2039978.unk0 != 0 || gUnknown_2039978.unk8.unk0 != 0) {
if (sub_80998E0(&gUnknown_2039978.unk8)) {
sub_8099E80(gUnknown_2039978.unk8.unkC, gUnknown_2039978.unk4);
}
else if (gUnknown_2039978.unk8.unk0 == 0) {
switch (gUnknown_2039978.unk0) {
case 0:
break;
case 1:
case 3:
case 5:
case 7:
case 9:
case 11:
if (gUnknown_2039978.unk8.unkC >= 256) {
gUnknown_2039978.unk0 = 0;
}
else if (gUnknown_2039990) {
s32 var = 0;
switch (gUnknown_2039978.unk0) {
case 1: var = 2; break;
case 3: var = 4; break;
case 5: var = 6; break;
case 7: var = 8; break;
}
if (var != 0) {
sub_8099AFC(var, gUnknown_2039992, gUnknown_2039978.unk4);
}
else {
gUnknown_2039978.unk0 = 0;
}
}
break;
case 2:
case 4:
case 6:
case 8:
case 10:
case 12:
case 13:
case 14:
if (gUnknown_2039978.unk8.unkC == 0) {
gUnknown_2039978.unk0 = 0;
}
else if (gUnknown_2039990) {
sub_8099AFC(gUnknown_2039978.unk0, gUnknown_2039992, gUnknown_2039978.unk4);
}
break;
}
}
}
else if (gUnknown_2039990) {
bool8 r5 = TRUE;
if (gUnknown_2039958.unkC != 0 || gUnknown_2039958.unk0 != 0) {
r5 = FALSE;
if (gUnknown_2039958.unk0 != 3) {
sub_8099880(&gUnknown_2039958, gUnknown_2039992);
}
if (sub_80998E0(&gUnknown_2039958)) {
sub_8099DD0(gUnknown_2039958.unkC);
}
}
if (gUnknown_2039968.unkC != 0 || gUnknown_2039968.unk0 != 0) {
r5 = FALSE;
if (gUnknown_2039968.unk0 != 3) {
sub_8099880(&gUnknown_2039968, gUnknown_2039992);
}
if (sub_80998E0(&gUnknown_2039968)) {
sub_8099E58(gUnknown_2039968.unkC);
}
}
if (r5) {
gUnknown_2039990 = FALSE;
}
}
else {
if (sub_80998E0(&gUnknown_2039958)) {
sub_8099DD0(gUnknown_2039958.unkC);
}
if (sub_80998E0(&gUnknown_2039968)) {
sub_8099E58(gUnknown_2039968.unkC);
}
}
}
void sub_8099DD0(u16 a0)
{
s32 i;
for (i = 0; i < 14; i++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i, 0x100);
}
else {
sub_8003664(i, a0);
}
}
for (i = 16; i < 31; i++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i, 0x100);
}
else {
sub_8003664(i, a0);
}
}
sub_8003664(32, a0);
}
void sub_8099E58(u16 a0)
{
sub_8003664(15, a0);
sub_8003664(14, a0);
sub_8003664(31, a0);
}
void sub_8099E80(u16 param_1,unkStruct_3000400 param_2)
{
s32 i;
switch (gUnknown_2039978.unk0) {
case 0:
break;
case 1:
for (i = 0; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
for (i = 16; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
break;
case 9:
for (i = 14; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
for (i = 31; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
break;
case 5:
for (i = 0; i < 14; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
for (i = 16; i < 31; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036AC(i,param_1,param_2);
}
}
break;
case 2:
for (i = 0; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
for (i = 16; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
break;
case 10:
for (i = 14; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
for (i = 31; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
break;
case 6:
for (i = 0; i < 14; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
for (i = 16; i < 31; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_80036F4(i,param_1,param_2);
}
}
break;
case 3:
for (i = 0; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
for (i = 16; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
break;
case 11:
for (i = 14; i < 16; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
for (i = 31; i < 32; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
break;
case 7:
for (i = 0; i < 14; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
for (i = 16; i < 31; i++) {
if (gUnknown_2039998[i] & 2) {
sub_8003664(i,0x100);
}
else {
sub_8003780(i,param_1,param_2);
}
}
break;
case 4:
for (i = 0; i < 16; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
for (i = 16; i < 32; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
break;
case 12:
for (i = 14; i < 16; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
for (i = 31; i < 32; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
break;
case 13:
case 14:
switch (gUnknown_2039978.unk0) {
case 13:
param_2.unk0[0] = 0x90;
param_2.unk0[1] = 0x90;
param_2.unk0[2] = 0xFF;
param_2.unk0[3] = 0xFF;
break;
case 14:
param_2.unk0[0] = 0xFF;
param_2.unk0[1] = 0xC0;
param_2.unk0[2] = 0x80;
param_2.unk0[3] = 0xFF;
break;
}
// NOTE: fallthrough needed here
case 8:
for (i = 0; i < 14; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
for (i = 16; i < 31; i ++) {
if (gUnknown_2039998[i] & 1) {
sub_8003664(i,0x100);
}
else if (gUnknown_2039998[i] & 2) {
sub_8003664(i,param_1);
}
else {
sub_80037C8(i,param_1,param_2);
}
}
break;
}
}

View File

@ -25,7 +25,6 @@
#include "memory.h"
#include "personality_test1.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "string_format.h"
#include "text_1.h"
#include "text_2.h"
@ -35,9 +34,6 @@
IWRAM_INIT struct unkStruct_3001B64 *gUnknown_3001B64 = { NULL };
extern u16 gUnknown_20399DC;
extern u16 gUnknown_20399DE;
extern bool8 sub_802FCF0(void);
u8 ScriptPrintText_809B2B8(struct unkStruct_3001B64_unkC *, s32, s32, const char *);
bool8 IsTextboxOpen_809B40C(struct unkStruct_3001B64_unkC *);
@ -126,6 +122,9 @@ ALIGNED(4) static const u8 sYellowStringText[] = _("{COLOR YELLOW_N}%s{RESET}");
// TODO: Convert to actual string
ALIGNED(4) static const u8 gUnknown_8116190[] = {0x25, 0x73, 0x23, 0x5b, 0x49, 0x5d, 0x23, 0x7e, 0x20, 0x81, 0x40, 0x23, 0x57, 0x0a, 0x23, 0x5b, 0x4f, 0x5d, 0x23, 0x7e, 0x20, 0x81, 0x40, 0x00};
EWRAM_DATA u16 gUnknown_20399DC = 0;
EWRAM_DATA u16 gUnknown_20399DE = 0;
void sub_809A560(void)
{
sub_8014144();

View File

@ -39,7 +39,7 @@ struct unkStruct_20399E0
u32 unk8;
};
extern struct unkStruct_20399E0 *gUnknown_20399E0;
EWRAM_DATA struct unkStruct_20399E0 *gUnknown_20399E0 = {0};
void sub_809C63C();

View File

@ -4,6 +4,7 @@
#include "math.h"
#include "memory.h"
#include "other_random.h"
#include "ground_script.h"
struct unkStruct_20399E8
{
@ -24,7 +25,7 @@ struct unkStruct_20399E8
u8 unk44;
};
extern struct unkStruct_20399E8 gUnknown_20399E8;
EWRAM_DATA struct unkStruct_20399E8 gUnknown_20399E8 = {0};
void sub_809D0BC(void);
void sub_809D4B0(void);
@ -396,7 +397,7 @@ void sub_809D4B0(void)
gUnknown_2039A32 = -1;
gUnknown_2039A34 = -1;
gAnyScriptLocked = 0;
for (i = 0; i < 0x81; i++) {
for (i = 0; i < SCRIPT_LOCKS_ARR_COUNT; i++) {
gScriptLocks[i] = 0;
gScriptLockConds[i] = 0;
gUnlockBranchLabels[i] = 0;

View File

@ -8,7 +8,6 @@
#include "items.h"
#include "moves.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "random.h"
#include "string_format.h"
#include "strings.h"

View File

@ -10,7 +10,6 @@
#include "string_format.h"
#include "code_80958E8.h"
#include "mailbox.h"
#include "pokemon_mid.h"
#include "structs/str_dungeon.h"
#include "constants/dungeon.h"

View File

@ -22,7 +22,6 @@
#include "dungeon_move_util.h"
#include "code_800D090.h"
#include "dungeon_message.h"
#include "pokemon_mid.h"
#include "dungeon_strings.h"
#include "constants/move_id.h"
#include "moves.h"

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "ground_script.h"
#include "ground_sprite.h"
#include "debug.h"
#include "memory.h"
@ -11,7 +12,12 @@ typedef struct GroundEffect {
s16 unk6;
s16 unk8;
s8 unkA;
u8 fillB[0x1c4 - 0xB];
u8 fillB[0x14 - 0xB];
PixelPos unkPixelPos14;
u8 fill1C[0x124 - 0x1C];
PixelPos unkPixelPos124;
u8 fill12C[0x144 - 0x12C];
struct UnkGroundSpriteStruct unk144;
} GroundEffect;
IWRAM_INIT GroundEffect* gGroundEffects = NULL; // size 16 array
@ -100,7 +106,7 @@ void GroundEffect_Cancel(s32 scriptID, s32 sector)
index = 0;
ptr = &gGroundEffects[0];
for(; index < 0x10; index = (s16)(index + 1), ptr++)
for(; index < 16; index = (s16)(index + 1), ptr++)
{
if((ptr->unk6 != -1) && (ptr->unk8 == scriptID_s32))
if(sector_s32 < 0 || ptr->unkA == sector_s32)
@ -108,3 +114,28 @@ void GroundEffect_Cancel(s32 scriptID, s32 sector)
}
}
extern const char gUnknown_8118658[];
void GroundEffect_CancelBlank()
{
s32 index;
GroundEffect *ptr;
PixelPos pos;
Log(0, gUnknown_8118658); // "GroundEffect CancelBlank"
index = 0;
ptr = &gGroundEffects[0];
for (; index < 16; index = (s16)(index + 1), ptr++)
{
if (ptr->unk6 != -1)
{
pos.x = ptr->unkPixelPos124.x + ptr->unkPixelPos14.x;
pos.y = ptr->unkPixelPos124.y + ptr->unkPixelPos14.y;
if (!IsOnscreen_80A675C(&ptr->unk144, &pos))
{
GroundEffect_Delete(index);
}
}
}
}

View File

@ -132,11 +132,8 @@ bool8 sub_8099B94(void);
PixelPos SetVecFromDirectionSpeed(s8, s32);
bool8 sub_8098DCC(u32 speed);
extern const PixelPos gUnknown_81164DC;
extern u32 gUnknown_2039DA4;
extern char *gUnknown_203B4B0;
extern char gUnknown_2039D98[];
void sub_8099220(void *param_1, s32 param_2);
extern u32 gUnlockBranchLabels[];
s16 sub_8002694(u8 param_1); // value -> GroundEnter lookup
bool8 sub_809B260(void *dst);
bool8 sub_809B18C(s32 *sp);
@ -145,12 +142,6 @@ bool8 sub_809D234(void);
s32 sub_80A14E8(Action *, u8, u32, s32);
u8 sub_80990EC(struct unkStruct_20398C8 *param_1, s32 param_2);
extern s16 gCurrentMap;
extern s16 gUnknown_2039A32;
extern s16 gUnknown_2039A34;
extern MenuItem gChoices[9];
extern char gUnknown_81165D4[];
extern char gUnknown_81165F4[];
extern char gUnknown_811660C[];
@ -167,10 +158,6 @@ extern DebugLocation gUnknown_81166F8;
extern DebugLocation gUnknown_8116704;
extern ScriptCommand gUnknown_81164E4;
extern u8 gAnyScriptLocked;
extern u8 gScriptLocks[];
extern u8 gScriptLockConds[];
extern const DebugLocation gUnknown_8116588;
extern const DebugLocation gUnknown_8116538;
extern const DebugLocation gUnknown_8116560;
@ -224,7 +211,6 @@ extern DungeonLocation gUnknown_81167E8;
extern DungeonLocation gUnknown_8116788;
extern DungeonLocation gUnknown_811678C;
extern DungeonLocation gUnknown_8116790;
extern u16 gUnknown_2039DA8;
PokemonStruct1 *sub_808D2E8(s32 species, u8 *name, u32 _itemID, DungeonLocation *location, u16 *moveID);
bool8 HasRecruitedMon(s32 species);
@ -247,6 +233,19 @@ extern void sub_80997F4(u16, u16);
s32 sub_809CFE8(u16 param_1);
extern bool8 sub_80A579C(PixelPos *a0, PixelPos *a1);
// TODO: make these static maybe?
EWRAM_DATA s16 gCurrentMap = 0;
EWRAM_DATA s16 gUnknown_2039A32 = 0;
EWRAM_DATA s16 gUnknown_2039A34 = 0;
EWRAM_DATA u8 gAnyScriptLocked = 0;
// Hard to say why the arrays are larger than SCRIPT_LOCKS_ARR_COUNT. Could be unused EWRAM variables or special case indexes.
ALIGNED(4) EWRAM_DATA u8 gScriptLocks[SCRIPT_LOCKS_ARR_COUNT + 7] = {0};
ALIGNED(4) EWRAM_DATA u8 gScriptLockConds[SCRIPT_LOCKS_ARR_COUNT + 7] = {0};
EWRAM_DATA u32 gUnlockBranchLabels[SCRIPT_LOCKS_ARR_COUNT + 1] = {0};
EWRAM_DATA MenuItem gChoices[9] = {0};
EWRAM_DATA char gUnknown_2039D98[POKEMON_NAME_LENGTH + 2] = {0};
EWRAM_DATA u32 gUnknown_2039DA4 = 0;
EWRAM_DATA u16 gUnknown_2039DA8 = 0;
EWRAM_INIT static int sNumChoices = 0;
// -1 didn't match
@ -3899,7 +3898,7 @@ void GroundScript_Unlock(void)
gAnyScriptLocked = 0;
index = 0;
for (index = 0; index <= 0x80; index++) {
for (index = 0; index < SCRIPT_LOCKS_ARR_COUNT; index++) {
if(gScriptLocks[index] != 0) {
Log(1, gUnknown_8116848, index);
cond = GroundMapNotifyAll(index);

View File

@ -54,9 +54,6 @@ extern void DealDamageToEntity(Entity *, s32, u32, u32);
extern u32 gUnknown_8106A50;
extern u32 gUnknown_8106A4C;
// TODO The parameters don't match the function definition in pokemon_mid.h (u8*, s16).
extern void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index);
bool8 ProtectMoveAction(Entity * pokemon,Entity * target,Move *move, s32 param_4)
{
ProtectStatusTarget(pokemon, target);

View File

@ -24,7 +24,6 @@
#include "dungeon_strings.h"
#include "dungeon_random.h"
#include "dungeon_misc.h"
#include "pokemon_mid.h"
extern u32 gUnknown_8106A4C;

View File

@ -20,7 +20,6 @@
#include "math.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"

View File

@ -20,7 +20,6 @@
#include "math.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"

View File

@ -19,7 +19,6 @@
#include "math.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"

View File

@ -656,10 +656,10 @@ void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index)
sprintfStatic(buffer, gUnknown_8107600, gMonsterParameters[new_index].species); // {color YELLOW}%s{reset}
}
void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index)
void CopyCyanMonsterNametoBuffer(u8 *buffer, s32 index_)
{
s32 new_index = index;
sprintfStatic(buffer, gUnknown_8107608, gMonsterParameters[new_index].species); // {color CYAN}%s{reset}
s32 index = (s16) index_;
sprintfStatic(buffer, gUnknown_8107608, gMonsterParameters[index].species); // {color CYAN}%s{reset}
}
void sub_808D930(u8 *buffer, s32 index)
@ -1132,7 +1132,7 @@ bool8 CanMonLearnMove(u16 moveID, s16 _species)
{
u16 levelUpMoveID;
u16 HMTMMoveID;
s32 species = _species; // r4
s32 species = _species;
const u8* learnsetPtr;
if (species == MONSTER_DECOY) return 0;

View File

@ -1,8 +1,6 @@
.include "src/m4a.o"
.include "src/main_loops.o"
.space 0x4
.space 4
.include "src/event_flag.o"
.include "src/memory.o"
.include "src/bg_palette_buffer.o"
@ -18,41 +16,8 @@
.include "src/music.o"
.include "src/bg_control.o"
.include "src/cpu.o"
.space 0x4
gUnknown_202D808: /* 202D808 (sub_800D2EC - sub_800D59C) */
.space 0x108
gUnknown_202D910: /* 202D910 (sub_800D224 - sub_800D68C) */
.space 0x4
gUnknown_202D914: /* 202D914 (sub_800D670) */
.space 0x20C
gUnknown_202DB20: /* 202DB20 (sub_800D2EC - sub_800D494) */
.space 0x10
gUnknown_202DB30: /* 202DB30 (sub_800D1E0 - sub_800D494) */
.space 0x20
gUnknown_202DB50: /* 202DB50 (sub_800D2EC - sub_800D494) */
.space 0x8
gUnknown_202DB58: /* 202DB58 (sub_800D224 - sub_800D494) */
.space 0x8
gUnknown_202DB60: /* 202DB60 (sub_800D1C0 - sub_800D494) */
.space 0x8
gUnknown_202DB68: /* 202DB68 (sub_800D33C - sub_800D588) */
.space 0x4
gUnknown_202DB6C: /* 202DB6C (sub_800D33C - sub_800D494) */
.space 0x4
gUnknown_202DB70: /* 202DB70 (sub_800D33C - sub_800D57C) */
.space 0x4
gUnknown_202DB74: /* 202DB74 (sub_800D224 - sub_800D600) */
.space 0x4
gUnknown_202DB78: /* 202DB78 (sub_800D6AC - sub_800D9B8) */
.space 0x40
gUnknown_202DBB8: /* 202DBB8 (sub_800D6AC / data_80B9BB8) */
.space 0x140
gUnknown_202DCF8: /* 202DCF8 (sub_80001E8 - sub_800D9B8) */
.space 0x120
.space 4
.include "src/code_800D090.o"
.include "src/friend_areas_map.o"
.include "src/code_80118A4.o"
.include "src/save.o"
@ -74,13 +39,13 @@ gUnknown_202DCF8: /* 202DCF8 (sub_80001E8 - sub_800D9B8) */
.include "src/dungeon_message_log.o"
.include "src/dungeon_move.o"
.include "src/dungeon_main.o"
.space 0x4
.space 4
.include "src/dungeon_menu_items.o"
.space 0x4
.space 4
.include "src/dungeon_menu_team.o"
.space 0x4
.space 4
.include "src/dungeon_menu_moves.o"
.space 0x4
.space 4
.include "src/dungeon_menu_others.o"
.include "src/dungeon_menu_recruitment.o"
.include "src/code_8066D04.o"
@ -91,80 +56,34 @@ gUnknown_202DCF8: /* 202DCF8 (sub_80001E8 - sub_800D9B8) */
.include "src/dungeon_ai_items.o"
.include "src/code_8073CF0.o"
.include "src/code_8075708.o"
.space 0x4
.space 4
.include "src/dungeon_ai_attack.o"
.include "src/code_80848F0.o"
.space 0x4
.space 4
.include "src/pokemon.o"
.include "src/items.o"
.include "src/rescue_team_info.o"
.space 0x4
.space 4
.include "src/friend_area.o"
.include "src/moves.o"
.include "src/game_options.o"
.include "src/play_time.o"
.include "src/code_8094F88.o"
.space 0x4
.space 4
.include "src/code_80958E8.o"
.space 0x4
.space 4
.include "src/code_8097670.o"
.space 0x4
.space 4
.include "src/exclusive_pokemon.o"
.space 0x4
.space 4
.include "src/ground_main.o"
.space 0x7
gUnknown_2039958: /* 2039958 (sub_809977C - sub_8099BE4) */
.space 0x10
gUnknown_2039968: /* 2039968 (sub_809977C - sub_8099BE4) */
.space 0x10
gUnknown_2039978: /* 2039978 (sub_8099A5C - sub_8099E80) */
.space 0x8
gUnknown_2039980: /* 2039980 (sub_809977C - sub_80997F4) */
.space 0x10
gUnknown_2039990: /* 2039990 (sub_809977C - sub_8099BE4) */
.space 0x2
gUnknown_2039992: /* 2039992 (sub_809977C - sub_8099BE4) */
.space 0x6
gUnknown_2039998: /* 2039998 (sub_809977C - sub_8099E80) */
.space 0x44
gUnknown_20399DC: /* 20399DC (sub_809A560 - sub_809B614) */
.space 0x2
gUnknown_20399DE: /* 20399DE (sub_809A560 - sub_809B614) */
.space 0x2
gUnknown_20399E0: /* 20399E0 (sub_809CB50 - sub_809CCDC) */
.space 0x8
gUnknown_20399E8: /* 20399E8 (sub_809D0BC - sub_809D25C) */
.space 0x14
gUnknown_20399FC: /* 20399FC (sub_809D25C) */
.space 0x34
gCurrentMap: /* 2039A30 (sub_809D4B0 - ExecuteScriptCommand) */
.space 0x2
gUnknown_2039A32: /* 2039A32 (sub_809D4B0 - ExecuteScriptCommand) */
.space 0x2
gUnknown_2039A34: /* 2039A34 (sub_809D4B0 - ExecuteScriptCommand) */
.space 0x2
gAnyScriptLocked: /* 2039A36 (sub_809D4B0 - GroundScript_Unlock) */
.space 0x2
gScriptLocks: /* 2039A38 (sub_809D4B0 - GroundScript_Unlock) */
.space 0x88
gScriptLockConds: /* 2039AC0 (sub_809D4B0 - GroundScript_Unlock) */
.space 0x88
gUnlockBranchLabels: /* 2039B48 (sub_809D4B0 - HandleAction) */
.space 0x208
gChoices: /* 2039D50 (ExecuteScriptCommand) */
.space 0x48
gUnknown_2039D98: /* 2039D98 (HandleAction - sub_80A14E8) [seems to be storage for strings.. used for both Team Name and Player Name] */
.space 0xC
gUnknown_2039DA4: /* 2039DA4 (HandleAction) */
.space 0x4
gUnknown_2039DA8: /* 2039DA8 (sub_80A14E8) */
.space 0x8
.space 4
.include "src/code_8099360.o"
.include "src/code_809A560.o"
.include "src/code_809C5C4.o"
.space 4
.include "src/code_809D148.o"
.include "src/ground_script.o"
.space 4
.include "src/ground_sprite.o"
.include "src/ground_script_file.o"