1323 Commits

Author SHA1 Message Date
Martin Kiewitz
ab22c27f7a AGI: Cut menu in case menu names are too long
Required for games that add to many names or add names, that are
too long. The code needs to get adjusted anyway for different
platforms, so for now just cut the menu names instead
Required for at least the fan game Get Outta Space Quest
2016-02-09 14:54:46 +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
5e67457553 AGI: Resource checking for setView/setLoop/setCel
Also loading view resources in case they are not loaded on set.view
Fixes crash in Larry 1 for Apple IIgs after getting beaten up
by taxi driver (was an original game bug). Even makes it work now.
Original interpreter closed down in this situation.
For setLoop() and setCel() error()s were added for this case
to avoid crashes.
Also: screenObj->viewData renamed to screenObj->viewResource
2016-02-07 19:59:23 +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
d836a52557 AGI: Do not set TIME_DELAY at all on restart
Original AGI did not do it and it would ruin the game speed of
at least Larry on Apple IIgs after dying.
2016-02-07 01:10:38 +01:00
Martin Kiewitz
c43ee3a7a5 AGI: Fix regression from stringWordWrap rewrite
Space at the end of the string was handled inaccurately
Fixes kq1 text scrolling bug #7021
Rewrite was done in commit efb65324688f20cc534a25312f558f9264125762
2016-02-07 00:24:11 +01:00
Martin Kiewitz
2b216e1494 AGI: Move debugger to Ctrl-Shift-D
because of Police Quest 1 using Ctrl-D for calling dispatch.
Solves FR #395
2016-02-06 03:00:20 +01:00
Martin Kiewitz
bb9052bf6f AGI: Switch to CLUT3 for Macintosh as default 2016-02-06 00:03:17 +01:00
Martin Kiewitz
088c4d118c AGI: Adding Macintosh palettes for GR+SQ2
But not actually using the GR palette, because it looks horrible.
2016-02-05 23:53:26 +01:00
Martin Kiewitz
eaf0aeb604 AGI: Make it possible to also force CGA/EGA/VGA
...rendering
2016-02-05 22:09:11 +01:00
Martin Kiewitz
a7ffda3ba1 AGI: fix build powf() -> pow() 2016-02-05 17:03:38 +01:00
Martin Kiewitz
f09a15f276 AGI: Render mode Macintosh added
Palette + mouse cursor + box frame color only atm
Thanks to wjp for gamma correction
Not sure, if our current color adjustment is correct
Should be checked by using actual hardware
2016-02-05 16:41:02 +01:00
Martin Kiewitz
f954603f8d AGI: GfxMgr::drawBox now using kRenderMacintosh 2016-02-05 14:23:23 +01:00
Martin Kiewitz
efb6532468 AGI: Rewrote stringWordWrap()
Original code wasn't accurate
2016-02-05 14:13:45 +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
26791ec7d9 AGI: Add verbose flags to debug command screenobj 2016-02-04 18:49:15 +01:00
Martin Kiewitz
240982a46e AGI: Fix cursor position after save game descr.
Cursor was placed incorrectly after entering saved game description
using original load/save dialogs.
2016-02-04 17:22:23 +01:00
Martin Kiewitz
af8dbfc998 AGI: More accurate menu mouse support
Menu items did not switch to inverted state when they are disabled.
2016-02-04 16:42:41 +01:00
Martin Kiewitz
9620979def AGI: Add Atari ST system UI buttons 2016-02-04 15:30:50 +01:00
Martin Kiewitz
db03baed02 AGI: Add buttons to save/restore verify dialogs 2016-02-04 13:58:10 +01:00
Martin Kiewitz
c17cd72bae AGI: Add Amiga system UI buttons
Also adjust window frames for Amiga. Amiga also uses hi-res ones.
2016-02-04 13:38:18 +01:00
Martin Kiewitz
e019323f07 AGI: Add Apple IIgs system UI buttons
For Restart/Quit/Pause dialog
2016-02-04 12:51:35 +01:00
Martin Kiewitz
dbdf77660e AGI: Fix disabled look to work properly in menus 2016-02-04 00:55:53 +01:00
Martin Kiewitz
f6c9cffa26 AGI: Add different window frames for Macintosh
Also work on drawCharacter code for SystemUI usage
2016-02-03 22:47:58 +01:00
Martin Kiewitz
0f026c7766 AGI: Add different window frames for Apple IIgs
Only slightly different than on PC
2016-02-03 22:25:52 +01:00
Martin Kiewitz
a9bb8c3a50 AGI: Message box mouse support 2016-02-03 08:27:44 +01:00
Martin Kiewitz
d23871fdd8 AGI: Rename WINDOWRESET to WINDOW_AUTO_CLOSE_TIMER 2016-02-03 04:17:15 +01:00
Martin Kiewitz
3eebf2eb41 AGI: Increase time delay for Apple IIgs
It seems that either Apple IIgs ran very slowly or that its
AGI interpreter didn't do the delays as on all the other platforms.
Further investigation needed
Fixes all sorts of games running now way too fast.
2016-02-03 03:49:37 +01:00
Martin Kiewitz
9a3454393b AGI: Remove unused initialized variable 2016-02-03 03:13:25 +01:00
Martin Kiewitz
cc55cb13d3 AGI: Remove _game.state, not needed anymore 2016-02-03 03:07:50 +01:00
Martin Kiewitz
34117170f2 AGI: Change cycle delay handling, seems to fix GR
Removed pollTimer()
Renamed pause() to wait()
Doing 10 msec delays instead of at least 50 msec per EventProcess
Seems to fix weird Gold Rush ingame timer issue?! bug #4147
2016-02-03 02:40:01 +01:00
Martin Kiewitz
778c1ddb69 AGI: Cycle event processing changed
processEvents() renamed to processScummVMEvents()
mainCycle() renamed to processAGIEvents()
have.key now sets up an inner loop and calls processAGIEvents()
to avoid any further cycle work processing
2016-02-03 02:21:07 +01:00
Martin Kiewitz
c2038e00d0 AGI: Call update screen in have.key for now
Some games call it in an endless loop until a key is returned
2016-02-03 01:47:26 +01:00
Martin Kiewitz
702b66a49d AGI: Make inner loop handlers consistent 2016-02-03 01:41:32 +01:00
Martin Kiewitz
8271058a45 AGI: Implement messageBox() as inner loop
Also remove _game.keypress, _game.msgBoxTicks
2016-02-03 01:32:57 +01:00
Martin Kiewitz
9fecbe58a1 AGI: Remove Gold Rush workaround, no longer needed 2016-02-03 01:03:40 +01:00
Martin Kiewitz
563d890991 AGI: Fix regression of have.key changes
original commit 8269a94bcd55200f7ae8aba00c7b6fd0d37b9a37
Now hopefully properly implemented.
Adjusted a few more inaccuracies
(we set v19 to 0, where we shouldn't have)
2016-02-03 00:26:35 +01:00
Martin Kiewitz
920bea0fd9 AGI: add drawCharacterOnDisplay() 2016-02-02 23:27:13 +01:00
Martin Kiewitz
5f41a09701 AGI: Remove inputMode, not needed anyore 2016-02-02 23:02:50 +01:00
Martin Kiewitz
cdc6a2f3c3 AGI: test commands cleanup 2016-02-02 22:41:01 +01:00
Martin Kiewitz
8269a94bcd AGI: Use inner loop functionality for have.key
Also do it like the original interpreter did it
2016-02-02 22:26:39 +01:00
Martin Kiewitz
8a29f98c9c AGI: Don't pause in game timer while in menus
Original interpreter did not do it and we paused music/sfx,
which the original interpreter also didn't do.
Shouldn't cause issues.
2016-02-02 21:28:47 +01:00
Martin Kiewitz
5cd7ad8622 AGI: code formatting 2016-02-02 20:41:11 +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
9ad3712aa3 AGI: Add WORKAROUND comment to "render after menu"
see commit 0b75bf37219cf49f274da330a44e81068152599c
Original AGI did not do, what we are doing now
2016-02-02 19:58:55 +01:00
Martin Kiewitz
223ce70eab AGI: Don't use status row for menu mouse trigger
Use hardcoded first line instead
In Donald Duck the status line is at line 24, but also hidden
2016-02-02 17:47:17 +01:00
Martin Kiewitz
0b75bf3721 AGI: Render after menu, when playarea starts at 0
Fixes graphics glitch for Donald Duck
2016-02-02 17:44:53 +01:00