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

New crash screen #725

Draft
wants to merge 615 commits into
base: develop/3.0.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
615 commits
Select commit Hold shift + click to select a range
d88e073
Press L+R to open page select popup
Arceveti Mar 8, 2024
2bde0a3
Add libpl version detection to about page + small changes
Arceveti Mar 8, 2024
1958736
Fix libpl build
Arceveti Mar 8, 2024
29eac8e
Add libpl header include in page_about.c
Arceveti Mar 9, 2024
2cdce77
Improve about page
Arceveti Mar 9, 2024
4ef30f9
Fix libpl version entry
Arceveti Mar 9, 2024
6ae62c5
Skip libpl entries on about page if libpl is not supported
Arceveti Mar 9, 2024
51d1571
Add variables
Arceveti Mar 9, 2024
9385a5b
Add a few libpl entries to about page + scrollable about page
Arceveti Mar 9, 2024
80a2146
extended extended bounds entries + gfx pool + goddard
Arceveti Mar 9, 2024
7a4ba53
Make entire about page scrollable
Arceveti Mar 9, 2024
d3053bf
Fix build with UNF + update BITFLAG_BOOL comment
Arceveti Mar 9, 2024
6ae514b
Fix some about page issues
Arceveti Mar 10, 2024
18dfc30
More about page changes
Arceveti Mar 10, 2024
c55f97e
Improve register handling
Arceveti Mar 11, 2024
f43a2f5
More registers improvements
Arceveti Mar 11, 2024
291ae6c
Add control description for page select menu
Arceveti Mar 11, 2024
a22945a
Shrink page select + popup outlines
Arceveti Mar 11, 2024
408344c
Add libdragon crash description heuristics + fix asserts/fpcsr on hom…
Arceveti Mar 11, 2024
745531b
Remove unused field in register struct
Arceveti Mar 11, 2024
9409607
Move popups to folder
Arceveti Mar 11, 2024
3c7f84d
util folder
Arceveti Mar 11, 2024
e305485
More about page entries
Arceveti Mar 11, 2024
9c95b35
Improve FPE error handling + fix float register handling + improve fl…
Arceveti Mar 11, 2024
d8e71ff
Rename enum 'FloatError' to 'FloatErrorType'
Arceveti Mar 11, 2024
d0455b3
Various changes, mostly just refactors
Arceveti Mar 12, 2024
fea5499
Don't print output registers on home screen
Arceveti Mar 12, 2024
d853b0f
Fix some settings
Arceveti Mar 12, 2024
f36a0d5
Add option to include non-RDRAM symbols in mapPacker.py + add map sym…
Arceveti Mar 12, 2024
f72a46b
About page rewrite
Arceveti Mar 13, 2024
c50a8b6
Fix about page UNF print + make scrollbars clearer + formatting
Arceveti Mar 13, 2024
92fa246
Fix last row of registers not printing + small changes
Arceveti Mar 13, 2024
2164f33
Don't print duplicate registers on home page + add output indices for…
Arceveti Mar 13, 2024
1d856d0
Name hex strings in _Litob.c
Arceveti Mar 13, 2024
1d209d4
cs_print_f32 improvement
Arceveti Mar 13, 2024
a247e82
Use osSyncPrintf for UNF prints
Arceveti Mar 13, 2024
bfe447d
Separate float register format detection from coprocessor number
Arceveti Mar 14, 2024
1993ee4
Adjust pc for delay slot
Arceveti Mar 14, 2024
080b107
Show thread number and name on registers page
Arceveti Mar 14, 2024
f5b5ab7
UNF intellisense + include libpl + small formatting change
Arceveti Mar 14, 2024
b8e90ee
Add goddard size to about page
Arceveti Mar 14, 2024
e72833d
More about page improvements + crash_descriptions.c reordering
Arceveti Mar 14, 2024
3548308
Move goddard entry position in about page
Arceveti Mar 14, 2024
4a3f153
Add asterisk to settings group header if one of its entries is change…
Arceveti Mar 15, 2024
3adb40e
Add recent pages to lists
Arceveti Mar 15, 2024
36ab9f4
About page list gfx pool as number of commands instead of hex
Arceveti Mar 15, 2024
04cc7a8
Fix about page long long info buffers not appearing on subsequent cra…
Arceveti Mar 15, 2024
a4c6dfe
Settings persist on subsequent crashes
Arceveti Mar 15, 2024
f92f00f
A+B+START to attempt to revive crashed page
Arceveti Mar 15, 2024
4d2f3ba
Add setting for address select preview symbol + fix memory page name …
Arceveti Mar 15, 2024
7fcc7fc
Don't close popup on page revive + some null checks
Arceveti Mar 15, 2024
6ced7d9
Fix wrong/duplicate registers on registers page + add cs_print_symbol…
Arceveti Mar 15, 2024
06fcf3e
Don't open controls popup when reviving a page
Arceveti Mar 15, 2024
f64216a
Fix crash screen crashes not having thread descriptions
Arceveti Mar 15, 2024
05a60ae
Improve some setting names
Arceveti Mar 15, 2024
ad14c80
Add memory region names + read doubleword aligned function
Arceveti Mar 15, 2024
ba956c8
Add gInspectThread + add UNF thread IDs
Arceveti Mar 16, 2024
332eeb9
Determine thread 0 thread names by priority
Arceveti Mar 16, 2024
0a79b28
Fix typo + add get thread state and flags str funcs + fix page select…
Arceveti Mar 16, 2024
73afcaf
enum ThreadID documentation
Arceveti Mar 16, 2024
4edf643
Add threads page
Arceveti Mar 17, 2024
eb75175
Use osMemSize for ram size in about page + auto buffer size
Arceveti Mar 17, 2024
6c160d1
Change page ordering + improe CSPage enum
Arceveti Mar 17, 2024
5852058
Streamline settings groups
Arceveti Mar 17, 2024
731e7ed
Allow changing the crash screen's inspected thread + page ordering
Arceveti Mar 17, 2024
dd641c5
Reegisters page fixes + add DIV_CEIL
Arceveti Mar 17, 2024
8b7cd1e
Fix some struct/union definition formats
Arceveti Mar 17, 2024
e84457b
Add selection cursor and register inspection to registers page (unfin…
Arceveti Mar 18, 2024
c7d2e35
Fix UNF thread IDs in enum + improve some comments
Arceveti Mar 19, 2024
f07b721
Move cs_reinitialize_pagesto crash_pages
Arceveti Mar 19, 2024
79480b0
some float and registers stuff
Arceveti Mar 19, 2024
68e4593
Registers page horizontal wrapping
Arceveti Mar 19, 2024
1113995
Add console processor id to about page
Arceveti Mar 19, 2024
932f5f1
VERSION.txt for crash screen
Arceveti Mar 19, 2024
1b9fd89
Status and FPCSR decode bits with reginspect
Arceveti Mar 19, 2024
b3e0116
rename home page to summary and popup_register to popup_reginspect
Arceveti Mar 19, 2024
b8e4995
Add cause register to registers page
Arceveti Mar 19, 2024
c9572d4
Show data at pointers in reginspect
Arceveti Mar 19, 2024
4ebcfbc
improve two descriptions
Arceveti Mar 19, 2024
76e8810
Add binary search for map symbols + add translucent divider between s…
Arceveti Mar 20, 2024
31caf7b
Jump to pointer location from reginspect
Arceveti Mar 20, 2024
2242953
color for unknown disasm rows + name unknown thread
Arceveti Mar 20, 2024
4d91482
move rgba16_blend to crash_draw
Arceveti Mar 20, 2024
383b1bc
Some stuff
Arceveti Mar 20, 2024
eb8fb7b
Use binary symbol search for disasm branch arrows
Arceveti Mar 20, 2024
2f0a5b4
Output map data rom sizes to debug_map.txt (like goddard.txt)
Arceveti Mar 20, 2024
aa79f92
Change "crash_" file prefix to "cs_"
Arceveti Mar 20, 2024
5893723
Print code fields in disasm for exception causing instructions
Arceveti Mar 20, 2024
98c0f9f
Add hex prefix to disasm code fields
Arceveti Mar 21, 2024
97ffebd
Add support for odd numbered float registers (f64 can generate code t…
Arceveti Mar 21, 2024
d3d1231
more various stuff
Arceveti Mar 21, 2024
c25267c
Don't store branch arrow colors in buffer + increase buffer size
Arceveti Mar 21, 2024
181a1e9
Optimizations to reduce branch arrow buffer size
Arceveti Mar 21, 2024
6390757
Move thread entry draw to cs_draw and use on regs page + add commente…
Arceveti Mar 21, 2024
cce0b0b
Change in makefile (was unstaged)
Arceveti Mar 21, 2024
01abdac
Rename 'popup_address_select' files to 'popup_address' + add page nam…
Arceveti Mar 21, 2024
dde8d55
some stuff
Arceveti Mar 21, 2024
dfcb3aa
Move threads to dropdown on registers page + add stuff to readme + lo…
Arceveti Mar 22, 2024
8bb90e6
Remove remaining threads page stuff
Arceveti Mar 22, 2024
7dc1579
Fix "debug_assert" UNF conflict (renamed the UNF version)
Arceveti Mar 23, 2024
3a3a28c
Thread name fallback on map symbol name
Arceveti Mar 23, 2024
e5c3b2a
Update readme + some comments
Arceveti Mar 23, 2024
5a4be03
cs_main refactoring
Arceveti Mar 24, 2024
3f11385
Add option for symbol name headers in disasm
Arceveti Mar 24, 2024
63a0f63
Fix thread queue looping after second crash screen crash
Arceveti Mar 24, 2024
a12c875
Update readme
Arceveti Mar 24, 2024
8f4e601
Fix print_as_binary + print binary data on II exception + fix map pag…
Arceveti Mar 25, 2024
08801aa
cs_draw_triangle optimization
Arceveti Mar 25, 2024
b4984fa
Summary page layout + some refactoring
Arceveti Mar 25, 2024
baf031c
Fix floats being incorrect in hex mode on registers page
Arceveti Mar 25, 2024
db35404
Add special registers + RCP crash handling + various refactoring
Arceveti Mar 27, 2024
88a8a7e
Fix capital "N" in font
Arceveti Mar 28, 2024
77e10fb
Redesign summary page again + refactoring
Arceveti Mar 28, 2024
4ca081b
Revert assert message color
Arceveti Mar 28, 2024
86bee5a
summary page stuff
Arceveti Mar 28, 2024
7b9151a
even more summary page stuff
Arceveti Mar 29, 2024
3323732
Add binary and color display modes to memory page
Arceveti Mar 29, 2024
8e21df1
Better print buffers + move RCP assert info to the asserts in main.h
Arceveti Mar 30, 2024
e5d9a29
Fix missing includes for asserts
Arceveti Mar 30, 2024
0013305
Update some comments + remove a redundant fname check.
Arceveti Mar 30, 2024
8acb8a8
Make a couple asserts clearer
Arceveti Mar 31, 2024
82ac27f
Add get_segment_name
Arceveti Mar 31, 2024
20f049e
Add assert for missing source warp node
Arceveti Mar 31, 2024
7458d40
Fix typo
Arceveti Mar 31, 2024
9dd84ce
Add symbol dividers to memory page + improve on disasm page
Arceveti Apr 2, 2024
8aa47f4
Improve fallback memory strings
Arceveti Apr 3, 2024
64a61b1
Improve memory page dividers + pointer jumps
Arceveti Apr 3, 2024
2f93208
Various refactors
Arceveti Apr 5, 2024
4feb3e4
float format info for lwc1/ldc1/swc1/sdc1
Arceveti Apr 5, 2024
d18d057
More refactoring + PRIds
Arceveti Apr 6, 2024
482dedb
Improve reginspect
Arceveti Apr 6, 2024
1137ae5
Rename "MAP VIEW" to "MAP SYMBOLS"
Arceveti Apr 7, 2024
0530f1d
Improve some debug map ifdefs
Arceveti Apr 7, 2024
99bc22f
Improve printing of unknown map symbol sizes
Arceveti Apr 7, 2024
889c385
Put crash screen in its own rom segment and add sSegmentSizes
Arceveti Apr 7, 2024
4b438e6
Add sSegmentROMTable without breaking Fast64 exporting + strings for …
Arceveti Apr 7, 2024
ff484b9
Clean up some segment stuff
Arceveti Apr 8, 2024
4578af8
Fix build warning
Arceveti Apr 8, 2024
9bd6091
Add segments page
Arceveti Apr 8, 2024
c4495e0
Reginspect print both 32 and 64 bit values
Arceveti Apr 10, 2024
f887a16
Improve asserts + reginspect bool strings
Arceveti Apr 10, 2024
ff87e48
Fix unsafe data read when searching for branch offsets.
Arceveti Apr 11, 2024
541486f
Combine cs_draw_rect/cs_draw_dark_rect/cs_draw_outline + optimize rec…
Arceveti Apr 11, 2024
ab76c58
Use faster darken drawing in all draw funcs
Arceveti Apr 11, 2024
2985bd7
Fix denorm/NaN text color on reginspect
Arceveti Apr 11, 2024
fc05a45
Fix typo in symbol_is_function
Arceveti Apr 12, 2024
4c7d142
Add asserts for some common crashes + specific "level" and "rcp" asse…
Arceveti Apr 12, 2024
aa05f32
fix typo
Arceveti Apr 15, 2024
025758b
Improve segment symbols
Arceveti Apr 15, 2024
cc36e58
Add CLZ/CTZ/POPCOUNT macros
Arceveti Apr 17, 2024
dd46bb3
Fix safe memoey read for physical addresses
Arceveti Apr 17, 2024
d3527d3
Improve reginspect
Arceveti Apr 17, 2024
5e478e9
Update asm.h
Arceveti Apr 17, 2024
656de5a
Add interface registers page
Arceveti Apr 17, 2024
f1a5e0c
Hi Arthur
Arceveti Apr 17, 2024
6f00f3d
Use __func__ to get current function name for asserts instead of usin…
Arceveti Apr 17, 2024
4227fd6
Add c standard version to compiler section on about page
Arceveti Apr 17, 2024
5cd024e
Fix RDB description
Arceveti Apr 18, 2024
33b4025
Include assert.h in macros.h
Arceveti Apr 19, 2024
f529732
Actually fix safe memory reads
Arceveti Apr 19, 2024
1f7d4df
Print badvaddr to summary page for TLB or address exceptions
Arceveti Apr 19, 2024
0e46aaf
Allow moving cursor while reginspect is open + improve register page …
Arceveti Apr 19, 2024
1b89b37
Print badvaddr on EXC_MOD
Arceveti Apr 19, 2024
32e9216
Add to builtins.h + custom message if running code in non-code segment
Arceveti Apr 21, 2024
1a06461
Registers rewrite
Arceveti Apr 21, 2024
64d31e2
Various cleanup
Arceveti Apr 21, 2024
41591bc
Clean up reginspect decoded bits printing
Arceveti Apr 21, 2024
d7e87ea
Small changes
Arceveti Apr 21, 2024
36bd5b3
Add build.c + add commit hash to build info + small changes
Arceveti Apr 21, 2024
508ab49
Rename 'TO_STRING' and 'TO_STRING2' to 'STRINGIFY' and 'EXPAND_AND_ST…
Arceveti Apr 21, 2024
9f21629
Improve viewable/scrollable memory boundary defines
Arceveti Apr 22, 2024
29c12a8
Fix symbol dividers crash + make the setting work + allow scrolling i…
Arceveti Apr 22, 2024
30ab8cc
MapSymbolIndex typedef + fix build warnings
Arceveti Apr 22, 2024
3159654
Reginspect for interface registers
Arceveti Apr 22, 2024
ac1641e
Cleaner microcode name define
Arceveti Apr 22, 2024
23f67fd
Add f3dex3 check to about page
Arceveti Apr 23, 2024
9b4da37
Some reginspect bit decoding
Arceveti Apr 23, 2024
b9e2349
Rename reg bits commands + fix typos
Arceveti Apr 23, 2024
f7e315f
Fix register data .inc.c includes
Arceveti Apr 23, 2024
55b1f5b
sRegDesc_Default extern
Arceveti Apr 23, 2024
1e8b6f5
Add cs_draw_custom_5x5_glyph (unused for now)
Arceveti Apr 23, 2024
2b5050f
add 'checkThread' arg to get_reg_val
Arceveti Apr 23, 2024
a5713ca
Rename 'registers' folder to 'register_data'
Arceveti Apr 23, 2024
6daa911
CP2.inc.c and CP3.inc.c consistency
Arceveti Apr 23, 2024
386064e
Move reg bit defines from reginspect to reg_bits.h
Arceveti Apr 23, 2024
49186ef
Some C0 register bit mask defines
Arceveti Apr 23, 2024
dfd6a4c
Fix build
Arceveti Apr 23, 2024
3e24de5
C0 config reginspect decoded bits + sureAddr in reg info
Arceveti Apr 24, 2024
dd30315
Add mention of L/R to switch page in the summary page instruction text
Arceveti Apr 24, 2024
d57901d
Draw registers page sections from list + get_reg_val null checks
Arceveti Apr 24, 2024
4101f49
Fix macro/define name in assert conditions + mark code after asserts …
Arceveti Apr 24, 2024
3da6bca
Improve reginspect pointer detection
Arceveti Apr 24, 2024
93b6531
Merge branch 'develop/2.3.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Apr 25, 2024
2a59b3f
Move instruction data to insn_db.inc.c
Arceveti Apr 25, 2024
c4bdda3
Improve register order on registers page + improve description printi…
Arceveti Apr 25, 2024
11229d7
Move reginspect bit decode data to reginspect_bits.inc.c + clean up r…
Arceveti Apr 25, 2024
e775e71
Stack trace cleanup + Add HI_OF_/LO_OF_ macros
Arceveti Apr 26, 2024
2abd2b5
Clean up some debug map ifdefs
Arceveti Apr 26, 2024
e6c3e71
Add symbols mode to memory view
Arceveti Apr 26, 2024
d37ac91
Smooth text scrolling
Arceveti Apr 26, 2024
eac8af8
Print an additional character of symbols on memory page + osWriteback…
Arceveti Apr 26, 2024
e05be1a
More space for symbols on thread registers page
Arceveti Apr 26, 2024
6e7e79b
Update readme + reduce stack trace buffer size
Arceveti Apr 29, 2024
c734dbb
Reduce size of disasm instruction database by half
Arceveti Apr 29, 2024
f106513
show start and size instead of range on segments page
Arceveti Apr 29, 2024
dec76ac
Move warp node asserts + add assert for null music dynamics + update …
Arceveti Apr 29, 2024
7cca77e
Only calculate text scroll speed once
Arceveti Apr 29, 2024
d060bc7
Draw footer on crashed page + some null checks
Arceveti Apr 29, 2024
0dd5439
Clean up segment_symbols.h
Arceveti Apr 29, 2024
6ae348e
Add hardcoded segments to segments page + move segment data to new files
Arceveti Apr 30, 2024
2ed4517
enum typedef consistency
Arceveti Apr 30, 2024
676e4ec
Add new UNF rdb thread id
Arceveti Apr 30, 2024
e101238
insn_db fixes
Arceveti Apr 30, 2024
45a74a3
Move attributes to attributes.h
Arceveti May 1, 2024
12dec74
Better disasm branch arrow fill buffer trigger
Arceveti May 1, 2024
74006f7
Memory page f32 mode (aligned)
Arceveti May 2, 2024
7e11ab7
Check if valid ram addr in memory page symbols mode
Arceveti May 5, 2024
3696dc8
Add LLBit register info
Arceveti May 5, 2024
d111ee8
Use local variable for LLBit check
Arceveti May 5, 2024
42f6a73
Handle watchpoint exceptions
Arceveti May 5, 2024
3483ca1
Highlight sp and badvaddr on memory page
Arceveti May 6, 2024
f59c343
Move register info defines to the files they're used in
Arceveti May 6, 2024
ca31ea4
Add count factor and adjust some timings accordingly
Arceveti May 6, 2024
6ee3659
thread pri 0 while waiting but pri appmax-1 after crash + mapPacker.p…
Arceveti May 7, 2024
33aef53
Better count factor timing adjustment
Arceveti May 7, 2024
e0820c4
disasm improvements
Arceveti May 7, 2024
71c9293
Even better count factor timing adjustment
Arceveti May 8, 2024
6f779c1
Add option to try to parse non-.text data as instructions
Arceveti May 8, 2024
71c999b
Move disasm reg buffer to disasm file
Arceveti May 9, 2024
cebdb3e
Print extra registers on summary for certain instructions
Arceveti May 9, 2024
3a5b950
Merge branch 'develop/2.3.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti May 9, 2024
056706c
Only use 2 framebuffers + some small fixes
Arceveti May 10, 2024
74771e6
Disasm pseudo C code mode
Arceveti May 10, 2024
a6b4c33
Fix disasm pseudo C flickering by forcing 30 FPS (?)
Arceveti May 11, 2024
583b2ce
Pseudo C code improvements
Arceveti May 12, 2024
deeed7e
Improve pseudo C comments
Arceveti May 12, 2024
e7417af
Add subiu and dsubiu pseudoinstructions
Arceveti May 12, 2024
74888ea
Fix trap instruction param in pseudo C
Arceveti May 12, 2024
0682d4f
Cache op names + other stuff
Arceveti May 15, 2024
caf253e
Stack trace rewrite (now actually works properly)
Arceveti May 17, 2024
26eb1b8
Small changes
Arceveti May 17, 2024
295d61b
Update stack trace page + other fixes
Arceveti May 22, 2024
95d80a5
Better double buffering (fixes Parallel screenshot flickering)
Arceveti May 22, 2024
790fcda
Add "unreachable" after FORCE_CRASH()
Arceveti May 22, 2024
1f156d9
reginspect stuff
Arceveti May 24, 2024
f7ff1b8
Turn off VI special features on crash (saves 1-2ms on console and fix…
Arceveti May 31, 2024
8d2f083
Add all builtins to builtins.h
Arceveti Jun 3, 2024
947c078
Add static asserts for struct/union sizes
Arceveti Jun 3, 2024
f1bc0f6
disasm/pseudoC updates
Arceveti Jun 3, 2024
2a1d69e
Merge branch 'develop/3.0.0' of https://github.com/HackerN64/HackerSM…
arthurtilly Sep 9, 2024
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,6 @@ textures/cave/hmc_textures.0A000.rgba16.png
textures/cave/hmc_textures.0A800.rgba16.png
textures/cave/hmc_textures.0B800.ia16.png
textures/cave/hmc_textures.0C000.ia16.png
textures/crash_screen/crash_screen_font.ia1.png
textures/effect/bubble.06048.rgba16.png
textures/effect/flower.00008.rgba16.png
textures/effect/flower.00808.rgba16.png
Expand Down
3 changes: 2 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"F3DEX_GBI_2=1",
"F3DZEX_NON_GBI_2=1",
"F3DEX_GBI_SHARED=1",
"LIBPL=1"
"LIBPL=1",
"UNF=1"
],
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
"cStandard": "gnu17",
Expand Down
47 changes: 32 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,10 @@ else ifeq ($(VERSION),sh)
DEFINES += VERSION_SH=1
endif


# FIXLIGHTS - converts light objects to light color commands for assets, needed for vanilla-style lighting
FIXLIGHTS ?= 1

DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE

TARGET := sm64


# GRUCODE - selects which RSP microcode to use.
# f3dex -
Expand Down Expand Up @@ -192,7 +189,7 @@ GCC_GRAPH_NODE_OPT_FLAGS = \

ifeq ($(COMPILER),gcc)
MIPSISET := -mips3
OPT_FLAGS := $(GCC_MAIN_OPT_FLAGS)
OPT_FLAGS := $(GCC_MAIN_OPT_FLAGS)
COLLISION_OPT_FLAGS = $(GCC_COLLISION_OPT_FLAGS)
MATH_UTIL_OPT_FLAGS = $(GCC_MATH_UTIL_OPT_FLAGS)
GRAPH_NODE_OPT_FLAGS = $(GCC_GRAPH_NODE_OPT_FLAGS)
Expand Down Expand Up @@ -257,7 +254,7 @@ endif
# (library will be pulled into repo after building with this enabled for the first time)
# 1 - includes code in ROM
# 0 - does not
LIBPL ?= 0
LIBPL ?= 1
LIBPL_DIR := lib/libpl
$(eval $(call validate-option,LIBPL,0 1))
ifeq ($(LIBPL),1)
Expand Down Expand Up @@ -382,7 +379,7 @@ ACTOR_DIR := actors
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))

