diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8dd86a397..f9708d3ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,12 +13,16 @@ jobs: include: - name: "Debug, No F3DEX3" args: DEBUG_FEATURES=1 CPP_DEFINES=-DENABLE_F3DEX3=0 + version: gc-eu-mq-dbg - name: "Debug, F3DEX3" args: DEBUG_FEATURES=1 CPP_DEFINES=-DENABLE_F3DEX3=1 + version: ntsc-1.2 - name: "Release, No F3DEX3" args: DEBUG_FEATURES=0 CPP_DEFINES=-DENABLE_F3DEX3=0 + version: ntsc-1.2 - name: "Release, F3DEX3" args: DEBUG_FEATURES=0 CPP_DEFINES=-DENABLE_F3DEX3=1 + version: gc-eu-mq-dbg defaults: run: shell: bash @@ -49,8 +53,8 @@ jobs: # Setup the project - name: Setup - run: make setup -j$(nproc) + run: make setup -j$(nproc) VERSION=${{ matrix.version }} # Build the project - name: Build - run: ${{ matrix.args }} make -j$(nproc) + run: ${{ matrix.args }} make -j$(nproc) VERSION=${{ matrix.version }} diff --git a/.make_hackeroot.mk b/.make_hackeroot.mk index eba6578d1..a73cc0c31 100644 --- a/.make_hackeroot.mk +++ b/.make_hackeroot.mk @@ -190,7 +190,7 @@ patch: # Create F3DEX3 bps patches # Steps: # - run Flips and create the patches -create_f3dex3_patches: F3DEX3/f3dzex2.code F3DEX3/f3dzex2.data +create_f3dex3_patches: $(F3DEX3_DIR)/f3dzex2.code $(F3DEX3_DIR)/f3dzex2.data $(call print_no_args,Creating F3DEX3 patches...) $(V)$(FLIPS) --create --bps $(F3DEX3_DIR)/f3dzex2.code $(F3DEX3_DIR)/F3DEX3_BrW.code $(F3DEX3_DIR)/F3DEX3_BrW.code.bps $(V)$(FLIPS) --create --bps $(F3DEX3_DIR)/f3dzex2.data $(F3DEX3_DIR)/F3DEX3_BrW.data $(F3DEX3_DIR)/F3DEX3_BrW.data.bps diff --git a/F3DEX3/gc/F3DEX3_BrW.code.bps b/F3DEX3/gc/F3DEX3_BrW.code.bps index 6634c5d5c..eb7d91a87 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW.code.bps and b/F3DEX3/gc/F3DEX3_BrW.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW.data.bps b/F3DEX3/gc/F3DEX3_BrW.data.bps index 8b24e5598..6df602f31 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW.data.bps and b/F3DEX3/gc/F3DEX3_BrW.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC.code.bps b/F3DEX3/gc/F3DEX3_BrW_NOC.code.bps index dc05eb296..f916771d0 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC.code.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC.data.bps b/F3DEX3/gc/F3DEX3_BrW_NOC.data.bps index 1e0fdedd7..83d88c295 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC.data.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PA.code.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PA.code.bps index 564f95686..ca826240e 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PA.code.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PA.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PA.data.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PA.data.bps index 8ec527bd7..c115bd0df 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PA.data.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PA.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PB.code.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PB.code.bps index ebba9d608..b6c51e407 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PB.code.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PB.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PB.data.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PB.data.bps index 41d89c19f..095e2e6b8 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PB.data.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PB.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PC.code.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PC.code.bps index 3df9fb567..18667ca79 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PC.code.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PC.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_NOC_PC.data.bps b/F3DEX3/gc/F3DEX3_BrW_NOC_PC.data.bps index 3707a3580..123e5a84d 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_NOC_PC.data.bps and b/F3DEX3/gc/F3DEX3_BrW_NOC_PC.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PA.code.bps b/F3DEX3/gc/F3DEX3_BrW_PA.code.bps index 8b5b60723..ea3f68d47 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PA.code.bps and b/F3DEX3/gc/F3DEX3_BrW_PA.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PA.data.bps b/F3DEX3/gc/F3DEX3_BrW_PA.data.bps index c606e60fe..decbc5d9c 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PA.data.bps and b/F3DEX3/gc/F3DEX3_BrW_PA.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PB.code.bps b/F3DEX3/gc/F3DEX3_BrW_PB.code.bps index 28d82b7cd..4b0167b8d 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PB.code.bps and b/F3DEX3/gc/F3DEX3_BrW_PB.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PB.data.bps b/F3DEX3/gc/F3DEX3_BrW_PB.data.bps index cb5948acf..b5e9fcbe6 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PB.data.bps and b/F3DEX3/gc/F3DEX3_BrW_PB.data.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PC.code.bps b/F3DEX3/gc/F3DEX3_BrW_PC.code.bps index 86569b068..451143202 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PC.code.bps and b/F3DEX3/gc/F3DEX3_BrW_PC.code.bps differ diff --git a/F3DEX3/gc/F3DEX3_BrW_PC.data.bps b/F3DEX3/gc/F3DEX3_BrW_PC.data.bps index 2756caf10..6f139bc16 100644 Binary files a/F3DEX3/gc/F3DEX3_BrW_PC.data.bps and b/F3DEX3/gc/F3DEX3_BrW_PC.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW.code.bps b/F3DEX3/n64/F3DEX3_BrW.code.bps index f36d6ddbe..7d34be8f4 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW.code.bps and b/F3DEX3/n64/F3DEX3_BrW.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW.data.bps b/F3DEX3/n64/F3DEX3_BrW.data.bps index e0625ffd5..91a2cd671 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW.data.bps and b/F3DEX3/n64/F3DEX3_BrW.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC.code.bps b/F3DEX3/n64/F3DEX3_BrW_NOC.code.bps index c7726d346..b87d19b4c 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC.code.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC.data.bps b/F3DEX3/n64/F3DEX3_BrW_NOC.data.bps index 03854112c..a5b4f6368 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC.data.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PA.code.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PA.code.bps index 814dd80a6..2c230b7d7 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PA.code.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PA.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PA.data.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PA.data.bps index 6994778e0..91faab7fb 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PA.data.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PA.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PB.code.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PB.code.bps index 22453ac06..5556e77af 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PB.code.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PB.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PB.data.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PB.data.bps index ca938fbc7..0825a2acc 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PB.data.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PB.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PC.code.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PC.code.bps index c3973a6b1..a3f1fbafe 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PC.code.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PC.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_NOC_PC.data.bps b/F3DEX3/n64/F3DEX3_BrW_NOC_PC.data.bps index 3392aef3b..cd1c470b4 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_NOC_PC.data.bps and b/F3DEX3/n64/F3DEX3_BrW_NOC_PC.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PA.code.bps b/F3DEX3/n64/F3DEX3_BrW_PA.code.bps index cce5822cf..6796c54ed 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PA.code.bps and b/F3DEX3/n64/F3DEX3_BrW_PA.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PA.data.bps b/F3DEX3/n64/F3DEX3_BrW_PA.data.bps index 64b2045da..84a49ae9f 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PA.data.bps and b/F3DEX3/n64/F3DEX3_BrW_PA.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PB.code.bps b/F3DEX3/n64/F3DEX3_BrW_PB.code.bps index d2ec4c82b..61d941ffb 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PB.code.bps and b/F3DEX3/n64/F3DEX3_BrW_PB.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PB.data.bps b/F3DEX3/n64/F3DEX3_BrW_PB.data.bps index 19745fd08..965e45dd3 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PB.data.bps and b/F3DEX3/n64/F3DEX3_BrW_PB.data.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PC.code.bps b/F3DEX3/n64/F3DEX3_BrW_PC.code.bps index 35de0acbd..7f779dda1 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PC.code.bps and b/F3DEX3/n64/F3DEX3_BrW_PC.code.bps differ diff --git a/F3DEX3/n64/F3DEX3_BrW_PC.data.bps b/F3DEX3/n64/F3DEX3_BrW_PC.data.bps index 6fe193de6..27ee568ba 100644 Binary files a/F3DEX3/n64/F3DEX3_BrW_PC.data.bps and b/F3DEX3/n64/F3DEX3_BrW_PC.data.bps differ diff --git a/include/ultra64/gbi.f3dex3.h b/include/ultra64/gbi.f3dex3.h index f5f3c99c6..39db98305 100644 --- a/include/ultra64/gbi.f3dex3.h +++ b/include/ultra64/gbi.f3dex3.h @@ -16,6 +16,9 @@ #ifndef GBI_F3DEX3_H #define GBI_F3DEX3_H +/* Don't remove this block which defines F3DEX3 as F3DEX2. Other headers in your +romhack codebase will likely assume that if the microcode is not F3DEX2, it is +F3DEX1 or older, thus breaking F3DEX3 compatibility even more. */ #ifdef F3DEX_GBI_2 #undef F3DEX_GBI_2 #endif @@ -28,6 +31,13 @@ #define F3DEX_GBI_PL 1 #define F3DEX_GBI_3 1 +/* This is only included to check correctness of OS_YIELD_DATA_SIZE. If you are +sure this is correct in your project, you can remove this include. */ +#include "ultra64/sptask.h" +#if OS_YIELD_DATA_SIZE != 0xC00 +#error "F3DEX3 requires OS_YIELD_DATA_SIZE == 0xC00" +#endif + #ifdef REQUIRE_SEMICOLONS_AFTER_GBI_COMMANDS /* OoT style, semicolons required after using macros, cleaner code. If modding SM64, will have to fix a few places the codebase omits the semicolons. */ @@ -63,7 +73,8 @@ of warnings if you use -Wpedantic. */ */ /*#define G_SPECIAL_3 0xD3 no-op in F3DEX2 */ /*#define G_SPECIAL_2 0xD4 no-op in F3DEX2 */ -/*#define G_SPECIAL_1 0xD5 triggered MVP recalculation, not supported in F3DEX3 */ +/*#define G_SPECIAL_1 0xD5 triggered MVP recalculation in F3DEX2 for debug */ +#define G_FLUSH 0xD4 #define G_MEMSET 0xD5 #define G_DMA_IO 0xD6 #define G_TEXTURE 0xD7 @@ -578,8 +589,12 @@ longer a multiple of 8 (DMA word). This was not used in any command anyway. */ #define G_MDSFT_PIPELINE 23 /* G_SETOTHERMODE_H gPipelineMode */ -#define G_PM_1PRIMITIVE (1 << G_MDSFT_PIPELINE) #define G_PM_NPRIMITIVE (0 << G_MDSFT_PIPELINE) +#ifdef KAZE_GBI_HACKS +#define G_PM_1PRIMITIVE G_PM_NPRIMITIVE +#else +#define G_PM_1PRIMITIVE (1 << G_MDSFT_PIPELINE) +#endif /* G_SETOTHERMODE_H gSetCycleType */ #define G_CYC_1CYCLE (0 << G_MDSFT_CYCLETYPE) @@ -1194,6 +1209,18 @@ typedef union { long long int force_structure_alignment[2]; } Vp; +/* + * Light types, encoded in the kc coefficient. + */ +/** + * Standard directional light. Equivalent to kc = 0. + */ +#define LIGHT_TYPE_DIR 0 +/** + * Identifies the light as a point light, with x acting as the kc coefficient. + */ +#define LIGHT_TYPE_POINT(x) x + /** * Light structure. * @@ -2027,6 +2054,26 @@ typedef union { * Macros to assemble the graphics display list */ +/* + * Command where only the first word (containing the command byte) is used, + * saving one CPU instruction to write the second word as zero. + */ +#define g1Word(pkt, c, l) \ +_DW({ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL((c), 24, 8) | \ + _SHIFTL((l), 0, 24)); \ +}) +/* + * The static version has to fill in the second word with something. + */ +#define gs1Word(c, l) \ +{ \ + (_SHIFTL((c), 24, 8) | \ + _SHIFTL((l), 0, 24)), \ + 0 \ +} + /* * DMA macros */ @@ -2084,8 +2131,8 @@ _DW({ \ (unsigned int)(adrs) \ } -#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0) -#define gsSPNoOp() gsDma0p( G_SPNOOP, 0, 0) +#define gSPNoOp(pkt) g1Word(pkt, G_SPNOOP, 0) +#define gsSPNoOp() gs1Word( G_SPNOOP, 0) /** * @brief macro which inserts a matrix operation at the end display list. @@ -2258,8 +2305,8 @@ _DW({ \ #define _gSPBranchListRaw(pkt,dl,hint) gDma1p(pkt, G_DL, dl, hint, G_DL_NOPUSH) #define _gsSPBranchListRaw( dl,hint) gsDma1p( G_DL, dl, hint, G_DL_NOPUSH) -#define _gSPEndDisplayListRaw(pkt,hint) gDma0p(pkt, G_ENDDL, 0, hint) -#define _gsSPEndDisplayListRaw(hint) gsDma0p( G_ENDDL, 0, hint) +#define _gSPEndDisplayListRaw(pkt,hint) g1Word(pkt, G_ENDDL, hint) +#define _gsSPEndDisplayListRaw(hint) gs1Word( G_ENDDL, hint) /* * Converts a total expected count of DL commands to a number of bytes to @@ -2430,27 +2477,36 @@ _DW({ \ /** * @copydetails gSPMemset */ -#define gsSPMemset(pkt, dram, value, size) \ +#define gsSPMemset(dram, value, size) \ gsImmp1(G_RDPHALF_1, ((value) & 0xFFFF)), \ gsDma0p(G_MEMSET, (dram), ((size) & 0xFFFFF0)) /** - * RSP short command (no DMA required) macros + * Flush the internal DMEM buffer of RDP commands to the RDP FIFO in DRAM, + * causing the RDP to immediately begin executing any previous commands. + * Without SPFlush, the RDP may not begin executing any given command until up + * to 46 more RDP commands after that have been processed by the RSP (or the + * final end of the display list for the frame). + * + * The primary use case is if your frame's display list begins with clearing + * the framebuffer and/or Z buffer, and then proceeds to things which take + * significant time on the RSP before emitting many RDP commands, such as + * matrix and lighting for drawing a character model. You should insert SPFlush + * after the first large buffer clear to cause the RDP to begin executing those + * long operations immediately while the RSP is continuing to work. If you are + * clearing both the framebuffer and Z buffer, you would usually only need one + * SPFlush after the first of these two DPFillRect commands. */ -#define gImmp0(pkt, c) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = _SHIFTL((c), 24, 8); \ -}) +#define gSPFlush(pkt) g1Word(pkt, G_FLUSH, 0) /** - * @copydetails gImmp0 + * @copydetails gSPFlush + */ +#define gsSPFlush() gs1Word( G_FLUSH, 0) + +/* + * RSP short command (no DMA required) macros */ -#define gsImmp0(c) \ -{ \ - _SHIFTL((c), 24, 8) \ -} #define gImmp1(pkt, c, p0) \ _DW({ \ @@ -2466,58 +2522,6 @@ _DW({ \ (unsigned int)(p0) \ } -#define gImmp2(pkt, c, p0, p1) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = _SHIFTL((c), 24, 8); \ - _g->words.w1 = (_SHIFTL((p0), 16, 16) | \ - _SHIFTL((p1), 8, 8)); \ -}) - -#define gsImmp2(c, p0, p1) \ -{ \ - _SHIFTL((c), 24, 8), \ - (_SHIFTL((p0), 16, 16) | \ - _SHIFTL((p1), 8, 8)) \ -} - -#define gImmp3(pkt, c, p0, p1, p2) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = _SHIFTL((c), 24, 8); \ - _g->words.w1 = (_SHIFTL((p0), 16, 16) | \ - _SHIFTL((p1), 8, 8) | \ - _SHIFTL((p2), 0, 8)); \ -}) - -#define gsImmp3(c, p0, p1, p2) \ -{ \ - _SHIFTL((c), 24, 8), \ - (_SHIFTL((p0), 16, 16) | \ - _SHIFTL((p1), 8, 8) | \ - _SHIFTL((p2), 0, 8)) \ -} - -#define gImmp21(pkt, c, p0, p1, dat) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = (_SHIFTL((c), 24, 8) | \ - _SHIFTL((p0), 8, 16) | \ - _SHIFTL((p1), 0, 8)); \ - _g->words.w1 = (unsigned int) (dat); \ -}) - -#define gsImmp21(c, p0, p1, dat) \ -{ \ - (_SHIFTL((c), 24, 8) | \ - _SHIFTL((p0), 8, 16) | \ - _SHIFTL((p1), 0, 8)), \ - (unsigned int) (dat) \ -} - #define gMoveWd(pkt, index, offset, data) \ gDma1p((pkt), G_MOVEWORD, data, (offset & 0xFFF), index) #define gsMoveWd( index, offset, data) \ @@ -2559,22 +2563,13 @@ _DW({ \ /** * 1 Triangle */ -#define gSP1Triangle(pkt, v0, v1, v2, flag) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - _g->words.w0 = (_SHIFTL(G_TRI1, 24, 8) | \ - __gsSP1Triangle_w1f(v0, v1, v2, flag)); \ - _g->words.w1 = 0; \ -}) +#define gSP1Triangle(pkt, v0, v1, v2, flag) \ + g1Word(pkt, G_TRI1, __gsSP1Triangle_w1f(v0, v1, v2, flag)) /** * @copydetails gSP1Triangle */ #define gsSP1Triangle(v0, v1, v2, flag) \ -{ \ - (_SHIFTL(G_TRI1, 24, 8) | \ - __gsSP1Triangle_w1f(v0, v1, v2, flag)), \ - 0 \ -} + gs1Word(G_TRI1, __gsSP1Triangle_w1f(v0, v1, v2, flag)) /** * 1 Quadrangle @@ -5232,19 +5227,8 @@ _DW({ \ _SHIFTL(sB, 0, 8)) \ } -#define gDPNoParam(pkt, cmd) \ -_DW({ \ - Gfx *_g = (Gfx *)(pkt); \ - \ - _g->words.w0 = _SHIFTL(cmd, 24, 8); \ - _g->words.w1 = 0; \ -}) - -#define gsDPNoParam(cmd) \ -{ \ - _SHIFTL(cmd, 24, 8), \ - 0 \ -} +#define gDPNoParam(pkt, cmd) g1Word(pkt, cmd, 0) +#define gsDPNoParam(cmd) gs1Word( cmd, 0) #define gDPParam(pkt, cmd, param) \ _DW({ \ @@ -5473,4 +5457,4 @@ _DW({ \ #define gDPNoOpCloseDisp(pkt, file, line) gDma1p(pkt, G_NOOP, file, line, 8) #define gDPNoOpTag3(pkt, type, data, n) gDma1p(pkt, G_NOOP, data, n, type) -#endif /* GBI_F3DEX3_H */ +#endif /* F3DEX3_H */ diff --git a/include/z64save.h b/include/z64save.h index 21cb73fdb..10e2fbe0c 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -12,10 +12,14 @@ typedef enum ZTargetSetting { } ZTargetSetting; typedef enum Language { +#if OOT_NTSC /* 0 */ LANGUAGE_JPN, /* 1 */ LANGUAGE_ENG, - /* 2 */ LANGUAGE_GER, - /* 3 */ LANGUAGE_FRA, +#else + /* 0 */ LANGUAGE_ENG, + /* 1 */ LANGUAGE_GER, + /* 2 */ LANGUAGE_FRA, +#endif /* */ LANGUAGE_MAX } Language; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index d2e348ba8..0d6760433 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1423,6 +1423,13 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex } } +//! TODO: remove once this is documented +#if OOT_VERSION == NTSC_1_2 +#define MOON_VTX gMoonDL_04039410_Vtx +#else +#define MOON_VTX gMoonDL_04038F70_Vtx +#endif + void Environment_DrawSunAndMoon(PlayState* play) { // This replace gMoonDL in gameplay_keep. TODO make this gMoonDL once asset replacement is sophisticated enough static Gfx sMoonDL[] = { @@ -1436,7 +1443,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_PRIM_A | G_RM_XLU_SURF2), gsDPLoadTextureBlock(gMoonTex, G_IM_FMT_IA, G_IM_SIZ_8b, 64, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD), - gsSPVertex(gMoonDL_04039410_Vtx, 4, 0), + gsSPVertex(MOON_VTX, 4, 0), gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), gsSPEndDisplayList(), };