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 #466

Closed
wants to merge 310 commits into from
Closed
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
310 commits
Select commit Hold shift + click to select a range
a4eafb3
Add 'sDisasmColors'
Arceveti Aug 1, 2022
0d06f83
Combine parse_map and parse_map_return
Arceveti Aug 1, 2022
7739265
Improve insn_db ordering + rename 'is_branch' to 'get_branch_offset' …
Arceveti Aug 1, 2022
fec9b17
Add get_insn_type
Arceveti Aug 1, 2022
76215ff
static const crash screen font
Arceveti Aug 2, 2022
765261d
Rename 'sHideCrashScreen' to 'sDrawBackground'
Arceveti Aug 2, 2022
a6077a8
Add selection cursor to RAM viewer and disasm pages of the crash screen
Arceveti Aug 2, 2022
8b7c814
Press B to close address selection box
Arceveti Aug 2, 2022
48dd449
Rename static crash screen arrays with 's' prefix
Arceveti Aug 3, 2022
52a5d81
Disasm instruction descriptions
Arceveti Aug 3, 2022
6a11d8c
Jump to address target defaults to branch/jump target of selected line
Arceveti Aug 3, 2022
786e605
Small crash_screen_fill_branch_buffer optimization
Arceveti Aug 3, 2022
5e23747
Add ADDR_IS_KNOWN macro
Arceveti Aug 3, 2022
a2510e8
Rename fields in MapEntry struct
Arceveti Aug 3, 2022
d78ca2e
Merge ADDR_IS_KNOWN macro into is_in_code_segment + add PARAM_SDT
Arceveti Aug 3, 2022
cac14fd
Use Z to cycle between drawing crash screen & background instead of u…
Arceveti Aug 3, 2022
c5489aa
Add controls popup for individual pages
Arceveti Aug 3, 2022
be95781
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Aug 4, 2022
d4bb8a8
Allow switching pages when controls box is open
Arceveti Aug 4, 2022
57b6b1e
Fix broken coverage on crash screen game screenshot + close controls …
Arceveti Aug 4, 2022
bba0774
formatting
Arceveti Aug 4, 2022
8a62662
Add localized horizontal function name scrolling for large function n…
Arceveti Aug 4, 2022
71e4b2b
Add char macros
Arceveti Aug 4, 2022
0f5aa47
Rewrite crash screen text formatting system + split crash screen draw…
Arceveti Aug 5, 2022
8efb50b
Move some macros to proper header files
Arceveti Aug 5, 2022
3108c53
Fix build warnings/errors when INCLUDE_DEBUG_MAP is disabled
Arceveti Aug 5, 2022
6d431c7
Fix function name consistency + Show selected instruction's branch ar…
Arceveti Aug 5, 2022
3a65319
Add DISASM_INCLUDE_ALL_INSTRUCTIONS
Arceveti Aug 5, 2022
9f412b4
crash_screen_print optimization
Arceveti Aug 6, 2022
c779bf3
Add precise crash screen cursor controls
Arceveti Aug 6, 2022
d325a36
Fix address select wrapping + add IS_IN_RAM, GET_HEX_DIGIT, SET_HEX_D…
Arceveti Aug 6, 2022
470ea3c
Use color macros in draw_crashed_image_i4
Arceveti Aug 7, 2022
b983ac4
insn_db alignment
Arceveti Aug 7, 2022
fbc01c9
insn_disasm formatting improvements
Arceveti Aug 7, 2022
e7b7dfc
Disasm shows binary values when sShowRamAsAscii is on
Arceveti Aug 7, 2022
d4edb36
Make the middle part of the lowercase "z" diagonal in crash screen font
Arceveti Aug 7, 2022
c7eb787
Improve macro order
Arceveti Aug 16, 2022
61fd664
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Aug 16, 2022
459026c
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 28, 2022
8be4e56
Small formatting fix in colors.h
Arceveti Sep 28, 2022
dffb09f
Fix asserts
Arceveti Sep 29, 2022
05bcbe7
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 29, 2022
806ff24
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 29, 2022
aa5f9e2
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 30, 2022
68cd80d
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Oct 4, 2022
9a0e519
do while 0 for color copy and FORCE_CRASH macros
Arceveti Oct 7, 2022
c1011ee
move funny crash sound to its own function
Arceveti Oct 7, 2022
81359dc
Add 'SET_CRASH_ADDR' and 'FORCE_CRASH_AT_ADDR'
Arceveti Nov 3, 2022
3dfb0b3
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Nov 8, 2022
ed4c509
Fix alert_rcp_hung_up error
Arceveti Nov 8, 2022
2c42334
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Nov 28, 2022
66a8f1b
Use ARRAY_COUNT for sFpcsrDesc loop in crash_screen_print_fpcsr
Arceveti Dec 6, 2022
44cc20d
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Dec 6, 2022
2b43a72
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Dec 10, 2022
fc78712
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Dec 10, 2022
8fcbeee
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Dec 12, 2022
b8e442b
Use GCC extensions for some arrays
Arceveti Dec 14, 2022
9d8ab7f
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Dec 14, 2022
d7d7b90
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Jan 26, 2023
21df519
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Jan 26, 2023
5962e27
formatting changes :)
Arceveti Jan 26, 2023
36751d8
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Feb 11, 2023
4a68be5
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Mar 7, 2023
04c4fdd
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Mar 17, 2023
dd74c24
Fix sControlsDescriptions
Arceveti Mar 17, 2023
8cf89d8
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Mar 27, 2023
cbdf37d
map_parser.c formatting
Arceveti Mar 27, 2023
e439d23
crash screen print/draw changes
Arceveti Mar 27, 2023
9e50c0a
Fix build
Arceveti Mar 27, 2023
441a1e2
Crash screen changes + insn_disasm struct refactor
Arceveti Mar 27, 2023
6d7dd94
crash_screen_print formatting
Arceveti Mar 28, 2023
7e9dbd8
crash_screen_print refactoring
Arceveti Mar 28, 2023
a95e0c6
major print cleanup
Arceveti Mar 30, 2023
8bf457f
split crash screen pages into separate files
Arceveti Mar 31, 2023
3edeb75
Async disasm branch arrow search + more refactoring
Arceveti Mar 31, 2023
980f5f5
Rewrite disasm insn checking and param formatting
Arceveti Apr 5, 2023
b35b990
disasm fixes + pointer formatting changes
Arceveti Apr 7, 2023
5ccf1e3
Fix cop1_fmt_to_char
Arceveti Apr 7, 2023
d85cb90
More pseudoinstructions + fix get_branch_target_from_addr crash
Arceveti Apr 8, 2023
2be64da
Add symbols for all .text sections to map_parser
Arceveti Apr 10, 2023
fb8ed57
Add NEVER_INLINE + Add macros to cause specific exceptions
Arceveti Apr 10, 2023
b8ef92f
insn_disasm changes + add LI pseudoinstruction + fix MM crash
Arceveti Apr 10, 2023
e45c831
Fix build when KEEP_MARIO_HEAD is disabled
Arceveti Apr 10, 2023
2101259
More map_parser cleanup
Arceveti Apr 10, 2023
17a245b
More cleanup
Arceveti Apr 11, 2023
1f171b1
more crash screen refactoring
Arceveti Apr 14, 2023
5abe193
Don't use unique encoding for crash screen font
Arceveti Apr 14, 2023
f85dbda
Add init funcs + gCrashScreens array
Arceveti Apr 14, 2023
ae7f005
Add CSDrawDarkRectDarken enum + some clenaup
Arceveti Apr 15, 2023
e3345e5
Reduce crash screen stack size
Arceveti Apr 15, 2023
beafe00
crash screen refactoring
Arceveti Apr 15, 2023
ee7ad98
Infinitely recursive crash screens
Arceveti Apr 15, 2023
7d93146
Fix NUM_CRASH_SCREEN_BUFFERS define
Arceveti Apr 15, 2023
e05fbec
Remove crash screen crashed image
Arceveti Apr 15, 2023
f6ded6c
Move crash screen thread IDs up to 1000
Arceveti Apr 15, 2023
937e3d6
Make crash_scren_print return number of chars instead of lines
Arceveti Apr 15, 2023
8fb56aa
Some refactoring + consistent global variable naming
Arceveti Apr 16, 2023
4abe16b
Directly use global instead of arg for thread pointers in draw functions
Arceveti Apr 16, 2023
e84ce50
Use a single crashed thread pointer + combine some print functions + …
Arceveti Apr 17, 2023
68c2ad9
Fix map_parser
Arceveti Apr 17, 2023
ca5c378
Fix disasm commas + improve branch arrow spacing
Arceveti Apr 17, 2023
3782fa6
Fix FPCSR print
Arceveti Apr 18, 2023
cb5e566
Stack trace improvements
Arceveti Apr 18, 2023
222031b
Optimizations
Arceveti Apr 18, 2023
2a5a701
+ ram viewer
Arceveti Apr 18, 2023
657527b
Add ALIGNFLOOR macro
Arceveti Apr 19, 2023
35203c2
Use asm macros for asm functions
Arceveti Apr 19, 2023
4ba1994
Jump from stack trace selection
Arceveti Apr 19, 2023
a925a4d
Fix map data DMA overwriting some game code
Arceveti Apr 27, 2023
e249c44
Make number of map entries global + headless_dma cleanup
Arceveti Apr 27, 2023
7006497
Add size estimations to map data
Arceveti Apr 27, 2023
b0ef240
Catch SP Break + code segment checks + some refactoring
Arceveti Apr 27, 2023
1806cfe
Fix disasm arrows appearing a frame late when switching page
Arceveti Apr 29, 2023
2ed1892
Add memory typedefs
Arceveti Apr 30, 2023
6db53fc
Add gEnablePseudoinstructions
Arceveti Apr 30, 2023
884cd68
Loop changes + better scroll bounds
Arceveti Apr 30, 2023
a838b47
Fix scroll bar
Arceveti Apr 30, 2023
1ee7415
Fix build
Arceveti Apr 30, 2023
dff9b61
Improve address select wrapping
Arceveti Apr 30, 2023
de6bc0a
Properly validate addresses before reading
Arceveti Apr 30, 2023
d5d38e7
Add crash_screen_print_map_name
Arceveti May 1, 2023
04fadbd
print_crash_screen_header cleanup
Arceveti May 1, 2023
5ab8373
Improve stack trace display
Arceveti May 1, 2023
01d001f
Add Map Viewer page
Arceveti May 1, 2023
6b7a023
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti May 1, 2023
82bd9f6
Formatting changes
Arceveti May 1, 2023
cf5f130
Improve char/uchar usage
Arceveti May 1, 2023
b641981
Rename 'gCrashAddress' to 'gSetCrashAddress'
Arceveti May 7, 2023
f88e090
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Jul 13, 2023
0d5c78d
Various formatting/refactoring
Arceveti Jul 13, 2023
f33b1c8
Fix mapPacker.py + add type to map data
Arceveti Jul 13, 2023
7cc11f6
Signed ints for crash screen draw
Arceveti Jul 13, 2023
5128f35
memory_read functions for specific sizes
Arceveti Jul 13, 2023
ea3a203
Add parse error code to map entry format
Arceveti Jul 13, 2023
3dab43c
Refactor map symbol searching + change "entry" to "symbol"
Arceveti Jul 14, 2023
3073303
Rename "crash_screen" files to "crash_main" + add placeholder setting…
Arceveti Jul 14, 2023
6755d1e
Swap stack trace and map view pages + some fixes
Arceveti Jul 18, 2023
0cab90c
Fix map parser
Arceveti Jul 18, 2023
c77efff
Add draw scissor box
Arceveti Jul 18, 2023
9c91366
Update the map view page if the selected symbol changed on a differen…
Arceveti Jul 18, 2023
372653b
Fix stack trace on subsequent crash screens
Arceveti Jul 18, 2023
9552922
Assert page improvements + print buffer bounds assert
Arceveti Jul 18, 2023
6bd6af4
Remove unused line
Arceveti Jul 21, 2023
738adeb
Fix draw scissor box preventing hiding framebuffer
Arceveti Jul 21, 2023
83392dc
Update mapPacker.py comments & struct
Arceveti Jul 21, 2023
5a9cca4
Add index numbers to puppyprint log page
Arceveti Jul 21, 2023
a772d74
Rename page file names
Arceveti Jul 21, 2023
e5b7a47
Add settings page
Arceveti Jul 23, 2023
f9493e4
Add disasm immediate format setting + crash_screen_draw_row_selection…
Arceveti Jul 24, 2023
76ea4f3
Rename "game_input.h" to "input.h" to match input branch
Arceveti Jul 24, 2023
ed75f79
Move handle_input to input.h for easier merging later
Arceveti Jul 24, 2023
66fc5de
Add setting for pseudoinstructions + color fixes
Arceveti Jul 24, 2023
b4dfa5c
Fix print scroll speed 0
Arceveti Jul 24, 2023
bb869b6
Update colors + settings order
Arceveti Jul 26, 2023
84c6b21
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Aug 7, 2023
8e4950d
Add <> arrows to settings
Arceveti Aug 7, 2023
f362a46
Optimize PrintBuffer memory usage + add ColorRGBA32 union
Arceveti Aug 7, 2023
e048478
Add option to print disasm branches as addresses + formatting
Arceveti Aug 8, 2023
84cb6e1
Print asterisk if setting has been changed from default
Arceveti Aug 8, 2023
bab96a8
Add reset to defaults + fix hiding crash screen with Z + change setti…
Arceveti Aug 8, 2023
9847040
Settings fixes + INCLUDE_DEBUG_MAP ifdef fixes
Arceveti Aug 9, 2023
7ddee27
Implement "SELECTION" mode for disasm branch arrows
Arceveti Aug 9, 2023
ac3c581
Composite controller
Arceveti Aug 9, 2023
14dad60
Wrap selection for stack trace and settings pages + use sp for currfu…
Arceveti Aug 11, 2023
78a48e1
Use tc->sp for the first sCSFunctionStackBuffer entry
Arceveti Aug 11, 2023
74fe186
Add option to parse context register symbol names
Arceveti Aug 11, 2023
9a2908d
Add settings for cursor direction hold wait frames and analog deadzone
Arceveti Aug 11, 2023
034306d
Clean up settings defaults in INCLUDE_DEBUG_MAP ifderfs
Arceveti Aug 11, 2023
a26c4b5
Add settings section headers
Arceveti Aug 12, 2023
83eef2b
Make settings section headers collapsible
Arceveti Aug 12, 2023
c10dbc2
Move settings functionality into its own file + crash_types.h cleanup
Arceveti Aug 12, 2023
5276c65
Fix includes
Arceveti Aug 12, 2023
216da32
Fix disasm branch arrows sometimes appearing outside of code sections…
Arceveti Aug 12, 2023
b1b19eb
Move non-default setting asterisk
Arceveti Aug 13, 2023
cedee53
Move controls lists + some renames
Arceveti Aug 13, 2023
0131f78
Add config_crash.h
Arceveti Aug 13, 2023
072421b
Replace triangle functions with a cropped diamond shape
Arceveti Aug 14, 2023
32aa26d
Add setting for current symbol name in disasm
Arceveti Aug 14, 2023
7faf718
Clean up disasm branch arrow head drawing
Arceveti Aug 14, 2023
cdcafa6
Clamp settings scroll when section is collapsed
Arceveti Aug 14, 2023
399d536
Add current symbol name setting for memory page
Arceveti Aug 15, 2023
251bc0e
Combine assert and log pages
Arceveti Aug 15, 2023
ffbaf89
Add tab support
Arceveti Aug 16, 2023
e158586
Add assert args + assert.c/assert.h
Arceveti Aug 16, 2023
e2f248c
Add __n64Assert_Condition + Replace assert args with ERRORF, ASSERTF,…
Arceveti Aug 16, 2023
d9fed14
Use ASSERTF for crash_screen_print_impl buffer size check
Arceveti Aug 16, 2023
88e9d3b
Update assert print in log page
Arceveti Aug 16, 2023
584e729
Red assert highlight
Arceveti Aug 17, 2023
643c275
Add gCSWordWrapXLimit + formatting
Arceveti Aug 17, 2023
616bed1
Header formatting + insn format string fix
Arceveti Aug 20, 2023
4cf6c28
move non-default setting asterisk
Arceveti Aug 20, 2023
1b7c28b
update_crash_screen_page cleanup
Arceveti Aug 20, 2023
cd2dce5
more crash_controls.c cleanup + address_select.h formatting
Arceveti Aug 20, 2023
d0050ca
Fix disasm branch arrows + fix typo
Arceveti Aug 22, 2023
cb0718c
Various formatting
Arceveti Aug 22, 2023
a6700b4
static char buffer for print
Arceveti Aug 22, 2023
b6ca9ff
Add expand/collapse all for settings
Arceveti Aug 22, 2023
cbaacbf
Add setting for log index numbers
Arceveti Aug 22, 2023
50cfd18
Add show/hide settings for stack address and offset in stack page
Arceveti Aug 22, 2023
a59a944
Add settings for map view page
Arceveti Aug 22, 2023
e197e87
Improve struct typedefs
Arceveti Aug 23, 2023
14ad9af
Move 'name' member of CSPage to the beginning
Arceveti Aug 23, 2023
6fa0274
Various refactors
Arceveti Aug 23, 2023
48cdefd
Update comment
Arceveti Aug 23, 2023
bcfa6a1
Move CSPage structs to page files
Arceveti Aug 23, 2023
64c5c4c
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Aug 24, 2023
42633dc
Clean up crash_screen_thread_entry
Arceveti Sep 2, 2023
c437424
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 2, 2023
cc3f1f6
Fix vc_check.h include
Arceveti Sep 2, 2023
dc5bd6a
Improve UNF ifdef in thread3_main
Arceveti Sep 2, 2023
99e9e36
Assert fixes
Arceveti Sep 2, 2023
e342f8d
Add 'CRASH_SCREEN_START_PAGE' define + fix build warning
Arceveti Sep 2, 2023
79cd81f
Clean up settings prints + context page as start page
Arceveti Sep 2, 2023
972c8c0
Split settings data into groups
Arceveti Sep 5, 2023
f56f7b8
Remove unused crash_main.c includes + assert formatting
Arceveti Sep 5, 2023
216fca5
Function name consistency + some documentation
Arceveti Sep 6, 2023
a7c8223
Fix insn_disasm coprocessor subtype accuracy + documentation
Arceveti Sep 8, 2023
337272b
control list name consistency
Arceveti Sep 9, 2023
6d9d7a9
Clean up get_insn_type_and_list
Arceveti Sep 9, 2023
5e4b059
Further get_insn_type_and_list cleanup
Arceveti Sep 9, 2023
954a5af
get_insn optimization
Arceveti Sep 10, 2023
ae0010c
More get_insn optimization
Arceveti Sep 10, 2023
38fb684
Better null terminators for insn_db arrays + update documentation
Arceveti Sep 10, 2023
1338223
Improve disasm selection box
Arceveti Sep 10, 2023
71daa02
Various documentation + formatting
Arceveti Sep 10, 2023
fc231ea
Context page string get refactor
Arceveti Sep 10, 2023
96e822a
UNF compatibility + print on crash
Arceveti Sep 10, 2023
cf3e089
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 11, 2023
2eef280
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 11, 2023
7f40c65
insn_disasm formatting + small optimizations
Arceveti Sep 12, 2023
8377fd9
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 12, 2023
271cf7f
Improve unaligned data reads
Arceveti Sep 12, 2023
0ce3bb0
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 22, 2023
fea0858
Merge branch 'develop/2.1.0' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 25, 2023
6ede47f
Merge branch 'master' of https://github.com/Reonu/HackerSM64 into dev…
Arceveti Sep 26, 2023
1a39538
Merge branch 'master' of https://github.com/Reonu/HackerSM64 into dev…
Arceveti Sep 27, 2023
ec385f7
Add INCBIN + get version number string from VERSION.txt
Arceveti Sep 27, 2023
48bea33
spawn lakitu at the origin (#712)
someone2639 Sep 27, 2023
38f25d2
rename flips src dir (#711)
thecozies Sep 27, 2023
01c3f20
v2.1.2
gheskett Sep 27, 2023
9056a10
Merge branch 'develop/2.1.2' of https://github.com/Reonu/HackerSM64 i…
Arceveti Sep 27, 2023
7de18d1
Merge pull request #714 from HackerN64/develop/2.1.2
thecozies Sep 27, 2023
bb73ec3
Change popup box functionality
Arceveti Sep 27, 2023
7e9fd41
Remove HACKERSM64_VERSION define
Arceveti Sep 27, 2023
81eff90
formatting changes :)
Arceveti Sep 28, 2023
b423f68
More renames + comment cs_draw_line
Arceveti Sep 28, 2023
637603f
More formatting
Arceveti Sep 28, 2023
57f581d
Fix FORCE_CRASH not working on most emulators + remove FRAMEBUFFER_SI…
Arceveti Sep 30, 2023
23f2d5f
Merge branch 'master' of https://github.com/Reonu/HackerSM64 into dev…
Arceveti Sep 30, 2023
4831380
Fix crash screen's crash screen + Only start on logs page during asse…
Arceveti Sep 30, 2023
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
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ else ifeq ($(VERSION),sh)
DEFINES += VERSION_SH=1
endif

DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE

# TARGET -
TARGET := sm64


Expand Down Expand Up @@ -374,7 +374,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 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 @@ -585,7 +585,8 @@ libultra: $(BUILD_DIR)/libultra.a

# Extra object file dependencies
$(BUILD_DIR)/asm/boot.o: $(IPL3_RAW_FILES)
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/crash_screen/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/images/crash_screen_crashed.o: $(CRASH_TEXTURE_2_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 Down Expand Up @@ -834,7 +835,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) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF [email protected] -o $@ $<
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF [email protected] -o $@ $<

# Link libgoddard
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
Expand All @@ -847,7 +848,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) -MMD -MP -MT $@ -MF [email protected] -o $@ $<

