Files
mm/src/code/z_prenmi.c
T
Tharo b1b114e142 Decompile graph.c (#274)
* Decompiled, 1 non-matching, add some bss reordering helpers

* Document stuff

* Review suggestions

* graphutil.c -> graphalloc.c

* Try to fix fault callback warnings

* Remove extra comments in GfxMasterList

* char pad -> u32 pad

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>

* Fix gameState

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Other suggestions

Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
2021-10-29 15:30:48 -03:00

52 lines
1.3 KiB
C

#include "global.h"
void PreNMI_Stop(PreNMIContext* prenmiCtx) {
prenmiCtx->state.running = 0;
prenmiCtx->state.nextGameStateInit = NULL;
prenmiCtx->state.nextGameStateSize = 0;
}
void PreNMI_Update(PreNMIContext* prenmiCtx) {
if (prenmiCtx->timer == 0) {
ViConfig_UpdateVi(1);
PreNMI_Stop(prenmiCtx);
return;
}
prenmiCtx->timer--;
}
void PreNMI_Draw(PreNMIContext* prenmiCtx) {
GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx;
func_8012CF0C(gfxCtx, true, true, 0, 0, 0);
OPEN_DISPS(gfxCtx);
func_8012C470(gfxCtx);
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(255, 255, 255, 1) << 16) | GPACK_RGBA5551(255, 255, 255, 1));
gDPFillRectangle(POLY_OPA_DISP++, 0, prenmiCtx->timer + 100, SCREEN_WIDTH - 1, prenmiCtx->timer + 100);
CLOSE_DISPS(gfxCtx);
}
void PreNMI_Main(PreNMIContext* prenmiCtx) {
PreNMI_Update(prenmiCtx);
PreNMI_Draw(prenmiCtx);
prenmiCtx->state.unk_A3 = 1;
}
void PreNMI_Destroy(PreNMIContext* prenmiCtx) {
}
void PreNMI_Init(PreNMIContext* prenmiCtx) {
prenmiCtx->state.main = (GameStateFunc)PreNMI_Main;
prenmiCtx->state.destroy = (GameStateFunc)PreNMI_Destroy;
prenmiCtx->timer = 30;
prenmiCtx->unkA8 = 10;
Game_SetFramerateDivisor(&prenmiCtx->state, 1);
}