Skip to content

Commit 83a5f8f

Browse files
committed
game: Update structs and enums
1 parent ea6188f commit 83a5f8f

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

source/game/common_data.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struct __attribute__((packed)) __attribute__((aligned(2))) PlayerData {
1818
int anonymous_f;
1919
int anonymous_g;
2020
u8 anonymous_h[2];
21-
u16 anonymous_i;
22-
u16 anonymous_j;
21+
u16 health_max;
22+
u16 health_current;
2323
char magic_size_type;
2424
char magic;
2525
u16 rupee_count;

source/game/context.h

+16-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,21 @@ struct GlobalContext : State {
259259
u16 field_C2BC;
260260
u8 gap_C2BE[355];
261261
__attribute__((packed)) __attribute__((aligned(1))) u32 field_C421;
262-
u8 gap_C425[163];
262+
u8 gap_C425[7];
263+
void (*player_init)(act::Player*, GlobalContext*, int);
264+
void (*player_update)(act::Player*, GlobalContext*, pad::State*, pad::TouchscreenState*);
265+
void (*player_switch_to_held_state_0)(GlobalContext*, act::Player*);
266+
void (*player_use_fishing_rod)(GlobalContext*);
267+
bool (*player_switch_to_held_state)(GlobalContext*, act::Player*, bool is_gyorg);
268+
void* player_fn_x4;
269+
void* player_switch_to_still;
270+
void* player_fn_x5;
271+
void* player_talk;
272+
void* player_fn_x6;
273+
void* player_fn_x7;
274+
void* player_fn_x8;
275+
void* player_fn_x9;
276+
u8 gap_C460[0x68];
263277
char field_C4C8[4];
264278
u16 field_C4CC;
265279
u8 gap_C4CE[46];
@@ -337,6 +351,7 @@ static_assert(rst::util::OffsetOf(&GlobalContext::ocarina_state) == 0x8366);
337351
static_assert(rst::util::OffsetOf(&GlobalContext::ocarina_song) == 0x836A);
338352
static_assert(rst::util::OffsetOf(&GlobalContext::hide_hud) == 0x825E);
339353
static_assert(rst::util::OffsetOf(&GlobalContext::field_836E) == 0x836E);
354+
static_assert(rst::util::OffsetOf(&GlobalContext::field_C4C8) == 0xC4C8);
340355
static_assert(sizeof(GlobalContext) == 0x11030);
341356

342357
} // namespace game

source/game/player.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct Player : public Actor {
7272
IsUsingZoraBarrier = 0x10,
7373
Unk20 = 0x20,
7474
Unk40 = 0x40,
75-
Unk80 = 0x80,
75+
Dead = 0x80,
7676
Unk100 = 0x100,
7777
Unk200 = 0x200,
7878
Unk400 = 0x400,
@@ -101,6 +101,10 @@ struct Player : public Actor {
101101

102102
enum class Flag2 : u32 {
103103
Moving = 0x20,
104+
// Set when in the "held" state.
105+
Unk40 = 0x40,
106+
// Set when the player can stay in the hold state.
107+
Held = 0x80,
104108
Underwater = 0x400,
105109
TatlFlying = 0x0010'0000,
106110
PlayingIdleAnimation = 0x1000'0000,

0 commit comments

Comments
 (0)