begin event data

This commit is contained in:
DizzyEggg 2017-09-02 21:43:53 +02:00
parent a47face8cf
commit a4cc67008e
25 changed files with 1303 additions and 87 deletions

View File

@ -70,7 +70,7 @@ sub_809E7E8: @ 809E7E8
subs r4, r0 subs r4, r0
lsls r4, 16 lsls r4, 16
lsrs r4, 16 lsrs r4, 16
bl sub_809D3A0 bl ClearUpperFlags
adds r0, r4, 0 adds r0, r4, 0
bl sub_8122580 bl sub_8122580
adds r0, r4, 0 adds r0, r4, 0

View File

@ -10134,7 +10134,7 @@ _0811F0EC:
thumb_func_start sub_811F0F8 thumb_func_start sub_811F0F8
sub_811F0F8: @ 811F0F8 sub_811F0F8: @ 811F0F8
push {lr} push {lr}
bl sub_809D42C bl IsNationalPokedexEnabled
lsls r0, 24 lsls r0, 24
lsrs r0, 24 lsrs r0, 24
pop {r1} pop {r1}
@ -10447,7 +10447,7 @@ _0811F358:
movs r1, 0x14 movs r1, 0x14
strh r1, [r0] strh r1, [r0]
_0811F37A: _0811F37A:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _0811F398 beq _0811F398
ldr r0, =gUnknown_0203A120 ldr r0, =gUnknown_0203A120

View File

@ -5,36 +5,9 @@
.text .text
thumb_func_start sub_809D300
sub_809D300: @ 809D300
push {r4,lr}
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldr r1, =0x00001270
adds r0, r1
movs r2, 0x96
lsls r2, 1
movs r1, 0
bl memset
ldr r0, [r4]
ldr r1, =0x0000139c
adds r0, r1
movs r2, 0x80
lsls r2, 2
movs r1, 0
bl memset
ldr r0, =gUnknown_020375FC
movs r1, 0
movs r2, 0x10
bl memset
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_809D300
thumb_func_start sub_809D344 thumb_func_start ClearTempFieldEventData
sub_809D344: @ 809D344 ClearTempFieldEventData: @ 809D344
push {lr} push {lr}
ldr r0, =gSaveBlock1Ptr ldr r0, =gSaveBlock1Ptr
ldr r0, [r0] ldr r0, [r0]
@ -61,10 +34,10 @@ sub_809D344: @ 809D344
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D344 thumb_func_end ClearTempFieldEventData
thumb_func_start sub_809D3A0 thumb_func_start ClearUpperFlags
sub_809D3A0: @ 809D3A0 ClearUpperFlags: @ 809D3A0
push {lr} push {lr}
ldr r0, =gSaveBlock1Ptr ldr r0, =gSaveBlock1Ptr
ldr r0, [r0] ldr r0, [r0]
@ -76,10 +49,10 @@ sub_809D3A0: @ 809D3A0
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D3A0 thumb_func_end ClearUpperFlags
thumb_func_start sub_809D3C0 thumb_func_start DisableNationalPokedex
sub_809D3C0: @ 809D3C0 DisableNationalPokedex: @ 809D3C0
push {lr} push {lr}
ldr r0, =0x00004046 ldr r0, =0x00004046
bl GetVarPointer bl GetVarPointer
@ -93,10 +66,10 @@ sub_809D3C0: @ 809D3C0
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D3C0 thumb_func_end DisableNationalPokedex
thumb_func_start sub_809D3E8 thumb_func_start EnableNationalPokedex
sub_809D3E8: @ 809D3E8 EnableNationalPokedex: @ 809D3E8
push {r4,r5,lr} push {r4,r5,lr}
ldr r0, =0x00004046 ldr r0, =0x00004046
bl GetVarPointer bl GetVarPointer
@ -120,10 +93,10 @@ sub_809D3E8: @ 809D3E8
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D3E8 thumb_func_end EnableNationalPokedex
thumb_func_start sub_809D42C thumb_func_start IsNationalPokedexEnabled
sub_809D42C: @ 809D42C IsNationalPokedexEnabled: @ 809D42C
push {lr} push {lr}
ldr r0, =gSaveBlock2Ptr ldr r0, =gSaveBlock2Ptr
ldr r0, [r0] ldr r0, [r0]
@ -149,30 +122,30 @@ _0809D468:
_0809D46A: _0809D46A:
pop {r1} pop {r1}
bx r1 bx r1
thumb_func_end sub_809D42C thumb_func_end IsNationalPokedexEnabled
thumb_func_start sub_809D470 thumb_func_start DisableMysteryGift
sub_809D470: @ 809D470 DisableMysteryGift: @ 809D470
push {lr} push {lr}
ldr r0, =0x000008ac ldr r0, =0x000008ac
bl FlagReset bl FlagReset
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D470 thumb_func_end DisableMysteryGift
thumb_func_start sub_809D480 thumb_func_start EnableMysteryGift
sub_809D480: @ 809D480 EnableMysteryGift: @ 809D480
push {lr} push {lr}
ldr r0, =0x000008ac ldr r0, =0x000008ac
bl FlagSet bl FlagSet
pop {r0} pop {r0}
bx r0 bx r0
.pool .pool
thumb_func_end sub_809D480 thumb_func_end EnableMysteryGift
thumb_func_start sub_809D490 thumb_func_start IsMysteryGiftEnabled
sub_809D490: @ 809D490 IsMysteryGiftEnabled: @ 809D490
push {lr} push {lr}
ldr r0, =0x000008ac ldr r0, =0x000008ac
bl FlagGet bl FlagGet
@ -181,7 +154,7 @@ sub_809D490: @ 809D490
pop {r1} pop {r1}
bx r1 bx r1
.pool .pool
thumb_func_end sub_809D490 thumb_func_end IsMysteryGiftEnabled
thumb_func_start sub_809D4A4 thumb_func_start sub_809D4A4
sub_809D4A4: @ 809D4A4 sub_809D4A4: @ 809D4A4

View File

@ -307,7 +307,7 @@ sub_8009638: @ 8009638
movs r0, 0x80 movs r0, 0x80
lsls r0, 8 lsls r0, 8
strh r0, [r5, 0x2] strh r0, [r5, 0x2]
bl sub_809D42C bl IsNationalPokedexEnabled
strb r0, [r5, 0x10] strb r0, [r5, 0x10]
ldr r0, =0x0000087f ldr r0, =0x0000087f
bl FlagGet bl FlagGet
@ -9240,7 +9240,7 @@ _0800DDC8:
ands r4, r1 ands r4, r1
orrs r4, r0 orrs r4, r0
strb r4, [r7] strb r4, [r7]
bl sub_809D42C bl IsNationalPokedexEnabled
ands r0, r6 ands r0, r6
ldrb r1, [r7, 0x1] ldrb r1, [r7, 0x1]
ands r5, r1 ands r5, r1
@ -39455,7 +39455,7 @@ sub_801DC20: @ 801DC20
ldr r6, =gUnknown_020375F0 ldr r6, =gUnknown_020375F0
bl sub_801B044 bl sub_801B044
adds r4, r0, 0 adds r4, r0, 0
bl sub_809D490 bl IsMysteryGiftEnabled
cmp r0, 0 cmp r0, 0
beq _0801DC3A beq _0801DC3A
bl sub_801B0CC bl sub_801B0CC

View File

@ -4650,7 +4650,7 @@ fmt_pokedex: @ 8031F7C
lsrs r0, 24 lsrs r0, 24
cmp r0, 0x1 cmp r0, 0x1
bne _08031FFE bne _08031FFE
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _08031FA4 beq _08031FA4
movs r0, 0x1 movs r0, 0x1

View File

@ -582,7 +582,7 @@ sub_8153BE4: @ 8153BE4
sub_8153C4C: @ 8153C4C sub_8153C4C: @ 8153C4C
push {r4,lr} push {r4,lr}
adds r4, r0, 0 adds r4, r0, 0
bl sub_809D3E8 bl EnableNationalPokedex
ldr r0, =gStringVar4 ldr r0, =gStringVar4
ldr r1, =gUnknown_08674B9E ldr r1, =gUnknown_08674B9E
bl StringExpandPlaceholders bl StringExpandPlaceholders

