Commit graph

186 commits

Author SHA1 Message Date
sluicebox
faaf89389b AGI: Implement near.water opcode
Used by Black Cauldron AGIv1 when filling flask
2025-01-30 21:14:57 -08:00
sluicebox
5c30bfb1b1 AGI: Update misc AGIv1 opcode details 2025-01-30 21:14:03 -08:00
sluicebox
3138057f69 AGI: Implement AGIv1 set.bit and clear.bit opcodes 2024-12-30 14:25:42 -08:00
sluicebox
c6c2924258 AGI: Cleanup PictureMgr 2024-12-13 09:31:01 -08:00
sluicebox
1b5f759ff2 AGI: Add workaround for LSL1 repeating message
Fixes bug #15293
2024-11-13 13:42:02 -08:00
Miro Kropacek
5cc7ddd240 AGI: Process events while executing commands
This has a direct effect in e.g. Police Quest Apple IIGS demo where the
script checks the state of MIDI playback. This works fine as long as the
playback is executed in another thread but on platforms which depend on
regular pollEvent() events it leads to an infinite loop within
AgiEngine::runLogic().
2024-11-13 09:48:44 +02:00
sluicebox
ce2410f7a3 AGI: Update Apple IIgs opcodes
- discard.sound has three potential opcode values depending on the
  interpreter version; this is now handled and documented.
- Unknown opcode 175 is now handled and its presence is documented.
- Fixes AGIDEMO and PQ1 calling set.simple instead of discard.sound.
- Reverted SQ2 workaround now that its discard.sound calls are
  correctly handled: 736d7cd533
2024-10-28 21:02:52 -07:00
sluicebox
f15c08bfb6 AGI: Remove extra AGI256 picture render
We duplicated show.pic in the AGI256 opcode for loading pictures,
but AGI256 already required scripts to call show.pic after loading.
2024-10-28 21:02:51 -07:00
sluicebox
a5909e5f60 AGI: Move AGI256 picture opcode into function 2024-10-28 21:02:51 -07:00
sluicebox
22a4111c57 AGI: Add Apple II speed controls, implement set.speed 2024-09-16 20:27:39 -07:00
sluicebox
3b7a9e1663 AGI: Add setFlagOrVar() 2024-09-08 17:15:19 -07:00
sluicebox
6ed7bd1263 AGI: Add Apple II and CoCo3 sound-blocking behavior 2024-08-31 17:36:08 +03:00
sluicebox
ab669cbb6b AGI: Cleanup warning messages 2024-08-17 17:56:39 -07:00
sluicebox
6b50eadebf AGI: Remove "agi" prefix from AgiEngine method names 2024-08-17 17:56:29 -07:00
Hubert Maier
4906420455 JANITORIAL: Fix succeded and bizzare typos in op_cmd.cpp 2024-07-03 11:09:22 +03:00
sluicebox
2a66a9d8a7 AGI: Add bounds checking to strings
Fan games are known to use out of bounds string numbers
2024-04-15 18:23:47 -07:00
sluicebox
9795144183 AGI: Implement motion/cycler overwrite behavior
- Fixes Black Cauldron witches not disappearing at end of game
- Properly fixes Donald Duck's Playground intro, bug #14170
- Continues to fix KQ1 eagle jump, bug #7046

Big thanks to @AGKorson for providing detailed information on this
interpreter behavior, script analysis, and maintaining excellent
AGI documentation in WinAGI.

See also:
8a595e7771
5484f0bc58
cc7cbfe626
2024-03-21 10:02:02 +02:00
sluicebox
f4201eeda8 AGI: More misc cleanup 2024-03-10 17:20:54 -06:00
sluicebox
065d049008 AGI: op_cmd cleanup 2024-03-09 09:07:59 -07:00
sluicebox
30bfbecc1f AGI: Fix KQ3 Rosella staircase bug
Fixes bug #11996
2024-03-06 11:21:46 -07:00
sluicebox
126c19855a AGI: Restrict AGIMOUSE feature to AGIMOUSE games
Fixes bug #12747 where fan game Phil's Quest immediately ends, but this
also affects early KQ2 and other games.
2024-03-02 13:22:38 -07:00
sluicebox
89723ae889 AGI: Move SQ2 Apple IIgs unknown opcode handling 2024-01-30 13:22:44 -08:00
sluicebox
a8145c5930 AGI: Cleanup op_cmd.cpp 2024-01-30 13:22:44 -08:00
sluicebox
0c06708053 AGI: Fix opcode table version detection
- Fixes Manhunter 1 Amiga / Atari ST not starting
- Fixes Manhunter 2 Amiga not starting
- Fixes Gold Rush Atari ST
- Fixes King's Quest IV Apple IIGS
- Fixes Black Cauldron Apple IIGS
- Uses original opcode name: get.mse.posn (from GR Amiga)
2024-01-26 13:34:53 -08:00
sluicebox
bc8550ce02 AGI: Allow message box to be drawn over menu
Fixes five Mixed-Up Mother Goose nursery rhymes. Bug #13820
2024-01-22 18:06:40 -07:00
sluicebox
8f2127e418 AGI: Cleanup graphics code 2024-01-22 17:32:46 -07:00
sluicebox
0877da67b2 AGI: Fix uninit memory use, crash on error
Fixes random crashes when an illegal opcode is encountered.

See bug #14699
2024-01-01 21:59:20 -08:00
Eugene Sandulenko
3a1701536f
AGI: Avoid using bitfields in debugC() 2023-12-28 01:41:10 +01:00
Le Philousophe
3457d49fd5 AGI: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Le Philousophe
a91558aefd AGI: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Daniel Abramowitz
f47977db1d AGI: Format Logs
Use the text's stringPrintf function to format the log messages.
2022-10-17 07:26:46 +03:00
Daniel Abramowitz
65aba03517 AGI: Write log() Function to File
Now the log() function writes to a file, as
the AGI engine did.

