Commit Graph
167 Commits
Author SHA1 Message Date
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
Martin Kiewitz dbea55b36b AGI: Rename nonBlockingText -> artificialDelay
Also add a table for Apple IIgs games for music issues like in PQ1
intro, where the developers thought that loading a new room would
take X amount of time and they started loading before the music was
done. In our AGI music may get cut off because of this.

It of course also happens, when using the original interpreter,
as soon as you emulate a faster processor. Which means this
is also a workaround.

See bug #7026
2016-02-11 17:26:25 +01:00
Martin Kiewitz c26d3fd62f AGI: Change set.simple string copy code 2016-02-09 13:51:14 +01:00
Martin Kiewitz f5a83adc01 AGI: Fix various CIDs
CID 1350104: regression from graphics rewrite in C64 picture drawing
CID 1350101: potential buffer overflow in set.simple command
CID 1350112: uninitialized variable in TextMgr
CID 1350113: false positive uninitialized variable in SystemUI
CID 1350114: potentially uninitialized variable in IIgsSample
CID 1350117: false positive uninitialized variable in InventoryMgr
CID 1350103: code bug in CGA rendering TextMgr::charAttrib_Set()
CID 1350109: false positive in GfxFont::loadFontAmigaPseudoTopaz()
CID 1350111: original AGI uninitialized memory issue
             in SpritesMgr::showObject
2016-02-09 12:47:45 +01:00
Martin Kiewitz e155e1bfa9 AGI: Stop set.simple getting called for <2.425
Also stop it from getting called by 2.440 AGI.
Was implemented for 2.425, removed in 2.440 and re-added
in 2.917.
The opcode is called after answering the phone at the store
(555-6969) in Apple IIgs Larry. It can't be automatic saving.
See script 22, line 678 in AGI Studio.
Stops automatic saving getting enabled for Larry 1 Apple IIgs.
Also added warning messages to other commands as well.
2016-02-07 18:05:51 +01:00
Martin Kiewitz 72a3cae20b AGI: Restrict hide.mouse to AGI3 only
Command seems to not have existed in at least 2.917 (PC).
Space Quest 2 on Apple IIgs calls it during intro, but never
calls show.mouse. SQ2 on other platforms does not make this call.
Mouse cursor is not hidden under emulator, so atm I have to assume
that it's either a dodgy script or there was something else hacked
into the interpreter back then.

This fixes Space Quest 2 Apple IIgs losing mouse cursor, when
the intro is not canceled.
2016-02-04 23:24:59 +01:00
Martin Kiewitz 4b7d49dcff AGI: Fix Hold-Key-Mode implementation
Hold-Key-Mode got introduced v2.425, it was simply not possible
to disable it until 3.098.
Now creating a AGI_KEY_STATIONARY event, so that it works properly

Fixes Mixed Up Mother Goose
2016-02-04 22:53:15 +01:00
Martin Kiewitz 9f7ff8351b AGI: Fix mouse code for transitions
Do not show mouse cursor after transition, when it's currently
switched to hidden. Do the same for hide/show.mouse opcodes.
2016-02-04 21:21:52 +01:00
Martin Kiewitz 9fecbe58a1 AGI: Remove Gold Rush workaround, no longer needed 2016-02-03 01:03:40 +01:00
Martin Kiewitz 5f41a09701 AGI: Remove inputMode, not needed anyore 2016-02-02 23:02:50 +01:00
Johannes Schickel 6778175f6d AGI: Fix formatting.
This mostly enforces tabs for indentation and spaces for formatting. But also
fixes spaces on empty lines, some extra/missing spaces.

astyle + manual fixup
2016-02-02 20:15:18 +01:00
Martin Kiewitz 05a5fc1b65 AGI: mouse support for menu 2016-02-02 17:28:58 +01:00
Martin Kiewitz 2a4a290d31 AGI: change how menus are triggered on Non-PC 2016-02-01 19:08:22 +01:00
Martin Kiewitz 9fff1686fc AGI: Pass vm pointer directly to commands
No functional change
2016-02-01 16:37:28 +01:00
Martin Kiewitz 839ac0a6a4 AGI: Rename _game.lognum to _game.curLogicNr
Also a bit of cleanup
2016-02-01 16:21:13 +01:00
Martin Kiewitz f86d68d214 AGI: Remove old clockEnabled boolean
No longer needed
We use ScummVM system total play time functionality instead
2016-02-01 15:54:32 +01:00
Martin Kiewitz 896bf83ddc AGI: Fix pause command effectively freezing game
In game timer wasn't resumed, which caused no more cycles to
get executed.
2016-02-01 15:52:18 +01:00
Martin Kiewitz c28e101cdb AGI: implement predictive dialog 2016-02-01 01:34:36 +01:00
Martin Kiewitz fd9c46831d AGI: remove timer hack, implement in game timer
in game timer is now updated, when scripts read in game timer
VM variables and during main loop. ScummVM total play time feature
is used for it. Game cycle syncing is done at the same time.
2016-01-31 20:53:36 +01:00
Martin Kiewitz 4bc01ab7d5 AGI: getflag/setflag/etc. cleanup
renamed getflag() to getFlag()
renamed setflag() to setFlag()
renamed flipflag() to flipFlag()
preagi: renamed setFlag for this engine to setWinnieFlag
2016-01-31 17:56:53 +01:00