View File

@ -280,7 +280,7 @@ _080844B2:
bl set_player_trainer_id bl set_player_trainer_id
bl PlayTimeCounter_Reset bl PlayTimeCounter_Reset
bl sub_8084390 bl sub_8084390
bl sub_809D300 bl InitEventData
bl sub_80EBEE0 bl sub_80EBEE0
bl GabbyAndTyNewGameInitData bl GabbyAndTyNewGameInitData
bl sub_80E8B28 bl sub_80E8B28

View File

@ -30,7 +30,7 @@ sub_80BB2D0: @ 80BB2D0
str r1, [r0, 0x1C] str r1, [r0, 0x1C]
str r1, [r0, 0x20] str r1, [r0, 0x20]
str r1, [r0, 0x24] str r1, [r0, 0x24]
bl sub_809D3C0 bl DisableNationalPokedex
movs r1, 0 movs r1, 0
movs r2, 0 movs r2, 0
ldr r3, =gSaveBlock1Ptr ldr r3, =gSaveBlock1Ptr
@ -409,7 +409,7 @@ _080BB628:
ldr r3, =0x00000612 ldr r3, =0x00000612
adds r1, r3 adds r1, r3
strh r0, [r1] strh r0, [r1]
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
cmp r1, 0 cmp r1, 0
bne _080BB65E bne _080BB65E
@ -439,7 +439,7 @@ _080BB65E:
adds r0, r3 adds r0, r3
movs r1, 0 movs r1, 0
strb r1, [r0] strb r1, [r0]
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080BB6D0 bne _080BB6D0
movs r0, 0 movs r0, 0
@ -1181,7 +1181,7 @@ _080BBD7C:
adds r3, 0x4 adds r3, 0x4
adds r1, r3 adds r1, r3
strh r0, [r1] strh r0, [r1]
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
cmp r1, 0 cmp r1, 0
bne _080BBDB6 bne _080BBDB6
@ -1227,7 +1227,7 @@ sub_80BBDE8: @ 80BBDE8
adds r1, r2 adds r1, r2
ldrh r1, [r1] ldrh r1, [r1]
strb r1, [r0, 0x19] strb r1, [r0, 0x19]
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
cmp r1, 0 cmp r1, 0
bne _080BBE18 bne _080BBE18
@ -1875,7 +1875,7 @@ sub_80BC3DC: @ 80BC3DC
adds r3, 0x4 adds r3, 0x4
adds r1, r3 adds r1, r3
strh r0, [r1] strh r0, [r1]
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
cmp r1, 0 cmp r1, 0
bne _080BC42A bne _080BC42A
@ -1940,7 +1940,7 @@ sub_80BC47C: @ 80BC47C
adds r3, 0x4 adds r3, 0x4
adds r1, r3 adds r1, r3
strh r0, [r1] strh r0, [r1]
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
cmp r1, 0 cmp r1, 0
bne _080BC4CA bne _080BC4CA
@ -2295,7 +2295,7 @@ sub_80BC844: @ 80BC844
b _080BC862 b _080BC862
.pool .pool
_080BC858: _080BC858:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080BC870 bne _080BC870
ldr r0, =gUnknown_08DC16F6 ldr r0, =gUnknown_08DC16F6
@ -2383,7 +2383,7 @@ _080BC8FC:
b _080BC92C b _080BC92C
.pool .pool
_080BC910: _080BC910:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _080BC924 beq _080BC924
mov r0, sp mov r0, sp
@ -4743,7 +4743,7 @@ sub_80BDB7C: @ 80BDB7C
beq _080BDCCC beq _080BDCCC
b _080BE414 b _080BE414
_080BDCCC: _080BDCCC:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _080BDCD6 beq _080BDCD6
b _080BDF4C b _080BDF4C
@ -8589,7 +8589,7 @@ _080BFF78:
adds r0, r2 adds r0, r2
b _080C0038 b _080C0038
_080BFF82: _080BFF82:
bl sub_809D42C bl IsNationalPokedexEnabled
adds r1, r0, 0 adds r1, r0, 0
adds r0, r4, 0 adds r0, r4, 0
movs r2, 0x1 movs r2, 0x1
@ -11142,7 +11142,7 @@ _080C1332:
movs r0, 0x3 movs r0, 0x3
movs r3, 0 movs r3, 0
bl copy_decompressed_tile_data_to_vram_autofree bl copy_decompressed_tile_data_to_vram_autofree
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080C13E4 bne _080C13E4
ldr r1, =gUnknown_08DC3A0C ldr r1, =gUnknown_08DC3A0C
@ -11520,7 +11520,7 @@ sub_80C170C: @ 80C170C
ldrsh r0, [r0, r1] ldrsh r0, [r0, r1]
cmp r0, 0 cmp r0, 0
beq _080C1740 beq _080C1740
bl sub_809D42C bl IsNationalPokedexEnabled
ldr r6, =gUnknown_0856EDB8 ldr r6, =gUnknown_0856EDB8
cmp r0, 0 cmp r0, 0
bne _080C174C bne _080C174C
@ -11528,7 +11528,7 @@ sub_80C170C: @ 80C170C
b _080C174C b _080C174C
.pool .pool
_080C1740: _080C1740:
bl sub_809D42C bl IsNationalPokedexEnabled
ldr r6, =gUnknown_0856ED9C ldr r6, =gUnknown_0856ED9C
cmp r0, 0 cmp r0, 0
bne _080C174C bne _080C174C
@ -11594,7 +11594,7 @@ _080C178C:
ldr r4, =gSaveBlock2Ptr ldr r4, =gSaveBlock2Ptr
ldr r1, [r4] ldr r1, [r4]
strb r0, [r1, 0x19] strb r0, [r1, 0x19]
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080C17E8 bne _080C17E8
ldr r1, [r4] ldr r1, [r4]
@ -12368,7 +12368,7 @@ _080C1E94:
b _080C1EC4 b _080C1EC4
.pool .pool
_080C1EA4: _080C1EA4:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080C1ED0 bne _080C1ED0
ldr r2, =gUnknown_0856ED48 ldr r2, =gUnknown_0856ED48
@ -12722,7 +12722,7 @@ sub_80C20F8: @ 80C20F8
movs r1, 0x2D movs r1, 0x2D
movs r2, 0x41 movs r2, 0x41
bl sub_80C1270 bl sub_80C1270
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _080C21B6 beq _080C21B6
ldrh r0, [r5, 0xE] ldrh r0, [r5, 0xE]

View File

@ -4893,7 +4893,7 @@ sub_806E3C0: @ 806E3C0
push {r4,lr} push {r4,lr}
lsls r0, 16 lsls r0, 16
lsrs r4, r0, 16 lsrs r4, r0, 16
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _0806E3DA beq _0806E3DA
adds r0, r4, 0 adds r0, r4, 0

View File

@ -1376,7 +1376,7 @@ _080850C8:
bl set_current_map_header_from_sav1_save_old_name bl set_current_map_header_from_sav1_save_old_name
bl CopyFieldObjectTemplatesToSav1 bl CopyFieldObjectTemplatesToSav1
bl sav2_set_x9_depending_on_sav1_map bl sav2_set_x9_depending_on_sav1_map
bl sub_809D344 bl ClearTempFieldEventData
bl wild_pokemon_reroll bl wild_pokemon_reroll
bl prev_quest_postbuffer_cursor_backup_reset bl prev_quest_postbuffer_cursor_backup_reset
adds r0, r6, 0 adds r0, r6, 0
@ -1464,7 +1464,7 @@ _080851A2:
lsrs r6, r0, 24 lsrs r6, r0, 24
bl sub_80EB218 bl sub_80EB218
bl sav2_set_x9_depending_on_sav1_map bl sav2_set_x9_depending_on_sav1_map
bl sub_809D344 bl ClearTempFieldEventData
bl wild_pokemon_reroll bl wild_pokemon_reroll
bl prev_quest_postbuffer_cursor_backup_reset bl prev_quest_postbuffer_cursor_backup_reset
ldr r0, =gSaveBlock1Ptr ldr r0, =gSaveBlock1Ptr

