src/core1: various video/screen/framebuffer related documentations

neue Datei:     include/core1/vimgr.h
        umbenannt:      src/core1/code_E360.c -> src/core1/vimgr.c
This commit is contained in:
mariob92
2024-10-09 08:11:35 +02:00
parent 50138293a4
commit 6050ddbbd2
45 changed files with 398 additions and 368 deletions

View File

@@ -8,7 +8,6 @@
#define ABS(d) ((d) >= 0) ? (d) : -(d)
#endif
extern s16 D_803A5D00[2][0xF660]; //framebuffer
extern u8 D_8037DCC8; //bottles bonus flags???
@@ -156,7 +155,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
func_80253208(gfx,
(s32)(D_8037E5C0.unk18[0] - sp3C/2), (s32)(D_8037E5C0.unk18[1] - sp3C/2),
(s32)sp3C, (s32)sp3C,
D_803A5D00[getActiveFramebuffer()]
gFramebuffers[getActiveFramebuffer()]
);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, marker_loadModelBin(chBottlesBonusCursorMarker));
viewport_func_8024E030(this->position, D_8037E5C0.unk10);

View File

@@ -20,7 +20,7 @@ void func_802BE940(void)
sp3C[0] = (sp3C[1] = (sp3C[2] = 0.0f));
sp3C[1] = -1.0f;
ml_vec3f_pitch_rotate_copy(sp24, sp3C, 68.0f);
sp30[0] = sp24[1] * ((f32) framebuffer_width / framebuffer_height);
sp30[0] = sp24[1] * ((f32) gFramebufferWidth / gFramebufferHeight);
sp30[1] = 0;
D_8037DA40[1] = sp24[1];

View File

