pictograph docs

This commit is contained in:
engineer124
2022-10-06 15:07:26 -04:00
parent abd997d27f
commit 2d64b28e8e
11 changed files with 56 additions and 44 deletions
+2 -2
View File
@@ -2430,8 +2430,8 @@ void func_80165690(void);
// void func_80166060(void);
Gfx* func_801660B8(PlayState* play, Gfx* gfx);
void Play_Destroy(GameState* thisx);
void func_801663C4(u8* arg0, u8* arg1, u32 arg2);
void func_80166644(u8* arg0, u8* arg1, s32 arg2);
void Play_CompressI8ToI5(u8* arg0, u8* arg1, u32 arg2);
void Play_DecompressI5ToI8(u8* arg0, u8* arg1, s32 arg2);
// void func_801668B4(void);
void func_80166968(PlayState* play, Camera* camera);
void func_80166B30(PlayState* play);
+1 -1
View File
@@ -3479,7 +3479,7 @@ extern GfxPool gGfxPools[2];
extern u8 gAudioHeap[0x138000];
extern u8 gSystemHeap[UNK_SIZE];
extern u8 D_80780000[0x4600];
extern u8 gPictoPhotoI8[]; // PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y
extern u8 D_80784600[0x56200];
extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH];
+1 -1
View File
@@ -1001,7 +1001,7 @@ struct PlayState {
/* 0x18B9C */ char unk_18B9C[0x2B8];
/* 0x18E54 */ SceneTableEntry* loadedScene;
/* 0x18E58 */ char unk_18E58[0x4];
/* 0x18E5C */ u8* unk_18E5C;
/* 0x18E5C */ u8* pictoPhotoI8;
/* 0x18E60 */ char unk_18E60[0x8];
/* 0x18E68 */ s32 unk_18E68;
/* 0x18E6C */ char unk_18E6C[0x3EC];
+8 -1
View File
@@ -145,6 +145,13 @@ typedef enum {
/* 52 */ HUD_VISIBILITY_NONE_INSTANT = 52
} HudVisibility;
#define PICTO_RESOLUTION_X 160
#define PICTO_RESOLUTION_Y 112
#define PICTO_POS_X ((void)0, ((SCREEN_WIDTH - PICTO_RESOLUTION_X) / 2))
// Picture is offset up by 33 pixels to give room for the message box at the bottom
#define PICTO_POS_Y (((void)0, ((SCREEN_HEIGHT - PICTO_RESOLUTION_Y) / 2)) - 33)
typedef struct SramContext {
/* 0x00 */ u8* readBuff;
/* 0x04 */ u8 *saveBuf;
@@ -310,7 +317,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[PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y * 5 / 8]; // buffer containing the pictograph photo
/* 0x3CA0 */ s32 fileNum; // "file_no"
/* 0x3CA4 */ s16 powderKegTimer; // "big_bom_timer"
/* 0x3CA6 */ u8 unk_3CA6;
+5 -5
View File
@@ -36,11 +36,11 @@ typedef enum {
/* 0x3F */ PICTOGRAPH_BAD_DISTANCE
} PictographFlag;
// The following macros are subject to renaming once the capture system is better understood
#define PICTO_RESOLUTION_HORIZONTAL 150
#define PICTO_RESOLUTION_VERTICAL 105
#define PICTO_CAPTURE_REGION_TOPLEFT_X ((SCREEN_WIDTH - PICTO_RESOLUTION_HORIZONTAL) / 2)
#define PICTO_CAPTURE_REGION_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_RESOLUTION_VERTICAL) / 2)
// The subregion of the picto photo that will set the flag for an actor being in the photo
#define PICTO_CAPTURE_REGION_HORIZONTAL 150
#define PICTO_CAPTURE_REGION_VERTICAL 105
#define PICTO_CAPTURE_REGION_TOPLEFT_X ((SCREEN_WIDTH - PICTO_CAPTURE_REGION_HORIZONTAL) / 2)
#define PICTO_CAPTURE_REGION_TOPLEFT_Y ((SCREEN_HEIGHT - PICTO_CAPTURE_REGION_VERTICAL) / 2)
s32 Snap_RecordPictographedActors(PlayState* play);
void Snap_SetFlag(s32 flag);
+31 -26
View File
@@ -2223,8 +2223,9 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
// Related to pictograph
if (sPictographState == PICTOGRAPH_STATE_LENS) {
if (!(play->actorCtx.flags & ACTORCTX_FLAG_PICTOGRAPH_ON)) {
func_801663C4((play->unk_18E5C != NULL) ? play->unk_18E5C : D_801FBB90,
(u8*)((void)0, gSaveContext.pictoPhoto), 0x4600);
Play_CompressI8ToI5((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : D_801FBB90,
(u8*)((void)0, gSaveContext.pictoPhotoI5),
PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y);
interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0;
restoreHudVisibility = true;
sPictographState = PICTOGRAPH_STATE_OFF;
@@ -2261,8 +2262,9 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
sPictographState = PICTOGRAPH_STATE_OFF;
if (sPictographPhotoBeingTaken) {
func_801663C4((play->unk_18E5C != NULL) ? play->unk_18E5C : D_801FBB90,
(u8*)((void)0, gSaveContext.pictoPhoto), 0x4600);
Play_CompressI8ToI5((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : D_801FBB90,
(u8*)((void)0, gSaveContext.pictoPhotoI5),
PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y);
Snap_RecordPictographedActors(play);
}
play->actorCtx.flags &= ~ACTORCTX_FLAG_PICTOGRAPH_ON;
@@ -2292,8 +2294,9 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
Interface_SetHudVisibility(HUD_VISIBILITY_A_B);
sPictographState = PICTOGRAPH_STATE_LENS;
} else {
func_80166644((u8*)((void)0, gSaveContext.pictoPhoto),
(play->unk_18E5C != NULL) ? play->unk_18E5C : D_801FBB90, 0x4600);
Play_DecompressI5ToI8((u8*)((void)0, gSaveContext.pictoPhotoI5),
(play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : D_801FBB90,
PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y);
play->haltAllActors = true;
sPictographState = PICTOGRAPH_STATE_SETUP_PHOTO;
}
@@ -6399,33 +6402,33 @@ void Interface_Draw(PlayState* play) {
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gPictoBoxFocusBorderTex, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP,
G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(OVERLAY_DISP++, YREG(32) * 4, YREG(33) * 4, (YREG(32) + 0x10) * 4, (YREG(33) + 0x10) * 4,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(34) * 4, YREG(35) * 4, (YREG(34) + 0x10) * 4, (YREG(35) + 0x10) * 4,
G_TX_RENDERTILE, 512, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(36) * 4, YREG(37) * 4, (YREG(36) + 0x10) * 4, (YREG(37) + 0x10) * 4,
G_TX_RENDERTILE, 0, 512, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(38) * 4, YREG(39) * 4, (YREG(38) + 0x10) * 4, (YREG(39) + 0x10) * 4,
G_TX_RENDERTILE, 512, 512, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(32) << 2, YREG(33) << 2, (YREG(32) << 2) + (16 << 2),
(YREG(33) << 2) + (16 << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(34) << 2, YREG(35) << 2, (YREG(34) << 2) + (16 << 2),
(YREG(35) << 2) + (16 << 2), G_TX_RENDERTILE, 512, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(36) << 2, YREG(37) << 2, (YREG(36) << 2) + (16 << 2),
(YREG(37) << 2) + (16 << 2), G_TX_RENDERTILE, 0, 512, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(38) << 2, YREG(39) << 2, (YREG(38) << 2) + (16 << 2),
(YREG(39) << 2) + (16 << 2), G_TX_RENDERTILE, 512, 512, 1 << 10, 1 << 10);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gPictoBoxFocusIconTex, G_IM_FMT_I, 32, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(OVERLAY_DISP++, YREG(40) * 4, YREG(41) * 4, (YREG(40) + 0x20) * 4, (YREG(41) + 0x10) * 4,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(40) << 2, YREG(41) << 2, (YREG(40) << 2) + 0x80,
(YREG(41) << 2) + (16 << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, gPictoBoxFocusTextTex, G_IM_FMT_I, 32, 8, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(OVERLAY_DISP++, YREG(42) * 4, YREG(43) * 4, (YREG(42) + 0x20) * 4, (YREG(43) + 0x8) * 4,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, YREG(42) << 2, YREG(43) << 2, (YREG(42) << 2) + 0x80,
(YREG(43) << 2) + 0x20, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
// Draw pictograph photo
if (sPictographState >= PICTOGRAPH_STATE_SETUP_PHOTO) {
if (!(play->actorCtx.flags & ACTORCTX_FLAG_PICTOGRAPH_ON)) {
func_801663C4((play->unk_18E5C != NULL) ? play->unk_18E5C : D_801FBB90, (u8*)gSaveContext.pictoPhoto,
0x4600);
Play_CompressI8ToI5((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : D_801FBB90,
(u8*)gSaveContext.pictoPhotoI5, PICTO_RESOLUTION_X * PICTO_RESOLUTION_Y);
interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0;
@@ -6433,7 +6436,7 @@ void Interface_Draw(PlayState* play) {
gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE;
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
} else {
s16 phi_a2;
s16 pictoRectTop;
if (sPictographState == PICTOGRAPH_STATE_SETUP_PHOTO) {
sPictographState = PICTOGRAPH_STATE_PHOTO;
@@ -6454,14 +6457,16 @@ void Interface_Draw(PlayState* play) {
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 160, 160, 255);
phi_a2 = 0x1F;
for (sp2CC = 0; sp2CC < 14; sp2CC++, phi_a2 += 8) {
pictoRectTop = PICTO_POS_Y;
for (sp2CC = 0; sp2CC < (PICTO_RESOLUTION_Y / 8); sp2CC++, pictoRectTop += 8) {
gDPLoadTextureBlock(OVERLAY_DISP++,
(u8*)((play->unk_18E5C != NULL) ? play->unk_18E5C : D_801FBB90) + (0x500 * sp2CC),
G_IM_FMT_I, G_IM_SIZ_8b, 160, 8, 0, G_TX_NOMIRROR | G_TX_WRAP,
(u8*)((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : D_801FBB90) +
(0x500 * sp2CC),
G_IM_FMT_I, G_IM_SIZ_8b, PICTO_RESOLUTION_X, 8, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPTextureRectangle(OVERLAY_DISP++, ((void)0, 320), phi_a2 * 4, ((void)0, 960), (phi_a2 + 8) * 4,
gSPTextureRectangle(OVERLAY_DISP++, PICTO_POS_X << 2, pictoRectTop << 2,
(PICTO_POS_X + PICTO_RESOLUTION_X) << 2, (pictoRectTop << 2) + (8 << 2),
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
}
+2 -2
View File
@@ -39,9 +39,9 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Destroy.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801663C4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CompressI8ToI5.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80166644.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_DecompressI5ToI8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801668B4.s")
+1 -1
View File
@@ -174,7 +174,7 @@ s32 Snap_ValidatePictograph(PlayState* play, Actor* actor, s32 flag, Vec3f* pos,
y = (s16)PROJECTED_TO_SCREEN_Y(projectedPos, distance) - PICTO_CAPTURE_REGION_TOPLEFT_Y;
// checks if the coordinates are within the capture region
if ((x < 0) || (x > PICTO_RESOLUTION_HORIZONTAL) || (y < 0) || (y > PICTO_RESOLUTION_VERTICAL)) {
if ((x < 0) || (x > PICTO_CAPTURE_REGION_HORIZONTAL) || (y < 0) || (y > PICTO_CAPTURE_REGION_VERTICAL)) {
Snap_SetFlag(PICTOGRAPH_NOT_IN_VIEW);
ret |= PICTOGRAPH_NOT_IN_VIEW;
}
+2 -2
View File
@@ -2987,8 +2987,8 @@
0x80166060:("func_80166060",),
0x801660B8:("func_801660B8",),
0x8016613C:("Play_Destroy",),
0x801663C4:("func_801663C4",),
0x80166644:("func_80166644",),
0x801663C4:("Play_CompressI8ToI5",),
0x80166644:("Play_DecompressI5ToI8",),
0x801668B4:("func_801668B4",),
0x80166968:("func_80166968",),
0x80166B30:("func_80166B30",),
+1 -1
View File
@@ -4368,7 +4368,7 @@
0x80209EA0:("gGfxPools","GfxPool","[2]",0x40620),
0x8024A4C0:("gAudioHeap","u8","[0x138000]",0x138000),
0x803824C0:("gSystemHeap","u8","[UNK_SIZE]",0x3fdb40),
0x80780000:("D_80780000","u8","[0x4600]",0x4600),
0x80780000:("gPictoPhotoI8","u8","[0x4600]",0x4600),
0x80784600:("D_80784600","u8","[0x56200]",0x56200),
0x807DA800:("gFramebuffer0","u16","[SCREEN_HEIGHT][SCREEN_WIDTH]",0x25800),
0x80800860:("titleRotation","s16","",0x2),
+2 -2
View File
@@ -2501,8 +2501,8 @@ asm/non_matchings/code/z_play/func_80165EC0.s,func_80165EC0,0x80165EC0,0x68
asm/non_matchings/code/z_play/func_80166060.s,func_80166060,0x80166060,0x16
asm/non_matchings/code/z_play/func_801660B8.s,func_801660B8,0x801660B8,0x21
asm/non_matchings/code/z_play/Play_Destroy.s,Play_Destroy,0x8016613C,0xA2
asm/non_matchings/code/z_play/func_801663C4.s,func_801663C4,0x801663C4,0xA0
asm/non_matchings/code/z_play/func_80166644.s,func_80166644,0x80166644,0x9C
asm/non_matchings/code/z_play/Play_CompressI8ToI5.s,Play_CompressI8ToI5,0x801663C4,0xA0
asm/non_matchings/code/z_play/Play_DecompressI5ToI8.s,Play_DecompressI5ToI8,0x80166644,0x9C
asm/non_matchings/code/z_play/func_801668B4.s,func_801668B4,0x801668B4,0x2D
asm/non_matchings/code/z_play/func_80166968.s,func_80166968,0x80166968,0x72
asm/non_matchings/code/z_play/func_80166B30.s,func_80166B30,0x80166B30,0x339
1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2501 asm/non_matchings/code/z_play/func_80166060.s func_80166060 0x80166060 0x16
2502 asm/non_matchings/code/z_play/func_801660B8.s func_801660B8 0x801660B8 0x21
2503 asm/non_matchings/code/z_play/Play_Destroy.s Play_Destroy 0x8016613C 0xA2
2504 asm/non_matchings/code/z_play/func_801663C4.s asm/non_matchings/code/z_play/Play_CompressI8ToI5.s func_801663C4 Play_CompressI8ToI5 0x801663C4 0xA0
2505 asm/non_matchings/code/z_play/func_80166644.s asm/non_matchings/code/z_play/Play_DecompressI5ToI8.s func_80166644 Play_DecompressI5ToI8 0x80166644 0x9C
2506 asm/non_matchings/code/z_play/func_801668B4.s func_801668B4 0x801668B4 0x2D
2507 asm/non_matchings/code/z_play/func_80166968.s func_80166968 0x80166968 0x72
2508 asm/non_matchings/code/z_play/func_80166B30.s func_80166B30 0x80166B30 0x339