1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

Misc Small Retail Files OK (#1687)

* shrink_window, z_lib, z_lights OK

* sys_cfb.c OK

* cleanup
This commit is contained in:
engineer124 2024-02-02 03:15:53 +11:00 committed by GitHub
parent 7c5ab8fcec
commit e33d76568c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 35 deletions

View File

@ -86,7 +86,7 @@ void Letterbox_Update(s32 updateRate) {
sLetterboxState = LETTERBOX_STATE_IDLE;
}
if (R_HREG_MODE == HREG_MODE_LETTERBOX) {
if (OOT_DEBUG && (R_HREG_MODE == HREG_MODE_LETTERBOX)) {
if (R_LETTERBOX_INIT != HREG_MODE_LETTERBOX) {
R_LETTERBOX_INIT = HREG_MODE_LETTERBOX;
R_LETTERBOX_ENABLE_LOGS = 0;

View File

@ -13,11 +13,19 @@ void SysCfb_Init(s32 n64dd) {
tmpFbEnd = 0x8044BE80;
if (n64dd == 1) {
PRINTF("RAM 8M mode (N64DD対応)\n"); // "RAM 8M mode (N64DD compatible)"
#if OOT_DEBUG
sSysCfbEnd = 0x805FB000;
#else
sSysCfbEnd = 0x80600000;
#endif
} else {
// "The margin for this version is %dK bytes"
PRINTF("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024));
#if OOT_DEBUG
sSysCfbEnd = tmpFbEnd;
#else
sSysCfbEnd = 0x80400000;
#endif
}
} else if (osMemSize >= 0x400000) {
PRINTF("RAM4M mode\n");
@ -28,6 +36,9 @@ void SysCfb_Init(s32 n64dd) {
screenSize = SCREEN_WIDTH * SCREEN_HEIGHT;
sSysCfbEnd &= ~0x3F;
if (1) {}
// "The final address used by the system is %08x"
PRINTF("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
sSysCfbFbPtr[0] = sSysCfbEnd - (screenSize * 4);

View File

@ -407,8 +407,10 @@ void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) {
* instead, with a minimum step of minStep. Returns remaining distance to target.
*/
f32 Math_SmoothStepToF(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep) {
f32 stepSize;
if (*pValue != target) {
f32 stepSize = (target - *pValue) * fraction;
stepSize = (target - *pValue) * fraction;
if ((stepSize >= minStep) || (stepSize <= -minStep)) {
if (stepSize > step) {

View File

@ -64,13 +64,12 @@ void Lights_Draw(Lights* lights, GraphicsContext* gfxCtx) {
gSPNumLights(POLY_OPA_DISP++, lights->numLights);
gSPNumLights(POLY_XLU_DISP++, lights->numLights);
i = 0;
light = &lights->l.l[0];
i = 0;
while (i < lights->numLights) {
gSPLight(POLY_OPA_DISP++, light, ++i);
gSPLight(POLY_XLU_DISP++, light, i);
light++;
gSPLight(POLY_XLU_DISP++, light++, i);
}
// ambient light is total number of lights + 1
@ -314,22 +313,20 @@ Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambient
}
void Lights_GlowCheck(PlayState* play) {
LightNode* node;
LightPoint* params;
Vec3f pos;
Vec3f multDest;
f32 cappedInvWDest;
f32 wX;
f32 wY;
s32 wZ;
s32 zBuf;
node = play->lightCtx.listHead;
LightNode* node = play->lightCtx.listHead;
while (node != NULL) {
params = &node->info->params.point;
LightPoint* params = &node->info->params.point;
if (node->info->type == LIGHT_POINT_GLOW) {
Vec3f pos;
Vec3f multDest;
f32 cappedInvWDest;
f32 wX;
f32 wY;
s32 wZ;
s32 zBuf;
pos.x = params->x;
pos.y = params->y;
pos.z = params->z;
@ -362,9 +359,7 @@ void Lights_GlowCheck(PlayState* play) {
void Lights_DrawGlow(PlayState* play) {
s32 pad;
LightNode* node;
node = play->lightCtx.listHead;
LightNode* node = play->lightCtx.listHead;
OPEN_DISPS(play->state.gfxCtx, "../z_lights.c", 887);
@ -374,23 +369,20 @@ void Lights_DrawGlow(PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleTextureLoadDL);
while (node != NULL) {
LightInfo* info;
LightPoint* params;
f32 scale;
s32 pad[4];
if ((node->info->type == LIGHT_POINT_GLOW)) {
s32 pad[6];
LightPoint* params = &node->info->params.point;
info = node->info;
params = &info->params.point;
if (params->drawGlow) {
f32 scale = SQ(params->radius) * 0.0000026f;
if ((info->type == LIGHT_POINT_GLOW) && (params->drawGlow)) {
scale = SQ(params->radius) * 0.0000026f;
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lights.c", 918),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50);
Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_lights.c", 918),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL);
}
}
node = node->next;