diff options
| author | MegaMech <inkstudios1@hotmail.com> | 2024-11-15 23:27:18 -0700 |
|---|---|---|
| committer | MegaMech <inkstudios1@hotmail.com> | 2024-11-15 23:27:18 -0700 |
| commit | 815c11ac4beca80b96c82f9bb1b4e0ff78bbd9a6 (patch) | |
| tree | d61866337bb7dc16495f3c15102086274e72ec04 /src/engine | |
| parent | 75344d87eb0eed56bd366be65934681a5c1ecf15 (diff) | |
Fix jumbotron
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/courses/LuigiRaceway.cpp | 66 | ||||
| -rw-r--r-- | src/engine/courses/WarioStadium.cpp | 53 |
2 files changed, 25 insertions, 94 deletions
diff --git a/src/engine/courses/LuigiRaceway.cpp b/src/engine/courses/LuigiRaceway.cpp index f9a9de13a..725aaad4f 100644 --- a/src/engine/courses/LuigiRaceway.cpp +++ b/src/engine/courses/LuigiRaceway.cpp @@ -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)); } } diff --git a/src/engine/courses/WarioStadium.cpp b/src/engine/courses/WarioStadium.cpp index 39447b590..24296a8d7 100644 --- a/src/engine/courses/WarioStadium.cpp +++ b/src/engine/courses/WarioStadium.cpp @@ -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)); } } |
