Debug camera (#2400)

* Moves SoH mixer to SoH from LUS.

* Debug camera now works in SoH, but mempak saving does not (yet).

* Debug camera is now enabled/disabled based on the gDebugEnabled cvar.

* Updates OTRGlobals comments

* Updates OTRGlobals comments
This commit is contained in:
Kenix3 2023-01-26 18:43:09 -05:00 committed by GitHub
parent 569013535e
commit 47f206825d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 229 additions and 212 deletions

View File

@ -40,6 +40,7 @@
#include "Enhancements/n64_weird_frame_data.inc" #include "Enhancements/n64_weird_frame_data.inc"
#include "frame_interpolation.h" #include "frame_interpolation.h"
#include "variables.h" #include "variables.h"
#include "z64.h"
#include "macros.h" #include "macros.h"
#include <Utils/StringHelper.h> #include <Utils/StringHelper.h>
#include <Hooks.h> #include <Hooks.h>
@ -107,6 +108,87 @@ CustomMessageManager* CustomMessageManager::Instance;
ItemTableManager* ItemTableManager::Instance; ItemTableManager* ItemTableManager::Instance;
GameInteractor* GameInteractor::Instance; GameInteractor* GameInteractor::Instance;
extern "C" char** cameraStrings;
std::vector<std::shared_ptr<std::string>> cameraStdStrings;
// OTRTODO: A lot of these left in Japanese are used by the mempak manager. LUS does not currently support mempaks. Ignore unused ones.
const char* constCameraStrings[] = {
"INSUFFICIENT",
"KEYFRAMES",
"YOU CAN ADD MORE",
"FINISHED",
"PLAYING",
"DEMO CAMERA TOOL",
"CANNOT PLAY",
"KEYFRAME ",
"PNT / ",
"> >",
"< <",
"< >",
GFXP_KATAKANA "*プレイヤ-*",
"E MODE FIX",
"E MODE ABS",
GFXP_HIRAGANA "ガメン" GFXP_KATAKANA " デモ", // OTRTODO: Unused, get a translation! Number 15
GFXP_HIRAGANA "ガメン フツウ", // OTRTODO: Unused, get a translation! Number 16
"P TIME MAX",
GFXP_KATAKANA "リンク" GFXP_HIRAGANA " キオク", // OTRTODO: Unused, get a translation! Number 18
GFXP_KATAKANA "リンク" GFXP_HIRAGANA " ムシ", // OTRTODO: Unused, get a translation! Number 19
"*VIEWPT*",
"*CAMPOS*",
"DEBUG CAMERA",
"CENTER/LOCK",
"CENTER/FREE",
"DEMO CONTROL",
GFXP_KATAKANA "メモリ" GFXP_HIRAGANA "ガタリマセン",
"p",
"e",
"s",
"l",
"c",
GFXP_KATAKANA "メモリパック",
GFXP_KATAKANA "セーブ",
GFXP_KATAKANA "ロード",
GFXP_KATAKANA "クリア-",
GFXP_HIRAGANA "ヲヌカナイデネ",
"FREE BYTE",
"NEED BYTE",
GFXP_KATAKANA "*メモリ-パック*",
GFXP_HIRAGANA "ヲミツケラレマセン",
GFXP_KATAKANA "ファイル " GFXP_HIRAGANA "",
GFXP_HIRAGANA "シテモイイデスカ?",
GFXP_HIRAGANA "ゲンザイヘンシュウチュウノ", // OTRTODO: Unused, get a translation! Number 43
GFXP_KATAKANA "ファイル" GFXP_HIRAGANA "ハハキサレマス", // OTRTODO: Unused, get a translation! Number 44
GFXP_HIRAGANA "ハイ",
GFXP_HIRAGANA "イイエ",
GFXP_HIRAGANA "シテイマス",
GFXP_HIRAGANA "ウワガキ", // OTRTODO: Unused, get a translation! Number 48
GFXP_HIRAGANA "シマシタ",
"USE BYTE",
GFXP_HIRAGANA "ニシッパイ",
"E MODE REL",
"FRAME ",
"KEY / ",
"(CENTER)",
"(ORIG)",
"(PLAYER)",
"(ALIGN)",
"(SET)",
"(OBJECT)",
GFXP_KATAKANA "ポイントNo. ", // OTRTODO: Unused, need translation. Number 62
"FOV ",
"N FRAME ",
"Z ROT ",
GFXP_KATAKANA "モ-ド ", // OTRTODO: Unused, need translation. Number 65
" R FOCUS ",
"PMAX ",
"DEPTH ",
"XROT ",
"YROT ",
GFXP_KATAKANA "フレ-ム ",
GFXP_KATAKANA "ト-タル ",
GFXP_KATAKANA "キ- / ",
};
OTRGlobals::OTRGlobals() { OTRGlobals::OTRGlobals() {
std::vector<std::string> OTRFiles; std::vector<std::string> OTRFiles;
std::string mqPath = Ship::Window::GetPathRelativeToAppDirectory("oot-mq.otr"); std::string mqPath = Ship::Window::GetPathRelativeToAppDirectory("oot-mq.otr");
@ -165,6 +247,16 @@ OTRGlobals::OTRGlobals() {
hasMasterQuest = hasOriginal = false; hasMasterQuest = hasOriginal = false;
// Move the camera strings from read only memory onto the heap (writable memory)
// This is in OTRGlobals right now because this is a place that will only ever be run once at the beginning of startup.
// We should probably find some code in db_camera that does initialization and only run once, and then dealloc on deinitialization.
cameraStrings = (char**)malloc(sizeof(constCameraStrings));
for (int32_t i = 0; i < sizeof(constCameraStrings) / sizeof(char*); i++) {
// OTRTODO: never deallocated...
auto dup = strdup(constCameraStrings[i]);
cameraStrings[i] = dup;
}
auto versions = context->GetResourceManager()->GetGameVersions(); auto versions = context->GetResourceManager()->GetGameVersions();
for (uint32_t version : versions) { for (uint32_t version : versions) {

View File

@ -3,75 +3,7 @@
static PlayState* sPlayState; static PlayState* sPlayState;
// TODO: cleanup these arrays and UB access char** cameraStrings = {0};
char* D_8012CEE0[] = { GFXP_KATAKANA "キ-フレ-ム" GFXP_HIRAGANA "ガ" };
char* D_8012CEE4 = GFXP_HIRAGANA "タリマセン。";
char* D_8012CEE8 = GFXP_HIRAGANA "サイセイデキマセン";
char* D_8012CEEC = GFXP_HIRAGANA "サイセイシュウリョウ";
char* D_8012CEF0 = GFXP_HIRAGANA "サイセイチュウ!";
char* D_8012CEF4 = "DEMO CAMERA TOOL";
char* D_8012CEF8[] = { GFXP_HIRAGANA "モウハイリマセン", GFXP_HIRAGANA "トウロク テンメ", GFXP_HIRAGANA "ヘンコウ / " };
char* D_8012CF04 = "> >";
char* D_8012CF08 = "< <";
char* D_8012CF0C = "< >";
char* D_8012CF10 = GFXP_KATAKANA "*プレイヤ-*";
char* D_8012CF14 = GFXP_KATAKANA "Eモ-ド" GFXP_HIRAGANA " ソウタイ";
char* D_8012CF18[] = { GFXP_KATAKANA "Eモ-ド" GFXP_HIRAGANA "ゼッタイ", GFXP_HIRAGANA "ガメン" GFXP_KATAKANA " デモ",
GFXP_HIRAGANA "ガメン フツウ" };
char* D_8012CF24[] = { GFXP_HIRAGANA "Pジカン MAX", GFXP_KATAKANA "リンク" GFXP_HIRAGANA " キオク",
GFXP_KATAKANA "リンク" GFXP_HIRAGANA " ムシ" };
char* D_8012CF30 = GFXP_HIRAGANA "*ミテルイチ*";
char* D_8012CF34 = GFXP_KATAKANA "*カメラ" GFXP_HIRAGANA "イチ*";
char* D_8012CF38 = "DEBUG CAMERA";
char* D_8012CF3C = GFXP_KATAKANA "センタ-/ロック";
char* D_8012CF40 = GFXP_KATAKANA "センタ-/フリ-";
char* D_8012CF44 = "DEMO CONTROL";
char* D_8012CF48 = GFXP_KATAKANA "メモリ" GFXP_HIRAGANA "ガタリマセン";
char* D_8012CF4C = "p";
char* D_8012CF50[] = { "e", "s", "l", "c" };
char* D_8012CF60[] = { GFXP_KATAKANA "メモリパック" }; // "Mempak"
char* D_8012CF64 = GFXP_KATAKANA "セーブ"; // "Save"
char* D_8012CF68 = GFXP_KATAKANA "ロード"; // "Load"
char* D_8012CF6C = GFXP_KATAKANA "クリア-"; // "Clear"
char* D_8012CF70 = GFXP_HIRAGANA "ヲヌカナイデネ";
char* D_8012CF74 = "FREE BYTE";
char* D_8012CF78 = "NEED BYTE";
char* D_8012CF7C = GFXP_KATAKANA "*メモリ-パック*";
char* D_8012CF80 = GFXP_HIRAGANA "ヲミツケラレマセン";
char* D_8012CF84 = GFXP_KATAKANA "ファイル " GFXP_HIRAGANA "";
char* D_8012CF88[] = { GFXP_HIRAGANA "シテモイイデスカ?", GFXP_HIRAGANA "ゲンザイヘンシュウチュウノ",
GFXP_KATAKANA "ファイル" GFXP_HIRAGANA "ハハキサレマス" };
char* D_8012CF94 = GFXP_HIRAGANA "ハイ";
char* D_8012CF98 = GFXP_HIRAGANA "イイエ";
char* D_8012CF9C[] = { GFXP_HIRAGANA "シテイマス", GFXP_HIRAGANA "ウワガキ" };
char* D_8012CFA4 = GFXP_HIRAGANA "シマシタ";
char* D_8012CFA8 = "USE BYTE";
char* D_8012CFAC = GFXP_HIRAGANA "ニシッパイ";
char* D_8012CFB0 = GFXP_KATAKANA "Eモ-ド" GFXP_HIRAGANA " コテイ";
char D_8012CFB4[] = GFXP_KATAKANA "フレ-ム ";
char D_8012CFC4[] = GFXP_KATAKANA "キ- / ";
char D_8012CFD0[] = GFXP_HIRAGANA "(センタ-テン)\0\0\0\0\0";
char D_8012CFE4[] = GFXP_HIRAGANA "(ゲンテン)\0\0\0\0\0\0";
char D_8012CFF8[] = GFXP_KATAKANA "(プレイヤ-)\0\0\0\0\0";
char D_8012D00C[] = GFXP_HIRAGANA "(イチアワセ)\0\0\0\0\0\0";
char D_8012D020[] = GFXP_HIRAGANA "(セッテイ)\0\0\0\0\0\0\0\0";
char D_8012D034[] = GFXP_HIRAGANA "(キャッカン)\0\0\0\0\0\0";
char D_8012D048[] = GFXP_KATAKANA "ポイントNo. \0\0\0";
char D_8012D05C[] = GFXP_HIRAGANA "ガカク \0\0\0";
char D_8012D070[] = GFXP_KATAKANA "Nフレ-ム \0\0\0\0";
char D_8012D084[] = GFXP_HIRAGANA "Zカイテン \0\0\0";
char D_8012D098[] = GFXP_KATAKANA "モ-ド \0\0\0\0";
char D_8012D0AC[] = " R" GFXP_HIRAGANA "チュウシン \0\0\0";
char D_8012D0C0[] = GFXP_HIRAGANA "Pジカン \0\0";
char D_8012D0D4[] = GFXP_HIRAGANA "キョリ \0";
char D_8012D0E4[] = GFXP_HIRAGANA "Xカイテン \0\0";
char D_8012D0F8[] = GFXP_HIRAGANA "Yカイテン \0\0";
#define ACTION_E 0 #define ACTION_E 0
#define ACTION_SAVE 1 #define ACTION_SAVE 1
@ -94,6 +26,7 @@ static DbCamera* sDbCamPtr;
static s16 D_8016110C; static s16 D_8016110C;
static DbCameraAnim sDbCamAnim; static DbCameraAnim sDbCamAnim;
Vec3f* DbCamera_AddVecSph(Vec3f* out, Vec3f* in, VecSph* sph) { Vec3f* DbCamera_AddVecSph(Vec3f* out, Vec3f* in, VecSph* sph) {
Vec3f ret; Vec3f ret;
Vec3f vec; Vec3f vec;
@ -168,9 +101,6 @@ char* DbCamera_SetTextValue(s16 value, char* str, u8 endIdx) {
char* strIter; char* strIter;
char sign; char sign;
// OTRTODO - This crashes...
return;
strIter = str + (s32)endIdx - 1; strIter = str + (s32)endIdx - 1;
str[endIdx] = '\0'; str[endIdx] = '\0';
@ -367,9 +297,9 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
sDbCamAnim.unk_0A = 0; sDbCamAnim.unk_0A = 0;
} }
func_8006376C(0x11, 0x17, 3, D_8012CEE0[0]); func_8006376C(0x0D, 0x17, 3, cameraStrings[0]);
func_8006376C(0x12, 0x18, 3, D_8012CEE4); func_8006376C(0x0E, 0x18, 3, cameraStrings[1]);
func_8006376C(0x10, 0x1A, 1, D_8012CEE8); func_8006376C(0x0B, 0x1A, 1, cameraStrings[2]);
return; return;
} }
@ -383,7 +313,7 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) { if (dbCamera->sub.nFrames > 0 && dbCamera->sub.nFrames < sDbCamAnim.unk_04) {
sDbCamAnim.unk_0A = 0; sDbCamAnim.unk_0A = 0;
func_8006376C(0xF, 0x1A, 1, D_8012CEEC); func_8006376C(0xF, 0x1A, 1, cameraStrings[3]);
} }
if (dbCamera->sub.mode != 1) { if (dbCamera->sub.mode != 1) {
@ -398,19 +328,19 @@ void func_800B44E0(DbCamera* dbCamera, Camera* cam) {
dbCamera->roll = sDbCamAnim.roll; dbCamera->roll = sDbCamAnim.roll;
dbCamera->rollDegrees = sDbCamAnim.roll * (360.0f / 256.0f); dbCamera->rollDegrees = sDbCamAnim.roll * (360.0f / 256.0f);
DbCamera_SetTextValue(sDbCamAnim.unk_04, &D_8012CFB4[8], 4); DbCamera_SetTextValue(sDbCamAnim.unk_04, &cameraStrings[53][6], 4);
func_8006376C(0x10, 0x17, 3, D_8012CFB4); func_8006376C(0x10, 0x17, 3, cameraStrings[53]);
D_8012CFC4[5] = ((sDbCamAnim.keyframe + 1) / 10) + '0'; cameraStrings[54][4] = ((sDbCamAnim.keyframe + 1) / 10) + '0';
D_8012CFC4[6] = ((sDbCamAnim.keyframe + 1) % 10) + '0'; cameraStrings[54][5] = ((sDbCamAnim.keyframe + 1) % 10) + '0';
D_8012CFC4[8] = ((dbCamera->sub.nPoints - 5) / 10) + '0'; cameraStrings[54][7] = ((dbCamera->sub.nPoints - 5) / 10) + '0';
D_8012CFC4[9] = ((dbCamera->sub.nPoints - 5) % 10) + '0'; cameraStrings[54][8] = ((dbCamera->sub.nPoints - 5) % 10) + '0';
func_8006376C(0x10, 0x18, 3, D_8012CFC4); func_8006376C(0x10, 0x18, 3, cameraStrings[54]);
func_8006376C(0x10, 0x1A, 1, D_8012CEF0); func_8006376C(0x10, 0x1A, 1, cameraStrings[4]);
return; return;
} }
sDbCamAnim.unk_0A = 0; sDbCamAnim.unk_0A = 0;
func_8006376C(0xF, 0x1A, 1, D_8012CEEC); func_8006376C(0xF, 0x1A, 1, cameraStrings[3]);
} }
void DbCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* points) { void DbCamera_PrintPoints(const char* name, s16 count, CutsceneCameraPoint* points) {
@ -986,7 +916,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
if (dbCamera->unk_00 == 1) { if (dbCamera->unk_00 == 1) {
OREG(0) = 8; OREG(0) = 8;
func_8006376C(0xC, 5, 0, D_8012CEF4); func_8006376C(0xC, 5, 0, cameraStrings[5]);
if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_CRIGHT) && if (CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_CRIGHT) &&
!CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) { !CHECK_BTN_ALL(sPlayState->state.input[2].cur.button, BTN_L)) {
func_800B44E0(dbCamera, cam); func_800B44E0(dbCamera, cam);
@ -1068,21 +998,21 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} }
func_8006376C(0xA, 6, (dbCamera->sub.unk_08 == 0) ? 7 : 4, D_8012D00C); func_8006376C(0xA, 6, (dbCamera->sub.unk_08 == 0) ? 7 : 4, cameraStrings[58]);
func_8006376C(0x11, 6, (dbCamera->sub.unk_08 == 1) ? 7 : 4, D_8012D020); func_8006376C(0x11, 6, (dbCamera->sub.unk_08 == 1) ? 7 : 4, cameraStrings[59]);
func_8006376C(0x17, 6, (dbCamera->sub.unk_08 == 2) ? 7 : 4, D_8012D034); func_8006376C(0x17, 6, (dbCamera->sub.unk_08 == 2) ? 7 : 4, cameraStrings[60]);
if (dbCamera->sub.unkIdx == 0x80) { if (dbCamera->sub.unkIdx == 0x80) {
func_8006376C(0x10, 0x1A, 1, D_8012CEF8[0]); func_8006376C(0x10, 0x1A, 1, cameraStrings[6]);
} else if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) { } else if (dbCamera->sub.unkIdx == (dbCamera->sub.nPoints - 1)) {
D_8012CEE0[7][10] = (dbCamera->sub.nPoints / 10) + '0'; cameraStrings[7][8] = (dbCamera->sub.nPoints / 10) + '0';
D_8012CEE0[7][11] = (dbCamera->sub.nPoints % 10) + '0'; cameraStrings[7][9] = (dbCamera->sub.nPoints % 10) + '0';
func_8006376C(0xF, 0x1A, 1, D_8012CEE0[7]); func_8006376C(0xF, 0x1A, 1, cameraStrings[7]);
} else { } else {
D_8012CEE0[8][10] = ((dbCamera->sub.unkIdx + 1) / 10) + '0'; cameraStrings[8][4] = ((dbCamera->sub.unkIdx + 1) / 10) + '0';
D_8012CEE0[8][11] = ((dbCamera->sub.unkIdx + 1) % 10) + '0'; cameraStrings[8][5] = ((dbCamera->sub.unkIdx + 1) % 10) + '0';
D_8012CEE0[8][13] = ((dbCamera->sub.nPoints - 1) / 10) + '0'; cameraStrings[8][7] = ((dbCamera->sub.nPoints - 1) / 10) + '0';
D_8012CEE0[8][14] = ((dbCamera->sub.nPoints - 1) % 10) + '0'; cameraStrings[8][8] = ((dbCamera->sub.nPoints - 1) % 10) + '0';
func_8006376C(0xF, 0x1A, 1, D_8012CEE0[8]); func_8006376C(0xF, 0x1A, 1, cameraStrings[8]);
} }
switch (dbCamera->sub.unk_08) { switch (dbCamera->sub.unk_08) {
@ -1092,16 +1022,16 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
case 0: case 0:
dbCamera->unk_3C = false; dbCamera->unk_3C = false;
if (dbCamera->sub.mode != 1) { if (dbCamera->sub.mode != 1) {
func_8006376C(0xD, 0x18, 3, !D_80161144 ? D_8012CF04 : D_8012CF08); func_8006376C(0xD, 0x18, 3, !D_80161144 ? cameraStrings[9] : cameraStrings[10]);
DbCamera_SetTextValue(sp104.pitch * 0.00549325f, &D_8012D0E4[11], 4); DbCamera_SetTextValue(sp104.pitch * 0.00549325f, &cameraStrings[69][6], 4);
func_8006376C(0xF, 0x17, 3, D_8012D0E4); func_8006376C(0xF, 0x17, 3, cameraStrings[69]);
DbCamera_SetTextValue(sp104.yaw * 0.00549325f, &D_8012D0F8[11], 4); DbCamera_SetTextValue(sp104.yaw * 0.00549325f, &cameraStrings[70][6], 4);
func_8006376C(0xF, 0x18, 3, D_8012D0F8); func_8006376C(0xF, 0x18, 3, cameraStrings[70]);
DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); DbCamera_SetTextValue(sp104.r, &cameraStrings[68][5], 5);
func_8006376C(0xF, 0x19, 3, D_8012D0D4); func_8006376C(0xF, 0x19, 3, cameraStrings[68]);
} else { } else {
func_8006376C(0xE, 0x18, 3, D_8012CF0C); func_8006376C(0xE, 0x18, 3, cameraStrings[11]);
func_8006376C(0x10, 0x16, 3, D_8012CF10); func_8006376C(0x10, 0x16, 3, cameraStrings[12]);
sp110 = 'X'; sp110 = 'X';
DbCamera_SetTextValue(temp_s6->pos.x, &sp111, 7); DbCamera_SetTextValue(temp_s6->pos.x, &sp111, 7);
func_8006376C(0x10, 0x17, 3, &sp110); func_8006376C(0x10, 0x17, 3, &sp110);
@ -1296,35 +1226,35 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
} }
} }
DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle, &D_8012D05C[10], 3); DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].viewAngle, &cameraStrings[62][10], 3);
func_8006376C(0x10, 0x14, (dbCamera->sub.unk_0A == 0) ? 7 : 4, D_8012D05C); func_8006376C(0x0E, 0x14, (dbCamera->sub.unk_0A == 0) ? 7 : 4, cameraStrings[62]);
DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame, &D_8012D070[9], 3); DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].nextPointFrame, &cameraStrings[63][10], 3);
func_8006376C(0x10, 0x15, (dbCamera->sub.unk_0A == 1) ? 7 : 4, D_8012D070); func_8006376C(0x0E, 0x15, (dbCamera->sub.unk_0A == 1) ? 7 : 4, cameraStrings[63]);
DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll, &D_8012D084[10], 3); DbCamera_SetTextValue(dbCamera->sub.lookAt[dbCamera->sub.unkIdx].cameraRoll, &cameraStrings[64][10], 3);
func_8006376C(0x10, 0x16, (dbCamera->sub.unk_0A == 2) ? 7 : 4, D_8012D084); func_8006376C(0x0E, 0x16, (dbCamera->sub.unk_0A == 2) ? 7 : 4, cameraStrings[64]);
func_8006376C(0xF, 0x17, (dbCamera->sub.unk_0A == 3) ? 7 : 4, func_8006376C(0xF, 0x17, (dbCamera->sub.unk_0A == 3) ? 7 : 4,
(dbCamera->sub.mode == 1) ? D_8012CF14 (dbCamera->sub.mode == 1) ? cameraStrings[13]
: (dbCamera->sub.mode == 0) ? *D_8012CF18 : (dbCamera->sub.mode == 0) ? cameraStrings[14]
: D_8012CFB0); : cameraStrings[52]);
if (dbCamera->sub.unk_0C) { if (dbCamera->sub.unk_0C) {
D_8012D05C[80] = '>'; cameraStrings[66][0] = '>';
} else { } else {
D_8012D05C[80] = '<'; cameraStrings[66][0] = '<';
} }
D_8012D05C[81] = ' '; cameraStrings[66][1] = ' ';
D_8012D05C[94] = ' '; cameraStrings[66][9] = ' ';
if (dbCamera->sub.unk_0C) { if (dbCamera->sub.unk_0C) {
D_8012D05C[95] = '>'; cameraStrings[66][10] = '>';
} else { } else {
D_8012D05C[95] = '<'; cameraStrings[66][10] = '<';
} }
D_8012D05C[96] = '\0'; cameraStrings[66][11] = '\0';
func_8006376C(0xF, 0x18, (dbCamera->sub.unk_0A == 4) ? 7 : 4, D_8012D0AC); func_8006376C(0xF, 0x18, (dbCamera->sub.unk_0A == 4) ? 7 : 4, cameraStrings[66]);
DbCamera_SetTextValue(dbCamera->sub.nFrames, &D_8012D0C0[10], 5); DbCamera_SetTextValue(dbCamera->sub.nFrames, &cameraStrings[67][10], 5);
func_8006376C(0xF, 0x19, (dbCamera->sub.unk_0A == 5) ? 7 : 4, func_8006376C(0xF, 0x19, (dbCamera->sub.unk_0A == 5) ? 7 : 4,
(dbCamera->sub.nFrames == -1) ? *D_8012CF24 : D_8012D0C0); (dbCamera->sub.nFrames == -1) ? cameraStrings[17] : cameraStrings[67]);
break; break;
} }
@ -1333,7 +1263,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7
: !D_80161144 ? 4 : !D_80161144 ? 4
: 3, : 3,
D_8012CF30); cameraStrings[20]);
sp110 = 'X'; sp110 = 'X';
DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6); DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6);
func_8006376C(3, 0x17, 2, &sp110); func_8006376C(3, 0x17, 2, &sp110);
@ -1347,7 +1277,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7
: D_80161144 ? 4 : D_80161144 ? 4
: 3, : 3,
D_8012CF34); cameraStrings[21]);
sp110 = 'X'; sp110 = 'X';
DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6); DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6);
func_8006376C(0x1E, 0x17, 2, &sp110); func_8006376C(0x1E, 0x17, 2, &sp110);
@ -1358,33 +1288,32 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6); DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6);
func_8006376C(0x1E, 0x19, 2, &sp110); func_8006376C(0x1E, 0x19, 2, &sp110);
} else { } else {
if (D_8012CEE0[0]) {}
OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp7C); OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp7C);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
func_8006376C(3, 0x16, func_8006376C(3, 0x16,
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && !D_80161144) ? 7
: !D_80161144 ? 4 : !D_80161144 ? 4
: 3, : 3,
D_8012CF30); cameraStrings[20]);
DbCamera_SetTextValue(spFC.pitch * 0.00549325f, &D_8012D0E4[10], 4); DbCamera_SetTextValue(spFC.pitch * 0.00549325f, &cameraStrings[69][5], 4);
func_8006376C(3, 0x17, 3, D_8012D0E4); func_8006376C(3, 0x17, 3, cameraStrings[69]);
DbCamera_SetTextValue(spFC.yaw * 0.00549325f, &D_8012D0F8[10], 4); DbCamera_SetTextValue(spFC.yaw * 0.00549325f, &cameraStrings[70][5], 4);
func_8006376C(3, 0x18, 3, D_8012D0F8); func_8006376C(3, 0x18, 3, cameraStrings[70]);
DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); DbCamera_SetTextValue(spFC.r, &cameraStrings[68][5], 5);
func_8006376C(3, 0x19, 3, D_8012D0D4); func_8006376C(3, 0x19, 3, cameraStrings[68]);
OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp80); OLib_Vec3fDiffToVecSphGeo(&spFC, sp90, sp80);
spFC.yaw -= cam->playerPosRot.rot.y; spFC.yaw -= cam->playerPosRot.rot.y;
func_8006376C(0x1E, 0x16, func_8006376C(0x1E, 0x16,
((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7 ((dbCamera->sub.unk_08 == 1) && (dbCamera->sub.unk_0A == 4) && D_80161144) ? 7
: D_80161144 ? 4 : D_80161144 ? 4
: 3, : 3,
D_8012CF34); cameraStrings[21]);
DbCamera_SetTextValue(spFC.pitch * 0.00549325f, &D_8012D0E4[10], 4); DbCamera_SetTextValue(spFC.pitch * 0.00549325f, &cameraStrings[69][5], 4);
func_8006376C(0x1C, 0x17, 3, D_8012D0E4); func_8006376C(0x1C, 0x17, 3, cameraStrings[69]);
DbCamera_SetTextValue(spFC.yaw * 0.00549325f, &D_8012D0F8[10], 4); DbCamera_SetTextValue(spFC.yaw * 0.00549325f, &cameraStrings[70][5], 4);
func_8006376C(0x1C, 0x18, 3, D_8012D0F8); func_8006376C(0x1C, 0x18, 3, cameraStrings[70]);
DbCamera_SetTextValue(spFC.r, &D_8012D0D4[7], 6); DbCamera_SetTextValue(spFC.r, &cameraStrings[68][5], 5);
func_8006376C(0x1C, 0x19, 3, D_8012D0D4); func_8006376C(0x1C, 0x19, 3, cameraStrings[68]);
} }
DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f, DebugDisplay_AddObject(dbCamera->at.x, dbCamera->at.y + 1.0f, dbCamera->at.z, 0, 0, 0, 0.02f, 2.0f, 0.02f,
@ -1429,11 +1358,11 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
dbCamera->unk_38 = -1; dbCamera->unk_38 = -1;
} }
func_8006376C(0xE, 5, 0, D_8012CF38); func_8006376C(0xE, 5, 0, cameraStrings[22]);
func_8006376C(9, 6, (dbCamera->unk_78 == 0) ? 7 : 4, D_8012CFD0); func_8006376C(9, 6, (dbCamera->unk_78 == 0) ? 7 : 4, cameraStrings[55]);
func_8006376C(0x11, 6, (dbCamera->unk_78 == 1) ? 7 : 4, D_8012CFE4); func_8006376C(0x11, 6, (dbCamera->unk_78 == 1) ? 7 : 4, cameraStrings[56]);
func_8006376C(0x18, 6, (dbCamera->unk_78 == 2) ? 7 : 4, D_8012CFF8); func_8006376C(0x18, 6, (dbCamera->unk_78 == 2) ? 7 : 4, cameraStrings[57]);
func_8006376C(3, 0x16, D_80161144 ? 3 : 4, D_8012CF30); func_8006376C(3, 0x16, D_80161144 ? 3 : 4, cameraStrings[20]);
sp110 = 'X'; sp110 = 'X';
DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6); DbCamera_SetTextValue(dbCamera->at.x, &sp111, 6);
func_8006376C(3, 0x17, 2, &sp110); func_8006376C(3, 0x17, 2, &sp110);
@ -1443,7 +1372,7 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
sp110 = 'Z'; sp110 = 'Z';
DbCamera_SetTextValue(dbCamera->at.z, &sp111, 6); DbCamera_SetTextValue(dbCamera->at.z, &sp111, 6);
func_8006376C(3, 0x19, 2, &sp110); func_8006376C(3, 0x19, 2, &sp110);
func_8006376C(0x1E, 0x16, D_80161144 ? 4 : 3, D_8012CF34); func_8006376C(0x1E, 0x16, D_80161144 ? 4 : 3, cameraStrings[21]);
sp110 = 'X'; sp110 = 'X';
DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6); DbCamera_SetTextValue(dbCamera->eye.x, &sp111, 6);
func_8006376C(0x1E, 0x17, 2, &sp110); func_8006376C(0x1E, 0x17, 2, &sp110);
@ -1453,17 +1382,17 @@ void DbCamera_Update(DbCamera* dbCamera, Camera* cam) {
sp110 = 'Z'; sp110 = 'Z';
DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6); DbCamera_SetTextValue(dbCamera->eye.z, &sp111, 6);
func_8006376C(0x1E, 0x19, 2, &sp110); func_8006376C(0x1E, 0x19, 2, &sp110);
func_8006376C(0xD, 0x18, 3, !D_80161144 ? D_8012CF04 : D_8012CF08); func_8006376C(0xD, 0x18, 3, !D_80161144 ? cameraStrings[9] : cameraStrings[10]);
DbCamera_SetTextValue(sp104.pitch * 0.00549325f, &D_8012D0E4[11], 4); DbCamera_SetTextValue(sp104.pitch * 0.00549325f, &cameraStrings[69][6], 4);
func_8006376C(0xF, 0x17, 3, D_8012D0E4); func_8006376C(0xF, 0x17, 3, cameraStrings[69]);
DbCamera_SetTextValue(sp104.yaw * 0.00549325f, &D_8012D0F8[11], 4); DbCamera_SetTextValue(sp104.yaw * 0.00549325f, &cameraStrings[70][6], 4);
func_8006376C(0xF, 0x18, 3, D_8012D0F8); func_8006376C(0xF, 0x18, 3, cameraStrings[70]);
DbCamera_SetTextValue(sp104.r, &D_8012D0D4[8], 6); DbCamera_SetTextValue(sp104.r, &cameraStrings[68][5], 5);
func_8006376C(0xF, 0x19, 3, D_8012D0D4); func_8006376C(0xF, 0x19, 3, cameraStrings[68]);
if (dbCamera->unk_3C) { if (dbCamera->unk_3C) {
func_8006376C(0x10, 0x1A, 1, D_8012CF3C); func_8006376C(0x0F, 0x1A, 1, cameraStrings[23]);
} else { } else {
func_8006376C(0x10, 0x1A, 1, D_8012CF40); func_8006376C(0x0F, 0x1A, 1, cameraStrings[24]);
} }
D_8012D110++; D_8012D110++;
@ -1726,10 +1655,6 @@ void DbCamera_PrintAllCuts(Camera* cam) {
osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** finish! ***** */\n@@@\n"); osSyncPrintf("@@@\n@@@\n@@@/* ****** spline point data ** finish! ***** */\n@@@\n");
} }
char D_8012D114[] = GFXP_KATAKANA "フレ-ム ";
char D_8012D128[] = GFXP_KATAKANA "ト-タル ";
char D_8012D13C[] = GFXP_KATAKANA "キ- / ";
s32 func_800B91B0(Camera* cam, DbCamera* dbCamera) { s32 func_800B91B0(Camera* cam, DbCamera* dbCamera) {
s32 pointCount; s32 pointCount;
s32 curPoint; s32 curPoint;
@ -1751,16 +1676,16 @@ s32 func_800B91B0(Camera* cam, DbCamera* dbCamera) {
!func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, sDbCameraCuts[D_8016110C].lookAt, !func_800BB2B4(&sDbCamAnim.lookAtPos, &sDbCamAnim.roll, &sDbCamAnim.fov, sDbCameraCuts[D_8016110C].lookAt,
&sDbCamAnim.keyframe, &sDbCamAnim.curFrame)) { &sDbCamAnim.keyframe, &sDbCamAnim.curFrame)) {
D_8012D13C[7] = ((sDbCamAnim.keyframe + 1) / 10) + '0'; cameraStrings[73][7] = ((sDbCamAnim.keyframe + 1) / 10) + '0';
D_8012D13C[8] = ((sDbCamAnim.keyframe + 1) % 10) + '0'; cameraStrings[73][8] = ((sDbCamAnim.keyframe + 1) % 10) + '0';
D_8012D13C[10] = ((sDbCameraCuts[D_8016110C].nPoints - 5) / 10) + '0'; cameraStrings[73][10] = ((sDbCameraCuts[D_8016110C].nPoints - 5) / 10) + '0';
D_8012D13C[11] = ((sDbCameraCuts[D_8016110C].nPoints - 5) % 10) + '0'; cameraStrings[73][11] = ((sDbCameraCuts[D_8016110C].nPoints - 5) % 10) + '0';
DbCamera_SetTextValue(sDbCamAnim.unk_04, &D_8012D114[10], 4); DbCamera_SetTextValue(sDbCamAnim.unk_04, &cameraStrings[71][10], 4);
func_8006376C(0xF, 0x16, 3, D_8012D114); func_8006376C(0xF, 0x16, 3, cameraStrings[71]);
DbCamera_SetTextValue(sDbCamAnim.unk_0C, &D_8012D128[10], 4); DbCamera_SetTextValue(sDbCamAnim.unk_0C, &cameraStrings[72][10], 4);
func_8006376C(0xF, 0x17, 3, D_8012D128); func_8006376C(0xF, 0x17, 3, cameraStrings[72]);
func_8006376C(0xF, 0x18, 3, D_8012D13C); func_8006376C(0xF, 0x18, 3, cameraStrings[73]);
func_8006376C(0x10, 0x1A, 1, D_8012CEF0); func_8006376C(0x10, 0x1A, 1, cameraStrings[4]);
sDbCamAnim.unk_04++; sDbCamAnim.unk_04++;
sDbCamAnim.unk_0C++; sDbCamAnim.unk_0C++;
@ -1835,7 +1760,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
VecSph sp5C; VecSph sp5C;
s32 (*callbacks[])(char*) = { DbCamera_SaveCallback, DbCamera_LoadCallback, DbCamera_ClearCallback }; s32 (*callbacks[])(char*) = { DbCamera_SaveCallback, DbCamera_LoadCallback, DbCamera_ClearCallback };
func_8006376C(0xE, 5, 0, D_8012CF44); // DEMO CONTROL func_8006376C(0xE, 5, 0, cameraStrings[25]); // DEMO CONTROL
idx1 = sCurFileIdx >> 1; idx1 = sCurFileIdx >> 1;
idx2 = sLastFileIdx >> 1; idx2 = sLastFileIdx >> 1;
@ -1856,13 +1781,13 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
&D_801333E8); &D_801333E8);
dbCamera->sub.demoCtrlToggleSwitch ^= 1; dbCamera->sub.demoCtrlToggleSwitch ^= 1;
} }
D_8012CEE0[41][9] = sCurFileIdx + 'A'; cameraStrings[41][9] = sCurFileIdx + 'A';
func_8006376C(0xA, 7, 5, D_8012CEE0[41]); func_8006376C(0xA, 7, 5, cameraStrings[41]);
func_8006376C(0x10, 7, 5, D_8012CF60[dbCamera->sub.demoCtrlActionIdx]); func_8006376C(0x10, 7, 5, cameraStrings[dbCamera->sub.demoCtrlActionIdx + 32]);
func_8006376C(0x14, 7, 5, D_8012CF88[0]); func_8006376C(0x14, 7, 5, cameraStrings[42]);
func_8006376C(0x11, 8, dbCamera->sub.demoCtrlToggleSwitch ? 4 : 7, D_8012CF94); func_8006376C(0x11, 8, dbCamera->sub.demoCtrlToggleSwitch ? 4 : 7, cameraStrings[45]);
func_8006376C(0x15, 8, dbCamera->sub.demoCtrlToggleSwitch ? 7 : 4, D_8012CF98); func_8006376C(0x15, 8, dbCamera->sub.demoCtrlToggleSwitch ? 7 : 4, cameraStrings[46]);
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A)) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A)) {
if (dbCamera->sub.demoCtrlToggleSwitch == 0) { if (dbCamera->sub.demoCtrlToggleSwitch == 0) {
@ -1880,9 +1805,9 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
dbCamera->sub.demoCtrlMenu++; dbCamera->sub.demoCtrlMenu++;
} else { } else {
dbCamera->sub.demoCtrlToggleSwitch ^= 1; dbCamera->sub.demoCtrlToggleSwitch ^= 1;
D_8012CF84[9] = sCurFileIdx + 'A'; cameraStrings[41][9] = sCurFileIdx + 'A';
func_8006376C(0xD, 7, 5, D_8012CF88[-1]); // todo: find something better func_8006376C(0xD, 7, 5, cameraStrings[41]); // todo: find something better
func_8006376C(0x12, 7, 5, D_8012CF80); func_8006376C(0x12, 7, 5, cameraStrings[40]);
func_8006376C(0xD, 9, dbCamera->sub.demoCtrlToggleSwitch ? 1 : 6, "PRESS B BUTTON"); func_8006376C(0xD, 9, dbCamera->sub.demoCtrlToggleSwitch ? 1 : 6, "PRESS B BUTTON");
} }
} }
@ -1897,12 +1822,12 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
case DEMO_CTRL_MENU(ACTION_SAVE, MENU_CALLBACK): case DEMO_CTRL_MENU(ACTION_SAVE, MENU_CALLBACK):
case DEMO_CTRL_MENU(ACTION_LOAD, MENU_CALLBACK): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_CALLBACK):
case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_CALLBACK): { case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_CALLBACK): {
D_8012CEE0[41][9] = sCurFileIdx + 'A'; cameraStrings[41][9] = sCurFileIdx + 'A';
func_8006376C(0xC, 7, 5, D_8012CEE0[41]); func_8006376C(0xC, 7, 5, cameraStrings[41]);
func_8006376C(0x12, 7, 5, D_8012CF60[dbCamera->sub.demoCtrlActionIdx]); func_8006376C(0x12, 7, 5, cameraStrings[dbCamera->sub.demoCtrlActionIdx + 32]);
func_8006376C(0x16, 7, 5, D_8012CF9C[0]); func_8006376C(0x16, 7, 5, cameraStrings[47]);
if (callbacks[dbCamera->sub.demoCtrlActionIdx - 1](&D_8012CF84[9])) { if (callbacks[dbCamera->sub.demoCtrlActionIdx - 1](&cameraStrings[41][9])) {
dbCamera->sub.demoCtrlMenu++; dbCamera->sub.demoCtrlMenu++;
return 1; return 1;
} else { } else {
@ -1915,10 +1840,10 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
case DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_SUCCESS):
case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_SUCCESS): { case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_SUCCESS): {
dbCamera->sub.demoCtrlToggleSwitch ^= 1; dbCamera->sub.demoCtrlToggleSwitch ^= 1;
D_8012CEE0[41][9] = sCurFileIdx + 'A'; cameraStrings[41][9] = sCurFileIdx + 'A';
func_8006376C(0xD, 7, 5, D_8012CEE0[41]); func_8006376C(0xD, 7, 5, cameraStrings[41]);
func_8006376C(0x13, 7, 5, D_8012CF60[dbCamera->sub.demoCtrlMenu / 100]); func_8006376C(0x13, 7, 5, cameraStrings[(dbCamera->sub.demoCtrlMenu / 100) + 32]);
func_8006376C(0x17, 7, 5, D_8012CFA4); func_8006376C(0x17, 7, 5, cameraStrings[49]);
func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON"); func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON");
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) || if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) ||
@ -1937,10 +1862,10 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
case DEMO_CTRL_MENU(ACTION_LOAD, MENU_ERROR): case DEMO_CTRL_MENU(ACTION_LOAD, MENU_ERROR):
case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_ERROR): { case DEMO_CTRL_MENU(ACTION_CLEAR, MENU_ERROR): {
dbCamera->sub.demoCtrlToggleSwitch ^= 1; dbCamera->sub.demoCtrlToggleSwitch ^= 1;
D_8012CEE0[41][9] = sCurFileIdx + 'A'; cameraStrings[41][9] = sCurFileIdx + 'A';
func_8006376C(0xD, 7, 5, D_8012CEE0[(dbCamera->sub.demoCtrlMenu / 100) + 32]); func_8006376C(0xD, 7, 5, cameraStrings[(dbCamera->sub.demoCtrlMenu / 100) + 32]);
func_8006376C(0x11, 7, 5, D_8012CFAC); func_8006376C(0x11, 7, 5, cameraStrings[51]);
func_8006376C(0x17, 7, 5, D_8012CFA4); func_8006376C(0x17, 7, 5, cameraStrings[49]);
func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON"); func_8006376C(0xD, 9, (dbCamera->sub.demoCtrlToggleSwitch != 0) ? 1 : 6, "PRESS B BUTTON");
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) || if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_A) ||
@ -2013,30 +1938,30 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
} }
idx3 = dbCamera->sub.demoCtrlActionIdx; idx3 = dbCamera->sub.demoCtrlActionIdx;
func_8006376C(0xE, 7, 5, D_8012CF50[idx3]); func_8006376C(0xE, 7, 5, cameraStrings[idx3 + 28]);
func_8006376C(0xF, 7, 4, sp74); func_8006376C(0xF, 7, 4, sp74);
func_8006376C((sCurFileIdx * 2) + 0x10, 7, 7, "_"); // cursor func_8006376C((sCurFileIdx * 2) + 0x10, 7, 7, "_"); // cursor
DbCamera_SetTextValue(DbCamera_GetMempakAllocSize(), sp74, 6); DbCamera_SetTextValue(DbCamera_GetMempakAllocSize(), sp74, 6);
func_8006376C(0xD, 9, 6, D_8012CF78); // NEED BYTE func_8006376C(0xD, 9, 6, cameraStrings[38]); // NEED BYTE
func_8006376C(0x11, 9, 4, sp74); func_8006376C(0x11, 9, 4, sp74);
DbCamera_SetTextValue(Mempak_GetFreeBytes(2), sp74, 6); DbCamera_SetTextValue(Mempak_GetFreeBytes(2), sp74, 6);
func_8006376C(0xD, 0xA, 6, D_8012CF74); // FREE BYTE func_8006376C(0xD, 0xA, 6, cameraStrings[37]); // FREE BYTE
func_8006376C(0x11, 0xA, 4, sp74); func_8006376C(0x11, 0xA, 4, sp74);
if (sMempakFilesize != 0) { if (sMempakFilesize != 0) {
DbCamera_SetTextValue(sMempakFilesize, sp74, 6); DbCamera_SetTextValue(sMempakFilesize, sp74, 6);
func_8006376C(0xD, 0xB, 7, D_8012CFA8); func_8006376C(0xD, 0xB, 7, cameraStrings[50]);
func_8006376C(0x11, 0xB, 4, sp74); func_8006376C(0x11, 0xB, 4, sp74);
} }
idx1 = (dbCamera->sub.demoCtrlActionIdx + 2); idx1 = (dbCamera->sub.demoCtrlActionIdx + 2);
func_8006376C(0xF, 0x16, 1, D_8012CF7C); func_8006376C(0xF, 0x16, 1, cameraStrings[39]);
func_8006376C(0x12, 0x17, sDbCameraColors[idx1], D_8012CF64); func_8006376C(0x12, 0x17, sDbCameraColors[idx1], cameraStrings[33]);
func_8006376C(0x12, 0x18, sDbCameraColors[idx1 - 1], D_8012CF68); func_8006376C(0x12, 0x18, sDbCameraColors[idx1 - 1], cameraStrings[34]);
func_8006376C(0x12, 0x19, sDbCameraColors[idx1 - 2], D_8012CF6C); func_8006376C(0x12, 0x19, sDbCameraColors[idx1 - 2], cameraStrings[35]);
func_8006376C(0xE, dbCamera->sub.demoCtrlActionIdx + 0x16, 7, D_8012CF0C); // current selection func_8006376C(0xE, dbCamera->sub.demoCtrlActionIdx + 0x16, 7, cameraStrings[11]); // current selection
func_8006376C(0xD, 0x1A, 5, D_8012CF60[0]); func_8006376C(0xD, 0x1A, 5, cameraStrings[32]);
func_8006376C(0x14, 0x1A, 5, D_8012CF70); func_8006376C(0x14, 0x1A, 5, cameraStrings[36]);
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP)) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP)) {
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0,
@ -2063,8 +1988,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
} }
goto block_2; goto block_2;
} else { } else {
func_8006376C(0xC, 0x1A, 4, D_8012CF60[0]); func_8006376C(0xC, 0x1A, 4, cameraStrings[32]);
func_8006376C(0x13, 0x1A, 4, D_8012CF80); func_8006376C(0x13, 0x1A, 4, cameraStrings[40]);
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B) || if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_B) ||
CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP) || CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DUP) ||
CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) { CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_DDOWN)) {
@ -2097,7 +2022,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
DbCamera_DrawSlotLetters(sp74, 7, 5, 4); DbCamera_DrawSlotLetters(sp74, 7, 5, 4);
if (sDbCamAnim.unk_0A != 0) { if (sDbCamAnim.unk_0A != 0) {
func_8006376C(4, 7, 5, D_8012CF4C); func_8006376C(4, 7, 5, cameraStrings[27]);
func_8006376C(D_8016110C * 2 + 6, 7, 7, ">"); func_8006376C(D_8016110C * 2 + 6, 7, 7, ">");
if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CUP)) { if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CUP)) {
@ -2203,7 +2128,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub); sp74[sCurFileIdx] = DbCamera_InitCut(idx1, &dbCamera->sub);
if (sp74[sCurFileIdx] == '?') { if (sp74[sCurFileIdx] == '?') {
func_8006376C(0xF, 0x18, 7, D_8012CF48); func_8006376C(0xF, 0x18, 7, cameraStrings[26]);
} }
} }
} }
@ -2281,7 +2206,7 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) {
Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
} }
func_8006376C(4, 7, 5, D_8012CF50[0]); func_8006376C(4, 7, 5, cameraStrings[28]);
sp74[1] = 0; sp74[1] = 0;
if (sLastFileIdx != -1) { if (sLastFileIdx != -1) {
sp74[0] = D_801612EA; sp74[0] = D_801612EA;

View File

@ -7615,7 +7615,7 @@ Vec3s Camera_Update(Camera* camera) {
} }
// enable/disable debug cam // enable/disable debug cam
if (CVarGetInteger("gDebugCamera", 0) && CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { if (CVarGetInteger("gDebugEnabled", 0) && CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) {
gDbgCamEnabled ^= 1; gDbgCamEnabled ^= 1;
if (gDbgCamEnabled) { if (gDbgCamEnabled) {
DbgCamera_Enable(&D_8015BD80, camera); DbgCamera_Enable(&D_8015BD80, camera);