Expand Down
7 changes: 5 additions & 2 deletions Makefile.split
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,14 @@ $(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)))

CRASH_TEXTURE_2_FILES := $(wildcard $(TEXTURE_DIR)/crash_custom/*.png)
CRASH_TEXTURE_2_C_FILES := $(addprefix $(BUILD_DIR)/,$(patsubst %.png,%.inc.c,$(CRASH_TEXTURE_2_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/repo, widescreen, reonucam, various defines for hacker QoL
- **JoshDuMan**: Decomp guy, general assistance
- **Arceveti**: Silhouette, shadow optimisation, better hanging, breath meter
- **Arceveti**: New crash screen, silhouette, shadow optimisation, better hanging, breath meter
- **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
570 changes: 377 additions & 193 deletions include/color_presets.h

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* A catch-all file for configuring various bugfixes and other settings in SM64
*/


// HackerSM64 version number. DO NOT CHANGE THIS UNLESS YOU ARE A HACKERSM64 DEVELOPER.
#define HACKERSM64_VERSION "2.1.0 beta"


#include "config/config_audio.h"
#include "config/config_benchmark.h"
#include "config/config_camera.h"
Expand Down
18 changes: 17 additions & 1 deletion include/config/config_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// #define DEBUG_ALL

// Disables all debug options (except PUPPYPRINT).
#define DISABLE_ALL
// #define DISABLE_ALL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remember this


// Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
// If not using PUPPYPRINT_DEBUG, press L to toggle the profiler.
Expand Down Expand Up @@ -55,3 +55,19 @@

// Forces a crash when the game starts. Useful for debugging the crash screen.
// #define DEBUG_FORCE_CRASH_ON_BOOT

// Forces a crash when the player presses L in-game.
#define DEBUG_FORCE_CRASH_ON_L

// Enables the DEBUG_ASSERT macro.
#define ENABLE_DEBUG_ASSERTS

// Includes function map data in the ROM.
#define INCLUDE_DEBUG_MAP

// Includes an image which displays when the crash screen crashes.
// Uses 38.4 KB of rom space.
#define CRASH_SCREEN_CRASH_SCREEN

// Plays a Mario "WAAAOOOW" sound effect when the game crashes.
// #define FUNNY_CRASH_SOUND
13 changes: 9 additions & 4 deletions include/config/config_rom.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
// Currently not recommended, as it may cause random crashes.
// #define ENABLE_RUMBLE (1 || VERSION_SH)

// Screen Size Defines.
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

// Height of the black borders at the top and bottom of the screen for NTSC Versions. You can set it to different values for console and emulator.
// There is generally no reason to have a value other than 0 for emulator. As for console, it provides a (small) performance boost.
#define BORDER_HEIGHT_CONSOLE 0
#define BORDER_HEIGHT_EMULATOR 0

// Screen Size Defines.
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

// Don't change these.
#define SCREEN_CENTER_X (SCREEN_WIDTH / 2)
#define SCREEN_CENTER_Y (SCREEN_HEIGHT / 2)
#define SCREEN_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT)
7 changes: 6 additions & 1 deletion include/config/config_safeguards.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

#ifdef DISABLE_ALL
#undef DEBUG_ALL
#undef USE_PROFILER
#undef TEST_LEVEL
#undef DEBUG_LEVEL_SELECT
#undef ENABLE_DEBUG_FREE_MOVE
Expand All @@ -86,7 +87,11 @@
#undef UNLOCK_ALL
#undef COMPLETE_SAVE_FILE
#undef DEBUG_FORCE_CRASH_ON_BOOT
#undef USE_PROFILER
#undef DEBUG_FORCE_CRASH_ON_L
#undef ENABLE_DEBUG_ASSERTS
#undef INCLUDE_DEBUG_MAP
#undef CRASH_SCREEN_CRASH_SCREEN
#undef FUNNY_CRASH_SOUND
#endif // DISABLE_ALL

#ifdef DEBUG_ALL
Expand Down
36 changes: 22 additions & 14 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,60 @@
#define UNUSED
#endif

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

// Avoid undefined behaviour for non-returning functions
// Always inline a function
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))
#define ALWAYS_INLINE inline __attribute__((always_inline))
#else
#define NORETURN
#define ALWAYS_INLINE inline
#endif

// Static assertions
// Fall through a switch case
#ifdef __GNUC__
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#define FALL_THROUGH __attribute__((fallthrough))
#else
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
#define FALL_THROUGH
#endif

// Align to 8-byte boundary for DMA requirements
// 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
// Align to 16-byte boundary (for audio lib requirements)
#ifdef __GNUC__
#define ALIGNED16 __attribute__((aligned(16)))
#else
#define ALIGNED16
#endif

// Align to 16-byte boundary for audio lib requirements
// 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 16-byte boundary for audio lib requirements
// Static assertions
#ifdef __GNUC__
#define ALWAYS_INLINE inline __attribute__((always_inline))
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#else
#define ALWAYS_INLINE inline
#define STATIC_ASSERT(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
#endif

#ifndef NO_SEGMENTED_MEMORY
Expand Down
2 changes: 0 additions & 2 deletions include/segments.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@
#define SEG_POOL_START _framebuffersSegmentBssEnd // 0x0165000 in size
#define POOL_SIZE RAM_END - SEG_POOL_START

#define MAP_PARSER_ADDRESS 0x80345678

#endif // SEGMENTS_H
18 changes: 14 additions & 4 deletions include/sm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@
#include "macros.h"
#include "segments.h"

// Crash handler enhancement
#ifdef CRASH_SCREEN_INCLUDED
#define DEBUG_ASSERT(exp) do { if (!(exp)) _n64_assert(__FILE__, __LINE__, #exp, 1); } while (0)
extern char *__n64Assert_Filename;
extern u32 __n64Assert_LineNum;
extern char *__n64Assert_Message;
extern void __n64Assert(char *fileName, u32 lineNum, char *message);

