fb test patches

This commit is contained in:
Sonic Dreamcaster
2025-10-23 18:07:23 -03:00
parent 3fef7e6d2c
commit 3dccdc2401
3 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ LD ?= ld.lld
CFLAGS := -target mips -mips2 -mabi=32 -O2 -G0 -mno-abicalls -mno-odd-spreg -mno-check-zero-division \
-fomit-frame-pointer -ffast-math -fno-unsafe-math-optimizations -fno-builtin-memset \
-Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-but-set-variable -Wno-missing-braces -Wno-unsupported-floating-point-opt -Wno-switch
CPPFLAGS := -nostdinc -DTARGET_N64 -DF3DEX_GBI_2 -D_LANGUAGE_C -DMIPS -I ../lib/DukeNukemZeroHour/include -I ../lib/DukeNukemZeroHour/libs/libultra/include/2.0I -I ../lib/rt64/include -I ../lib/N64ModernRuntime/N64Recomp/include
CPPFLAGS := -nostdinc -DTARGET_N64 -DF3DEX_GBI_2 -D_LANGUAGE_C -D_FINALROM -D_MIPS_SZLONG=32 -DMIPS -I ../lib/DukeNukemZeroHour/include -I ../lib/DukeNukemZeroHour/libs/libultra/include/2.0I -I ../lib/rt64/include -I ../lib/N64ModernRuntime/N64Recomp/include
LDFLAGS := -nostdlib -T patches.ld -T syms.ld -Map patches.map --unresolved-symbols=ignore-all --emit-relocs
C_SRCS := $(wildcard *.c)
+3 -1
View File
@@ -31,7 +31,9 @@
#include "PR/ultratypes.h"
#include "rt64_extended_gbi.h"
// #include "PR/gbi.h"
#include "PR/gbi.h"
#include "PR/os.h"
#include "PR/mbi.h"
// #include "PR/os_thread.h"
// #include "PR/os_message.h"
// #include "common_structs.h"
+42
View File
@@ -0,0 +1,42 @@
#include "patches.h"
extern Gfx *gpDisplayList;
extern s32 gScreenWidth;
extern s32 gScreenHeight;
extern s32 _framebufferIndex_000BE020;
extern u8 *gDepthBuffer;
extern u8 *_framebuffer[3];
extern s32 D_800BD3E8;
extern u8 _red_000BDFEC;
extern u8 _green_000BDFED;
extern u8 _blue_000BDFEE;
#if 0
RECOMP_PATCH void main_80000C74(void)
{
recomp_printf("FramebufferIndex: %d\n", _framebufferIndex_000BE020);
gDPPipeSync(gpDisplayList++);
gDPSetCycleType(gpDisplayList++, G_CYC_FILL);
gDPSetRenderMode(gpDisplayList++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
gDPSetColorImage(gpDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, OS_K0_TO_PHYSICAL(gDepthBuffer));
gDPSetFillColor(gpDisplayList++, GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0));
gDPFillRectangle(gpDisplayList++, 12, 12, gScreenWidth - 12, gScreenHeight - 12);
gDPPipeSync(gpDisplayList++);
gDPSetColorImage(gpDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, OS_K0_TO_PHYSICAL(_framebuffer[_framebufferIndex_000BE020]));
gDPSetCycleType(gpDisplayList++, G_CYC_2CYCLE);
}
#endif
#if 0
RECOMP_PATCH void func_80000DDC(void)
{
recomp_printf("FramebufferIndex: %d\n", _framebufferIndex_000BE020);
gDPSetColorImage(gpDisplayList++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, OS_K0_TO_PHYSICAL(_framebuffer[_framebufferIndex_000BE020]));
if (D_800BD3E8 != 0)
{
gDPSetCycleType(gpDisplayList++, G_CYC_FILL);
gDPSetFillColor(gpDisplayList++, GPACK_RGBA5551(_red_000BDFEC, _green_000BDFED, _blue_000BDFEE, 1) << 16 | GPACK_RGBA5551(_red_000BDFEC, _green_000BDFED, _blue_000BDFEE, 1));
gDPFillRectangle(gpDisplayList++, 0, 0, gScreenWidth - 1, gScreenHeight - 1);
}
}
#endif