1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-13 19:35:28 +00:00

Make Gamestates use thisx for entry point functions (#437)

* fix colliderinit typo

* fix initchain

* reloc

* thisx

* sample

* review

* forgot sample main
This commit is contained in:
fig02 2020-10-11 21:52:50 -04:00 committed by GitHub
parent b010db7c19
commit ed719f3da0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 74 additions and 54 deletions

View file

@ -1,30 +1,30 @@
#include "global.h"
#include "vt.h"
void func_80092320(PreNMIContext* prenmiCtx) {
prenmiCtx->state.running = false;
prenmiCtx->state.init = NULL;
prenmiCtx->state.size = 0;
void func_80092320(PreNMIContext* this) {
this->state.running = false;
this->state.init = NULL;
this->state.size = 0;
}
void PreNMI_Update(PreNMIContext* prenmiCtx) {
void PreNMI_Update(PreNMIContext* this) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "prenmi_move\n" VT_RST);
// Strings existing only in rodata
("../z_prenmi.c");
("(int)volume = %d\n");
if (prenmiCtx->timer == 0) {
if (this->timer == 0) {
ViConfig_UpdateVi(1);
func_80092320(prenmiCtx);
func_80092320(this);
return;
}
prenmiCtx->timer--;
this->timer--;
}
void PreNMI_Draw(PreNMIContext* prenmiCtx) {
GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx;
void PreNMI_Draw(PreNMIContext* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
osSyncPrintf(VT_COL(YELLOW, BLACK) "prenmi_draw\n" VT_RST);
@ -34,26 +34,30 @@ void PreNMI_Draw(PreNMIContext* prenmiCtx) {
func_80095248(gfxCtx, 0, 0, 0);
func_800940B0(gfxCtx);
gDPSetFillColor(oGfxCtx->polyOpa.p++, (GPACK_RGBA5551(255, 255, 255, 1) << 16) | GPACK_RGBA5551(255, 255, 255, 1));
gDPFillRectangle(oGfxCtx->polyOpa.p++, 0, prenmiCtx->timer + 100, SCREEN_WIDTH - 1, prenmiCtx->timer + 100);
gDPFillRectangle(oGfxCtx->polyOpa.p++, 0, this->timer + 100, SCREEN_WIDTH - 1, this->timer + 100);
CLOSE_DISPS(gfxCtx, "../z_prenmi.c", 112);
}
void PreNMI_Main(PreNMIContext* prenmiCtx) {
PreNMI_Update(prenmiCtx);
PreNMI_Draw(prenmiCtx);
void PreNMI_Main(GameState* thisx) {
PreNMIContext* this = (PreNMIContext*)thisx;
PreNMI_Update(this);
PreNMI_Draw(this);
prenmiCtx->state.unk_A0 = 1;
this->state.unk_A0 = 1;
}
void PreNMI_Destroy(PreNMIContext* prenmiCtx) {
void PreNMI_Destroy(GameState* thisx) {
}
void PreNMI_Init(PreNMIContext* prenmiCtx) {
prenmiCtx->state.main = PreNMI_Main;
prenmiCtx->state.destroy = PreNMI_Destroy;
prenmiCtx->timer = 30;
prenmiCtx->unk_A8 = 10;
void PreNMI_Init(GameState* thisx) {
PreNMIContext* this = (PreNMIContext*)thisx;
this->state.main = PreNMI_Main;
this->state.destroy = PreNMI_Destroy;
this->timer = 30;
this->unk_A8 = 10;
R_UPDATE_RATE = 1;
}