@@ -11,10 +11,6 @@ extern void func_8033DC18(void);
extern f32 func_8033DC20(void);
extern void func_8033DC9C(f32);
extern s32 framebuffer_width; //framebuffer_width
extern s32 framebuffer_height; //framebuffer_height
extern s16 D_803A5D00[2][0xF660]; //framebuffer
/* .bss */
struct {
f32 unk0;
@@ -35,7 +31,7 @@ void func_802E31D0(s32 arg0) {
if ((temp_v0 == 0) || (temp_v0 == 3)) {
func_8024A85C(arg0);
func_80249DE0(0, 0, D_8037E8C0.unkC, 0, 0);
osWritebackDCache(D_803A5D00[arg0], (s32) ((f32) framebuffer_width * (f32) framebuffer_height * sizeof(s16)));
osWritebackDCache(gFramebuffers[arg0], (s32) ((f32) gFramebufferWidth * (f32) gFramebufferHeight * sizeof(s16)));
}
}
@@ -53,14 +49,14 @@ void func_802E329C(s32 arg0, Gfx **gfx_begin, Gfx **gfx_end) {
vtx_start = vtx;
scissorBox_SetForGameMode(&gfx, arg0);
if (D_8037E8C0.unk14 == 2) {
drawRectangle2D(&gfx, 0, 0, (s32) (f32) framebuffer_width, (s32) (f32) framebuffer_height, 0, 0, 0);
drawRectangle2D(&gfx, 0, 0, (s32) (f32) gFramebufferWidth, (s32) (f32) gFramebufferHeight, 0, 0, 0);
}
if ((D_8037E8C0.unk14 == 0) || (D_8037E8C0.unk14 == 3)) {
viewport_setRenderViewportAndPerspectiveMatrix(&gfx, &mtx);
gcbound_draw(&gfx);
}
if (D_8037E8C0.unk14 == 1) {
drawRectangle2D(&gfx, 0, 0, (s32) (f32) framebuffer_width, (s32) (f32) framebuffer_height, 0, 0, 0);
drawRectangle2D(&gfx, 0, 0, (s32) (f32) gFramebufferWidth, (s32) (f32) gFramebufferHeight, 0, 0, 0);
viewport_setRenderViewportAndPerspectiveMatrix(&gfx, &mtx);
func_802F1858(D_8037E8C0.unk10, &gfx, &mtx, &vtx);
}
@@ -95,11 +91,11 @@ void func_802E3524(s32 arg0) {
Gfx *gfx_begin;
Gfx *gfx_end;
func_802E31D0(func_8024BD80());
func_802E329C(func_8024BD80(), &gfx_begin, &gfx_end);
func_802E31D0(getOtherFramebuffer());
func_802E329C(getOtherFramebuffer(), &gfx_begin, &gfx_end);
func_80253EA4(gfx_begin, gfx_end);
func_80254008();
func_8024C1B4();
viMgr_func_8024C1B4();
}
void func_802E3580(void) {
@@ -107,8 +103,8 @@ void func_802E3580(void) {
func_802F1884(D_8037E8C0.unk10);
func_802E5F68();
comusicPlayer_free();
dummy_func_80253420();
func_8024BF94(2);
depthBuffer_stub();
viMgr_func_8024BF94(2);
}
void dummy_func_802E35D0(void){}

View File

@@ -301,7 +301,7 @@ void game_draw(s32 arg0){
if(D_8037E8E0.unkC == 0){
sp2C = gfx;
func_8024C1DC();
viMgr_func_8024C1DC();
func_80253EC4(gfx_start, sp2C);
if(arg0) {
@@ -365,7 +365,7 @@ void func_802E4170(void){
timedFuncQueue_free();
func_802F9C48();
modelRender_free();
dummy_func_80253420();
depthBuffer_stub();
func_802E398C(0);
func_8030AFD8(0);
func_80321854();

View File

@@ -481,7 +481,7 @@ void func_802E6628(s32 arg0, char *arg1) {
sp2C = func_802E4E54(0);
arg0 *= D_8037E900->unk4[sp2C].height;
func_802E502C((s32) (((f32) framebuffer_width - (f32) func_802E51A4(arg1, sp2C, 0, D_8037E900->flags)) / 2), arg0, sp2C, arg1, sp28);
func_802E502C((s32) (((f32) gFramebufferWidth - (f32) func_802E51A4(arg1, sp2C, 0, D_8037E900->flags)) / 2), arg0, sp2C, arg1, sp28);
}
void func_802E66F0(s32 arg0, char *arg1) {
@@ -491,7 +491,7 @@ void func_802E66F0(s32 arg0, char *arg1) {
sp24 = func_802E4E54(0);
arg0 *= D_8037E900->unk4[sp24].height;
func_802E502C((s32) (((f32) framebuffer_width - (f32) func_802E51A4(arg1, sp24, 0, D_8037E900->flags)) / 2), arg0, sp24, arg1, D_8037E900->unk1C);
func_802E502C((s32) (((f32) gFramebufferWidth - (f32) func_802E51A4(arg1, sp24, 0, D_8037E900->flags)) / 2), arg0, sp24, arg1, D_8037E900->unk1C);
}
void func_802E67AC(void){

View File

@@ -4,7 +4,6 @@
#include "variables.h"
extern s16 D_803A5D00[2][0xF660];
typedef struct Struct_Core2_6A4B0_2{
s16 (*vtx_coord)[3];
@@ -75,8 +74,8 @@ void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
gSPVertex((*gfx)++, osVirtualToPhysical(i_vtx), 16, 0);
for(sp4C = 0; sp4C < 6; sp4C++){
for(sp50 = 0; sp50 < 9; sp50++){
s16 *tmem = arg0->tmem_ptr + (0x20*sp50 + 1) + (0x20*sp4C + 0xC)*framebuffer_width;
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(tmem), G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, 0, 0, 0, 33, 33, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
s16 *tmem = arg0->tmem_ptr + (0x20*sp50 + 1) + (0x20*sp4C + 0xC)*gFramebufferWidth;
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(tmem), G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, 0, 0, 0, 33, 33, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
for(sp54 = 0; sp54 < 2; sp54++){
gSP1Triangle((*gfx)++, var_s3, var_s3 + 1, var_s3 + 2, 0);
var_s3 += 3;
@@ -129,12 +128,12 @@ Struct_Core2_6A4B0_2 *func_802F18F0(void){
void func_802F1934(Struct_Core2_6A4B0_2 * arg0, s32 arg1){
func_802F18B8(arg0);
arg0->tmem_raw_ptr = malloc(framebuffer_width*framebuffer_height*sizeof(u16) + 0x10);
arg0->tmem_raw_ptr = malloc(gFramebufferWidth*gFramebufferHeight*sizeof(u16) + 0x10);
arg0->tmem_ptr = arg0->tmem_raw_ptr;
while(((s32)arg0->tmem_ptr & 0x10) == 0){
arg0->tmem_ptr = (u16*)((s32)arg0->tmem_ptr + 1);
}
func_80253010(arg0->tmem_ptr, D_803A5D00[arg1], framebuffer_width*framebuffer_height*sizeof(u16));
func_80253010(arg0->tmem_ptr, gFramebuffers[arg1], gFramebufferWidth*gFramebufferHeight*sizeof(u16));
osWriteBackDCacheAll();
}
@@ -163,8 +162,8 @@ void func_802F1A10(Struct_Core2_6A4B0_2 *arg0, f32 angle_degrees) {
cos = cosf(angle_degrees * 2 * BAD_PI);
sin = sinf(angle_degrees * 2 * BAD_PI);
viewport_getPosition_vec3f(spC0);
spCC[0] = (-(framebuffer_width / 2) * 4) + 8;
spCC[1] = ((framebuffer_height / 2) * 4) - 0x38;
spCC[0] = (-(gFramebufferWidth / 2) * 4) + 8;
spCC[1] = ((gFramebufferHeight / 2) * 4) - 0x38;
spCC[2] = -0xA;
for(var_s6 = 0; var_s6 < 6; var_s6++){
for(var_s4 = 0; var_s4 < 9; var_s4++){

View File

@@ -6,7 +6,6 @@
#include "ml/mtx.h"
extern s16 D_803A5D00[2][0xF660];
extern f32 func_80257680(f32, f32, f32);
@@ -87,23 +86,23 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
mlMtx_apply_vec3f(spD0, spD0);
spD0[0] = (-297.0f * spD0[0]) / spD0[2];
spD0[1] = (297.0f * spD0[1]) / spD0[2];
spC4 = (s32) (spD0[0] + (f32) (framebuffer_width / 2));
spC0 = (s32) (spD0[1] + (f32) (framebuffer_height / 2));
spC4 = (s32) (spD0[0] + (f32) (gFramebufferWidth / 2));
spC0 = (s32) (spD0[1] + (f32) (gFramebufferHeight / 2));
if (spC4 < 0) {
spC4 = 0;
} else if (framebuffer_width - 0x20 < spC4) {
spC4 = framebuffer_width - 0x20;
} else if (gFramebufferWidth - 0x20 < spC4) {
spC4 = gFramebufferWidth - 0x20;
}
if (spC0 < 0) {
spC0 = 0;
} else if (framebuffer_height - 0x20 < spC0) {
spC0 = framebuffer_height - 0x20;
} else if (gFramebufferHeight - 0x20 < spC0) {
spC0 = gFramebufferHeight - 0x20;
}
gSPDisplayList((*gfx)++, D_80368AC0);
func_80347FC0(gfx, D_80368AB0[1].unk0, 0, 0, 0, 0, 0, NULL, NULL, &width, &height);
temp_addr = &D_803A5D00[func_8024BD80()][spC0*framebuffer_width + (spC4 & 0xFFFC)];
gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, temp_addr);
temp_addr = &gFramebuffers[getOtherFramebuffer()][spC0*gFramebufferWidth + (spC4 & 0xFFFC)];
gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, temp_addr);
gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 9, 0x0080, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync((*gfx)++);
gDPLoadTile((*gfx)++, G_TX_LOADTILE, 0, 0, 0x008C, 0x007C);

View File

@@ -740,8 +740,8 @@ void _printbuffer_draw_letter(char letter, f32* xPtr, f32* yPtr, f32 arg3, Gfx *
temp_f24 = (sp214->x - 1.0);
spD0 = sp214->y - 1.0;
temp_f26 = (f64) sp200 - (f32) framebuffer_width * 0.5;
spC0 = (f64)f28 - (f32)framebuffer_height*0.5 -0.5f;
temp_f26 = (f64) sp200 - (f32) gFramebufferWidth * 0.5;
spC0 = (f64)f28 - (f32)gFramebufferHeight*0.5 -0.5f;
gSPVertex((*gfx)++, *vtx, 4, 0);
for(iy = 0.0f; iy < 2.0; iy+= 1.0){
for(ix = 0.0f; ix < 2.0; ix += 1.0){

View File

@@ -1,9 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
extern s16 D_803A5D00[2][0xF660];
void func_802FEDE0(BKTextureList *texture_list, s32 indx, s32 x_offset, s32 y_offset){
u16 *sp24;
u16 *frame_buffer_ptr;
@@ -11,10 +10,10 @@ void func_802FEDE0(BKTextureList *texture_list, s32 indx, s32 x_offset, s32 y_of
s32 x;
sp24 = (u16*)func_802EA620(texture_list) + indx*32*32;
frame_buffer_ptr = D_803A5D00[getActiveFramebuffer()];
frame_buffer_ptr = gFramebuffers[getActiveFramebuffer()];
for(y = 0; y < 32; y++){//L802FEE60
for(x = 0; x < 32; x++){//L802FEE68
sp24[32*(31 - y) + x] = frame_buffer_ptr[(y_offset + y)*framebuffer_width + (x_offset + x)] | 1; //framebuffer to texture???
sp24[32*(31 - y) + x] = frame_buffer_ptr[(y_offset + y)*gFramebufferWidth + (x_offset + x)] | 1; //framebuffer to texture???
};
};
}
@@ -25,12 +24,12 @@ void func_802FEF48(BKModelBin *model_bin){
s32 x, y;
texture_list = model_getTextureList(model_bin);
osInvalDCache((void *)D_803A5D00[getActiveFramebuffer()], framebuffer_width * framebuffer_height*2);
osInvalDCache((void *)gFramebuffers[getActiveFramebuffer()], gFramebufferWidth * gFramebufferHeight*2);
for(y = 0; y < 8; y++){//L802FEFEC
for(x = 0; x < 10; x++){
//get textures from framebuffer???
func_802FEDE0(texture_list, 10*y + x, 32*x + (framebuffer_width - 10*32)/2, (s32)32*y + (framebuffer_height - 8*32)/2);
func_802FEDE0(texture_list, 10*y + x, 32*x + (gFramebufferWidth - 10*32)/2, (s32)32*y + (gFramebufferHeight - 8*32)/2);
}
};

View File

@@ -1,9 +1,8 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
extern u8 D_803A5D00[2][0x1ecc0];
#define TILE_SIZE 32
#define TILE_COUNT_X 5
@@ -91,7 +90,7 @@ void func_8030C27C(void){
void func_8030C2D4(Gfx **gdl, Mtx **mptr, Vtx **vptr){
scissorBox_setDefault();
func_80253640(gdl, D_803A5D00[getActiveFramebuffer()]);
func_80253640(gdl, gFramebuffers[getActiveFramebuffer()]);
}
// Draws a 160x128 image pointed to by D_80382450 into the center of the screen

View File

@@ -1,9 +1,9 @@
#include <ultra64.h>
#include "core1/core1.h"
#include "functions.h"
#include "variables.h"
extern s16 D_803A5D00[2][0xF660];
Gfx D_8036C630[] =
{
@@ -40,10 +40,10 @@ void func_80314BB0(Gfx **gfx, Mtx **mtx, Vtx **vtx, void * frame_buffer_1, void
s32 y;
gSPDisplayList((*gfx)++, D_8036C630);
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_PHYSICAL_TO_K0(frame_buffer_1));
for(y = 0; y < framebuffer_height / 32 + 1; y++){
for(x = 0; x < framebuffer_width / 32 + 1; x++){
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(frame_buffer_2), G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, framebuffer_height,
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, OS_PHYSICAL_TO_K0(frame_buffer_1));
for(y = 0; y < gFramebufferHeight / 32 + 1; y++){
for(x = 0; x < gFramebufferWidth / 32 + 1; x++){
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(frame_buffer_2), G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, gFramebufferHeight,
0x20*x, 0x20*y, 0x20*(x + 1) - 1, 0x20*(y + 1) - 1,
NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, 0, 0
);
@@ -53,13 +53,13 @@ void func_80314BB0(Gfx **gfx, Mtx **mtx, Vtx **vtx, void * frame_buffer_1, void
}
}
gSPDisplayList((*gfx)++, D_8036C690);
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, OS_PHYSICAL_TO_K0(D_803A5D00[getActiveFramebuffer()]));
gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gFramebufferWidth, OS_PHYSICAL_TO_K0(gFramebuffers[getActiveFramebuffer()]));
}
void func_80315084(Gfx **gfx, Mtx **mtx, Vtx **vtx){
func_80335128(0);
D_803830A0 = 2;
func_80314BB0(gfx, mtx, vtx, zBuffer_get(), D_803A5D00[getActiveFramebuffer()]);
func_80314BB0(gfx, mtx, vtx, zBuffer_get(), gFramebuffers[getActiveFramebuffer()]);
}
void func_80315110(Gfx **gfx, Mtx **mtx, Vtx **vtx){
@@ -72,7 +72,7 @@ void func_80315110(Gfx **gfx, Mtx **mtx, Vtx **vtx){
else{
D_803830A0--;
}
func_80314BB0(gfx, mtx, vtx, D_803A5D00[getActiveFramebuffer()], zBuffer_get());
func_80314BB0(gfx, mtx, vtx, gFramebuffers[getActiveFramebuffer()], zBuffer_get());
}
void func_803151D0(Gfx **gfx, Mtx **mtx, Vtx **vtx){

View File

@@ -143,7 +143,7 @@ void func_803223AC(void) {
func_8032236C(0x1C, 4, &sp28);
func_8032236C(0x1D, 5, &sp28);
sp28 = (sp28 == 0) ? 2 : sp28;
func_8024BF94(sp28);
viMgr_func_8024BF94(sp28);
}
void func_80322490(void) {

View File

@@ -31,7 +31,7 @@ void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) {
f32 sp40;
if (D_803835E0 == 0) {
drawRectangle2D(gdl, 0, 0, framebuffer_width, framebuffer_height, 0, 0, 0);
drawRectangle2D(gdl, 0, 0, gFramebufferWidth, gFramebufferHeight, 0, 0, 0);
func_802BBD2C(&sp44, &sp40);
viewport_setNearAndFar(sp44, sp40);
viewport_setRenderViewportAndPerspectiveMatrix(gdl, mptr);

View File

@@ -21,7 +21,7 @@ void func_8033DC18(void){}
f32 func_8033DC20(void){
f32 out;
D_80384470 = func_8024BD94();
D_80384470 = viMgr_func_8024BD94();
out = 0.016666666666666666*D_80384470;
return out;
}

View File

@@ -39,7 +39,7 @@ f32 time_getDelta(void){
}
f32 func_8033DDB8(void){
return func_8024BD94()*(1/60.0);
return viMgr_func_8024BD94()*(1/60.0);
}
f32 func_8033DDEC(void){

View File

@@ -136,14 +136,14 @@ void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
sp9C[2] = temp_s1->unk4[2];
ml_vec3f_yaw_rotate_copy(sp9C, sp9C, -spD0[1]);
ml_vec3f_pitch_rotate_copy(sp9C, sp9C, -spD0[0]);
if (!(((1.2 * (f32)framebuffer_width) / 2) < sp9C[0]) && !(sp9C[0] < ((-1.2 * (f32)framebuffer_width) / 2))) {
if (!(((1.2 * (f32)framebuffer_height) / 2) < sp9C[1]) && !(sp9C[1] < ((-1.2 * (f32)framebuffer_height) / 2))) {
if (!(((1.2 * (f32)gFramebufferWidth) / 2) < sp9C[0]) && !(sp9C[0] < ((-1.2 * (f32)gFramebufferWidth) / 2))) {
if (!(((1.2 * (f32)gFramebufferHeight) / 2) < sp9C[1]) && !(sp9C[1] < ((-1.2 * (f32)gFramebufferHeight) / 2))) {
sp90[0] = -sp9C[0];
sp90[1] = -sp9C[1];
sp90[2] = sp9C[2];
ml_vec3f_pitch_rotate_copy(sp90, sp90, spD0[0]);
ml_vec3f_yaw_rotate_copy(sp90, sp90, spD0[1]);
var_f22 = 1.0f - (((sp9C[0] * sp9C[0]) + (sp9C[1] * sp9C[1])) / ((f32)framebuffer_height * (f32)framebuffer_height));
var_f22 = 1.0f - (((sp9C[0] * sp9C[0]) + (sp9C[1] * sp9C[1])) / ((f32)gFramebufferHeight * (f32)gFramebufferHeight));
if (var_f22 < 0.0f) {
var_f22 = 0.0f;
}
@@ -181,7 +181,7 @@ void func_80350BFC(void) {
if (D_80386170.unk4 != NULL) {
D_80386170.unk0 = func_80350780(D_80386170.unk4->unk10);
D_80386170.unk8 = assetcache_get(0x882);
ml_vec3f_set_length(D_80386170.unk4->unk4, (2*(f32)framebuffer_width) / 2);
ml_vec3f_set_length(D_80386170.unk4->unk4, (2*(f32)gFramebufferWidth) / 2);
D_8038617C.unk0 = 1;
D_8038617C.unk1 = 0;
}

View File

@@ -86,8 +86,8 @@ void fxairscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0x78);
}
x = func_802FB0E4(arg1);
x = ((-40 + x) + D_80381F68[var_s6]) - ((f32) framebuffer_width / 2);
y = ((78 + (i_part * 15.5)) - ((f32) framebuffer_height / 2));
x = ((-40 + x) + D_80381F68[var_s6]) - ((f32) gFramebufferWidth / 2);
y = ((78 + (i_part * 15.5)) - ((f32) gFramebufferHeight / 2));
//stagger x position
x = (i_part & 1) ? x + 5.0f : x - 5.0f;

View File

@@ -8,9 +8,6 @@ f32 time_getDelta(void);
f32 func_802FB0DC(struct8s *);
f32 func_802FB0E4(struct8s *);
extern s32 framebuffer_width; //framebuffer_w
extern s32 framebuffer_height; //framebuffer_h
Gfx D_80369920[] = {
gsDPPipeSync(),
@@ -154,8 +151,8 @@ void func_802FD360(struct8s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
tmp_f26 = (arg0->unk20 == ITEM_0_HOURGLASS_TIMER && texture_width == 0x10) ? 1.0f : 0.0f;
for(tmp_s4 = 0; tmp_s4 < 2; tmp_s4++){//L802FD528
for(tmp_s2 = 0; tmp_s2 < 2; tmp_s2++){//
(*vtx)->v.ob[0] = ((func_802FB0DC(arg0) + (((texture_width*arg0->unk40*tmp_s2 - texture_width*arg0->unk40/2) - (f32)framebuffer_width/2) + arg0->unk38)) + tmp_f26) * 4.0f;
(*vtx)->v.ob[1] = ((((texture_height*arg0->unk40/2 - texture_height*arg0->unk40*tmp_s4) + (f32)framebuffer_height/2) - arg0->unk3C) - func_802FB0E4(arg0)*arg0->unk4C)*4.0f;
(*vtx)->v.ob[0] = ((func_802FB0DC(arg0) + (((texture_width*arg0->unk40*tmp_s2 - texture_width*arg0->unk40/2) - (f32)gFramebufferWidth/2) + arg0->unk38)) + tmp_f26) * 4.0f;
(*vtx)->v.ob[1] = ((((texture_height*arg0->unk40/2 - texture_height*arg0->unk40*tmp_s4) + (f32)gFramebufferHeight/2) - arg0->unk3C) - func_802FB0E4(arg0)*arg0->unk4C)*4.0f;
(*vtx)->v.ob[2] = -0x14;
(*vtx)->v.tc[0] = ((texture_width -1) * tmp_s2) << 6;
(*vtx)->v.tc[1] = ((texture_height -1) * tmp_s4) << 6;

View File

@@ -7,7 +7,6 @@
extern f32 vtxList_getGlobalNorm(BKVertexList *);
extern void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer);
extern s16 D_803A5D00[2][0xF660];
extern f32 func_802FB0E4(struct8s*);
typedef struct {
@@ -210,7 +209,7 @@ void fxcommon3score_draw(enum item_e item_id, void *arg1, Gfx **gfx, Mtx **mtx,
if(a1->unk6C == 0.0f){
a1->unk6C = 1.1*(vtxList_getGlobalNorm(model_getVtxList(a1->model)) * a1->unk3C);
}
func_80253208(gfx, a1->unk30 - a1->unk6C, sp40 - a1->unk6C, 2*a1->unk6C, 2*a1->unk6C, D_803A5D00[getActiveFramebuffer()]);
func_80253208(gfx, a1->unk30 - a1->unk6C, sp40 - a1->unk6C, 2*a1->unk6C, 2*a1->unk6C, gFramebuffers[getActiveFramebuffer()]);
if(a1->anim_ctrl != NULL){
animctrl_drawSetup(a1->anim_ctrl, sp5C, 1);
}

View File

@@ -6,9 +6,6 @@
extern f32 func_802FB0E4(struct8s*);
extern s32 framebuffer_width;
extern s32 framebuffer_height;
/* .data */
BKSprite * gSpriteHealth = NULL;
BKSprite * gSpriteRedHealth = NULL;
@@ -112,8 +109,8 @@ void fxhealthscore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mt
gDPSetPrimColor((*gfx)++, 0, 0, 0xFF, 0xFF, 0xFF, 0x78);
}
f20 = 96.0f - (f32) framebuffer_width / 2 + (i * 13);
f14 = (f32) framebuffer_height / 2 - func_802FB0E4(arg1) - D_80381F08[s6] - -48.0f;
f20 = 96.0f - (f32) gFramebufferWidth / 2 + (i * 13);
f14 = (f32) gFramebufferHeight / 2 - func_802FB0E4(arg1) - D_80381F08[s6] - -48.0f;
f14 = (i & 1) ? f14 + 5.75 : f14 - 5.75;
gSPVertex((*gfx)++, *vtx, 4, 0);

View File

@@ -141,8 +141,8 @@ void fxhoneycarrierscore_draw(s32 arg0, struct8s *arg1, Gfx **arg2, Mtx **arg3,
}
}
}
sp128 = (244.0f - ((f32) framebuffer_width / 2));
sp124 = func_802FB0E4(arg1) + ((f32) framebuffer_height / 2) - 246.0f;
sp128 = (244.0f - ((f32) gFramebufferWidth / 2));
sp124 = func_802FB0E4(arg1) + ((f32) gFramebufferHeight / 2) - 246.0f;
guTranslate(*arg3, sp128 * 4.0f, sp124 * 4.0f, 0.0f);
gSPMatrix((*arg2)++, OS_K0_TO_PHYSICAL((*arg3)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
guRotate(*arg3, func_802FDE60(D_803815D8 + D_803815DC), 0.0f, 0.0f, 1.0f);

View File

@@ -176,8 +176,8 @@ void fxjinjoscore_draw(s32 arg0, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx
// If the jinjo is collected then it's drawn fully opaque, otherwise it's drawn with partial alpha
gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, jinjo_collected ? 0xFF : 0x6E);
}
center_x = pos_x - (f32) framebuffer_width / 2 + x_offset;
center_y = (f32) framebuffer_height / 2 + func_802FB0E4(arg1) - 266.0f + 40.0f + y_offset - D_80381E78[jinjo_id];
center_x = pos_x - (f32) gFramebufferWidth / 2 + x_offset;
center_y = (f32) gFramebufferHeight / 2 + func_802FB0E4(arg1) - 266.0f + 40.0f + y_offset - D_80381E78[jinjo_id];
gSPVertex((*gfx)++, *vtx, 4, 0);
// Set up the positions of the four vertices
for(i = 0; i < 2; i++){

View File

@@ -102,8 +102,8 @@ void fxlifescore_draw(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx,
sp104 = sp104 + 4;
}
var_s5 = (40.0f - ((f32) framebuffer_width / 2)) + spE0;
var_s4 = (((((f32) framebuffer_height / 2) - func_802FB0E4(arg1)) - -16.0f) - spDC);
var_s5 = (40.0f - ((f32) gFramebufferWidth / 2)) + spE0;
var_s4 = (((((f32) gFramebufferHeight / 2) - func_802FB0E4(arg1)) - -16.0f) - spDC);
for(var_v1 = 0; var_v1 < 2; var_v1++){
for(var_v0 = 0; var_v0 < 2; var_v0++){
(*vtx)->v.ob[0] = (s16) (s32) (((((f32) spF0 * D_80381EB8 * (f32) var_v0) - (((f32) spE8 * D_80381EB8) / 2)) + var_s5) * 4.0f);

View File

@@ -26,7 +26,7 @@ u8 _gcbound_blue; //D_80380902
void _gcbound_draw(Gfx** dl, s32 a, s32 r, s32 g, s32 b){
gSPDisplayList((*dl)++, &D_803688E8);
gDPSetFogColor((*dl)++, r, g, b, a);
gSPTextureRectangle((*dl)++, 0, 0, (framebuffer_width-1)<<2, (framebuffer_height-1)<<2, 0, 0, 0, 0x100, 0x100);
gSPTextureRectangle((*dl)++, 0, 0, (gFramebufferWidth-1)<<2, (gFramebufferHeight-1)<<2, 0, 0, 0, 0x100, 0x100);
}
void gcbound_draw(Gfx** dl){

View File

@@ -1373,7 +1373,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
}
gcpausemenu_drawSprite(gfx, mtx, vtx, D_80383010.joystick_sprite, D_80383010.joystick_frame, 30.0f, 196.0f, 1, (s32) D_80383010.left_joystick_alpha);
gcpausemenu_drawSprite(gfx, mtx, vtx, D_80383010.joystick_sprite, D_80383010.joystick_frame, (f32)(framebuffer_width - 0x1E), 196.0f, 0, (s32) D_80383010.right_joystick_alpha);
gcpausemenu_drawSprite(gfx, mtx, vtx, D_80383010.joystick_sprite, D_80383010.joystick_frame, (f32)(gFramebufferWidth - 0x1E), 196.0f, 0, (s32) D_80383010.right_joystick_alpha);
var_a0 = ((*((u32 * ) & D_80383010.state) << 0x1c) >> 0x1f); //left_joystick_visible
if (var_a0 != 0) {
if (D_80383010.left_joystick_alpha < 0xFF) {
@@ -1396,7 +1396,7 @@ void gcpausemenu_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
D_80383010.right_joystick_alpha = (D_80383010.right_joystick_alpha - 0xC > 0) ? D_80383010.right_joystick_alpha - 0xC : 0;
}
}
gcpausemenu_drawSprite(gfx, mtx, vtx, D_80383010.b_button_sprite, (s32) D_80383010.b_button_frame, framebuffer_width * 0.5, 196.0f, 0, (s32) D_80383010.b_button_alpha);
gcpausemenu_drawSprite(gfx, mtx, vtx, D_80383010.b_button_sprite, (s32) D_80383010.b_button_frame, gFramebufferWidth * 0.5, 196.0f, 0, (s32) D_80383010.b_button_alpha);
var_a0 = ((*((u32 * ) & D_80383010.state) << 0x1e) >> 0x1f);//b_button_visible
if (var_a0 != 0) {
if (D_80383010.b_button_alpha < 0xFF) {

View File

@@ -75,7 +75,7 @@ void sky_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
viewport_setNearAndFar(5.0f, 15000.0f);
if(gcSky.model_bins[0]){
drawRectangle2D(gfx, 0, 0, (s32)(f32) framebuffer_width, (s32)(f32)framebuffer_height,0, 0, 0); //fill screen with black
drawRectangle2D(gfx, 0, 0, (s32)(f32) gFramebufferWidth, (s32)(f32)gFramebufferHeight,0, 0, 0); //fill screen with black
viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx);
viewport_getPosition_vec3f(position);
for(i = 0; i < 3; i++){
@@ -89,7 +89,7 @@ void sky_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
}
}
else{//L8030B200
drawRectangle2D(gfx, 0, 0, (s32)(f32) framebuffer_width, (s32)(f32)framebuffer_height, 0, 0, 0);
drawRectangle2D(gfx, 0, 0, (s32)(f32) gFramebufferWidth, (s32)(f32)gFramebufferHeight, 0, 0, 0);
}//L8030B254
}

View File

@@ -861,7 +861,7 @@ void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, BK
}
sp2C[1] = this->unk172 + ((f32) arg4 * this->unk198);
sp2C[2] = -10.0f;
func_80252330((sp2C[0] * 4.0f) - ((f32)framebuffer_width * 2), ((f32)framebuffer_height * 2) - (sp2C[1] * 4.0f), sp2C[2]);
func_80252330((sp2C[0] * 4.0f) - ((f32)gFramebufferWidth * 2), ((f32)gFramebufferHeight * 2) - (sp2C[1] * 4.0f), sp2C[2]);
temp_f12 = (f32) ((f64) this->unk198 * 0.8);
mlMtxScale_xyz(temp_f12, temp_f12, 1.0f);
mlMtxApply(*mtx);
@@ -1402,8 +1402,8 @@ GcZoombox *gczoombox_new(s32 y, GcZoomboxSprite portrait_id, s32 arg2, s32 arg3,
this->unk1A4_24 = arg3;
if(this->unk1A4_24){
this->unk16A = 45;
this->unk174 = framebuffer_width - 0x25;
this->unk170 = framebuffer_width + 0x66;
this->unk174 = gFramebufferWidth - 0x25;
this->unk170 = gFramebufferWidth + 0x66;
}else{
this->unk16A = 71;
this->unk174 = 0x25;
@@ -1604,9 +1604,9 @@ void func_80318640(GcZoombox *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) {
if (this != NULL) {
if (this->unk1A4_24) {
this->unk174 = framebuffer_width - arg1;
this->unk174 = gFramebufferWidth - arg1;
this->unk16A = arg1 + (8.0f * arg2);
this->unk170 = (framebuffer_width - arg1) + 0x8B;
this->unk170 = (gFramebufferWidth - arg1) + 0x8B;
} else {
this->unk174 = arg1;
phi_v0 = arg4 ? 0x28 : 0x22;