#define ASSERT(cond, message) do {\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo if this is a runtime assert that follows the C standard then it should be named assert in all lowercase

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought that requires a bit of extra work (including meddling with n64_assert.s and the assert parser) so consider this comment optional

if (!(cond)) { \
__n64Assert(__FILE__, __LINE__, (message)); \
} \
} while (0);

#ifdef ENABLE_DEBUG_ASSERTS
#define DEBUG_ASSERT(cond, message) ASSERT(cond, message)
#else
#define DEBUG_ASSERT(exp)
#define DEBUG_ASSERT(cond, message)
#endif

// Pointer casting is technically UB, and avoiding it gets rid of endian issues as well as a nice side effect.
Expand Down
3 changes: 0 additions & 3 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
} \
}

#define SCREEN_CENTER_X (SCREEN_WIDTH / 2)
#define SCREEN_CENTER_Y (SCREEN_HEIGHT / 2)

struct Config {
f32 audioFrequency;
#ifdef WIDE
Expand Down
27 changes: 20 additions & 7 deletions sm64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ SECTIONS
#endif

/* hardcoded symbols to satisfy preliminary link for map parser */
#ifndef DEBUG_MAP_STACKTRACE
_mapDataSegmentRomStart = 0;
gMapEntries = 0;
gMapEntrySize = 0;
gMapStrings = 0;
#if defined(INCLUDE_DEBUG_MAP) && defined(PRELIMINARY)
_mapDataSegmentRomStart = 0;
gMapEntries = 0;
gMapEntrySize = 0;
gMapStrings = 0;
#endif

BEGIN_SEG(main, .) SUBALIGN(16)
Expand All @@ -162,6 +162,7 @@ SECTIONS
#endif

BUILD_DIR/src/boot*.o(.text*);
BUILD_DIR/src/crash_screen*.o(.text*);
BUILD_DIR/src/hvqm*.o(.text*);
BUILD_DIR/src/usb*.o(.text*);
BUILD_DIR/src/audio*.o(.text*);
Expand All @@ -188,6 +189,7 @@ SECTIONS
/* data */
BUILD_DIR/asm/n64_assert.o(.*data*);
BUILD_DIR/src/boot*.o(.*data*);
BUILD_DIR/src/crash_screen*.o(.*data*);
BUILD_DIR/src/audio*.o(.*data*);
#ifdef S2DEX_TEXT_ENGINE
lib/libs2d_engine.a:*(.*data*);
Expand All @@ -207,6 +209,7 @@ SECTIONS

/* rodata */
BUILD_DIR/src/boot*.o(.rodata*);
BUILD_DIR/src/crash_screen*.o(.rodata*);
BUILD_DIR/src/usb*.o(.rodata*);
BUILD_DIR/src/audio*.o(.rodata*);
#ifdef S2DEX_TEXT_ENGINE
Expand All @@ -227,6 +230,7 @@ SECTIONS
BEGIN_NOLOAD(main)
{
BUILD_DIR/src/boot*.o(.*bss*);
BUILD_DIR/src/crash_screen*.o(.*bss*);
BUILD_DIR/src/hvqm*.o(.*bss*);
BUILD_DIR/src/usb*.o(.*bss*);
BUILD_DIR/src/audio*.o(.*bss*);
Expand Down Expand Up @@ -532,8 +536,17 @@ SECTIONS
END_SEG(capcom)
#endif

#ifdef DEBUG_MAP_STACKTRACE
BEGIN_SEG(mapData, (RAM_END - 0x00100000)) {
#ifdef CRASH_SCREEN_CRASH_SCREEN
. = ALIGN(0x40);
BEGIN_SEG(crash_screen_crash_screen, __romPos)
{
KEEP(BUILD_DIR/src/images/crash_screen_crashed.o(.rodata*));
}
END_SEG(crash_screen_crash_screen)
#endif

#if defined(INCLUDE_DEBUG_MAP) && !defined(PRELIMINARY)
BEGIN_SEG(mapData, (RAM_END - RAM_1MB)) {
KEEP(BUILD_DIR/asm/debug/map.o(.data*));
}
END_SEG(mapData)
Expand Down
3 changes: 1 addition & 2 deletions src/boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "game/sound_init.h"
#include "buffers/buffers.h"
#include "segments.h"
#include "crash_screen/crash_screen.h"
#include "game/main.h"
#include "game/rumble_init.h"
#include "game/version.h"
Expand Down Expand Up @@ -318,8 +319,6 @@ void check_cache_emulation() {
__osRestoreInt(saved);
}

extern void crash_screen_init(void);

void thread3_main(UNUSED void *arg) {
setup_mesg_queues();
alloc_pool();
Expand Down
2 changes: 2 additions & 0 deletions src/buffers/framebuffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ extern RGBA16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
#define gFramebuffer1 gFramebuffers[1]
#define gFramebuffer2 gFramebuffers[2]

#define FRAMEBUFFER_SIZE (SCREEN_SIZE * sizeof(RGBA16))

#endif // FRAMEBUFFERS_H
Loading