Commit Graph

982 Commits

Author SHA1 Message Date
Max Horn
7c992d6598 DETECTOR: Merge ADParams into AdvancedMetaEngine 2011-06-14 18:17:01 +02:00
Max Horn
a9b49fbc66 AGI: Switch to alternate AdvancedMetaEngine, avoid ADParams 2011-06-10 22:15:40 +02:00
Max Horn
4827cc914a ENGINES: Change incorrect use of 'target' to 'gameid' 2011-06-10 22:15:40 +02:00
eriktorbjorn
0c1665820b AGI: Experimental fix for bug #3292778 ("SQ2: Music missing notes")
The idea here is that if two voices are generating the same tone,
the square wave generator should be in sync so that the wave forms
amplify each other, rather than cancelling each other out.
2011-06-10 19:41:31 +02:00
D G Turner
b5bb412569 AGI: Numeric Keypad Control in Predictive Dialog (Bug #3309376)
In AGI games, the numeric keypad is used as an alias for cursor keys to
allow stationary and 8 directional input, but while the predictive
dialog is open, this is more sensibly mapped to numeric input to
allow use of the predictive input on desktop ports.
2011-06-08 04:16:54 +01:00
D G Turner
e3a409b9a4 AGI: Fix Engine Exit While Predictive Dialog Is Open. 2011-06-08 03:38:52 +01:00
D G Turner
dbaf9e49c7 AGI: Fix Broken Predictive Text Input.
This was a regression introduced by
4b2f92b5e5 (r55135)
2011-06-08 03:13:13 +01:00
Max Horn
5faa7e3a53 AGI: Fix type mismatch (see bug #3311198) 2011-06-03 23:17:26 +02:00
Max Horn
e364072091 Remove accidentally added file *sigh* 2011-06-03 18:21:00 +02:00
Max Horn
11bd6da595 SCI: Switch some char* to Common::String& 2011-06-03 16:16:38 +02:00
D G Turner
305c6b4d83 AGI: Replace snprintf() usage with Common::String::format()
Safer and less portability issues.
2011-06-02 19:46:55 +01:00
Max Horn
477d6233c3 ENGINES: Change 2nd param of Engine::saveGameState to Common::String 2011-06-02 18:31:59 +02:00
Willem Jan Palenstijn
218d82c62b AGI: Fix compilation on 64 bit platforms
I'm unable to test this change, but it avoids using a pointer to store
an int temporarily.
2011-05-25 22:45:21 +02:00
Eugene Sandulenko
ed9768fde3 Merge pull request #9 from tiqpit/a2gs
AGI: Fix //gs output
2011-05-25 10:00:26 -07:00
Matthew Hoops
eea482fa43 ALL: behaviour -> behavior 2011-05-25 10:50:46 -04:00
Max Horn
6c5f50c246 COMMON: Add exit() to list of forbidden symbols 2011-05-23 19:39:26 +02:00
Max Horn
39ab4a2dc4 AGI: Constify stuff 2011-05-18 13:06:33 +02:00
Willem Jan Palenstijn
72acac58b6 AGI: Cleanup 2011-05-17 21:21:51 +02:00
Max Horn
44b798d107 AGI: Unify RandomSource instantiation
This fixes a leak in PreAGI games (which never deleted their
RandomSource), ensures that PreAGI's RandomSource has a name (and hence
is registered with the event recorder) and even slightly simplifies the
AgiEngine destructor.
2011-05-17 12:17:27 +02:00
Max Horn
4cbe4ede66 COMMON: Registers RandomSources in constructor with the event recorder
This also removes the dependency of engines on the event recorder header
and API, and will make it easier to RandomSources that are not properly
registered.
2011-05-17 12:17:26 +02:00
Thierry Crozat
3c59e37035 ENGINES: Unify engine names
This unifies the engine names in MetaEngine::getName() and the
credits. In particular drop "Engine" or "engine" from the names when
it was present and use expanded names in credits when the
MetaEngine uses it (e.g. "Beneath a Steel Sky" instead of "BASS").
2011-05-16 00:11:32 +01:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Matthew Hoops
8dd17a2ae1 AGI: Replace Winnie macros with functions
From patch #3298149
2011-05-07 15:25:55 -04:00
Max Horn
59e77ed667 ALL: Mark printf and various other symbols as forbidden
Right now, a few places in the frontend code still use printf and
consorts. We mark the affected files with a FIXME for now, and
add a dedicated exception for each. To be fixed!

Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always
enforce a compiler error
2011-05-02 16:31:31 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Ori Avtalion
cd6ee0589d JANITORIAL: Format forward declarations to follow convention 2011-04-28 12:20:34 +03:00
Eugene Sandulenko
52c05acd95 AGI: Fix bug #3087825: AGI: Code analysis warnings 2011-04-24 12:28:22 +03:00
Max Horn
73f04118f3 COMMON: Rename Error to ErrorCode, introduce new Error class 2011-04-18 18:22:02 +02:00
Max Horn
2e095e25f2 ALL: centre -> center 2011-04-14 14:34:28 +02:00
Max Horn
84184aabc0 ALL: colour -> color 2011-04-14 14:12:35 +02:00
Jussi Pitkanen
40b0d468e3 AGI: More formatting changes... 2011-04-12 18:40:43 +03:00
Jussi Pitkanen
40394431dc AGI: Use delete[] instead of delete for arrays 2011-04-12 18:22:24 +03:00
Jussi Pitkanen
506f3bdc10 AGI: Formatting 2011-04-12 18:07:35 +03:00
Max Horn
0ce2ca4e00 COMMON: Replace MKID_BE by MKTAG
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.
2011-04-12 16:53:15 +02:00
Jussi Pitkanen
d099ad3a48 AGI: Detect swap mode correctly for Apple IIGS instruments.
Also add comments describing which instruments use swap mode or vibrato,
plus print debug messages when those instruments are actually being played.
2011-04-10 17:27:07 +03:00
Jussi Pitkanen
4b3f081ee0 AGI: Cleanup sound_2gs.* 2011-04-09 19:11:25 +03:00
Jussi Pitkanen
fbb2d4d6cc AGI: Let games start playing a new sound even if another one is still playing. 2011-04-09 19:09:29 +03:00
Jussi Pitkanen
d660b7f78d AGI: Refactor and fix Apple IIGS sound generator
Make the player be centered on a fixed number of "generators" instead of
MIDI channels that arbitrarily allocate generators for notes.

Make the audio stream to be stereo and for sample rate use _sampleRate.
Rewrite the synthesis core:
  * Make generators use both oscillators
  * Implement swap mode for oscillators
  * Fix envelope update frequency
2011-04-09 00:48:26 +03:00
Max Horn
b188e60f44 AGI: Avoid global constructors (due to global refs) 2011-04-04 09:53:26 +02:00
md5
101d4b66e2 AGI: Added the Spanish version of SQ2 (bug report #3260349) 2011-04-03 19:11:49 +03:00
Max Horn
8c931fd1e8 AUDIO: Add Audio::MidiPlayer::createDriver(), let some engines use it 2011-03-28 18:06:36 +02:00
Max Horn
7949d7c6de AUDIO: Move more common code to Audio::MidiPlayer
This also should fix some regressions from the previous
commits, related to MidiParser's either being leaked,
or being deleted and then used again (i.e., crashing).

I tested as many games as I had available, but further
testing of all affected engines is called for anyway.
2011-03-25 14:15:53 +01:00
Max Horn
f4b30ecf6e AGI: Change SoundGenMIDI to derive from Audio::MidiPlayer
As a side effect, this fixes the incorrect handling of 'All Note Off'
in SoundGenMIDI::send.
2011-03-24 16:46:46 +01:00
Max Horn
088bd7a70b ENGINES: Remove unused MIDI pass-through code 2011-03-23 17:07:48 +01:00
Max Horn
e70fd59b35 ENGINES: Further simplify pseudo MidiDrivers; fix some regressions
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.

This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.
2011-03-23 16:49:41 +01:00
Max Horn
29847ea42d AUDIO: Change several fake MidiDrivers to MidiDriver_BASE subclasses
Many engines follow the advice in audio/midiparser.h and create a
"pseudo-MidiDriver" subclass. But MidiParser really only needs a tiny
subset of the MidiDriver capabilities, namely those found in
MidiDriver_BASE. So we try to subclass from that whenever possible; this
allows us to remove many stub methods, and enables further future
simplifications.
2011-03-23 15:25:47 +01:00
Max Horn
8982fff1b7 AUDIO: Add pure virtual MidiDriver::isOpen() method
This in turn enables modifying MidiDriver_MPU401::close() to allow
it to be called on a midi driver that has not yet been opened.

The specific issue that triggered me to make these changes was a
crash-upon-quit in HUGO, caused by it instantiating a midi driver,
then encountering an error (missing hugo.dat) *before* having
opened the new midi driver; the general cleanup code then tries
to close the (not yet opened) midi driver -> kaboom

Also fixed some engines which were leaking MidiDriver instances.
2011-03-22 23:51:47 +01:00
dhewg
a3efe915d3 PREAGI: Cleanup volume levels initialization 2011-03-19 15:32:35 +01:00
dhewg
454bad69e9 AGI: Remove newlines from debug() 2011-03-16 20:58:57 +01:00
dhewg
69a026192e AGI: Kill the timer based counter
Using the timer mechanism for just a simple counter is not just
overkill, its also inaccurate. When using a call frequency of x,
and waiting for y callbacks, the passed time will not be x*y.
The problem amplifies on slower platforms and/or fair thread
schedulers.
Use absolute times instead. Most notably, the walking speed of
the avatar is now smooth on android, but probably on all other
handhelds we support too.
2011-03-05 11:00:37 +01:00
Matthew Hoops
06e88662d9 AGI: Add detection for the 'AGI Combat' fan game 2011-02-28 22:22:19 -05:00
Johannes Schickel
bb2daae936 AGI: Remove leftover RGBA reference in comments. 2011-02-20 21:39:29 +01:00
Johannes Schickel
021ecca3b0 AGI: Adapt to setPalette RGBA->RGB change. 2011-02-14 17:08:31 +01:00
Max Horn
42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Max Horn
2d1c8a3533 ALL: Fix whitespaces / indention
svn-id: r55818
2011-02-07 23:01:06 +00:00
Max Horn
ab039812e7 COMMON: OSystem now has a PaletteManager
svn-id: r55806
2011-02-07 17:52:38 +00:00
Max Horn
4b2f92b5e5 AGI: Rewrote predictive code matcher
The new code is simpler, avoids a potential buffer overrun
(by avoiding to to use a buffer in the first place), and
hopefully has slightly more sane matching properties.

svn-id: r55135
2011-01-06 21:11:24 +00:00
Max Horn
0a8189fd41 AGI: cleanup
svn-id: r55124
2011-01-05 13:04:08 +00:00
Max Horn
6edc86a19b DEBUG: Let GUI::Debugger::preEnter and postEnter (un)pause the engine
svn-id: r54815
2010-12-07 18:54:21 +00:00
Max Horn
2180b2d6b5 COMMON: Split common/stream.h into several headers
svn-id: r54385
2010-11-19 17:03:07 +00:00
Max Horn
a0df86955f ALL: Push down deps on stream.h from .h to .cpp files
svn-id: r54358
2010-11-19 01:37:04 +00:00
Max Horn
4d3a07b494 COMMON: Rename and tweak MD5 functions
* names now comply to our naming conventions
* the function computeStreamMD5AsString which computes the MD5
  as a hex string now returns it as a Common::String
* add doxygen comments

svn-id: r54121
2010-11-07 17:16:59 +00:00
Max Horn
a7248a0601 ENGINES: Replace many printfs by warning/debug/debugN
svn-id: r54031
2010-11-01 21:37:47 +00:00
Max Horn
9a350f4398 ENGINES: Get rid of some (f)printfs
svn-id: r54011
2010-11-01 16:04:47 +00:00
Max Horn
415f9a1b0b AGI: Add note about AgiEngine::parseFeatures
svn-id: r53872
2010-10-27 09:47:18 +00:00
Max Horn
2c99caa795 AGI: Fix memory leak in AgiEngine::parseFeatures()
svn-id: r53869
2010-10-26 22:35:37 +00:00
Max Horn
7c2323bdc3 AGI: Replace report() macro by debug() / warning()
This makes AGI quite a bit less noisy by default.

svn-id: r53868
2010-10-26 22:33:49 +00:00
Max Horn
3534cff8ef ALL: Fix indention (whitespaces -> tabs)
svn-id: r53738
2010-10-23 15:46:50 +00:00
Max Horn
4ccce19876 ENGINES: Enhance namespace comments a bit
svn-id: r53484
2010-10-15 12:48:19 +00:00
Eugene Sandulenko
764eaa554c AGI: Fix some code analysis warnings (bug #3087825)
svn-id: r53470
2010-10-15 08:49:20 +00:00
Eugene Sandulenko
77e70a7187 AGI: Fix bug #3017908 with MIDI music
Bug #3017908: "AGI: No music with the new MIDI patch"
Thanks to Raziel^ for pinpointing the bug.

svn-id: r53166
2010-10-12 19:44:40 +00:00
Torbjörn Andersson
54b2a8c98d JANITORIAL: Cleanup (mostly whitespace)
svn-id: r53161
2010-10-12 04:19:58 +00:00
Willem Jan Palenstijn
0fd6b7608e AGI: Fix one more strncpy/strncat issue
svn-id: r53148
2010-10-11 17:52:44 +00:00
Johannes Schickel
cc0afa92b3 AGI: Fix possible buffer overflow.
This is based on patch #3085298 "overflows in agi and parallaction".

svn-id: r53147
2010-10-11 17:07:53 +00:00
Torbjörn Andersson
8d297f065a AGI: Properly detect the autosave slot in the save dialog
Forward-ported from branch. Let's do this the easy way for now, even
if I'm not sure why the save dialog shows the autosave slot anyway.

svn-id: r52997
2010-10-03 18:38:38 +00:00
Torbjörn Andersson
4543855eca AGI: Fix bug in cmd_cancel_line()
We have to update cursor position, not just terminate the input
buffer. This makes Ctrl-C work as intended, which fixes one half of
bug #3054184 ("SQ1 AGI: keyboard special keys are not functioning
properly"). I'm not sure if the second half actually is a bug. 

svn-id: r52899
2010-09-26 11:20:55 +00:00
Matthew Hoops
d4504a3f3a AGI: Fix C64 AGI pictures
The initial screen color needs to be 0 and not 0xf for these. Winnie C64/Apple II should be completable now, with some graphical glitches and palette problems.

svn-id: r52881
2010-09-25 14:28:48 +00:00
David Turner
4b7a9b29fe AGI: Fix for Bug #3067263 "SQ2: ScummVM hanging on the inventory screen"
This was due to a loop in AgiEngine::selectItems(int n), which lacked a check
that the engine was quitting or restarting.

svn-id: r52856
2010-09-22 20:05:10 +00:00
Torbjörn Andersson
f994deb4ee AGI: Deconfusify the AGI music driver
(After a brief discussion with sev.) AdLib is now the old Sarien sound,
PCjr is the new PCjr emulation. PCjr is still the default; we don't
need to ask getMusicType() how to get there.

svn-id: r52838
2010-09-21 06:05:27 +00:00
Eugene Sandulenko
d43ff54a08 AGI: Changed meaning of pcjr sound device. Now it is Sarien emu
Music drivers:
default: proper Tandy/PCJr
adlib: proper Tandy/PCJr
pcjr: old Sarien emu
amiga: old Sarien emu in Amiga mode
pcspk: Sarien emu in PCSpk mode (quite wrong)
midi: 4 channel MIDI

svn-id: r52836
2010-09-21 05:36:51 +00:00
Eugene Sandulenko
763c089d06 AGI: Fix bug #3061578: AGI: PCjr Mode Not Default for DOS Games
svn-id: r52831
2010-09-20 21:17:49 +00:00
Torbjörn Andersson
c91a07229a JANITORIAL: Removed most punctuation at end of warning() and error()
Our warning() and error() functions always add an exclamation mark
to the end of the message anyway.

svn-id: r52791
2010-09-18 10:55:16 +00:00
Torbjörn Andersson
df91686a36 AGI: Initialise PCjr emulator channels on creation
Because chanGen() gets called very early, and sometimes it crashes
ScummVM as soon as the game starts. Actually, it's probably enough to
initialise a couple of fields in _tchannel[], but I figured it
couldn't hurt to clear all of _channel[] and _tchannel[].

svn-id: r52741
2010-09-16 04:43:49 +00:00
Johannes Schickel
6588398ce6 MIDI: Send a reset MIDI device signal on startup.
This is currently done in the engine code. I adapted AGI, AGOS, DRACI,
GROOVIE, LURE, MADE, QUEEN, SAGA, SKY, TINSEL and TOUCHE to send a reset
device on startup. The sound output still works fine (started up a game
from every engine), so this should hopefully not introduce any regressions.

As far as I can tell it seems that SCUMM does send a proper device reset, so
I did not touch it. KYRA only sends a proper reset for MT-32 currently. I am
not sure about SCI though.

This fixes bug #3066826 "SIMON: MIDI notes off when using RTL after SCI".

svn-id: r52736
2010-09-15 22:00:20 +00:00
Travis Howell
f7fa335a1b AGI: Fix compilation.
svn-id: r52719
2010-09-14 00:47:26 +00:00
Johannes Schickel
efc13c42b2 AGI: Improve support for MT-32 in the MIDI output.
Formerly the AGI MIDI code did not setup the channel mask properly, in case
"native_mt32" was set. This resulted in one missing channel (i.e. channel 0),
since the MT-32 only responds to data for channels 1-9.

svn-id: r52718
2010-09-14 00:44:41 +00:00
Eugene Sandulenko
fcdb349fa2 AGI: Respect mute setting
svn-id: r52373
2010-08-25 07:41:14 +00:00
Eugene Sandulenko
349b89adce AGI: Fix bug #3034370
Bug #3034370: "Manhunter: New York keyboard unresponsive". Actually
the keyboard was made responsive after June implementation of set.key,
still the game speed was increasing. Fixed that too.

svn-id: r52369
2010-08-25 07:39:50 +00:00
Eugene Sandulenko
30d8dda867 AGI: Reset controllers on game restart
svn-id: r52368
2010-08-25 07:39:31 +00:00
Eugene Sandulenko
663a606602 AGI: Fix bug #3017908: "AGI: No music with the new MIDI patch"
Fixed by performing proper MIDI initialization.

svn-id: r52332
2010-08-24 12:41:56 +00:00
Eugene Sandulenko
756d5e2847 AGI: Fix valgrind warning
svn-id: r51312
2010-07-26 14:22:16 +00:00
Eugene Sandulenko
e4bc0c3a18 AGI: Fix crash on exit thanks to valgrind
svn-id: r51311
2010-07-26 14:21:59 +00:00
Eugene Sandulenko
aea09cb3a0 AGI: Fix spelling and formatting
svn-id: r51310
2010-07-26 14:21:18 +00:00
Eugene Sandulenko
afc872cba8 AGI: Fix bug #3017911
Bug #3017911: "AGI (Fan): SQ0 - Ego flickering". It is a regression from r49745,
as it appeared, some of the screen updates were too much.

svn-id: r51223
2010-07-23 21:11:56 +00:00
Max Horn
1d4c82885d DEBUGGER: Simplify how our console debugger works / is used
* Remove _isAttached member var and isAttached method
* Engines now always call the onFrame method; whether it does
  something is decided by the debugger class resp. its subclasses
* Make detach() protected instead of private, so that subclasses
  can invoke it
* Remove _detach_now member var (call detach() instead).
* Rename _frame_countdown to _frameCountdown and properly
  document it.
* Add more doxygen comments
* Cleanup

svn-id: r50963
2010-07-17 18:38:42 +00:00
Johannes Schickel
e75eee21e3 Use "true" instead of "1" in if statements to make clang a bit more happier with -Werror.
svn-id: r50943
2010-07-16 21:50:12 +00:00
Torbjörn Andersson
bde1cbd785 Cleanup.
svn-id: r50928
2010-07-16 03:34:25 +00:00
Matthew Hoops
6c22d599ec Fix non-PCSPK sound types in AGI.
svn-id: r50891
2010-07-14 17:04:53 +00:00
Filippos Karapetis
4304a414ab AGI: Removed the deprecated (and confusing) getGameId() function inside the AgiEngine class, and fixed a related bug, too
svn-id: r50607
2010-07-02 23:12:17 +00:00
Filippos Karapetis
188f8d9a11 AGI: Fixed bug #3017905 - "AGI: GR - Crash on start". A free() was done on an already freed reference
svn-id: r50606
2010-07-02 22:55:56 +00:00