aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/cycle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r--engines/agi/cycle.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index f253804da3..4148306de2 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -153,9 +153,11 @@ void AgiEngine::interpretCycle() {
oldScore = getVar(VM_VAR_SCORE);
setFlag(VM_FLAG_ENTERED_CLI, false);
_game.exitAllLogics = false;
+ _veryFirstInitialCycle = false;
artificialDelay_CycleDone();
resetControllers();
}
+ _veryFirstInitialCycle = false;
artificialDelay_CycleDone();
resetControllers();
@@ -351,7 +353,7 @@ int AgiEngine::playGame() {
if (appleIIgsDelayOverwrite->gameId == getGameID())
break; // game found
appleIIgsDelayOverwrite++;
- }
+ }
}
do {
@@ -403,7 +405,7 @@ int AgiEngine::playGame() {
if (timeDelayOverwrite >= 0) {
if (timeDelayOverwrite != timeDelay) {
// delayOverwrite is not the same as the delay taken from the scripts? overwrite it
- warning("AppleIIgs: time delay overwrite from %d to %d", timeDelay, timeDelayOverwrite);
+ //warning("AppleIIgs: time delay overwrite from %d to %d", timeDelay, timeDelayOverwrite);
setVar(VM_VAR_TIME_DELAY, timeDelayOverwrite - 1); // adjust for Apple IIgs
timeDelay = timeDelayOverwrite;
@@ -411,7 +413,27 @@ int AgiEngine::playGame() {
}
}
+ // Increment the delay value by one, so that we wait for at least 1 cycle
+ // In Original AGI 1 cycle was 50 milliseconds, so 20 frames per second
+ // So TIME_DELAY 1 resulted in around 20 frames per second
+ // 2 resulted in around 10 frames per second
+ // 0 however resulted in no limits at all, so the game ran as fast as possible
+ // We obviously do not want the game to run as fast as possible, so we will use 40 frames per second instead.
+ timeDelay = timeDelay * 2;
+ if (!timeDelay)
+ timeDelay = 1;
+
+ // Our cycle counter runs at 25 milliseconds.
+ // So time delay has to be 1 for the originally unlimited speed - for our 40 fps
+ // 2 for 20 frames per second
+ // 4 for 10 frames per second
+ // and so on.
+
if (_passedPlayTimeCycles >= timeDelay) {
+ // code to check for executed cycles
+ // TimeDate time;
+ // g_system->getTimeAndDate(time);
+ // warning("cycle %d", time.tm_sec);
inGameTimerResetPassedCycles();
interpretCycle();
@@ -495,7 +517,13 @@ int AgiEngine::runGame() {
break;
case Common::kRenderHercA:
case Common::kRenderHercG:
- setVar(VM_VAR_MONITOR, kAgiMonitorHercules);
+ // Set EGA for now. Some games place text differently, when this is set to kAgiMonitorHercules.
+ // Text placement was different for Hercules rendering (16x12 instead of 16x16). There also was
+ // not enough space left for the prompt at the bottom. This was caused by the Hercules resolution.
+ // We don't have this restriction and we also support the regular prompt for Hercules mode.
+ // In theory Sierra could have had special Hercules code inside their games.
+ // TODO: check this.
+ setVar(VM_VAR_MONITOR, kAgiMonitorEga);
break;
// Don't know if Amiga AGI games use a different value than kAgiMonitorEga
// for vMonitor so I just use kAgiMonitorEga for them (As was done before too).