diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 62a27bd0..71be5a3d 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -25,7 +25,7 @@ "TARGET_N64=1", "VERSION_US=1", "F3DEX_GBI_2=1", - "F3DZEX_GBI_2=1", + "F3DZEX_NON_GBI_2=1", "F3DEX_GBI_SHARED=1", "NON_MATCHING=1", "AVOID_UB=1" diff --git a/Makefile b/Makefile index e0f8a992..145e1f7d 100644 --- a/Makefile +++ b/Makefile @@ -108,7 +108,7 @@ else ifeq ($(GRUCODE),l3dex2) # Line3DEX2 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) - DEFINES += F3DZEX_GBI_2=1 F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1 + DEFINES += F3DZEX_NON_GBI_2=1 F3DEX_GBI_2=1 F3DEX_GBI_SHARED=1 else ifeq ($(GRUCODE),super3d) # Super3D $(warning Super3D is experimental. Try at your own risk.) DEFINES += SUPER3D_GBI=1 F3D_NEW=1 diff --git a/README.md b/README.md index 706efddd..490b2a32 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff **Lighting Engine by Wiseguy** -- Lighting Engine is available on a separate branch ([base/lighting-engine](https://github.com/Reonu/HackerSM64/tree/base/lighting-engine)). Instructions on how to use it are in the readme of that branch. +- Lighting Engine is available on a separate branch ([base/lighting-engine-wip](https://github.com/Reonu/HackerSM64/tree/base/lighting-engine-wip)). Instructions on how to use it are in the readme of that branch. - Alternatively, the main repo has `Puppylights` available, which is a more lightweight, but limited lighting library intended to be used to modify existing light properties. You can look at `puppylights.c` to find out how to use it. **Puppycam** diff --git a/VERSION.txt b/VERSION.txt index 46b105a3..0ac852dd 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v2.0.0 +v2.0.1 diff --git a/include/config/config_graphics.h b/include/config/config_graphics.h index 4c4b52ff..d693f6c0 100644 --- a/include/config/config_graphics.h +++ b/include/config/config_graphics.h @@ -39,7 +39,7 @@ // Similar to the above, but 30 FPS (Textures by InTheBeef, cleaned up by Arceveti) #define IA8_30FPS_COINS -// Use .rej microcode for certain objects (experimental - only should be used when F3DZEX_GBI_2 is defined). +// Use .rej microcode for certain objects (experimental - only should be used when F3DEX_GBI_2 is defined). // For advanced users only. Does not work perfectly out the box, best used when exported actor models are // using 64 vertex sizes, offered by Fast64 in the microcode menu. // #define OBJECTS_REJ diff --git a/include/config/config_safeguards.h b/include/config/config_safeguards.h index 0a5dd97d..22364085 100644 --- a/include/config/config_safeguards.h +++ b/include/config/config_safeguards.h @@ -14,9 +14,9 @@ * config_graphics */ -#ifndef F3DZEX_GBI_2 - #undef OBJECTS_REJ // OBJECTS_REJ requires f3dzex. -#endif // !F3DZEX_GBI_2 +#ifndef F3DEX_GBI_2 + #undef OBJECTS_REJ // OBJECTS_REJ requires f3dex2. +#endif // !F3DEX_GBI_2 #ifndef F3DEX_GBI_SHARED #undef OBJECTS_REJ // Non F3DEX-based ucodes do NOT support ucode switching. diff --git a/include/segments.h b/include/segments.h index 99a716b8..d51e2423 100644 --- a/include/segments.h +++ b/include/segments.h @@ -38,7 +38,7 @@ * importing large custom content. */ -#define SEG_POOL_START _engineSegmentBssEnd // 0x0165000 in size +#define SEG_POOL_START _framebuffersSegmentBssEnd // 0x0165000 in size #define POOL_SIZE RAM_END - SEG_POOL_START #define MAP_PARSER_ADDRESS 0x80345678 diff --git a/sm64.ld b/sm64.ld index 414726c3..7bff39df 100755 --- a/sm64.ld +++ b/sm64.ld @@ -102,6 +102,13 @@ SECTIONS END_SEG(boot) . = (RAM_START + 0x400); + BEGIN_NOLOAD(zbuffer) + { + BUILD_DIR/src/buffers/zbuffer.o(.bss*); + } + END_NOLOAD(zbuffer) + + . = _zbufferSegmentBssEnd; BEGIN_NOLOAD(buffers) { BUILD_DIR/src/buffers/buffers.o(.bss*); @@ -279,28 +286,13 @@ SECTIONS . = ALIGN(0x40); } END_NOLOAD(engine) -#ifndef USE_EXT_RAM - . = 0x80200000; -#else - . = 0x80400000; -#endif + + . = _engineSegmentBssEnd; BEGIN_NOLOAD(framebuffers) { BUILD_DIR/src/buffers/framebuffers.o(.bss*); } END_NOLOAD(framebuffers) -#ifndef USE_EXT_RAM - . = 0x80300000; -#else - . = 0x80500000; -#endif - BEGIN_NOLOAD(zbuffer) - { - BUILD_DIR/src/buffers/zbuffer.o(.bss*); - } - END_NOLOAD(zbuffer) - - . = _engineSegmentBssEnd; __mainPoolStart = .; __mainPoolSize = (RAM_END - .); diff --git a/src/boot/memory.c b/src/boot/memory.c index cfc084aa..4c3bd940 100644 --- a/src/boot/memory.c +++ b/src/boot/memory.c @@ -139,11 +139,6 @@ void main_pool_init(void *start, void *end) { #endif } -extern u8 _framebuffersSegmentBssStart[]; -extern u8 _framebuffersSegmentBssEnd[]; -extern u8 _zbufferSegmentBssStart[]; -extern u8 _zbufferSegmentBssEnd[]; - /** * Allocate a block of memory from the pool of given size, and from the * specified side of the pool (MEMORY_POOL_LEFT or MEMORY_POOL_RIGHT). @@ -158,12 +153,6 @@ void *main_pool_alloc(u32 size, u32 side) { sPoolFreeSpace -= size; if (side == MEMORY_POOL_LEFT) { newListHead = (struct MainPoolBlock *) ((u8 *) sPoolListHeadL + size); - if ((u32)newListHead >= (u32)&_framebuffersSegmentBssStart && (u32)newListHead <= (u32)&_framebuffersSegmentBssEnd) { - newListHead = (struct MainPoolBlock *)ALIGN16((u32)&_framebuffersSegmentBssEnd + 0x40); - } - if ((u32)newListHead >= (u32)&_zbufferSegmentBssStart && (u32)newListHead <= (u32)&_zbufferSegmentBssEnd) { - newListHead = (struct MainPoolBlock *)ALIGN16((u32)&_zbufferSegmentBssEnd + 0x40); - } sPoolListHeadL->next = newListHead; newListHead->prev = sPoolListHeadL; newListHead->next = NULL; diff --git a/src/game/game_init.c b/src/game/game_init.c index 545e9e66..8ab354f8 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -293,6 +293,11 @@ void create_gfx_task_structure(void) { gGfxSPTask->task.t.ucode_data = gspF3DZEX2_PosLight_fifoDataStart; gGfxSPTask->task.t.ucode_size = ((u8 *) gspF3DZEX2_PosLight_fifoTextEnd - (u8 *) gspF3DZEX2_PosLight_fifoTextStart); gGfxSPTask->task.t.ucode_data_size = ((u8 *) gspF3DZEX2_PosLight_fifoDataEnd - (u8 *) gspF3DZEX2_PosLight_fifoDataStart); +#elif F3DZEX_NON_GBI_2 + gGfxSPTask->task.t.ucode = gspF3DZEX2_NoN_PosLight_fifoTextStart; + gGfxSPTask->task.t.ucode_data = gspF3DZEX2_NoN_PosLight_fifoDataStart; + gGfxSPTask->task.t.ucode_size = ((u8 *) gspF3DZEX2_NoN_PosLight_fifoTextEnd - (u8 *) gspF3DZEX2_NoN_PosLight_fifoTextStart); + gGfxSPTask->task.t.ucode_data_size = ((u8 *) gspF3DZEX2_NoN_PosLight_fifoDataEnd - (u8 *) gspF3DZEX2_NoN_PosLight_fifoDataStart); #elif F3DEX2PL_GBI gGfxSPTask->task.t.ucode = gspF3DEX2_PosLight_fifoTextStart; gGfxSPTask->task.t.ucode_data = gspF3DEX2_PosLight_fifoDataStart; diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index da5dd1e9..80818e30 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -367,7 +367,7 @@ void geo_process_master_list_sub(struct GraphNodeMasterList *node) { gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER); } #ifdef OBJECTS_REJ - #if defined(F3DZEX_GBI_2) && defined(VISUAL_DEBUG) + #if defined(F3DEX_GBI_2) && defined(VISUAL_DEBUG) if (hitboxView) render_debug_boxes(DEBUG_UCODE_REJ); #endif switch_ucode(GRAPH_NODE_UCODE_DEFAULT); @@ -408,7 +408,7 @@ void geo_append_display_list(void *displayList, s32 layer) { } #endif // SILHOUETTE } -#endif // F3DZEX_GBI_2 || SILHOUETTE +#endif // F3DEX_GBI_2 || SILHOUETTE if (gCurGraphNodeMasterList != NULL) { struct DisplayListNode *listNode = alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode));