-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adds SAVE_TYPE_ERROR_SCREEN #5188
Adds SAVE_TYPE_ERROR_SCREEN #5188
Conversation
…merald-expansion/pull/5188\#discussion_r1720747901 Reindent function per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720747984 Split Compound String into seperate lines per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748104 Changed Rom to ROM per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748104 Removed extra new line per https://github.com/rh-hideout/pokeemerald-expansion/pull/5188\#discussion_r1720748172
Oh I see, hmm... Yeah I suppose you'd expect to indent that like: SaveFailedScreenTextPrint(
COMPOUND_STRING(
"{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n\n"
"If playing on an emulator, set your\n"
"save type setting to\n"
"Flash 1Mb/128K and reload the ROM.\n"
"\n"
"If playing on hardware, your cart\n"
"does not have a working flash chip."),
1, 0); Since this PR is going to static const saveFailedMessage[] =
"{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n\n"
"If playing on an emulator, set your\n"
"save type setting to\n"
"Flash 1Mb/128K and reload the ROM.\n"
"\n"
"If playing on hardware, your cart\n"
"does not have a working flash chip.";
SaveFailedScreenTextPrint(saveFailedMessage, 1, 0); I think either of those is fine. For comparison here's the right-leaning one which I think is probably a bit annoying to read if your editor is narrow like mine... But I imagine it's fine for most people? SaveFailedScreenTextPrint(
COMPOUND_STRING("{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n\n"
"If playing on an emulator, set your\n"
"save type setting to\n"
"Flash 1Mb/128K and reload the ROM.\n"
"\n"
"If playing on hardware, your cart\n"
"does not have a working flash chip."),
1, 0); To be honest, I don't have strong opinions about any of the choices. Weakly I'd order them 2, 1, 3. In this example I think 1 and 2 are pretty interchangeable, but if there were a lot of arguments to the function, or the string wasn't the first or last argument, I could see 2 making it easier to follow what's happening.
I tried with |
I agree with this. I would say generally compound strings in function calls looks a bit weird. |
I tried option 2 and either I did something wrong or it doesn't work: https://files.catbox.moe/7ou4w3.c |
Whoops, my bad! I think the problem is that I forgot the -static const u8 saveFailedMessage[] = //prints garbage
+static const u8 saveFailedMessage[] = _(
"{COLOR RED}ERROR! {COLOR DARK_GRAY}Flash memory not detected!\n\n"
"If playing on an emulator, set your\n"
"save type setting to\n"
"Flash 1Mb/128K and reload the ROM.\n"
"\n"
"If playing on hardware, your cart\n"
- "does not have a working flash chip.";
+ "does not have a working flash chip."); |
Description
SAVE_TYPE_ERROR_SCREEN
. If enabled, this shows an error message when the game is loaded on a cart without a flash chip or on an emulator with the wrong save type setting instead of crashing.Details
Usage
SAVE_TYPE_ERROR_SCREEN
Developers must change this value to TRUE in
include/config/save.h
to enable.Given Text
Testing
Clean Branch
You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:
Patch
wget https://files.catbox.moe/4bsipp.patch -O save.patch ; git apply save.patch ; rm save.patch
Repo
git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion saveTypeError
Manual Tests
After replicating the branch, to recreate my testing environment, you can either directly download the debug script, or manually create the changes.
Download
SAVE_TYPE_ERROR_SCREEN == TRUE
wget https://files.catbox.moe/32u54c.h -O include/config/save.h
SAVE_TYPE_ERROR_SCREEN == FALSE
wget https://files.catbox.moe/ier3wd.h -O include/config/save.h
Manual Testing
include/config/save.h
to the desired valuesVisualBoyAdvance
I can't figure out how to change the save type in mGBA 0.10.2, so I'm using VisualBoyAdvance-M 2.1.9.
To change the save type: Options > Game Boy Advance > Configure > Save Type
Verified Scenarios
All videos show the steps described in "Manual Testing"
TRUE
Zr4FbwX.1.mp4
FALSE
QbH4p3z.1.mp4
People who collaborated with me in this PR
This was originally written by by Anon822. Give them all the credit.
Discord Contact Info
I am
pkmnsnfrn
on Discord.