Skip to content

Commit 53efc22

Browse files
authored
Framebuffer clear and bump LUS (HarbourMasters#4187)
1 parent ad0e173 commit 53efc22

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
8484
################################################################################
8585
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
8686

87+
################################################################################
88+
# Set GBI version
89+
################################################################################
90+
91+
add_compile_definitions(F3DEX_GBI_2)
92+
8793
################################################################################
8894
# Sub-projects
8995
################################################################################

OTRExporter

soh/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
407407
">"
408408
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
409409
"INCLUDE_GAME_PRINTF;"
410+
"F3DEX_GBI_2"
410411
"UNICODE;"
411412
"_UNICODE"
412413
STORMLIB_NO_AUTO_LINK
@@ -425,6 +426,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
425426
"NDEBUG;"
426427
">"
427428
"INCLUDE_GAME_PRINTF;"
429+
"F3DEX_GBI_2"
428430
"WIN32;"
429431
"UNICODE;"
430432
"_UNICODE"
@@ -440,6 +442,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
440442
"$<$<CONFIG:Release>:"
441443
"NDEBUG"
442444
">"
445+
"F3DEX_GBI_2"
443446
"SPDLOG_ACTIVE_LEVEL=3;"
444447
"SPDLOG_NO_THREAD_ID;"
445448
"SPDLOG_NO_TLS;"
@@ -453,6 +456,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
453456
"$<$<CONFIG:Release>:"
454457
"NDEBUG"
455458
">"
459+
"F3DEX_GBI_2"
456460
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
457461
"SPDLOG_ACTIVE_LEVEL=0;"
458462
"_CONSOLE;"

soh/include/functions.h

-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ extern "C"
2222

2323
void gSPSegment(void* value, int segNum, uintptr_t target);
2424
void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target);
25-
void gDPSetTextureImage(Gfx* pkt, u32 f, u32 s, u32 w, uintptr_t i);
2625
void gSPDisplayList(Gfx* pkt, Gfx* dl);
2726
void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset);
2827
void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0);
2928
void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr);
30-
void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb);
3129

3230

3331
void cleararena(void);

soh/soh/GbiWrap.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ extern "C" void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target) {
6666
__gSPSegment(value, segNum, target);
6767
}
6868

69-
extern "C" void gDPSetTextureImage(Gfx* pkt, u32 format, u32 size, u32 width, uintptr_t i) {
70-
__gDPSetTextureImage(pkt, format, size, width, i);
71-
}
72-
73-
extern "C" void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb)
74-
{
75-
__gDPSetTextureImageFB(pkt, format, size, width, fb);
76-
}
77-
7869
extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) {
7970
char* imgData = (char*)dl;
8071

soh/src/code/z_rcp.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
15391539
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
15401540
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
15411541
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_ZDZ(G_MAXFBZ, 0) << 16) | GPACK_ZDZ(G_MAXFBZ, 0));
1542-
gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1);
1542+
gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1);
15431543
gDPPipeSync(POLY_OPA_DISP++);
15441544

15451545
// Fill the whole screen with the base color
@@ -1548,7 +1548,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
15481548
gDPSetCycleType(POLY_OPA_DISP++, G_CYC_FILL);
15491549
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
15501550
gDPSetFillColor(POLY_OPA_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1));
1551-
gDPFillRectangle(POLY_OPA_DISP++, 0, letterboxSize, gScreenWidth - 1, gScreenHeight - letterboxSize - 1);
1551+
gDPFillWideRectangle(POLY_OPA_DISP++, OTRGetRectDimensionFromLeftEdge(0), letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - letterboxSize - 1);
15521552
gDPPipeSync(POLY_OPA_DISP++);
15531553

15541554
// 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) {
15571557
gDPSetCycleType(OVERLAY_DISP++, G_CYC_FILL);
15581558
gDPSetRenderMode(OVERLAY_DISP++, G_RM_NOOP, G_RM_NOOP2);
15591559
gDPSetFillColor(OVERLAY_DISP++, (GPACK_RGBA5551(r, g, b, 1) << 16) | GPACK_RGBA5551(r, g, b, 1));
1560-
gDPFillRectangle(OVERLAY_DISP++, 0, 0, gScreenWidth - 1, letterboxSize - 1);
1561-
gDPFillRectangle(OVERLAY_DISP++, 0, gScreenHeight - letterboxSize, gScreenWidth - 1, gScreenHeight - 1);
1560+
gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), letterboxSize - 1);
1561+
gDPFillWideRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromLeftEdge(0), gScreenHeight - letterboxSize, OTRGetRectDimensionFromRightEdge(gScreenWidth - 1), gScreenHeight - 1);
15621562
gDPPipeSync(OVERLAY_DISP++);
15631563
}
15641564
}

0 commit comments

Comments
 (0)