From 53efc22a23efd7bc76733efa00a35d67b798ae29 Mon Sep 17 00:00:00 2001 From: Lywx Date: Mon, 27 May 2024 16:33:02 -0600 Subject: [PATCH] Framebuffer clear and bump LUS (#4187) --- CMakeLists.txt | 6 ++++++ OTRExporter | 2 +- ZAPDTR | 2 +- libultraship | 2 +- soh/CMakeLists.txt | 4 ++++ soh/include/functions.h | 2 -- soh/soh/GbiWrap.cpp | 9 --------- soh/src/code/z_rcp.c | 8 ++++---- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 891d6ad26..490489f55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,12 @@ include(CMake/GlobalSettingsInclude.cmake OPTIONAL) ################################################################################ set_property(GLOBAL PROPERTY USE_FOLDERS ON) +################################################################################ +# Set GBI version +################################################################################ + +add_compile_definitions(F3DEX_GBI_2) + ################################################################################ # Sub-projects ################################################################################ diff --git a/OTRExporter b/OTRExporter index 3cea9ee7c..d70db9806 160000 --- a/OTRExporter +++ b/OTRExporter @@ -1 +1 @@ -Subproject commit 3cea9ee7c017d842aa4d9ceeb8d3ffbf29c6effb +Subproject commit d70db9806c02c229ca3ed928ad0bdae128fe4ac7 diff --git a/ZAPDTR b/ZAPDTR index f38a9c92e..04d42249d 160000 --- a/ZAPDTR +++ b/ZAPDTR @@ -1 +1 @@ -Subproject commit f38a9c92eb99368c0607acf356d5651ebdc96f51 +Subproject commit 04d42249d2c15c3b442a0282a90bc8b7bda25b03 diff --git a/libultraship b/libultraship index 0da318c0f..9def18e62 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 0da318c0f4e431313565cad546fc469b8e850388 +Subproject commit 9def18e62467b4225d26e206e0039a31ed406573 diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 3f086bcac..6984291d3 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -407,6 +407,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") ">" "$<$:ENABLE_REMOTE_CONTROL>" "INCLUDE_GAME_PRINTF;" + "F3DEX_GBI_2" "UNICODE;" "_UNICODE" STORMLIB_NO_AUTO_LINK @@ -425,6 +426,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "NDEBUG;" ">" "INCLUDE_GAME_PRINTF;" + "F3DEX_GBI_2" "WIN32;" "UNICODE;" "_UNICODE" @@ -440,6 +442,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS") "$<$:" "NDEBUG" ">" + "F3DEX_GBI_2" "SPDLOG_ACTIVE_LEVEL=3;" "SPDLOG_NO_THREAD_ID;" "SPDLOG_NO_TLS;" @@ -453,6 +456,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang") "$<$:" "NDEBUG" ">" + "F3DEX_GBI_2" "$<$:ENABLE_REMOTE_CONTROL>" "SPDLOG_ACTIVE_LEVEL=0;" "_CONSOLE;" diff --git a/soh/include/functions.h b/soh/include/functions.h index b9e1f6981..fc7fc15b7 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -22,12 +22,10 @@ extern "C" void gSPSegment(void* value, int segNum, uintptr_t target); void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target); -void gDPSetTextureImage(Gfx* pkt, u32 f, u32 s, u32 w, uintptr_t i); void gSPDisplayList(Gfx* pkt, Gfx* dl); void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset); void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0); void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr); -void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb); void cleararena(void); diff --git a/soh/soh/GbiWrap.cpp b/soh/soh/GbiWrap.cpp index 2399051f5..2dad29e60 100644 --- a/soh/soh/GbiWrap.cpp +++ b/soh/soh/GbiWrap.cpp @@ -66,15 +66,6 @@ extern "C" void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target) { __gSPSegment(value, segNum, target); } -extern "C" void gDPSetTextureImage(Gfx* pkt, u32 format, u32 size, u32 width, uintptr_t i) { - __gDPSetTextureImage(pkt, format, size, width, i); -} - -extern "C" void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb) -{ - __gDPSetTextureImageFB(pkt, format, size, width, fb); -} - extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) { char* imgData = (char*)dl; diff --git a/soh/src/code/z_rcp.c b/soh/src/code/z_rcp.c index adfa946e7..978c04d3c 100644 --- a/soh/src/code/z_rcp.c +++ b/soh/src/code/z_rcp.c @@ -1539,7 +1539,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) { gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2); gDPSetFillColor(POLY_OPA_DISP++, (GPACK_ZDZ(G_MAXFBZ, 0) << 16) | GPACK_ZDZ(G_MAXFBZ, 0)); - gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1); + gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1); gDPPipeSync(POLY_OPA_DISP++); // Fill the whole screen with the base color @@ -1548,7 +1548,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) { gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2); gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1)); - gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1); + gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1); gDPPipeSync(POLY_OPA_DISP++); // Draw the letterbox if applicable (uses the same color as the screen base) @@ -1557,8 +1557,8 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) { gDPSetCycleType(OVERLAY_DISP++, G_CYC_FILL); gDPSetRenderMode(OVERLAY_DISP++, G_RM_NOOP, G_RM_NOOP2); gDPSetFillColor(OVERLAY_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1)); - gDPFillRectangle(OVERLAY_DISP++, 0, 0, gScreenWidth - 1, letterboxSize - 1); - gDPFillRectangle(OVERLAY_DISP++, 0, gScreenHeight - letterboxSize, gScreenWidth - 1, gScreenHeight - 1); + gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), letterboxSize - 1); + gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), gScreenHeight - letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - 1); gDPPipeSync(OVERLAY_DISP++); } }