View File

@ -4432,7 +4432,7 @@ _08137A70:
_08137A80: _08137A80:
ldr r1, =gUnknown_020375E4 ldr r1, =gUnknown_020375E4
strh r0, [r1] strh r0, [r1]
bl sub_809D42C bl IsNationalPokedexEnabled
lsls r0, 16 lsls r0, 16
lsrs r0, 16 lsrs r0, 16
pop {r1} pop {r1}

View File

@ -34000,7 +34000,7 @@ _081970A2:
adds r1, r7, 0 adds r1, r7, 0
bl StringExpandPlaceholders bl StringExpandPlaceholders
adds r5, r0, 0 adds r5, r0, 0
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _08197156 beq _08197156
strb r6, [r5] strb r6, [r5]
@ -40566,7 +40566,7 @@ _0819A398:
b _0819A43C b _0819A43C
.pool .pool
_0819A3A8: _0819A3A8:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _0819A3B8 beq _0819A3B8
movs r0, 0x1 movs r0, 0x1

View File

@ -3578,7 +3578,7 @@ _0807912C:
cmp r0, 0 cmp r0, 0
beq _08079158 beq _08079158
_08079138: _08079138:
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _08079164 bne _08079164
ldr r0, =gUnknown_0203229C ldr r0, =gUnknown_0203229C
@ -6142,7 +6142,7 @@ _0807A60C:
cmp r5, r7 cmp r5, r7
blt _0807A60C blt _0807A60C
_0807A62E: _0807A62E:
bl sub_809D42C bl IsNationalPokedexEnabled
mov r1, r9 mov r1, r9
lsls r4, r1, 2 lsls r4, r1, 2
cmp r0, 0 cmp r0, 0

View File

@ -1921,7 +1921,7 @@ _080C3740:
thumb_func_start sub_80C376C thumb_func_start sub_80C376C
sub_80C376C: @ 80C376C sub_80C376C: @ 80C376C
push {lr} push {lr}
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
bne _080C377E bne _080C377E
movs r0, 0x1 movs r0, 0x1

View File

@ -3321,7 +3321,7 @@ _080EDB9C:
cmp r6, r0 cmp r6, r0
bls _080EDB88 bls _080EDB88
strb r5, [r4, 0x4] strb r5, [r4, 0x4]
bl sub_809D42C bl IsNationalPokedexEnabled
cmp r0, 0 cmp r0, 0
beq _080EDBCC beq _080EDBCC
movs r0, 0x1 movs r0, 0x1

View File

@ -16,6 +16,11 @@
#define BATTLE_TYPE_KYOGRE_GROUDON 0x1000 #define BATTLE_TYPE_KYOGRE_GROUDON 0x1000
#define BATTLE_TYPE_LEGENDARY 0x2000 #define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_REGI 0x4000 #define BATTLE_TYPE_REGI 0x4000
#define BATTLE_TYPE_TWO_VS_ONE 0x8000
#define BATTLE_TYPE_RECORDED 0x1000000
#define BATTLE_TYPE_GROUDON 0x10000000
#define BATTLE_TYPE_KYORGE 0x20000000
#define BATTLE_TYPE_RAYQUAZA 0x40000000
#define AI_ACTION_UNK1 0x0001 #define AI_ACTION_UNK1 0x0001
#define AI_ACTION_UNK2 0x0002 #define AI_ACTION_UNK2 0x0002

44
include/event_data.h Normal file
View File

@ -0,0 +1,44 @@
#ifndef GUARD_EVENT_DATA_H
#define GUARD_EVENT_DATA_H
#include "flags.h"
#include "vars.h"
void InitEventData(void);
void ClearTempFieldEventData(void);
void ClearUpperFlags(void);
void DisableNationalPokedex(void);
void EnableNationalPokedex(void);
bool32 IsNationalPokedexEnabled(void);
void DisableMysteryGift(void);
void EnableMysteryGift(void);
bool32 IsMysteryGiftEnabled(void);
void DisableResetRTC(void);
void EnableResetRTC(void);
bool32 CanResetRTC(void);
u16 *GetVarPointer(u16 id);
u16 VarGet(u16 id);
bool8 VarSet(u16 id, u16 value);
u8 VarGetFieldObjectGraphicsId(u8 id);
u8 *GetFlagPointer(u16 id);
u8 FlagSet(u16 id);
u8 FlagReset(u16 id);
bool8 FlagGet(u16 id);
extern u16 gSpecialVar_0x8000;
extern u16 gSpecialVar_0x8001;
extern u16 gSpecialVar_0x8002;
extern u16 gSpecialVar_0x8003;
extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
extern u16 gSpecialVar_0x8006;
extern u16 gSpecialVar_0x8007;
extern u16 gSpecialVar_0x8008;
extern u16 gSpecialVar_0x8009;
extern u16 gSpecialVar_0x800A;
extern u16 gSpecialVar_0x800B;
extern u16 gScriptResult;
extern u16 gScriptLastTalked;
extern u16 gScriptFacing;
#endif // GUARD_EVENT_DATA_H

89
include/flags.h Normal file
View File

@ -0,0 +1,89 @@
#ifndef GUARD_FLAGS_H
#define GUARD_FLAGS_H
#define TRAINER_FLAG_START 0x500
// SYSTEM FLAGS
#define SYS_POKEMON_GET 0x800
#define SYS_POKEDEX_GET 0x801
#define SYS_POKENAV_GET 0x802
#define SYS_GAME_CLEAR 0x804
#define SYS_CHAT_USED 0x805
#define SYS_HIPSTER_MEET 0x806
// badges
#define BADGE01_GET 0x807
#define BADGE02_GET 0x808
#define BADGE03_GET 0x809
#define BADGE04_GET 0x80A
#define BADGE05_GET 0x80B
#define BADGE06_GET 0x80C
#define BADGE07_GET 0x80D
#define BADGE08_GET 0x80E
// cities and towns
#define FLAG_VISITED_LITTLEROOT_TOWN 0x80F
#define FLAG_VISITED_OLDALE_TOWN 0x810
#define FLAG_VISITED_DEWFORD_TOWN 0x811
#define FLAG_VISITED_LAVARIDGE_TOWN 0x812
#define FLAG_VISITED_FALLARBOR_TOWN 0x813
#define FLAG_VISITED_VERDANTURF_TOWN 0x814
#define FLAG_VISITED_PACIFIDLOG_TOWN 0x815
#define FLAG_VISITED_PETALBURG_CITY 0x816
#define FLAG_VISITED_SLATEPORT_CITY 0x817
#define FLAG_VISITED_MAUVILLE_CITY 0x818
#define FLAG_VISITED_RUSTBORO_CITY 0x819
#define FLAG_VISITED_FORTREE_CITY 0x81A
#define FLAG_VISITED_LILYCOVE_CITY 0x81B
#define FLAG_VISITED_MOSSDEEP_CITY 0x81C
#define FLAG_VISITED_SOOTOPOLIS_CITY 0x81D
#define FLAG_VISITED_EVER_GRANDE_CITY 0x81E
#define SYS_USE_FLASH 0x828
#define SYS_USE_STRENGTH 0x829
#define SYS_WEATHER_CTRL 0x82A
#define SYS_CYCLING_ROAD 0x82B
#define SYS_SAFARI_MODE 0x82C
#define SYS_CRUISE_MODE 0x82D
#define SYS_TV_HOME 0x830
#define SYS_TV_WATCH 0x831
#define SYS_TV_START 0x832
#define SYS_POPWORD_INPUT 0x833
#define SYS_MIX_RECORD 0x834
#define SYS_CLOCK_SET 0x835
#define SYS_NATIONAL_DEX 0x836
#define SYS_CAVE_SHIP 0x837
#define SYS_CAVE_WONDER 0x838
#define SYS_CAVE_BATTLE 0x839
#define SYS_SHOAL_TIDE 0x83A
#define SYS_RIBBON_GET 0x83B
#define FLAG_UNLOCK_BATTLE_TOWER 0x848
#define FLAG_UNLOCK_SOUTHERN_ISLAND 0x849
#define SYS_PC_LANETTE 0x84B
#define SYS_EXDATA_ENABLE 0x84C
#define SYS_ENC_UP_ITEM 0x84D
#define SYS_ENC_DOWN_ITEM 0x84E
#define SYS_BRAILLE_DIG 0x84F
#define SYS_BRAILLE_STRENGTH 0x850
#define SYS_BRAILLE_WAIT 0x851
#define SYS_BRAILLE_FLY 0x852
#define SYS_HAS_EON_TICKET 0x853
#define SYS_POKEMON_LEAGUE_FLY 0x854
#define SYS_TV_LATI 0x85D
#define SYS_SHOAL_ITEM 0x85F
#define SYS_B_DASH 0x860 // got Running Shoes
#define SYS_CTRL_OBJ_DELETE 0x861
#define SYS_RESET_RTC_ENABLE 0x862
// SPECIAL FLAGS (unknown purpose)
#define SPECIAL_FLAG_1 0x4001
#endif // GUARD_FLAGS_H

