-
Notifications
You must be signed in to change notification settings - Fork 167
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
base: develop/3.0.0
Are you sure you want to change the base?
New crash screen #725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments for requested changes (3 are changes, the rest are notes), also here's the todo list but annotated for things i think fit the scope of this PR and things that should be saved for later
Annotated with 4 categories:
- Add: I'll approve when these are done
- Defer: Good features, but save them for another PR
- Wait: Save until problematic
- Out of Scope: self-explanatory
General
-
A "print current page to UNF" button. (hold
START
orZ
?). (Add) -
Verify whether
FORCE_CRASH_AT_ADDR
works or is needed. (Add) -
Fix lowercase
debug_assert
conflict with UNFdebug_assert
. (Add) -
Fix the flickering on Ares if possible. (Add)
-
Fix data in extended RAM not being read correctly. (Add)
-
Verify whether
osWritebackDCacheAll()
usage is correct. (Add) -
Don't have all crash screen code always loaded (keep in its own segment then DMA it on crash?). (Defer)
-
Ifdef the entire crash screen. (Defer)
-
Simplified crash screen (for HLE? or if DMA fails?). (Defer)
-
Finish and clean up
macros.h
stuff. (Defer, some of these might not be possible to trigger) -
Combine
sRegNames
frompages/context.c
andsRegisterNames
frominsn_disasm.c
if possible. (Defer) -
Clean up
INCLUDE_DEBUG_MAP
ifdefs as much as possible. (Defer) -
Page selection grid popup. (Defer)
-
Individual page settings in each page's controls/help popup box. (Defer)
-
Ability to undo address select and disasm jumps? (Defer)
-
Horizontal text scrolling should actually scroll by pixels rather than scrolling the char buffer. (Defer)
-
Make controls list scrollable if too long. (Wait)
-
A page to interpret memory as an image? For texture viewing? How would wrap width work? (Wait)
-
Physical vs. Virtual address setting? (Wait)
-
"Home" page with crash screen instructions. (Wait)
-
Controls rebinding page (necessary?) (Wait)
-
Should assert macros be uppercase or lowercase? (Wait) (also lowercase imo)
-
Low vs. High resolution setting. (Out of Scope)
Context page
-
Is R0 needed? It's always 0. (Already done)
-
T8 and T9 registers. (Already Done)
-
Jump to selected register address, or value (if the value is a valid address). (Already Done)
-
Show offsets in parse register address names mode. (Defer)
-
Extended version with a scrollable list of all registers and their full 64 bit contents (Everything from here plus any other CPU/RCP registers). (Wait)
-
Select individual registers (Wait)
-
Selected register descriptions. (Wait)
-
Setting for interpreting integer registers as decimal? (Wait)
-
Different colors for register names from parsed global variable names (disasm page too). (Wait)
-
Multiple FPCSR descriptions at once. (Wait)
Log/Assert page
- Timestamps? (Wait)
Stack trace page
- Libdragon stack trace functionality. (Defer)
Map view page
-
Is search functionality possible/reasonable? (Wait)
-
Should moving the cursor location here also change the location in ram view and disasm? (Out of Scope) (Also no)
RAM view page
-
Read 4 bytes as address for address select popup (requires multi-select?). (Defer)
-
Is search functionality possible/reasonable? (Wait)
-
Binary view mode. (Wait)
-
Write the viewed area to a buffer on each scroll to avoid constant data reads each frame. (Wait)
Disasm page
-
Show addresses for each row (setting). (Defer)
-
Can the
insn_as_string
andinsn_name
buffers be combined? (Defer) -
Multi-line pseudoinstructions if possible (ABS, BLT, BGT, BLE, NEG, NEGU, NOT, BGE, LI, LA, SGE, SGE, ADD?). (Wait)
-
Is it possible to include function names inline at the beginning of each function without compromising scrolling? (Wait)
-
Implement "OVERSCAN" mode for branch arrows. (Wait)
Settings page
- Save all changed settings somehow? (Wait)
- Confirmation dialog box to reset all to defaults. (Wait)
- Jump to the page from a page group. (Unnecessary if settings become part of their respective pages)
}; | ||
|
||
static const char* sCauseDesc[18] = { | ||
/*EXC_INT */ "Interrupt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This array can use designated initializers too using [EXC >> 2] = ...,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't work for the last two entries because the index would skip from 15 to 23 then 31 (see R4300.h line 211-228).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having it skip would introduce a bit of padding space but it also eliminates the correction in line 103 in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a net increase of 0x138 bytes for a negligible optimization, and code size matters more than performance here.
src/crash_screen/crash_print.c
Outdated
return numChars; | ||
} | ||
|
||
static void cs_scroll_buffer(size_t bufferCount, size_t charLimit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only complaint here is that this gets hard to read on the cause screen (maybe a pause here?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can slow down the text scroll speed on the settings page. Should holding B pause scrolling text in its place?
src/crash_screen/crash_print.c
Outdated
} | ||
escaped = TRUE; | ||
break; | ||
case CHAR_COLOR: // @RRGGBBAA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this specific color syntax will be obsoleted by the ascii pr
#define SET_CRASH_ADDR(ptr) \ | ||
do { \ | ||
extern uintptr_t gSetCrashAddress; \ | ||
gSetCrashAddress = (uintptr_t)&(ptr); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Will not work on arbitrary numbers as pointers
…nto develop/2.1.0-new-crash-screen
…es coverage issue on ares) + update README + some other stuff
Repointing to 3.0 (this is way too dramatic to fit in a minor release) |
WARNING: Please do not update this branch with non-3.0 changes! This will only serve to prevent this PR from ever being in a mergeable state until the next minor release. |
… into develop/2.1.0-new-crash-screen
Moved from #466.
(description currently WIP)
The crash screen has been entirely rewritten.
Pages:
Context page
__OSThreadContext
.Logs/Assert page
Stack trace page
B
to toggle between parsed names + offsets or addresses onlyMap view page
RAM view page
B
to toggle between hex values and ASCII values for each byte.Disassembly page
INCLUDE_DEBUG_MAP
is defined.INCLUDE_DEBUG_MAP
is not defined.Settings page
Other:
Header
Manual address select box
A
to open a box that allows you to choose a specific address to jump to.Controls
START
on any page to open a popup which lists the controls for that page.Safe memory reads
src/crash_screen/memory_read.c
Map parser
src/crash_screen/map_parser.c
andtools/mapPacker.py
nm --print-size --numeric-sort
instead of just reading from thesm64_prelim.map
file. This change allows reading static functions, externs, and also symbol types and sizes.UNF compatibility
debug_printcontext()
insrc/usb/debug.c
New drawing system
cs_print()
"@FF0000FFred text"
will print "red text" in red.cs_print_scroll()
. If the final formatted string length exceeds the width, it will scroll the text insteadSaved screenshot
Support for crash screen crashes
New asserts
src/game/assert.h
ERROR(message)
Will always assert with 'message' without a condition.ASSERT(condition, message)
Will assert with 'message' if 'condition' is false.DEBUG_
prefix to the beginning of either of the above to have it only run ifENABLE_DEBUG_ASSERTS
is defined (eg. (DEBUG_ASSERT()
).F
suffix to the end of either of the above to allow formatting in 'message' like printf (eg.ASSERTF()
).(moved TODO to
src/crash_screen/README.md
)