Fix jumbotron

This commit is contained in:
MegaMech
2024-11-15 23:27:18 -07:00
parent 75344d87eb
commit 815c11ac4b
3 changed files with 25 additions and 288 deletions
+16 -50
View File
@@ -33,6 +33,7 @@ extern "C" {
#include "memory.h"
#include "courses/staff_ghost_data.h"
#include "framebuffer_effects.h"
#include "skybox_and_splitscreen.h"
extern const char *luigi_raceway_dls[];
extern s16 currentScreenSection;
}
@@ -241,6 +242,16 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
// Invalidate Jumbotron textures so they update each frame
// This could be more efficient if we exposed the non-opcode based invalidation to be called
// inside copy_framebuffers_port
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0xF800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x10800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x11800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x12800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x13800);
gSPInvalidateTexCache(gDisplayListHead++, gSegmentTable[5] + 0x14800);
if (func_80290C20(arg0->camera) == 1) {
gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE);
gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
@@ -278,58 +289,13 @@ void LuigiRaceway::Render(struct UnkStruct_800DC5EC* arg0) {
currentScreenSection = 0;
}
uintptr_t fb = (uintptr_t) gSegmentTable[5] + 0xF800;
FB_WriteFramebufferSliceToCPU(gDisplayListHead, (void*)fb, true);
// FB_DrawFromFramebuffer(gDisplayListHead, 0, fb, true);
// FB_CopyToFramebuffer(gDisplayListHead, 0, fb, false, NULL);
/**
* The jumbo television screen is split into six sections each section is copied one at a time.
* This is done to fit within the n64's texture size requirements; 64x32
* The jumbo television screen used to be split into six sections to fit into the n64's texture size restrictions
* It isn't split into six sections anymore
*/
switch (currentScreenSection) {
case 0:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800));
#endif
break;
case 1:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x10800));
#endif
break;
case 2:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x11800));
#endif
break;
case 3:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x12800));
#endif
break;
case 4:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x13800));
#endif
break;
case 5:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x14800));
#endif
break;
}
copy_jumbotron_fb_port(D_800DC5DC, D_800DC5E0, currentScreenSection,
(u16*) PHYSICAL_TO_VIRTUAL(gPortFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xF800));
}
}
+9 -44
View File
@@ -32,6 +32,7 @@ extern "C" {
#include "collision.h"
#include "code_8003DC40.h"
#include "memory.h"
#include "skybox_and_splitscreen.h"
extern const char *wario_stadium_dls[];
extern s16 currentScreenSection;
}
@@ -248,50 +249,14 @@ void WarioStadium::Render(struct UnkStruct_800DC5EC* arg0) {
if (currentScreenSection > 5) {
currentScreenSection = 0;
}
switch (currentScreenSection) {
case 0:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x8800));
#endif
break;
case 1:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x9800));
#endif
break;
case 2:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xA800));
#endif
break;
case 3:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 32, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xB800));
#endif
break;
case 4:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xC800));
#endif
break;
case 5:
#ifdef TARGET_N64
copy_framebuffer(D_800DC5DC + 64, D_800DC5E0 + 64, 64, 32,
(u16*) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0xD800));
#endif
break;
}
/**
* The jumbo television screen used to be split into six sections to fit into the n64's texture size restrictions
* It isn't split into six sections anymore
*/
copy_jumbotron_fb_port(D_800DC5DC, D_800DC5E0, currentScreenSection,
(u16*) PHYSICAL_TO_VIRTUAL(gPortFramebuffers[prevFrame]),
(u16*) PHYSICAL_TO_VIRTUAL(gSegmentTable[5] + 0x8800));
}
}