56
include/game_stat.h Normal file
View File

@ -0,0 +1,56 @@
#ifndef GUARD_GAME_STAT_H
#define GUARD_GAME_STAT_H
#define GAME_STAT_SAVED_GAME 0
#define GAME_STAT_FIRST_HOF_PLAY_TIME 1
#define GAME_STAT_STARTED_TRENDS 2
#define GAME_STAT_PLANTED_BERRIES 3
#define GAME_STAT_TRADED_BIKES 4
#define GAME_STAT_STEPS 5
#define GAME_STAT_GOT_INTERVIEWED 6
#define GAME_STAT_TOTAL_BATTLES 7
#define GAME_STAT_WILD_BATTLES 8
#define GAME_STAT_TRAINER_BATTLES 9
#define GAME_STAT_ENTERED_HOF 10
#define GAME_STAT_POKEMON_CAPTURES 11
#define GAME_STAT_FISHING_CAPTURES 12
#define GAME_STAT_HATCHED_EGGS 13
#define GAME_STAT_EVOLVED_POKEMON 14
#define GAME_STAT_USED_POKECENTER 15
#define GAME_STAT_RESTED_AT_HOME 16
#define GAME_STAT_ENTERED_SAFARI_ZONE 17
#define GAME_STAT_USED_CUT 18
#define GAME_STAT_USED_ROCK_SMASH 19
#define GAME_STAT_MOVED_SECRET_BASE 20
#define GAME_STAT_POKEMON_TRADES 21
#define GAME_STAT_UNKNOWN_22 22
#define GAME_STAT_LINK_BATTLE_WINS 23
#define GAME_STAT_LINK_BATTLE_LOSSES 24
#define GAME_STAT_LINK_BATTLE_DRAWS 25
#define GAME_STAT_USED_SPLASH 26
#define GAME_STAT_USED_STRUGGLE 27
#define GAME_STAT_SLOT_JACKPOTS 28
#define GAME_STAT_CONSECUTIVE_ROULETTE_WINS 29
#define GAME_STAT_ENTERED_BATTLE_TOWER 30
#define GAME_STAT_UNKNOWN_31 31
#define GAME_STAT_BATTLE_TOWER_BEST_STREAK 32
#define GAME_STAT_POKEBLOCKS 33
#define GAME_STAT_POKEBLOCKS_WITH_FRIENDS 34
#define GAME_STAT_WON_LINK_CONTEST 35
#define GAME_STAT_ENTERED_CONTEST 36
#define GAME_STAT_WON_CONTEST 37
#define GAME_STAT_SHOPPED 38
#define GAME_STAT_USED_ITEMFINDER 39
#define GAME_STAT_GOT_RAINED_ON 40
#define GAME_STAT_CHECKED_POKEDEX 41
#define GAME_STAT_RECEIVED_RIBBONS 42
#define GAME_STAT_JUMPED_DOWN_LEDGES 43
#define GAME_STAT_WATCHED_TV 44
#define GAME_STAT_CHECKED_CLOCK 45
#define GAME_STAT_WON_POKEMON_LOTTERY 46
#define GAME_STAT_USED_DAYCARE 47
#define GAME_STAT_RODE_CABLE_CAR 48
#define GAME_STAT_ENTERED_HOT_SPRINGS 49
#define NUM_GAME_STATS 50
#endif // GUARD_GAME_STAT_H

57
include/global.berry.h Normal file
View File

@ -0,0 +1,57 @@
#ifndef GUARD_GLOBAL_BERRY_H
#define GUARD_GLOBAL_BERRY_H
struct Berry
{
const u8 name[7];
u8 firmness;
u16 size;
u8 maxYield;
u8 minYield;
const u8 *description1;
const u8 *description2;
u8 stageDuration;
u8 spicy;
u8 dry;
u8 sweet;
u8 bitter;
u8 sour;
u8 smoothness;
};
struct EnigmaBerry
{
struct Berry berry;
u8 pic[(6 * 6) * TILE_SIZE_4BPP];
u16 palette[16];
u8 description1[45];
u8 description2[45];
u8 itemEffect[18];
u8 holdEffect;
u8 holdEffectParam;
u32 checksum;
};
struct BattleEnigmaBerry
{
/*0x00*/ u8 name[7];
/*0x07*/ u8 holdEffect;
/*0x08*/ u8 itemEffect[18];
/*0x1A*/ u8 holdEffectParam;
};
struct BerryTree
{
u8 berry;
u8 stage:7;
u8 growthSparkle:1;
u16 minutesUntilNextStage;
u8 berryYield;
u8 regrowthCount:4;
u8 watered1:1;
u8 watered2:1;
u8 watered3:1;
u8 watered4:1;
};
#endif // GUARD_GLOBAL_BERRY_H

389
include/global.fieldmap.h Normal file
View File

