Skip to content
MegaMech edited this page Aug 10, 2023 · 3 revisions

Enhancements are additions that are not in the original game. They can be helpful for debugging, fixing bugs, adding features, etc.

Crash Screen

Ported from sm64 located in debug/crash_screen_enhancement.c

How to use:

  1. make clean (if fresh clone then skip this step)
  2. make -j DEBUG=1
  3. Add #define CRASH_SCREEN_ENHANCEMENT to the top of main.c or crash_screen.c
  4. Uncomment //#define SKIP_DRAW_SQUARE in crash_screen.c if using emulator (hopefully this will display crash info on pj64)

The new crash screen should now work.

Force "a crash" on boot to test:

#include "debug/crash_screen_enhancement.h"

void display_and_vsync(void) {
    profiler_log_thread5_time(BEFORE_DISPLAY_LISTS);
    osRecvMesg(&gGfxVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
    exec_display_list(&gGfxPool->spTask);
    profiler_log_thread5_time(AFTER_DISPLAY_LISTS);
    osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
    osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer]));
    profiler_log_thread5_time(THREAD5_END);
    osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
    crash_screen_set_framebuffer((uintptr_t *) gPhysicalFramebuffers[sRenderedFramebuffer]);

    crash_screen_draw(&gGameLoopThread);
    // Add this line ^

    if (++sRenderedFramebuffer == 3) {
        sRenderedFramebuffer = 0;
    }
    if (++sRenderingFramebuffer == 3) {
        sRenderingFramebuffer = 0;
    }
    gGlobalTimer++;
}
Clone this wiki locally