Files
oot/src/code/z_prenmi.c
T
Tharo 1bef952ff6 Unused variable/parameter cleanup (#1321)
* UNUSED attribute for variables and parameters in static segments and for all stack padding variables

* No more unused variable warnings

* Make pad variable names consistent

* Small cleanup

* Macro-ify stack padding

* Use stack padding for more variables not previously named pad

* Format

* Check unused parameter on gamestate overlays and pause menu

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Merge 2x u8 stack pads into 1x s16 stack pad in en_ik

* Remove UNUSED from function prototypes

* Suggested changes

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* More unused variables

* Fix merge, updated for new versions

* Format

* questionable UNUSED and STACK_PAD more usage

* format

* format

* one more STACK_PADS in z_kaleido_map.c

---------

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2026-09-24 06:29:19 +02:00

78 lines
1.8 KiB
C

#include "gfx.h"
#include "attributes.h"
#include "gfx_setupdl.h"
#include "prenmi_state.h"
#include "printf.h"
#include "regs.h"
#include "terminal.h"
#include "versions.h"
#include "vi_mode.h"
void func_80092320(PreNMIState* this) {
this->state.running = false;
this->state.init = NULL;
this->state.size = 0;
}
void PreNMI_Update(PreNMIState* this) {
PRINTF(VT_COL(YELLOW, BLACK) "prenmi_move\n" VT_RST);
// Strings existing only in rodata
if (0) {
PRINTF("../z_prenmi.c");
PRINTF("(int)volume = %d\n");
}
if (this->timer == 0) {
#if OOT_VERSION < PAL_1_0
osViSetYScale(1.0f);
osViBlack(true);
#else
ViConfig_UpdateVi(true);
#endif
func_80092320(this);
return;
}
this->timer--;
}
void PreNMI_Draw(PreNMIState* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
PRINTF(VT_COL(YELLOW, BLACK) "prenmi_draw\n" VT_RST);
OPEN_DISPS(gfxCtx, "../z_prenmi.c", 96);
gSPSegment(POLY_OPA_DISP++, 0x00, NULL);
Gfx_SetupFrame(gfxCtx, 0, 0, 0);
Gfx_SetupDL_36Opa(gfxCtx);
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(255, 255, 255, 1) << 16) | GPACK_RGBA5551(255, 255, 255, 1));
gDPFillRectangle(POLY_OPA_DISP++, 0, this->timer + 100, SCREEN_WIDTH - 1, this->timer + 100);
CLOSE_DISPS(gfxCtx, "../z_prenmi.c", 112);
}
void PreNMI_Main(GameState* thisx) {
PreNMIState* this = (PreNMIState*)thisx;
PreNMI_Update(this);
PreNMI_Draw(this);
this->state.inPreNMIState = true;
}
void PreNMI_Destroy(UNUSED GameState* thisx) {
}
void PreNMI_Init(GameState* thisx) {
PreNMIState* this = (PreNMIState*)thisx;
this->state.main = PreNMI_Main;
this->state.destroy = PreNMI_Destroy;
this->timer = 30;
this->unk_A8 = 10;
R_UPDATE_RATE = 1;
}