# Directories containing source files
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers src/images src/crash_screen src/crash_screen/pages src/crash_screen/popups src/crash_screen/util actors levels bin data assets asm lib sound
LIBZ_SRC_DIRS := src/libz
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
BIN_DIRS := bin bin/$(VERSION)
Expand Down Expand Up @@ -429,6 +426,21 @@ GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
# Automatic dependency files
DEP_FILES := $(O_FILES:.o=.d) $(LIBZ_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d

#==============================================================================#
# Git Options #
#==============================================================================#

# Set PACKAGE_VERSION define for printing commit hash
ifeq ($(origin PACKAGE_VERSION), undefined)
PACKAGE_VERSION := $(shell git log -1 --pretty=%h | tr -d '\n')
ifeq ('$(PACKAGE_VERSION)', '')
PACKAGE_VERSION = Unknown version
endif
endif

# Make sure the build reports the correct version
$(shell touch src/boot/build.c)

#==============================================================================#
# Compiler Options #
#==============================================================================#
Expand Down Expand Up @@ -522,6 +534,13 @@ RSPASMFLAGS := $(foreach d,$(DEFINES),-definelabel $(subst =, ,$(d)))
# C preprocessor flags
CPPFLAGS := -P -Wno-trigraphs $(DEF_INC_CFLAGS)

DEBUG_INFO_DEFINES := -DSAVETYPE='$(SAVETYPE)' -DREGION='$(VERSION)' -DGRUCODE='$(GRUCODE)' -DCOMPRESSION_FORMAT='$(COMPRESS)' -DPACKAGE_VERSION='$(PACKAGE_VERSION)'

CFLAGS += $(DEBUG_INFO_DEFINES)
CPPFLAGS += $(DEBUG_INFO_DEFINES)

# SAVETYPE VERSION GRUCODE

#==============================================================================#
# Miscellaneous Tools #
#==============================================================================#
Expand Down Expand Up @@ -639,7 +658,7 @@ patch: $(ROM)

# Extra object file dependencies
$(BUILD_DIR)/asm/ipl3.o: $(IPL3_RAW_FILES)
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/crash_screen/cs_draw.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/game/version.o: $(BUILD_DIR)/src/game/version_data.h
$(BUILD_DIR)/lib/aspMain.o: $(BUILD_DIR)/rsp/audio.bin
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(SOUND_BIN_DIR)/sequences.bin $(SOUND_BIN_DIR)/bank_sets
Expand All @@ -649,8 +668,6 @@ ifeq ($(VERSION),sh)
$(BUILD_DIR)/src/audio/load_sh.o: $(SOUND_BIN_DIR)/bank_sets.inc.c $(SOUND_BIN_DIR)/sequences_header.inc.c $(SOUND_BIN_DIR)/ctl_header.inc.c $(SOUND_BIN_DIR)/tbl_header.inc.c
endif

$(CRASH_TEXTURE_C_FILES): TEXTURE_ENCODING := u32

ifeq ($(COMPILER),gcc)
$(BUILD_DIR)/src/libz/%.o: OPT_FLAGS := -Os
$(BUILD_DIR)/src/libz/%.o: CFLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-pointer-sign
Expand Down Expand Up @@ -847,7 +864,7 @@ $(BUILD_DIR)/rsp/%.bin $(BUILD_DIR)/rsp/%_data.bin: rsp/%.s
# Run linker script through the C preprocessor
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(BUILD_DIR)/goddard.txt
$(call print,Preprocessing linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF [email protected] -o $@ $<
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF [email protected] -o $@ $<

# Link libgoddard
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
Expand All @@ -860,7 +877,7 @@ $(BUILD_DIR)/libz.a: $(LIBZ_O_FILES)
$(V)$(AR) rcs -o $@ $(LIBZ_O_FILES)

# SS2: Goddard rules to get size
$(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a
$(BUILD_DIR)/sm64_prelim.ld: $(LD_SCRIPT) $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a
$(call print,Preprocessing preliminary linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF [email protected] -o $@ $<

Expand All @@ -874,13 +891,13 @@ $(BUILD_DIR)/goddard.txt: $(BUILD_DIR)/sm64_prelim.elf

$(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
$(call print,Assembling:,$<,$@)
$(V)python3 tools/mapPacker.py $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/bin/addr.bin $(BUILD_DIR)/bin/name.bin
$(V)python3 tools/mapPacker.py $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/bin/addr.bin $(BUILD_DIR)/bin/name.bin $(BUILD_DIR)/debug_map.txt
$(V)$(CROSS)gcc -c $(ASMFLAGS) $(foreach i,$(INCLUDE_DIRS),-Wa,-I$(i)) -x assembler-with-cpp -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<

# Link SM64 ELF file
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libz.a $(BUILD_DIR)/libgoddard.a
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -T debug_map.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc

# Build ROM
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
Expand All @@ -902,7 +919,7 @@ else ifeq ($(CONSOLE),bb)
endif
$(V)$(N64CKSUM) $@

$(BUILD_DIR)/$(TARGET).objdump: $(ELF)
$(BUILD_DIR)/$(TARGET_STRING).objdump: $(ELF)
$(OBJDUMP) -D $< > $@

.PHONY: all clean distclean default test load rebuildtools
Expand Down
4 changes: 2 additions & 2 deletions Makefile.split
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ $(BUILD_DIR)/bin/%_skybox.elf: SEGMENT_ADDRESS := 0x0A000000
# --------------------------------------

# intro and ipl3 textures are not compressed
INTRO_RAW_FILES := $(wildcard $(TEXTURE_DIR)/intro_raw/*.png)
INTRO_RAW_FILES := $(wildcard $(TEXTURE_DIR)/intro_raw/*.png)
$(BUILD_DIR)/src/goddard/renderer.o: $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(INTRO_RAW_FILES)))

IPL3_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/ipl3_raw/*.png)
IPL3_RAW_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%,$(IPL3_TEXTURE_FILES)))

CRASH_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/crash_custom/*.png)
CRASH_TEXTURE_FILES := $(wildcard $(TEXTURE_DIR)/crash_screen/*.png)
CRASH_TEXTURE_C_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(CRASH_TEXTURE_FILES)))
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- **Fazana**: PuppyLib, ucode swapping, audio load time optimisations (with Arctic), general hacker qol improvements, visual debug
- **Reonu**: Starting the project + widescreen, reonucam, various defines for hacker QoL, and a custom Spanish (Spain) translation of the game.
- **JoshDuMan**: Decomp guy, general assistance
- **Arceveti**: Silhouette, shadow optimisation, better hanging, breath meter, 4 controller support
- **Arceveti**: Naming unknown symbols, new crash screen, silhouette, shadow optimizations, breath meter, 4 controller support, implementations of rounded corners, slope fix, exposed ceiling fix, other bugfixes
- **axollyon**: Console testing, bugfixes, idea-guying, and had a hand in silhouettes
- **Wiseguy**: World scale reimplementation, silhouette, graph node optimisations, instant input patch, cake screen fix, segmented code support, and various optimizations/fixes
- **Kaze**: Graph node optimisations, automatic optimal collision distance
Expand Down
10 changes: 2 additions & 8 deletions asm/debug/map.s
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
.include "macros.inc"
.section .data
.balign 16
glabel gMapEntries
glabel gMapSymbols
.incbin "bin/addr.bin"
glabel gMapEntryEnd
glabel gMapSymbolsEnd

.balign 16
glabel gMapStrings
.incbin "bin/name.bin"
glabel gMapStringsEnd

.balign 16
glabel gMapEntrySize
.word (gMapEntryEnd - gMapEntries) / 4
glabel gMapStringSize
.word (gMapStringsEnd - gMapStrings)
9 changes: 6 additions & 3 deletions asm/n64_assert.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.include "macros.inc"

.section .data
glabel __n64Assert_Condition
.skip 4
glabel __n64Assert_Filename
.skip 4
glabel __n64Assert_LineNum
Expand All @@ -11,9 +13,10 @@ glabel __n64Assert_Message
.section .text

glabel __n64Assert
sw $a0, __n64Assert_Filename
sw $a1, __n64Assert_LineNum
sw $a2, __n64Assert_Message
sw $a0, __n64Assert_Condition
sw $a1, __n64Assert_Filename
sw $a2, __n64Assert_LineNum
sw $a3, __n64Assert_Message
syscall
nop

4 changes: 3 additions & 1 deletion asm/pj64_get_count_factor_asm.s
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.balign 32
glabel pj64_get_count_factor_asm
mfc0 $t0, $9 // $9 is the COUNT register
NOP
mfc0 $t1, $9
jr $ra
subu $v0, $t1, $t0
jr $ra
srl $v0, $v0, 1
122 changes: 122 additions & 0 deletions include/attributes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#pragma once



// Avoid compiler warnings for unused variables or functions.
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif

// Avoid undefined behaviour for non-returning functions.
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))
#else
#define NORETURN
#endif

// Always inline a function.
#ifdef __GNUC__
#define ALWAYS_INLINE inline __attribute__((always_inline))
#else
#define ALWAYS_INLINE inline
#endif

// Never inline a function.
#ifdef __GNUC__
#define NEVER_INLINE __attribute__((noinline))
#else
#define NEVER_INLINE
#endif

// Fall through a switch case.
#ifdef __GNUC__
#define FALL_THROUGH __attribute__((fallthrough))
#else
#define FALL_THROUGH
#endif

// Hot (fequently used) code paths.
#ifdef __GNUC__
#define HOT __attribute__((hot))
#else
#define HOT
#endif

// Cold (infrequently used) code paths.
#ifdef __GNUC__
#define COLD __attribute__((cold))
#else
#define COLD
#endif

// Use Og when compiling the function.
#ifdef __GNUC__
#define OPTIMIZE_OG __attribute__((optimize("Og")))
#else
#define OPTIMIZE_OG
#endif

// Use Os when compiling the function.
#ifdef __GNUC__
#define OPTIMIZE_OS __attribute__((optimize("Os")))
#else
#define OPTIMIZE_OS
#endif

// Use Ofast when compiling the function.
#ifdef __GNUC__
#define OPTIMIZE_OFAST __attribute__((optimize("Ofast")))
#else
#define OPTIMIZE_OFAST
#endif

// Ignore 4-byte alignment in structs.
#ifdef __GNUC__
#define PACKED __attribute__((packed))
#else
#define PACKED
#endif

// Align to 4-byte boundary.
#ifdef __GNUC__
#define ALIGNED4 __attribute__((aligned(4)))
#else
#define ALIGNED4
#endif

// Align to 8-byte boundary (for DMA requirements).
#ifdef __GNUC__
#define ALIGNED8 __attribute__((aligned(8)))
#else
#define ALIGNED8
#endif

// Align to 16-byte boundary (for audio lib requirements).
#ifdef __GNUC__
#define ALIGNED16 __attribute__((aligned(16)))
#else
#define ALIGNED16
#endif

// Align to 32-byte boundary.
#ifdef __GNUC__
#define ALIGNED32 __attribute__((aligned(32)))
#else
#define ALIGNED32
#endif

// Align to 64-byte boundary.
#ifdef __GNUC__
#define ALIGNED64 __attribute__((aligned(64)))
#else
#define ALIGNED64
#endif

// Align to arbitrary byte boundary (must be a power of 2).
#ifdef __GNUC__
#define ALIGNED(__align__) __attribute__((aligned(__align__)))
#else
#define ALIGNED(__align__)
#endif
Loading