@ -0,0 +1,389 @@
#ifndef GUARD_GLOBAL_FIELDMAP_H
#define GUARD_GLOBAL_FIELDMAP_H
enum
{
CONNECTION_SOUTH = 1,
CONNECTION_NORTH,
CONNECTION_WEST,
CONNECTION_EAST,
CONNECTION_DIVE,
CONNECTION_EMERGE
};
// map types
enum
{
MAP_TYPE_0,
MAP_TYPE_TOWN,
MAP_TYPE_CITY,
MAP_TYPE_ROUTE,
MAP_TYPE_UNDERGROUND,
MAP_TYPE_UNDERWATER,
MAP_TYPE_6,
MAP_TYPE_7,
MAP_TYPE_INDOOR,
MAP_TYPE_SECRET_BASE
};
// map battle scenes
enum
{
MAP_BATTLE_SCENE_NORMAL, // 0
MAP_BATTLE_SCENE_GYM, // 1
MAP_BATTLE_SCENE_MAGMA, // 2
MAP_BATTLE_SCENE_AQUA, // 3
MAP_BATTLE_SCENE_SIDNEY, // 4
MAP_BATTLE_SCENE_PHOEBE, // 5
MAP_BATTLE_SCENE_GLACIA, // 6
MAP_BATTLE_SCENE_DRAKE, // 7
MAP_BATTLE_SCENE_BATTLE_TOWER, // 8
};
typedef void (*TilesetCB)(void);
struct Tileset
{
/*0x00*/ bool8 isCompressed;
/*0x01*/ bool8 isSecondary;
/*0x04*/ void *tiles;
/*0x08*/ void *palettes;
/*0x0c*/ void *metatiles;
/*0x10*/ void *metatileAttributes;
/*0x14*/ TilesetCB callback;
};
struct MapData
{
/*0x00*/ s32 width;
/*0x04*/ s32 height;
/*0x08*/ u16 *border;
/*0x0c*/ u16 *map;
/*0x10*/ struct Tileset *primaryTileset;
/*0x14*/ struct Tileset *secondaryTileset;
};
struct BackupMapData
{
s32 width;
s32 height;
u16 *map;
};
struct MapObjectTemplate
{
/*0x00*/ u8 localId;
/*0x01*/ u8 graphicsId;
/*0x02*/ u8 unk2;
/*0x04*/ s16 x;
/*0x06*/ s16 y;
/*0x08*/ u8 elevation;
/*0x09*/ u8 movementType;
/*0x0A*/ u8 unkA_0:4;
u8 unkA_4:4;
///*0x0B*/ u8 fillerB[1];
/*0x0C*/ u16 unkC;
/*0x0E*/ u16 unkE;
/*0x10*/ u8 *script;
/*0x14*/ u16 flagId;
/*0x16*/ u8 filler_16[2];
}; /*size = 0x18*/
struct WarpEvent
{
s16 x, y;
s8 warpId;
u8 mapGroup;
u8 mapNum;
u8 unk7;
};
struct CoordEvent
{
s16 x, y;
u8 unk4;
u8 filler_5;
u16 trigger;
u16 index;
u8 filler_A[0x2];
u8 *script;
};
struct BgEvent
{
u16 x, y;
u8 unk4;
u8 kind;
// 0x2 padding for the union beginning.
union { // carried over from diego's FR/LG work, seems to be the same struct
// in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union.
u8 *script;
// hidden item type probably
struct {
u8 filler6[0x2];
u16 hiddenItemId; // flag offset to determine flag lookup
} hiddenItem;
// secret base type
u32 secretBaseId;
} bgUnion;
};
struct MapEvents
{
u8 mapObjectCount;
u8 warpCount;
u8 coordEventCount;
u8 bgEventCount;
struct MapObjectTemplate *mapObjects;
struct WarpEvent *warps;
struct CoordEvent *coordEvents;
struct BgEvent *bgEvents;
};
struct MapConnection
{
/*0x00*/ u8 direction;
/*0x01*/ u32 offset;
/*0x05*/ u8 mapGroup;
/*0x06*/ u8 mapNum;
};
struct MapConnections
{
s32 count;
struct MapConnection *connections;
};
struct MapHeader
{
/* 0x00 */ struct MapData *mapData;
/* 0x04 */ struct MapEvents *events;
/* 0x08 */ u8 *mapScripts;
/* 0x0C */ struct MapConnections *connections;
/* 0x10 */ u16 music;
/* 0x12 */ u16 mapDataId;
/* 0x14 */ u8 regionMapSectionId;
/* 0x15 */ u8 cave;
/* 0x16 */ u8 weather;
/* 0x17 */ u8 mapType;
/* 0x18 */ u8 filler_18;
/* 0x19 */ u8 escapeRope;
/* 0x1A */ u8 flags;
/* 0x1B */ u8 battleType;
};
struct MapObject
{
/*0x00*/ u32 active:1;
u32 mapobj_bit_1:1;
u32 mapobj_bit_2:1;
u32 mapobj_bit_3:1;
u32 mapobj_bit_4:1;
u32 mapobj_bit_5:1;
u32 mapobj_bit_6:1;
u32 mapobj_bit_7:1;
/*0x01*/ u32 mapobj_bit_8:1;
u32 mapobj_bit_9:1;
u32 mapobj_bit_10:1;
u32 mapobj_bit_11:1;
u32 mapobj_bit_12:1;
u32 mapobj_bit_13:1;
u32 mapobj_bit_14:1;
u32 mapobj_bit_15:1;
/*0x02*/ u32 mapobj_bit_16:1;
u32 mapobj_bit_17:1;
u32 mapobj_bit_18:1;
u32 mapobj_bit_19:1;
u32 mapobj_bit_20:1;
u32 mapobj_bit_21:1;
u32 mapobj_bit_22:1;
u32 mapobj_bit_23:1;
/*0x03*/ u32 mapobj_bit_24:1;
u32 mapobj_bit_25:1;
u32 mapobj_bit_26:1;
u32 mapobj_bit_27:1;
u32 mapobj_bit_28:1;
u32 mapobj_bit_29:1;
u32 mapobj_bit_30:1;
u32 mapobj_bit_31:1;
/*0x04*/ u8 spriteId;
/*0x05*/ u8 graphicsId;
/*0x06*/ u8 animPattern;
/*0x07*/ u8 trainerType;
/*0x08*/ u8 localId;
/*0x09*/ u8 mapNum;
/*0x0A*/ u8 mapGroup;
/*0x0B*/ u8 mapobj_unk_0B_0:4;
u8 elevation:4;
/*0x0C*/ struct Coords16 coords1;
/*0x10*/ struct Coords16 coords2;
/*0x14*/ struct Coords16 coords3;
/*0x18*/ u8 mapobj_unk_18:4; //current direction?
/*0x18*/ u8 placeholder18:4;
/*0x19*/ u8 mapobj_unk_19;
/*0x1A*/ u8 mapobj_unk_1A;
/*0x1B*/ u8 mapobj_unk_1B;
/*0x1C*/ u8 mapobj_unk_1C;
/*0x1D*/ u8 trainerRange_berryTreeId;
/*0x1E*/ u8 mapobj_unk_1E;
/*0x1F*/ u8 mapobj_unk_1F;
/*0x20*/ u8 mapobj_unk_20;
/*0x21*/ u8 mapobj_unk_21;
/*0x22*/ u8 animId;
/*size = 0x24*/
};
// THIS IS NEEDED TO MAKE TRAINER_SEE.C MATCH, PLEASE DO NOT REMOVE UNLESS YOU FIX CHECKPATHBETWEENTRAINERANDPLAYER
struct MapObject2
{
/*0x00*/ u32 active:1;
u32 mapobj_bit_1:1;
u32 mapobj_bit_2:1;
u32 mapobj_bit_3:1;
u32 mapobj_bit_4:1;
u32 mapobj_bit_5:1;
u32 mapobj_bit_6:1;
u32 mapobj_bit_7:1;
/*0x01*/ u32 mapobj_bit_8:1;
u32 mapobj_bit_9:1;
u32 mapobj_bit_10:1;
u32 mapobj_bit_11:1;
u32 mapobj_bit_12:1;
u32 mapobj_bit_13:1;
u32 mapobj_bit_14:1;
u32 mapobj_bit_15:1;
/*0x02*/ u32 mapobj_bit_16:1;
u32 mapobj_bit_17:1;
u32 mapobj_bit_18:1;
u32 mapobj_bit_19:1;
u32 mapobj_bit_20:1;
u32 mapobj_bit_21:1;
u32 mapobj_bit_22:1;
u32 mapobj_bit_23:1;
/*0x03*/ u32 mapobj_bit_24:1;
u32 mapobj_bit_25:1;
u32 mapobj_bit_26:1;
u32 mapobj_bit_27:1;
u32 mapobj_bit_28:1;
u32 mapobj_bit_29:1;
u32 mapobj_bit_30:1;
u32 mapobj_bit_31:1;
/*0x04*/ u8 spriteId;
/*0x05*/ u8 graphicsId;
/*0x06*/ u8 animPattern;
/*0x07*/ u8 trainerType;
/*0x08*/ u8 localId;
/*0x09*/ u8 mapNum;
/*0x0A*/ u8 mapGroup;
/*0x0B*/ u8 mapobj_unk_0B_0:4;
u8 elevation:4;
/*0x0C*/ struct Coords16 coords1;
/*0x10*/ struct Coords16 coords2;
/*0x14*/ struct Coords16 coords3;
/*0x18*/ u8 mapobj_unk_18:4;
/*0x18*/ u8 placeholder18:4;
/*0x19*/ u8 mapobj_unk_19:4;
/*0x19*/ u8 mapobj_unk_19b:4;
/*0x1A*/ u8 mapobj_unk_1A;
/*0x1B*/ u8 mapobj_unk_1B;
/*0x1C*/ u8 mapobj_unk_1C;
/*0x1D*/ u8 trainerRange_berryTreeId;
/*0x1E*/ u8 mapobj_unk_1E;
/*0x1F*/ u8 mapobj_unk_1F;
/*0x20*/ u8 mapobj_unk_20;
/*0x21*/ u8 mapobj_unk_21;
/*size = 0x24*/
};
struct MapObjectGraphicsInfo
{
/*0x00*/ u16 tileTag;
/*0x02*/ u16 paletteTag1;
/*0x04*/ u16 paletteTag2;
/*0x06*/ u16 size;
/*0x08*/ s16 width;
/*0x0A*/ s16 height;
/*0x0C*/ u8 paletteSlot:4;
u8 shadowSize:2;
u8 inanimate:1;
u8 disableReflectionPaletteLoad:1;
/*0x0D*/ u8 tracks;
/*0x10*/ const struct OamData *oam;
/*0x14*/ const struct SubspriteTable *subspriteTables;
/*0x18*/ const union AnimCmd *const *anims;
/*0x1C*/ const struct SpriteFrameImage *images;
/*0x20*/ const union AffineAnimCmd *const *affineAnims;
};
#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1)
#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2)
#define PLAYER_AVATAR_FLAG_SURFING (1 << 3)
#define PLAYER_AVATAR_FLAG_4 (1 << 4)
#define PLAYER_AVATAR_FLAG_5 (1 << 5)
#define PLAYER_AVATAR_FLAG_6 (1 << 6)
#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
enum
{
ACRO_BIKE_NORMAL,
ACRO_BIKE_TURNING,
ACRO_BIKE_WHEELIE_STANDING,
ACRO_BIKE_BUNNY_HOP,
ACRO_BIKE_WHEELIE_MOVING,
ACRO_BIKE_STATE5,
ACRO_BIKE_STATE6,
};
enum
{
DIR_NONE,
DIR_SOUTH,
DIR_NORTH,
DIR_WEST,
DIR_EAST,
};
enum
{
COLLISION_LEDGE_JUMP = 6
};
struct PlayerAvatar /* 0x202E858 */
{
/*0x00*/ u8 flags;
/*0x01*/ u8 bike;
/*0x02*/ u8 running2;
/*0x03*/ u8 running1;
/*0x04*/ u8 spriteId;
/*0x05*/ u8 mapObjectId;
/*0x06*/ u8 unk6;
/*0x07*/ u8 gender;
u8 acroBikeState;
u8 unk9;
u8 bikeFrameCounter;
u8 unkB;
u32 unkC;
u32 unk10;
u8 unk14[8];
u8 unk1C[8];
// TODO: rest of struct
};
struct Camera
{
bool8 field_0:1;
s32 x;
s32 y;
};
extern struct MapObject gMapObjects[];
extern u8 gSelectedMapObject;
extern struct MapHeader gMapHeader;
extern struct PlayerAvatar gPlayerAvatar;
#endif // GUARD_GLOBAL_FIELDMAP_H

