z_debug OK (#330)

* z_debug OK

* Rename function

* Remove duplicate struct

* Update z64.h
This commit is contained in:
EllipticEllipsis 2021-10-14 16:25:14 +01:00 committed by GitHub
parent 3aeadb42b8
commit 151e098e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 13 deletions

View File

@ -1547,7 +1547,7 @@ s32 func_800E8FA4(Actor* actor, Vec3f* param_2, Vec3s* param_3, Vec3s* param_4);
s32 func_800E9138(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, f32 param_5);
s32 func_800E9250(GlobalContext* globalCtx, Actor* actor, Vec3s* param_3, Vec3s* param_4, Vec3f param_5);
u8 func_800E9360(void);
void static_context_init(void);
void GameInfo_Init(void);
// void func_800E9470(void);
void DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type, GraphicsContext* gfxCtx);
void DebugDisplay_DrawObjects(GlobalContext* globalCtx);

View File

@ -36,6 +36,7 @@
#include "z64scene.h"
#include "z64save.h"
#include "z64transition.h"
#include "regs.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@ -242,14 +243,16 @@ typedef struct {
/* 0x11D88 */ u8 unk_11D88;
} Font; // size = 0x11D8C
// Game Info aka. Static Context
// Data normally accessed through REG macros (see regs.h)
typedef struct {
/* 0x0000 */ u8 unk0;
/* 0x0001 */ u8 unk1;
/* 0x0002 */ u8 unk2;
/* 0x0003 */ u8 unk3;
/* 0x0004 */ u32 unk4;
/* 0x0008 */ UNK_TYPE1 pad8[0xC];
/* 0x0014 */ s16 data[2784]; // Accessed through REG macros
/* 0x00 */ u8 unk_00; // regPage;? // 1 is first page
/* 0x01 */ u8 unk_01; // regGroup;? // "register" group (R, RS, RO, RP etc.)
/* 0x02 */ u8 unk_02; // regCur;? // selected register within page
/* 0x03 */ u8 unk_03; // dpadLast;?
/* 0x04 */ u32 unk_04; // repeat;?
/* 0x08 */ UNK_TYPE1 pad_08[0xC];
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 entries
} GameInfo; // size = 0x15D4
typedef struct {

1
spec
View File

@ -471,7 +471,6 @@ beginseg
include "build/src/code/z_common_data.o"
include "build/data/code/z_common_data.bss.o"
include "build/src/code/z_debug.o"
include "build/data/code/z_debug.bss.o"
include "build/src/code/z_debug_display.o"
include "build/data/code/z_debug_display.data.o"
include "build/data/code/z_debug_display.bss.o"

View File

@ -24,7 +24,7 @@ void Main(void* arg) {
startHeapSize = fb - sysHeap;
SystemArena_Init(sysHeap, startHeapSize);
static_context_init();
GameInfo_Init();
R_ENABLE_ARENA_DBG = 0;

View File

@ -1,3 +1,19 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/static_context_init.s")
GameInfo* gGameInfo;
void GameInfo_Init(void) {
s32 i;
gGameInfo = (GameInfo*)SystemArena_Malloc(sizeof(GameInfo));
if (1) {}
gGameInfo->unk_00 = 0;
gGameInfo->unk_01 = 0;
gGameInfo->unk_02 = 0;
gGameInfo->unk_04 = 0;
gGameInfo->unk_03 = 0;
for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
gGameInfo->data[i] = 0;
}
}

View File

@ -1519,7 +1519,7 @@
0x800E9138:("func_800E9138",),
0x800E9250:("func_800E9250",),
0x800E9360:("func_800E9360",),
0x800E93E0:("static_context_init",),
0x800E93E0:("GameInfo_Init",),
0x800E9470:("func_800E9470",),
0x800E9488:("DebugDisplay_AddObject",),
0x800E9564:("DebugDisplay_DrawObjects",),

View File

@ -1033,7 +1033,7 @@ asm/non_matchings/code/code_800E8EA0/func_800E8FA4.s,func_800E8FA4,0x800E8FA4,0x
asm/non_matchings/code/code_800E8EA0/func_800E9138.s,func_800E9138,0x800E9138,0x46
asm/non_matchings/code/code_800E8EA0/func_800E9250.s,func_800E9250,0x800E9250,0x44
asm/non_matchings/code/z_common_data/func_800E9360.s,func_800E9360,0x800E9360,0x20
asm/non_matchings/code/z_debug/static_context_init.s,static_context_init,0x800E93E0,0x24
asm/non_matchings/code/z_debug/GameInfo_Init.s,GameInfo_Init,0x800E93E0,0x24
asm/non_matchings/code/z_debug_display/func_800E9470.s,func_800E9470,0x800E9470,0x6
asm/non_matchings/code/z_debug_display/DebugDisplay_AddObject.s,DebugDisplay_AddObject,0x800E9488,0x37
asm/non_matchings/code/z_debug_display/DebugDisplay_DrawObjects.s,DebugDisplay_DrawObjects,0x800E9564,0x24

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
1033 asm/non_matchings/code/code_800E8EA0/func_800E9138.s func_800E9138 0x800E9138 0x46
1034 asm/non_matchings/code/code_800E8EA0/func_800E9250.s func_800E9250 0x800E9250 0x44
1035 asm/non_matchings/code/z_common_data/func_800E9360.s func_800E9360 0x800E9360 0x20
1036 asm/non_matchings/code/z_debug/static_context_init.s asm/non_matchings/code/z_debug/GameInfo_Init.s static_context_init GameInfo_Init 0x800E93E0 0x24
1037 asm/non_matchings/code/z_debug_display/func_800E9470.s func_800E9470 0x800E9470 0x6
1038 asm/non_matchings/code/z_debug_display/DebugDisplay_AddObject.s DebugDisplay_AddObject 0x800E9488 0x37
1039 asm/non_matchings/code/z_debug_display/DebugDisplay_DrawObjects.s DebugDisplay_DrawObjects 0x800E9564 0x24