2021-09-15 23:24:19 +00:00
|
|
|
#ifndef Z64_H
|
|
|
|
#define Z64_H
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "ultra64.h"
|
|
|
|
#include "ultra64/gs2dex.h"
|
2023-09-09 14:24:52 +00:00
|
|
|
#include "attributes.h"
|
2023-11-30 21:22:30 +00:00
|
|
|
#include "audiomgr.h"
|
2020-10-11 17:45:08 +00:00
|
|
|
#include "z64save.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64light.h"
|
z_bgcheck.c, 800430A0.c, 80043480.c (#256)
* beginning of migrating changes
* got matching
* changed order a bit
* clean up bgcheck
* fix conflict
* fix conflict again
* first stab at identifying types, some oks
* Clean up most bad structs/pointer math, move relevant structs to z64bgcheck.h, get some OKs
* more OKs, z_bgcheck.bss migration, update some sys_math3d.c args
* couple more OKs
* pushing some OKs
* fix compilation issues
* code_800430A0.c OK, more files decomp'd
* 8003A3E0 big OK :)
* Decomp most of func_8003C614, decomp helper funcs
* Decomp SurfaceType, CamData, and WaterBox property related functions
* more OKs, big OK in 8003C078
* more OKs, more progress, move a function definition in z_collision_check to functions.h
* more clean-ups, more OKs, dyn_vtx is now defined as u8*
* 8003A5B8, 8003A7D8, 8003C614, 8003DD6C OK, document function args better
* data migrated, more OKs
* 80041240 OK, func_8003B3C8 and func_8003BB18 disassembled
* func_80040284, 800409A8 non_matching, add IS_ZERO macro
* All asm files have C representations, some big OKs, lots of minor tweaks
* More OKs, non-matching code cleanup
* 8003FBF4 and 80040BE4 OK, improve codegen for most functions
* format z_bgcheck.c
* fix warnings, compile errors on NON_MATCHING
* func_8003EE80 is now NON_MATCHING
* begin documenting some functions
* formatting
* more documentation, func_8003A95C OK
* fix PHYSICAL_TO_VIRTUAL changes
* fix var rename
* More documentation, functions 80040E40, 80041648 OK, change types to not be compatible with ZAP
* func_8004239C ok, more NON_MATCHING improvements, more documentation
* Implement most suggested changes
* Convert comments to slower comments
* /**
* Implement ZAP2 changes
* my anti-virus ate my format.sh results
* Rename a couple hundred functions, fix minor stuff
* rename var so that clang formats correctly
* run format.sh
* implement Petrie's matches/suggestions
* format
* matches
* and the asm
* slight error
* Add SSList
* two more matches
* stuff
* implement code changes
* clean up Petrie's matchings
Co-authored-by: Arthur <arthurtilly413@gmail.com>
Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-01-08 11:12:58 +00:00
|
|
|
#include "z64bgcheck.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64actor.h"
|
|
|
|
#include "z64player.h"
|
|
|
|
#include "z64audio.h"
|
|
|
|
#include "z64object.h"
|
2022-05-09 16:59:23 +00:00
|
|
|
#include "z64ocarina.h"
|
decompile z_camera (#398)
* cleanup
* name camera action functions
* decompile a few small functions, name a few Camera struct members
* decompile camera data, decompile a few camera functions
* Split ASM for code_800BB0A0
* removing code_800BB0A0.s
* PR Requests, Camera WIP
* remove #define NON_MATCHING from db_camera
* rename code_8007BF90.c to z_olib.c, rename functions in z_olib.c
* camera wip
* rename some struct memebers, some decomp wip
* pr updates
* camera wip
* name some fields in Camera Struct, being making sense of Camera_Update
* Camera WIP
* wip
* wip
* add z64camera.h header, begin creating CameraSetting macros
* wip
* wip
* wip
* wip
* migrate camera bss to c
* match a couple functions in db_camera
* match some small db_camera functions
* wip
* migrate db_camera rodata, match a few functions
* remote db_camera.rodata.s
* match some of db_camera
* identify types of some unknown data pieces
* some small wip
* Match Camera_Init, some function changes, some struct name changes. Change unk_C0 and unk_CC to floats from Vec3fs
* add naming for a few more Camera struct members
* wip
* match func_80043F94
* Match Camera_Jump1
* document some of Camera_Jump1
* wip
* match Camera_Jump3
* Match Camera_Update, FeelsAmazing
* wip
* wip
* match Camera_SetParam
* minor cleanup
* wip
* wip
* match Camera_KeepOn0
* some documentation, modify some matching functions to match style of others.
* match Camera_Demo1
* match camera_demo9
* document Camera_Demo1 and Camera_Demo9
* wip
* Match camera_battle4
* match camera_unique2
* Match Camera_Unique3
* match camera_special6
* match Camera_Special5
* wip
* document camera_special6
* naming updates
* match camera_Unique1
* match Camera_Unique0
* wip
* Match Camera_CalcUpFromPitchYawRoll
* match func_80045508
* document Camera_Battle4
* document several camera functions, move camera data to separate file
* rename phi/theta to pitch/yaw
* wip
* uniq9 wip
* Camera_Unqiue9 OK
* document Camera_Unique9
* name unk_160 in camera struct
* wip
* wip
* minor updates
* fix conflicts
* wip
* wip
* Olib updates
* wip
* wip
* rename most Math3D functions, few matches, documentation
* wip
* document most of math3d
* wip
* wip
* wip
* pr updates
* Match Camera_Fixed4
* match func_80058E8C
* pr updates
* add missing comment block finalizer
* Merge math3dupdates
* match Camera_ChangeSetting
* Match Camera_ChangeMode
* match func_80058148
* Match Camera_Special9
* decompile the rest of camera data
* match Camera_Demo5
* name a few camera functions in z_play
* match func_80046CB4, some work on other fucntions
* wip
* impove some non matchings
* fix function rename
* match func_800588B4
* match Camera_Subj4
* wip
* Camera_Demo3 matching, Camera_Battle1 big progress
* Camera_Normal2 OK
* wip
* match Camera_Parallel1
* normalize some things across functions
* match Camera_Normal1
* Match Camera_Normal3
* some cleanup
* more cleanup
* more cleanup , match Camera_CalcDefaultPitch
* data formatting
* Match Camera_Jump2
* document Camera_Jump2
* Match Camera_KeepOn3
* document some of Camera_KeepOn3
* improve some non_matchings
* match func_80045C74 and func_800460A8
* code cleanup, documentation
* match Camera_KeepOn1
* Match Camera_Subj3
* Match Camera_Battle1
* remove non_matching from func_80044adc and func_80046e20
* name several members of Battle1
* more documentation on Battle1
* cleanup
* renaming Camera_Vec3fScaleXYZFactor to Camera_Vec3fTranslateByUnitVector
* reorganize update structs, remove final references to params, remove CameraParams union
* implement camera enums into player
* Renaming Camera_GetDir to Camera_GetInputDir, Camera_GetRealDir to Camera_GetCamDir, etc, implement camera enum's into player
* remove non-global camera variables from variables.h
* clean up some variable declarations
* finish pr comment updates
* fix some warnings
* data formatting
* finish commenting on data
* delete unused asm
* remove asm
Co-authored-by: fig <fig02srl@gmail.com>
2020-12-06 22:39:47 +00:00
|
|
|
#include "z64camera.h"
|
2021-09-20 16:51:35 +00:00
|
|
|
#include "z64environment.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64cutscene.h"
|
|
|
|
#include "z64collision_check.h"
|
2022-05-20 06:27:54 +00:00
|
|
|
#include "z64curve.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64scene.h"
|
|
|
|
#include "z64effect.h"
|
|
|
|
#include "z64item.h"
|
|
|
|
#include "z64animation.h"
|
2022-11-30 17:46:12 +00:00
|
|
|
#include "z64animation_legacy.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64dma.h"
|
|
|
|
#include "z64math.h"
|
2021-03-29 17:24:08 +00:00
|
|
|
#include "z64map_mark.h"
|
2022-12-30 13:55:31 +00:00
|
|
|
#include "z64message.h"
|
|
|
|
#include "z64pause.h"
|
2022-01-12 23:00:28 +00:00
|
|
|
#include "z64skin.h"
|
2023-08-15 16:21:19 +00:00
|
|
|
#include "z64game.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "z64transition.h"
|
2023-08-15 16:21:19 +00:00
|
|
|
#include "z64transition_instances.h"
|
2021-06-15 17:29:10 +00:00
|
|
|
#include "z64interface.h"
|
2022-11-26 22:53:41 +00:00
|
|
|
#include "z64skybox.h"
|
2023-08-15 16:21:19 +00:00
|
|
|
#include "z64sram.h"
|
2022-12-30 13:55:31 +00:00
|
|
|
#include "z64view.h"
|
2023-09-16 21:16:58 +00:00
|
|
|
#include "z64vis.h"
|
2022-02-11 23:23:57 +00:00
|
|
|
#include "alignment.h"
|
2022-10-07 11:29:33 +00:00
|
|
|
#include "seqcmd.h"
|
2021-11-30 18:47:09 +00:00
|
|
|
#include "sequence.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "sfx.h"
|
|
|
|
#include "color.h"
|
2022-12-30 13:55:31 +00:00
|
|
|
#include "gfxprint.h"
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "ichain.h"
|
|
|
|
#include "regs.h"
|
2022-02-02 21:43:34 +00:00
|
|
|
#include "irqmgr.h"
|
|
|
|
#include "padmgr.h"
|
|
|
|
#include "fault.h"
|
2022-06-03 19:43:30 +00:00
|
|
|
#include "sched.h"
|
2022-09-27 16:40:26 +00:00
|
|
|
#include "rumble.h"
|
2022-11-16 07:32:07 +00:00
|
|
|
#include "mempak.h"
|
2022-11-13 23:29:50 +00:00
|
|
|
#include "tha.h"
|
|
|
|
#include "thga.h"
|
2023-08-15 16:21:19 +00:00
|
|
|
#include "speedmeter.h"
|
|
|
|
#include "gfx.h"
|
|
|
|
#include "jpeg.h"
|
|
|
|
#include "prerender.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
#define SCREEN_WIDTH 320
|
|
|
|
#define SCREEN_HEIGHT 240
|
|
|
|
|
|
|
|
#define REGION_NULL 0
|
2022-10-02 21:40:09 +00:00
|
|
|
#define REGION_JP 1
|
|
|
|
#define REGION_US 2
|
2020-03-17 04:31:30 +00:00
|
|
|
#define REGION_EU 3
|
|
|
|
|
2022-04-09 00:20:23 +00:00
|
|
|
#define THREAD_PRI_IDLE_INIT 10
|
|
|
|
#define THREAD_PRI_MAIN_INIT 10
|
|
|
|
#define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files
|
|
|
|
#define THREAD_PRI_GRAPH 11
|
|
|
|
#define THREAD_PRI_AUDIOMGR 12
|
|
|
|
#define THREAD_PRI_PADMGR 14
|
|
|
|
#define THREAD_PRI_MAIN 15
|
|
|
|
#define THREAD_PRI_SCHED 15
|
|
|
|
#define THREAD_PRI_DMAMGR 16
|
|
|
|
#define THREAD_PRI_IRQMGR 17
|
|
|
|
#define THREAD_PRI_FAULT_CLIENT (OS_PRIORITY_APPMAX - 1)
|
|
|
|
#define THREAD_PRI_FAULT OS_PRIORITY_APPMAX
|
|
|
|
|
|
|
|
#define THREAD_ID_IDLE 1
|
|
|
|
#define THREAD_ID_FAULT 2
|
|
|
|
#define THREAD_ID_MAIN 3
|
|
|
|
#define THREAD_ID_GRAPH 4
|
|
|
|
#define THREAD_ID_SCHED 5
|
|
|
|
#define THREAD_ID_PADMGR 7
|
|
|
|
#define THREAD_ID_AUDIOMGR 10
|
|
|
|
#define THREAD_ID_DMAMGR 18
|
|
|
|
#define THREAD_ID_IRQMGR 19
|
2020-10-03 15:22:44 +00:00
|
|
|
|
2022-02-06 18:00:01 +00:00
|
|
|
#define STACK(stack, size) \
|
|
|
|
u64 stack[ALIGN8(size) / sizeof(u64)]
|
|
|
|
|
|
|
|
#define STACK_TOP(stack) \
|
|
|
|
((u8*)(stack) + sizeof(stack))
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
// NOTE: Once we start supporting other builds, this can be changed with an ifdef
|
|
|
|
#define REGION_NATIVE REGION_EU
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2022-07-14 23:02:07 +00:00
|
|
|
/* 0x00 */ s32 regPage; // 0: no page selected (reg editor is not active); 1: first page; `REG_PAGES`: last page
|
|
|
|
/* 0x04 */ s32 regGroup; // Indexed from 0 to `REG_GROUPS`-1. Each group has its own character to identify it.
|
|
|
|
/* 0x08 */ s32 regCur; // Selected reg, indexed from 0 as the page start
|
|
|
|
/* 0x0C */ s32 dPadInputPrev;
|
|
|
|
/* 0x10 */ s32 inputRepeatTimer;
|
|
|
|
/* 0x14 */ s16 data[REG_GROUPS * REGS_PER_GROUP]; // Accessed through *REG macros, see regs.h
|
2022-10-15 05:40:00 +00:00
|
|
|
} RegEditor; // size = 0x15D4
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-12-03 14:49:32 +00:00
|
|
|
/* 0x00 */ u8 seqId;
|
|
|
|
/* 0x01 */ u8 natureAmbienceId;
|
|
|
|
} SequenceContext; // size = 0x2
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
typedef struct {
|
2021-03-28 23:35:16 +00:00
|
|
|
/* 0x00 */ s32 enabled;
|
|
|
|
/* 0x04 */ s32 timer;
|
|
|
|
} FrameAdvanceContext; // size = 0x8
|
2020-04-16 21:36:12 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ Vec3f pos;
|
|
|
|
/* 0x0C */ f32 unk_0C; // radius?
|
|
|
|
/* 0x10 */ Color_RGB8 color;
|
|
|
|
} TargetContextEntry; // size = 0x14
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ Vec3f naviRefPos; // possibly wrong
|
|
|
|
/* 0x0C */ Vec3f targetCenterPos;
|
|
|
|
/* 0x18 */ Color_RGBAf naviInner;
|
|
|
|
/* 0x28 */ Color_RGBAf naviOuter;
|
|
|
|
/* 0x38 */ Actor* arrowPointedActor;
|
|
|
|
/* 0x3C */ Actor* targetedActor;
|
|
|
|
/* 0x40 */ f32 unk_40;
|
|
|
|
/* 0x44 */ f32 unk_44;
|
|
|
|
/* 0x48 */ s16 unk_48;
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x4A */ u8 activeCategory;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x4B */ u8 unk_4B;
|
|
|
|
/* 0x4C */ s8 unk_4C;
|
|
|
|
/* 0x4D */ char unk_4D[0x03];
|
|
|
|
/* 0x50 */ TargetContextEntry arr_50[3];
|
|
|
|
/* 0x8C */ Actor* unk_8C;
|
2021-12-05 17:13:53 +00:00
|
|
|
/* 0x90 */ Actor* bgmEnemy; // The nearest enemy to player with the right flags that will trigger NA_BGM_ENEMY
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x94 */ Actor* unk_94;
|
|
|
|
} TargetContext; // size = 0x98
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-04-05 17:37:46 +00:00
|
|
|
/* 0x00 */ void* texture;
|
|
|
|
/* 0x04 */ s16 x;
|
|
|
|
/* 0x06 */ s16 y;
|
|
|
|
/* 0x08 */ u8 width;
|
|
|
|
/* 0x09 */ u8 height;
|
|
|
|
/* 0x0A */ u8 durationTimer; // how long the title card appears for before fading
|
|
|
|
/* 0x0B */ u8 delayTimer; // how long the title card waits to appear
|
|
|
|
/* 0x0C */ s16 alpha;
|
|
|
|
/* 0x0E */ s16 intensity;
|
2020-03-17 04:31:30 +00:00
|
|
|
} TitleCardContext; // size = 0x10
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-01-18 21:04:04 +00:00
|
|
|
/* 0x00 */ s32 length; // number of actors loaded of this category
|
|
|
|
/* 0x04 */ Actor* head; // pointer to head of the linked list of this category (most recent actor added)
|
2020-03-17 04:31:30 +00:00
|
|
|
} ActorListEntry; // size = 0x08
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-06-21 23:51:04 +00:00
|
|
|
/* 0x0000 */ u8 freezeFlashTimer;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0001 */ char unk_01[0x01];
|
|
|
|
/* 0x0002 */ u8 unk_02;
|
2022-01-24 23:42:36 +00:00
|
|
|
/* 0x0003 */ u8 lensActive;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0004 */ char unk_04[0x04];
|
|
|
|
/* 0x0008 */ u8 total; // total number of actors loaded
|
2022-01-17 20:30:30 +00:00
|
|
|
/* 0x000C */ ActorListEntry actorLists[ACTORCAT_MAX];
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x006C */ TargetContext targetCtx;
|
2020-03-22 21:50:11 +00:00
|
|
|
struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0104 */ u32 swch;
|
|
|
|
/* 0x0108 */ u32 tempSwch;
|
|
|
|
/* 0x010C */ u32 unk0;
|
|
|
|
/* 0x0110 */ u32 unk1;
|
|
|
|
/* 0x0114 */ u32 chest;
|
|
|
|
/* 0x0118 */ u32 clear;
|
|
|
|
/* 0x011C */ u32 tempClear;
|
|
|
|
/* 0x0120 */ u32 collect;
|
|
|
|
/* 0x0124 */ u32 tempCollect;
|
|
|
|
} flags;
|
|
|
|
/* 0x0128 */ TitleCardContext titleCtx;
|
|
|
|
/* 0x0138 */ char unk_138[0x04];
|
2022-06-20 20:17:09 +00:00
|
|
|
/* 0x013C */ void* absoluteSpace; // Space used to allocate actor overlays with alloc type ACTOROVL_ALLOC_ABSOLUTE
|
2020-03-17 04:31:30 +00:00
|
|
|
} ActorContext; // size = 0x140
|
|
|
|
|
2020-05-01 02:00:39 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u16 countdown;
|
2022-01-11 01:31:53 +00:00
|
|
|
/* 0x04 */ Vec3f worldPos;
|
|
|
|
/* 0x10 */ Vec3f projectedPos;
|
2022-07-30 13:05:27 +00:00
|
|
|
} SfxSource; // size = 0x1C
|
2020-05-01 02:00:39 +00:00
|
|
|
|
2021-05-02 23:15:16 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ void* loadedRamAddr;
|
2022-10-02 15:38:09 +00:00
|
|
|
/* 0x04 */ uintptr_t vromStart;
|
|
|
|
/* 0x08 */ uintptr_t vromEnd;
|
2021-05-02 23:15:16 +00:00
|
|
|
/* 0x0C */ void* vramStart;
|
|
|
|
/* 0x10 */ void* vramEnd;
|
|
|
|
/* 0x14 */ u32 offset; // loadedRamAddr - vramStart
|
|
|
|
/* 0x18 */ const char* name;
|
|
|
|
} KaleidoMgrOverlay; // size = 0x1C
|
|
|
|
|
|
|
|
typedef enum {
|
2023-07-05 22:36:19 +00:00
|
|
|
/* 0 */ KALEIDO_OVL_KALEIDO_SCOPE,
|
|
|
|
/* 1 */ KALEIDO_OVL_PLAYER_ACTOR,
|
|
|
|
/* 2 */ KALEIDO_OVL_MAX
|
2021-05-02 23:15:16 +00:00
|
|
|
} KaleidoOverlayType;
|
|
|
|
|
2021-03-28 23:50:46 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 00 */ GAMEOVER_INACTIVE,
|
|
|
|
/* 01 */ GAMEOVER_DEATH_START,
|
|
|
|
/* 02 */ GAMEOVER_DEATH_WAIT_GROUND, // wait for link to fall and hit the ground
|
|
|
|
/* 03 */ GAMEOVER_DEATH_DELAY_MENU, // wait for 1 second before showing the game over menu
|
2022-08-30 21:35:00 +00:00
|
|
|
/* 04 */ GAMEOVER_DEATH_MENU, // do nothing while kaleidoscope handles the game over menu
|
2021-03-28 23:50:46 +00:00
|
|
|
/* 20 */ GAMEOVER_REVIVE_START = 20,
|
|
|
|
/* 21 */ GAMEOVER_REVIVE_RUMBLE,
|
|
|
|
/* 22 */ GAMEOVER_REVIVE_WAIT_GROUND, // wait for link to fall and hit the ground
|
|
|
|
/* 23 */ GAMEOVER_REVIVE_WAIT_FAIRY, // wait for the fairy to rise all the way up out of links body
|
|
|
|
/* 24 */ GAMEOVER_REVIVE_FADE_OUT // fade out the game over lights as link is revived and gets back up
|
|
|
|
} GameOverState;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u16 state;
|
2021-09-20 16:51:35 +00:00
|
|
|
} GameOverContext; // size = 0x2
|
2020-04-16 21:36:12 +00:00
|
|
|
|
2022-05-21 12:54:51 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 0 */ LENS_MODE_HIDE_ACTORS, // lens actors are visible by default, and hidden by using lens (for example, fake walls)
|
|
|
|
/* 1 */ LENS_MODE_SHOW_ACTORS // lens actors are invisible by default, and shown by using lens (for example, invisible enemies)
|
|
|
|
} LensMode;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ ROOM_BEHAVIOR_TYPE1_0,
|
|
|
|
/* 1 */ ROOM_BEHAVIOR_TYPE1_1,
|
|
|
|
/* 2 */ ROOM_BEHAVIOR_TYPE1_2,
|
|
|
|
/* 3 */ ROOM_BEHAVIOR_TYPE1_3, // unused
|
|
|
|
/* 4 */ ROOM_BEHAVIOR_TYPE1_4, // unused
|
|
|
|
/* 5 */ ROOM_BEHAVIOR_TYPE1_5
|
|
|
|
} RoomBehaviorType1;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ ROOM_BEHAVIOR_TYPE2_0,
|
|
|
|
/* 1 */ ROOM_BEHAVIOR_TYPE2_1,
|
|
|
|
/* 2 */ ROOM_BEHAVIOR_TYPE2_2,
|
|
|
|
/* 3 */ ROOM_BEHAVIOR_TYPE2_3,
|
|
|
|
/* 4 */ ROOM_BEHAVIOR_TYPE2_4,
|
|
|
|
/* 5 */ ROOM_BEHAVIOR_TYPE2_5,
|
|
|
|
/* 6 */ ROOM_BEHAVIOR_TYPE2_6
|
|
|
|
} RoomBehaviorType2;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ s8 num;
|
|
|
|
/* 0x01 */ u8 unk_01;
|
2022-05-21 12:54:51 +00:00
|
|
|
/* 0x02 */ u8 behaviorType2;
|
|
|
|
/* 0x03 */ u8 behaviorType1;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x04 */ s8 echo;
|
2022-05-21 12:54:51 +00:00
|
|
|
/* 0x05 */ u8 lensMode;
|
2022-08-31 23:28:51 +00:00
|
|
|
/* 0x08 */ RoomShape* roomShape; // original name: "ground_shape"
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0C */ void* segment;
|
|
|
|
/* 0x10 */ char unk_10[0x4];
|
|
|
|
} Room; // size = 0x14
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ Room curRoom;
|
|
|
|
/* 0x14 */ Room prevRoom;
|
|
|
|
/* 0x28 */ void* bufPtrs[2];
|
|
|
|
/* 0x30 */ u8 unk_30;
|
|
|
|
/* 0x31 */ s8 status;
|
|
|
|
/* 0x34 */ void* unk_34;
|
|
|
|
/* 0x38 */ DmaRequest dmaRequest;
|
|
|
|
/* 0x58 */ OSMesgQueue loadQueue;
|
|
|
|
/* 0x70 */ OSMesg loadMsg;
|
2021-12-11 01:21:19 +00:00
|
|
|
/* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config
|
2021-08-15 23:15:58 +00:00
|
|
|
} RoomContext; // size = 0x78
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2024-01-11 15:30:47 +00:00
|
|
|
#define SAC_ENABLE (1 << 0)
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-01-18 02:13:36 +00:00
|
|
|
/* 0x000 */ s16 colATCount;
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x002 */ u16 sacFlags;
|
2021-01-18 02:13:36 +00:00
|
|
|
/* 0x004 */ Collider* colAT[COLLISION_CHECK_AT_MAX];
|
|
|
|
/* 0x0CC */ s32 colACCount;
|
|
|
|
/* 0x0D0 */ Collider* colAC[COLLISION_CHECK_AC_MAX];
|
|
|
|
/* 0x1C0 */ s32 colOCCount;
|
|
|
|
/* 0x1C4 */ Collider* colOC[COLLISION_CHECK_OC_MAX];
|
|
|
|
/* 0x28C */ s32 colLineCount;
|
|
|
|
/* 0x290 */ OcLine* colLine[COLLISION_CHECK_OC_LINE_MAX];
|
2020-10-11 17:45:08 +00:00
|
|
|
} CollisionCheckContext; // size = 0x29C
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-23 21:34:26 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ GameState state;
|
|
|
|
} SetupState; // size = 0xA4
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0000 */ GameState state;
|
2021-05-02 23:15:16 +00:00
|
|
|
/* 0x00A4 */ u8* staticSegment;
|
2020-03-19 22:29:33 +00:00
|
|
|
/* 0x00A8 */ View view;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x01D0 */ SramContext sramCtx;
|
2020-03-19 22:29:33 +00:00
|
|
|
/* 0x01D4 */ u16 unk_1D4; // not used in mq dbg (some sort of timer that doesn't seem to affect anything)
|
|
|
|
/* 0x01D6 */ s16 coverAlpha;
|
|
|
|
/* 0x01D8 */ s16 addAlpha; // not used in mq dbg
|
|
|
|
/* 0x01DA */ u16 visibleDuration; // not used in mq dbg
|
|
|
|
/* 0x01DC */ s16 ult;
|
|
|
|
/* 0x01DE */ s16 uls;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x01E0 */ char unk_1E0[0x01];
|
2020-03-19 22:29:33 +00:00
|
|
|
/* 0x01E1 */ u8 exit;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x01E2 */ char unk_1E2[0x06];
|
2022-06-23 21:34:26 +00:00
|
|
|
} ConsoleLogoState; // size = 0x1E8
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-23 21:34:26 +00:00
|
|
|
struct MapSelectState;
|
2020-07-09 01:54:39 +00:00
|
|
|
|
2020-06-14 02:59:58 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ char* name;
|
2022-06-23 21:34:26 +00:00
|
|
|
/* 0x04 */ void (*loadFunc)(struct MapSelectState*, s32);
|
2020-06-14 02:59:58 +00:00
|
|
|
/* 0x08 */ s32 entranceIndex;
|
|
|
|
} SceneSelectEntry; // size = 0xC
|
|
|
|
|
2022-06-23 21:34:26 +00:00
|
|
|
typedef struct MapSelectState {
|
2020-06-14 02:59:58 +00:00
|
|
|
/* 0x0000 */ GameState state;
|
|
|
|
/* 0x00A8 */ View view;
|
|
|
|
/* 0x01D0 */ s32 count;
|
|
|
|
/* 0x01D4 */ SceneSelectEntry* scenes;
|
|
|
|
/* 0x01D8 */ s32 currentScene;
|
2021-10-24 00:44:45 +00:00
|
|
|
/* 0x01DC */ s32 pageDownIndex; // Index of pageDownStops
|
|
|
|
/* 0x01E0 */ s32 pageDownStops[7];
|
|
|
|
/* 0x01FC */ char unk_1FC[0x0C];
|
2020-06-14 02:59:58 +00:00
|
|
|
/* 0x0208 */ s32 opt;
|
2021-10-24 00:44:45 +00:00
|
|
|
/* 0x020C */ s32 topDisplayedScene; // The scene which is currently at the top of the screen
|
|
|
|
/* 0x0210 */ char unk_210[0x0C];
|
|
|
|
/* 0x021C */ s32 verticalInputAccumulator;
|
|
|
|
/* 0x0220 */ s32 verticalInput;
|
|
|
|
/* 0x0224 */ s32 timerUp;
|
|
|
|
/* 0x0228 */ s32 timerDown;
|
|
|
|
/* 0x022C */ s32 lockUp;
|
|
|
|
/* 0x0230 */ s32 lockDown;
|
|
|
|
/* 0x0234 */ s32 unk_234; // unused
|
2021-05-02 23:15:16 +00:00
|
|
|
/* 0x0238 */ u8* staticSegment;
|
2022-06-23 21:34:26 +00:00
|
|
|
} MapSelectState; // size = 0x240
|
2020-06-14 02:59:58 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
typedef struct {
|
2020-03-22 16:37:38 +00:00
|
|
|
/* 0x0000 */ GameState state;
|
2021-05-02 23:15:16 +00:00
|
|
|
/* 0x00A4 */ u8* staticSegment;
|
2020-03-22 16:37:38 +00:00
|
|
|
/* 0x00A8 */ View view;
|
2022-06-23 21:34:26 +00:00
|
|
|
} SampleState; // size = 0x1D0
|
2020-03-22 16:37:38 +00:00
|
|
|
|
2020-03-30 20:29:51 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u8 byte0;
|
|
|
|
/* 0x01 */ u8 byte1;
|
|
|
|
/* 0x02 */ u8 byte2;
|
|
|
|
/* 0x03 */ u8 byte3;
|
2022-10-15 17:24:13 +00:00
|
|
|
} QuestHintCmd; // size = 0x4
|
2020-03-30 20:29:51 +00:00
|
|
|
|
2021-08-15 23:15:58 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u8 numActors;
|
|
|
|
/* 0x04 */ TransitionActorEntry* list;
|
2023-07-05 22:36:19 +00:00
|
|
|
} TransitionActorContext; // size = 0x8
|
2021-08-15 23:15:58 +00:00
|
|
|
|
2022-12-30 13:55:31 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing.
|
|
|
|
/* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background.
|
|
|
|
/* 2 */ PAUSE_BG_PRERENDER_PROCESS, // The previous frame was PAUSE_BG_PRERENDER_SETUP, now apply prerender filters.
|
|
|
|
/* 3 */ PAUSE_BG_PRERENDER_READY, // The pause background is ready to be used.
|
|
|
|
/* 4 */ PAUSE_BG_PRERENDER_MAX
|
|
|
|
} PauseBgPreRenderState;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ TRANS_TILE_OFF, // Inactive, do nothing
|
|
|
|
/* 1 */ TRANS_TILE_SETUP, // Save the necessary buffers
|
|
|
|
/* 2 */ TRANS_TILE_PROCESS, // Initialize the transition
|
|
|
|
/* 3 */ TRANS_TILE_READY // The transition is ready, so will update and draw each frame
|
2023-01-10 18:03:31 +00:00
|
|
|
} TransitionTileState;
|
2022-12-30 13:55:31 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
typedef struct PlayState {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00000 */ GameState state;
|
2022-07-31 23:44:47 +00:00
|
|
|
/* 0x000A4 */ s16 sceneId;
|
2022-05-31 18:19:46 +00:00
|
|
|
/* 0x000A6 */ u8 sceneDrawConfig;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x000A7 */ char unk_A7[0x9];
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x000B0 */ void* sceneSegment;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x000B8 */ View view;
|
2020-08-29 23:00:17 +00:00
|
|
|
/* 0x001E0 */ Camera mainCamera;
|
2022-05-12 18:35:31 +00:00
|
|
|
/* 0x0034C */ Camera subCameras[NUM_CAMS - CAM_ID_SUB_FIRST];
|
2021-03-31 16:18:31 +00:00
|
|
|
/* 0x00790 */ Camera* cameraPtrs[NUM_CAMS];
|
2022-05-12 18:35:31 +00:00
|
|
|
/* 0x007A0 */ s16 activeCamId;
|
|
|
|
/* 0x007A2 */ s16 nextCamId;
|
2021-12-03 14:49:32 +00:00
|
|
|
/* 0x007A4 */ SequenceContext sequenceCtx;
|
2020-09-05 13:45:10 +00:00
|
|
|
/* 0x007A8 */ LightContext lightCtx;
|
2021-03-28 23:35:16 +00:00
|
|
|
/* 0x007B8 */ FrameAdvanceContext frameAdvCtx;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x007C0 */ CollisionContext colCtx;
|
|
|
|
/* 0x01C24 */ ActorContext actorCtx;
|
|
|
|
/* 0x01D64 */ CutsceneContext csCtx; // "demo_play"
|
2022-07-30 13:05:27 +00:00
|
|
|
/* 0x01DB4 */ SfxSource sfxSources[16];
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x01F74 */ SramContext sramCtx;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x01F78 */ SkyboxContext skyboxCtx;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x020D8 */ MessageContext msgCtx; // "message"
|
|
|
|
/* 0x104F0 */ InterfaceContext interfaceCtx; // "parameter"
|
|
|
|
/* 0x10760 */ PauseContext pauseCtx;
|
2021-03-28 23:50:46 +00:00
|
|
|
/* 0x10A20 */ GameOverContext gameOverCtx;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x10A24 */ EnvironmentContext envCtx;
|
2020-03-20 21:12:26 +00:00
|
|
|
/* 0x10B20 */ AnimationContext animationCtx;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x117A4 */ ObjectContext objectCtx;
|
|
|
|
/* 0x11CBC */ RoomContext roomCtx;
|
2021-08-15 23:15:58 +00:00
|
|
|
/* 0x11D34 */ TransitionActorContext transiActorCtx;
|
2022-05-21 18:23:43 +00:00
|
|
|
/* 0x11D3C */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader);
|
|
|
|
/* 0x11D40 */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input);
|
2023-10-17 19:16:31 +00:00
|
|
|
/* 0x11D44 */ int (*isPlayerDroppingFish)(struct PlayState* play);
|
2022-05-21 18:23:43 +00:00
|
|
|
/* 0x11D48 */ s32 (*startPlayerFishing)(struct PlayState* play);
|
|
|
|
/* 0x11D4C */ s32 (*grabPlayer)(struct PlayState* play, Player* player);
|
2023-10-28 11:46:24 +00:00
|
|
|
/* 0x11D50 */ s32 (*tryPlayerCsAction)(struct PlayState* play, Actor* actor, s32 csAction);
|
2022-05-21 18:23:43 +00:00
|
|
|
/* 0x11D54 */ void (*func_11D54)(Player* player, struct PlayState* play);
|
|
|
|
/* 0x11D58 */ s32 (*damagePlayer)(struct PlayState* play, s32 damage);
|
|
|
|
/* 0x11D5C */ void (*talkWithPlayer)(struct PlayState* play, Actor* actor);
|
2021-11-30 23:52:16 +00:00
|
|
|
/* 0x11D60 */ MtxF viewProjectionMtxF;
|
|
|
|
/* 0x11DA0 */ MtxF billboardMtxF;
|
|
|
|
/* 0x11DE0 */ Mtx* billboardMtx;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x11DE4 */ u32 gameplayFrames;
|
|
|
|
/* 0x11DE8 */ u8 linkAgeOnLoad;
|
2022-12-24 18:55:17 +00:00
|
|
|
/* 0x11DE9 */ u8 haltAllActors;
|
2022-10-16 22:00:18 +00:00
|
|
|
/* 0x11DEA */ u8 spawn;
|
|
|
|
/* 0x11DEB */ u8 numActorEntries;
|
2021-08-15 23:15:58 +00:00
|
|
|
/* 0x11DEC */ u8 numRooms;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x11DF0 */ RomFile* roomList;
|
2022-10-16 22:00:18 +00:00
|
|
|
/* 0x11DF4 */ ActorEntry* playerEntry;
|
|
|
|
/* 0x11DF8 */ ActorEntry* actorEntryList;
|
2022-05-21 12:54:51 +00:00
|
|
|
/* 0x11DFC */ void* unk_11DFC;
|
2022-10-16 22:00:18 +00:00
|
|
|
/* 0x11E00 */ Spawn* spawnList;
|
|
|
|
/* 0x11E04 */ s16* exitList;
|
|
|
|
/* 0x11E08 */ Path* pathList;
|
2022-10-15 17:24:13 +00:00
|
|
|
/* 0x11E0C */ QuestHintCmd* naviQuestHints;
|
2021-03-29 17:14:08 +00:00
|
|
|
/* 0x11E10 */ void* specialEffects;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x11E14 */ u8 skyboxId;
|
2022-04-27 20:00:25 +00:00
|
|
|
/* 0x11E15 */ s8 transitionTrigger; // "fade_direction"
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x11E16 */ s16 unk_11E16;
|
2023-01-12 22:08:38 +00:00
|
|
|
/* 0x11E18 */ s16 bgCoverAlpha;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x11E1A */ s16 nextEntranceIndex;
|
|
|
|
/* 0x11E1C */ char unk_11E1C[0x40];
|
2020-12-11 22:38:23 +00:00
|
|
|
/* 0x11E5C */ s8 shootingGalleryStatus;
|
|
|
|
/* 0x11E5D */ s8 bombchuBowlingStatus; // "bombchu_game_flag"
|
2022-04-27 20:00:25 +00:00
|
|
|
/* 0x11E5E */ u8 transitionType;
|
z_collision_check.c (#73)
* func_8005B280 ok
* func_8005B65C OK
* split out func_8005BD50
* func_8005B7C0 OK
* func_8005B7F4 OK
* func_8005B824 OK
* func_8005B860 ok
* improve sanity
* func_8005B6B0 ok, ColliderInit_Actor structs added
* func_8005B884 ok
* func_8005BBF8 ok, split out func_8005BF50
* split more stuff out of func_8005C050.s
* func_8005C050 OK
* func_8005BA30 fakish OK, func_8005BAD8 real OK
* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues
* func_8005BB10 Ok
* func_8005BF50 OK
* func_8005BE50 OK
* func_8005BD50 OK
* func_8005BCC8 Ok
* func_8005BC28
* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok
* save my work commit
* func_8005C2BC fake OK
* func_8005C5B0 ok
* func_8005C608 ok
* func_8005C6C0 ok
* func_8005C6F8 ok
* func_8005C730 ok
* func_8005C774 func_8005C798 func_8005C7BC OK
* func_8005C7E0 ok, func_8005C810 split
* func_8005C810 OK
* func_8005C8C8 ok
* func_8005C964 OK
* func_8005CA88 ok
* func_8005CBAC ok
* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK
* func_8005CD34 func_8005CDD0 Ok
* func_8005CE6C ok
* func_8005CEC4 ok
* func_8005CEDC ok
* func_8005CF90 Ok
* standardize type names/vars more
* func_8005D3BC ok
* func_8005D40C OK, z64.h CollisionCheckContext
* func_8005D4B4 func_8005D4C8 ok
* partial data section migration
* improve function documentation, OT->OC
* Actor_CollisionCheck_SetOC ok
* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok
* func_8005BA84 ok
* func_800611A0 ok
* func_80061274 ok
* clean up func_80061274
* func_8006139C ok
* func_8005E9C0 and dependencies OK
* minor cleanup to func_8005E9C0
* func_8005EC6C OK!
* func_8005E81C ok
* func_8005E604 ok
* func_8005E2EC func_8005E4F8 OK
* func_8005DE9C OK func_8005D8AC disassembled
* func_8006146C func_8006268C ok
* func_8005EEE0 ok
* func_8005F17C
* func_8005F39C ok
* func_8005F5B0 decompiled, not matching
* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK
* func_8005FA30 ok, split more functions
* func_8005FC04 ok
* func_8005FDCC k
* func_8005FF90 OK OK OK
* func_80060204 dead
* func_800604B0 ok
* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish
* func_800635D0 ok, func_80062ECC not so much
* OcLine oks
* D_8011DF28 functions disassembled
* D_8011DF5C functions OK
* setAT_SAC. setAC_SAC, setOC_SAC OK
* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK
* func_800617D4 ok, func_800614A4 disassembled
* CollisionCheck_OC D_8011DFAC functions OK
* func_80062530 ok
* CollisionCheck_generalLineOcCheck subfunctions OK
* func_800622E4 ok
* after a long fought battle, func_80061F64 has fallen.
* func_800628A4 disassembled
* func_800627A0 func_8006285C OK
* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok
* func_80062CD4 decompiled, import EffShield/EffSpark types from MM
* various SubActor98 struct functions OK
* func_8005D4DC func_8005D62C ok
* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs
* func_80060C2C ok
* minor code tweaks
* func_80061C98 ok somehow
* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types
* Apply changes
* formatting
* tweak a couple function names
* krim changes, func naming
* missed some things
* function renames
* Implement GenColliderInit.py utility
* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching
* func_800614A4 ok
* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE
* collisionCheckCtx -> colChkCtx, fix small things
2020-04-26 02:43:35 +00:00
|
|
|
/* 0x11E60 */ CollisionCheckContext colChkCtx;
|
2022-12-24 18:55:17 +00:00
|
|
|
/* 0x120FC */ u16 cutsceneFlags[20];
|
2021-07-04 15:58:19 +00:00
|
|
|
/* 0x12124 */ PreRender pauseBgPreRender;
|
2020-09-15 19:10:19 +00:00
|
|
|
/* 0x12174 */ char unk_12174[0x53];
|
|
|
|
/* 0x121C7 */ s8 unk_121C7;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x121C8 */ TransitionContext transitionCtx;
|
|
|
|
/* 0x12418 */ char unk_12418[0x3];
|
2020-04-30 18:41:09 +00:00
|
|
|
/* 0x1241B */ u8 transitionMode; // "fbdemo_wipe_modem"
|
2022-12-24 02:46:56 +00:00
|
|
|
/* 0x1241C */ TransitionFade transitionFadeFlash; // Transition fade instance which flashes screen, see R_TRANS_FADE_FLASH_ALPHA_STEP
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x12428 */ char unk_12428[0x3];
|
2022-06-21 00:31:53 +00:00
|
|
|
/* 0x1242B */ u8 viewpoint; // toggleable camera setting by shops or player. Is also equal to the bgCamIndex + 1
|
2021-08-15 23:15:58 +00:00
|
|
|
/* 0x1242C */ SceneTableEntry* loadedScene;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x12430 */ char unk_12430[0xE8];
|
2022-05-21 18:23:43 +00:00
|
|
|
} PlayState; // size = 0x12518
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x0000 */ GameState state;
|
|
|
|
/* 0x00A8 */ View view;
|
2022-06-23 21:34:26 +00:00
|
|
|
} TitleSetupState; // size = 0x1D0
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-11 17:45:08 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00000 */ GameState state;
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x000A4 */ Vtx* windowVtx;
|
2021-05-02 23:15:16 +00:00
|
|
|
/* 0x000A8 */ u8* staticSegment;
|
|
|
|
/* 0x000AC */ u8* parameterSegment;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x000B0 */ char unk_B0[0x8];
|
|
|
|
/* 0x000B8 */ View view;
|
|
|
|
/* 0x001E0 */ SramContext sramCtx;
|
|
|
|
/* 0x001E4 */ char unk_1E4[0x4];
|
|
|
|
/* 0x001E8 */ SkyboxContext skyboxCtx;
|
|
|
|
/* 0x00348 */ MessageContext msgCtx;
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x0E760 */ Font font;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x1C8E8 */ EnvironmentContext envCtx;
|
|
|
|
/* 0x1C9E4 */ char unk_1C9E4[0x4];
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x1C9E8 */ Vtx* windowContentVtx;
|
|
|
|
/* 0x1C9EC */ Vtx* keyboardVtx;
|
|
|
|
/* 0x1C9F0 */ Vtx* nameEntryVtx;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x1C9F4 */ u8 n64ddFlag;
|
|
|
|
/* 0x1C9F6 */ u16 deaths[3];
|
|
|
|
/* 0x1C9FC */ u8 fileNames[3][8];
|
|
|
|
/* 0x1CA14 */ u16 healthCapacities[3];
|
|
|
|
/* 0x1CA1C */ u32 questItems[3];
|
|
|
|
/* 0x1CA28 */ s16 n64ddFlags[3];
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x1CA2E */ s8 defense[3];
|
|
|
|
/* 0x1CA32 */ u16 health[3];
|
|
|
|
/* 0x1CA38 */ s16 buttonIndex;
|
|
|
|
/* 0x1CA3A */ s16 confirmButtonIndex; // 0: yes, 1: quit
|
|
|
|
/* 0x1CA3C */ s16 menuMode;
|
|
|
|
/* 0x1CA3E */ s16 configMode;
|
|
|
|
/* 0x1CA40 */ s16 prevConfigMode;
|
|
|
|
/* 0x1CA42 */ s16 nextConfigMode;
|
|
|
|
/* 0x1CA44 */ s16 selectMode;
|
|
|
|
/* 0x1CA46 */ s16 selectedFileIndex;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x1CA48 */ char unk_1CA48[0x2];
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x1CA4A */ s16 fileNamesY[3];
|
|
|
|
/* 0x1CA50 */ s16 actionTimer;
|
|
|
|
/* 0x1CA52 */ s16 buttonYOffsets[6];
|
|
|
|
/* 0x1CA5E */ s16 copyDestFileIndex;
|
|
|
|
/* 0x1CA60 */ s16 warningLabel;
|
|
|
|
/* 0x1CA62 */ s16 warningButtonIndex;
|
|
|
|
/* 0x1CA64 */ s16 titleLabel;
|
|
|
|
/* 0x1CA66 */ s16 nextTitleLabel;
|
|
|
|
/* 0x1CA68 */ s16 windowColor[3];
|
|
|
|
/* 0x1CA6E */ s16 titleAlpha[2];
|
|
|
|
/* 0x1CA72 */ s16 windowAlpha;
|
|
|
|
/* 0x1CA74 */ s16 fileButtonAlpha[3];
|
|
|
|
/* 0x1CA7A */ s16 nameBoxAlpha[3];
|
|
|
|
/* 0x1CA80 */ s16 nameAlpha[3];
|
|
|
|
/* 0x1CA86 */ s16 connectorAlpha[3];
|
|
|
|
/* 0x1CA8C */ s16 fileInfoAlpha[3];
|
|
|
|
/* 0x1CA92 */ s16 actionButtonAlpha[2];
|
|
|
|
/* 0x1CA96 */ s16 confirmButtonAlpha[2];
|
|
|
|
/* 0x1CA9A */ s16 optionButtonAlpha;
|
|
|
|
/* 0x1CA9C */ s16 nameEntryBoxAlpha;
|
|
|
|
/* 0x1CA9E */ s16 controlsAlpha;
|
|
|
|
/* 0x1CAA0 */ s16 emptyFileTextAlpha;
|
|
|
|
/* 0x1CAA2 */ s16 highlightColor[4];
|
|
|
|
/* 0x1CAAA */ s16 highlightPulseDir; // 0 fade out, 1 fade in
|
|
|
|
/* 0x1CAAC */ s16 unk_1CAAC; // initialized but never used
|
|
|
|
/* 0x1CAAE */ s16 confirmButtonTexIndices[2];
|
|
|
|
/* 0x1CAB2 */ s16 inputTimerX;
|
|
|
|
/* 0x1CAB4 */ s16 inputTimerY;
|
|
|
|
/* 0x1CAB6 */ s16 stickXDir;
|
|
|
|
/* 0x1CAB8 */ s16 stickYDir;
|
2022-08-30 18:55:37 +00:00
|
|
|
/* 0x1CABA */ s16 stickAdjX;
|
|
|
|
/* 0x1CABC */ s16 stickAdjY;
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x1CABE */ s16 nameEntryBoxPosX;
|
|
|
|
/* 0x1CAC0 */ s16 windowPosX;
|
|
|
|
/* 0x1CAC4 */ f32 windowRot;
|
|
|
|
/* 0x1CAC8 */ s16 kbdButton; // only for buttons, not characters
|
|
|
|
/* 0x1CACA */ s16 charPage; // 0: hiragana, 1: katakana, 2: alphabet
|
|
|
|
/* 0x1CACC */ s16 charBgAlpha; // square shape the letter sits in
|
|
|
|
/* 0x1CACE */ s16 charIndex; // 0 - 64, top left to bottom right
|
|
|
|
/* 0x1CAD0 */ s16 kbdX; // (0, 0) is top left character
|
|
|
|
/* 0x1CAD2 */ s16 kbdY;
|
2020-10-11 17:45:08 +00:00
|
|
|
/* 0x1CAD4 */ s16 newFileNameCharCount;
|
2021-11-15 21:33:44 +00:00
|
|
|
/* 0x1CAD6 */ s16 unk_1CAD6[5];
|
2022-06-23 21:34:26 +00:00
|
|
|
} FileSelectState; // size = 0x1CAE0
|
2020-04-18 08:50:41 +00:00
|
|
|
|
2022-06-15 18:41:47 +00:00
|
|
|
// Macros for `EntranceInfo.field`
|
|
|
|
#define ENTRANCE_INFO_CONTINUE_BGM_FLAG (1 << 15)
|
|
|
|
#define ENTRANCE_INFO_DISPLAY_TITLE_CARD_FLAG (1 << 14)
|
|
|
|
#define ENTRANCE_INFO_END_TRANS_TYPE_MASK 0x3F80
|
|
|
|
#define ENTRANCE_INFO_END_TRANS_TYPE_SHIFT 7
|
|
|
|
#define ENTRANCE_INFO_END_TRANS_TYPE(field) \
|
|
|
|
(((field) >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT) \
|
|
|
|
& (ENTRANCE_INFO_END_TRANS_TYPE_MASK >> ENTRANCE_INFO_END_TRANS_TYPE_SHIFT))
|
|
|
|
#define ENTRANCE_INFO_START_TRANS_TYPE_MASK 0x7F
|
|
|
|
#define ENTRANCE_INFO_START_TRANS_TYPE_SHIFT 0
|
|
|
|
#define ENTRANCE_INFO_START_TRANS_TYPE(field) \
|
|
|
|
(((field) >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT) \
|
|
|
|
& (ENTRANCE_INFO_START_TRANS_TYPE_MASK >> ENTRANCE_INFO_START_TRANS_TYPE_SHIFT))
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2022-07-31 23:44:47 +00:00
|
|
|
/* 0x00 */ s8 sceneId;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x01 */ s8 spawn;
|
2020-04-16 21:36:12 +00:00
|
|
|
/* 0x02 */ u16 field;
|
2020-03-17 04:31:30 +00:00
|
|
|
} EntranceInfo; // size = 0x4
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2021-11-30 23:40:42 +00:00
|
|
|
/* 0x00 */ void* loadedRamAddr;
|
2022-10-02 15:38:09 +00:00
|
|
|
/* 0x04 */ uintptr_t vromStart; // if applicable
|
|
|
|
/* 0x08 */ uintptr_t vromEnd; // if applicable
|
2021-11-30 23:40:42 +00:00
|
|
|
/* 0x0C */ void* vramStart; // if applicable
|
|
|
|
/* 0x10 */ void* vramEnd; // if applicable
|
2022-06-05 16:48:44 +00:00
|
|
|
/* 0x14 */ void* unk_14;
|
2021-11-30 23:40:42 +00:00
|
|
|
/* 0x18 */ void* init; // initializes and executes the given context
|
|
|
|
/* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
|
2022-06-05 16:48:44 +00:00
|
|
|
/* 0x20 */ void* unk_20;
|
|
|
|
/* 0x24 */ void* unk_24;
|
2021-11-30 23:40:42 +00:00
|
|
|
/* 0x28 */ UNK_TYPE4 unk_28;
|
|
|
|
/* 0x2C */ u32 instanceSize;
|
2020-03-17 04:31:30 +00:00
|
|
|
} GameStateOverlay; // size = 0x30
|
|
|
|
|
2022-06-23 21:34:26 +00:00
|
|
|
typedef struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ GameState state;
|
2021-11-30 23:40:42 +00:00
|
|
|
/* 0xA4 */ u32 timer;
|
|
|
|
/* 0xA8 */ UNK_TYPE4 unk_A8;
|
2022-06-23 21:34:26 +00:00
|
|
|
} PreNMIState; // size = 0xAC
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-06-03 20:52:10 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 1 */ F_8F = 1,
|
|
|
|
/* 2 */ F_7F,
|
|
|
|
/* 3 */ F_6F,
|
|
|
|
/* 4 */ F_5F,
|
|
|
|
/* 5 */ F_4F,
|
|
|
|
/* 6 */ F_3F,
|
|
|
|
/* 7 */ F_2F,
|
|
|
|
/* 8 */ F_1F,
|
|
|
|
/* 9 */ F_B1,
|
|
|
|
/* 10 */ F_B2,
|
|
|
|
/* 11 */ F_B3,
|
|
|
|
/* 12 */ F_B4,
|
|
|
|
/* 13 */ F_B5,
|
|
|
|
/* 14 */ F_B6,
|
|
|
|
/* 15 */ F_B7,
|
|
|
|
/* 16 */ F_B8
|
|
|
|
} FloorID;
|
|
|
|
|
2022-04-03 22:33:50 +00:00
|
|
|
// All arrays pointed in this struct are indexed by "map indices"
|
2020-05-01 15:09:20 +00:00
|
|
|
// In dungeons, the map index corresponds to the dungeon index (which also indexes keys, items, etc)
|
|
|
|
// In overworld areas, the map index corresponds to the overworld area index (spot 00, 01, etc)
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ s16 (*floorTexIndexOffset)[8]; // dungeon texture index offset by floor
|
|
|
|
/* 0x04 */ s16* bossFloor; // floor the boss is on
|
|
|
|
/* 0x08 */ s16 (*roomPalette)[32]; // map palette by room
|
|
|
|
/* 0x0C */ s16* maxPaletteCount; // max number of palettes in a same floor
|
|
|
|
/* 0x10 */ s16 (*paletteRoom)[8][14]; // room by palette by floor
|
|
|
|
/* 0x14 */ s16 (*roomCompassOffsetX)[44]; // dungeon compass icon X offset by room
|
|
|
|
/* 0x18 */ s16 (*roomCompassOffsetY)[44]; // dungeon compass icon Y offset by room
|
|
|
|
/* 0x1C */ u8* dgnMinimapCount; // number of room minimaps
|
|
|
|
/* 0x20 */ u16* dgnMinimapTexIndexOffset; // dungeon minimap texture index offset
|
|
|
|
/* 0x24 */ u16* owMinimapTexSize;
|
|
|
|
/* 0x28 */ u16* owMinimapTexOffset;
|
|
|
|
/* 0x2C */ s16* owMinimapPosX;
|
|
|
|
/* 0x30 */ s16* owMinimapPosY;
|
|
|
|
/* 0x34 */ s16 (*owCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
|
2022-05-10 19:51:38 +00:00
|
|
|
/* 0x38 */ s16* dgnTexIndexBase; // dungeon texture index base
|
2020-05-01 15:09:20 +00:00
|
|
|
/* 0x3C */ s16 (*dgnCompassInfo)[4]; // [X scale, Y scale, X offset, Y offset]
|
|
|
|
/* 0x40 */ s16* owMinimapWidth;
|
|
|
|
/* 0x44 */ s16* owMinimapHeight;
|
|
|
|
/* 0x48 */ s16* owEntranceIconPosX; // "dungeon entrance" icon X pos
|
|
|
|
/* 0x4C */ s16* owEntranceIconPosY; // "dungeon entrance" icon Y pos
|
|
|
|
/* 0x50 */ u16* owEntranceFlag; // flag in inf_table[26] based on which entrance icons are shown (0xFFFF = always shown)
|
|
|
|
/* 0x54 */ f32 (*floorCoordY)[8]; // Y coordinate of each floor
|
|
|
|
/* 0x58 */ u16* switchEntryCount; // number of "room switch" entries, which correspond to the next 3 arrays
|
|
|
|
/* 0x5C */ u8 (*switchFromRoom)[51]; // room to come from
|
|
|
|
/* 0x60 */ u8 (*switchFromFloor)[51]; // floor to come from
|
|
|
|
/* 0x64 */ u8 (*switchToRoom)[51]; // room to go to
|
2020-06-03 20:52:10 +00:00
|
|
|
/* 0x68 */ u8 (*floorID)[8];
|
|
|
|
/* 0x6C */ s16* skullFloorIconY; // dungeon big skull icon Y pos
|
2020-05-01 15:09:20 +00:00
|
|
|
} MapData; // size = 0x70
|
|
|
|
|
2022-11-17 02:57:02 +00:00
|
|
|
// TODO get these properties from the textures themselves
|
|
|
|
#define MAP_I_TEX_WIDTH 96
|
|
|
|
#define MAP_I_TEX_HEIGHT 85
|
|
|
|
#define MAP_I_TEX_SIZE ((MAP_I_TEX_WIDTH * MAP_I_TEX_HEIGHT) / 2) // 96x85 I4 texture
|
|
|
|
|
|
|
|
#define MAP_48x85_TEX_WIDTH 48
|
|
|
|
#define MAP_48x85_TEX_HEIGHT 85
|
|
|
|
#define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct DebugDispObject {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ Vec3f pos;
|
|
|
|
/* 0x0C */ Vec3s rot;
|
|
|
|
/* 0x14 */ Vec3f scale;
|
|
|
|
/* 0x20 */ Color_RGBA8 color;
|
|
|
|
/* 0x24 */ s16 type;
|
|
|
|
/* 0x28 */ struct DebugDispObject* next;
|
|
|
|
} DebugDispObject; // size = 0x2C
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef enum {
|
2023-07-05 22:36:19 +00:00
|
|
|
/* 0 */ MTXMODE_NEW, // generates a new matrix
|
|
|
|
/* 1 */ MTXMODE_APPLY // applies transformation to the current matrix
|
2020-03-17 04:31:30 +00:00
|
|
|
} MatrixMode;
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct StackEntry {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ struct StackEntry* next;
|
|
|
|
/* 0x04 */ struct StackEntry* prev;
|
2022-07-12 16:47:25 +00:00
|
|
|
/* 0x08 */ u32* head;
|
|
|
|
/* 0x0C */ u32* tail;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x10 */ u32 initValue;
|
|
|
|
/* 0x14 */ s32 minSpace;
|
|
|
|
/* 0x18 */ const char* name;
|
|
|
|
} StackEntry;
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef enum {
|
2023-07-05 22:36:19 +00:00
|
|
|
/* 0 */ STACK_STATUS_OK,
|
|
|
|
/* 1 */ STACK_STATUS_WARNING,
|
|
|
|
/* 2 */ STACK_STATUS_OVERFLOW
|
2020-03-17 04:31:30 +00:00
|
|
|
} StackStatus;
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u32 magic; // IS64
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x04 */ u32 get;
|
|
|
|
/* 0x08 */ u8 unk_08[0x14-0x08];
|
|
|
|
/* 0x14 */ u32 put;
|
|
|
|
/* 0x18 */ u8 unk_18[0x20-0x18];
|
|
|
|
/* 0x20 */ u8 data[0x10000-0x20];
|
|
|
|
} ISVDbg;
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-04-13 23:03:10 +00:00
|
|
|
/* 0x00 */ char name[0x18];
|
|
|
|
/* 0x18 */ u32 mediaFormat;
|
|
|
|
/* 0x1C */ union {
|
2020-03-22 21:50:11 +00:00
|
|
|
struct {
|
2020-03-17 04:31:30 +00:00
|
|
|
u16 cartId;
|
|
|
|
u8 countryCode;
|
|
|
|
u8 version;
|
|
|
|
};
|
|
|
|
u32 regionInfo;
|
|
|
|
};
|
2020-04-13 23:03:10 +00:00
|
|
|
} LocaleCartInfo; // size = 0x20
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-04-13 23:03:10 +00:00
|
|
|
/* 0x00 */ char magic[4]; // Yaz0
|
|
|
|
/* 0x04 */ u32 decSize;
|
2020-06-05 17:18:39 +00:00
|
|
|
/* 0x08 */ u32 compInfoOffset; // only used in mio0
|
|
|
|
/* 0x0C */ u32 uncompDataOffset; // only used in mio0
|
2022-06-11 07:42:05 +00:00
|
|
|
/* 0x10 */ u8 data[1];
|
2020-04-13 23:03:10 +00:00
|
|
|
} Yaz0Header; // size = 0x10 ("data" is not part of the header)
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
struct ArenaNode;
|
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct Arena {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ struct ArenaNode* head;
|
|
|
|
/* 0x04 */ void* start;
|
2022-04-09 00:20:23 +00:00
|
|
|
/* 0x08 */ OSMesgQueue lockQueue;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x20 */ u8 unk_20;
|
|
|
|
/* 0x21 */ u8 isInit;
|
|
|
|
/* 0x22 */ u8 flag;
|
2020-03-22 21:50:11 +00:00
|
|
|
} Arena; // size = 0x24
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct ArenaNode {
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x00 */ s16 magic;
|
|
|
|
/* 0x02 */ s16 isFree;
|
|
|
|
/* 0x04 */ u32 size;
|
|
|
|
/* 0x08 */ struct ArenaNode* next;
|
|
|
|
/* 0x0C */ struct ArenaNode* prev;
|
|
|
|
/* 0x10 */ const char* filename;
|
|
|
|
/* 0x14 */ s32 line;
|
|
|
|
/* 0x18 */ OSId threadId;
|
|
|
|
/* 0x1C */ Arena* arena;
|
|
|
|
/* 0x20 */ OSTime time;
|
2020-03-22 21:50:11 +00:00
|
|
|
/* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding
|
|
|
|
} ArenaNode; // size = 0x30
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2023-02-27 08:14:02 +00:00
|
|
|
/* Relocation entry field getters */
|
|
|
|
#define RELOC_SECTION(reloc) ((reloc) >> 30)
|
|
|
|
#define RELOC_OFFSET(reloc) ((reloc) & 0xFFFFFF)
|
2022-05-31 18:28:17 +00:00
|
|
|
#define RELOC_TYPE_MASK(reloc) ((reloc) & 0x3F000000)
|
|
|
|
#define RELOC_TYPE_SHIFT 24
|
|
|
|
|
2023-02-27 08:14:02 +00:00
|
|
|
/* MIPS Relocation Types, matches the MIPS ELF spec */
|
|
|
|
#define R_MIPS_32 2
|
|
|
|
#define R_MIPS_26 4
|
2022-05-31 18:28:17 +00:00
|
|
|
#define R_MIPS_HI16 5
|
|
|
|
#define R_MIPS_LO16 6
|
|
|
|
|
2023-02-27 08:14:02 +00:00
|
|
|
/* Reloc section id, must fit in 2 bits otherwise the relocation format must be modified */
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ RELOC_SECTION_NULL,
|
|
|
|
/* 1 */ RELOC_SECTION_TEXT,
|
|
|
|
/* 2 */ RELOC_SECTION_DATA,
|
|
|
|
/* 3 */ RELOC_SECTION_RODATA,
|
|
|
|
/* 4 */ RELOC_SECTION_MAX
|
|
|
|
} RelocSectionId;
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
typedef struct OverlayRelocationSection {
|
|
|
|
/* 0x00 */ u32 textSize;
|
|
|
|
/* 0x04 */ u32 dataSize;
|
|
|
|
/* 0x08 */ u32 rodataSize;
|
|
|
|
/* 0x0C */ u32 bssSize;
|
|
|
|
/* 0x10 */ u32 nRelocations;
|
2023-02-27 08:14:02 +00:00
|
|
|
/* 0x14 */ u32 relocations[1]; // size is nRelocations
|
2020-03-18 20:22:00 +00:00
|
|
|
} OverlayRelocationSection; // size >= 0x18
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:50:11 +00:00
|
|
|
typedef struct {
|
2020-03-20 11:43:51 +00:00
|
|
|
/* 0x00 */ u32 resetting;
|
|
|
|
/* 0x04 */ u32 resetCount;
|
|
|
|
/* 0x08 */ OSTime duration;
|
|
|
|
/* 0x10 */ OSTime resetTime;
|
2022-04-30 23:03:22 +00:00
|
|
|
} PreNmiBuff; // size = 0x18 (actually osAppNMIBuffer is 0x40 bytes large but the rest is unused)
|
2020-03-20 11:43:51 +00:00
|
|
|
|
2022-11-13 23:07:27 +00:00
|
|
|
typedef enum {
|
|
|
|
/* 0 */ VI_MODE_EDIT_STATE_INACTIVE,
|
|
|
|
/* 1 */ VI_MODE_EDIT_STATE_ACTIVE,
|
|
|
|
/* 2 */ VI_MODE_EDIT_STATE_2, // active, more adjustments
|
|
|
|
/* 3 */ VI_MODE_EDIT_STATE_3 // active, more adjustments, print comparison with NTSC LAN1 mode
|
|
|
|
} ViModeEditState;
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
typedef struct {
|
2023-07-05 22:36:19 +00:00
|
|
|
/* 0x00 */ OSViMode customViMode;
|
|
|
|
/* 0x50 */ s32 viHeight;
|
|
|
|
/* 0x54 */ s32 viWidth;
|
|
|
|
/* 0x58 */ s32 rightAdjust;
|
|
|
|
/* 0x5C */ s32 leftAdjust;
|
|
|
|
/* 0x60 */ s32 lowerAdjust;
|
|
|
|
/* 0x64 */ s32 upperAdjust;
|
|
|
|
/* 0x68 */ s32 editState;
|
|
|
|
/* 0x6C */ s32 tvType;
|
|
|
|
/* 0x70 */ u32 loRes;
|
|
|
|
/* 0x74 */ u32 antialiasOff;
|
|
|
|
/* 0x78 */ u32 modeN; // Controls interlacing, the meaning of this mode is different based on choice of resolution
|
|
|
|
/* 0x7C */ u32 fb16Bit;
|
|
|
|
/* 0x80 */ u32 viFeatures;
|
|
|
|
/* 0x84 */ u32 unk_84;
|
|
|
|
} ViMode; // size = 0x88
|
2021-02-14 00:49:40 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#endif
|