Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 - Microcode overhaul #816

Open
wants to merge 78 commits into
base: develop/3.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2365d35
F3DZEX to object file
Jul 3, 2024
99ab140
Microcode selection to config_graphics.h
Jul 3, 2024
ac508b6
Remove build options display.
Jul 3, 2024
d708e61
Microcode massacre
Jul 3, 2024
9ae367b
Total HVQM death
Jul 3, 2024
bf86d4e
Remove S2DEX engine
Jul 3, 2024
2ad4031
Use enumatered F3DEX selector
Jul 3, 2024
ed382ea
ditto
Jul 3, 2024
c5979e0
Fix F3DEX build
Jul 3, 2024
1736a99
Remove hvqm remnants
Jul 3, 2024
dc100c2
fix mislabeled config safeguard entry
Jul 3, 2024
d682a8d
Rename L3DZEX2
Jul 3, 2024
7bfd7ed
Add preliminary F3DEX3 support
Jul 3, 2024
371878c
.
Jul 3, 2024
d9c1ad2
Simplify grucode pointers
Jul 3, 2024
e2038c2
Decringify i guess?
Jul 3, 2024
326f93e
Remove gs2dex includes
Jul 3, 2024
14195ae
.
Jul 3, 2024
e84c7d6
fixed newlines in cfg
Jul 3, 2024
731cd26
Fix lighting direction for F3DEX3
Jul 4, 2024
10cc802
Add WIP F3DEX3 performance profiler
Jul 4, 2024
22d5d09
wtf
Jul 4, 2024
9c6e4eb
Fix config issues
Jul 5, 2024
b2e8f8b
Move F3DEX3 CPU functionality to a dedicated file
Jul 5, 2024
e3d7871
Readme credit
Jul 5, 2024
aac5cc7
Use new profiler controls
Jul 9, 2024
8c2d9bd
Restore config
Jul 9, 2024
da6cea3
update ex3 version + fix lvp error
Nov 21, 2024
5c1fba0
F3DEX3 update (real)
Nov 21, 2024
c78af91
Fix area.c viewport
Jan 7, 2025
22bae3a
add buffer clear optimizations
Jan 7, 2025
cf9da2e
fix non ex3 viewport
Jan 7, 2025
8af3114
goddard fixes
Jan 7, 2025
ae47349
fix memset in game_init.c label
Jan 7, 2025
3dbca60
ending screen viewport fix
Jan 7, 2025
999d092
finish goddard for now
Jan 14, 2025
0e7eac0
Remove redundant check for lookat calculation
Jan 14, 2025
a6eb26e
Add gSPCameraWorld for ingame graphics
Jan 14, 2025
79382a4
Use G_LIGHTING_SPECULAR for reflective surfaces
Jan 14, 2025
0f86221
add define for ex3 memclear, more specular changes
Jan 15, 2025
b7f084b
Add disable instant input config
Jan 15, 2025
6a11806
cfb clear coverage reset
Jan 15, 2025
17a1dc7
workaround for memclear cfb oddity
Jan 15, 2025
097c55f
Add specular shading to DDD
Jan 15, 2025
a60c070
fix framebuffer garbage on goddard load
Jan 15, 2025
75af330
ditto
Jan 16, 2025
8139d63
ditto
Jan 16, 2025
f19b3ed
fix goddard renderer typo in cameraworld apply
Jan 16, 2025
7c6577b
cleanup lookat code
Jan 18, 2025
c429527
Merge pull request #3 from mountainflaw/testingg
mountainflaw Jan 18, 2025
34933c5
Merge branch 'develop/3.0.0' into ucode_to_cfg
mountainflaw Jan 18, 2025
20e2f0c
Update config.h
mountainflaw Jan 18, 2025
7a8ec2d
ttc speculars
Jan 18, 2025
8e04820
Add simple F3DEX3 lighting engine
Jan 22, 2025
09077f3
Sort linked list before render to render closest to mario point light…
Jan 22, 2025
6b0041b
fix lightnum bug
Jan 22, 2025
5181c0f
code cleanup
Jan 22, 2025
d9df6ec
fix ex2 build
Jan 22, 2025
12a8906
Update lighting engine info
Jan 22, 2025
668b4f7
Remove F3DEX support
Jan 22, 2025
c5970a3
use bcopy for struct data transfer in lighting engine
Jan 22, 2025
aad6fcc
delete debug stuff for lighting engine
Jan 22, 2025
86e91cc
Remove RSP memclear
Jan 22, 2025
da9f1f1
lighting engine: stop early with no lights
Jan 22, 2025
76ac54b
Add F3DEX3 lighting engine documentation
Jan 22, 2025
be4543d
Fix end credits
Jan 22, 2025
ae338f2
Merge pull request #4 from mountainflaw/testingg
mountainflaw Jan 22, 2025
64f1a13
remove actor specular
Jan 22, 2025
f3aef6c
level unspecularize
Jan 22, 2025
bde273d
Merge pull request #5 from mountainflaw/testingg
mountainflaw Jan 22, 2025
c4ef74b
despecularized segment2
Jan 22, 2025
b0be4c2
Merge pull request #6 from mountainflaw/testingg
mountainflaw Jan 22, 2025
700032a
restore config
Jan 23, 2025
72a709d
defuck spacing
Jan 23, 2025
e5cdea5
ditto
Jan 23, 2025
80421a2
game
Jan 23, 2025
3f15721
bring back the cringe
Jan 23, 2025
ba3cafb
cleanup goddard lookat
Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2142,8 +2142,6 @@ lib/libs2d_engine.a
!/lib/n64/*.a
!/lib/ique/*.a

!/lib/PR/hvqm/*.o

# .orig files
*.orig

Expand Down
54 changes: 2 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,42 +94,6 @@ DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE

TARGET := sm64


# GRUCODE - selects which RSP microcode to use.
# 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
GRUCODE ?= f3dzex
$(eval $(call validate-option,GRUCODE,f3dex f3dex2 f3dex2pl f3dzex super3d l3dex2))

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)
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
endif

# TEXT ENGINES
# s2dex_text_engine - Text Engine by someone2639
TEXT_ENGINE := none
$(eval $(call validate-option,TEXT_ENGINE,none s2dex_text_engine))

ifeq ($(TEXT_ENGINE), s2dex_text_engine)
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
SRC_DIRS += src/s2d_engine
endif
# add more text engines here

#==============================================================================#
# Optimization flags #
#==============================================================================#
Expand Down Expand Up @@ -243,15 +207,6 @@ else
DEFINES += _FINALROM=1 NDEBUG=1 OVERWRITE_OSPRINT=0
endif

# HVQM - whether to use HVQM fmv library
# 1 - includes code in ROM
# 0 - does not
HVQM ?= 0
$(eval $(call validate-option,HVQM,0 1))
ifeq ($(HVQM),1)
DEFINES += HVQM=1
SRC_DIRS += src/hvqm
endif

# LIBPL - whether to include libpl library for interfacing with Parallel Launcher
# (library will be pulled into repo after building with this enabled for the first time)
Expand Down Expand Up @@ -418,7 +373,6 @@ O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(CPP_FILES),$(BUILD_DIR)/$(file:.cpp=.o)) \
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
$(foreach file,$(GENERATED_C_FILES),$(file:.c=.o)) \
lib/PR/hvqm/hvqm2sp1.o lib/PR/hvqm/hvqm2sp2.o

LIBZ_O_FILES := $(foreach file,$(LIBZ_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
Expand Down Expand Up @@ -447,7 +401,7 @@ else
$(error Unable to detect a suitable MIPS toolchain installed)
endif

LIBRARIES := nustd hvqm2 z goddard
LIBRARIES := nustd z goddard

LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))

Expand Down Expand Up @@ -490,7 +444,7 @@ ifeq ($(TARGET_N64),1)
CC_CFLAGS := -fno-builtin
endif

INCLUDE_DIRS += include $(BUILD_DIR) $(BUILD_DIR)/include src . include/hvqm
INCLUDE_DIRS += include $(BUILD_DIR) $(BUILD_DIR)/include src .
ifeq ($(TARGET_N64),1)
INCLUDE_DIRS += include/libc
endif
Expand Down Expand Up @@ -585,10 +539,6 @@ endef
all: $(ROM)
@$(SHA1SUM) $(ROM)
@$(PRINT) "${BLINK}Build succeeded.\n$(NO_COL)"
@$(PRINT) "==== Build Options ====$(NO_COL)\n"
@$(PRINT) "${GREEN}Version: $(BLUE)$(VERSION)$(NO_COL)\n"
@$(PRINT) "${GREEN}Microcode: $(BLUE)$(GRUCODE)$(NO_COL)\n"
@$(PRINT) "${GREEN}Console: $(BLUE)$(CONSOLE)$(NO_COL)\n"

clean:
$(RM) -r $(BUILD_DIR_BASE)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
This does mean that any framebuffer effects will have to be done on buffer 0 if targeting emulators
- Automatic console and emulator detection: Use the `gEmulator` variable to wrap your code in an emulator check.
- Separate defines for emulator and console black border height.
- Getting HVQM FMV support to work with the game is WIP.

Requirements are the same as regular SM64, however a GCC MIPS cross compiler is also required. If you're on Debian-like Linux, you can use the ``gcc-mips-linux-gnu`` package. The toolchain that comes with my SDK is also supported.

Expand Down
5 changes: 0 additions & 5 deletions actors/group0.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,3 @@
#include "white_particle_small/model.inc.c"

#include "sparkle_animation/model.inc.c"

#ifdef S2DEX_TEXT_ENGINE
#include "src/s2d_engine/s2d_config.h"
#include FONT_C_FILE
#endif
7 changes: 0 additions & 7 deletions data/capcom.s

This file was deleted.

1 change: 0 additions & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
#include "config/config_objects.h"
#include "config/config_rom.h"


/* WARNING: Compatibility safeguards - don't remove this file unless you know what you're doing */
#include "config/config_safeguards.h"
19 changes: 19 additions & 0 deletions include/config/config_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,22 @@
* Only use this if you can test the difference of your hack with and without this change on console.
*/
// #define USE_FRUSTRATIO2

