Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions libogc/exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,28 @@ void __exception_setreload(int t)
static void waitForReload(void)
{
u32 level;

PAD_Init();

kprintf("\n\n\tPress RESET (or Z on your GameCube Controller) to reload");

if(reload_timer > 0)
kprintf("\n\tReloading in %d seconds\n", reload_timer/50);
if(reload_timer > 0) {
kprintf("\n\n\tReloading in %d seconds", reload_timer/50);
}

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.

}
PAD_ScanPads();

int buttonsDown = PAD_ButtonsDown(0);

if( (buttonsDown & PAD_TRIGGER_Z) || SYS_ResetButtonDown() ||
reload_timer == 0 )
{
kprintf("\n\tReload\n\n\n");
kprintf("\n\n\tReload\n\n\n");
_CPU_ISR_Disable(level);
__reload ();
}
Expand Down