Kaleido OK & icon_item_vtx_static (Documented) (#1243)

* Begin Kaleido

* WIP

* DW macros for gbi

* More Progress

* Match KaleidoScope_GrayOutTextureRGBA32

* DrawGameOver wip

* Add some function names

* A few more matching, some docs

* More docs, data wip

* Import Kaleido Data

* Data cleanup

* Some progress

* Match TitleCard_Draw Again (Thanks Roman)

* Match KaleidoScope_DrawDebugEditor

* KaleidoScope_UpdateDebugEditor WIP

* Some cleanup

* z_kaleido_debug.c OK

* Cleanup

* match func_8081B6EC

* more wip, data cleanup

* match func_80825A50

* match KaleidoScope_InitVertices

* cursor progress

* name func

* item headers

* match KaleidoScope_DrawItemSelect

* KaleidoScope_UpdateItemEquip WIP

* match kaleido item

* doc kaleido item

* z_kaleido_prompt ok

* kaleido mask setup

* small cleanup

* kaleido mask OK

* mask cleanup

* small fix

* quest page setup

* doc save prompt

* sync with prompt docs

* KaleidoScope_Update WIP

* More progress on KaleidoScope_Update

* kaleido update cleanup

* KaleidoScope_Update OK

* Slightly cleaner match in KaleidoScope_Update

* match KaleidoScope_DrawPages and KaleidoScope_DrawGameOver, organize data

* more cleanup

* match KaleidoScope_Draw and KaleidoScope_SetView

* match KaleidoScope_UpdateNamePanel

* match another 2 funcs, segment docs

* another KaleidoScope_UpdateNamePanel ?

* swap update name panel names

* another match, only 2 large/similar vtx function in kaleido nes

* more setup for drawInfoPanel

* match KaleidoScope_DrawDungeonStrayFairyCount, 8 funcs left

* document KaleidoScope_DrawDungeonStrayFairyCount

* KaleidoScope_DrawInfoPanel1 WIP

* match KaleidoScope_DrawInfoPanel2

* gameover pause states

* name two pause states

* match KaleidoScope_UpdateDungeonCursor and KaleidoScope_UpdateWorldMapCursor

* match KaleidoScope_DrawDungeonMap

* KaleidoScope_DrawWorldMap WIP

* cleanup map

* some cursor/texture docs

* more cursor docs

* KaleidoScope_UpdateQuestCursor wip

* match KaleidoScope_UpdateQuestCursor

* quest cleanup

* KaleidoScope_DrawQuestStatus WIP, broke gakufu

* match KaleidoScope_DrawInfoPanel1, Kaleido NES OK

* pause substates

* more cleanup

* map progress

* very small improvements to KaleidoScope_DrawWorldMap

* match KaleidoScope_DrawWorldMap

* cleanup KaleidoScope_DrawWorldMap

* rematch EnGakufu_ProcessNotes, thanks anon58

* gameover and misc docs

* more docs

* small cleanup of maps

* owl warp and other docs

* symmetry in pause state

* some docs and cleanup

* docs

* more docs from OoT WIP

* fix

* quest page docs

* more enums

* more cleanup and enums

* another round of docs

* doc cursor indices

* map docs

* some docs

* cleanup for-loops

* cleanup

* else if

* small docs

* icon_item_field_static

* dungeon static

* eol

* icon item jpn static

* vtx static

* jpn static comments

* import parameter texture functions

* mask cleanup

* sync with PRs

* some docs

* more docs

* fix bss

* some docs

* sync with PR

* quest docs

* fix quest vtx

* sync with PR

* sync with PR

* fix typo

* small cleanup

* vtx madness

* more vtx

* add quad docs

* cleanup vtx

* cleanup

* cleanup

* revert gbi changes

* cleanup

* more cleanup

* another cleanup

* remove empty comment

* some PR review

* more naming suggestions

* namefixer

* L button to Z button

---------

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
engineer124
2023-05-30 02:04:21 +10:00
committed by GitHub
parent fc475a9756
commit aa0a968791
16 changed files with 1413 additions and 221 deletions
+13 -17
View File
@@ -849,17 +849,12 @@ void TitleCard_Draw(GameState* gameState, TitleCardContext* titleCtx) {
if (titleCtx->alpha != 0) {
s32 width = titleCtx->width;
s32 height = titleCtx->height;
s32 unk1;
s32 spC0;
s32 sp38;
s32 spB8;
s32 spB4;
s32 temp;
temp = width * 2;
spC0 = (titleCtx->x * 4) - temp;
spB8 = (titleCtx->y * 4) - (height * 2);
sp38 = width * 2;
s32 doubleWidth = width * 2;
s32 titleX = (titleCtx->x * 4) - doubleWidth;
s32 doubleHeight = height * 2;
s32 titleY = (titleCtx->y * 4) - doubleHeight;
s32 titleSecondY;
s32 textureLanguageOffset;
OPEN_DISPS(gameState->gfxCtx);
@@ -867,29 +862,30 @@ void TitleCard_Draw(GameState* gameState, TitleCardContext* titleCtx) {
height = TMEM_SIZE / width;
}
spB4 = spB8 + (height * 4);
titleSecondY = titleY + (height * 4);
OVERLAY_DISP = Gfx_SetupDL52_NoCD(OVERLAY_DISP);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity,
(u8)titleCtx->alpha);
gDPLoadTextureBlock(OVERLAY_DISP++, (s32*)titleCtx->texture, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0,
gDPLoadTextureBlock(OVERLAY_DISP++, titleCtx->texture, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 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++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 + (height * 4) - 1,
gSPTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
height = titleCtx->height - height;
// If texture is bigger than 0x1000, display the rest
if (height > 0) {
gDPLoadTextureBlock(OVERLAY_DISP++, (s32)titleCtx->texture + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, width,
gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, width,
height, 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++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 + (height * 4) - 1,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPTextureRectangle(OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4,
titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
CLOSE_DISPS(gameState->gfxCtx);
+2 -2
View File
@@ -40,13 +40,13 @@ void KaleidoScopeCall_Update(PlayState* play) {
if (ShrinkWindow_Letterbox_GetSize() == 0) {
R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP;
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_0;
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_APPEARING;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
}
} else if (pauseCtx->state == PAUSE_STATE_GAMEOVER_0) {
R_PAUSE_BG_PRERENDER_STATE = PAUSE_BG_PRERENDER_SETUP;
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_0;
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_APPEARING;
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1;
} else if ((pauseCtx->state == PAUSE_STATE_OPENING_1) || (pauseCtx->state == PAUSE_STATE_GAMEOVER_1) ||
(pauseCtx->state == PAUSE_STATE_OWLWARP_1)) {
+1 -1
View File
@@ -145,7 +145,7 @@ void KaleidoSetup_Init(PlayState* play) {
pauseCtx->cursorPoint[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);
pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT;
pauseCtx->pageSwitchTimer = 0;
pauseCtx->pageSwitchInputTimer = 0;
pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE;
pauseCtx->cursorItem[PAUSE_MAP] = R_REVERSE_FLOOR_INDEX + (DUNGEON_FLOOR_INDEX_4 - 1);