Mario Kart 64
Loading...
Searching...
No Matches
crash_screen.c File Reference
#include <ultra64.h>
#include <macros.h>
#include <mk64.h>
#include <stdarg.h>
#include <string.h>
#include "crash_screen.h"
#include "main.h"
#include "textures/crash_screen/crash_screen_font.ia1.inc.c"
Include dependency graph for crash_screen.c:

Macros

#define DRAW_CODE   0xFFFF
 
#define CHARACTER_DASH   16
 
#define BLACK_COLOUR   0x0001
 

Functions

void osSetEventMesg (OSEvent, OSMesgQueue *, OSMesg)
 
s32 osRecvMesg (OSMesgQueue *, OSMesg *, s32)
 
void crash_screen_draw_glyph (u16 *framebuffer, s32 x, s32 y, s32 glyph)
 
void crash_screen_draw_square (u16 *framebuffer)
 
void crash_screen_draw_info (u16 *framebuffer, OSThread *thread)
 
OSThreadget_faulted_thread (void)
 
void thread9_crash_screen (UNUSED void *arg0)
 Retrieves faulted thread and displays debug info after the user inputs the button sequence. Button sequence: L, Up, Left, Down, Right, R, L, B, A.
 
void crash_screen_set_framebuffer (u16 *framebuffer)
 
void thread9_crash_screen (void *)
 
void create_debug_thread (void)
 
void start_debug_thread (void)
 

Variables

OSThread D_80162790
 
ALIGNED8 u8 gDebugThreadStack [0x400]
 
OSMesgQueue D_80162D40
 
OSMesg D_80162D58
 
u16pFramebuffer
 
s32 sButtonSequenceIndex
 
s32 sCounter = 0
 
u8 crashScreenFont [][8]
 
u16 sCrashScreenButtonSequence []
 

Macro Definition Documentation

◆ BLACK_COLOUR

#define BLACK_COLOUR   0x0001

Draws three black boxes then prints crash info in the following format: Line 1: threadId - address of faulted instruction - error code Line 2: Address in the return address register Line 3: Machine code of faulted instruction

The R4300i manual discusses exceptions in more depth.

Parameters
framebuffer
faultedthread

◆ CHARACTER_DASH

#define CHARACTER_DASH   16

◆ DRAW_CODE

#define DRAW_CODE   0xFFFF

Function Documentation

◆ crash_screen_draw_glyph()

void crash_screen_draw_glyph ( u16 * framebuffer,
s32 x,
s32 y,
s32 glyph )
Here is the caller graph for this function:

◆ crash_screen_draw_info()

void crash_screen_draw_info ( u16 * framebuffer,
OSThread * thread )
Bug
if this check fails, the ra register is printed a second time.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ crash_screen_draw_square()

void crash_screen_draw_square ( u16 * framebuffer)
Here is the caller graph for this function:

◆ crash_screen_set_framebuffer()

void crash_screen_set_framebuffer ( u16 * framebuffer)
Here is the caller graph for this function:

◆ create_debug_thread()

void create_debug_thread ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_faulted_thread()

OSThread * get_faulted_thread ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osRecvMesg()

s32 osRecvMesg ( OSMesgQueue * mq,
OSMesg * msg,
s32 flag )
extern
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osSetEventMesg()

void osSetEventMesg ( OSEvent e,
OSMesgQueue * mq,
OSMesg msg )
extern
Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_debug_thread()

void start_debug_thread ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread9_crash_screen() [1/2]

void thread9_crash_screen ( UNUSED void * arg0)

Retrieves faulted thread and displays debug info after the user inputs the button sequence. Button sequence: L, Up, Left, Down, Right, R, L, B, A.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread9_crash_screen() [2/2]

void thread9_crash_screen ( void * )
extern

Variable Documentation

◆ crashScreenFont

u8 crashScreenFont[][8]
Initial value:
= {
}

◆ D_80162790

OSThread D_80162790

◆ D_80162D40

OSMesgQueue D_80162D40

◆ D_80162D58

OSMesg D_80162D58

◆ gDebugThreadStack

ALIGNED8 u8 gDebugThreadStack[0x400]

◆ pFramebuffer

u16* pFramebuffer

◆ sButtonSequenceIndex

s32 sButtonSequenceIndex

◆ sCounter

s32 sCounter = 0

◆ sCrashScreenButtonSequence

u16 sCrashScreenButtonSequence[]
Initial value:
#define DRAW_CODE
Definition crash_screen.c:21
#define B_BUTTON
Definition os.h:390
#define A_BUTTON
Definition os.h:389
#define D_JPAD
Definition os.h:398
#define U_JPAD
Definition os.h:395
#define R_JPAD
Definition os.h:397
#define L_TRIG
Definition os.h:391
#define L_JPAD
Definition os.h:396
#define R_TRIG
Definition os.h:392