Changing the Exception Handler Message

From NSMBW Modding Database
Jump to navigation Jump to search

This tutorial will guide you through editing NewerSMBW's Exception Handler (crash screen) message.

Requirements

Tutorial

Step 1

In NewerSMBW's source code, open the Kamek/src/exceptionHandler.cpp file with your text editor.

Step 2

Go to line 147 in your text editor, and you should see this text below:

nw4r::db::Exception_Printf_("Whoops! " GAME_NAME " [%s] has crashed - %s\n\nPlease send the information below to\nnewer@newerteam.com\nYou can scroll through this report using the D-Pad.\n\n", GetRegionAndVersion(), GetErrorDescription(OSError));

Edit the text inside the quotations and save your changes, but do not edit the nw4r::db::Exception_Printf_("SRR0: %08X | DSISR: %08X | DAR: %08X\n", osContext->srr[0]); line or any other lines. For example:

nw4r::db::Exception_Printf_("A crash occurred with " GAME_NAME "!\nRegion: %s, Crash Type: %s.\n\n/- Please give us more information about the\ncrash (including a \"screenshot\" of it) and send it\nto newer@newerteam.com. Use the D-Pad to scroll\nthrough the information/report. To get out of the\ncrash, please turn off your Wii or Wii U console by\nholding down the POWER button or by unplugging it. -\\\n\n", GetRegionAndVersion(), GetErrorDescription(OSError));

Make sure to end the text with \n\n, so that the rest of the exception info will display properly.

Use \n for a new line character, \\ for a left slash character, or \" for a double quote character.


Step 3

This step is only required for changing the info of the mod name/version, game region/version, and the NewerASM identifier.

To change the mod name/version info, go to line 5, and you should see the following text:

#if defined(ANOTHER_WII)
#define GAME_NAME "Another v3.2"
#elif defined(HOLIDAY_SPECIAL)
#define GAME_NAME "NerXMAS v1.12"
#elif defined(SUMMER_SUN)
#define GAME_NAME "SumSun v1.12"
#elif defined(FALLING_LEAF)
#define GAME_NAME "Newer FL v1.12"
#elif defined(NEWER_WII)
#define GAME_NAME "Newer Wii v1.30"
#else
#define GAME_NAME "The game"
#endif

Find the #define macro for your game, and change the text inside the quotations. For example, we'll change NewerSMBW's name to NewerSMBW v1.3.0. The changes should now look like the text below:

#if defined(ANOTHER_WII)
#define GAME_NAME "Another v3.2"
#elif defined(HOLIDAY_SPECIAL)
#define GAME_NAME "NerXMAS v1.12"
#elif defined(SUMMER_SUN)
#define GAME_NAME "SumSun v1.12"
#elif defined(FALLING_LEAF)
#define GAME_NAME "Newer FL v1.12"
#elif defined(NEWER_WII)
#define GAME_NAME "NewerSMBW v1.3.0"
#else
#define GAME_NAME "The game"
#endif

To change the game region/version info, go to line 96 and find this text:

char *GetRegionAndVersion()
{
    NSMBWVer version = getNsmbwVer();
    switch(version)
    {
        case pal:
            return "PALv1";
        case pal2:
            return "PALv2";
        case ntsc:
            return "NTSCv1";
        case ntsc2:
            return "NTSCv2";
        case jpn:
            return "JPNv1";
        case jpn2:
            return "JPNv2";
        case kor:
            return "kor";
        case twn:
            return "twn";
        default:
            return "UNKNOWN";
    }
}

Each return value is what will be printed in the message. For example, we'll change each of them to the 2 letters that each region folder on the game disc uses (EU, US, JP, KR, and TW). The changes should now look like the text below:

char *GetRegionAndVersion()
{
    NSMBWVer version = getNsmbwVer();
    switch(version)
    {
        case pal:
            return "EUv1";
        case pal2:
            return "EUv2";
        case ntsc:
            return "USv1";
        case ntsc2:
            return "USv2";
        case jpn:
            return "JPv1";
        case jpn2:
            return "JPv2";
        case kor:
            return "KR";
        case twn:
            return "TW";
        default:
            return "UNKNOWN";
    }
}

To change the NewerASM identifier, go to line 173 and find this text:

nw4r::db::Exception_Printf_(" - %08X NewerASM", stackPointer[1] - dlcode);

Whenever a memory address is above a certain value, a secondary address will be shown beside it, alongside the identifier. For example, we'll change the identifier to Custom Code. The changes should now look like the text below:

nw4r::db::Exception_Printf_(" - %08X Custom Code", stackPointer[1] - dlcode);


Step 4

To see the Exception Handler message, you'll need to crash the game. For simplicity, replace the existing kuribo.arc.LZ file (in the /SpriteTex folder of your NewerSMBW patch folder) with this corrupted one here. Make sure to back up the existing kuribo.arc.LZ file before replacing it.

Step 5

Compile NewerSMBW's source code, enter into level 1-1 (Palm Beach), and the game should crash. You will see your edited Exception Handler message (these are the examples used in Step 2 and 3):