From 4ea65071f3a64385ca73d8c3faf21c421c16c1db Mon Sep 17 00:00:00 2001 From: CrashOveride95 Date: Sun, 22 Aug 2021 11:59:13 -0400 Subject: [PATCH 1/2] Add L3DEX2 mode Mostly as a "curiosity" mode, not intended to be used for serious mods (unless you implement ucode loading but that's not being done here) --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 95a79106..9c5c5deb 100644 --- a/Makefile +++ b/Makefile @@ -116,9 +116,10 @@ TARGET := sm64.$(VERSION) # f3d_new - default for EU and Shindou versions # f3dex - # f3dex2 - +# l3dex2 - F3DEX2 version that only renders in wireframe # f3dzex - newer, experimental microcode used in Animal Crossing # super3d - extremely experimental version of Fast3D lacking many features for speed -$(eval $(call validate-option,GRUCODE,f3d_old f3dex f3dex2 f3dex2pl f3d_new f3dzex super3d)) +$(eval $(call validate-option,GRUCODE,f3d_old f3dex f3dex2 f3dex2pl f3d_new f3dzex super3d l3dex2)) ifeq ($(GRUCODE),f3d_old) DEFINES += F3D_OLD=1 @@ -128,6 +129,8 @@ else ifeq ($(GRUCODE),f3dex) # Fast3DEX DEFINES += F3DEX_GBI=1 F3DEX_GBI_SHARED=1 else ifeq ($(GRUCODE),f3dex2) # Fast3DEX2 DEFINES += F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1 +else ifeq ($(GRUCODE),l3dex2) # Line3DEX2 + DEFINES += L3DEX2_GBI=1 L3DEX2_ALONE=1 F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1 else ifeq ($(GRUCODE),f3dex2pl) # Fast3DEX2_PosLight DEFINES += F3DEX2PL_GBI=1 F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1 else ifeq ($(GRUCODE),f3dzex) # Fast3DZEX (2.08J / Animal Forest - Dōbutsu no Mori) From 587137a5fecdf130e7a1c390f5908a5f51a3c534 Mon Sep 17 00:00:00 2001 From: CrashOveride95 Date: Sun, 22 Aug 2021 11:59:26 -0400 Subject: [PATCH 2/2] whoops didn't commit everything --- src/game/area.c | 2 ++ src/game/game_init.c | 5 ++++- src/game/level_geo.c | 2 ++ src/game/screen_transition.c | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/area.c b/src/game/area.c index 0113030d..d2f8f6a0 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -298,6 +298,7 @@ void area_update_objects(void) { * transition type, time in frames, and the RGB color that will fill the screen. */ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue) { +#ifndef L3DEX2_ALONE gWarpTransition.isActive = TRUE; gWarpTransition.type = transType; gWarpTransition.time = time; @@ -348,6 +349,7 @@ void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue) { gWarpTransition.data.endTexRadius = GFX_DIMENSIONS_FULL_RADIUS; } } +#endif } /* diff --git a/src/game/game_init.c b/src/game/game_init.c index f693158d..4337d051 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -269,7 +269,10 @@ void create_gfx_task_structure(void) { gGfxSPTask->task.t.ucode_boot = rspbootTextStart; gGfxSPTask->task.t.ucode_boot_size = ((u8 *) rspbootTextEnd - (u8 *) rspbootTextStart); gGfxSPTask->task.t.flags = 0; -#ifdef F3DZEX_GBI_2 +#ifdef L3DEX2_ALONE + gGfxSPTask->task.t.ucode = gspL3DEX2_fifoTextStart; + gGfxSPTask->task.t.ucode_data = gspL3DEX2_fifoDataStart; +#elif F3DZEX_GBI_2 gGfxSPTask->task.t.ucode = gspF3DZEX2_PosLight_fifoTextStart; gGfxSPTask->task.t.ucode_data = gspF3DZEX2_PosLight_fifoDataStart; #elif F3DEX2PL_GBI diff --git a/src/game/level_geo.c b/src/game/level_geo.c index 1fc4b88e..86be4b87 100644 --- a/src/game/level_geo.c +++ b/src/game/level_geo.c @@ -70,9 +70,11 @@ Gfx *geo_skybox_main(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) struct GraphNodePerspective *camFrustum = (struct GraphNodePerspective *) camNode->fnNode.node.parent; +#ifndef L3DEX2_ALONE gfx = create_skybox_facing_camera(0, backgroundNode->background, camFrustum->fov, gLakituState.pos[0], gLakituState.pos[1], gLakituState.pos[2], gLakituState.focus[0], gLakituState.focus[1], gLakituState.focus[2]); +#endif } return gfx; diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index b9fa99b5..89b0d8b6 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -298,7 +298,9 @@ Gfx *geo_cannon_circle_base(s32 callContext, struct GraphNode *node, UNUSED Mat4 if (callContext == GEO_CONTEXT_RENDER && gCurrentArea != NULL && gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) { graphNode->fnNode.node.flags = (graphNode->fnNode.node.flags & 0xFF) | 0x500; +#ifndef L3DEX2_ALONE dlist = render_cannon_circle_base(); +#endif } return dlist; }