View File

@ -108,6 +108,544 @@ struct SaveBlock2
extern struct SaveBlock2 *gSaveBlock2Ptr; extern struct SaveBlock2 *gSaveBlock2Ptr;
struct SecretBaseRecord
{
/*ID?*/ /*0x1A08*/ u8 sbr_field_0;
/*0x1A09*/ u8 sbr_field_1_0:4;
/*0x1A09*/ u8 gender:1;
/*0x1A09*/ u8 sbr_field_1_5:1;
/*0x1A09*/ u8 sbr_field_1_6:2;
/*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes?
/*0x1A12*/ u8 trainerId[4]; // byte 0 is used for determining trainer class
/*0x1A16*/ u16 sbr_field_e;
/*0x1A18*/ u8 sbr_field_10;
/*0x1A19*/ u8 sbr_field_11;
/*0x1A1A*/ u8 decorations[16];
/*0x1A2A*/ u8 decorationPos[16];
/*0x1A3A*/ u32 partyPersonality[6];
/*0x1A54*/ u16 partyMoves[6 * 4];
/*0x1A84*/ u16 partySpecies[6];
/*0x1A90*/ u16 partyHeldItems[6];
/*0x1A9C*/ u8 partyLevels[6];
/*0x1AA2*/ u8 partyEVs[6];
};
#include "game_stat.h"
#include "global.fieldmap.h"
#include "global.berry.h"
#include "pokemon.h"
struct WarpData
{
s8 mapGroup;
s8 mapNum;
s8 warpId;
s16 x, y;
};
struct ItemSlot
{
u16 itemId;
u16 quantity;
};
struct Pokeblock
{
u8 color;
u8 spicy;
u8 dry;
u8 sweet;
u8 bitter;
u8 sour;
u8 feel;
};
struct Roamer
{
/*0x00*/ u32 ivs;
/*0x04*/ u32 personality;
/*0x08*/ u16 species;
/*0x0A*/ u16 hp;
/*0x0C*/ u8 level;
/*0x0D*/ u8 status;
/*0x0E*/ u8 cool;
/*0x0F*/ u8 beauty;
/*0x10*/ u8 cute;
/*0x11*/ u8 smart;
/*0x12*/ u8 tough;
/*0x13*/ bool8 active;
/*0x14*/ u8 filler[0x8];
};
struct RamScriptData
{
u8 magic;
u8 mapGroup;
u8 mapNum;
u8 objectId;
u8 script[995];
};
struct RamScript
{
u32 checksum;
struct RamScriptData data;
};
struct SB1_2EFC_Struct
{
u16 var;
u8 unknown[0x1E];
};
struct EasyChatPair
{
u16 unk0_0:7;
u16 unk0_7:7;
u16 unk1_6:1;
u16 unk2;
u16 words[2];
}; /*size = 0x8*/
struct TVShowCommon
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 pad02[20];
/*0x16*/ u16 var16[3];
/*0x1C*/ u8 srcTrainerId3Lo;
/*0x1D*/ u8 srcTrainerId3Hi;
/*0x1E*/ u8 srcTrainerId2Lo;
/*0x1F*/ u8 srcTrainerId2Hi;
/*0x20*/ u8 srcTrainerIdLo;
/*0x21*/ u8 srcTrainerIdHi;
/*0x22*/ u8 trainerIdLo;
/*0x23*/ u8 trainerIdHi;
};
struct TVShowFanClubLetter
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 species;
/*0x04*/ u16 pad04[6];
/*0x10*/ u8 playerName[8];
/*0x18*/ u8 language;
};
struct TVShowRecentHappenings
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 var02;
/*0x04*/ u16 var04[6];
/*0x10*/ u8 playerName[8];
/*0x18*/ u8 language;
/*0x19*/ u8 pad19[10];
};
struct TVShowFanclubOpinions
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 var02;
/*0x04*/ u8 var04A:4;
/*0x04*/ u8 var04B:4;
/*0x05*/ u8 playerName[8];
/*0x0D*/ u8 language;
/*0x0E*/ u8 var0E;
/*0x0F*/ u8 var0F;
/*0x10*/ u8 var10[8];
/*0x18*/ u16 var18[2];
/*0x1C*/ u16 var1C[4];
};
struct TVShowUnknownType04
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 pad02[4];
/*0x06*/ u16 var06;
};
struct TVShowNameRaterShow
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 species;
/*0x04*/ u8 pokemonName[11];
/*0x0F*/ u8 trainerName[11];
/*0x1A*/ u8 random;
/*0x1B*/ u8 random2;
/*0x1C*/ u16 var1C;
/*0x1E*/ u8 language;
/*0x1F*/ u8 pokemonNameLanguage;
};
struct TVShowBravoTrainerPokemonProfiles
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 species;
/*0x04*/ u16 var04[2];
/*0x08*/ u8 pokemonNickname[11];
/*0x13*/ u8 contestCategory:3;
/*0x13*/ u8 contestRank:2;
/*0x13*/ u8 contestResult:2;
/*0x13*/ u8 var13_7:1;
/*0x14*/ u16 var14;
/*0x16*/ u8 playerName[8];
/*0x1E*/ u8 language;
/*0x1F*/ u8 var1f;
};
struct TVShowBravoTrainerBattleTowerSpotlight
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 trainerName[8];
/*0x0A*/ u16 species;
/*0x0C*/ u8 pokemonName[8];
/*0x14*/ u16 defeatedSpecies;
/*0x16*/ u16 var16;
/*0x18*/ u16 var18[1];
/*0x1A*/ u8 btLevel;
/*0x1B*/ u8 var1b;
/*0x1C*/ u8 var1c;
/*0x1D*/ u8 language;
};
struct TVShowPokemonToday
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 language;
/*0x03*/ u8 language2;
/*0x04*/ u8 nickname[11];
/*0x0F*/ u8 ball;
/*0x10*/ u16 species;
/*0x12*/ u8 var12;
/*0x13*/ u8 playerName[8];
};
struct TVShowSmartShopper
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 priceReduced;
/*0x03*/ u8 language;
/*0x04*/ u8 pad04[2];
/*0x06*/ u16 itemIds[3];
/*0x0C*/ u16 itemAmounts[3];
/*0x12*/ u8 shopLocation;
/*0x13*/ u8 playerName[8];
};
struct TVShowPokemonTodayFailed
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 language;
/*0x03*/ u8 pad03[9];
/*0x0c*/ u16 species;
/*0x0e*/ u16 species2;
/*0x10*/ u8 var10;
/*0x11*/ u8 var11;
/*0x12*/ u8 var12;
/*0x13*/ u8 playerName[8];
};
struct TVShowPokemonAngler
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 var02;
/*0x03*/ u8 var03;
/*0x04*/ u16 var04;
/*0x06*/ u8 language;
u8 pad07[12];
/*0x13*/ u8 playerName[8];
};
struct TVShowWorldOfMasters
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u16 var02;
/*0x04*/ u16 var04;
/*0x06*/ u16 var06;
/*0x08*/ u16 var08;
/*0x0a*/ u8 var0a;
/*0x0b*/ u8 language;
u8 pad0c[7];
/*0x13*/ u8 playerName[8];
};
struct TVShowMassOutbreak
{
/*0x00*/ u8 var00;
/*0x01*/ u8 var01;
/*0x02*/ u8 var02;
/*0x03*/ u8 var03;
/*0x04*/ u16 moves[4];
/*0x0C*/ u16 species;
/*0x0E*/ u16 var0E;
/*0x10*/ u8 locationMapNum;
/*0x11*/ u8 locationMapGroup;
/*0x12*/ u8 var12;
/*0x13*/ u8 probability;
/*0x14*/ u8 level;
/*0x15*/ u8 var15;
/*0x16*/ u16 var16;
/*0x18*/ u8 language;
u8 pad19[11];
};
typedef union TVShow
{
struct TVShowCommon common;
struct TVShowFanClubLetter fanclubLetter;
struct TVShowRecentHappenings recentHappenings;
struct TVShowFanclubOpinions fanclubOpinions;
struct TVShowUnknownType04 unkShow04;
struct TVShowNameRaterShow nameRaterShow;
struct TVShowBravoTrainerPokemonProfiles bravoTrainer;
struct TVShowBravoTrainerBattleTowerSpotlight bravoTrainerTower;
struct TVShowPokemonToday pokemonToday;
struct TVShowSmartShopper smartshopperShow;
struct TVShowPokemonTodayFailed pokemonTodayFailed;
struct TVShowPokemonAngler pokemonAngler;
struct TVShowWorldOfMasters worldOfMasters;
struct TVShowMassOutbreak massOutbreak;
} TVShow;
struct MailStruct
{
/*0x00*/ u16 words[9];
/*0x12*/ u8 playerName[8];
/*0x1A*/ u8 trainerId[4];
/*0x1E*/ u16 species;
/*0x20*/ u16 itemId;
};
struct UnkMauvilleOldManStruct
{
u8 unk_2D94;
u8 unk_2D95;
/*0x2D96*/ u16 mauvilleOldMan_ecArray[6];
/*0x2DA2*/ u16 mauvilleOldMan_ecArray2[6];
/*0x2DAE*/ u8 playerName[8];
/*0x2DB6*/ u8 filler_2DB6[0x3];
/*0x2DB9*/ u8 playerTrainerId[4];
u8 unk_2DBD;
}; /*size = 0x2C*/
struct UnkMauvilleOldManStruct2
{
u8 filler0;
u8 unk1;
u8 unk2;
u16 mauvilleOldMan_ecArray[10];
u8 mauvilleOldMan_ecArray2[12];
u8 fillerF[0x2];
}; /*size = 0x2C*/
struct MauvilleOldManTrader
{
u8 unk0;
u8 unk1[4];
u8 unk5[4][11];
u8 unk31;
};
typedef union OldMan
{
struct UnkMauvilleOldManStruct oldMan1;
struct UnkMauvilleOldManStruct2 oldMan2;
struct MauvilleOldManTrader trader;
u8 filler[0x40];
} OldMan;
struct Unk_SB_Access_Struct1
{
u8 filler0[0xF8];
struct SB1_2EFC_Struct sb1_2EFC_struct[5];
};
struct Unk_SB_Access_Struct2
{
/*0x0000*/ struct SB1_2EFC_Struct sb1_2EFC_struct2[12]; // each is 0x20
/*0x2F84*/ u8 filler[0x18];
};
/*0x2E04*/
typedef union SB_Struct
{
struct Unk_SB_Access_Struct1 unkSB1;
struct Unk_SB_Access_Struct2 unkSB2;
} SB_Struct;
// size is 0x198
struct UnknownSaveStruct2ABC
{
u8 val0;
u8 val1;
u16 val2;
};
struct GabbyAndTyData
{
/*2b10*/ u16 mon1;
/*2b12*/ u16 mon2;
/*2b14*/ u16 lastMove;
/*2b16*/ u16 quote;
/*2b18*/ u8 mapnum;
/*2b19*/ u8 battleNum;
/*2b1a*/ u8 valA_0:1;
/*2b1a*/ u8 valA_1:1;
/*2b1a*/ u8 valA_2:1;
/*2b1a*/ u8 valA_3:1;
/*2b1a*/ u8 valA_4:1;
/*2b1a*/ u8 valA_5:3;
/*2b1b*/ u8 valB_0:1;
/*2b1b*/ u8 valB_1:1;
/*2b1b*/ u8 valB_2:1;
/*2b1b*/ u8 valB_3:1;
/*2b1b*/ u8 valB_4:1;
/*2b1b*/ u8 valB_5:3;
};
struct RecordMixing_UnknownStructSub
{
u32 unk0;
u8 data[0x34];
//u8 data[0x38];
};
struct RecordMixing_UnknownStruct
{
struct RecordMixing_UnknownStructSub data[2];
u32 unk70;
u16 unk74[0x2];
};
struct LinkBattleRecord
{
u8 name[8];
u16 trainerId;
u16 wins;
u16 losses;
u16 draws;
};
struct RecordMixingGiftData
{
u8 unk0;
u8 quantity;
u16 itemId;
u8 filler4[8];
};
struct RecordMixingGift
{
int checksum;
struct RecordMixingGiftData data;
};
struct SaveBlock1
{
/*0x00*/ struct Coords16 pos;
/*0x04*/ struct WarpData location;
/*0x0C*/ struct WarpData warp1;
/*0x14*/ struct WarpData warp2;
/*0x1C*/ struct WarpData warp3;
/*0x24*/ struct WarpData warp4;
/*0x2C*/ u16 battleMusic;
/*0x2E*/ u8 weather;
/*0x2F*/ u8 filler_2F;
/*0x30*/ u8 flashUsed;
/*0x32*/ u16 mapDataId;
/*0x34*/ u16 mapView[0x100];
/*0x234*/ u8 playerPartyCount;
/*0x238*/ struct Pokemon playerParty[6];
/*0x490*/ u32 money;
/*0x494*/ u16 coins;
/*0x496*/ u16 registeredItem; // registered for use with SELECT button
/*0x498*/ struct ItemSlot pcItems[50];
/*0x560*/ struct ItemSlot bagPocket_Items[30];
/*0x5D8*/ struct ItemSlot bagPocket_KeyItems[30];
/*0x650*/ struct ItemSlot bagPocket_PokeBalls[16];
/*0x690*/ struct ItemSlot bagPocket_TMHM[64];
/*0x790*/ struct ItemSlot bagPocket_Berries[46];
/*0x848*/ struct Pokeblock pokeblocks[40];
/*0x988*/ u8 seen1[52];
/*0x9BC*/ u16 berryBlenderRecords[3];
/*0x9C2*/ u8 field_9C2[6];
/*0x9C8*/ u16 trainerRematchStepCounter;
/*0x9CA*/ u8 trainerRematches[100];
/*0xA30*/ struct MapObject mapObjects[16];
/*0xC70*/ struct MapObjectTemplate mapObjectTemplates[64];
/*0x1270*/ u8 flags[300];
/*0x139C*/ u16 vars[256];
// TODO: FIX BELOW
/*0x1540*/ u32 gameStats[NUM_GAME_STATS];
/*0x1608*/ struct BerryTree berryTrees[128];
/*0x1A08*/ struct SecretBaseRecord secretBases[20];
/*0x2688*/ u8 playerRoomDecor[12];
/*0x2694*/ u8 playerRoomDecorPos[12];
/*0x26A0*/ u8 decorDesk[10];
/*0x26AA*/ u8 decorChair[10];
/*0x26B4*/ u8 decorPlant[10];
/*0x26BE*/ u8 decorOrnament[30];
/*0x26DC*/ u8 decorMat[30];
/*0x26FA*/ u8 decorPoster[10];
/*0x2704*/ u8 decorDoll[40];
/*0x272C*/ u8 decorCushion[10];
/*0x2736*/ u8 padding_2736[2];
/*0x2738*/ TVShow tvShows[25];
/*0x2ABC*/ struct UnknownSaveStruct2ABC unknown_2ABC[16];
/*0x2AFC*/ u16 outbreakPokemonSpecies;
/*0x2AFE*/ u8 outbreakLocationMapNum;
/*0x2AFF*/ u8 outbreakLocationMapGroup;
/*0x2B00*/ u8 outbreakPokemonLevel;
/*0x2B01*/ u8 outbreakUnk1;
/*0x2B02*/ u16 outbreakUnk2;
/*0x2B04*/ u16 outbreakPokemonMoves[4];
/*0x2B0C*/ u8 outbreakUnk4;
/*0x2B0D*/ u8 outbreakPokemonProbability;
/*0x2B0E*/ u16 outbreakUnk5;
/*0x2B10*/ struct GabbyAndTyData gabbyAndTyData;
/*0x2B1C*/ u16 unk2B1C[6];
/*0x2B28*/ u16 unk2B28[6];
/*0x2B34*/ u16 unk2B34[6];
/*0x2B40*/ u16 unk2B40[6];
/*0x2B4C*/ struct MailStruct mail[16];
/*0x2D8C*/ u8 unk2D8C[4];
/*0x2D90*/ u8 filler_2D90[0x4];
/*0x2D94*/ OldMan oldMan;
/*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff
/*0x2DFC*/ u8 filler_2DFC[0x8];
/*0x2E04*/ SB_Struct sbStruct;
/*0x2F9C*/ struct BoxPokemon daycareData[2];
/*0x303C*/ struct RecordMixing_UnknownStruct filler_303C;
/*0x30AC*/ u8 filler_30B4[0x2];
/*0x30B6*/ u8 filler_30B6;
/*0x30B7*/ u8 filler_30B7[1];
/*0x30B8*/ struct LinkBattleRecord linkBattleRecords[5];
/*0x3108*/ u8 filler_3108[8];
/*0x3110*/ u8 giftRibbons[7];
/*0x3117*/ u8 filler_311B[0x2D];
/*0x3144*/ struct Roamer roamer;
/*0x3160*/ struct EnigmaBerry enigmaBerry;
/*0x3690*/ struct RamScript ramScript;
/*0x3A7C*/ struct RecordMixingGift recordMixingGift;
/*0x3A8C*/ u8 unk3A8C[52]; //pokedex related
};
extern struct SaveBlock1* gSaveBlock1Ptr;
struct Bitmap // TODO: Find a better spot for this struct Bitmap // TODO: Find a better spot for this
{ {
u8* pixels; u8* pixels;

53
include/vars.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef GUARD_VARS_H
#define GUARD_VARS_H
#define VAR_0x4000 0x4000
#define VAR_0x4001 0x4001
#define VAR_0x4002 0x4002
#define VAR_0x4003 0x4003
#define VAR_0x4004 0x4004
#define VAR_0x4005 0x4005
#define VAR_0x4006 0x4006
#define VAR_0x4007 0x4007
#define VAR_0x4008 0x4008
#define VAR_0x4009 0x4009
#define VAR_0x400A 0x400A
#define VAR_0x401F 0x401F
#define VAR_RECYCLE_GOODS 0x4020
#define VAR_REPEL_STEP_COUNT 0x4021
#define VAR_ICE_STEP_COUNT 0x4022
#define VAR_FIRST_POKE 0x4023
#define VAR_MIRAGE_RND_H 0x4024
#define VAR_MIRAGE_RND_L 0x4025
#define VAR_SECRET_BASE_MAP 0x4026
#define VAR_HAPPINESS_STEP_COUNTER 0x402A
#define VAR_POISON_STEP_COUNTER 0x402B
#define VAR_RESET_RTC_ENABLE 0x402C
#define VAR_DAYS 0x4040
#define VAR_DEPT_STORE_FLOOR 0x4043
#define VAR_POKELOT_PRIZE 0x4045
#define VAR_NATIONAL_DEX 0x4046
#define VAR_SHROOMISH_SIZE_RECORD 0x4047
#define VAR_ASH_GATHER_COUNT 0x4048
#define VAR_BIRCH_STATE 0x4049
#define VAR_CRUISE_STEP_COUNT 0x404A
#define VAR_POKELOT_RND1 0x404B
#define VAR_POKELOT_RND2 0x404C
#define VAR_BARBOACH_SIZE_RECORD 0x404F
#define VAR_0x4054 0x4054
#define VAR_0x4089 0x4089
#define VAR_0x4095 0x4095
#define VAR_0x4097 0x4097
#define VAR_0x409a 0x409a
#define VAR_PORTHOLE 0x40B4
#define VAR_0x40BC 0x40BC
#define VAR_0x40C2 0x40C2
#endif // GUARD_VARS_H

View File

@ -93,6 +93,7 @@ SECTIONS {
asm/script.o(.text); asm/script.o(.text);
asm/scrcmd.o(.text); asm/scrcmd.o(.text);
asm/field_control_avatar.o(.text); asm/field_control_avatar.o(.text);
src/event_data.o(.text);
asm/event_data.o(.text); asm/event_data.o(.text);
asm/coord_event_weather.o(.text); asm/coord_event_weather.o(.text);
asm/field_tasks.o(.text); asm/field_tasks.o(.text);

11
src/event_data.c Normal file
View File

@ -0,0 +1,11 @@
#include "global.h"
#include "event_data.h"
extern u8 gUnknown_020375FC[16];
void InitEventData(void)
{
memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags));
memset(gSaveBlock1Ptr->vars, 0, sizeof(gSaveBlock1Ptr->vars));
memset(gUnknown_020375FC, 0, sizeof(gUnknown_020375FC));
}