3286 Commits

Author SHA1 Message Date
D G Turner
971b16fdac SCUMM: HE: Fix MSVC Warning
This was reported by Henke37 on IRC.
2019-09-15 22:47:43 +01:00
D G Turner
84d0a294af SCUMM: Replace Various String Functions with Common String Usage
This removes the dependency on the unsafe strcpy and strcat string
functions with usage of Common::String instead.
2019-09-15 20:20:03 +01:00
athrxx
0e73472207 AUDIO: (FM-Towns/PC98) - cleanup mutex handling 2019-08-07 16:43:06 +02:00
athrxx
aecf194880 SCUMM: (iMUSE/Amiga) - minor fixes
- At at least one place in INDY4 the game attempts to send a Roland MT-32 patch to the Amiga driver. This will fail and thus not cause any harm, but I have added a check nonetheless. The original Amiga driver ignores sysex messages that don't have the iMuse manufacturer id 7D.
- In INDY4 the iMuse player thinks it has a percussion channel due to the fact that it plays ROL resources. This should also be irrelevant for the actual playback, but I have added a check for that, too.
2019-07-22 20:17:38 +02:00
jepael
afb9ff0048 SCUMM: (iMUSE/Amiga) - Fix compiler warning (#1751) 2019-07-17 21:10:39 +02:00
athrxx
4c45f9f39f SCUMM: (iMUSE/Amiga) - fix INDY4 instruments handling
FOA Amiga uses 'ROL ' resources (unlike MI2 which has 'AMI ' resources). So our imuse player treated those as MT32 tracks playing on a non-MT32 device and applied GM mapping. Which of course messed up the instruments.
2019-07-17 17:26:52 +02:00
athrxx
4c6ff7843f SCUMM: remove unused declarations
(several function declarations in imuse_internal.h)
2019-07-17 17:26:52 +02:00
athrxx
7478cffd88 SCUMM: (iMUSE/Amiga) - cleanup 2019-07-17 17:26:51 +02:00
athrxx
19643175a8 SCUMM: limit 'Unrecognized base tag' warning to valid cases
This warning will not only show up if a tag is actually unrecognized but also in cases where the tag is recognized, but the resource size is 0. This happens quite a lot in the Amiga version of MI2 with 'SOU ' tags.
2019-07-14 21:45:52 +02:00
athrxx
4ee4d2d9af SCUMM: (FM-Towns Audio) remove TODO
The audio track is not broken. LEC simply didn't make good  euphony music tracks for the FM-Towns. There is nothing we can do about that.

The TODO implies that someone should mess around with the audio data (change the composition?).
2019-07-14 21:45:48 +02:00
athrxx
01f99f1a0a SCUMM: imuse driver directory cleanup
- move mac, pc speaker and fm-towns ims sound drivers into separate directory

(AdLib and MT32/GM drivers are still too entangled with common code to be moved so easily, especially MT32/GM. It would require lots of changes to the common code and possibly to all engines using the MidiDriver class. So I leave that for now.)
2019-07-14 21:45:43 +02:00
athrxx
d1b64aab0c SCUMM: (iMuse/Amiga) - improve accuracy
This fixes the issue that some rhythm instruments didn't receive correct notes. The changes have been limited to the Amiga versions.
2019-07-14 21:45:29 +02:00
athrxx
0899ecc987 SCUMM: hook up Amiga MI2 + INDY4 to new sound driver 2019-07-14 20:56:27 +02:00
athrxx
9afdde2601 SCUMM: add Amiga iMuse sound driver
(applies to MI2 and INDY4)
2019-07-14 20:56:27 +02:00
Torbjörn Andersson
1e23d43006 SCUMM: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that
contain non-POD data types. Get around that by either initializing
the object when created, or by adding a reset() method.
2019-07-14 14:58:19 +03:00
Filippos Karapetis
174721e911 SCUMM: Fix MSVC warnings
- Change float suffix to uppercase
- Initialize potentially uninitialized variables
- Fix default cases in switch statements
2019-05-27 14:53:42 +03:00
Eugene Sandulenko
eac0b16750 SCUMM: HE: Added some names to basketball U32 commands 2019-05-25 20:54:56 +02:00
Robert Crossfield
71172add9c SCUMM: Original V0-V2 flashlight shape and size for MM/Zak (#10947, #10951) 2019-05-05 15:41:20 +03:00
Cameron Cawley
8c2b09d919 COMMON: Replace NEResourceType and PEResourceType with a shared enum 2019-05-01 23:52:56 +03:00
Cameron Cawley
bcef809e61 WINCE: Fix compilation 2019-04-15 08:06:39 +03:00
Zhiqi Yin
efa9717c69 SCUMM HE: Bug fix for moonbase stack memory corruption
What:
The bug is reproducible in the following ways:
1. quiting the game
2. enter challenge mode state 2, when the game starts move mouse around
the menu buttons (choose building or weapons)
Observed behavior: In he/wiz_he.cpp:2839, the function failed to return since
the stack around variable 'color' was corrupted. The game will crash then.

Analysis:
Since other function will modify memory area around local variable 'color',
the bug shoud be caused by memory overwritten. The memory write happens
in this modified file. From the code, it only wants to write a certain amount
of pixels. So I found 2 places where more pixels are written. This causes
stack memory corruption.

Fix:
Add checking. If we have written enough pixels then break.

Testing:
The game UI looks correct. Single player mode game is tested.
Bug no longer observable. Tested for both cases mentioned above.
2019-03-12 00:25:25 +01:00
Ben Castricum
9b56d7c6bc SCUMM: MONKEY2: Skip extra code on FMTOWNS, fixes bug #2223 2018-10-02 19:32:32 +01:00
Colin Snover
072a52a9d2 SCUMM: Replace use of strdup with Common::String 2018-08-18 16:30:05 +02:00
Ben Castricum
91b17af1cf SCUMM : Add support for European Wii Pajama Sam (EAN3546430138939) 2018-08-18 13:51:54 +02:00
Paul Gilbert
11e33ba3fc JANITORIAL: Removing trailing spaces after int casts 2018-08-17 20:30:20 -07:00
Adrian Frühwirth
f99977255c SCUMM: Add another German Mac version of DOTT
Fixes Trac#10616.
2018-07-19 20:50:08 +02:00
Adrian Frühwirth
7df014ea6d SCUMM: Clarify workaround for Venice music in Indy 3 FMTOWNS 2018-07-02 14:45:54 +02:00
Sven Meier
64c54591c3 SCUMM: Workaround erroneous AKC_JUMP in German SPY Fox 3
Fixes Trac#3813 and makes this version of the game completable.
2018-06-23 13:50:57 +02:00
Adrian Frühwirth
48db9f04ea SCUMM: Fix recent commit to compile under all circumstances 2018-06-06 20:53:14 +02:00
Adrian Frühwirth
788d85d6b8 SCUMM: Work around distorted speech on submarine in Indy4
The speech sample at VCTL offset 0x76ccbca ("Hey you!") which is used
when Indy gets caught on the German submarine seems to not be a VOC
but raw PCM s16be at (this is a guess) 44.1 kHz with a bogus VOC header.
To work around this we skip the VOC header and decode the raw PCM data.

Fixes Trac#10559
2018-06-06 18:20:20 +00:00
Torbjörn Andersson
fba0afefa5 SCUMM: Remove unnecessary space. 2018-06-04 06:41:51 +02:00
Adrian Frühwirth
d433aedf37 SCUMM: Improve 'imuse play' debugger command error handling
This commit introduces the following (seemingly non-invasive) changes
to make the 'imuse play' debugger command more useful (i.e. don't crash
when trying to load the wrong kind of (sound) resource.

* ScummEngine::readSoundResource()
  Instead of fatally error()'ing upon hitting a non-sound resource type,
  e.g. a room header (0x524d4844 aka RMHD), we now only issue a warning().
  This enables the already existing dead code which properly returns 0
  (aka no resource loaded).

* ResourceManager::validateResource()
  Instead of fatally error()'ing upon hitting an illegal glob type we now
  only issue a warning() and return false (also existing dead code).
  All methods calling validateResource() check its return value so this
  seems like the right thing to do anyway.

* ScummDebugger::Cmd_IMuse()
  Instead of directly calling ensureResourceLoaded() we now call
  getResourceAddress() instead (which in turn calls ensureResourceLoaded()
  and handles other edge cases) and only attempt to play a sound if the
  returned pointer actually is valid.

Fixes Trac#10527.
2018-06-03 19:38:52 +01:00
Adrian Frühwirth
56d2bf77ba SCUMM: Ensure pointer returned by getResourceAddress() is usable
In some cases the pointer returned is used directly without further
error checking.
As most instances already assert() in this case this commit simply
adds asserts where missing and deemed appropriate.
2018-06-01 17:08:39 +00:00
Eugene Sandulenko
1e1ed29704 SCUMM: HE: Mark Bink as engine dependency 2018-05-30 09:26:17 +02:00
Bastien Bouclet
61f9398b04
Merge pull request #1187 from bgK/detection-refactor-unknown
ENGINES: Return unknown game variants with the list of detected games
2018-05-28 18:43:15 +02:00
Adrian Frühwirth
07efcfd458 SCUMM: Fix wrong comment about iMUSE digital variable 2018-05-21 11:24:40 +02:00
Adrian Frühwirth
c7f3416daa JANITORIAL: Remove trailing whitespace 2018-05-20 23:40:20 +02:00
Adrian Frühwirth
8cb0109b40 SCUMM: Improve autosave handling
v5+ scripts can request saving/loading of savegames, this type of
savegame is internally called a "temporary" savegame
(_saveStateTemporary == true) which is invisible to the user (I'm not
sure whether this is by design or not).

Currently the savegame handling in scummLoop_handleSaveLoad() doesn't
distinguish between such temporary savegames and normal autosaves and
unconditionally resets _lastSaveTime (even after loading).
This has the unwanted side effect of potentially delaying the creation
of normal autosaves which are supposed to be created in accordance with
the autosave period setting in the GUI.

This commit makes sure that _lastSaveTime only gets updated if and only
if saving a (non-temporary) autosave.
2018-05-10 17:51:30 +00:00
Bastien Bouclet
90b78c5446 ENGINES: Merge GameDescriptor and DetectedGame 2018-05-10 09:04:23 +02:00
Bastien Bouclet
1de5aca585 ENGINES: Set the GameDescriptor decription in the constructor 2018-05-10 09:04:23 +02:00
Bastien Bouclet
5aff87dc15 ENGINES: Turn GameDescriptor into a simple struct 2018-05-10 09:04:23 +02:00
Bastien Bouclet
643c24db75 ENGINES: Change MetaEngine::listSupportedGames to return plain game descriptors 2018-05-10 09:04:23 +02:00
Bastien Bouclet
8fb149e3c7 ENGINES: Change MetaEngine::findGame to return a plain game descriptor 2018-05-10 09:04:23 +02:00
Bastien Bouclet
cf1ebf2951 ENGINES: Add unknown game variants to the game detector results 2018-05-10 09:04:23 +02:00
Adrian Frühwirth
7ebbb12dfb SCUMM: Remove superfluous 'else' in IMuseInternal::ImSetTrigger()
Both means to calculate `diff` are essentially equal because
wraparound of unsigned integers is well-defined and does what
the 'else' branch is simulating manually. Because of this,
gcc complains when compiling with -Wduplicated-branches.
2018-05-07 22:21:42 +02:00
Adrian Frühwirth
48406bbd41 SCUMM: Simplify clampCameraPos() using CLIP 2018-05-07 19:54:45 +02:00
Adrian Frühwirth
49116b4ae7 ALL: Use CLIP to clip volumes 2018-05-05 17:57:31 +02:00
Adrian Frühwirth
7b48934598 SCUMM: Protect autosave (slot 0) from deletion/overwriting 2018-05-01 22:34:00 +02:00
Lothar Serra Mari
451cf2304f ENGINES: Show the unknown Game dialog only when the detector is launched by the Add Game feature 2018-04-29 21:47:10 +01:00
Adrian Frühwirth
9bee9e1ba6 JANITORIAL: Fix whitespace 2018-04-19 12:08:31 +02:00