1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 15:34:41 +00:00

DbCamera to DebugCamera (#1482)

* better dbCam prefix

* missed some

* PR Suggestions

* alignment

* more debug

* cleanup
This commit is contained in:
engineer124 2023-01-12 16:06:31 -05:00 committed by GitHub
parent 542012efa6
commit 1149530c92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1050 additions and 1076 deletions

View file

@ -1,32 +1,32 @@
#include "global.h"
typedef struct {
u8 x;
u8 y;
u8 colorIndex;
char text[21];
} DbCameraTextBufferEntry; // size = 0x18
/* 0x0 */ u8 x;
/* 0x1 */ u8 y;
/* 0x2 */ u8 colorIndex;
/* 0x3 */ char text[21];
} DebugCamTextBufferEntry; // size = 0x18
typedef struct {
u16 hold;
u16 press;
/* 0x0 */ u16 hold;
/* 0x2 */ u16 press;
} InputCombo; // size = 0x4
RegEditor* gRegEditor;
DbCameraTextBufferEntry sDbCameraTextBuffer[22];
DebugCamTextBufferEntry sDebugCamTextBuffer[22];
s16 sDbCameraTextEntryCount = 0;
s16 sDebugCamTextEntryCount = 0;
Color_RGBA8 sDbCameraTextColors[] = {
{ 255, 255, 32, 192 }, // DBCAMERA_TEXT_YELLOW
{ 255, 150, 128, 192 }, // DBCAMERA_TEXT_PEACH
{ 128, 96, 0, 64 }, // DBCAMERA_TEXT_BROWN
{ 192, 128, 16, 128 }, // DBCAMERA_TEXT_ORANGE
{ 255, 192, 32, 128 }, // DBCAMERA_TEXT_GOLD
{ 230, 230, 220, 64 }, // DBCAMERA_TEXT_WHITE
{ 128, 150, 255, 128 }, // DBCAMERA_TEXT_BLUE
{ 128, 255, 32, 128 }, // DBCAMERA_TEXT_GREEN
Color_RGBA8 sDebugCamTextColors[] = {
{ 255, 255, 32, 192 }, // DEBUG_CAM_TEXT_YELLOW
{ 255, 150, 128, 192 }, // DEBUG_CAM_TEXT_PEACH
{ 128, 96, 0, 64 }, // DEBUG_CAM_TEXT_BROWN
{ 192, 128, 16, 128 }, // DEBUG_CAM_TEXT_ORANGE
{ 255, 192, 32, 128 }, // DEBUG_CAM_TEXT_GOLD
{ 230, 230, 220, 64 }, // DEBUG_CAM_TEXT_WHITE
{ 128, 150, 255, 128 }, // DEBUG_CAM_TEXT_BLUE
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
};
InputCombo sRegGroupInputCombos[REG_GROUPS] = {
@ -108,16 +108,16 @@ void Regs_Init(void) {
}
}
// Function is stubbed. Name is assumed by similarities in signature to `DbCamera_ScreenTextColored` and usage.
void DbCamera_ScreenText(u8 x, u8 y, const char* text) {
// Function is stubbed. Name is assumed by similarities in signature to `DebugCamera_ScreenTextColored` and usage.
void DebugCamera_ScreenText(u8 x, u8 y, const char* text) {
}
void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
DbCameraTextBufferEntry* entry = &sDbCameraTextBuffer[sDbCameraTextEntryCount];
void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
DebugCamTextBufferEntry* entry = &sDebugCamTextBuffer[sDebugCamTextEntryCount];
char* textDest;
s16 charCount;
if (sDbCameraTextEntryCount < ARRAY_COUNT(sDbCameraTextBuffer)) {
if (sDebugCamTextEntryCount < ARRAY_COUNT(sDebugCamTextBuffer)) {
entry->x = x;
entry->y = y;
entry->colorIndex = colorIndex;
@ -134,18 +134,18 @@ void DbCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text) {
*textDest = '\0';
sDbCameraTextEntryCount++;
sDebugCamTextEntryCount++;
}
}
void DbCamera_DrawScreenText(GfxPrint* printer) {
void DebugCamera_DrawScreenText(GfxPrint* printer) {
s32 i;
Color_RGBA8* color;
DbCameraTextBufferEntry* entry;
DebugCamTextBufferEntry* entry;
for (i = 0; i < sDbCameraTextEntryCount; i++) {
entry = &sDbCameraTextBuffer[i];
color = &sDbCameraTextColors[entry->colorIndex];
for (i = 0; i < sDebugCamTextEntryCount; i++) {
entry = &sDebugCamTextBuffer[i];
color = &sDebugCamTextColors[entry->colorIndex];
GfxPrint_SetColor(printer, color->r, color->g, color->b, color->a);
GfxPrint_SetPos(printer, entry->x, entry->y);
@ -288,14 +288,14 @@ void Debug_DrawText(GraphicsContext* gfxCtx) {
GfxPrint_Open(&printer, gfx);
if ((OREG(0) == 1) || (OREG(0) == 8)) {
DbCamera_DrawScreenText(&printer);
DebugCamera_DrawScreenText(&printer);
}
if (gRegEditor->regPage != 0) {
Regs_DrawEditor(&printer);
}
sDbCameraTextEntryCount = 0;
sDebugCamTextEntryCount = 0;
gfx = GfxPrint_Close(&printer);
gSPEndDisplayList(gfx++);