Pictographs some more

This commit is contained in:
Derek Hensley
2022-10-05 21:42:45 -07:00
parent 1eca2fc63f
commit 234e97538e
6 changed files with 39 additions and 29 deletions
+1 -1
View File
@@ -2450,7 +2450,7 @@ void Play_DisableMotionBlur(void);
// void Play_ConvertBufferToI(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
// void Play_EnableMotionBlurPriority(void);
// void Play_DisableMotionBlurPriority(void);
// void Play_TakePictograph(void);
// void Play_TakePictographPhoto(void);
// void Play_ChooseDynamicTransition(void);
// void Play_SetupTransition(void);
// void Play_ClearTransition(void);
+2
View File
@@ -112,6 +112,8 @@
#define R_FB_FILTER_A SREG(84)
#define R_FB_FILTER_ENV_COLOR(c) SREG(85 + c)
#define R_PICTOGRAPH_PHOTO_STATE SREG(89)
#define R_MOTION_BLUR_ALPHA SREG(90)
#define R_MOTION_BLUR_ENABLED SREG(91)
#define R_MOTION_BLUR_PRIORITY_ALPHA SREG(92)
+1 -1
View File
@@ -298,7 +298,7 @@ typedef struct SaveContext {
/* 0x1050 */ u64 bottleTimerTimeLimits[BOTTLE_MAX]; // The original total time given before the timer expires, in centiseconds (1/100th sec). "bottle_sub"
/* 0x1080 */ u64 bottleTimerCurTimes[BOTTLE_MAX]; // The remaining time left before the timer expires, in centiseconds (1/100th sec). "bottle_time"
/* 0x10B0 */ OSTime bottleTimerPausedOsTimes[BOTTLE_MAX]; // The cumulative osTime spent with the timer paused. "bottle_stop_time"
/* 0x10E0 */ u64 pictoPhoto[1400]; // buffer containing the pictograph photo
/* 0x10E0 */ u8 pictoPhotoI5[0x2BC0]; // buffer containing the pictograph photo, compressed to I5 from I8
/* 0x3CA0 */ s32 fileNum; // "file_no"
/* 0x3CA4 */ s16 powderKegTimer; // "big_bom_timer"
/* 0x3CA6 */ u8 unk_3CA6;
+31 -23
View File
@@ -204,11 +204,19 @@ void Play_DisableMotionBlurPriority(void) {
R_MOTION_BLUR_PRIORITY_ENABLED = false;
}
void func_80165E04(void) {
SREG(89) = 1;
typedef enum {
/* 0 */ PICTOGRAPH_PHOTO_STATE_OFF,
/* 1 */ PICTOGRAPH_PHOTO_STATE_START,
/* 2 */ PICTOGRAPH_PHOTO_STATE_TAKE,
/* 3 */ PICTOGRAPH_PHOTO_STATE_FINISH
} PictographPhotoState;
// Will take the photograph, but doesn't compress and save it
void Play_StartTakingPictographPhoto(void) {
R_PICTOGRAPH_PHOTO_STATE = PICTOGRAPH_PHOTO_STATE_START;
}
void Play_TakePictograph(PreRender* prerender) {
void Play_TakePictographPhoto(PreRender* prerender) {
PreRender_ApplyFilters(prerender);
Play_ConvertBufferToI(gPictoPhotoI8, prerender->fbufSave, 320, 80, 64, 240 - 1, 176 - 1, 8);
}
@@ -413,12 +421,12 @@ void Play_Destroy(GameState* thisx) {
this->state.gfxCtx->callbackParam = 0;
Play_DestroyMotionBlur();
if (SREG(94) != 0) {
if (R_PAUSE_MENU_MODE != 0) {
PreRender_ApplyFiltersSlowlyDestroy(&this->pauseBgPreRender);
SREG(94) = 0;
R_PAUSE_MENU_MODE = 0;
}
SREG(89) = 0;
R_PICTOGRAPH_PHOTO_STATE = PICTOGRAPH_PHOTO_STATE_OFF;
PreRender_Destroy(&this->pauseBgPreRender);
this->unk_18E58 = NULL;
this->pictoPhotoI8 = NULL;
@@ -936,11 +944,11 @@ void Play_Update(PlayState* this) {
gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment);
gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
if (SREG(89) == 2) {
SREG(89) = 3;
if (R_PICTOGRAPH_PHOTO_STATE == PICTOGRAPH_PHOTO_STATE_TAKE) {
R_PICTOGRAPH_PHOTO_STATE = PICTOGRAPH_PHOTO_STATE_FINISH;
MsgEvent_SendNullTask();
Play_TakePictograph(&this->pauseBgPreRender);
SREG(89) = 0;
Play_TakePictographPhoto(&this->pauseBgPreRender);
R_PICTOGRAPH_PHOTO_STATE = PICTOGRAPH_PHOTO_STATE_OFF;
}
Actor_SetMovementScale(this->state.framerateDivisor);
@@ -1144,12 +1152,12 @@ void Play_Draw(PlayState* this) {
u8 sp25B = false;
f32 var_fv0; // fogFar
if (SREG(94) >= 4) {
if (R_PAUSE_MENU_MODE >= 4) {
PreRender_ApplyFiltersSlowlyDestroy(&this->pauseBgPreRender);
SREG(94) = 0;
R_PAUSE_MENU_MODE = 0;
}
if ((SREG(94) < 2) && (gTrnsnUnkState < 2)) {
if ((R_PAUSE_MENU_MODE < 2) && (gTrnsnUnkState < 2)) {
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.mesh->type0.type == 1)) {
func_8012CF0C(gfxCtx, 0, 1, 0, 0, 0);
} else {
@@ -1264,15 +1272,15 @@ void Play_Draw(PlayState* this) {
PreRender_SetValues(&this->pauseBgPreRender, D_801FBBCC, D_801FBBCE, gfxCtx->curFrameBuffer, gfxCtx->zbuffer);
if (SREG(94) == 2) {
if (R_PAUSE_MENU_MODE == 2) {
MsgEvent_SendNullTask();
if (!gSaveContext.screenScaleFlag) {
PreRender_ApplyFiltersSlowlyInit(&this->pauseBgPreRender);
}
SREG(94) = 3;
R_PAUSE_MENU_MODE = 3;
SREG(33) |= 1;
} else {
if (SREG(94) == 3) {
if (R_PAUSE_MENU_MODE == 3) {
Gfx* sp8C = POLY_OPA_DISP;
if (this->pauseBgPreRender.unk_4D == 2) {
@@ -1374,7 +1382,7 @@ void Play_Draw(PlayState* this) {
DebugDisplay_DrawObjects(this);
Play_DrawMotionBlur(this);
if (((SREG(94) == 1) || (gTrnsnUnkState == 1)) || (SREG(89) == 1)) {
if (((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) || (R_PICTOGRAPH_PHOTO_STATE == 1)) {
Gfx* sp74;
Gfx* sp70 = POLY_OPA_DISP;
@@ -1382,12 +1390,12 @@ void Play_Draw(PlayState* this) {
gSPDisplayList(OVERLAY_DISP++, sp74);
this->pauseBgPreRender.fbuf = gfxCtx->curFrameBuffer;
if (SREG(94) == 1) {
SREG(94) = 2;
if (R_PAUSE_MENU_MODE == 1) {
R_PAUSE_MENU_MODE = 2;
this->pauseBgPreRender.fbufSave = (u16*)gfxCtx->zbuffer;
this->pauseBgPreRender.cvgSave = this->unk_18E58;
} else if (SREG(89) == 1) {
SREG(89) = 2;
} else if (R_PICTOGRAPH_PHOTO_STATE == 1) {
R_PICTOGRAPH_PHOTO_STATE = 2;
this->pauseBgPreRender.fbufSave = (u16*)gfxCtx->zbuffer;
this->pauseBgPreRender.cvgSave = this->unk_18E58;
} else {
@@ -2231,8 +2239,8 @@ void Play_Init(GameState* thisx) {
Play_InitMotionBlur();
SREG(94) = 0;
SREG(89) = 0;
R_PAUSE_MENU_MODE = 0;
R_PICTOGRAPH_PHOTO_STATE = 0;
PreRender_Init(&this->pauseBgPreRender);
PreRender_SetValuesSave(&this->pauseBgPreRender, D_801FBBCC, D_801FBBCE, NULL, NULL, NULL);
+2 -2
View File
@@ -2980,8 +2980,8 @@
0x80165DB8:("Play_SetMotionBlurPriorityAlpha",),
0x80165DCC:("Play_EnableMotionBlurPriority",),
0x80165DF0:("Play_DisableMotionBlurPriority",),
0x80165E04:("func_80165E04",),
0x80165E1C:("Play_TakePictograph",),
0x80165E04:("Play_StartPictographPhoto",),
0x80165E1C:("Play_TakePictographPhoto",),
0x80165E7C:("Play_ChooseDynamicTransition",),
0x80165EC0:("Play_SetupTransition",),
0x80166060:("Play_ClearTransition",),
+2 -2
View File
@@ -2494,8 +2494,8 @@ asm/non_matchings/code/z_play/Play_ConvertBufferToI.s,Play_ConvertBufferToI,0x80
asm/non_matchings/code/z_play/Play_SetMotionBlurPriorityAlpha.s,Play_SetMotionBlurPriorityAlpha,0x80165DB8,0x5
asm/non_matchings/code/z_play/Play_EnableMotionBlurPriority.s,Play_EnableMotionBlurPriority,0x80165DCC,0x9
asm/non_matchings/code/z_play/Play_DisableMotionBlurPriority.s,Play_DisableMotionBlurPriority,0x80165DF0,0x5
asm/non_matchings/code/z_play/func_80165E04.s,func_80165E04,0x80165E04,0x6
asm/non_matchings/code/z_play/Play_TakePictograph.s,Play_TakePictograph,0x80165E1C,0x18
asm/non_matchings/code/z_play/Play_StartPictographPhoto.s,Play_StartPictographPhoto,0x80165E04,0x6
asm/non_matchings/code/z_play/Play_TakePictographPhoto.s,Play_TakePictographPhoto,0x80165E1C,0x18
asm/non_matchings/code/z_play/Play_ChooseDynamicTransition.s,Play_ChooseDynamicTransition,0x80165E7C,0x11
asm/non_matchings/code/z_play/Play_SetupTransition.s,Play_SetupTransition,0x80165EC0,0x68
asm/non_matchings/code/z_play/Play_ClearTransition.s,Play_ClearTransition,0x80166060,0x16
1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2494 asm/non_matchings/code/z_play/Play_SetMotionBlurPriorityAlpha.s Play_SetMotionBlurPriorityAlpha 0x80165DB8 0x5
2495 asm/non_matchings/code/z_play/Play_EnableMotionBlurPriority.s Play_EnableMotionBlurPriority 0x80165DCC 0x9
2496 asm/non_matchings/code/z_play/Play_DisableMotionBlurPriority.s Play_DisableMotionBlurPriority 0x80165DF0 0x5
2497 asm/non_matchings/code/z_play/func_80165E04.s asm/non_matchings/code/z_play/Play_StartPictographPhoto.s func_80165E04 Play_StartPictographPhoto 0x80165E04 0x6
2498 asm/non_matchings/code/z_play/Play_TakePictograph.s asm/non_matchings/code/z_play/Play_TakePictographPhoto.s Play_TakePictograph Play_TakePictographPhoto 0x80165E1C 0x18
2499 asm/non_matchings/code/z_play/Play_ChooseDynamicTransition.s Play_ChooseDynamicTransition 0x80165E7C 0x11
2500 asm/non_matchings/code/z_play/Play_SetupTransition.s Play_SetupTransition 0x80165EC0 0x68
2501 asm/non_matchings/code/z_play/Play_ClearTransition.s Play_ClearTransition 0x80166060 0x16