mirror of
https://github.com/JorjBauer/aiie.git
synced 2024-11-25 19:31:36 +00:00
initialize cpu speed state in the bios menu so it shows the correct value
This commit is contained in:
parent
826e5d14c5
commit
c0f105807c
26
bios.cpp
26
bios.cpp
@ -173,6 +173,7 @@ bool BIOS::loop()
|
||||
bool hitReturn = false;
|
||||
|
||||
uint16_t rv;
|
||||
bool changingMenu = false;
|
||||
if (g_keyboard->kbhit()) {
|
||||
switch (g_keyboard->read()) {
|
||||
case PK_DARR:
|
||||
@ -187,11 +188,13 @@ bool BIOS::loop()
|
||||
selectedMenuItem = 0;
|
||||
selectedMenu++;
|
||||
selectedMenu %= NUM_TITLES;
|
||||
changingMenu = true;
|
||||
needsRedraw = true;
|
||||
break;
|
||||
case PK_LARR:
|
||||
selectedMenuItem = 0;
|
||||
selectedMenu--;
|
||||
changingMenu = true;
|
||||
if (selectedMenu < 0) {
|
||||
selectedMenu = NUM_TITLES-1;
|
||||
}
|
||||
@ -206,6 +209,29 @@ bool BIOS::loop()
|
||||
}
|
||||
}
|
||||
|
||||
if (changingMenu && selectedMenu == BIOS_HARDWARE) {
|
||||
// Need to initialize the CPU speed from g_speed
|
||||
switch (g_speed) {
|
||||
case 1023000:
|
||||
currentCPUSpeedIndex = CPUSPEED_FULL;
|
||||
break;
|
||||
case 1023000/2:
|
||||
currentCPUSpeedIndex = CPUSPEED_HALF;
|
||||
break;
|
||||
case 1023000*2:
|
||||
currentCPUSpeedIndex = CPUSPEED_DOUBLE;
|
||||
break;
|
||||
case 1023000*4:
|
||||
currentCPUSpeedIndex = CPUSPEED_QUAD;
|
||||
break;
|
||||
default:
|
||||
// Dunno what happened, but we'll default back to full (normal) speed
|
||||
currentCPUSpeedIndex = CPUSPEED_FULL;
|
||||
g_speed = 1023000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (selectedMenu) {
|
||||
case BIOS_AIIE:
|
||||
rv = AiieMenuHandler(needsRedraw, hitReturn);
|
||||
|
Loading…
Reference in New Issue
Block a user