mirror of
https://github.com/HackerN64/HackerOoT.git
synced 2026-01-21 10:37:37 -08:00
f3dex3: required changes
This commit is contained in:
2
Makefile
2
Makefile
@@ -378,6 +378,8 @@ $(BUILD_DIR)/baserom/%.o: $(BASEROM_SEGMENTS_DIR)/%
|
||||
$(BUILD_DIR)/data/%.o: data/%.s
|
||||
$(AS) $(ASFLAGS) $< -o $@
|
||||
|
||||
$(BUILD_DIR)/data/rsp.rodata.f3dex3.o: F3DEX3/F3DEX3.code F3DEX3/F3DEX3.data
|
||||
|
||||
$(BUILD_DIR)/assets/text/%.enc.h: assets/text/%.h assets/text/charmap.txt
|
||||
$(PYTHON) tools/msgenc.py assets/text/charmap.txt $< $@
|
||||
|
||||
|
||||
32
data/rsp.rodata.f3dex3.s
Normal file
32
data/rsp.rodata.f3dex3.s
Normal file
@@ -0,0 +1,32 @@
|
||||
.include "macro.inc"
|
||||
|
||||
# assembler directives
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
.set gp=64 # allow use of 64-bit general purpose registers
|
||||
|
||||
.section .rodata
|
||||
|
||||
.balign 16
|
||||
|
||||
glabel aspMainDataStart
|
||||
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCCE10, 0x2E0
|
||||
glabel aspMainDataEnd
|
||||
|
||||
glabel gspF3DZEX2_NoN_PosLight_fifoTextStart
|
||||
.incbin "F3DEX3/F3DEX3.code"
|
||||
glabel gspF3DZEX2_NoN_PosLight_fifoTextEnd
|
||||
.balign 16
|
||||
|
||||
glabel gspF3DZEX2_NoN_PosLight_fifoDataStart
|
||||
.incbin "F3DEX3/F3DEX3.data"
|
||||
glabel gspF3DZEX2_NoN_PosLight_fifoDataEnd
|
||||
.balign 16
|
||||
|
||||
glabel gspS2DEX2d_fifoDataStart
|
||||
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEB40, 0x390
|
||||
glabel gspS2DEX2d_fifoDataEnd
|
||||
|
||||
glabel njpgdspMainDataStart
|
||||
.incbin "baseroms/gc-eu-mq-dbg/baserom-decompressed.z64", 0xBCEED0, 0x60
|
||||
glabel njpgdspMainDataEnd
|
||||
@@ -9,6 +9,15 @@
|
||||
// Disables AA (Improves console performance but causes visible seams between unconnected geometry).
|
||||
// #define DISABLE_AA false
|
||||
|
||||
/**
|
||||
* F3DEX3 options
|
||||
* ``ENABLE_F3DEX3_RECOMMENDATIONS`` will enable the recommended changes listed in F3DEX3's readme
|
||||
* ``ENABLE_F3DEX3_NEW_FEATURES`` will enable the required changes to use the new features from F3DEX3
|
||||
*/
|
||||
#define ENABLE_F3DEX3 true
|
||||
#define ENABLE_F3DEX3_RECOMMENDATIONS true
|
||||
#define ENABLE_F3DEX3_NEW_FEATURES true
|
||||
|
||||
// Fix annoying glitches (crashes and softlocks)
|
||||
#define FIX_ANNOYING_GLITCH true
|
||||
|
||||
|
||||
@@ -107,6 +107,16 @@
|
||||
/*****************
|
||||
* config_game.h
|
||||
*/
|
||||
#if !ENABLE_F3DEX3 && ENABLE_F3DEX3_RECOMMENDATIONS
|
||||
#undef ENABLE_F3DEX3_RECOMMENDATIONS
|
||||
#define ENABLE_F3DEX3_RECOMMENDATIONS false
|
||||
#endif
|
||||
|
||||
#if !ENABLE_F3DEX3 && ENABLE_F3DEX3_NEW_FEATURES
|
||||
#undef ENABLE_F3DEX3_NEW_FEATURES
|
||||
#define ENABLE_F3DEX3_NEW_FEATURES false
|
||||
#endif
|
||||
|
||||
#if FORCE_WIDESCREEN
|
||||
#define USE_WIDESCREEN true
|
||||
#else
|
||||
|
||||
5166
include/ultra64/gbi.f3dex3.h
Normal file
5166
include/ultra64/gbi.f3dex3.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,11 @@
|
||||
#ifndef ULTRA64_GBI_H
|
||||
#define ULTRA64_GBI_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if ENABLE_F3DEX3
|
||||
#include "gbi.f3dex3.h"
|
||||
#else
|
||||
/* To enable Fast3DEX grucode support, define F3DEX_GBI. */
|
||||
|
||||
/* Types */
|
||||
@@ -5153,4 +5158,6 @@ _DW({ \
|
||||
|
||||
#endif
|
||||
|
||||
#endif // ENABLE_F3DEX3
|
||||
|
||||
#endif
|
||||
|
||||
4
spec
4
spec
@@ -553,7 +553,11 @@ beginseg
|
||||
include "$(BUILD_DIR)/src/code/z_construct.o"
|
||||
include "$(BUILD_DIR)/data/audio_tables.rodata.o"
|
||||
include "$(BUILD_DIR)/data/rsp.text.o"
|
||||
#if ENABLE_F3DEX3
|
||||
include "$(BUILD_DIR)/data/rsp.rodata.f3dex3.o"
|
||||
#else
|
||||
include "$(BUILD_DIR)/data/rsp.rodata.o"
|
||||
#endif
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -894,7 +894,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
this->tri1Cnt++;
|
||||
this->pipeSyncRequired = true;
|
||||
} break;
|
||||
|
||||
#if !ENABLE_F3DEX3
|
||||
case G_LINE3D: {
|
||||
if (curGfx->line.wd == 0) {
|
||||
DISAS_LOG("gsSPLine3D(%d, %d),", curGfx->line.v0, curGfx->line.v1);
|
||||
@@ -906,7 +906,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
this->lineCnt++;
|
||||
this->pipeSyncRequired = true;
|
||||
} break;
|
||||
|
||||
#endif
|
||||
case G_TRI2: {
|
||||
Gtri2 tri2 = ptr->tri2;
|
||||
u32 v0, v1, v2;
|
||||
@@ -1019,13 +1019,13 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
DISAS_LOG("gsSPSegment(%d, 0x%08x),", movewd.offset / 4, movewd.data);
|
||||
this->segments[movewd.offset / 4] = movewd.data & 0xFFFFFF;
|
||||
} break;
|
||||
|
||||
#if !ENABLE_F3DEX3
|
||||
case G_MW_CLIP: {
|
||||
DISAS_LOG("gsSPClipRatio(FRUSTRATIO_%d), ",
|
||||
(movewd.data != 0) ? movewd.data : -movewd.data);
|
||||
ptr += 4 - 1;
|
||||
} break;
|
||||
|
||||
#endif
|
||||
case G_MW_NUMLIGHT: {
|
||||
DISAS_LOG("gsSPNumLights(%d), ", movewd.data / 24);
|
||||
} break;
|
||||
@@ -1039,11 +1039,11 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
case G_MW_FOG: {
|
||||
DISAS_LOG("gsSPFogFactor(%d, %d),", movewd.data >> 16, movewd.data & 0xFFFF);
|
||||
} break;
|
||||
|
||||
#if !ENABLE_F3DEX3
|
||||
case G_MW_PERSPNORM: {
|
||||
DISAS_LOG("gsSPPerspNormalize(%d),", movewd.data);
|
||||
} break;
|
||||
|
||||
#endif
|
||||
default: {
|
||||
DISAS_LOG("gsMoveWd(%d, %d, %d), ", movewd.index, movewd.offset, movewd.data);
|
||||
} break;
|
||||
@@ -1062,14 +1062,15 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
DISAS_LOG("vtrans=[%d %d %d %d] ", vp->vtrans[0], vp->vtrans[1], vp->vtrans[2],
|
||||
vp->vtrans[3]);
|
||||
} break;
|
||||
|
||||
#if !ENABLE_F3DEX3
|
||||
case G_MV_MATRIX: {
|
||||
DISAS_LOG("gsSPForceMatrix(0x%08x),", movemem.data);
|
||||
ptr += 2 - 1;
|
||||
} break;
|
||||
|
||||
#endif
|
||||
case G_MV_LIGHT: {
|
||||
switch (movemem.offset * 8) {
|
||||
#if !ENABLE_F3DEX3
|
||||
case G_MVO_LOOKATX: {
|
||||
DISAS_LOG("gsSPLookAtX(0x%08x),", movemem.data);
|
||||
} break;
|
||||
@@ -1077,7 +1078,7 @@ void UCodeDisas_Disassemble(UCodeDisas* this, Gfx* ptr) {
|
||||
case G_MVO_LOOKATY: {
|
||||
DISAS_LOG("gsSPLookAtY(0x%08x),", movemem.data);
|
||||
} break;
|
||||
|
||||
#endif
|
||||
default: {
|
||||
DISAS_LOG("gsSPLight(0x%08x,%d),", movemem.data,
|
||||
(movemem.offset * 8 - 0x18) / 0x18);
|
||||
|
||||
@@ -110,7 +110,9 @@ void Lights_BindPoint(Lights* lights, LightParams* params, Vec3f* vec) {
|
||||
|
||||
scale = posDiff / scale;
|
||||
scale = 1 - SQ(scale);
|
||||
|
||||
#if ENABLE_F3DEX3
|
||||
light->l.type = 0;
|
||||
#endif
|
||||
light->l.col[0] = light->l.colc[0] = params->point.color[0] * scale;
|
||||
light->l.col[1] = light->l.colc[1] = params->point.color[1] * scale;
|
||||
light->l.col[2] = light->l.colc[2] = params->point.color[2] * scale;
|
||||
@@ -129,6 +131,9 @@ void Lights_BindDirectional(Lights* lights, LightParams* params, Vec3f* vec) {
|
||||
Light* light = Lights_FindSlot(lights);
|
||||
|
||||
if (light != NULL) {
|
||||
#if ENABLE_F3DEX3
|
||||
light->l.type = 0;
|
||||
#endif
|
||||
light->l.col[0] = light->l.colc[0] = params->dir.color[0];
|
||||
light->l.col[1] = light->l.colc[1] = params->dir.color[1];
|
||||
light->l.col[2] = light->l.colc[2] = params->dir.color[2];
|
||||
@@ -286,6 +291,9 @@ Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8
|
||||
lights->numLights = numLights;
|
||||
|
||||
for (i = 0; i < numLights; i++) {
|
||||
#if ENABLE_F3DEX3
|
||||
lights->l.l[i].l.type = 0;
|
||||
#endif
|
||||
lights->l.l[i].l.col[0] = lights->l.l[i].l.colc[0] = r;
|
||||
lights->l.l[i].l.col[1] = lights->l.l[i].l.colc[1] = g;
|
||||
lights->l.l[i].l.col[2] = lights->l.l[i].l.colc[2] = b;
|
||||
|
||||
@@ -106,6 +106,8 @@ void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32
|
||||
l->l[1].l.dir[0] = FTOFRAC8(xUp);
|
||||
l->l[1].l.dir[1] = FTOFRAC8(yUp);
|
||||
l->l[1].l.dir[2] = FTOFRAC8(zUp);
|
||||
|
||||
#if !ENABLE_F3DEX3
|
||||
l->l[0].l.col[0] = 0x00;
|
||||
l->l[0].l.col[1] = 0x00;
|
||||
l->l[0].l.col[2] = 0x00;
|
||||
@@ -122,6 +124,7 @@ void guLookAtHiliteF(f32 mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32
|
||||
l->l[1].l.colc[1] = 0x80;
|
||||
l->l[1].l.colc[2] = 0x00;
|
||||
l->l[1].l.pad2 = 0x00;
|
||||
#endif
|
||||
|
||||
mf[0][0] = xRight;
|
||||
mf[1][0] = yRight;
|
||||
|
||||
@@ -33,6 +33,11 @@ void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) {
|
||||
GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 25);
|
||||
GfxPrint_Printf(printer, "[Build Option:%s]", gBuildMakeOption);
|
||||
|
||||
if (ENABLE_F3DEX3) {
|
||||
GfxPrint_SetPos(printer, WIDE_MULT(7, WIDE_GET_16_9), 27);
|
||||
GfxPrint_Printf(printer, "Powered by F3DEX3!");
|
||||
}
|
||||
|
||||
gfx = GfxPrint_Close(printer);
|
||||
GfxPrint_Destroy(printer);
|
||||
*gfxP = gfx;
|
||||
|
||||
Reference in New Issue
Block a user