/**
* Primary graphics microcode selection
* Define F3DEX_VERSION as one of the following to select the primary graphics microcode:
* 1 - F3DEX - Worse console performance for improved Z-buffer precision.
* 2 - F3DZEX2 - (Majora's Mask version). HLE emulator compatible, good console performance.
* 3 - F3DEX3 - Created by Sauraen. Better console performance in most situations.
* 4 - F3DEX3 LVP (legacy vertex pipeline) - F3DEX3 with legacy vertex pipeline.
* Lowers RSP processing time at the cost of new features.
* Read F3DEX3 README for more information.
*/

#define F3DEX_VERSION 2

/**
* Enables usage of the line microcode. It can be loaded with gSPLoadUcode within a display list.
*/

// #define ENABLE_LINE_UCODE
25 changes: 25 additions & 0 deletions include/config/config_safeguards.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,28 @@
#undef BORDER_HEIGHT_EMULATOR
#define BORDER_HEIGHT_EMULATOR 0
#endif // !TARGET_N64

/*****************
* config_graphics.h
*/

#ifdef F3DEX_VERSION
#if F3DEX_VERSION == 1
#define F3DEX_GBI
#elif F3DEX_VERSION == 2
#define F3DEX_GBI_2
#elif F3DEX_VERSION == 3 || F3DEX_VERSION == 4
#define F3DEX_GBI_3
#else
#error "Invalid microcode selection. Valid options are 1-4 inclusive."
#endif
#else
#error "F3DEX_VERSION is not defined in config/config_graphics.h"
#endif

#ifdef ENABLE_LINE_UCODE
#if F3DEX_VERSION > 2
#undef ENABLE_LINE_UCODE
#warning "F3DEX3 does not support ENABLE_LINE_UCODE, so it will be disabled."
#endif
#endif
122 changes: 0 additions & 122 deletions include/hvqm/HVQM2File.h

This file was deleted.

22 changes: 0 additions & 22 deletions include/hvqm/HVQmd.h

This file was deleted.

33 changes: 0 additions & 33 deletions include/hvqm/adpcmdec.h

This file was deleted.

Loading