SACT: Ctrl key cancels SACT.Wait and SACT.TimerWait

This fixes an issue where the roulette in Rance 5D could not be fast
forwarded using the Ctrl key.
This commit is contained in:
kichikuou
2026-01-09 16:16:13 +09:00
parent 38dc9a7b0b
commit f2fe6b9724
3 changed files with 12 additions and 10 deletions
+7 -7
View File
@@ -1613,10 +1613,10 @@ static void TimerWait() {
int wTimerID = getCaliValue();
int wCount = getCaliValue();
while (wCount > stimer_get(wTimerID) && !nact->is_quit) {
sys_keywait(10, KEYWAIT_NONCANCELABLE);
}
int msec = (wCount - stimer_get(wTimerID)) * 10;
if (msec > 0)
sys_keywait(msec, KEYWAIT_CTRL_CANCELABLE);
TRACE("SACT.TimerWait %d,%d:", wTimerID, wCount);
}
@@ -1627,9 +1627,9 @@ static void TimerWait() {
*/
static void Wait() {
int wCount = getCaliValue();
sys_keywait(wCount*10, KEYWAIT_NONCANCELABLE);
sys_keywait(wCount * 10, KEYWAIT_CTRL_CANCELABLE);
TRACE("SACT.Wait %d:", wCount);
}
+1
View File
@@ -112,6 +112,7 @@ int sys_keywait(int msec, unsigned flags) {
key = sys_getInputInfo();
cancel_yield(); // We just yielded!
if ((flags & KEYWAIT_CANCELABLE) && key) break;
if ((flags & KEYWAIT_CTRL_CANCELABLE) && RawKeyInfo[KEY_CTRL]) break;
}
return key;
+4 -3
View File
@@ -38,9 +38,10 @@ struct SDL_Point;
#define SYS35KEY_ESC 64
#define SYS35KEY_TAB 128
#define KEYWAIT_NONCANCELABLE 0
#define KEYWAIT_CANCELABLE 1
#define KEYWAIT_SKIPPABLE 2
#define KEYWAIT_NONCANCELABLE 0
#define KEYWAIT_CANCELABLE 1
#define KEYWAIT_SKIPPABLE 2
#define KEYWAIT_CTRL_CANCELABLE 4
// System3.x key codes (IG command, etc.)
// These are originated from Windows virtual key codes (VK_*).