Skip to content

Commit

Permalink
Framebuffer clear and bump LUS (HarbourMasters#4187)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed May 27, 2024
1 parent ad0e173 commit 53efc22
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter
2 changes: 1 addition & 1 deletion ZAPDTR
2 changes: 1 addition & 1 deletion libultraship
Submodule libultraship updated 34 files
+2 −0 cmake/cvars.cmake
+1 −1 cmake/dependencies/common.cmake
+13 −9 include/libultraship/libultra/gbi.h
+1 −1 include/libultraship/libultra/gs2dex.h
+33 −0 src/config/Config.cpp
+2 −0 src/config/Config.h
+61 −2 src/config/ConsoleVariable.cpp
+2 −0 src/config/ConsoleVariable.h
+6 −2 src/controller/controldevice/controller/mapping/sdl/SDLMapping.cpp
+1 −1 src/controller/controldevice/controller/mapping/sdl/SDLMapping.h
+37 −7 src/controller/deviceindex/ShipDeviceIndexMappingManager.cpp
+4 −0 src/graphic/Fast3D/Fast3dWindow.cpp
+2 −0 src/graphic/Fast3D/Fast3dWindow.h
+18 −17 src/graphic/Fast3D/f3dex.h
+8 −3 src/graphic/Fast3D/gfx_direct3d11.cpp
+2 −1 src/graphic/Fast3D/gfx_direct3d_common.cpp
+2 −2 src/graphic/Fast3D/gfx_dxgi.cpp
+3 −8 src/graphic/Fast3D/gfx_metal.cpp
+2 −1 src/graphic/Fast3D/gfx_metal_shader.cpp
+2 −3 src/graphic/Fast3D/gfx_opengl.cpp
+30 −10 src/graphic/Fast3D/gfx_pc.cpp
+3 −0 src/graphic/Fast3D/gfx_pc.h
+2 −4 src/graphic/Fast3D/gfx_sdl2.cpp
+1 −0 src/graphic/Fast3D/lus_gbi.h
+8 −0 src/public/bridge/consolevariablebridge.cpp
+3 −0 src/public/bridge/consolevariablebridge.h
+4 −4 src/public/bridge/gfxbridge.h
+1 −1 src/public/bridge/resourcebridge.cpp
+15 −8 src/resource/ResourceLoader.cpp
+1 −0 src/resource/ResourceLoader.h
+4 −2 src/resource/factory/DisplayListFactory.cpp
+0 −2 src/window/gui/GfxDebuggerWindow.cpp
+10 −0 src/window/gui/Gui.cpp
+2 −1 src/window/gui/Gui.h
4 changes: 4 additions & 0 deletions soh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
">"
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
"INCLUDE_GAME_PRINTF;"
"F3DEX_GBI_2"
"UNICODE;"
"_UNICODE"
STORMLIB_NO_AUTO_LINK
Expand All @@ -425,6 +426,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
"NDEBUG;"
">"
"INCLUDE_GAME_PRINTF;"
"F3DEX_GBI_2"
"WIN32;"
"UNICODE;"
"_UNICODE"
Expand All @@ -440,6 +442,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"F3DEX_GBI_2"
"SPDLOG_ACTIVE_LEVEL=3;"
"SPDLOG_NO_THREAD_ID;"
"SPDLOG_NO_TLS;"
Expand All @@ -453,6 +456,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"F3DEX_GBI_2"
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
"SPDLOG_ACTIVE_LEVEL=0;"
"_CONSOLE;"
Expand Down
2 changes: 0 additions & 2 deletions soh/include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions soh/soh/GbiWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions soh/src/code/z_rcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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++);
}
}
Expand Down

0 comments on commit 53efc22

Please sign in to comment.