Name and document z-buffer functions
This commit is contained in:
parent
7349c3b172
commit
73fc947f44
|
|
@ -208,7 +208,7 @@
|
|||
build/ROMID/game/game_175f90.o (section); \
|
||||
build/ROMID/game/buildtime.o (section); \
|
||||
build/ROMID/game/stubs/game_176000.o (section); \
|
||||
build/ROMID/game/game_176080.o (section); \
|
||||
build/ROMID/game/zbuf.o (section); \
|
||||
build/ROMID/game/stagemusic.o (section); \
|
||||
build/ROMID/game/utils.o (section); \
|
||||
build/ROMID/game/mplayer/ingame.o (section); \
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
build/ROMID/game/game_175f90.o (section); \
|
||||
build/ROMID/game/buildtime.o (section); \
|
||||
build/ROMID/game/stubs/game_176000.o (section); \
|
||||
build/ROMID/game/game_176080.o (section); \
|
||||
build/ROMID/game/zbuf.o (section); \
|
||||
build/ROMID/game/stagemusic.o (section); \
|
||||
build/ROMID/game/utils.o (section); \
|
||||
build/ROMID/game/mplayer/ingame.o (section); \
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
build/ROMID/game/game_175f90.o (section); \
|
||||
build/ROMID/game/buildtime.o (section); \
|
||||
build/ROMID/game/stubs/game_176000.o (section); \
|
||||
build/ROMID/game/game_176080.o (section); \
|
||||
build/ROMID/game/zbuf.o (section); \
|
||||
build/ROMID/game/stagemusic.o (section); \
|
||||
build/ROMID/game/utils.o (section); \
|
||||
build/ROMID/game/mplayer/ingame.o (section); \
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
build/ROMID/game/game_175f90.o (section); \
|
||||
build/ROMID/game/buildtime.o (section); \
|
||||
build/ROMID/game/stubs/game_176000.o (section); \
|
||||
build/ROMID/game/game_176080.o (section); \
|
||||
build/ROMID/game/zbuf.o (section); \
|
||||
build/ROMID/game/stagemusic.o (section); \
|
||||
build/ROMID/game/utils.o (section); \
|
||||
build/ROMID/game/mplayer/ingame.o (section); \
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
build/ROMID/game/game_175f90.o (section); \
|
||||
build/ROMID/game/buildtime.o (section); \
|
||||
build/ROMID/game/stubs/game_176000.o (section); \
|
||||
build/ROMID/game/game_176080.o (section); \
|
||||
build/ROMID/game/zbuf.o (section); \
|
||||
build/ROMID/game/stagemusic.o (section); \
|
||||
build/ROMID/game/utils.o (section); \
|
||||
build/ROMID/game/mplayer/ingame.o (section); \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "game/file.h"
|
||||
#include "game/lv.h"
|
||||
#include "game/texdecompress.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/training.h"
|
||||
#include "game/lang.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
|
|
@ -8383,10 +8383,10 @@ glabel var7f1aca90
|
|||
/* f0a71e4: 100002d5 */ b .L0f0a7d3c
|
||||
/* f0a71e8: 8fbf0034 */ lw $ra,0x34($sp)
|
||||
.L0f0a71ec:
|
||||
/* f0a71ec: 0fc5d9ad */ jal mblurRender
|
||||
/* f0a71ec: 0fc5d9ad */ jal zbufDrawArtifactsOffscreen
|
||||
/* f0a71f0: 8fa4014c */ lw $a0,0x14c($sp)
|
||||
/* f0a71f4: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a71f8: 0c002ca0 */ jal vi0000b280
|
||||
/* f0a71f8: 0c002ca0 */ jal viPrepareZbuf
|
||||
/* f0a71fc: 00402025 */ or $a0,$v0,$zero
|
||||
/* f0a7200: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a7204: 0c002c74 */ jal vi0000b1d0
|
||||
|
|
@ -9083,9 +9083,9 @@ glabel var7f1aca90
|
|||
/* f0a7c0c: afb500e4 */ sw $s5,0xe4($sp)
|
||||
/* f0a7c10: 0fc2baf8 */ jal casingsRender
|
||||
/* f0a7c14: 27a4014c */ addiu $a0,$sp,0x14c
|
||||
/* f0a7c18: 0fc5d8a6 */ jal mblur0f176298
|
||||
/* f0a7c18: 0fc5d8a6 */ jal zbufSwap
|
||||
/* f0a7c1c: 00000000 */ nop
|
||||
/* f0a7c20: 0fc5d8ab */ jal mblur0f1762ac
|
||||
/* f0a7c20: 0fc5d8ab */ jal zbufConfigureRdp
|
||||
/* f0a7c24: 8fa4014c */ lw $a0,0x14c($sp)
|
||||
/* f0a7c28: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a7c2c: 0c002c74 */ jal vi0000b1d0
|
||||
|
|
@ -9224,10 +9224,10 @@ glabel var7f1aca90
|
|||
/* f0a71e4: 100002d5 */ b .L0f0a7d3c
|
||||
/* f0a71e8: 8fbf0034 */ lw $ra,0x34($sp)
|
||||
.L0f0a71ec:
|
||||
/* f0a71ec: 0fc5d9ad */ jal mblurRender
|
||||
/* f0a71ec: 0fc5d9ad */ jal zbufDrawArtifactsOffscreen
|
||||
/* f0a71f0: 8fa4014c */ lw $a0,0x14c($sp)
|
||||
/* f0a71f4: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a71f8: 0c002ca0 */ jal vi0000b280
|
||||
/* f0a71f8: 0c002ca0 */ jal viPrepareZbuf
|
||||
/* f0a71fc: 00402025 */ or $a0,$v0,$zero
|
||||
/* f0a7200: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a7204: 0c002c74 */ jal vi0000b1d0
|
||||
|
|
@ -9924,9 +9924,9 @@ glabel var7f1aca90
|
|||
/* f0a7c0c: afb500e4 */ sw $s5,0xe4($sp)
|
||||
/* f0a7c10: 0fc2baf8 */ jal casingsRender
|
||||
/* f0a7c14: 27a4014c */ addiu $a0,$sp,0x14c
|
||||
/* f0a7c18: 0fc5d8a6 */ jal mblur0f176298
|
||||
/* f0a7c18: 0fc5d8a6 */ jal zbufSwap
|
||||
/* f0a7c1c: 00000000 */ nop
|
||||
/* f0a7c20: 0fc5d8ab */ jal mblur0f1762ac
|
||||
/* f0a7c20: 0fc5d8ab */ jal zbufConfigureRdp
|
||||
/* f0a7c24: 8fa4014c */ lw $a0,0x14c($sp)
|
||||
/* f0a7c28: afa2014c */ sw $v0,0x14c($sp)
|
||||
/* f0a7c2c: 0c002c74 */ jal vi0000b1d0
|
||||
|
|
@ -10065,10 +10065,10 @@ glabel var7f1aca90
|
|||
/* f0a4f30: 100002cd */ beqz $zero,.NB0f0a5a68
|
||||
/* f0a4f34: 8fbf0034 */ lw $ra,0x34($sp)
|
||||
.NB0f0a4f38:
|
||||
/* f0a4f38: 0fc5c4d5 */ jal mblurRender
|
||||
/* f0a4f38: 0fc5c4d5 */ jal zbufDrawArtifactsOffscreen
|
||||
/* f0a4f3c: 8fa40144 */ lw $a0,0x144($sp)
|
||||
/* f0a4f40: afa20144 */ sw $v0,0x144($sp)
|
||||
/* f0a4f44: 0c002d00 */ jal vi0000b280
|
||||
/* f0a4f44: 0c002d00 */ jal viPrepareZbuf
|
||||
/* f0a4f48: 00402025 */ or $a0,$v0,$zero
|
||||
/* f0a4f4c: afa20144 */ sw $v0,0x144($sp)
|
||||
/* f0a4f50: 0c002cd4 */ jal vi0000b1d0
|
||||
|
|
@ -10756,9 +10756,9 @@ glabel var7f1aca90
|
|||
/* f0a5938: afb500dc */ sw $s5,0xdc($sp)
|
||||
/* f0a593c: 0fc2b250 */ jal casingsRender
|
||||
/* f0a5940: 27a40144 */ addiu $a0,$sp,0x144
|
||||
/* f0a5944: 0fc5c3ce */ jal mblur0f176298
|
||||
/* f0a5944: 0fc5c3ce */ jal zbufSwap
|
||||
/* f0a5948: 00000000 */ sll $zero,$zero,0x0
|
||||
/* f0a594c: 0fc5c3d3 */ jal mblur0f1762ac
|
||||
/* f0a594c: 0fc5c3d3 */ jal zbufConfigureRdp
|
||||
/* f0a5950: 8fa40144 */ lw $a0,0x144($sp)
|
||||
/* f0a5954: afa20144 */ sw $v0,0x144($sp)
|
||||
/* f0a5958: 0c002cd4 */ jal vi0000b1d0
|
||||
|
|
@ -10862,8 +10862,8 @@ void bgunRender(Gfx **gdlptr)
|
|||
return;
|
||||
}
|
||||
|
||||
gdl = mblurRender(gdl);
|
||||
gdl = vi0000b280(gdl);
|
||||
gdl = zbufDrawArtifactsOffscreen(gdl);
|
||||
gdl = viPrepareZbuf(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
|
||||
gDPSetScissor(gdl++, G_SC_NON_INTERLACE, viGetViewLeft(), viGetViewTop(),
|
||||
|
|
@ -11083,9 +11083,9 @@ void bgunRender(Gfx **gdlptr)
|
|||
}
|
||||
|
||||
casingsRender(&gdl);
|
||||
mblur0f176298();
|
||||
zbufSwap();
|
||||
|
||||
gdl = mblur0f1762ac(gdl);
|
||||
gdl = zbufConfigureRdp(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
|
||||
gDPSetScissor(gdl++, G_SC_NON_INTERLACE, viGetViewLeft(), viGetViewTop(),
|
||||
|
|
|
|||
|
|
@ -1772,7 +1772,7 @@ Gfx *creditsDraw(Gfx *gdl)
|
|||
|
||||
g_ScaleX = 1;
|
||||
|
||||
gdl = vi0000b280(gdl);
|
||||
gdl = viPrepareZbuf(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
gdl = creditsFillFramebuffer(gdl, 0x000000ff);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "game/bg.h"
|
||||
#include "game/file.h"
|
||||
#include "game/lv.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/mplayer/scenarios.h"
|
||||
#include "game/portal.h"
|
||||
#include "game/propobj.h"
|
||||
|
|
@ -596,7 +596,19 @@ void func0f001c0c(void)
|
|||
|
||||
mempGetStageFree();
|
||||
|
||||
ptr = mblurGetAllocation();
|
||||
/**
|
||||
* This lighting initialisation needs to build temporary tables in memory.
|
||||
* The memp system allows freeing of the most recent allocation *only*,
|
||||
* so it's not easy to build these tables and dispose of them afterwards.
|
||||
*
|
||||
* Instead of using memp, it uses the z-buffer as a temporary scratch space.
|
||||
* This is safe because there are no RDP tasks in progress at this point.
|
||||
* The game waits for them to complete before loading the stage.
|
||||
*
|
||||
* Note that for some stages the z-buffer allocation must be higher than the
|
||||
* lo-res size to support the lighting needs here.
|
||||
*/
|
||||
ptr = zbufGetAllocation();
|
||||
|
||||
var80061434 = (f32 *)ptr;
|
||||
ptr += table1size;
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ void artifactsCalculateGlaresForRoom(s32 roomnum)
|
|||
yi = func0f13c710(viewtop + (1.0f - spdc[1] * f20) * (viewheight * 0.5f));
|
||||
f0 = (spdc[2] * f20 * 511.0f + 511.0f) * 32.0f;
|
||||
|
||||
if (var800844f0
|
||||
if (g_ZbufPtr1
|
||||
&& xi >= (s32)viewleft
|
||||
&& xi < (s32)(viewleft + viewwidth)
|
||||
&& yi >= (s32)viewtop
|
||||
|
|
@ -323,7 +323,7 @@ void artifactsCalculateGlaresForRoom(s32 roomnum)
|
|||
|
||||
if (index < MAX_ARTIFACTS) {
|
||||
artifact->unk04 = func0f13c574(f0) >> 2;
|
||||
artifact->unk08 = &var800844f0[viGetWidth() * yi + xi];
|
||||
artifact->unk08 = &g_ZbufPtr1[viGetWidth() * yi + xi];
|
||||
artifact->light = &roomlights[i];
|
||||
artifact->type = ARTIFACTTYPE_GLARE;
|
||||
artifact->unk0c.u16_2 = xi;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include "game/sky.h"
|
||||
#include "game/game_13c510.h"
|
||||
#include "game/game_1531a0.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/challenge.h"
|
||||
#include "game/chrmgr.h"
|
||||
#include "game/env.h"
|
||||
|
|
@ -999,7 +999,7 @@ Gfx *lvRender(Gfx *gdl)
|
|||
gSPDisplayList(gdl++, &var80061380);
|
||||
}
|
||||
|
||||
gdl = vi0000b280(gdl);
|
||||
gdl = viPrepareZbuf(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
|
||||
gDPSetScissorFrac(gdl++, 0,
|
||||
|
|
@ -1145,8 +1145,8 @@ Gfx *lvRender(Gfx *gdl)
|
|||
g_Vars.currentplayer->viewwidth, g_Vars.currentplayer->viewheight);
|
||||
mtx00016748(g_Vars.currentplayerstats->scale_bg2gfx);
|
||||
env0f1657f8();
|
||||
mblur0f176298();
|
||||
gdl = vi0000b280(gdl);
|
||||
zbufSwap();
|
||||
gdl = viPrepareZbuf(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
gdl = currentPlayerScissorToViewport(gdl);
|
||||
artifactsClear();
|
||||
|
|
|
|||
|
|
@ -1874,7 +1874,7 @@ Gfx *menuRenderModels(Gfx *gdl, struct menu840 *thing, s32 arg2)
|
|||
bool sp2f4;
|
||||
|
||||
if (arg2 < 3 && g_MenuData.unk5d5_03) {
|
||||
gdl = vi0000b280(gdl);
|
||||
gdl = viPrepareZbuf(gdl);
|
||||
gdl = vi0000b1d0(gdl);
|
||||
|
||||
g_MenuData.unk5d5_03 = false;
|
||||
|
|
|
|||
|
|
@ -2373,7 +2373,7 @@ void skyCreateArtifact(struct artifact *artifact, s32 x, s32 y)
|
|||
s32 viewheight = viGetViewHeight();
|
||||
|
||||
if (x >= viewleft && x < viewleft + viewwidth && y >= viewtop && y < viewtop + viewheight) {
|
||||
artifact->unk08 = &var800844f0[(s32)camGetScreenWidth() * y + x];
|
||||
artifact->unk08 = &g_ZbufPtr1[(s32)camGetScreenWidth() * y + x];
|
||||
artifact->unk0c.u16_2 = x;
|
||||
artifact->unk0c.u16_1 = y;
|
||||
artifact->type = ARTIFACTTYPE_CIRCLE;
|
||||
|
|
@ -2424,7 +2424,7 @@ Gfx *skyRenderSuns(Gfx *gdl, bool xray)
|
|||
|
||||
xscale = 1;
|
||||
|
||||
if (env->numsuns <= 0 || !var800844f0 || g_Vars.mplayerisrunning) {
|
||||
if (env->numsuns <= 0 || !g_ZbufPtr1 || g_Vars.mplayerisrunning) {
|
||||
return gdl;
|
||||
}
|
||||
|
||||
|
|
@ -2876,7 +2876,7 @@ Gfx *skyRenderArtifacts(Gfx *gdl)
|
|||
gdl = sky0f126de8(gdl);
|
||||
}
|
||||
|
||||
if (env->numsuns <= 0 || !var800844f0 || g_Vars.mplayerisrunning) {
|
||||
if (env->numsuns <= 0 || !g_ZbufPtr1 || g_Vars.mplayerisrunning) {
|
||||
return gdl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "constants.h"
|
||||
#include "lib/sched.h"
|
||||
#include "game/player.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
#include "game/options.h"
|
||||
#include "bss.h"
|
||||
|
|
@ -11,64 +11,91 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
u32 var800ab7c0;
|
||||
u32 var800ab7c4;
|
||||
u16 var800ab7c8[0x180];
|
||||
u16 var800abac8[0x180];
|
||||
u16 var800abdc8[0x180];
|
||||
u32 g_ZbufWidth;
|
||||
u32 g_ZbufHeight;
|
||||
u16 g_ArtifactsCfb0[0x180];
|
||||
u16 g_ArtifactsCfb1[0x180];
|
||||
u16 g_ArtifactsCfb2[0x180];
|
||||
|
||||
u16 *var800844f0 = NULL;
|
||||
void *var800844f4 = NULL;
|
||||
u16 *g_ZbufPtr1 = NULL;
|
||||
u16 *g_ZbufPtr2 = NULL;
|
||||
|
||||
void *mblurGetAllocation(void)
|
||||
void *zbufGetAllocation(void)
|
||||
{
|
||||
return var800844f0;
|
||||
return g_ZbufPtr1;
|
||||
}
|
||||
|
||||
void mblurReset(s32 stagenum)
|
||||
void zbufReset(s32 stagenum)
|
||||
{
|
||||
var800844f0 = 0;
|
||||
var800844f4 = 0;
|
||||
g_ZbufPtr1 = NULL;
|
||||
g_ZbufPtr2 = NULL;
|
||||
|
||||
if (stagenum != STAGE_TITLE) {
|
||||
mblurAllocate();
|
||||
zbufAllocate();
|
||||
}
|
||||
}
|
||||
|
||||
void mblurAllocate(void)
|
||||
/**
|
||||
* In 4MB 2-player, the viewports are displayed with a vertical split and are
|
||||
* only half a screen height (the top 25% and bottom 25% of the screen are
|
||||
* black), so a half-height z-buffer is allocated.
|
||||
*
|
||||
* In 8MB, the full hi-res buffer is allocated. This makes sense for solo
|
||||
* missions because the player can switch to hi-res mid game. For normal
|
||||
* multiplayer this is wasteful but there's plenty of memory. For coop and anti
|
||||
* this is also wasteful, and memory is tight. They could have saved 137.5 KB.
|
||||
*/
|
||||
void zbufAllocate(void)
|
||||
{
|
||||
if (IS4MB()) {
|
||||
var800ab7c0 = 320;
|
||||
g_ZbufWidth = 320;
|
||||
|
||||
if (g_Vars.normmplayerisrunning && PLAYERCOUNT() >= 2) {
|
||||
var800ab7c4 = 110;
|
||||
g_ZbufHeight = 110;
|
||||
} else {
|
||||
var800ab7c4 = 220;
|
||||
g_ZbufHeight = 220;
|
||||
}
|
||||
} else {
|
||||
var800ab7c0 = 640;
|
||||
g_ZbufWidth = 640;
|
||||
|
||||
if (g_Vars.normmplayerisrunning && PLAYERCOUNT() >= 2) {
|
||||
var800ab7c4 = 220;
|
||||
g_ZbufHeight = 220;
|
||||
} else {
|
||||
var800ab7c4 = 220;
|
||||
g_ZbufHeight = 220;
|
||||
}
|
||||
}
|
||||
|
||||
var800844f0 = mempAlloc(var800ab7c0 * var800ab7c4 * 2 + 0x40, MEMPOOL_STAGE);
|
||||
var800844f0 = (void *)(((uintptr_t) var800844f0 + 0x3f) & ~0x3f);
|
||||
var800844f4 = var800844f0;
|
||||
g_ZbufPtr1 = mempAlloc(g_ZbufWidth * g_ZbufHeight * sizeof(u16) + 0x40, MEMPOOL_STAGE);
|
||||
g_ZbufPtr1 = (void *) (((uintptr_t) g_ZbufPtr1 + 0x3f) & ~0x3f);
|
||||
g_ZbufPtr2 = g_ZbufPtr1;
|
||||
}
|
||||
|
||||
void mblur0f176298(void)
|
||||
/**
|
||||
* Note: There is only one z-buffer, so there is nothing to swap.
|
||||
* Both of these pointers always have the same value.
|
||||
*
|
||||
* We assume this is a swap function due to the context in which it's called.
|
||||
* Perhaps the developers implemented two buffers with swapping before realising
|
||||
* they only needed one.
|
||||
*/
|
||||
void zbufSwap(void)
|
||||
{
|
||||
var800844f4 = var800844f0;
|
||||
g_ZbufPtr2 = g_ZbufPtr1;
|
||||
}
|
||||
|
||||
Gfx *mblur0f1762ac(Gfx *gdl)
|
||||
/**
|
||||
* In 8MB multiplayer, players on the bottom half of the screen have their
|
||||
* z-buffer shifted backwards by half a screen. This is safe because it's using
|
||||
* a scissor on the viewport.
|
||||
*
|
||||
* This allows the z-buffer allocation to be half a screen instead of a full
|
||||
* screen, however zbufAllocate allocates the full hi-res screen for 8MB,
|
||||
* so this benefit is not realised. The shifting code is likely from GE.
|
||||
*/
|
||||
Gfx *zbufConfigureRdp(Gfx *gdl)
|
||||
{
|
||||
u32 subamount;
|
||||
u32 addr;
|
||||
uintptr_t addr;
|
||||
|
||||
if (g_Vars.normmplayerisrunning
|
||||
&& (g_Vars.currentplayernum >= 2 || (PLAYERCOUNT() == 2 && g_Vars.currentplayernum == 1))) {
|
||||
|
|
@ -81,7 +108,7 @@ Gfx *mblur0f1762ac(Gfx *gdl)
|
|||
subamount = 0;
|
||||
}
|
||||
|
||||
addr = (uintptr_t)var800844f4 - subamount;
|
||||
addr = (uintptr_t) g_ZbufPtr2 - subamount;
|
||||
addr &= ~0x3f;
|
||||
|
||||
gDPPipeSync(gdl++);
|
||||
|
|
@ -90,14 +117,17 @@ Gfx *mblur0f1762ac(Gfx *gdl)
|
|||
return gdl;
|
||||
}
|
||||
|
||||
Gfx *mblur0f1763f4(Gfx *gdl)
|
||||
/**
|
||||
* Clear the current player's portion of the z-buffer.
|
||||
*/
|
||||
Gfx *zbufClear(Gfx *gdl)
|
||||
{
|
||||
s32 left;
|
||||
s32 right;
|
||||
|
||||
gDPPipeSync(gdl++);
|
||||
gDPSetRenderMode(gdl++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetColorImage(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, viGetWidth(), OS_PHYSICAL_TO_K0(var800844f4));
|
||||
gDPSetColorImage(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, viGetWidth(), OS_PHYSICAL_TO_K0(g_ZbufPtr2));
|
||||
gDPSetCycleType(gdl++, G_CYC_FILL);
|
||||
gDPSetFillColor(gdl++, 0xfffcfffc);
|
||||
gDPSetScissorFrac(gdl++, G_SC_NON_INTERLACE, 0, 0, playerGetFbWidth() * 4.0f, playerGetFbHeight() * 4.0f);
|
||||
|
|
@ -119,32 +149,32 @@ Gfx *mblur0f1763f4(Gfx *gdl)
|
|||
return gdl;
|
||||
}
|
||||
|
||||
u16 *mblur0f176668(s32 arg0)
|
||||
u16 *zbufGetArtifactsCfb(s32 index)
|
||||
{
|
||||
u16 *addr;
|
||||
|
||||
if (arg0 == 0) {
|
||||
addr = var800ab7c8;
|
||||
if (index == 0) {
|
||||
addr = g_ArtifactsCfb0;
|
||||
}
|
||||
|
||||
if (arg0 == 1) {
|
||||
addr = var800abac8;
|
||||
if (index == 1) {
|
||||
addr = g_ArtifactsCfb1;
|
||||
}
|
||||
|
||||
if (arg0 == 2) {
|
||||
addr = var800abdc8;
|
||||
if (index == 2) {
|
||||
addr = g_ArtifactsCfb2;
|
||||
}
|
||||
|
||||
addr = (u16 *)(((uintptr_t)addr + 0x3f) & ~0x3f);
|
||||
addr = (u16 *) (((uintptr_t) addr + 0x3f) & ~0x3f);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
Gfx *mblurRender(Gfx *gdl)
|
||||
Gfx *zbufDrawArtifactsOffscreen(Gfx *gdl)
|
||||
{
|
||||
struct artifact *artifacts = schedGetWriteArtifacts();
|
||||
u32 stack;
|
||||
u16 *sp4c = var800844f0;
|
||||
u16 *sp4c = g_ZbufPtr1;
|
||||
u32 s4 = 0;
|
||||
u16 *sp44;
|
||||
u16 *s2;
|
||||
|
|
@ -152,7 +182,7 @@ Gfx *mblurRender(Gfx *gdl)
|
|||
s32 i;
|
||||
|
||||
viGetBackBuffer();
|
||||
sp44 = mblur0f176668(g_SchedWriteArtifactsIndex);
|
||||
sp44 = zbufGetArtifactsCfb(g_SchedWriteArtifactsIndex);
|
||||
g_SchedSpecialArtifactIndexes[g_SchedWriteArtifactsIndex] = 1;
|
||||
|
||||
gDPPipeSync(gdl++);
|
||||
|
|
@ -452,7 +452,7 @@ extern bool g_Jpn;
|
|||
extern s32 g_LanguageId;
|
||||
#endif
|
||||
extern struct surfacetype *g_SurfaceTypes[15];
|
||||
extern u16 *var800844f0;
|
||||
extern u16 *g_ZbufPtr1;
|
||||
extern f32 var800845d4;
|
||||
extern struct coord var800845dc;
|
||||
extern struct menudialogdef g_2PMissionInventoryHMenuDialog;
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef IN_GAME_GAME_176080_H
|
||||
#define IN_GAME_GAME_176080_H
|
||||
#include <ultra64.h>
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
void *mblurGetAllocation(void);
|
||||
void mblurReset(s32 stagenum);
|
||||
void mblurAllocate(void);
|
||||
void mblur0f176298(void);
|
||||
Gfx *mblur0f1762ac(Gfx *gdl);
|
||||
Gfx *mblur0f1763f4(Gfx *gdl);
|
||||
Gfx *mblurRender(Gfx *gdl);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef IN_GAME_ZBUF_H
|
||||
#define IN_GAME_ZBUF_H
|
||||
#include <ultra64.h>
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
void *zbufGetAllocation(void);
|
||||
void zbufReset(s32 stagenum);
|
||||
void zbufAllocate(void);
|
||||
void zbufSwap(void);
|
||||
Gfx *zbufConfigureRdp(Gfx *gdl);
|
||||
Gfx *zbufClear(Gfx *gdl);
|
||||
Gfx *zbufDrawArtifactsOffscreen(Gfx *gdl);
|
||||
|
||||
#endif
|
||||
|
|
@ -25,7 +25,7 @@ Gfx *vi0000af00(Gfx *gdl, Vp *vp);
|
|||
Gfx *vi0000b0e8(Gfx *gdl, f32 fovy, f32 aspect);
|
||||
Gfx *vi0000b1a8(Gfx *gdl);
|
||||
Gfx *vi0000b1d0(Gfx *gdl);
|
||||
Gfx *vi0000b280(Gfx *gdl);
|
||||
Gfx *viPrepareZbuf(Gfx *gdl);
|
||||
Gfx *viFillBuffer(Gfx *gdl);
|
||||
Gfx *viRenderViewportEdges(Gfx *gdl);
|
||||
void viSetBufSize(s16 width, s16 height);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "game/music.h"
|
||||
#include "game/stubs/game_175f50.h"
|
||||
#include "game/game_175f90.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/game_1a78b0.h"
|
||||
#include "game/mplayer/mplayer.h"
|
||||
#include "game/pak.h"
|
||||
|
|
@ -1340,7 +1340,7 @@ void mainLoop(void)
|
|||
gfxReset();
|
||||
joyReset();
|
||||
dhudReset();
|
||||
mblurReset(g_StageNum);
|
||||
zbufReset(g_StageNum);
|
||||
lvReset(g_StageNum);
|
||||
viReset(g_StageNum);
|
||||
frametimeCalculate();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <n_libaudio.h>
|
||||
#include "constants.h"
|
||||
#include "game/music.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/stagemusic.h"
|
||||
#include "bss.h"
|
||||
#include "lib/snd.h"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include "game/camera.h"
|
||||
#include "game/player.h"
|
||||
#include "game/file.h"
|
||||
#include "game/game_176080.h"
|
||||
#include "game/zbuf.h"
|
||||
#include "game/gfxmemory.h"
|
||||
#include "game/menu.h"
|
||||
#include "game/options.h"
|
||||
|
|
@ -1377,11 +1377,11 @@ Gfx *vi0000b1d0(Gfx *gdl)
|
|||
return gdl;
|
||||
}
|
||||
|
||||
Gfx *vi0000b280(Gfx *gdl)
|
||||
Gfx *viPrepareZbuf(Gfx *gdl)
|
||||
{
|
||||
if (g_ViBackData->usezbuf) {
|
||||
gdl = mblur0f1762ac(gdl);
|
||||
gdl = mblur0f1763f4(gdl);
|
||||
gdl = zbufConfigureRdp(gdl);
|
||||
gdl = zbufClear(gdl);
|
||||
}
|
||||
|
||||
return gdl;
|
||||
|
|
|
|||
Loading…
Reference in New Issue