mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-11 14:18:39 -04:00
Play_Hireso (Bombers Notebook) OK w/ Docs (#1235)
* Start * Try every function * Import data * Docs from message branch * Fix non-equivalency for func_8016AE1C * Everything looks NON_MATCHING * Some more clean up and docs * Some cleanup * Small format * Small improvements here and there * Match a couple * Anotha one * and than there was 1 * and than there were none :) * Lots of docs * Finish code docs * schedule static * Macros + cleanup * text ids array cleanup * Entries cleanup * Use sBombersNotebookEntries in macros * Some docs from message branch * eventIndex -> event * Remove outdated comments * PR * BOMBERS_NOTEBOOK_ENTRY_SIZE * tables * Token pasting to simplify * Some more fixes * PR pt 1 * Format * Bring over BombersNotebook docs from z_message branch Co-authored-by: ZoeyZolotova <zoey.zolotova@gmail.com> * Full enum glory * Format * Name weekeventregs * typo * Some comments * bss * Review * bss * Update src/code/z_play_hireso.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Fix * Namefixer * bss * Format * 0 = 0x0000 --------- Co-authored-by: ZoeyZolotova <zoey.zolotova@gmail.com> Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
+43
-18
@@ -5,6 +5,27 @@
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
#if 0
|
||||
#define DEFINE_PERSON(_enum, _photo, _description, _metEnum, metMessage, _metFlag) metMessage,
|
||||
#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, completedMessage, _completedFlag) completedMessage,
|
||||
|
||||
u16 sBombersNotebookEventMessages[BOMBERS_NOTEBOOK_EVENT_MAX] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
#undef DEFINE_EVENT
|
||||
|
||||
#define DEFINE_PERSON(_enum, _photo, _description, _metEnum, _metMessage, metFlag) metFlag,
|
||||
#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, _completedMessage, completedFlag) completedFlag,
|
||||
|
||||
u16 gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_EVENT_MAX] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
#undef DEFINE_EVENT
|
||||
|
||||
s16 D_801D02D8[15] = {
|
||||
ACTOR_OCEFF_WIPE5, ACTOR_OCEFF_WIPE5, // Sonata of Awakening Effect, Sonata of Awakening Effect
|
||||
@@ -20,8 +41,6 @@ s32 D_801D02F8[15] = { 0,1,2,3,4,0,1,0,0,0,0,0,1,1,0 };
|
||||
|
||||
#endif
|
||||
|
||||
extern u16 D_801C6AB8[];
|
||||
extern u16 D_801C6B28[];
|
||||
extern s16 D_801D02D8[];
|
||||
extern s32 D_801D02F8[];
|
||||
extern s16 D_801F6B0C;
|
||||
@@ -365,19 +384,19 @@ void func_80151A68(PlayState* play, u16 textId) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80151BB4(PlayState* play, u8 arg1) {
|
||||
void Message_BombersNotebookQueueEvent(PlayState* play, u8 event) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
u8 temp = arg1;
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
if (!CHECK_WEEKEVENTREG(D_801C6B28[arg1])) {
|
||||
msgCtx->unk120B2[msgCtx->unk120B1] = temp;
|
||||
msgCtx->unk120B1++;
|
||||
if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[event])) {
|
||||
msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount] = event;
|
||||
msgCtx->bombersNotebookEventQueueCount++;
|
||||
}
|
||||
} else if (arg1 >= 20) {
|
||||
if (!CHECK_WEEKEVENTREG(D_801C6B28[arg1])) {
|
||||
msgCtx->unk120B2[msgCtx->unk120B1] = temp;
|
||||
msgCtx->unk120B1++;
|
||||
} else if (event >= BOMBERS_NOTEBOOK_PERSON_MAX) {
|
||||
// Non MET events are processed even if the player does not have the notebook yet
|
||||
if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags[event])) {
|
||||
msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount] = event;
|
||||
msgCtx->bombersNotebookEventQueueCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -386,16 +405,22 @@ u32 func_80151C9C(PlayState* play) {
|
||||
MessageContext* msgCtx = &play->msgCtx;
|
||||
|
||||
while (true) {
|
||||
if (msgCtx->unk120B1 == 0) {
|
||||
if (msgCtx->bombersNotebookEventQueueCount == 0) {
|
||||
return false;
|
||||
}
|
||||
msgCtx->unk120B1--;
|
||||
msgCtx->bombersNotebookEventQueueCount--;
|
||||
|
||||
if (!CHECK_WEEKEVENTREG(D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]])) {
|
||||
SET_WEEKEVENTREG(D_801C6B28[msgCtx->unk120B2[msgCtx->unk120B1]]);
|
||||
if (!CHECK_WEEKEVENTREG(gBombersNotebookWeekEventFlags
|
||||
[msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]])) {
|
||||
SET_WEEKEVENTREG(gBombersNotebookWeekEventFlags
|
||||
[msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]]);
|
||||
|
||||
if ((D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]] != 0) && CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
Message_ContinueTextbox(play, D_801C6AB8[msgCtx->unk120B2[msgCtx->unk120B1]]);
|
||||
if ((sBombersNotebookEventMessages
|
||||
[msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]] != 0) &&
|
||||
CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
|
||||
Message_ContinueTextbox(
|
||||
play, sBombersNotebookEventMessages
|
||||
[msgCtx->bombersNotebookEventQueue[msgCtx->bombersNotebookEventQueueCount]]);
|
||||
play_sound(NA_SE_SY_SCHEDULE_WRITE);
|
||||
return true;
|
||||
}
|
||||
@@ -476,7 +501,7 @@ u8 Message_GetState(MessageContext* msgCtx) {
|
||||
if (msgCtx->msgMode == 0x40) {
|
||||
return TEXT_STATE_13;
|
||||
}
|
||||
if ((msgCtx->msgMode == 0x43) && (msgCtx->stateTimer == 1) && (msgCtx->unk120B1 == 0)) {
|
||||
if ((msgCtx->msgMode == 0x43) && (msgCtx->stateTimer == 1) && (msgCtx->bombersNotebookEventQueueCount == 0)) {
|
||||
return TEXT_STATE_CLOSING;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "buffers.h"
|
||||
#include "z64bombers_notebook.h"
|
||||
#include "z64debug_display.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
@@ -1051,14 +1052,14 @@ void Play_Update(PlayState* this) {
|
||||
if (!sBombersNotebookOpen) {
|
||||
if (this->pauseCtx.bombersNotebookOpen) {
|
||||
sBombersNotebookOpen = true;
|
||||
sBombersNotebook.unk_00 = 0;
|
||||
sBombersNotebook.loadState = BOMBERS_NOTEBOOK_LOAD_STATE_NONE;
|
||||
}
|
||||
} else if (CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_L) ||
|
||||
CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_B) ||
|
||||
CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_START) || (gIrqMgrResetStatus != 0)) {
|
||||
sBombersNotebookOpen = false;
|
||||
this->pauseCtx.bombersNotebookOpen = false;
|
||||
sBombersNotebook.unk_00 = 0;
|
||||
sBombersNotebook.loadState = BOMBERS_NOTEBOOK_LOAD_STATE_NONE;
|
||||
this->msgCtx.msgLength = 0;
|
||||
this->msgCtx.msgMode = 0;
|
||||
this->msgCtx.currentTextId = 0;
|
||||
|
||||
+1349
-13
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64view.h"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
|
||||
#define ANIM_INTERP 1
|
||||
|
||||
Reference in New Issue
Block a user