It appears that ScummVM doesn't have any "append" functionality.
As a result, I made this implementation create a new file each time
a message is logged. Note that the file is only created if the
log() function is called. The file name includes the game name
and the current time, ensuring that logs won't be overwritten.

The format is: agi.<gameid>.<currentime>.log and will be logged to
the working directory.

Last week I first implemented the log() function. In that commit
I just had it log to the console. In this commit we start
writing to a file.
2022-10-16 21:52:21 +02:00
Daniel Abramowitz
a03b25a61a AGI: Initial Implemention of AGI's log() Function
This log() function was previously unimplemented in ScummVM. Its
purpose is to write log messages and some metadata about the game state
to a file.

This functionality does not affect game play. Presumably Sierra used
this to beta test their games. They would log the words that their
testers used but the game did not understand. The testers would
then submit the log file back to Sierra. Sierra would add the missing
words or descriptions to their games before release.

This is the first diff of a couple which will incrementally add this
functionality. In this diff, we just collect the information we need to
generate a log message close to what AGI actually did.

There are two notable differences which will be fixed in future diffs:
(See the comments in the code for more details.)
1. No message formatting.
2. We log to the console only.

For context, I'm currently writing an AGI game and would like to
collect this output from my friends and family, which is why I'm
implementing this functionality today.
2022-10-10 08:22:16 +03:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh
f1f4657b10 AGI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Thunderforge
35c3668275 COMMON: Fixing misspellings "occured" -> "occurred"
Fixing this misspelled word across multiple parts of the codebase.
2021-09-25 21:36:42 +03:00
sluicebox
93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
Henrik "Henke37" Andersson
7ea98181e2 AGI: Use PauseToken 2020-05-10 23:39:31 +02:00
Filippos Karapetis
5b7f11ded7 AGI: Cleanup game flags 2020-01-12 23:12:15 +02:00
Martin Kiewitz
77d232fbe2 AGI: always stop sound/music, when calling restore/save since 2.272
and therefore set the "fully played"-flag/variable, so that scripts
don't block forever in for example Police Quest 1 poker back room.
Fixes bug #9706
Thanks waltervn
2017-02-25 20:43:14 +01:00
Martin Kiewitz
9dd0cd51d5 AGI: Clean up VM opcode handling
so that invalid opcodes won't crash ScummVM anymore
2017-02-23 23:54:45 +01:00
Eugene Sandulenko
0d356d1c66 AGI: Safer string copying 2016-05-10 18:07:35 +02:00
Martin Kiewitz
e1c36a52b5 AGI: Add support for upscaling and Hercules hires font
- User option to force Hercules hires font for any rendering mode
- Also change mouse cursor hotspots from 1,1 to 0,0
- Fix inaccuracy in mouse controlled game menu
- Change render_Block(), drawBox(), drawDisplayRect() to use
  upper Y instead of lower Y. Original AGI uses lower Y, but
  upper Y makes upscaling way easier.
2016-02-27 21:44:21 +01:00
Martin Kiewitz
5484f0bc58 AGI: Add detection+workaround for endofloop+motion at the same time
Detects when end.of.loop + motions are used on the same screen
object at the same time, which would have resulted in flag
corruption in the original interpreter. We detect this
situation now, show a warning and disable the cycler in case
cycler was activated first.
This solves a new issue in kq1, when grabbing the eagle in room
22, that was previously hidden just like in the original AGI.
Fixes bug #7046
2016-02-19 10:34:37 +01:00
Martin Kiewitz
ed92ccde23 AGI: Apple IIgs time delay override MH1 completed
+ Disable hide.mouse for MH1 Apple IIgs
2016-02-18 16:55:49 +01:00
Martin Kiewitz
591e0522b9 AGI: Set.pri.base comments added (Apple IIgs KQ3+SQ2)
For KQ3 the calls are currently blocked b/c interpreter version
For SQ2 they aren't, which causes a few priority issues at the end
2016-02-16 16:51:43 +01:00
Martin Kiewitz
7b75936f56 AGI: Add heuristic to detect delay loops within scripts
And in that case poll events, delay for a few milliseconds and
update screen.
This somewhat worked before the graphics rewrite because of
a timer hack.
This one tries to detect actual inner loops.
Happens in at least Police Quest 1 when playing poker.
2016-02-14 22:43:52 +01:00
Martin Kiewitz
8eefa4e2b5 AGI: Added a few comments about KQ1
set.simple gets called when killing the witch + planting beans
Right after bowing to the king, ego faces away from him. This
issue was already present in 1.7.0. Could probably get solved
later via script patcher.
2016-02-14 15:17:57 +01:00
Martin Kiewitz
9a9ddc777e AGI: set.pri.base was actually available in AGI2.425
Was available only in 2.425 and in 2.936+.
Fixing comment accordingly. Also allowing the command for 2.425.
2016-02-14 02:01:28 +01:00
Martin Kiewitz
9f59b5ed7c AGI: Fix priority band handling
- Fix saving/loading priority bands table. Now saving the actual raw
  data
- Now also saving the flag, that defines if the priority table got
  modified by scripts
- For older saved games it will try to figure out the state of that
  flag
- Blocking set.pri.base for AGI below 2.936
- set.pri.base was actually introduced in 2.936 and not AGI3
- The set.pri.base bug was present in 2.936 as well
- Saved games created between the graphics rewrite and this
  commit may have priority issues for games, that used AGI2.936+
2016-02-13 20:42:30 +01:00