Skip to content

Conversation

@abdelali221
Copy link
Contributor

Exception handler now automatically returns to the HBC after timeout + Added a message that tells the user that they can press reset (or Z on their GameCube Controller) to skip timeout because users tended to just unplug their Wiis from power.

Exception handler now automatically returns to the HBC after timeout + Added a message that tells the user that they can press reset (or Z on their GameCube Controller) to skip timeout because users tended to just unplug their Wiis from power.
@DacoTaco
Copy link
Member

Hi!

thanks for the PR, i like the message being expanded!
Im surprised by the amount of people who dont know the reset buttons triggers the reload lol.

however, im not a fan that reload_timer's default is changed.
i'd rather have it that it keeps showing the error message/guru screen but also show to press reset or Z to reload.
if a program wants to auto reload, they should call the __exception_setreload function on startup.
I say that as sometimes im looking at code and the DSI screen at the same time to check what went wrong, so auto reload is a nono

can you change your code to reflect those changes?

@abdelali221
Copy link
Contributor Author

Sure! give me one minute.

while ( 1 )
{
if(reload_timer > 0) {
kprintf("\r\tReloading in %d seconds ", reload_timer/50);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this even needed? this would reprint this message on every loop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to give the user feedback about how much time is left before reloading, just so they don't assume that their Wii has crashed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to clear the line and reprint then. lookup console escape codes to clear line ^^
or find ways to clear previous line and reprint then :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed when you do a \r, it tells the console to go back to the start of the line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on real hardware and dolphin and it works flawlessly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the extra space at the end of the line was to mitigate that. I think clearing the line is still ideal though, the code is "\e[2K"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good now.

@abdelali221
Copy link
Contributor Author

@DacoTaco Using \x1b[2K seems to not work?

@abdelali221
Copy link
Contributor Author

I'm reverting to \r because it's simpler (and works fine).

@Naim2000
Copy link
Contributor

@abdelali221 \e[2K clears the line but you still need to move the cursor back with \r; use them both

@abdelali221
Copy link
Contributor Author

I'd like to know what's the point of doing a \x1b[2K first.

@DacoTaco
Copy link
Member

I'd like to know what's the point of doing a \x1b[2K first.

because what do you think will happen if you have 10 seconds until reload, and then printf with 9 seconds? or 100 seconds?

@abdelali221
Copy link
Contributor Author

That's the whole point of having a space at the end.

@DacoTaco
Copy link
Member

your space doesn't catch all cases, and is a nasty fix for the problem.

cleaned up and tested the code myself.

@DacoTaco DacoTaco merged commit ab1c181 into devkitPro:master Aug 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants