2298 Commits

Author SHA1 Message Date
Johannes Schickel
f0106cd59c - Removes deleted waitTicks prototype in KyraEngine
- Adds sound fading support to the adlib player
- Adds support for stopping running tracks

- Changes baseFreq type back to uint8
- corrects octave handling in updateAndOutput1
(Thanks to eriktorbjorn for doing that)

svn-id: r21185
2006-03-09 20:50:19 +00:00
Torbjörn Andersson
a5e0c392ba As LordHoto pointed out to me, updateCallback41() was slightly different after
all: it adjusts the frequency even when state.unk16 is zero. Fixed that, and
added some comments to hopefully explain the differences between the cleaned up
code and the original disassembly.

svn-id: r21184
2006-03-09 18:42:05 +00:00
Torbjörn Andersson
c571026a20 More cleanups and renamings:
* Rewrote updateCallback41() in terms of updateAndOutput1(), since they were
  almost identical to begin with.
* Rewrote updateAndOutput1() for better readability.
* Made unk10 signed, and renamed it baseOctave.
* Made unk14 signed, and renamed it baseNote.
* Made unk15 signed, and renamed it baseFreq.
* Renamed unk17 regAx. It appears to be a cache for that register.
* Renamed unkOutputValue1 regBx. It appears to be a cache for that register.
* Renamed updateCallback8() update_setBaseOctave().
* Renamed updateCallback13() update_setBaseNote().
* Renamed updateCallback20() update_setBaseFreq().

Which still leaves the mystery of unk16 and _unkTables[]. Perhaps *this* is the
pitch bend?

svn-id: r21183
2006-03-09 17:04:00 +00:00
Max Horn
6b19677e1d Make use of DetectedGame::updateDesc in the kyra & lure engines
svn-id: r21167
2006-03-09 12:52:54 +00:00
Torbjörn Andersson
671450fcb8 Set down in comments what I know about _outputTable[], and what I suspect about
_unkTable[]. Investigating the latter further might help unravelling several of
the "unk" variables. (Right now, I'm suspecting that unk15 is the pitch bend.)

svn-id: r21164
2006-03-09 12:36:11 +00:00
Torbjörn Andersson
9d19f7d32e Corrected a few comments where I had mistaken the note on/off bit for one of
the octave bits.

The unkOuput1() function always turns off the note, so I've renamed it
noteOff(). I've added some comments to unkOuput2() as well, but I'm still not
quite sure what its purpose is. It seems unlikely that it's simply a "note on"
function, given the many things it will clear for the channel. It does end by
turning the note on, though. Strange.

svn-id: r21162
2006-03-09 12:04:41 +00:00
Max Horn
86565fcca5 - Renamed GameSettings to PlainGameDescriptor
- Added new GameDescriptor struct (similar to PlainGameDescriptor but with
  Common::String members instead of const char * ones)
- Changed DetectedGame to subclass GameDescriptor
- Removed toGameSettings() in favor of new (template) constructors in
  DetectedGame and GameDescriptor
- Fixed a bug in the obsolete gameid handling in the SCUMM & SIMON engines

svn-id: r21150
2006-03-09 02:52:51 +00:00
Max Horn
d2f78184af - added new toDetectedGame() template function (analog to toGameSettings)
- made use of the new DetectedGame constructor from my last commit
- some related cleanup

svn-id: r21149
2006-03-09 01:42:56 +00:00
Johannes Schickel
f5efc8b169 Commits patch #1437774 ("KYRA1: Game will crash if bitmap is missing").
svn-id: r21146
2006-03-08 21:21:56 +00:00
Oystein Eftevaag
39c9af43ae Implemented the last menu (the settings screen). Walking speed, text speed,
and speech modes (text only, speech only, speech & text) can now be
configured. Toggling music and sound in general is not enabled yet.
Also formatted the static menu resources a bit differently, made
sure some vars in the menu code always got initalized, and
fixed a slight formatting error :).

svn-id: r21145
2006-03-08 13:15:13 +00:00
Max Horn
d9a9fac937 Fixed tons of format string warnings for debug/error calls (including several errors where the format string didn't match the number of arguments to the call)
svn-id: r21141
2006-03-08 11:37:25 +00:00
Oystein Eftevaag
cca7da5ba1 The adlib code was calling the Kyra delay() function instead of the
system delay, which was causing concurrency problems.

svn-id: r21136
2006-03-08 01:38:27 +00:00
Oystein Eftevaag
3f31e1b27d Added the proper death dialog, changed the sequence skipping code a bit to avoid
possible frame losses, and removed a (now) redundant call to showOverlay() in the
debugger.

svn-id: r21125
2006-03-07 14:16:52 +00:00
Johannes Schickel
4aaa3eacbd Renamed setTempo to update_setTempo, also fixed tempo handling (intro is too fast now though, but seems to be another problem).
Also changed some unsigned values to signed.

svn-id: r21111
2006-03-06 16:37:03 +00:00
Torbjörn Andersson
628d64f136 More renamings: _unkTableByte1 is now _tempo, and updateCallback29() is
setTempo().

svn-id: r21110
2006-03-06 16:31:19 +00:00
Torbjörn Andersson
ddd312cea7 Cleanup
svn-id: r21109
2006-03-06 15:10:48 +00:00
Johannes Schickel
e2779a0658 Corrects implementation of updateCallback48.
svn-id: r21105
2006-03-05 21:48:55 +00:00
Torbjörn Andersson
27e49b6f56 Note to self: compile before commit.
svn-id: r21103
2006-03-05 20:11:43 +00:00
Torbjörn Andersson
4fb6c92473 The updateUnk6Value() appears to be some sort of random number generator, so I
have renamed it getRandomNr(). The _unk6 variable has been renamed _rnd. (Our
MidiDriver_ADLIB class also has its own random number generator, so it's not
such a far-fetched guess as it may seem.)

svn-id: r21102
2006-03-05 20:09:02 +00:00
Torbjörn Andersson
525690344b Renamed output1() to adjustVolume(). I'm still uncertain exactly *how* the
volume is modified (it depends on several still unknown variables), but that's
all it does as far as I can tell.

svn-id: r21101
2006-03-05 19:48:22 +00:00
Torbjörn Andersson
623514df01 Cleanup: output0x388(0xABCD) is now writeOPL(0xAB, 0xCD), which is slightly
more easy to read.

svn-id: r21081
2006-03-04 20:27:51 +00:00
Max Horn
907bd7128d Fix for bug #1438822 (Targets are case sensitive)
svn-id: r21017
2006-03-02 22:29:01 +00:00
Johannes Schickel
491cbcec5b Changed timeing related variables to unsigned.
Also changed the callback interval.

svn-id: r21012
2006-03-02 16:14:46 +00:00
Johannes Schickel
ce63f2bc38 Oops forgot to enable music again.
svn-id: r20993
2006-03-01 18:18:16 +00:00
Johannes Schickel
730eaf2dca Added debug calls to the adlib functions, also uses mixer samplerate now.
Fixed a bug in updateCallback41.

svn-id: r20992
2006-03-01 16:44:32 +00:00
Torbjörn Andersson
8a60a99140 Fixed updateCallback11() according to LordHoto's directions, and renamed it
update_writeAdlib(). (The "update_" prefix will probably be changed later, but
for now I want it to remain obvious that the functions belong to the other
updateCallback*() functions.)

svn-id: r20990
2006-03-01 13:57:32 +00:00
Torbjörn Andersson
5734717f8e Renamed 'unk9' to a slightly more descriptive 'repeatCounter'. (I should have
done that in the previous commit.)

svn-id: r20987
2006-03-01 08:13:38 +00:00
Torbjörn Andersson
272a19cf5b Use signed integers for jump offsets, so that the jump opcodes can jump both
forward and backward. This seems to fix the looping of the Black forest music
(and probably others as well), and might fix the invalid pointer crashes and
wrong music that would sometimes play after a song had finished. Changed the
names of the jump opcode functions, and added "update_" prefixes to the
previously cleaned-up opcode functions.

svn-id: r20986
2006-03-01 08:06:54 +00:00
Torbjörn Andersson
3a38721d02 Cleaned up updateCallback36() and renamed it setVibratoDepth().
svn-id: r20985
2006-03-01 07:27:35 +00:00
Torbjörn Andersson
55739f1715 Cleaned up updateCallback35() and renamed it setAMDepth(). It looks like the
_unkOutputByte2 variable is there to keep track of the current value of the
BD register (AM Depth / Vibrato Depth / Rhythm)

svn-id: r20984
2006-03-01 07:21:51 +00:00
Torbjörn Andersson
90cbe402b2 Minor cleanup and comments.
svn-id: r20983
2006-03-01 06:56:53 +00:00
Johannes Schickel
1e2aa59bcb Added lock() and unlock() again to readBuffer.
Implemented stateCallback1_1.
Fix some small bugs here and there (can't say what the fixed but it should be correct now)
Also set's the correct timer call value (with the other the music was too fast)

svn-id: r20973
2006-02-28 17:02:14 +00:00
Torbjörn Andersson
6ee443f316 Added some basic comments, along with some very, very minor cleanup.
svn-id: r20972
2006-02-28 15:44:39 +00:00
Torbjörn Andersson
f03958be01 Removed unnecessary line.
svn-id: r20971
2006-02-28 09:54:09 +00:00
Torbjörn Andersson
005861cb14 This may be needless paranoia, but I always get nervous about order of
evaluation when there are multiple side-effects on the same variable (in this
case the internal state modified by va_arg()) in the same expression. So let's
just humor me and do the va_arg() calls one at a time.

svn-id: r20970
2006-02-28 08:49:51 +00:00
Johannes Schickel
2bcd6bb95e Fixes hangs in the "Pool of Sorrow" scene (at least I don't get them anymore).
svn-id: r20964
2006-02-27 23:41:27 +00:00
Johannes Schickel
f3106feaf5 Added WIP Adlib sound playing code to kyra.
It needs some checks since it doesn't work correctly in every case at the moment.

svn-id: r20960
2006-02-27 22:39:55 +00:00
Max Horn
075dc8a538 A typical example why MKID is dangerous: Kyra uses it incorrectly, thus savegames are not interchangable between BE and LE systems. Fixing this, by breaking all LE savegames (enabling a compatibility mode, if desired, is easy)
svn-id: r20866
2006-02-25 02:35:45 +00:00
Max Horn
8ac17430ac - renamed PLUGIN_getSupportedGames to PLUGIN_gameIDList for consistency
- renamed Engine_XXX_gameList to Engine_XXX_gameList for consistency
- added new Engine_XXX_findGameID / PLUGIN_findGameID function
- updated plugins code to take advantage of the new plugin API, to support
  obsolete gameids w/o showing them to the user

svn-id: r20752
2006-02-18 11:15:37 +00:00
Max Horn
81798556db - Removed the 'features' field from GameSettings
- Removed GF_DEFAULT_TO_1X_SCALER

svn-id: r20747
2006-02-18 00:12:36 +00:00
Max Horn
4ad0b867b3 Reduced header dependencies
svn-id: r20743
2006-02-17 15:37:25 +00:00
Max Horn
7967e30c73 Added global toGameSettings() template function for convenience; simplified GameSettings usage in some engines
svn-id: r20739
2006-02-17 00:22:53 +00:00
Max Horn
a96760a2fd Reduced use of GF_DEFAULT_TO_1X_SCALER in favor of a new param to Engine::initCommonGFX; added a TODO stating that it should eventually be removed completly
svn-id: r20738
2006-02-17 00:01:18 +00:00
Johannes Schickel
0bea9cf47b Made the kyra debug extensions more generic, i.e. scumm engine could replace
their debugC calls now with the new introduced debugC calls.
(A mail how to use it will follow shortly on -devel)
Also now these special engine debug flags can be specified from the commandline.
Also made the -c & --config parameter check more secure.

svn-id: r20695
2006-02-14 23:31:25 +00:00
Johannes Schickel
93e9639989 Reworked kyra debug output system. Now he have special kyra intern debug levels + the global debug levels, for now I enable all kyra debug levels if the global debug level is not -1. see 'toggle_debug' in the kyra debugger and kyra.h for the different levels. (This is just the beginning of it anyway, for example the sound debug level isn't used for now)
svn-id: r20678
2006-02-14 01:19:30 +00:00
Oystein Eftevaag
2905826002 Initializes a var that would sometimes cause the intro to run too fast.
svn-id: r20663
2006-02-13 03:52:57 +00:00
Max Horn
80cf2fa46f Reduced data duplication in module.mk files; added module.mk files for null and x11 backends; added engines/module.mk
svn-id: r20584
2006-02-12 00:16:31 +00:00
Max Horn
26ee630756 Moved engines to the new engines/ directory
svn-id: r20582
2006-02-11 22:45:04 +00:00