diff options
author | Travis Howell | 2009-07-04 05:56:10 +0000 |
---|---|---|
committer | Travis Howell | 2009-07-04 05:56:10 +0000 |
commit | 4656019e8a2f92f708a685be6d3d95edd7ee8d6d (patch) | |
tree | 1370ceb14c98da5478d85f207ae421dbaff473c8 /engines/scumm | |
parent | 6ef485f44896ad778d355bc1201f2f143cc9e770 (diff) | |
parent | df9570cb3265f4d81ac41d66d949355491e2df7e (diff) | |
download | scummvm-rg350-4656019e8a2f92f708a685be6d3d95edd7ee8d6d.tar.gz scummvm-rg350-4656019e8a2f92f708a685be6d3d95edd7ee8d6d.tar.bz2 scummvm-rg350-4656019e8a2f92f708a685be6d3d95edd7ee8d6d.zip |
Merged revisions 41219-41297,41299-41318,41322-41328,41331-41334,41336-41346,41348-41369,41372-41376,41379-41381,41384-41386,41389,41393,41395,41398,41400-41409,41419,41421,41423-41425,41428-41430,41432-41433,41452-41453,41458-41462,41465,41468,41470,41473-41474,41484-41490,41493,41496-41504,41506-41508,41516-41517,41519-41520,41528,41536-41538,41556-41557,41559-41560,41562-41576,41579,41584,41587-41592,41596,41598,41601-41603,41611,41618-41619,41630,41632-41635,41639,41641,41644-41647,41660,41663-41665,41668,41677,41679-41680,41683,41699-41705,41707-41709,41713-41715,41718-41727,41729-41736,41739-41763,41765-41766,41768-41774,41777-41778,41781-41799,41803,41806,41809-41813,41821-41823,41827,41833-41834,41836-41839,41841,41844-41848,41850-41853,41858-41860,41867-41871,41875-41887,41889-41893,41895-41897,41902-41903,41915-41917,41922,41929-41934,41938,41940-41964,41967-41968,41975,42007-42012,42020,42038-42041,42043-42044,42047-42050,42054-42056,42060,42062,42079,42081 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r41219 | drmccoy | 2009-06-06 21:34:11 +1000 (Sat, 06 Jun 2009) | 2 lines
Adding my German version of Playtoons 2 ("Rummelsdorf hoch zwei")
........
r41220 | wjpalenstijn | 2009-06-06 21:38:20 +1000 (Sat, 06 Jun 2009) | 3 lines
Store long-term pointers to object variables in a new ObjVarRef struct.
Storing them as reg_t* could cause the pointers to become invalid
when they pointed into CloneTable since CloneTable can be re-allocated.
........
r41221 | athrxx | 2009-06-06 22:18:39 +1000 (Sat, 06 Jun 2009) | 1 line
KYRA/LOL: fix input code for japanese game versions
........
r41222 | waltervn | 2009-06-06 22:30:13 +1000 (Sat, 06 Jun 2009) | 2 lines
SCI: Fix audio regression in KQ5CD, introduced in r41205.
........
r41223 | athrxx | 2009-06-07 00:14:07 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: fixed vaelan's cube
........
r41224 | athrxx | 2009-06-07 00:42:03 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: fixed level temp data size
........
r41225 | athrxx | 2009-06-07 01:32:42 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: fix last commit
........
r41226 | djwillis | 2009-06-07 01:41:17 +1000 (Sun, 07 Jun 2009) | 1 line
GP2XWiz: Cleanup and start to work on virtual keyboard support for the backend.
........
r41227 | thebluegr | 2009-06-07 02:43:13 +1000 (Sun, 07 Jun 2009) | 1 line
Moved some more debug commands to ScummVM's coneole
........
r41228 | drmccoy | 2009-06-07 02:47:21 +1000 (Sun, 07 Jun 2009) | 2 lines
Adding a pause mode
........
r41229 | drmccoy | 2009-06-07 02:48:29 +1000 (Sun, 07 Jun 2009) | 2 lines
Adding a general coktelplayer.scn demo file
........
r41230 | djwillis | 2009-06-07 02:52:45 +1000 (Sun, 07 Jun 2009) | 2 lines
GP2X: Small cleanup of control code and start to work on virtual keyboard support for the backend.
........
r41231 | lordhoto | 2009-06-07 03:10:15 +1000 (Sun, 07 Jun 2009) | 2 lines
Fix unused variable warnings.
........
r41232 | djwillis | 2009-06-07 03:21:50 +1000 (Sun, 07 Jun 2009) | 1 line
Virtual Keyboard: Fix detection of v_align option when used in the keyboard definition.
........
r41233 | sev | 2009-06-07 03:36:06 +1000 (Sun, 07 Jun 2009) | 1 line
Implement feature request #1180217: "GUI: Mute option"
........
r41234 | sev | 2009-06-07 03:36:21 +1000 (Sun, 07 Jun 2009) | 1 line
Mention new hotkey in README
........
r41235 | sev | 2009-06-07 03:36:58 +1000 (Sun, 07 Jun 2009) | 1 line
Add Mute control to all themes
........
r41236 | sev | 2009-06-07 03:37:15 +1000 (Sun, 07 Jun 2009) | 1 line
Implement FR#1522626: "GUI: Friendlier "Add Game" session"
........
r41237 | sev | 2009-06-07 03:37:31 +1000 (Sun, 07 Jun 2009) | 1 line
Implement FR#2090830: "GUI: RTL should focus game list on the last game played"
........
r41238 | sev | 2009-06-07 03:37:51 +1000 (Sun, 07 Jun 2009) | 1 line
Decrease number of free memory pages to realistic value
........
r41239 | sev | 2009-06-07 03:39:13 +1000 (Sun, 07 Jun 2009) | 1 line
Whitespace fixes and C++ comments
........
r41240 | sev | 2009-06-07 03:39:42 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug #2434187: "SQ2: message not displayed, or vanishes too quickly"
........
r41241 | sev | 2009-06-07 03:40:09 +1000 (Sun, 07 Jun 2009) | 1 line
Fix implementation of prevent.input. This fixes SQ2 intro
........
r41242 | sev | 2009-06-07 03:40:27 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug #2026570: "SQ2: Prompt disappears when it shouldn't"
........
r41243 | sev | 2009-06-07 03:40:56 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug #2721940: "AGI: Gold Rush! Restart Option differs from original"
........
r41244 | sev | 2009-06-07 03:41:29 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug #1745954: "GR: Intro "jumpy" in parts (Amiga version)"
........
r41245 | sev | 2009-06-07 03:41:50 +1000 (Sun, 07 Jun 2009) | 1 line
Store and compare MD5s in the saves
........
r41246 | sev | 2009-06-07 03:42:12 +1000 (Sun, 07 Jun 2009) | 1 line
Disable save/load when original did not allow
........
r41247 | sev | 2009-06-07 03:42:37 +1000 (Sun, 07 Jun 2009) | 1 line
Stop abusing game flag.
........
r41248 | sev | 2009-06-07 03:43:04 +1000 (Sun, 07 Jun 2009) | 1 line
Remove duplicated amiga busy cursor
........
r41249 | sev | 2009-06-07 03:43:26 +1000 (Sun, 07 Jun 2009) | 1 line
Implement debug commands "room" and "bt"
........
r41250 | sev | 2009-06-07 03:43:51 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug #2026605: "SQ2: Have to wait after dying to do anything."
........
r41251 | sev | 2009-06-07 03:44:24 +1000 (Sun, 07 Jun 2009) | 1 line
Cleanup
........
r41252 | sev | 2009-06-07 03:44:46 +1000 (Sun, 07 Jun 2009) | 1 line
Implement scummvm.ini flag features for AGI engine
........
r41253 | sev | 2009-06-07 03:45:06 +1000 (Sun, 07 Jun 2009) | 1 line
Implement cancel.line. Consider obj.status.f implemented
........
r41254 | sev | 2009-06-07 03:45:52 +1000 (Sun, 07 Jun 2009) | 1 line
Cleanup
........
r41255 | sev | 2009-06-07 03:46:19 +1000 (Sun, 07 Jun 2009) | 1 line
Implement hold.key and release.key opcodes
........
r41256 | sev | 2009-06-07 03:46:38 +1000 (Sun, 07 Jun 2009) | 1 line
Implement allow.menu opcode
........
r41257 | sev | 2009-06-07 03:46:55 +1000 (Sun, 07 Jun 2009) | 1 line
Implement hide.mouse and show.mouse opcodes
........
r41258 | sev | 2009-06-07 03:47:29 +1000 (Sun, 07 Jun 2009) | 1 line
Implement fence.mouse opcode
........
r41259 | sev | 2009-06-07 03:48:09 +1000 (Sun, 07 Jun 2009) | 1 line
Correct implementation for set.key opcode. Fixes #2605104: "AGI: Manhunter, F3 hotkey dosent work", removed number of hacks
........
r41260 | sev | 2009-06-07 03:48:30 +1000 (Sun, 07 Jun 2009) | 1 line
Add guard check to set.key opcode.
........
r41261 | sev | 2009-06-07 03:48:46 +1000 (Sun, 07 Jun 2009) | 1 line
Make PopUp widget look more balanced
........
r41262 | sev | 2009-06-07 03:49:09 +1000 (Sun, 07 Jun 2009) | 1 line
Improved look of popup widget, buttons, checkbox and tab widget
........
r41263 | sev | 2009-06-07 03:49:59 +1000 (Sun, 07 Jun 2009) | 1 line
Implement FR#2707442: "GUI: Improve Mass Add dialog"
........
r41264 | sev | 2009-06-07 03:50:30 +1000 (Sun, 07 Jun 2009) | 1 line
Sync all themes with improvements of mass dialog. Fixed list positioning
........
r41265 | sev | 2009-06-07 03:51:41 +1000 (Sun, 07 Jun 2009) | 1 line
Implement widget property "textalign". Added it to all theme layouts
........
r41266 | sev | 2009-06-07 03:52:44 +1000 (Sun, 07 Jun 2009) | 4 lines
Implement FR#2507667: "GUI: Improve PopupWidget rendering / theme layouting".
- Split out label from PopUp widget
- Aligned every widget on all layouts so GUI becomes to look nice again
- Moved textHAlign to layout properties
........
r41267 | sev | 2009-06-07 03:53:25 +1000 (Sun, 07 Jun 2009) | 2 lines
Add to launcher not yet functional search widget.
Make EditableWidget CommandSender
........
r41268 | sev | 2009-06-07 03:54:08 +1000 (Sun, 07 Jun 2009) | 1 line
Implement FR#1970293: "LAUNCHER: Add "quick search" input field like in iTunes"
........
r41269 | sev | 2009-06-07 03:54:28 +1000 (Sun, 07 Jun 2009) | 5 lines
Improvements to laucher dialog
- Made quicksearch turned off in the launcher game list
- Turn ListWidget into CommandSender
- Turn quicksearch off in launcher game list
- Connect laucher list widget with search box so search is initiated by typing
........
r41270 | sev | 2009-06-07 03:54:43 +1000 (Sun, 07 Jun 2009) | 1 line
Fix font size in EditTextWidget on screen resolution change.
........
r41271 | sev | 2009-06-07 03:54:59 +1000 (Sun, 07 Jun 2009) | 1 line
Fix item selection on filtered out list in launcher
........
r41272 | sev | 2009-06-07 03:56:41 +1000 (Sun, 07 Jun 2009) | 1 line
Added game GUI options to advancedDetector and updated all engines
........
r41273 | sev | 2009-06-07 03:56:59 +1000 (Sun, 07 Jun 2009) | 1 line
Fix bug with GUI options not set when per-game setting is empty
........
r41274 | sev | 2009-06-07 03:57:39 +1000 (Sun, 07 Jun 2009) | 1 line
Add GUI options support to Sky, Queen and Sword1&2 engines (which do not use AD)
........
r41275 | sev | 2009-06-07 03:58:08 +1000 (Sun, 07 Jun 2009) | 2 lines
Implement FR#862150: "GUI: Show subtitles/speech options only for speech games"
Add generic per-game GUI options support along the way ;)
........
r41276 | sev | 2009-06-07 03:58:29 +1000 (Sun, 07 Jun 2009) | 1 line
Do not change list content if filter was not changed
........
r41277 | sev | 2009-06-07 03:59:04 +1000 (Sun, 07 Jun 2009) | 1 line
Disable load from the launcher button for AGOS and Gob games with use of GUI options
........
r41278 | sev | 2009-06-07 03:59:54 +1000 (Sun, 07 Jun 2009) | 1 line
Add support for GUI options to SCUMM engine
........
r41279 | thebluegr | 2009-06-07 04:02:16 +1000 (Sun, 07 Jun 2009) | 1 line
Removed unused variable
........
r41280 | sev | 2009-06-07 04:11:05 +1000 (Sun, 07 Jun 2009) | 2 lines
Add empty file to cheat git-svn
........
r41281 | sev | 2009-06-07 04:21:07 +1000 (Sun, 07 Jun 2009) | 1 line
Disable MIDI controls if GUIO_NOMIDI is set
........
r41282 | sev | 2009-06-07 04:21:49 +1000 (Sun, 07 Jun 2009) | 1 line
Patch #1365914: "SCUMM: CMS support." Disabled by default. Still plenty to do.
........
r41283 | sev | 2009-06-07 04:22:18 +1000 (Sun, 07 Jun 2009) | 1 line
Added couple of newly discovered fanmade AGI games.
........
r41284 | sev | 2009-06-07 04:22:43 +1000 (Sun, 07 Jun 2009) | 1 line
Added CoCo3 version of SQ1
........
r41285 | sev | 2009-06-07 04:23:05 +1000 (Sun, 07 Jun 2009) | 1 line
Added GUI options for newly added games
........
r41286 | sev | 2009-06-07 04:23:24 +1000 (Sun, 07 Jun 2009) | 1 line
Shut gcc warning.
........
r41287 | sev | 2009-06-07 04:27:25 +1000 (Sun, 07 Jun 2009) | 2 lines
Bump theme version to 0.5 due to number of recent changes.
........
r41288 | sev | 2009-06-07 04:32:33 +1000 (Sun, 07 Jun 2009) | 2 lines
Restore search.bmp which was lost
........
r41289 | lordhoto | 2009-06-07 04:33:20 +1000 (Sun, 07 Jun 2009) | 2 lines
Fix printf format argument related warnings.
........
r41290 | thebluegr | 2009-06-07 04:38:41 +1000 (Sun, 07 Jun 2009) | 1 line
Updated the MSVC project files of the SCUMM engine for commit #41282
........
r41291 | lordhoto | 2009-06-07 04:41:25 +1000 (Sun, 07 Jun 2009) | 2 lines
Flag all games without full voice over with GUIO_NOSPEECH.
........
r41292 | athrxx | 2009-06-07 04:46:07 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: fix flying item hit processing
........
r41293 | thebluegr | 2009-06-07 05:04:09 +1000 (Sun, 07 Jun 2009) | 1 line
Fixed assertion when starting mass add and there are no games currently in the game list
........
r41294 | drmccoy | 2009-06-07 05:06:47 +1000 (Sun, 07 Jun 2009) | 4 lines
Demoplayer:
- Fixing the flawed double mode
- Adding an "auto" double mode, where the videos get scaled if possible
........
r41295 | lordhoto | 2009-06-07 05:10:25 +1000 (Sun, 07 Jun 2009) | 3 lines
- Flag Kyra3 detection entries with GUIO_NOMIDI
- Get rid of using directive
........
r41296 | sev | 2009-06-07 05:20:39 +1000 (Sun, 07 Jun 2009) | 2 lines
Bring old 'quick search' behavior of games list back.
........
r41297 | lordhoto | 2009-06-07 05:47:55 +1000 (Sun, 07 Jun 2009) | 2 lines
Use GameDescriptor::setGUIOptions instead of setting key "guioptions" directly.
........
r41299 | fingolfin | 2009-06-07 06:03:13 +1000 (Sun, 07 Jun 2009) | 1 line
GOB: Got rid of class ReferenceCounter; changed SurfaceDesc::Ptr to SurfaceDescPtr (a Common::SharedPtr); and changed many SurfaceDesc pointers to references
........
r41300 | djwillis | 2009-06-07 06:05:21 +1000 (Sun, 07 Jun 2009) | 1 line
Virtual Keyboard: 'Ab'use the console font to get a font small enough to be usable on 320*240 virtual keyboards for display_area (GUI and BigGUI take up far too much space).
........
r41301 | lordhoto | 2009-06-07 06:22:16 +1000 (Sun, 07 Jun 2009) | 2 lines
Made fix for empty game list on starting MassAdd a bit more robust.
........
r41302 | thebluegr | 2009-06-07 06:29:37 +1000 (Sun, 07 Jun 2009) | 1 line
Moved some more debug commands to ScummVM's coneole
........
r41303 | djwillis | 2009-06-07 06:36:12 +1000 (Sun, 07 Jun 2009) | 1 line
Virtual Keyboard: Add 320*240 support (in addition to 640*480) to the default keyboard pack. Also tweak vkeybd.xml to make it a little more like valid XML). New graphics still to come so excuse the ugly keyboard images for now.
........
r41304 | sev | 2009-06-07 06:58:36 +1000 (Sun, 07 Jun 2009) | 2 lines
Make script executable
........
r41305 | fingolfin | 2009-06-07 07:37:30 +1000 (Sun, 07 Jun 2009) | 1 line
GOB: Turned _spritesArray into a Common::Array (of fixed size) to detect out-of-bounds access to it (since access is controlled by scripts, this could (and does :/) easily happen. Also removed an obsolete swap() method, and fixed one case where _spritesArray was indeed accessed out of bounds
........
r41306 | drmccoy | 2009-06-07 07:41:22 +1000 (Sun, 07 Jun 2009) | 2 lines
Fixing the Woodruff intro: Using a flag that's /not/ already used be the scripts
........
r41307 | drmccoy | 2009-06-07 07:45:47 +1000 (Sun, 07 Jun 2009) | 2 lines
Fixing the demoplayer's auto double mode and added a REBASE0 option that sets the video's X and Y coordinates to 0,0
........
r41308 | drmccoy | 2009-06-07 07:54:12 +1000 (Sun, 07 Jun 2009) | 2 lines
Setting the game type of the generic demoplayer to Urban so it can make use of the initial palette
........
r41309 | fingolfin | 2009-06-07 09:22:22 +1000 (Sun, 07 Jun 2009) | 1 line
GUI: Simplified ThemeEngine::getImageSurface (this way it's easier to add more graphics in the future ;)
........
r41310 | fingolfin | 2009-06-07 09:22:35 +1000 (Sun, 07 Jun 2009) | 1 line
GUI: Pressing 'ESC' in the Launcher's quick search field now resets the search filter
........
r41311 | fingolfin | 2009-06-07 09:22:48 +1000 (Sun, 07 Jun 2009) | 1 line
GUI: Tweaked the launcher so that TAB switches focus between the list and the quick search field
........
r41312 | drmccoy | 2009-06-07 09:39:58 +1000 (Sun, 07 Jun 2009) | 1 line
Renamed the evaluateStore opcodes to assign, because that's what they are
........
r41313 | drmccoy | 2009-06-07 09:40:11 +1000 (Sun, 07 Jun 2009) | 1 line
Fascination needs o1_assign. o2_assign breaks the DOS floppy version
........
r41314 | athrxx | 2009-06-07 10:37:30 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: implemented king richard healing sequence
........
r41315 | lordhoto | 2009-06-07 10:51:19 +1000 (Sun, 07 Jun 2009) | 2 lines
Fix WSA v2 code, now the automap remove WSA file in Lands of Lore plays correctly.
........
r41316 | lordhoto | 2009-06-07 10:58:14 +1000 (Sun, 07 Jun 2009) | 2 lines
Add support for "WF_NO_LAST_FRAME" in WSA v1 code too. Since so far every v1 WSA file played fine, it might be unneeded, but better safe than sorry.
........
r41317 | drmccoy | 2009-06-07 11:45:09 +1000 (Sun, 07 Jun 2009) | 1 line
Dropping the v1 parser functions in favour of the extended v2 ones
........
r41318 | waltervn | 2009-06-07 12:18:38 +1000 (Sun, 07 Jun 2009) | 2 lines
SCI: Resmgr cleanup and preparations for moving resource36 handling into resmgr.
........
r41322 | strangerke | 2009-06-07 18:33:46 +1000 (Sun, 07 Jun 2009) | 1 line
Suppress use of parse_v1 and parse_v2 as DrMcCoy got rid of them.
........
r41323 | strangerke | 2009-06-07 18:46:15 +1000 (Sun, 07 Jun 2009) | 1 line
Suppress inclusion of a not yet committed file
........
r41324 | sev | 2009-06-07 20:03:19 +1000 (Sun, 07 Jun 2009) | 2 lines
Mention recent improvements
........
r41325 | sev | 2009-06-07 20:04:41 +1000 (Sun, 07 Jun 2009) | 2 lines
Added MD5 from Bug #2796782: "SCI: LSL1 Russian MD5"
........
r41326 | sev | 2009-06-07 20:13:05 +1000 (Sun, 07 Jun 2009) | 2 lines
MD5 from bugreport #2797962: "SCI: Laura Bows 2 german, md5"
........
r41327 | athrxx | 2009-06-07 20:34:01 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: implemented some missing monster animation code
........
r41328 | fingolfin | 2009-06-07 21:02:51 +1000 (Sun, 07 Jun 2009) | 1 line
Set svn:ignore
........
r41331 | fingolfin | 2009-06-07 22:37:16 +1000 (Sun, 07 Jun 2009) | 1 line
AGI: Fixed typo in game name ;)
........
r41332 | fingolfin | 2009-06-07 22:47:10 +1000 (Sun, 07 Jun 2009) | 1 line
Added an experimental '--upgrade-targets' option (to be refined; and possibly hooked to the GUI eventually). This updates the guioptions,platform and lang for all your targets (and with a source change, also the descriptions)
........
r41333 | fingolfin | 2009-06-07 23:04:03 +1000 (Sun, 07 Jun 2009) | 1 line
Added some new method variants to Common::String
........
r41334 | fingolfin | 2009-06-07 23:04:16 +1000 (Sun, 07 Jun 2009) | 1 line
Fix for bug #2802492 (GUI: search query causes game list scrollbar glitches)
........
r41336 | athrxx | 2009-06-07 23:07:16 +1000 (Sun, 07 Jun 2009) | 1 line
LOL: implemented two more opcodes for castle cimmeria
........
r41337 | fingolfin | 2009-06-07 23:14:34 +1000 (Sun, 07 Jun 2009) | 1 line
Fixed appending a (substring of a) string to itself
........
r41338 | thebluegr | 2009-06-08 01:53:30 +1000 (Mon, 08 Jun 2009) | 1 line
Replaced/removed KP_UINT, KP_SINT, SKPV and UKPV as well as the VIEW_PRIORITY and PRIORITY_BAND_FIRST wrappers
........
r41339 | thebluegr | 2009-06-08 02:44:57 +1000 (Mon, 08 Jun 2009) | 1 line
Init _opl to 0. This prevents a crash on exit when the Adlib driver is closed, if the game music driver doesn't support music for the currently playing game (e.g. Christmas 1998)
........
r41340 | thebluegr | 2009-06-08 02:50:34 +1000 (Mon, 08 Jun 2009) | 1 line
Replaced KP_ALT, SKPV_OR_ALT and UKPV_OR_ALT
........
r41341 | fingolfin | 2009-06-08 03:05:58 +1000 (Mon, 08 Jun 2009) | 1 line
cleanup
........
r41342 | fingolfin | 2009-06-08 03:06:32 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Renamed various song/songlib related structs and members
........
r41343 | fingolfin | 2009-06-08 03:06:51 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Objectified SongLibrary
........
r41344 | fingolfin | 2009-06-08 03:07:07 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Objectified Song struct 'a bit'
........
r41345 | fingolfin | 2009-06-08 03:07:25 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Simplified SongLibrary code a bit
........
r41346 | fingolfin | 2009-06-08 03:18:11 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Fixed the broken SciEngine::pauseEngineIntern code by ensuring that SciEngine::_gamestate is updated whenever the EngineState gets changed (due to loading a savestate)
........
r41348 | athrxx | 2009-06-08 04:51:03 +1000 (Mon, 08 Jun 2009) | 1 line
LOL: minor bug fix in battle system
........
r41349 | waltervn | 2009-06-08 05:15:55 +1000 (Mon, 08 Jun 2009) | 2 lines
SCI: Moved resource36 handling into resource manager.
........
r41350 | lordhoto | 2009-06-08 05:58:00 +1000 (Mon, 08 Jun 2009) | 2 lines
Avoid warning about missing SFX file in Lands of Lore (it seems the original misses some datafiles for certain effects).
........
r41351 | lordhoto | 2009-06-08 06:43:43 +1000 (Mon, 08 Jun 2009) | 2 lines
Remove LoLEngine::_gameFlags and convert all Lands of Lore code to use _flagsTable instead.
........
r41352 | sev | 2009-06-08 08:05:57 +1000 (Mon, 08 Jun 2009) | 3 lines
Added current keymapper dialog to all themes so it could be tested by other
devs.
........
r41353 | thebluegr | 2009-06-08 08:15:28 +1000 (Mon, 08 Jun 2009) | 1 line
Applied madmoose's patch from bug report #2794216 - "Loading large Smacker movies is slow"
........
r41354 | thebluegr | 2009-06-08 08:17:44 +1000 (Mon, 08 Jun 2009) | 1 line
Formatting
........
r41355 | sev | 2009-06-08 08:19:48 +1000 (Mon, 08 Jun 2009) | 3 lines
Added Clear button for search box. Looks a bit off, but we do not yet have
skinned buttons.
........
r41356 | thebluegr | 2009-06-08 08:34:03 +1000 (Mon, 08 Jun 2009) | 1 line
Changed the bitstream buffer used to initialize the big Huffman trees to be a normal byte array, instead of a Common::Array
........
r41357 | lordhoto | 2009-06-08 08:41:38 +1000 (Mon, 08 Jun 2009) | 2 lines
Remove unneeded functionality from Screen.
........
r41358 | athrxx | 2009-06-08 08:42:21 +1000 (Mon, 08 Jun 2009) | 1 line
LOL: minor bug fix
........
r41359 | fingolfin | 2009-06-08 09:04:34 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: Got rid of g_EngineState
........
r41360 | fingolfin | 2009-06-08 09:05:11 +1000 (Mon, 08 Jun 2009) | 1 line
SCI: C++ified the song iterator code a little bit more
........
r41361 | thebluegr | 2009-06-08 09:29:11 +1000 (Mon, 08 Jun 2009) | 1 line
Hopefully fixed memory corruption when loading games
........
r41362 | lordhoto | 2009-06-08 12:26:33 +1000 (Mon, 08 Jun 2009) | 3 lines
- Fix Screen_v2::wsaFrameAnimationStep, now the MR album and LoL intro demo WSAs will be correctly played
- Made album page change in MR a bit slower, so it's visible at least
........
r41363 | djwillis | 2009-06-08 18:21:18 +1000 (Mon, 08 Jun 2009) | 1 line
Virtual Keyboard: Fix default keyboard pack to return correct events for ENTER and !.
........
r41364 | thebluegr | 2009-06-08 18:38:10 +1000 (Mon, 08 Jun 2009) | 1 line
Moved some more debug commands to ScummVM's console
........
r41365 | Kirben | 2009-06-08 18:56:32 +1000 (Mon, 08 Jun 2009) | 1 line
Update details for the Polish version of The Feeble Files.
........
r41366 | djwillis | 2009-06-08 19:10:12 +1000 (Mon, 08 Jun 2009) | 1 line
Virtual Keyboard: Add source files for the default keyboard pack seperate from ZIP archive (makes it easier to version the packs vkeybd.xml and track fixes) and add script to build keyboard pack(s) ZIP's from source files (based on /gui/themes/scummtheme.py).
........
r41367 | thebluegr | 2009-06-08 21:42:13 +1000 (Mon, 08 Jun 2009) | 1 line
Replaced GFXWARN with warning and GFXDEBUG with debugC
........
r41368 | waltervn | 2009-06-08 22:20:36 +1000 (Mon, 08 Jun 2009) | 2 lines
SCI: Cleanup
........
r41369 | Hkz | 2009-06-08 22:37:24 +1000 (Mon, 08 Jun 2009) | 1 line
sword1: add Broken Sword PSX demo support
........
r41372 | Kirben | 2009-06-09 00:21:43 +1000 (Tue, 09 Jun 2009) | 1 line
Add Polish font data for The Feeble Files.
........
r41373 | djwillis | 2009-06-09 00:47:38 +1000 (Tue, 09 Jun 2009) | 1 line
Virtual Keyboard: Move vkeybd.zip into packs folder and rename default keyboard pack to vkeybd_default(.zip) with updates to default-events.cpp. Also update vkeybdpack.py to use zlib compression if Python zlib is found. Update GP2X and GP2XWiz bundle files to get new vkeybd_default.zip.
........
r41374 | Kirben | 2009-06-09 00:50:34 +1000 (Tue, 09 Jun 2009) | 1 line
Add more Polish font data for The Feeble Files.
........
r41375 | Kirben | 2009-06-09 00:55:11 +1000 (Tue, 09 Jun 2009) | 1 line
Spacing.
........
r41376 | djwillis | 2009-06-09 01:45:03 +1000 (Tue, 09 Jun 2009) | 1 line
Virtual Keyboard: Fix slight error in earlier commit (failed to rename the XML to match the keyboard pack name).
........
r41379 | lordhoto | 2009-06-09 03:47:37 +1000 (Tue, 09 Jun 2009) | 2 lines
Fix out of bounds memory access in Screen::drawShape.
........
r41380 | Hkz | 2009-06-09 03:54:44 +1000 (Tue, 09 Jun 2009) | 1 line
sword1: slight cleanup of psx related sound code and comments
........
r41381 | lordhoto | 2009-06-09 04:30:28 +1000 (Tue, 09 Jun 2009) | 2 lines
Cleanup.
........
r41384 | lordhoto | 2009-06-09 06:11:07 +1000 (Tue, 09 Jun 2009) | 3 lines
- Cleanup
- Fix regression in Kyra1 outro
........
r41385 | djwillis | 2009-06-09 06:31:49 +1000 (Tue, 09 Jun 2009) | 1 line
Virtual Keyboard: Add some quick changes to the virtual keyboard to activate submit and cancel events from the default lowercase keyboards. This makes it possible to cancel and submit without having to call Common::KEYCODE_F7 again. Sorry for the nasty (temp) graphics.
........
r41386 | buddha_ | 2009-06-09 06:46:21 +1000 (Tue, 09 Jun 2009) | 3 lines
Convert FWRenderer and OSRenderer to use Cine::Palette.
Also fix some bugs that came up in testing of Cine::Palette.
........
r41389 | sev | 2009-06-09 07:52:32 +1000 (Tue, 09 Jun 2009) | 2 lines
Actually we /did not/ put periods at ends of the sentences in majority of past entries
........
r41393 | Kirben | 2009-06-09 10:00:24 +1000 (Tue, 09 Jun 2009) | 1 line
Correct check for font data table used in The Feeble Files.
........
r41395 | Kirben | 2009-06-09 16:37:42 +1000 (Tue, 09 Jun 2009) | 1 line
Remove unused old code.
........
r41398 | lordhoto | 2009-06-09 21:26:15 +1000 (Tue, 09 Jun 2009) | 5 lines
- Moved Screen_v2::copyWsaRect to Screen::copyWsaRect
- Made WSAMovie_v1::displayFrame code match the original
- Changed WSAMovieAmiga::displayFrame to use Screen::copyWsaRect too
- Got rid of '...' parameter usage in all WSA player classes
........
r41400 | wjpalenstijn | 2009-06-10 01:26:09 +1000 (Wed, 10 Jun 2009) | 1 line
Add (failing) hashmap test case for collision handling
........
r41401 | lordhoto | 2009-06-10 01:34:02 +1000 (Wed, 10 Jun 2009) | 2 lines
Changed some lines to tabs instead of whitespaces for identation.
........
r41402 | drmccoy | 2009-06-10 04:14:49 +1000 (Wed, 10 Jun 2009) | 1 line
Win Gob3 is multi-lingual (British, French, German)
........
r41403 | drmccoy | 2009-06-10 04:18:11 +1000 (Wed, 10 Jun 2009) | 1 line
Win Gob2 is multi-lingual (American, French, German)
........
r41404 | drmccoy | 2009-06-10 04:19:11 +1000 (Wed, 10 Jun 2009) | 1 line
Win Gob1 is multi-lingual (British, French, German, Italian, Spanish)
........
r41405 | drmccoy | 2009-06-10 04:52:55 +1000 (Wed, 10 Jun 2009) | 1 line
Multi-lingual Inca2 version (American, French, German, Italian, Spanish)
........
r41406 | drmccoy | 2009-06-10 04:53:17 +1000 (Wed, 10 Jun 2009) | 1 line
Win Lost in Time is multi-lingual (British, French, Spanish)
........
r41407 | drmccoy | 2009-06-10 04:53:35 +1000 (Wed, 10 Jun 2009) | 2 lines
Added a workaround for Win Lost in Time.
It's got VMD files which are still referenced as IMD
........
r41408 | waltervn | 2009-06-10 05:18:48 +1000 (Wed, 10 Jun 2009) | 2 lines
SCI: Moved SCI1 audio map handling into the resource manager.
........
r41409 | drmccoy | 2009-06-10 05:37:24 +1000 (Wed, 10 Jun 2009) | 1 line
Fixed CLEAR
........
r41419 | sev | 2009-06-10 18:18:44 +1000 (Wed, 10 Jun 2009) | 1 line
Clarify that Cygwin is not supported as building platform anymore
........
r41421 | sev | 2009-06-10 20:11:24 +1000 (Wed, 10 Jun 2009) | 1 line
Added debugCN() call which does not add newline automatically
........
r41423 | dreammaster | 2009-06-10 22:15:50 +1000 (Wed, 10 Jun 2009) | 1 line
Added variable to savegame format so that savegames can be correctly loaded from the ScummVM launcher
........
r41424 | dreammaster | 2009-06-10 22:16:30 +1000 (Wed, 10 Jun 2009) | 1 line
Added support for loading savegames from the launcher
........
r41425 | lordhoto | 2009-06-10 22:47:19 +1000 (Wed, 10 Jun 2009) | 2 lines
Fix documentation for debugC and debugCN, relying on special debug levels.
........
r41428 | lordhoto | 2009-06-11 01:01:20 +1000 (Thu, 11 Jun 2009) | 2 lines
Fix a bug in disableCursorPalette, where it never allowed the palette to be enabled properly again.
........
r41429 | strangerke | 2009-06-11 01:04:21 +1000 (Thu, 11 Jun 2009) | 3 lines
Gob detection :
- use GUIO_NOSPEECH and GUIO_NOSUBTITLES intensively, as there is no control other them even when they are present
- Replace non-ASCII characters by hex values
........
r41430 | lordhoto | 2009-06-11 01:11:17 +1000 (Thu, 11 Jun 2009) | 2 lines
Extend documentation for "kFeatureCursorHasPalette".
........
r41432 | lordhoto | 2009-06-11 01:20:52 +1000 (Thu, 11 Jun 2009) | 2 lines
Add a convenience wrapper to CursorMan for checking whether cursor palettes are supported.
........
r41433 | jvprat | 2009-06-11 01:33:37 +1000 (Thu, 11 Jun 2009) | 2 lines
Point to the Cursor and AudioCD Managers to help engine authors following the right path.
........
r41452 | sev | 2009-06-12 01:45:52 +1000 (Fri, 12 Jun 2009) | 1 line
Added set of CoCo3 AGI games
........
r41453 | buddha_ | 2009-06-12 04:32:35 +1000 (Fri, 12 Jun 2009) | 8 lines
Fix Operation Stealth's 2nd arcade sequence's revolving doors.
- Now the doors actually do revolve when before they didn't.
- The fix was to alias the 9th background with the collision
page directly when loading collision page data. This way
changes written to the 9th background go to the collision
page and vice versa (And there were changes in the labyrinth).
- Also converted _bgTable from a pure array to a Common::Array
........
r41458 | peres001 | 2009-06-12 15:03:18 +1000 (Fri, 12 Jun 2009) | 2 lines
* Final version of the IFF parsing code.
* Refactored ILBMDecoder usage from disk code.
........
r41459 | peres001 | 2009-06-12 16:20:11 +1000 (Fri, 12 Jun 2009) | 1 line
Removed a leftover printf().
........
r41460 | peres001 | 2009-06-12 17:18:01 +1000 (Fri, 12 Jun 2009) | 2 lines
* Replaced the A8SVXDecoder class with a function to return an AudioStream in trunk/sound/.
* Refactored sound code in Parallaction to use the new Audio::make8SVXStream.
........
r41461 | peres001 | 2009-06-12 17:55:44 +1000 (Fri, 12 Jun 2009) | 1 line
Cleanup of sound code.
........
r41462 | sev | 2009-06-12 18:00:26 +1000 (Fri, 12 Jun 2009) | 1 line
Rename KeyRemapper dialog to KeyMapper
........
r41465 | peres001 | 2009-06-12 18:51:05 +1000 (Fri, 12 Jun 2009) | 2 lines
* Moved the updated IFF code from Parallaction to common/
* Updated Parallaction and SAGA to use the new decoder infrastructure.
........
r41468 | peres001 | 2009-06-12 19:49:38 +1000 (Fri, 12 Jun 2009) | 3 lines
* Adapted Kyra to the new IFFParser interface.
* Adapted the new IFFParser to Kyra (slightly).
The Kyra1 demo on the website works.
........
r41470 | peres001 | 2009-06-12 19:56:07 +1000 (Fri, 12 Jun 2009) | 1 line
Finally fix build (extra qualifier removed).
........
r41473 | peres001 | 2009-06-12 20:26:15 +1000 (Fri, 12 Jun 2009) | 1 line
Added missing return statements.
........
r41474 | peres001 | 2009-06-12 20:26:58 +1000 (Fri, 12 Jun 2009) | 1 line
Fixed disposeStream initialization.
........
r41484 | strangerke | 2009-06-13 08:35:08 +1000 (Sat, 13 Jun 2009) | 1 line
Fix MSVC compilation : iff.h and iff.cpp were move from engines\parallaction\ to graphics\
........
r41485 | waltervn | 2009-06-13 09:29:27 +1000 (Sat, 13 Jun 2009) | 2 lines
SCI: Added detection entries for Japanese QFG.
........
r41486 | waltervn | 2009-06-13 09:46:23 +1000 (Sat, 13 Jun 2009) | 2 lines
SCI: Moved audio code from AudioResource to the sfx core.
........
r41487 | strangerke | 2009-06-13 17:54:25 +1000 (Sat, 13 Jun 2009) | 1 line
Oups. disk.cpp was also missing in MSVC files
........
r41488 | vinterstum | 2009-06-13 19:40:42 +1000 (Sat, 13 Jun 2009) | 1 line
Updated xcode project
........
r41489 | thebluegr | 2009-06-13 20:20:12 +1000 (Sat, 13 Jun 2009) | 1 line
Properly updated the MSVC project files of the parallaction engine, fixing compilation. Side note: please, don't include files outside the engine's directory (like files in /common) for engine project files - it's wrong, as the same code will be compiled twice
........
r41490 | thebluegr | 2009-06-13 20:23:23 +1000 (Sat, 13 Jun 2009) | 1 line
Removed duplicate entry of disk.cpp
........
r41493 | vinterstum | 2009-06-13 23:27:21 +1000 (Sat, 13 Jun 2009) | 1 line
Buildfix for gcc 3.3 (moved a template class member into the header file)
........
r41496 | wjpalenstijn | 2009-06-14 07:07:05 +1000 (Sun, 14 Jun 2009) | 3 lines
Fix erase() sometimes hiding other hash elements.
Like CPython, we now use a dummy node to mark nodes as erased,
so that lookup() can skip over it. All tests should now pass again.
........
r41497 | drmccoy | 2009-06-14 08:10:55 +1000 (Sun, 14 Jun 2009) | 1 line
Making TotTextData's item's offsets unsigned. This could fix the crash in the Polish Woodruff version (bug #2804962)
........
r41498 | strangerke | 2009-06-14 08:14:58 +1000 (Sun, 14 Jun 2009) | 1 line
Gob - *WIP* incomplete implementation of MDY/TBR
........
r41499 | drmccoy | 2009-06-14 08:35:22 +1000 (Sun, 14 Jun 2009) | 1 line
Warn when a sprite operation is to be performed on a nonexistent surface instead of crashing
........
r41500 | lordhoto | 2009-06-14 08:40:30 +1000 (Sun, 14 Jun 2009) | 2 lines
Strip trailing whitespaces.
........
r41501 | sev | 2009-06-14 08:48:16 +1000 (Sun, 14 Jun 2009) | 2 lines
Added sanity checking to stopSound() and a bit more debug output
........
r41502 | lordhoto | 2009-06-14 08:48:32 +1000 (Sun, 14 Jun 2009) | 2 lines
Added periods to every news entry (actually it seems like we always did that in the past, but were a bit lazier in the last time).
........
r41503 | lordhoto | 2009-06-14 09:04:26 +1000 (Sun, 14 Jun 2009) | 2 lines
Added yet another missing period at the end of a line. (I hope I catched all now)
........
r41504 | marcus_c | 2009-06-14 09:42:39 +1000 (Sun, 14 Jun 2009) | 5 lines
Detected games with different language or platform are now
no longer treated as duplicates, even if they have the same
target and directory. Also, pass these parameters to the
ConfMan, so that the correct version of the game is started.
........
r41506 | dreammaster | 2009-06-14 13:39:30 +1000 (Sun, 14 Jun 2009) | 1 line
Beginnings of music support for Cruise, based on the cine engine sound code (note that the music played isn't yet correct, though)
........
r41507 | lordhoto | 2009-06-14 21:08:35 +1000 (Sun, 14 Jun 2009) | 2 lines
Fix unused variable warning.
........
r41508 | drmccoy | 2009-06-14 22:19:42 +1000 (Sun, 14 Jun 2009) | 1 line
Fixed an animation speed regression that got introduced when I added a lag compensation for Woodruff
........
r41516 | lordhoto | 2009-06-15 00:05:42 +1000 (Mon, 15 Jun 2009) | 2 lines
Got rid of a needless "getEventManager" call. (Using Engine::_eventMan now instead)
........
r41517 | waltervn | 2009-06-15 00:11:21 +1000 (Mon, 15 Jun 2009) | 2 lines
SCI: Added detection entries for Japanese SQ4.
........
r41519 | lordhoto | 2009-06-15 00:24:28 +1000 (Mon, 15 Jun 2009) | 2 lines
Cleanup.
........
r41520 | cyx | 2009-06-15 01:07:34 +1000 (Mon, 15 Jun 2009) | 1 line
simplified .raw/.wav data files handling in introduction sequences
........
r41528 | jvprat | 2009-06-15 08:10:17 +1000 (Mon, 15 Jun 2009) | 2 lines
Fix groovie's GUI game options
........
r41536 | sev | 2009-06-15 17:06:52 +1000 (Mon, 15 Jun 2009) | 2 lines
Run AGIMOUSE hack as a side effect always
........
r41537 | thebluegr | 2009-06-15 18:24:01 +1000 (Mon, 15 Jun 2009) | 1 line
Added the missing pixelformat.h file
........
r41538 | thebluegr | 2009-06-15 18:44:35 +1000 (Mon, 15 Jun 2009) | 1 line
Added aliases for the script/breakpoint related commands and added the debugflag related commands to the help screen
........
r41556 | strangerke | 2009-06-16 05:46:00 +1000 (Tue, 16 Jun 2009) | 1 line
Add MD5 for Playtoons 4 FR
........
r41557 | athrxx | 2009-06-16 06:52:09 +1000 (Tue, 16 Jun 2009) | 4 lines
LOL: - started on the ingame menu code (death menu, load menu and main menu)
- fixed regression in kyra gui code (broken menu highlighting)
- fixed minor bug in animation code
........
r41559 | strangerke | 2009-06-16 07:28:11 +1000 (Tue, 16 Jun 2009) | 1 line
renamed playtoons target names to insult-free target names (maybe non-definitive names)
........
r41560 | athrxx | 2009-06-16 07:39:43 +1000 (Tue, 16 Jun 2009) | 1 line
LOL: implemented quit menu
........
r41562 | drmccoy | 2009-06-16 09:07:38 +1000 (Tue, 16 Jun 2009) | 1 line
Merging parseValExpr and parseExpr
........
r41563 | drmccoy | 2009-06-16 09:07:55 +1000 (Tue, 16 Jun 2009) | 1 line
Renamed varPos to varBase and split off getVarBase() from parseVarIndex() and parseExpr()
........
r41564 | drmccoy | 2009-06-16 09:08:09 +1000 (Tue, 16 Jun 2009) | 1 line
Renamed various variables to better reflect their meaning
........
r41565 | drmccoy | 2009-06-16 09:08:28 +1000 (Tue, 16 Jun 2009) | 1 line
Propagating variable name changes
........
r41566 | drmccoy | 2009-06-16 09:08:44 +1000 (Tue, 16 Jun 2009) | 1 line
Fixing the signness indicated by the OP_ enums
........
r41567 | drmccoy | 2009-06-16 09:09:04 +1000 (Tue, 16 Jun 2009) | 1 line
Adding a TYPE_ enum
........
r41568 | drmccoy | 2009-06-16 09:09:23 +1000 (Tue, 16 Jun 2009) | 1 line
Using the TYPE_ enum where applicable
........
r41569 | drmccoy | 2009-06-16 09:09:37 +1000 (Tue, 16 Jun 2009) | 1 line
Renaming some variables in o1_assign() and o2_assign() to mirror the structure in o6_assign()
........
r41570 | drmccoy | 2009-06-16 09:09:57 +1000 (Tue, 16 Jun 2009) | 1 line
Using cmpHelper for OP_NEQ too, since the original does a normal strcmp there as well. No idea where the stricmp came from
........
r41571 | drmccoy | 2009-06-16 09:10:10 +1000 (Tue, 16 Jun 2009) | 1 line
Remove some now superfluous comments
........
r41572 | drmccoy | 2009-06-16 09:10:27 +1000 (Tue, 16 Jun 2009) | 1 line
Splitting up parseExpr a bit
........
r41573 | drmccoy | 2009-06-16 09:10:51 +1000 (Tue, 16 Jun 2009) | 1 line
Moving _inter_resVal and _inter_resStr from Global to Parse
........
r41574 | drmccoy | 2009-06-16 09:11:08 +1000 (Tue, 16 Jun 2009) | 1 line
Renaming _inter_resVal to _resultInt
........
r41575 | drmccoy | 2009-06-16 09:11:29 +1000 (Tue, 16 Jun 2009) | 1 line
Renamed _inter_resStr to _resultStr
........
r41576 | athrxx | 2009-06-16 09:22:31 +1000 (Tue, 16 Jun 2009) | 1 line
KYRA: fixed regression (broken menu slide bars in HOF/MR)
........
r41579 | strangerke | 2009-06-16 17:14:07 +1000 (Tue, 16 Jun 2009) | 1 line
Add MD5 for Playtoons 3 (english)
........
r41584 | strangerke | 2009-06-16 22:25:53 +1000 (Tue, 16 Jun 2009) | 1 line
MDY/TBR : fix a thing or two. Still far from being OK, but in-game ambiance "music" is (a little) less buggy
........
r41587 | Hkz | 2009-06-17 04:58:21 +1000 (Wed, 17 Jun 2009) | 1 line
tinsel: check only english.txt for DW1 psx version detection, and use recursive "SearchMan.addDirectory()" to obtain subdirs for Discworld PSX datafiles
........
r41588 | lordhoto | 2009-06-17 05:26:44 +1000 (Wed, 17 Jun 2009) | 2 lines
Formatting.
........
r41589 | drmccoy | 2009-06-17 06:14:56 +1000 (Wed, 17 Jun 2009) | 1 line
Encapsulating stack adjustments
........
r41590 | drmccoy | 2009-06-17 06:15:19 +1000 (Wed, 17 Jun 2009) | 1 line
Encapsulating the Stack and StackFrame a bit
........
r41591 | drmccoy | 2009-06-17 06:15:49 +1000 (Wed, 17 Jun 2009) | 1 line
Properly initializing _soundMode, for ADLs too
........
r41592 | drmccoy | 2009-06-17 06:39:37 +1000 (Wed, 17 Jun 2009) | 1 line
Including scummsys.h and forward-declaring GobEngine
........
r41596 | athrxx | 2009-06-17 07:23:26 +1000 (Wed, 17 Jun 2009) | 1 line
LOL: implemented options menu (settings aren't saved yet)
........
r41598 | sev | 2009-06-17 07:59:20 +1000 (Wed, 17 Jun 2009) | 2 lines
Disable music for CoCo3 games. It has different format.
........
r41601 | drmccoy | 2009-06-17 14:15:45 +1000 (Wed, 17 Jun 2009) | 1 line
Changed opcodeDraw to be functor-based
........
r41602 | drmccoy | 2009-06-17 14:16:21 +1000 (Wed, 17 Jun 2009) | 1 line
Changed opcodeFunc to be functor-based
........
r41603 | drmccoy | 2009-06-17 14:16:51 +1000 (Wed, 17 Jun 2009) | 1 line
Changed opcodeGob to be functor-based
........
r41611 | strangerke | 2009-06-18 04:48:41 +1000 (Thu, 18 Jun 2009) | 2 lines
- Modify detection files for Playtoons CK Knights (CK2) as it wasn't making the difference with CK1
- Add Playtoons CK Monsters (CK1)
........
r41618 | sev | 2009-06-18 09:16:21 +1000 (Thu, 18 Jun 2009) | 2 lines
Preliminary support for CoCo3 music.
........
r41619 | dhewg | 2009-06-18 09:36:00 +1000 (Thu, 18 Jun 2009) | 1 line
Moved the wiidist target to ports.mk, cleaned it up and automated meta.xml generation.
........
r41630 | dreammaster | 2009-06-18 21:37:45 +1000 (Thu, 18 Jun 2009) | 1 line
Removed redundant code that isn't used
........
r41632 | drmccoy | 2009-06-18 23:27:14 +1000 (Thu, 18 Jun 2009) | 1 line
Replacing some #includes by forward declarations
........
r41633 | drmccoy | 2009-06-18 23:27:35 +1000 (Thu, 18 Jun 2009) | 1 line
Splitting an ADLPlayer and MDYPlayer from the AdLib class
........
r41634 | drmccoy | 2009-06-18 23:27:48 +1000 (Thu, 18 Jun 2009) | 1 line
Oops, forgot again that Fascination needs o1_assign
........
r41635 | Hkz | 2009-06-18 23:50:26 +1000 (Thu, 18 Jun 2009) | 1 line
scumm: added the missing word "version" in a comment
........
r41639 | dhewg | 2009-06-19 04:40:38 +1000 (Fri, 19 Jun 2009) | 1 line
added DIST_FILES_DOCS to Makefile.common, used by some dist targets now, incl. OSX bundles.
........
r41641 | vinterstum | 2009-06-19 04:57:17 +1000 (Fri, 19 Jun 2009) | 1 line
Improved the iphone swipe input handling
........
r41644 | dhewg | 2009-06-19 05:39:12 +1000 (Fri, 19 Jun 2009) | 1 line
added pred.dic to DIST_FILES_ENGINEDATA
........
r41645 | drmccoy | 2009-06-19 07:08:51 +1000 (Fri, 19 Jun 2009) | 1 line
Removing the useless _vm->_parse->
........
r41646 | lordhoto | 2009-06-19 07:47:10 +1000 (Fri, 19 Jun 2009) | 2 lines
Replaced "getRandomNumberSpecial" be RandomSource usage. (This is needed for proper event recording, also the probability for generated numbers is actually nearly the same)
........
r41647 | fingolfin | 2009-06-19 08:09:57 +1000 (Fri, 19 Jun 2009) | 1 line
Patch
........
r41660 | thebluegr | 2009-06-19 17:56:30 +1000 (Fri, 19 Jun 2009) | 1 line
Fixed a warning about an uninitialized variable
........
r41663 | drmccoy | 2009-06-19 19:42:41 +1000 (Fri, 19 Jun 2009) | 1 line
Ooops, forgot to change the array when copy-pasting the description function
........
r41664 | drmccoy | 2009-06-19 19:43:01 +1000 (Fri, 19 Jun 2009) | 1 line
Fixing The Last Dynasty again after the opcode dispatcher changes
........
r41665 | dreammaster | 2009-06-19 19:44:33 +1000 (Fri, 19 Jun 2009) | 1 line
Added myself to the CRUISE engine credits
........
r41668 | drmccoy | 2009-06-19 19:55:23 +1000 (Fri, 19 Jun 2009) | 1 line
Added my German version of The Last Dynasty
........
r41677 | athrxx | 2009-06-20 03:03:28 +1000 (Sat, 20 Jun 2009) | 2 lines
LOL: - implemented bezel cup opcode
- implemented font conversion for certain language specific characters in load game dialogue (only german atm)
........
r41679 | lordhoto | 2009-06-20 03:53:25 +1000 (Sat, 20 Jun 2009) | 2 lines
Fix some warnings.
........
r41680 | waltervn | 2009-06-20 04:07:45 +1000 (Sat, 20 Jun 2009) | 2 lines
SCI: Fix cel1 y-offset regression introduced in r40997.
........
r41683 | athrxx | 2009-06-20 04:46:19 +1000 (Sat, 20 Jun 2009) | 3 lines
LOL: - implemented delete menu
- fixed some bugs in the menu code
........
r41699 | dreammaster | 2009-06-20 16:20:12 +1000 (Sat, 20 Jun 2009) | 1 line
Added explicit casts to _fontConversionTableGerman for systems where char is signed
........
r41700 | dreammaster | 2009-06-20 16:48:47 +1000 (Sat, 20 Jun 2009) | 1 line
Finally tracked down the difference/bug in the music playing code - music playback now works
........
r41701 | dreammaster | 2009-06-20 17:36:12 +1000 (Sat, 20 Jun 2009) | 1 line
Bugfix to fade out any currently playing music when the game is restarted
........
r41702 | dreammaster | 2009-06-20 18:15:01 +1000 (Sat, 20 Jun 2009) | 1 line
Added proper saving of music state to savegames so music resumes when a savegame is loaded.
........
r41703 | dreammaster | 2009-06-20 18:15:39 +1000 (Sat, 20 Jun 2009) | 1 line
Implemented the library function Op_SongExist
........
r41704 | cyx | 2009-06-20 20:52:55 +1000 (Sat, 20 Jun 2009) | 2 lines
fixed OPL 0xB0 register write. the return value of findNote() already includes the octave, no need to readd it.
........
r41705 | dhewg | 2009-06-20 21:48:42 +1000 (Sat, 20 Jun 2009) | 2 lines
split loadKeyboardPack(), fallback to the current dir when searching for packs, and free memory in the case of an error.
........
r41707 | dhewg | 2009-06-20 21:50:15 +1000 (Sat, 20 Jun 2009) | 1 line
added vkeybd_default.zip to the Wii dist target.
........
r41708 | dhewg | 2009-06-20 21:53:31 +1000 (Sat, 20 Jun 2009) | 1 line
oups, wrong spot.
........
r41709 | dreammaster | 2009-06-20 22:02:08 +1000 (Sat, 20 Jun 2009) | 1 line
Changed many file reads and manual conversions from endian format to instead use file readSint16BE/readSint32BE calls
........
r41713 | athrxx | 2009-06-21 00:26:01 +1000 (Sun, 21 Jun 2009) | 1 line
LOL: implemented save menu
........
r41714 | athrxx | 2009-06-21 01:09:55 +1000 (Sun, 21 Jun 2009) | 1 line
LOL: cleanup
........
r41715 | athrxx | 2009-06-21 02:36:26 +1000 (Sun, 21 Jun 2009) | 1 line
LOL: minor fix for save menu
........
r41718 | lordhoto | 2009-06-21 11:14:57 +1000 (Sun, 21 Jun 2009) | 1 line
Prevent font code to draw characters not included in the font.
........
r41719 | lordhoto | 2009-06-21 11:15:09 +1000 (Sun, 21 Jun 2009) | 1 line
Fix drawing of sharp s.
........
r41720 | lordhoto | 2009-06-21 11:15:24 +1000 (Sun, 21 Jun 2009) | 1 line
Moved CP850<->ISO-8859-1 conversion to Util.
........
r41721 | lordhoto | 2009-06-21 11:15:37 +1000 (Sun, 21 Jun 2009) | 1 line
Enable proper umlaut handling in kyra 1-3.
........
r41722 | lordhoto | 2009-06-21 11:15:47 +1000 (Sun, 21 Jun 2009) | 1 line
Fix umlauts for original interpreter saves.
........
r41723 | lordhoto | 2009-06-21 11:22:23 +1000 (Sun, 21 Jun 2009) | 1 line
Cleanup.
........
r41724 | dreammaster | 2009-06-21 15:13:29 +1000 (Sun, 21 Jun 2009) | 1 line
Bugfixes to pre-loading and handling of resources such as sound files
........
r41725 | dreammaster | 2009-06-21 21:42:45 +1000 (Sun, 21 Jun 2009) | 1 line
Changed .SPL (sound effect) loading to load the Adlib version of sound effects - sound effects now work
........
r41726 | dreammaster | 2009-06-21 21:53:11 +1000 (Sun, 21 Jun 2009) | 1 line
Minor fixes to the individual note playing code
........
r41727 | thebluegr | 2009-06-21 23:06:08 +1000 (Sun, 21 Jun 2009) | 1 line
Cleanup
........
r41729 | athrxx | 2009-06-22 02:59:51 +1000 (Mon, 22 Jun 2009) | 3 lines
LOL: - implemented audio menu
- menu settings now get saved
- remove white spaces
........
r41730 | lordhoto | 2009-06-22 05:00:50 +1000 (Mon, 22 Jun 2009) | 1 line
Cleanup: Change LoL code to use KYRA volume handling.
........
r41731 | lordhoto | 2009-06-22 05:01:04 +1000 (Mon, 22 Jun 2009) | 1 line
Cleanup: Change LoL specific config entries to use underscores instead of whitespaces.
........
r41732 | lordhoto | 2009-06-22 05:49:20 +1000 (Mon, 22 Jun 2009) | 1 line
Fix slider buttons in LoL (and some minor cleanup).
........
r41733 | lordhoto | 2009-06-22 06:10:45 +1000 (Mon, 22 Jun 2009) | 1 line
Cleanup.
........
r41734 | athrxx | 2009-06-22 06:40:31 +1000 (Mon, 22 Jun 2009) | 2 lines
LOL: - implemented support for "floating cursors"
- prevent complete refresh for audio menu whenever a mouse button is pressed
........
r41735 | athrxx | 2009-06-22 07:05:06 +1000 (Mon, 22 Jun 2009) | 1 line
LOL: minor fix for floating cursors
........
r41736 | lordhoto | 2009-06-22 07:17:41 +1000 (Mon, 22 Jun 2009) | 1 line
Cleanup.
........
r41739 | lordhoto | 2009-06-22 12:34:35 +1000 (Mon, 22 Jun 2009) | 1 line
Start refactoring palette handling into new class "Palette".
........
r41740 | lordhoto | 2009-06-22 12:35:04 +1000 (Mon, 22 Jun 2009) | 1 line
Got rid of Screen::_currentPalette.
........
r41741 | lordhoto | 2009-06-22 12:35:45 +1000 (Mon, 22 Jun 2009) | 1 line
Changed Screen::getPalette to return a reference to a Palette object.
........
r41742 | lordhoto | 2009-06-22 12:36:16 +1000 (Mon, 22 Jun 2009) | 1 line
Add wrapper functionality for copying full palettes.
........
r41743 | lordhoto | 2009-06-22 12:36:54 +1000 (Mon, 22 Jun 2009) | 6 lines
- Changed the following Screen functions to take a reference to a Palette object:
-> setScreenPalette
-> fadePalette
-> getFadeParams
-> fadePalStep
- Fixed initialization of 256 color palettes
........
r41744 | lordhoto | 2009-06-22 12:37:20 +1000 (Mon, 22 Jun 2009) | 1 line
Changed Screen::loadBitmap and Movie::open to take an optional Palette pointer instead of an optional array pointer.
........
r41745 | lordhoto | 2009-06-22 12:37:41 +1000 (Mon, 22 Jun 2009) | 1 line
Changed Screen::loadPalette to take a reference to a Palette object instead of an array.
........
r41746 | lordhoto | 2009-06-22 12:37:57 +1000 (Mon, 22 Jun 2009) | 2 lines
- Fixed regression in Screen::fadeToBlack
- Fixed some palette regressions in Kyra1 Amiga (only the intro works currently)
........
r41747 | lordhoto | 2009-06-22 12:41:56 +1000 (Mon, 22 Jun 2009) | 1 line
Fix memory leak.
........
r41748 | dreammaster | 2009-06-22 16:17:50 +1000 (Mon, 22 Jun 2009) | 1 line
Implemented the Op_SetVolume method like the original, which simply set a dummy variable and never actually changed the volume
........
r41749 | dreammaster | 2009-06-22 16:35:08 +1000 (Mon, 22 Jun 2009) | 1 line
Added the dummy volume variable to the savegame format
........
r41750 | drmccoy | 2009-06-22 20:11:25 +1000 (Mon, 22 Jun 2009) | 1 line
Encapsulated access to Parse::_resultInt
........
r41751 | drmccoy | 2009-06-22 20:11:53 +1000 (Mon, 22 Jun 2009) | 1 line
Encapsulated access to _resultStr
........
r41752 | drmccoy | 2009-06-22 20:12:33 +1000 (Mon, 22 Jun 2009) | 1 line
Adding DataIO::existData()
........
r41753 | drmccoy | 2009-06-22 20:13:37 +1000 (Mon, 22 Jun 2009) | 1 line
Encapsulating script file access
........
r41754 | drmccoy | 2009-06-22 20:14:18 +1000 (Mon, 22 Jun 2009) | 1 line
Implemented a call stack
........
r41755 | drmccoy | 2009-06-22 20:14:49 +1000 (Mon, 22 Jun 2009) | 1 line
Removing debug output
........
r41756 | drmccoy | 2009-06-22 20:15:14 +1000 (Mon, 22 Jun 2009) | 1 line
Implemented loading TOTs from video file again
........
r41757 | drmccoy | 2009-06-22 20:15:52 +1000 (Mon, 22 Jun 2009) | 1 line
Giving CollisionArea a full-blown Script pointer instead the data pointer
........
r41758 | drmccoy | 2009-06-22 20:16:17 +1000 (Mon, 22 Jun 2009) | 1 line
Removing the now useless cuckoo function and shrink the call stack entries accordingly
........
r41759 | drmccoy | 2009-06-22 20:16:45 +1000 (Mon, 22 Jun 2009) | 1 line
Unwinding the call stack before unloading the script
........
r41760 | drmccoy | 2009-06-22 20:29:32 +1000 (Mon, 22 Jun 2009) | 1 line
Putting evalBoolResult() and evalExpr() into Script
........
r41761 | drmccoy | 2009-06-22 20:29:48 +1000 (Mon, 22 Jun 2009) | 1 line
Removing the Parse object from GobEngine
........
r41762 | drmccoy | 2009-06-22 20:30:09 +1000 (Mon, 22 Jun 2009) | 1 line
Pushing script.o down
........
r41763 | dreammaster | 2009-06-22 20:41:32 +1000 (Mon, 22 Jun 2009) | 1 line
Removed redundant variation of the routine to play sound effects
........
r41765 | drmccoy | 2009-06-22 21:53:46 +1000 (Mon, 22 Jun 2009) | 1 line
const correctness
........
r41766 | strangerke | 2009-06-22 22:03:58 +1000 (Mon, 22 Jun 2009) | 1 line
Include recently added script.h and script.cpp
........
r41768 | drmccoy | 2009-06-23 02:29:00 +1000 (Tue, 23 Jun 2009) | 1 line
Removing commented-out declarations
........
r41769 | drmccoy | 2009-06-23 02:29:16 +1000 (Tue, 23 Jun 2009) | 1 line
Adding some comments
........
r41770 | drmccoy | 2009-06-23 02:29:31 +1000 (Tue, 23 Jun 2009) | 1 line
Don't assert on pop when no script is loaded
........
r41771 | drmccoy | 2009-06-23 02:29:45 +1000 (Tue, 23 Jun 2009) | 1 line
More signess consistency on the reading and seeking methods
........
r41772 | drmccoy | 2009-06-23 02:30:06 +1000 (Tue, 23 Jun 2009) | 1 line
Renaming "Parse" to "Expression"
........
r41773 | drmccoy | 2009-06-23 02:30:35 +1000 (Tue, 23 Jun 2009) | 1 line
Renaming parse.h and parse.cpp to expression.h and expression.cpp
........
r41774 | drmccoy | 2009-06-23 02:30:51 +1000 (Tue, 23 Jun 2009) | 1 line
Renaming kDebugParser to kDebugExpression
........
r41777 | lordhoto | 2009-06-23 05:46:08 +1000 (Tue, 23 Jun 2009) | 1 line
Fix palette regression in Lands of Lore.
........
r41778 | strangerke | 2009-06-23 05:56:06 +1000 (Tue, 23 Jun 2009) | 1 line
rename parse.h and .cpp to expression.h and .cpp
........
r41781 | drmccoy | 2009-06-23 06:27:47 +1000 (Tue, 23 Jun 2009) | 1 line
Added stream-reading loading wrappers to MDYPlayer and added a workaround to fix TBR reading for the moment
........
r41782 | drmccoy | 2009-06-23 06:51:34 +1000 (Tue, 23 Jun 2009) | 1 line
Properly guarding Script::getOffset() and adding a reverse operation
........
r41783 | drmccoy | 2009-06-23 06:51:48 +1000 (Tue, 23 Jun 2009) | 1 line
Removing trailing spaces
........
r41784 | drmccoy | 2009-06-23 06:52:08 +1000 (Tue, 23 Jun 2009) | 1 line
Removing trailing tabs
........
r41785 | fingolfin | 2009-06-23 07:48:47 +1000 (Tue, 23 Jun 2009) | 1 line
Patch #2810483 (SCI: Convert gfx subsystem headers to Doxygen format), with @brief removed
........
r41786 | fingolfin | 2009-06-23 09:09:28 +1000 (Tue, 23 Jun 2009) | 1 line
Fixed NDS compilation when using older devkitpro versions (I accidentally broke that some time ago)
........
r41787 | dreammaster | 2009-06-23 11:01:16 +1000 (Tue, 23 Jun 2009) | 1 line
Bugfixes to keep sound effects to channel #4 like the original (it ignores the channel parameter to the given library routine)
........
r41788 | drmccoy | 2009-06-23 11:19:03 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script methods to get the TOT major and minor version
........
r41789 | drmccoy | 2009-06-23 11:19:21 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script methods to query commun file handling
........
r41790 | drmccoy | 2009-06-23 11:19:37 +1000 (Tue, 23 Jun 2009) | 1 line
Const correctness
........
r41791 | drmccoy | 2009-06-23 11:20:05 +1000 (Tue, 23 Jun 2009) | 1 line
Added a method to query the number of variables needed by a Script
........
r41792 | drmccoy | 2009-06-23 11:20:21 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script::getTextsOffset()
........
r41793 | drmccoy | 2009-06-23 11:21:06 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script::getResourcesOffset()
........
r41794 | drmccoy | 2009-06-23 11:21:51 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script::getAnimDataSize()
........
r41795 | drmccoy | 2009-06-23 11:22:30 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script::getStartOffset()
........
r41796 | drmccoy | 2009-06-23 11:22:51 +1000 (Tue, 23 Jun 2009) | 1 line
Added Script::getCenterOffset()
........
r41797 | drmccoy | 2009-06-23 11:23:14 +1000 (Tue, 23 Jun 2009) | 1 line
Replacing the 2 offset functions by a generic Script::getFunctionOffset()
........
r41798 | drmccoy | 2009-06-23 11:23:31 +1000 (Tue, 23 Jun 2009) | 1 line
Stopping the seek() going into the header
........
r41799 | drmccoy | 2009-06-23 11:23:51 +1000 (Tue, 23 Jun 2009) | 1 line
Also loading TOT properties when the TOT is found in a LOM
........
r41803 | drmccoy | 2009-06-23 18:51:55 +1000 (Tue, 23 Jun 2009) | 1 line
Changing the TBR FIXME into a warning in setVoice()
........
r41806 | Hkz | 2009-06-23 23:24:46 +1000 (Tue, 23 Jun 2009) | 1 line
tinsel: added some comments to psx palette mapper
........
r41809 | drmccoy | 2009-06-24 01:06:38 +1000 (Wed, 24 Jun 2009) | 1 line
Added German Fascination (3 disk version), as supplied by windlepoons in bug report #2809247
........
r41810 | drmccoy | 2009-06-24 01:08:56 +1000 (Wed, 24 Jun 2009) | 1 line
Added Hungarian versions of gob1-gob3 as supplied by goodoldgeorg in bug report #2810082
........
r41811 | drmccoy | 2009-06-24 03:37:18 +1000 (Wed, 24 Jun 2009) | 1 line
Binary, not logical ORing the GUIO flags (Strangerke, you fscked up there :P)
........
r41812 | drmccoy | 2009-06-24 03:55:09 +1000 (Wed, 24 Jun 2009) | 1 line
Added support for Hungarian
........
r41813 | drmccoy | 2009-06-24 03:55:27 +1000 (Wed, 24 Jun 2009) | 1 line
Proper support for Hungarian versions
........
r41821 | drmccoy | 2009-06-24 09:55:19 +1000 (Wed, 24 Jun 2009) | 1 line
Putting basic TOT handling into its own class
........
r41822 | drmccoy | 2009-06-24 09:55:35 +1000 (Wed, 24 Jun 2009) | 1 line
Putting TOT filename generation and LOM checking into TOTFile
........
r41823 | drmccoy | 2009-06-24 09:55:48 +1000 (Wed, 24 Jun 2009) | 1 line
Added methods to get the file base from a filename
........
r41827 | lordhoto | 2009-06-25 03:01:01 +1000 (Thu, 25 Jun 2009) | 1 line
Silence unsued variables warnings.
........
r41833 | waltervn | 2009-06-25 05:12:45 +1000 (Thu, 25 Jun 2009) | 2 lines
SCI: Partial support for dual-language games.
........
r41834 | waltervn | 2009-06-25 05:26:06 +1000 (Thu, 25 Jun 2009) | 2 lines
SCI: Fix regression in r41833.
........
r41836 | drmccoy | 2009-06-25 07:47:54 +1000 (Thu, 25 Jun 2009) | 1 line
Clarifying some warnings
........
r41837 | drmccoy | 2009-06-25 07:48:13 +1000 (Thu, 25 Jun 2009) | 1 line
Checking for the file's existence in DataIO::getDataStream()
........
r41838 | drmccoy | 2009-06-25 07:48:27 +1000 (Thu, 25 Jun 2009) | 1 line
Added the scriptEnd property
........
r41839 | drmccoy | 2009-06-25 07:49:37 +1000 (Thu, 25 Jun 2009) | 1 line
Wrapping resources (out of TOT, EXT, IM? and EX? files) loading into its own class
........
r41841 | mthreepwood | 2009-06-25 10:14:07 +1000 (Thu, 25 Jun 2009) | 1 line
After discussing with waltervn, committing my fix for the King's Quest I Demo (original from Patch #2795916). I'm also fixing the full game as well :)
........
r41844 | lordhoto | 2009-06-25 11:29:14 +1000 (Thu, 25 Jun 2009) | 1 line
Initial support for Kyrandia 1 PC-9801 Japanese 16 color.
........
r41845 | lordhoto | 2009-06-25 11:29:27 +1000 (Thu, 25 Jun 2009) | 1 line
Implement properly colored mouse cursors in 16 color version of Kyrandia 1.
........
r41846 | lordhoto | 2009-06-25 11:29:41 +1000 (Thu, 25 Jun 2009) | 1 line
Implement palette fading for 16 color version of Kyrandia 1.
........
r41847 | lordhoto | 2009-06-25 11:29:55 +1000 (Thu, 25 Jun 2009) | 1 line
Add config option for Kyra1 16 color, it'll only use dithering when "16_color" is set to true.
........
r41848 | lordhoto | 2009-06-25 11:30:12 +1000 (Thu, 25 Jun 2009) | 1 line
Strip trailing whitespaces and tabs.
........
r41850 | lordhoto | 2009-06-25 12:38:19 +1000 (Thu, 25 Jun 2009) | 1 line
Readd PC98 palette loading for LoL 16 color.
........
r41851 | lordhoto | 2009-06-25 12:39:00 +1000 (Thu, 25 Jun 2009) | 1 line
Implement proper VGA (a color component in [0, 63]) to our palette format (color component in [0, 255]) conversion.
........
r41852 | lordhoto | 2009-06-25 12:39:23 +1000 (Thu, 25 Jun 2009) | 1 line
Implement proper AMIGA to VGA color conversion.
........
r41853 | lordhoto | 2009-06-25 12:41:39 +1000 (Thu, 25 Jun 2009) | 1 line
Mention Kyra 1 PC98 16 color dithering support.
........
r41858 | strangerke | 2009-06-25 20:03:23 +1000 (Thu, 25 Jun 2009) | 1 line
Fix compilation issue for MSVC
........
r41859 | drmccoy | 2009-06-25 20:54:35 +1000 (Thu, 25 Jun 2009) | 1 line
Plugging some memory leaks
........
r41860 | drmccoy | 2009-06-25 20:55:01 +1000 (Thu, 25 Jun 2009) | 1 line
Giving the "backup" arrays their own class, Environments, and really plugging all related leaks
........
r41867 | lordhoto | 2009-06-26 01:22:08 +1000 (Fri, 26 Jun 2009) | 1 line
Implement proper color index conversion for Lands of Lore PC98. (The intro and menu screen work fine now)
........
r41868 | drmccoy | 2009-06-26 01:29:19 +1000 (Fri, 26 Jun 2009) | 1 line
Oops, used git commit --amend wrong, apparently. /This/ is the real Environments change I wanted to push
........
r41869 | drmccoy | 2009-06-26 01:37:46 +1000 (Fri, 26 Jun 2009) | 1 line
Adding more version entries for a Gob1 Win version, thanks to Hkz
........
r41870 | lordhoto | 2009-06-26 01:53:09 +1000 (Fri, 26 Jun 2009) | 1 line
Fix japanese font colors in Kyra 1 PC98 16 color.
........
r41871 | lordhoto | 2009-06-26 01:53:21 +1000 (Fri, 26 Jun 2009) | 1 line
Cleanup.
........
r41875 | drmccoy | 2009-06-26 04:53:36 +1000 (Fri, 26 Jun 2009) | 1 line
Making _numDataChunks unsigned
........
r41876 | lordhoto | 2009-06-26 05:52:49 +1000 (Fri, 26 Jun 2009) | 1 line
Cleanup.
........
r41877 | lordhoto | 2009-06-26 05:53:55 +1000 (Fri, 26 Jun 2009) | 1 line
Use Screen::loadPalette instead of Resource::loadFileToBuf.
........
r41878 | lordhoto | 2009-06-26 05:54:41 +1000 (Fri, 26 Jun 2009) | 1 line
Replace yet another palette from file loading with Screen::loadPalette.
........
r41879 | lordhoto | 2009-06-26 05:55:25 +1000 (Fri, 26 Jun 2009) | 1 line
Cleanup VQA player a bit.
........
r41880 | lordhoto | 2009-06-26 05:56:02 +1000 (Fri, 26 Jun 2009) | 1 line
Add a const "getData" access method to Palette.
........
r41881 | lordhoto | 2009-06-26 05:57:06 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_v2::generateOverlay to take a const Palette reference instead of a pointer.
........
r41882 | lordhoto | 2009-06-26 05:57:35 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_LoL::generateGrayOverlay to use a Palette object internally.
........
r41883 | lordhoto | 2009-06-26 05:58:17 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_HoF::generateGrayOverlay to use a Palette object internally.
........
r41884 | lordhoto | 2009-06-26 05:59:06 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_LoL genereta overlay functionallity to accept a Palette object as source.
........
r41885 | lordhoto | 2009-06-26 05:59:56 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_HoF::generateGrayOverlay to accept a Palette object as source.
........
r41886 | lordhoto | 2009-06-26 06:00:52 +1000 (Fri, 26 Jun 2009) | 1 line
Change Screen_v2::findLeastDifferentColor to take a Palette object as source.
........
r41887 | athrxx | 2009-06-26 07:17:50 +1000 (Fri, 26 Jun 2009) | 2 lines
KYRA/LOL: - support speech/text settings in LOL intro
- fix possible pc98 music issue
........
r41889 | lordhoto | 2009-06-26 09:03:57 +1000 (Fri, 26 Jun 2009) | 1 line
Implement difference in PC98 version. (This actually breaks the text colors in the LoL intro for now...)
........
r41890 | lordhoto | 2009-06-26 09:04:08 +1000 (Fri, 26 Jun 2009) | 1 line
Cleanup palette setup.
........
r41891 | lordhoto | 2009-06-26 09:04:21 +1000 (Fri, 26 Jun 2009) | 1 line
Store palettes in a Common::Array instead of a fixed size array.
........
r41892 | lordhoto | 2009-06-26 09:04:32 +1000 (Fri, 26 Jun 2009) | 1 line
Only initialize palettes with 16 colors in (real) 16 color games.
........
r41893 | lordhoto | 2009-06-26 09:04:43 +1000 (Fri, 26 Jun 2009) | 1 line
For now always enable voices in PC98 version of LoL.
........
r41895 | lordhoto | 2009-06-26 10:11:56 +1000 (Fri, 26 Jun 2009) | 1 line
Implement PC98 text mode color palette.
........
r41896 | lordhoto | 2009-06-26 10:12:08 +1000 (Fri, 26 Jun 2009) | 1 line
Implement palette difference in Kanji drawing code for PC98.
........
r41897 | lordhoto | 2009-06-26 10:12:19 +1000 (Fri, 26 Jun 2009) | 1 line
Implement difference in TIM's displayText code for PC98, this should fix the font color in the intro.
........
r41902 | athrxx | 2009-06-27 03:58:27 +1000 (Sat, 27 Jun 2009) | 1 line
KYRA/LOL: fixed minor bug by adding reset() call to pc98 audio driver destructor
........
r41903 | drmccoy | 2009-06-27 05:03:37 +1000 (Sat, 27 Jun 2009) | 1 line
Fixing text strings embedded in the TOT
........
r41915 | buddha_ | 2009-06-27 22:26:26 +1000 (Sat, 27 Jun 2009) | 11 lines
Name Operation Stealth's global variables 251 and 252 and init them in main loop.
These are used as a sort of a backup for the
mouse position (x, y) variables 249 and 250.
Future Wars's VAR_MOUSE_Y_MODE and Operation Stealth's
VAR_MOUSE_X_POS_2ND (251) clash and that's possibly
why executePlayerInput currently works incorrectly
with Operation Stealth. More reverse engineering
is needed...
........
r41916 | athrxx | 2009-06-27 22:36:12 +1000 (Sat, 27 Jun 2009) | 1 line
LOL: cleanup
........
r41917 | athrxx | 2009-06-27 23:15:47 +1000 (Sat, 27 Jun 2009) | 1 line
LOL: fixed regression
........
r41922 | athrxx | 2009-06-28 02:48:47 +1000 (Sun, 28 Jun 2009) | 1 line
LOL: add workaround to fix map text display when the language is set to French
........
r41929 | joostp | 2009-06-29 03:51:53 +1000 (Mon, 29 Jun 2009) | 2 lines
change link order in .spec file to produce working binaries when building using the configure script
........
r41930 | fingolfin | 2009-06-29 05:56:58 +1000 (Mon, 29 Jun 2009) | 1 line
Silenced the reamining warnings reported in patch #2684986 (gcc warnings with -DFORTIFY_SOURCE=2 -fstack-protector)
........
r41931 | fingolfin | 2009-06-29 05:57:27 +1000 (Mon, 29 Jun 2009) | 1 line
GUI: Replaced ThemeParser::_drawFunction hashmap by a static function getDrawingFunctionCallback which maps strings to draw funcs
........
r41932 | fingolfin | 2009-06-29 05:58:11 +1000 (Mon, 29 Jun 2009) | 4 lines
Changed OSystem::setWindowCaption to expect ISO LATIN 1 encoded input;
also intentionally broke WinCE and Symbian ports (in an obvious way that
can be undo by commenting out some text) -- hopefully this will get the
maintainers' attention during the next release cycle, unlike my emails
........
r41933 | fingolfin | 2009-06-29 05:58:30 +1000 (Mon, 29 Jun 2009) | 1 line
PS2: Don't overload fillScreen with a dummy, just use the inherited version
........
r41934 | fingolfin | 2009-06-29 07:04:24 +1000 (Mon, 29 Jun 2009) | 1 line
Fix PSP port
........
r41938 | eriktorbjorn | 2009-06-29 08:20:28 +1000 (Mon, 29 Jun 2009) | 2 lines
For consistency, use upper-case letter in hex constant.
........
r41940 | lordhoto | 2009-06-29 22:33:47 +1000 (Mon, 29 Jun 2009) | 1 line
Indentation fix.
........
r41941 | lordhoto | 2009-06-30 02:05:50 +1000 (Tue, 30 Jun 2009) | 1 line
Modified Palette::load*Palette definition.
........
r41942 | lordhoto | 2009-06-30 02:06:02 +1000 (Tue, 30 Jun 2009) | 1 line
Change LoLEngine::processMagicIce to use Palette objects internally.
........
r41943 | lordhoto | 2009-06-30 02:06:18 +1000 (Tue, 30 Jun 2009) | 1 line
Changed LoLEngine::setPaletteBrightness to take an Palette object.
........
r41944 | lordhoto | 2009-06-30 02:06:31 +1000 (Tue, 30 Jun 2009) | 1 line
Change LoLEngine::generateBrightnessPalette to take Palette objects as parameters.
........
r41945 | lordhoto | 2009-06-30 02:07:46 +1000 (Tue, 30 Jun 2009) | 1 line
Chang Palette parameter of LolEngine::setPaletteBrightness to be const.
........
r41946 | lordhoto | 2009-06-30 02:08:00 +1000 (Tue, 30 Jun 2009) | 1 line
Change raw palette read to Screen::loadPalette call.
........
r41947 | lordhoto | 2009-06-30 02:08:16 +1000 (Tue, 30 Jun 2009) | 1 line
Change Screen_LoL::loadSpecialColors to take an Palette object as parameter.
........
r41948 | lordhoto | 2009-06-30 02:08:28 +1000 (Tue, 30 Jun 2009) | 1 line
Change LoLEngine::generateFlashPalette to take Palette objects as parameters.
........
r41949 | lordhoto | 2009-06-30 02:08:39 +1000 (Tue, 30 Jun 2009) | 1 line
Cleanup KyraEngine_MR::updateCharPal.
........
r41950 | lordhoto | 2009-06-30 02:49:14 +1000 (Tue, 30 Jun 2009) | 1 line
Cleanup GUI_HoF::setupPalette.
........
r41951 | lordhoto | 2009-06-30 02:49:26 +1000 (Tue, 30 Jun 2009) | 1 line
Replaced some raw palette loads.
........
r41952 | lordhoto | 2009-06-30 02:49:38 +1000 (Tue, 30 Jun 2009) | 1 line
Add a "fill" method to Palette.
........
r41953 | lordhoto | 2009-06-30 02:49:53 +1000 (Tue, 30 Jun 2009) | 1 line
Adapted various code parts to use Palette::fill.
........
r41954 | lordhoto | 2009-06-30 03:05:49 +1000 (Tue, 30 Jun 2009) | 1 line
Removed some obsolete TODOs.
........
r41955 | lordhoto | 2009-06-30 03:06:00 +1000 (Tue, 30 Jun 2009) | 1 line
Update the screen animations while dropping items in Hand of Fate.
........
r41956 | lordhoto | 2009-06-30 03:06:17 +1000 (Tue, 30 Jun 2009) | 1 line
Removed more obsolete TODO messages.
........
r41957 | lordhoto | 2009-06-30 03:26:43 +1000 (Tue, 30 Jun 2009) | 1 line
Resolved some TODOs in Kyra3 code.
........
r41958 | lordhoto | 2009-06-30 03:26:56 +1000 (Tue, 30 Jun 2009) | 1 line
Removed obsolete TODOs in HoF code.
........
r41959 | lordhoto | 2009-06-30 04:00:18 +1000 (Tue, 30 Jun 2009) | 3 lines
- Get rid of code duplication for mouse cursor setup
- Fix mouse cursor colors in LoL PC98
(This commit might introduce regressions, since it changes the key color the mouse cursor uses)
........
r41960 | lordhoto | 2009-06-30 04:49:17 +1000 (Tue, 30 Jun 2009) | 1 line
Fix kyra2/kyra3 mouse cursor related regressions, introduced with r41959.
........
r41961 | lordhoto | 2009-06-30 04:49:28 +1000 (Tue, 30 Jun 2009) | 1 line
Fix palette regression caused by r41949.
........
r41962 | lordhoto | 2009-06-30 05:02:15 +1000 (Tue, 30 Jun 2009) | 1 line
Fix bug in drawShape, which caused invisibility in Kyra1 to be displayed incorrectly.
........
r41963 | lordhoto | 2009-06-30 06:16:59 +1000 (Tue, 30 Jun 2009) | 1 line
Fix LoL cursor in DOS version.
........
r41964 | lordhoto | 2009-06-30 06:17:10 +1000 (Tue, 30 Jun 2009) | 1 line
Fix bug in drawShape.
........
r41967 | lordhoto | 2009-06-30 09:14:35 +1000 (Tue, 30 Jun 2009) | 1 line
Fix invisible mouse cursor, when picking up items.
........
r41968 | lordhoto | 2009-06-30 09:23:29 +1000 (Tue, 30 Jun 2009) | 1 line
Add some more explanation to Graphics::CursorManager::showMouse and OSystem::showMouse.
........
r41975 | dreammaster | 2009-06-30 20:36:50 +1000 (Tue, 30 Jun 2009) | 1 line
Made the music/sfx volume settings actually affect the in-game music/sfx volume
........
r42007 | anotherguest | 2009-07-02 06:02:33 +1000 (Thu, 02 Jul 2009) | 1 line
Move action inits to engineInit and engineDone callbacks.
........
r42008 | anotherguest | 2009-07-02 06:11:44 +1000 (Thu, 02 Jul 2009) | 1 line
Use MIN with correct template parameter.
........
r42009 | fingolfin | 2009-07-02 06:51:04 +1000 (Thu, 02 Jul 2009) | 4 lines
- Added GCC_PRINTF attribute to several funcs where it makes sense
- change some constants from double to float, to avoid "loss of precision due to implicit conversion" warnings
- removed duplicate prototypes for some funcs
- fixed some "increases required alignment of target type" warnings
........
r42010 | fingolfin | 2009-07-02 06:51:34 +1000 (Thu, 02 Jul 2009) | 1 line
Fixed some more warnings observed on buildbot
........
r42011 | fingolfin | 2009-07-02 06:51:47 +1000 (Thu, 02 Jul 2009) | 1 line
Flag what looks like a bug in the CMS player code -- somebody should verify and fix this properly
........
r42012 | fingolfin | 2009-07-02 06:53:47 +1000 (Thu, 02 Jul 2009) | 1 line
oops
........
r42020 | drmccoy | 2009-07-02 22:15:04 +1000 (Thu, 02 Jul 2009) | 1 line
Added support for compressed sample files (patch #2815426 by m_kiewitz)
........
r42038 | fingolfin | 2009-07-03 07:16:36 +1000 (Fri, 03 Jul 2009) | 1 line
Enhanced the quicksearch box in the launcher to match words in the search string individually
........
r42039 | fingolfin | 2009-07-03 07:37:13 +1000 (Fri, 03 Jul 2009) | 1 line
fixed indention (and trigger a reconfigure in buildbot)
........
r42040 | fingolfin | 2009-07-03 08:05:42 +1000 (Fri, 03 Jul 2009) | 1 line
cleanup
........
r42041 | fingolfin | 2009-07-03 08:21:33 +1000 (Fri, 03 Jul 2009) | 1 line
Added -Wmissing-format-attribute to build system
........
r42043 | thebluegr | 2009-07-03 09:16:40 +1000 (Fri, 03 Jul 2009) | 1 line
Moved all the debug state variables in a separate struct and re-enabled several places where they're used
........
r42044 | thebluegr | 2009-07-03 09:58:05 +1000 (Fri, 03 Jul 2009) | 1 line
Moved some more debug state related variables in the DebugState struct
........
r42047 | dreammaster | 2009-07-03 16:19:20 +1000 (Fri, 03 Jul 2009) | 1 line
Bugfix for loading savegames where the active resource file database isn't completely filled
........
r42048 | dreammaster | 2009-07-03 16:21:04 +1000 (Fri, 03 Jul 2009) | 1 line
Bugfix for displaying text messages when an auto tracking (cut-scene) changes to a user wait
........
r42049 | thebluegr | 2009-07-03 17:06:48 +1000 (Fri, 03 Jul 2009) | 1 line
Applied patch #2815937 - "SCI: ReadString fix to repair LSL5 password". This fixes the problems with the LSL5 password for good
........
r42050 | thebluegr | 2009-07-03 19:01:51 +1000 (Fri, 03 Jul 2009) | 1 line
Simplified the kernel name loading code: Merged the default SCI0 and SCI1 kernel name tables in one table. vocab.999 is only used in SCI0 and SCI01 games if it exists as an override to the default kernel name table (which works with SCI0/SCI01 demos with no vocab.999, like KQ1 and xmas1998). Removed GF_SCI0_SCI1VOCAB.
........
r42054 | fingolfin | 2009-07-03 20:40:49 +1000 (Fri, 03 Jul 2009) | 1 line
Added more GCC_PRINTF attributes, and fixed resulting warnings in format strings
........
r42055 | fingolfin | 2009-07-03 20:41:03 +1000 (Fri, 03 Jul 2009) | 1 line
SCI: Fixed warning
........
r42056 | fingolfin | 2009-07-03 21:05:59 +1000 (Fri, 03 Jul 2009) | 1 line
If NDEBUG is #defined, then assert does nothing, leading to warnings about 'old_size' not being used -> fix that
........
r42060 | thebluegr | 2009-07-04 00:18:20 +1000 (Sat, 04 Jul 2009) | 1 line
Replaced all calls for manipulating the mouse cursor to be made to the CursorManager instead of directly to the graphics backend
........
r42062 | thebluegr | 2009-07-04 00:22:50 +1000 (Sat, 04 Jul 2009) | 2 lines
- Pushed debugstate into debug.h
- When an error occurs, manipulate the execution stack before error() opens the console inside getDebugger(), like FreeSCI did. Added another method for obtaining the SCI console for use by the engine itself.
........
r42079 | thebluegr | 2009-07-04 07:59:07 +1000 (Sat, 04 Jul 2009) | 1 line
Replaced script_error and CORE_ERROR with error()
........
r42081 | thebluegr | 2009-07-04 09:37:08 +1000 (Sat, 04 Jul 2009) | 1 line
SCI0 games using older graphics functions are automatically detected now, from the presence of the "TimesSin" and "SinMult" kernel functions. Removed the GF_SCI0_OLDGFXFUNCS game flag
........
svn-id: r42085
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/boxes.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/detection.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/detection.h | 5 | ||||
-rw-r--r-- | engines/scumm/detection_tables.h | 255 | ||||
-rw-r--r-- | engines/scumm/gfx.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/he/resource_he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/script_v71he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/module.mk | 1 | ||||
-rw-r--r-- | engines/scumm/object.cpp | 5 | ||||
-rw-r--r-- | engines/scumm/palette.cpp | 70 | ||||
-rw-r--r-- | engines/scumm/player_v2.h | 173 | ||||
-rw-r--r-- | engines/scumm/player_v2cms.cpp | 1855 | ||||
-rw-r--r-- | engines/scumm/resource.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 11 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 10 | ||||
-rw-r--r-- | engines/scumm/smush/imuse_channel.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 17 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 5 |
18 files changed, 2243 insertions, 194 deletions
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index f1429d4261..472e04b5f3 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -369,7 +369,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) { */ // Search for the bend on the left side - m = (resptr[199] - resptr[0]) / 199.0; + m = (resptr[199] - resptr[0]) / 199.0f; for (lowerIdx = 0; lowerIdx < 199 && (resptr[lowerIdx] == 1 || resptr[lowerIdx] == 255); lowerIdx++) { oldM = m; m = (resptr[199] - resptr[lowerIdx+1]) / (float)(199 - (lowerIdx+1)); @@ -383,7 +383,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) { } // Search for the bend on the right side - m = (resptr[199] - resptr[0]) / 199.0; + m = (resptr[199] - resptr[0]) / 199.0f; for (upperIdx = 199; upperIdx > 1 && (resptr[upperIdx] == 1 || resptr[upperIdx] == 255); upperIdx--) { oldM = m; m = (resptr[upperIdx-1] - resptr[0]) / (float)(upperIdx-1); diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 4e4175876b..cf88ded3b8 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -765,6 +765,8 @@ GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const { dg["preferredtarget"] = res; + dg.setGUIOptions(x->game.guioptions); + detectedGames.push_back(dg); } diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h index 26f6be8fec..9b4ff929e2 100644 --- a/engines/scumm/detection.h +++ b/engines/scumm/detection.h @@ -88,6 +88,11 @@ struct GameSettings { * specific platform. */ Common::Platform platform; + + /** + * Game GUI options. Used to enable/disable certain GUI widgets + */ + uint32 guioptions; }; enum FilenameGenMethod { diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index abdc5b4e91..2ea593c571 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -171,6 +171,10 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { {NULL, NULL, UNK} }; +using Common::GUIO_NONE; +using Common::GUIO_NOSPEECH; +using Common::GUIO_NOMIDI; + // The following table contains information about variants of our various // games. We index into it with help of md5table (from scumm-md5.h), to find // the correct GameSettings for a given game variant. @@ -191,194 +195,197 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { // only a single unique variant. This is used to help the detector quickly // decide whether it has to worry about distinguishing multiple variants or not. static const GameSettings gameVariantsTable[] = { - {"maniac", "Apple II", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformApple2GS}, - {"maniac", "C64", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformC64}, - {"maniac", "V1", "v1", GID_MANIAC, 1, 0, MDT_PCSPK, 0, Common::kPlatformPC}, - {"maniac", "V1 Demo", "v1", GID_MANIAC, 1, 0, MDT_PCSPK, GF_DEMO, Common::kPlatformPC}, - {"maniac", "NES", 0, GID_MANIAC, 1, 0, MDT_NONE, 0, Common::kPlatformNES}, - {"maniac", "V2", "v2", GID_MANIAC, 2, 0, MDT_PCSPK, 0, UNK}, - {"maniac", "V2 Demo", "v2", GID_MANIAC, 2, 0, MDT_PCSPK, GF_DEMO, Common::kPlatformPC}, - - {"zak", "V1", "v1", GID_ZAK, 1, 0, MDT_PCSPK, 0, UNK}, - {"zak", "V2", "v2", GID_ZAK, 2, 0, MDT_PCSPK, 0, UNK}, - {"zak", "FM-TOWNS", 0, GID_ZAK, 3, 0, MDT_TOWNS, GF_OLD256 | GF_AUDIOTRACKS, Common::kPlatformFMTowns}, - - {"indy3", "EGA", "ega", GID_INDY3, 3, 0, MDT_PCSPK | MDT_ADLIB, 0, UNK}, - {"indy3", "No Adlib", "ega", GID_INDY3, 3, 0, MDT_PCSPK, 0, UNK}, - {"indy3", "VGA", "vga", GID_INDY3, 3, 0, MDT_PCSPK | MDT_ADLIB, GF_OLD256 | GF_FEW_LOCALS, Common::kPlatformPC}, - {"indy3", "FM-TOWNS", 0, GID_INDY3, 3, 0, MDT_TOWNS, GF_OLD256 | GF_FEW_LOCALS | GF_AUDIOTRACKS, Common::kPlatformFMTowns}, - - {"loom", "EGA", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI, 0, UNK}, - {"loom", "No Adlib", "ega", GID_LOOM, 3, 0, MDT_PCSPK, 0, UNK}, - {"loom", "PC-Engine", 0, GID_LOOM, 3, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPCEngine}, - {"loom", "FM-TOWNS", 0, GID_LOOM, 3, 0, MDT_TOWNS, GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns}, - {"loom", "VGA", "vga", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPC}, - - {"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC}, - - {"monkey", "VGA", "vga", GID_MONKEY_VGA, 4, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI, 0, UNK}, - {"monkey", "EGA", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI, GF_16COLOR, Common::kPlatformPC}, - {"monkey", "No Adlib", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK, GF_16COLOR, Common::kPlatformAtariST}, - {"monkey", "Demo", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC}, - {"monkey", "CD", 0, GID_MONKEY, 5, 0, MDT_ADLIB, GF_AUDIOTRACKS, UNK}, - {"monkey", "FM-TOWNS", 0, GID_MONKEY, 5, 0, MDT_ADLIB, GF_AUDIOTRACKS, Common::kPlatformFMTowns}, - {"monkey", "SEGA", 0, GID_MONKEY, 5, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformSegaCD}, - - {"monkey2", 0, 0, GID_MONKEY2, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK}, - - {"atlantis", 0, 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK}, - - {"tentacle", 0, 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - - {"samnmax", 0, 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, + {"maniac", "Apple II", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformApple2GS, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "C64", 0, GID_MANIAC, 0, 0, MDT_PCSPK, 0, Common::kPlatformC64, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "V1", "v1", GID_MANIAC, 1, 0, MDT_PCSPK, 0, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "V1 Demo", "v1", GID_MANIAC, 1, 0, MDT_PCSPK, GF_DEMO, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "NES", 0, GID_MANIAC, 1, 0, MDT_NONE, 0, Common::kPlatformNES, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "V2", "v2", GID_MANIAC, 2, 0, MDT_PCSPK, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"maniac", "V2 Demo", "v2", GID_MANIAC, 2, 0, MDT_PCSPK, GF_DEMO, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"zak", "V1", "v1", GID_ZAK, 1, 0, MDT_PCSPK, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"zak", "V2", "v2", GID_ZAK, 2, 0, MDT_PCSPK, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"zak", "FM-TOWNS", 0, GID_ZAK, 3, 0, MDT_TOWNS, GF_OLD256 | GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"indy3", "EGA", "ega", GID_INDY3, 3, 0, MDT_PCSPK | MDT_CMS | MDT_ADLIB, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"indy3", "No Adlib", "ega", GID_INDY3, 3, 0, MDT_PCSPK, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"indy3", "VGA", "vga", GID_INDY3, 3, 0, MDT_PCSPK | MDT_ADLIB, GF_OLD256 | GF_FEW_LOCALS, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"indy3", "FM-TOWNS", 0, GID_INDY3, 3, 0, MDT_TOWNS, GF_OLD256 | GF_FEW_LOCALS | GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"loom", "EGA", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_CMS | MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, + {"loom", "No Adlib", "ega", GID_LOOM, 3, 0, MDT_PCSPK | MDT_CMS, 0, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"loom", "PC-Engine", 0, GID_LOOM, 3, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPCEngine, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"loom", "FM-TOWNS", 0, GID_LOOM, 3, 0, MDT_TOWNS, GF_AUDIOTRACKS | GF_OLD256, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"loom", "VGA", "vga", GID_LOOM, 4, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"pass", 0, 0, GID_PASS, 4, 0, MDT_PCSPK | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"monkey", "VGA", "vga", GID_MONKEY_VGA, 4, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, + {"monkey", "EGA", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_CMS | MDT_ADLIB | MDT_MIDI, GF_16COLOR, Common::kPlatformPC, GUIO_NOSPEECH}, + {"monkey", "No Adlib", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK, GF_16COLOR, Common::kPlatformAtariST, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"monkey", "Demo", "ega", GID_MONKEY_EGA, 4, 0, MDT_PCSPK | MDT_ADLIB, GF_16COLOR, Common::kPlatformPC, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"monkey", "CD", 0, GID_MONKEY, 5, 0, MDT_ADLIB, GF_AUDIOTRACKS, UNK, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"monkey", "FM-TOWNS", 0, GID_MONKEY, 5, 0, MDT_ADLIB, GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO_NOSPEECH | GUIO_NOMIDI}, + {"monkey", "SEGA", 0, GID_MONKEY, 5, 0, MDT_NONE, GF_AUDIOTRACKS, Common::kPlatformSegaCD, GUIO_NOSPEECH | GUIO_NOMIDI}, + + {"monkey2", 0, 0, GID_MONKEY2, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, + + {"atlantis", 0, 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NOSPEECH}, + {"atlantis", "CD" , 0, GID_INDY4, 5, 0, MDT_ADLIB | MDT_MIDI, 0, UNK, GUIO_NONE}, + + {"tentacle", 0, 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, + {"tentacle", "CD", 0, GID_TENTACLE, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + + {"samnmax", 0, 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NOSPEECH}, + {"samnmax", "CD", 0, GID_SAMNMAX, 6, 0, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, #ifdef ENABLE_SCUMM_7_8 - {"ft", 0, 0, GID_FT, 7, 0, MDT_NONE, 0, UNK}, + {"ft", 0, 0, GID_FT, 7, 0, MDT_NONE, 0, UNK, GUIO_NOMIDI}, - {"dig", 0, 0, GID_DIG, 7, 0, MDT_NONE, 0, UNK}, + {"dig", 0, 0, GID_DIG, 7, 0, MDT_NONE, 0, UNK, GUIO_NOMIDI}, - {"comi", 0, 0, GID_CMI, 8, 0, MDT_NONE, 0, Common::kPlatformWindows}, + {"comi", 0, 0, GID_CMI, 8, 0, MDT_NONE, 0, Common::kPlatformWindows, GUIO_NOMIDI}, #endif // Humongous Entertainment Scumm Version 6 - {"activity", "", 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"funpack", 0, 0, GID_FUNPACK, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"fbpack", 0, 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, + {"activity", "", 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"funpack", 0, 0, GID_FUNPACK, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"fbpack", 0, 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, - {"brstorm", 0, 0, GID_FBEAR, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"fbear", "HE 61", 0, GID_FBEAR, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"fbear", "HE 70", 0, GID_FBEAR, 6, 70, MDT_NONE, GF_USE_KEY, Common::kPlatformWindows}, + {"brstorm", 0, 0, GID_FBEAR, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"fbear", "HE 61", 0, GID_FBEAR, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"fbear", "HE 70", 0, GID_FBEAR, 6, 70, MDT_NONE, GF_USE_KEY, Common::kPlatformWindows, GUIO_NOMIDI}, - {"puttmoon", "", 0, GID_PUTTMOON, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"puttmoon", "HE 70", 0, GID_PUTTMOON, 6, 70, MDT_NONE, GF_USE_KEY, Common::kPlatformWindows}, + {"puttmoon", "", 0, GID_PUTTMOON, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"puttmoon", "HE 70", 0, GID_PUTTMOON, 6, 70, MDT_NONE, GF_USE_KEY, Common::kPlatformWindows, GUIO_NOMIDI}, - {"puttputt", "HE 60", 0, GID_HEGAME, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"puttputt", "HE 61", 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, - {"puttputt", "Demo", 0, GID_PUTTDEMO, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK}, + {"puttputt", "HE 60", 0, GID_HEGAME, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"puttputt", "HE 61", 0, GID_HEGAME, 6, 61, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, + {"puttputt", "Demo", 0, GID_PUTTDEMO, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK, GUIO_NONE}, // The following are meant to be generic HE game variants and as such do // not specify a game ID. Make sure that these are last in the table, else // they'll override more specific entries that follow later on. - {"", "HE 70", 0, GID_HEGAME, 6, 70, MDT_NONE, GF_USE_KEY, UNK}, + {"", "HE 70", 0, GID_HEGAME, 6, 70, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, #ifdef ENABLE_HE // HE CUP demos - {"", "HE CUP", 0, GID_HECUP, 6, 200, MDT_NONE, 0, UNK}, + {"", "HE CUP", 0, GID_HECUP, 6, 200, MDT_NONE, 0, UNK, GUIO_NOMIDI | GUIO_NOSPEECH}, // Humongous Entertainment Scumm Version 7.1 // The first version to use 640x480 resolution and wizImages // There are also 7.1 versions of freddemo, airdemo and farmdemo - {"catalog", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK}, - {"freddi", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK}, + {"catalog", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"freddi", "", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 7.2 - {"airport", "", 0, GID_HEGAME, 6, 72, MDT_NONE, GF_USE_KEY, UNK}, + {"airport", "", 0, GID_HEGAME, 6, 72, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Changed o_getResourceSize to cover all resource types - {"farm", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK}, - {"jungle", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK}, - {"puttzoo", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK}, + {"farm", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"jungle", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"puttzoo", "", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 8.0 ? Scummsrc.80 - {"freddi2", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, - {"pajama", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, + {"freddi2", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"pajama", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, - {"balloon", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, - {"dog", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, - {"maze", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, + {"balloon", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"dog", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"maze", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, - {"water", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, + {"water", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // condMaskCode value changed in setUserCondition & setTalkCondition - {"putttime", "", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK}, - {"socks", "", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK}, + {"putttime", "", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"socks", "", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 9.0 ? Scummsys.90 - {"baseball", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, - {"thinkerk", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, - {"thinker1", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, - {"spyfox", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, + {"baseball", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"thinkerk", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"thinker1", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"spyfox", "", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, - {"freddi3", "", 0, GID_FREDDI3, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, - {"freddi3", "HE 99", 0, GID_FREDDI3, 6, 99, MDT_NONE, GF_USE_KEY, UNK}, + {"freddi3", "", 0, GID_FREDDI3, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"freddi3", "HE 99", 0, GID_FREDDI3, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 9.5 ? Scummsys.95 - {"pajama2", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK}, - {"chase", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK}, + {"pajama2", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"chase", "", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 9.8 ? Scummsys.98 // these and later games can easily be identified by the .(a) file instead of a .he1 // and INIB chunk in the .he0 - {"lost", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, + {"lost", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, - {"puttrace", "HE 98", 0, GID_PUTTRACE, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, - {"puttrace", "HE 98.5", 0, GID_PUTTRACE, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK}, - {"puttrace", "HE 99", 0, GID_PUTTRACE, 6, 99, MDT_NONE, GF_USE_KEY, UNK}, + {"puttrace", "HE 98", 0, GID_PUTTRACE, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"puttrace", "HE 98.5", 0, GID_PUTTRACE, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK, GUIO_NOMIDI}, + {"puttrace", "HE 99", 0, GID_PUTTRACE, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, - {"bluesabctime", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, - {"BluesBirthday", 0, 0, GID_BIRTHDAY, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, - {"soccer", "", 0, GID_SOCCER, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, + {"bluesabctime", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"BluesBirthday", 0, 0, GID_BIRTHDAY, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"soccer", "", 0, GID_SOCCER, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, // Global scripts increased to 2048 - {"blues123time", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK}, - {"freddi4", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK}, - {"freddi4", "unenc", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_HE_985, UNK}, + {"blues123time", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK, GUIO_NOMIDI}, + {"freddi4", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK, GUIO_NOMIDI}, + {"freddi4", "unenc", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_HE_985, UNK, GUIO_NOMIDI}, // Humongous Entertainment Scumm Version 9.9 ? Scummsys.99 - {"football", 0, 0, GID_FOOTBALL, 6, 99, MDT_NONE, GF_USE_KEY, UNK}, - {"pajama3", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, - {"puttcircus", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, - {"spyfox2", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, - {"mustard", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, + {"football", 0, 0, GID_FOOTBALL, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"pajama3", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, + {"puttcircus", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, + {"spyfox2", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, + {"mustard", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, // Added the use of fonts - {"FreddisFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, - {"SamsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, - {"PuttsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK}, + {"FreddisFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, + {"SamsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, + {"PuttsFunShop", 0, 0, GID_FUNSHOP, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED, UNK, GUIO_NOMIDI}, // Added 16bit color - {"baseball2001", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK}, - {"SoccerMLS", 0, 0, GID_SOCCER, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, - {"spyozon", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, + {"baseball2001", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"SoccerMLS", 0, 0, GID_SOCCER, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"spyozon", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, - {"freddicove", "", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, - {"freddicove", "unenc", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, - {"freddicove", "HE 100", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, + {"freddicove", "", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"freddicove", "unenc", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"freddicove", "HE 100", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, // Restructured the Scumm engine - {"pjgames", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, + {"pjgames", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, // Uses smacker in external files, for testing only - {"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, - {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK}, - {"BluesTreasureHunt", 0, 0, GID_TREASUREHUNT, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_USE_KEY, UNK}, + {"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"BluesTreasureHunt", 0, 0, GID_TREASUREHUNT, 6, 99, MDT_NONE, GF_HE_LOCALIZED | GF_USE_KEY, UNK, GUIO_NOMIDI}, // Uses bink in external files for logos - {"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK}, - {"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK}, - {"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK}, - {"Soccer2004", 0, 0, GID_SOCCER, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK}, + {"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"Soccer2004", 0, 0, GID_SOCCER, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, // U32 code required, for testing only - {"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK}, - {"moonbase", "Demo", 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR | GF_DEMO, UNK}, + {"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOMIDI}, + {"moonbase", "Demo", 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR | GF_DEMO, UNK, GUIO_NOMIDI}, // The following are meant to be generic HE game variants and as such do // not specify a game ID. Make sure that these are last in the table, else // they'll override more specific entries that follow later on. - {"", "HE 71", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 72", 0, GID_HEGAME, 6, 72, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 73", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 80", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 85", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 90", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 95", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 98", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 98.5", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK}, - {"", "HE 99", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY, UNK}, - {"", "HE 100", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY, UNK}, + {"", "HE 71", 0, GID_HEGAME, 6, 71, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 72", 0, GID_HEGAME, 6, 72, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 73", 0, GID_HEGAME, 6, 73, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 80", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 85", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 90", 0, GID_HEGAME, 6, 90, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 95", 0, GID_HEGAME, 6, 95, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 98", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 98.5", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK, GUIO_NOMIDI}, + {"", "HE 99", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, + {"", "HE 100", 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY, UNK, GUIO_NOMIDI}, #endif - {NULL, NULL, 0, 0, 0, MDT_NONE, 0, 0, UNK} + {NULL, NULL, 0, 0, 0, MDT_NONE, 0, 0, UNK, 0} }; using Common::UNK_LANG; diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index d47301c974..4574ece6d0 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -577,13 +577,13 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i if (width <= 0 || height <= 0) return; - const byte *src = vs->getPixels(x, top); + const void *src = vs->getPixels(x, top); int m = _textSurfaceMultiplier; int vsPitch; int pitch = vs->pitch; if (_useCJKMode && _textSurfaceMultiplier == 2) { - scale2x(_fmtownsBuf, _screenWidth * m, src, vs->pitch, width, height); + scale2x(_fmtownsBuf, _screenWidth * m, (const byte *)src, vs->pitch, width, height); src = _fmtownsBuf; vsPitch = _screenWidth * m - width * m; @@ -602,7 +602,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i // Compute pointer to the text surface assert(_compositeBuf); - const byte *text = (byte *)_textSurface.getBasePtr(x * m, y * m); + const void *text = _textSurface.getBasePtr(x * m, y * m); // The values x, width, etc. are all multiples of 8 at this point, // so loop unrolloing might be a good idea... @@ -693,7 +693,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i } // Finally blit the whole thing to the screen - _system->copyRectToScreen(src, pitch, x, y, width, height); + _system->copyRectToScreen((const byte *)src, pitch, x, y, width, height); } // CGA diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp index 1b5b467512..022dbc0eb3 100644 --- a/engines/scumm/he/resource_he.cpp +++ b/engines/scumm/he/resource_he.cpp @@ -913,7 +913,7 @@ int Win32ResExtractor::convertIcons(byte *data, int datasize, byte **cursor, int if (entries[c].dib_size != bitmap.size + image_size + mask_size + palette_count * sizeof(Win32RGBQuad)) debugC(DEBUG_RESOURCE, "incorrect total size of bitmap (%d specified; %d real)", entries[c].dib_size, - bitmap.size + image_size + mask_size + palette_count * sizeof(Win32RGBQuad) + (int)(bitmap.size + image_size + mask_size + palette_count * sizeof(Win32RGBQuad)) ); image_data = (byte *)malloc(image_size); diff --git a/engines/scumm/he/script_v71he.cpp b/engines/scumm/he/script_v71he.cpp index 316d51b12d..c832d64316 100644 --- a/engines/scumm/he/script_v71he.cpp +++ b/engines/scumm/he/script_v71he.cpp @@ -59,7 +59,7 @@ byte *ScummEngine_v71he::heFindResourceData(uint32 tag, byte *ptr) { byte *ScummEngine_v71he::heFindResource(uint32 tag, byte *searchin) { uint32 curpos, totalsize, size; - debugC(DEBUG_RESOURCE, "heFindResource(%s, %lx)", tag2str(tag), searchin); + debugC(DEBUG_RESOURCE, "heFindResource(%s, %p)", tag2str(tag), (const void *)searchin); assert(searchin); searchin += 4; diff --git a/engines/scumm/module.mk b/engines/scumm/module.mk index 240d3c290d..58d8db91fc 100644 --- a/engines/scumm/module.mk +++ b/engines/scumm/module.mk @@ -38,6 +38,7 @@ MODULE_OBJS := \ player_v1.o \ player_v2.o \ player_v2a.o \ + player_v2cms.o \ player_v3a.o \ resource_v2.o \ resource_v3.o \ diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index 372fcd9e45..f29be071e0 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -1816,9 +1816,8 @@ void ScummEngine::loadFlObject(uint object, uint room) { assert(flob); // Copy object code + object image to floating object - ((uint32 *)flob)[0] = MKID_BE('FLOB'); - ((uint32 *)flob)[1] = TO_BE_32(flob_size); - + WRITE_UINT32(flob, MKID_BE('FLOB')); + WRITE_BE_UINT32(flob + 4, flob_size); memcpy(flob + 8, foir.obcd, obcd_size); memcpy(flob + 8 + obcd_size, foir.obim, obim_size); diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index c6ec85cd88..f59b59b40f 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -467,13 +467,9 @@ void ScummEngine::moveMemInPalRes(int start, int end, byte direction) { } void ScummEngine::palManipulateInit(int resID, int start, int end, int time) { - byte *pal, *target, *between; - byte *string1, *string2, *string3; - int i; - - string1 = getStringAddress(resID); - string2 = getStringAddress(resID + 1); - string3 = getStringAddress(resID + 2); + byte *string1 = getStringAddress(resID); + byte *string2 = getStringAddress(resID + 1); + byte *string3 = getStringAddress(resID + 2); if (!string1 || !string2 || !string3) { error("palManipulateInit(%d,%d,%d,%d): Cannot obtain string resources %d, %d and %d", resID, start, end, time, resID, resID + 1, resID + 2); @@ -493,29 +489,24 @@ void ScummEngine::palManipulateInit(int resID, int start, int end, int time) { if (!_palManipIntermediatePal) _palManipIntermediatePal = (byte *)calloc(0x600, 1); - pal = _currentPalette + start * 3; - target = _palManipPalette + start * 3; - between = _palManipIntermediatePal + start * 6; + byte *pal = _currentPalette + start * 3; + byte *target = _palManipPalette + start * 3; + uint16 *between = (uint16 *)(_palManipIntermediatePal + start * 6); - for (i = start; i < end; ++i) { + for (int i = start; i < end; ++i) { *target++ = *string1++; *target++ = *string2++; *target++ = *string3++; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; + *between++ = ((uint16) *pal++) << 8; + *between++ = ((uint16) *pal++) << 8; + *between++ = ((uint16) *pal++) << 8; } _palManipCounter = time; } void ScummEngine_v6::palManipulateInit(int resID, int start, int end, int time) { - byte *pal, *target, *between; const byte *new_pal; - int i; new_pal = getPalettePtr(resID, _roomResource); @@ -530,20 +521,17 @@ void ScummEngine_v6::palManipulateInit(int resID, int start, int end, int time) if (!_palManipIntermediatePal) _palManipIntermediatePal = (byte *)calloc(0x600, 1); - pal = _currentPalette + start * 3; - target = _palManipPalette + start * 3; - between = _palManipIntermediatePal + start * 6; + byte *pal = _currentPalette + start * 3; + byte *target = _palManipPalette + start * 3; + uint16 *between = (uint16 *)(_palManipIntermediatePal + start * 6); - for (i = start; i < end; ++i) { + for (int i = start; i < end; ++i) { *target++ = *new_pal++; *target++ = *new_pal++; *target++ = *new_pal++; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; - *(uint16 *)between = ((uint16) *pal++) << 8; - between += 2; + *between++ = ((uint16) *pal++) << 8; + *between++ = ((uint16) *pal++) << 8; + *between++ = ((uint16) *pal++) << 8; } _palManipCounter = time; @@ -551,26 +539,24 @@ void ScummEngine_v6::palManipulateInit(int resID, int start, int end, int time) void ScummEngine::palManipulate() { - byte *target, *pal, *between; - int i, j; - if (!_palManipCounter || !_palManipPalette || !_palManipIntermediatePal) return; - target = _palManipPalette + _palManipStart * 3; - pal = _currentPalette + _palManipStart * 3; - between = _palManipIntermediatePal + _palManipStart * 6; + byte *target = _palManipPalette + _palManipStart * 3; + byte *pal = _currentPalette + _palManipStart * 3; + uint16 *between = (uint16 *)(_palManipIntermediatePal + _palManipStart * 6); - for (i = _palManipStart; i < _palManipEnd; ++i) { - j = (*((uint16 *)between) += ((*target++ << 8) - *((uint16 *)between)) / _palManipCounter); + for (int i = _palManipStart; i < _palManipEnd; ++i) { + int j; + j = (*between += ((*target++ << 8) - *between) / _palManipCounter); *pal++ = j >> 8; - between += 2; - j = (*((uint16 *)between) += ((*target++ << 8) - *((uint16 *)between)) / _palManipCounter); + between++; + j = (*between += ((*target++ << 8) - *between) / _palManipCounter); *pal++ = j >> 8; - between += 2; - j = (*((uint16 *)between) += ((*target++ << 8) - *((uint16 *)between)) / _palManipCounter); + between++; + j = (*between += ((*target++ << 8) - *between) / _palManipCounter); *pal++ = j >> 8; - between += 2; + between++; } setDirtyColors(_palManipStart, _palManipEnd); _palManipCounter--; diff --git a/engines/scumm/player_v2.h b/engines/scumm/player_v2.h index cd88d57602..f0e14cdde3 100644 --- a/engines/scumm/player_v2.h +++ b/engines/scumm/player_v2.h @@ -158,6 +158,179 @@ private: void next_freqs(ChannelInfo *channel); }; +/** + * Scumm V2 CMS/Gameblaster MIDI driver. + */ +class Player_V2CMS : public Audio::AudioStream, public MusicEngine { +public: + Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer); + virtual ~Player_V2CMS(); + + virtual void setMusicVolume(int vol); + virtual void startSound(int sound); + virtual void stopSound(int sound); + virtual void stopAllSounds(); + virtual int getMusicTimer() const; + virtual int getSoundStatus(int sound) const; + + // AudioStream API + int readBuffer(int16 *buffer, const int numSamples); + bool isStereo() const { return true; } + bool endOfData() const { return false; } + int getRate() const { return _sample_rate; } + +protected: + +#include "common/pack-start.h" // START STRUCT PACKING + struct Voice { + byte attack; + byte decay; + byte sustain; + byte release; + byte octadd; + int16 vibrato; + int16 vibrato2; + int16 noise; + } PACKED_STRUCT; + + struct Voice2 { + byte *amplitudeOutput; + byte *freqOutput; + byte *octaveOutput; + + uint8 channel; + int8 sustainLevel; + int8 attackRate; + uint8 maxAmpl; + int8 decayRate; + int8 sustainRate; + int8 releaseRate; + int8 releaseTime; + int8 vibratoRate; + int8 vibratoDepth; + + int8 curVibratoRate; + int8 curVibratoUnk; + + int8 unkVibratoRate; + int8 unkVibratoDepth; + + int8 unkRate; + int8 unkCount; + + int nextProcessState; + int8 curVolume; + int8 curOctave; + int8 curFreq; + + int8 octaveAdd; + + int8 playingNote; + Voice2 *nextVoice; + + byte chanNumber; + } PACKED_STRUCT; + + struct MusicChip { + byte ampl[4]; + byte freq[4]; + byte octave[2]; + } PACKED_STRUCT; +#include "common/pack-end.h" // END STRUCT PACKING + + Voice _cmsVoicesBase[16]; + Voice2 _cmsVoices[8]; + MusicChip _cmsChips[2]; + + char _tempo; + char _tempoSum; + byte _looping; + byte _octaveMask; + int16 _midiDelay; + Voice2 *_midiChannel[16]; + byte _midiChannelUse[16]; + byte *_midiData; + byte *_midiSongBegin; + + int _loadedMidiSong; + + byte _lastMidiCommand; + uint _outputTableReady; + byte _clkFrequenz; + byte _restart; + byte _curSno; + + void loadMidiData(byte *data, int sound); + void play(); + + void processChannel(Voice2 *channel); + void processRelease(Voice2 *channel); + void processAttack(Voice2 *channel); + void processDecay(Voice2 *channel); + void processSustain(Voice2 *channel); + void processVibrato(Voice2 *channel); + + void playMusicChips(const MusicChip *table); + void playNote(byte *&data); + void clearNote(byte *&data); + void offAllChannels(); + void playVoice(); + void processMidiData(uint ticks); + + Voice2 *getFreeVoice(); + Voice2 *getPlayVoice(byte param); + + // from Player_V2 +protected: + bool _isV3Game; + Audio::Mixer *_mixer; + Audio::SoundHandle _soundHandle; + ScummEngine *_vm; + + int _header_len; + + uint32 _sample_rate; + uint32 _next_tick; + uint32 _tick_len; + + int _timer_count[4]; + int _timer_output; + + int _current_nr; + byte *_current_data; + int _next_nr; + byte *_next_data; + byte *_retaddr; + +private: + union ChannelInfo { + channel_data d; + uint16 array[sizeof(channel_data)/2]; + }; + + int _music_timer; + int _music_timer_ctr; + int _ticks_per_music_timer; + + Common::Mutex _mutex; + ChannelInfo _channels[5]; + +protected: + void mutex_up(); + void mutex_down(); + + virtual void nextTick(); + virtual void clear_channel(int i); + virtual void chainSound(int nr, byte *data); + virtual void chainNextSound(); + +private: + void do_mix(int16 *buf, uint len); + + void execute_cmd(ChannelInfo *channel); + void next_freqs(ChannelInfo *channel); +}; + } // End of namespace Scumm #endif diff --git a/engines/scumm/player_v2cms.cpp b/engines/scumm/player_v2cms.cpp new file mode 100644 index 0000000000..d628293d7d --- /dev/null +++ b/engines/scumm/player_v2cms.cpp @@ -0,0 +1,1855 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "engines/engine.h" +#include "scumm/player_v2.h" +#include "scumm/scumm.h" +#include "sound/mididrv.h" +#include "sound/mixer.h" + +namespace Scumm { +#define FREQ_HZ 236 // Don't change! + +#define FIXP_SHIFT 16 +#define MAX_OUTPUT 0x7fff + +#define NG_PRESET 0x0f35 /* noise generator preset */ +#define FB_WNOISE 0x12000 /* feedback for white noise */ +#define FB_PNOISE 0x08000 /* feedback for periodic noise */ + +// CMS/Gameblaster Emulation taken from DosBox + +#define LEFT 0x00 +#define RIGHT 0x01 +#define MAX_OUTPUT 0x7fff +#define MIN_OUTPUT -0x8000 +//#define CMS_BUFFER_SIZE 128 +#define CMS_RATE 22050 + +#define PROCESS_ATTACK 1 +#define PROCESS_RELEASE 2 +#define PROCESS_SUSTAIN 3 +#define PROCESS_DECAY 4 +#define PROCESS_VIBRATO 5 + +/* this structure defines a channel */ +struct saa1099_channel +{ + int frequency; /* frequency (0x00..0xff) */ + int freq_enable; /* frequency enable */ + int noise_enable; /* noise enable */ + int octave; /* octave (0x00..0x07) */ + int amplitude[2]; /* amplitude (0x00..0x0f) */ + int envelope[2]; /* envelope (0x00..0x0f or 0x10 == off) */ + + /* vars to simulate the square wave */ + double counter; + double freq; + int level; +}; + +/* this structure defines a noise channel */ +struct saa1099_noise +{ + /* vars to simulate the noise generator output */ + double counter; + double freq; + int level; /* noise polynomal shifter */ +}; + +/* this structure defines a SAA1099 chip */ +struct SAA1099 +{ + int stream; /* our stream */ + int noise_params[2]; /* noise generators parameters */ + int env_enable[2]; /* envelope generators enable */ + int env_reverse_right[2]; /* envelope reversed for right channel */ + int env_mode[2]; /* envelope generators mode */ + int env_bits[2]; /* non zero = 3 bits resolution */ + int env_clock[2]; /* envelope clock mode (non-zero external) */ + int env_step[2]; /* current envelope step */ + int all_ch_enable; /* all channels enable */ + int sync_state; /* sync all channels */ + int selected_reg; /* selected register */ + struct saa1099_channel channels[6]; /* channels */ + struct saa1099_noise noise[2]; /* noise generators */ +}; + +static byte envelope[8][64] = { + /* zero amplitude */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* maximum amplitude */ + {15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, + 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, + 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, + 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, }, + /* single decay */ + {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* repetitive decay */ + {15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + /* single triangular */ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* repetitive triangular */ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, + /* single attack */ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* repetitive attack */ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 } +}; + +static int amplitude_lookup[16] = { + 0*32767/16, 1*32767/16, 2*32767/16, 3*32767/16, + 4*32767/16, 5*32767/16, 6*32767/16, 7*32767/16, + 8*32767/16, 9*32767/16, 10*32767/16, 11*32767/16, + 12*32767/16, 13*32767/16, 14*32767/16, 15*32767/16 +}; + +class CMSEmulator { +public: + CMSEmulator(uint32 sampleRate) { + _sampleRate = sampleRate; + memset(_saa1099, 0, sizeof(SAA1099)*2); + } + + ~CMSEmulator() { } + + void portWrite(int port, int val); + void readBuffer(int16 *buffer, const int numSamples); +private: + uint32 _sampleRate; + + SAA1099 _saa1099[2]; + + void envelope(int chip, int ch); + void update(int chip, int16 *buffer, int length); + void portWriteIntern(int chip, int offset, int data); +}; + +void CMSEmulator::portWrite(int port, int val) { + switch (port) { + case 0x220: + portWriteIntern(0, 1, val); + break; + + case 0x221: + _saa1099[0].selected_reg = val & 0x1f; + if (_saa1099[0].selected_reg == 0x18 || _saa1099[0].selected_reg == 0x19) { + /* clock the envelope channels */ + if (_saa1099[0].env_clock[0]) envelope(0, 0); + if (_saa1099[0].env_clock[1]) envelope(0, 1); + } + break; + + case 0x222: + portWriteIntern(1, 1, val); + break; + + case 0x223: + _saa1099[1].selected_reg = val & 0x1f; + if (_saa1099[1].selected_reg == 0x18 || _saa1099[1].selected_reg == 0x19) { + /* clock the envelope channels */ + if (_saa1099[1].env_clock[0]) envelope(1, 0); + if (_saa1099[1].env_clock[1]) envelope(1, 1); + } + break; + + default: + warning("CMSEmulator got port: 0x%X", port); + break; + } +} + +void CMSEmulator::readBuffer(int16 *buffer, const int numSamples) { + update(0, &buffer[0], numSamples); + update(1, &buffer[0], numSamples); +} + +void CMSEmulator::envelope(int chip, int ch) { + SAA1099 *saa = &_saa1099[chip]; + if (saa->env_enable[ch]) { + int step, mode, mask; + mode = saa->env_mode[ch]; + /* step from 0..63 and then loop in steps 32..63 */ + step = saa->env_step[ch] = ((saa->env_step[ch] + 1) & 0x3f) | (saa->env_step[ch] & 0x20); + + mask = 15; + if (saa->env_bits[ch]) + mask &= ~1; /* 3 bit resolution, mask LSB */ + + saa->channels[ch*3+0].envelope[ LEFT] = + saa->channels[ch*3+1].envelope[ LEFT] = + saa->channels[ch*3+2].envelope[ LEFT] = Scumm::envelope[mode][step] & mask; + if (saa->env_reverse_right[ch] & 0x01) { + saa->channels[ch*3+0].envelope[RIGHT] = + saa->channels[ch*3+1].envelope[RIGHT] = + saa->channels[ch*3+2].envelope[RIGHT] = (15 - Scumm::envelope[mode][step]) & mask; + } else { + saa->channels[ch*3+0].envelope[RIGHT] = + saa->channels[ch*3+1].envelope[RIGHT] = + saa->channels[ch*3+2].envelope[RIGHT] = Scumm::envelope[mode][step] & mask; + } + } else { + /* envelope mode off, set all envelope factors to 16 */ + saa->channels[ch*3+0].envelope[ LEFT] = + saa->channels[ch*3+1].envelope[ LEFT] = + saa->channels[ch*3+2].envelope[ LEFT] = + saa->channels[ch*3+0].envelope[RIGHT] = + saa->channels[ch*3+1].envelope[RIGHT] = + saa->channels[ch*3+2].envelope[RIGHT] = 16; + } +} + +void CMSEmulator::update(int chip, int16 *buffer, int length) { + struct SAA1099 *saa = &_saa1099[chip]; + int j, ch; + + /* if the channels are disabled we're done */ + if (!saa->all_ch_enable) { + /* init output data */ + if (chip == 0) { + memset(buffer, 0, sizeof(int16)*length*2); + } + return; + } + + if (chip == 0) { + memset(buffer, 0, sizeof(int16)*length*2); + } + + for (ch = 0; ch < 2; ch++) { + switch (saa->noise_params[ch]) { + case 0: saa->noise[ch].freq = 31250.0 * 2; break; + case 1: saa->noise[ch].freq = 15625.0 * 2; break; + case 2: saa->noise[ch].freq = 7812.5 * 2; break; + case 3: saa->noise[ch].freq = saa->channels[ch * 3].freq; break; + } + } + + /* fill all data needed */ + for (j = 0; j < length; ++j) { + int output_l = 0, output_r = 0; + + /* for each channel */ + for (ch = 0; ch < 6; ch++) { + if (saa->channels[ch].freq == 0.0) + saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / + (511.0 - (double)saa->channels[ch].frequency); + + /* check the actual position in the square wave */ + saa->channels[ch].counter -= saa->channels[ch].freq; + while (saa->channels[ch].counter < 0) { + /* calculate new frequency now after the half wave is updated */ + saa->channels[ch].freq = (double)((2 * 15625) << saa->channels[ch].octave) / + (511.0 - (double)saa->channels[ch].frequency); + + saa->channels[ch].counter += _sampleRate; + saa->channels[ch].level ^= 1; + + /* eventually clock the envelope counters */ + if (ch == 1 && saa->env_clock[0] == 0) + envelope(chip, 0); + if (ch == 4 && saa->env_clock[1] == 0) + envelope(chip, 1); + } + + /* if the noise is enabled */ + if (saa->channels[ch].noise_enable) { + /* if the noise level is high (noise 0: chan 0-2, noise 1: chan 3-5) */ + if (saa->noise[ch/3].level & 1) { + /* subtract to avoid overflows, also use only half amplitude */ + output_l -= saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16 / 2; + output_r -= saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16 / 2; + } + } + + /* if the square wave is enabled */ + if (saa->channels[ch].freq_enable) { + /* if the channel level is high */ + if (saa->channels[ch].level & 1) { + output_l += saa->channels[ch].amplitude[ LEFT] * saa->channels[ch].envelope[ LEFT] / 16; + output_r += saa->channels[ch].amplitude[RIGHT] * saa->channels[ch].envelope[RIGHT] / 16; + } + } + } + + for (ch = 0; ch < 2; ch++) { + /* check the actual position in noise generator */ + saa->noise[ch].counter -= saa->noise[ch].freq; + while (saa->noise[ch].counter < 0) { + saa->noise[ch].counter += _sampleRate; + if( ((saa->noise[ch].level & 0x4000) == 0) == ((saa->noise[ch].level & 0x0040) == 0) ) + saa->noise[ch].level = (saa->noise[ch].level << 1) | 1; + else + saa->noise[ch].level <<= 1; + } + } + /* write sound data to the buffer */ + buffer[j*2] += output_l / 6; + buffer[j*2+1] += output_r / 6; + } +} + +void CMSEmulator::portWriteIntern(int chip, int offset, int data) { + SAA1099 *saa = &_saa1099[chip]; + int reg = saa->selected_reg; + int ch; + + switch (reg) { + /* channel i amplitude */ + case 0x00: + case 0x01: + case 0x02: + case 0x03: + case 0x04: + case 0x05: + ch = reg & 7; + saa->channels[ch].amplitude[LEFT] = amplitude_lookup[data & 0x0f]; + saa->channels[ch].amplitude[RIGHT] = amplitude_lookup[(data >> 4) & 0x0f]; + break; + + /* channel i frequency */ + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: + case 0x0c: + case 0x0d: + ch = reg & 7; + saa->channels[ch].frequency = data & 0xff; + break; + + /* channel i octave */ + case 0x10: + case 0x11: + case 0x12: + ch = (reg - 0x10) << 1; + saa->channels[ch + 0].octave = data & 0x07; + saa->channels[ch + 1].octave = (data >> 4) & 0x07; + break; + + /* channel i frequency enable */ + case 0x14: + saa->channels[0].freq_enable = data & 0x01; + saa->channels[1].freq_enable = data & 0x02; + saa->channels[2].freq_enable = data & 0x04; + saa->channels[3].freq_enable = data & 0x08; + saa->channels[4].freq_enable = data & 0x10; + saa->channels[5].freq_enable = data & 0x20; + break; + + /* channel i noise enable */ + case 0x15: + saa->channels[0].noise_enable = data & 0x01; + saa->channels[1].noise_enable = data & 0x02; + saa->channels[2].noise_enable = data & 0x04; + saa->channels[3].noise_enable = data & 0x08; + saa->channels[4].noise_enable = data & 0x10; + saa->channels[5].noise_enable = data & 0x20; + break; + + /* noise generators parameters */ + case 0x16: + saa->noise_params[0] = data & 0x03; + saa->noise_params[1] = (data >> 4) & 0x03; + break; + + /* envelope generators parameters */ + case 0x18: + case 0x19: + ch = reg - 0x18; + saa->env_reverse_right[ch] = data & 0x01; + saa->env_mode[ch] = (data >> 1) & 0x07; + saa->env_bits[ch] = data & 0x10; + saa->env_clock[ch] = data & 0x20; + saa->env_enable[ch] = data & 0x80; + /* reset the envelope */ + saa->env_step[ch] = 0; + break; + + /* channels enable & reset generators */ + case 0x1c: + saa->all_ch_enable = data & 0x01; + saa->sync_state = data & 0x02; + if (data & 0x02) { + int i; + /* Synch & Reset generators */ + for (i = 0; i < 6; i++) { + saa->channels[i].level = 0; + saa->channels[i].counter = 0.0; + } + } + break; + + default: /* Error! */ + error("CMS Unkown write to reg %x with %x",reg, data); + } +} + +#pragma mark - +#pragma mark - Player_V2CMS +#pragma mark - + +const uint8 note_lengths[] = { + 0, + 0, 0, 2, + 0, 3, 4, + 5, 6, 8, + 9, 12, 16, + 18, 24, 32, + 36, 48, 64, + 72, 96 +}; + +static const uint16 hull_offsets[] = { + 0, 12, 24, 36, 48, 60, + 72, 88, 104, 120, 136, 256, + 152, 164, 180 +}; + +static const int16 hulls[] = { + // hull 0 + 3, -1, 0, 0, 0, 0, 0, 0, + 0, -1, 0, 0, + // hull 1 (staccato) + 3, -1, 0, 32, 0, -1, 0, 0, + 0, -1, 0, 0, + // hull 2 (legato) + 3, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, + // hull 3 (staccatissimo) + 3, -1, 0, 2, 0, -1, 0, 0, + 0, -1, 0, 0, + // hull 4 + 3, -1, 0, 6, 0, -1, 0, 0, + 0, -1, 0, 0, + // hull 5 + 3, -1, 0, 16, 0, -1, 0, 0, + 0, -1, 0, 0, + // hull 6 + (int16) 60000, -1, -1000, 20, 0, 0, 0, 0, + (int16) 40000, -1, -5000, 5, 0, -1, 0, 0, + // hull 7 + (int16) 50000, -1, 0, 8, 30000, -1, 0, 0, + 28000, -1, -5000, 5, 0, -1, 0, 0, + // hull 8 + (int16) 60000, -1, -2000, 16, 0, 0, 0, 0, + 28000, -1, -6000, 5, 0, -1, 0, 0, + // hull 9 + (int16) 55000, -1, 0, 8, (int16) 35000, -1, 0, 0, + (int16) 40000, -1, -2000, 10, 0, -1, 0, 0, + // hull 10 + (int16) 60000, -1, 0, 4, -2000, 8, 0, 0, + (int16) 40000, -1, -6000, 5, 0, -1, 0, 0, + // hull 12 + 0, -1, 150, 340, -150, 340, 0, -1, + 0, -1, 0, 0, + // hull 13 == 164 + 20000, -1, 4000, 7, 1000, 15, 0, 0, + (int16) 35000, -1, -2000, 15, 0, -1, 0, 0, + + // hull 14 == 180 + (int16) 35000, -1, 500, 20, 0, 0, 0, 0, + (int16) 45000, -1, -500, 60, 0, -1, 0, 0, + + // hull misc = 196 + (int16) 44000, -1, -4400, 10, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 53000, -1, -5300, 10, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 63000, -1, -6300, 10, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 44000, -1, -1375, 32, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 53000, -1, -1656, 32, 0, -1, 0, 0, + 0, -1, 0, 0, + + // hull 11 == 256 + (int16) 63000, -1, -1968, 32, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 44000, -1, - 733, 60, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 53000, -1, - 883, 60, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 63000, -1, -1050, 60, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 44000, -1, - 488, 90, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 53000, -1, - 588, 90, 0, -1, 0, 0, + 0, -1, 0, 0, + + (int16) 63000, -1, - 700, 90, 0, -1, 0, 0, + 0, -1, 0, 0 +}; + +static const uint16 freqmod_lengths[] = { + 0x1000, 0x1000, 0x20, 0x2000, 0x1000 +}; + +static const uint16 freqmod_offsets[] = { + 0, 0x100, 0x200, 0x302, 0x202 +}; + +static const int8 freqmod_table[0x502] = { + 0, 3, 6, 9, 12, 15, 18, 21, + 24, 27, 30, 33, 36, 39, 42, 45, + 48, 51, 54, 57, 59, 62, 65, 67, + 70, 73, 75, 78, 80, 82, 85, 87, + 89, 91, 94, 96, 98, 100, 102, 103, + 105, 107, 108, 110, 112, 113, 114, 116, + 117, 118, 119, 120, 121, 122, 123, 123, + 124, 125, 125, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 125, 125, + 124, 123, 123, 122, 121, 120, 119, 118, + 117, 116, 114, 113, 112, 110, 108, 107, + 105, 103, 102, 100, 98, 96, 94, 91, + 89, 87, 85, 82, 80, 78, 75, 73, + 70, 67, 65, 62, 59, 57, 54, 51, + 48, 45, 42, 39, 36, 33, 30, 27, + 24, 21, 18, 15, 12, 9, 6, 3, + 0, -3, -6, -9, -12, -15, -18, -21, + -24, -27, -30, -33, -36, -39, -42, -45, + -48, -51, -54, -57, -59, -62, -65, -67, + -70, -73, -75, -78, -80, -82, -85, -87, + -89, -91, -94, -96, -98,-100,-102,-103, + -105,-107,-108,-110,-112,-113,-114,-116, + -117,-118,-119,-120,-121,-122,-123,-123, + -124,-125,-125,-126,-126,-126,-126,-126, + -126,-126,-126,-126,-126,-126,-125,-125, + -124,-123,-123,-122,-121,-120,-119,-118, + -117,-116,-114,-113,-112,-110,-108,-107, + -105,-103,-102,-100, -98, -96, -94, -91, + -89, -87, -85, -82, -80, -78, -75, -73, + -70, -67, -65, -62, -59, -57, -54, -51, + -48, -45, -42, -39, -36, -33, -30, -27, + -24, -21, -18, -15, -12, -9, -6, -3, + + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, + -128,-127,-126,-125,-124,-123,-122,-121, + -120,-119,-118,-117,-116,-115,-114,-113, + -112,-111,-110,-109,-108,-107,-106,-105, + -104,-103,-102,-101,-100, -99, -98, -97, + -96, -95, -94, -93, -92, -91, -90, -89, + -88, -87, -86, -85, -84, -83, -82, -81, + -80, -79, -78, -77, -76, -75, -74, -73, + -72, -71, -70, -69, -68, -67, -66, -65, + -64, -63, -62, -61, -60, -59, -58, -57, + -56, -55, -54, -53, -52, -51, -50, -49, + -48, -47, -46, -45, -44, -43, -42, -41, + -40, -39, -38, -37, -36, -35, -34, -33, + -32, -31, -30, -29, -28, -27, -26, -25, + -24, -23, -22, -21, -20, -19, -18, -17, + -16, -15, -14, -13, -12, -11, -10, -9, + -8, -7, -6, -5, -4, -3, -2, -1, + + -120, 120, + + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + -120,-120,-120,-120,-120,-120,-120,-120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, + + 41, 35, -66,-124, -31, 108, -42, -82, + 82,-112, 73, -15, -15, -69, -23, -21, + -77, -90, -37, 60,-121, 12, 62,-103, + 36, 94, 13, 28, 6, -73, 71, -34, + -77, 18, 77, -56, 67, -69,-117, -90, + 31, 3, 90, 125, 9, 56, 37, 31, + 93, -44, -53, -4,-106, -11, 69, 59, + 19, 13,-119, 10, 28, -37, -82, 50, + 32,-102, 80, -18, 64, 120, 54, -3, + 18, 73, 50, -10, -98, 125, 73, -36, + -83, 79, 20, -14, 68, 64, 102, -48, + 107, -60, 48, -73, 50, 59, -95, 34, + -10, 34,-111, -99, -31,-117, 31, -38, + -80, -54,-103, 2, -71, 114, -99, 73, + 44,-128, 126, -59,-103, -43, -23,-128, + -78, -22, -55, -52, 83, -65, 103, -42, + -65, 20, -42, 126, 45, -36,-114, 102, + -125, -17, 87, 73, 97, -1, 105,-113, + 97, -51, -47, 30, -99,-100, 22, 114, + 114, -26, 29, -16,-124, 79, 74, 119, + 2, -41, -24, 57, 44, 83, -53, -55, + 18, 30, 51, 116, -98, 12, -12, -43, + -44, -97, -44, -92, 89, 126, 53, -49, + 50, 34, -12, -52, -49, -45,-112, 45, + 72, -45,-113, 117, -26, -39, 29, 42, + -27, -64, -9, 43, 120,-127,-121, 68, + 14, 95, 80, 0, -44, 97,-115, -66, + 123, 5, 21, 7, 59, 51,-126, 31, + 24, 112,-110, -38, 100, 84, -50, -79, + -123, 62, 105, 21, -8, 70, 106, 4, + -106, 115, 14, -39, 22, 47, 103, 104, + -44, -9, 74, 74, -48, 87, 104, 118, + -6, 22, -69, 17, -83, -82, 36,-120, + 121, -2, 82, -37, 37, 67, -27, 60, + -12, 69, -45, -40, 40, -50, 11, -11, + -59, 96, 89, 61,-105, 39,-118, 89, + 118, 45, -48, -62, -55, -51, 104, -44, + 73, 106, 121, 37, 8, 97, 64, 20, + -79, 59, 106, -91, 17, 40, -63,-116, + -42, -87, 11,-121,-105,-116, 47, -15, + 21, 29,-102,-107, -63,-101, -31, -64, + 126, -23, -88,-102, -89,-122, -62, -75, + 84, -65,-102, -25, -39, 35, -47, 85, + -112, 56, 40, -47, -39, 108, -95, 102, + 94, 78, -31, 48,-100, -2, -39, 113, + -97, -30, -91, -30, 12,-101, -76, 71, + 101, 56, 42, 70,-119, -87,-126, 121, + 122, 118, 120, -62, 99, -79, 38, -33, + -38, 41, 109, 62, 98, -32,-106, 18, + 52, -65, 57, -90, 63,-119, 94, -15, + 109, 14, -29, 108, 40, -95, 30, 32, + 29, -53, -62, 3, 63, 65, 7,-124, + 15, 20, 5, 101, 27, 40, 97, -55, + -59, -25, 44,-114, 70, 54, 8, -36, + -13, -88,-115, -2, -66, -14, -21, 113, + -1, -96, -48, 59, 117, 6,-116, 126, + -121, 120, 115, 77, -48, -66,-126, -66, + -37, -62, 70, 65, 43,-116, -6, 48, + 127, 112, -16, -89, 84,-122, 50,-107, + -86, 91, 104, 19, 11, -26, -4, -11, + -54, -66, 125, -97,-119,-118, 65, 27, + -3, -72, 79, 104, -10, 114, 123, 20, + -103, -51, -45, 13, -16, 68, 58, -76, + -90, 102, 83, 51, 11, -53, -95, 16 +}; + +static const byte freqTable[] = { + 3, 10, 17, 24, 31, 38, 45, 51, + 58, 65, 71, 77, 83, 90, 96, 102, + 107, 113, 119, 125, 130, 136, 141, 146, + 151, 157, 162, 167, 172, 177, 181, 186, + 191, 195, 200, 204, 209, 213, 217, 221, + 226, 230, 234, 238, 242, 246, 249, 253 +}; + +/*static const byte amplTable[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 % + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 10 % + 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, // 20 % + 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x20, // 30% + 0x20, 0x20, 0x30, 0x30, 0x30, 0x30, 0x40, 0x40, + 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x20, 0x20, // 40 % + 0x30, 0x30, 0x40, 0x40, 0x40, 0x50, 0x50, 0x60, + 0x00, 0x00, 0x10, 0x10, 0x20, 0x20, 0x30, 0x30, // 50% + 0x40, 0x40, 0x50, 0x50, 0x60, 0x60, 0x70, 0x70, + 0x00, 0x00, 0x10, 0x10, 0x20, 0x30, 0x30, 0x40, // 60 % + 0x40, 0x50, 0x60, 0x60, 0x70, 0x70, 0x80, 0x90, + 0x00, 0x00, 0x10, 0x20, 0x20, 0x30, 0x40, 0x40, // 70 % + 0x50, 0x60, 0x70, 0x70, 0x80, 0x90, 0x90, 0xA0, + 0x00, 0x00, 0x10, 0x20, 0x30, 0x40, 0x40, 0x50, // 80 % + 0x60, 0x70, 0x80, 0x80, 0x90, 0xA0, 0xB0, 0xC0, + 0x00, 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, // 90 % + 0x70, 0x80, 0x90, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, + 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, // 100 % + 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0 +};*/ + +static const byte octaveTable[] = { + 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, + 0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, + 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, + 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x03, + 0x01, 0x04, 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, + 0x01, 0x08, 0x01, 0x09, 0x01, 0x0A, 0x01, 0x0B, + 0x02, 0x00, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, + 0x02, 0x04, 0x02, 0x05, 0x02, 0x06, 0x02, 0x07, + 0x02, 0x08, 0x02, 0x09, 0x02, 0x0A, 0x02, 0x0B, + 0x03, 0x00, 0x03, 0x01, 0x03, 0x02, 0x03, 0x03, + 0x03, 0x04, 0x03, 0x05, 0x03, 0x06, 0x03, 0x07, + 0x03, 0x08, 0x03, 0x09, 0x03, 0x0A, 0x03, 0x0B, + 0x04, 0x00, 0x04, 0x01, 0x04, 0x02, 0x04, 0x03, + 0x04, 0x04, 0x04, 0x05, 0x04, 0x06, 0x04, 0x07, + 0x04, 0x08, 0x04, 0x09, 0x04, 0x0A, 0x04, 0x0B, + 0x05, 0x00, 0x05, 0x01, 0x05, 0x02, 0x05, 0x03, + 0x05, 0x04, 0x05, 0x05, 0x05, 0x06, 0x05, 0x07, + 0x05, 0x08, 0x05, 0x09, 0x05, 0x0A, 0x05, 0x0B, + 0x06, 0x00, 0x06, 0x01, 0x06, 0x02, 0x06, 0x03, + 0x06, 0x04, 0x06, 0x05, 0x06, 0x06, 0x06, 0x07, + 0x06, 0x08, 0x06, 0x09, 0x06, 0x0A, 0x06, 0x0B, + 0x07, 0x00, 0x07, 0x01, 0x07, 0x02, 0x07, 0x03, + 0x07, 0x04, 0x07, 0x05, 0x07, 0x06, 0x07, 0x07, + 0x07, 0x08, 0x07, 0x09, 0x07, 0x0A, 0x07, 0x0B, + 0x08, 0x00, 0x08, 0x01, 0x08, 0x02, 0x08, 0x03, + 0x08, 0x04, 0x08, 0x05, 0x08, 0x06, 0x08, 0x07, + 0x08, 0x08, 0x08, 0x09, 0x08, 0x0A, 0x08, 0x0B, + 0x09, 0x00, 0x09, 0x01, 0x09, 0x02, 0x09, 0x03, + 0x09, 0x04, 0x09, 0x05, 0x09, 0x06, 0x09, 0x07, + 0x09, 0x08, 0x09, 0x09, 0x09, 0x0A, 0x09, 0x0B, + 0x0A, 0x00, 0x0A, 0x01, 0x0A, 0x02, 0x0A, 0x03, + 0x0A, 0x04, 0x0A, 0x05, 0x0A, 0x06, 0x0A, 0x07, + 0x0A, 0x08, 0x0A, 0x09, 0x0A, 0x0A, 0x0A, 0x0B +}; + +static const byte attackRate[] = { + 0, 2, 4, 7, 14, 26, 48, 82, + 128, 144, 160, 176, 192, 208, 224, 255 +}; + +static const byte decayRate[] = { + 0, 1, 2, 3, 4, 6, 12, 24, + 48, 96, 192, 215, 255, 255, 255, 255 +}; + +static const byte sustainRate[] = { + 255, 180, 128, 96, 80, 64, 56, 48, + 42, 36, 32, 28, 24, 20, 16, 0 +}; + +static const byte releaseRate[] = { + 0, 1, 2, 4, 6, 9, 14, 22, + 36, 56, 80, 100, 120, 140, 160, 255 +}; + +static const uint16 pcjr_freq_table[12] = { + 65472, 61760, 58304, 55040, 52032, 49024, + 46272, 43648, 41216, 38912, 36736, 34624 +}; + +static const byte volumeTable[] = { + 0x00, 0x10, 0x10, 0x11, 0x11, 0x21, 0x22, 0x22, + 0x33, 0x44, 0x55, 0x66, 0x88, 0xAA, 0xCC, 0xFF +}; + +static CMSEmulator *g_cmsEmu = 0; + +Player_V2CMS::Player_V2CMS(ScummEngine *scumm, Audio::Mixer *mixer) { + int i; + + _isV3Game = (scumm->_game.version >= 3); + _vm = scumm; + _mixer = mixer; +// debug("mixer rate: %d", _mixer->getOutputRate()); + _sample_rate = CMS_RATE; + + _header_len = (scumm->_game.features & GF_OLD_BUNDLE) ? 4 : 6; + + // Initialize sound queue + _current_nr = _next_nr = 0; + _current_data = _next_data = 0; + + // Initialize channel code + for (i = 0; i < 4; ++i) + clear_channel(i); + + _next_tick = 0; + _tick_len = (_sample_rate << FIXP_SHIFT) / FREQ_HZ; + + // Initialize V3 music timer + _music_timer_ctr = _music_timer = 0; + _ticks_per_music_timer = 65535; + + setMusicVolume(255); + + _timer_output = 0; + for (i = 0; i < 4; i++) + _timer_count[i] = 0; + + memset(_cmsVoicesBase, 0, sizeof(Voice)*16); + memset(_cmsVoices, 0, sizeof(Voice2)*8); + memset(_cmsChips, 0, sizeof(MusicChip)*2); + _midiDelay = _octaveMask = _looping = _tempo = 0; + _midiData = _midiSongBegin = 0; + _loadedMidiSong = 0; + memset(_midiChannel, 0, sizeof(Voice2*)*16); + memset(_midiChannelUse, 0, sizeof(byte)*16); + + _cmsVoices[0].amplitudeOutput = &(_cmsChips[0].ampl[0]); + _cmsVoices[0].freqOutput = &(_cmsChips[0].freq[0]); + _cmsVoices[0].octaveOutput = &(_cmsChips[0].octave[0]); + _cmsVoices[1].amplitudeOutput = &(_cmsChips[0].ampl[1]); + _cmsVoices[1].freqOutput = &(_cmsChips[0].freq[1]); + _cmsVoices[1].octaveOutput = &(_cmsChips[0].octave[0]); + _cmsVoices[2].amplitudeOutput = &(_cmsChips[0].ampl[2]); + _cmsVoices[2].freqOutput = &(_cmsChips[0].freq[2]); + _cmsVoices[2].octaveOutput = &(_cmsChips[0].octave[1]); + _cmsVoices[3].amplitudeOutput = &(_cmsChips[0].ampl[3]); + _cmsVoices[3].freqOutput = &(_cmsChips[0].freq[3]); + _cmsVoices[3].octaveOutput = &(_cmsChips[0].octave[1]); + _cmsVoices[4].amplitudeOutput = &(_cmsChips[1].ampl[0]); + _cmsVoices[4].freqOutput = &(_cmsChips[1].freq[0]); + _cmsVoices[4].octaveOutput = &(_cmsChips[1].octave[0]); + _cmsVoices[5].amplitudeOutput = &(_cmsChips[1].ampl[1]); + _cmsVoices[5].freqOutput = &(_cmsChips[1].freq[1]); + _cmsVoices[5].octaveOutput = &(_cmsChips[1].octave[0]); + _cmsVoices[6].amplitudeOutput = &(_cmsChips[1].ampl[2]); + _cmsVoices[6].freqOutput = &(_cmsChips[1].freq[2]); + _cmsVoices[6].octaveOutput = &(_cmsChips[1].octave[1]); + _cmsVoices[7].amplitudeOutput = &(_cmsChips[1].ampl[3]); + _cmsVoices[7].freqOutput = &(_cmsChips[1].freq[3]); + _cmsVoices[7].octaveOutput = &(_cmsChips[1].octave[1]); + + // inits the CMS Emulator like in the original + g_cmsEmu = new CMSEmulator(_sample_rate); + static const byte cmsInitData[13*2] = { + 0x1C, 0x02, + 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x14, 0x3F, 0x15, 0x00, 0x16, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1C, 0x01 + }; + + i = 0; + for (int cmsPort = 0x220; i < 2; cmsPort += 2, ++i) { + for (int off = 0; off < 13; ++off) { + g_cmsEmu->portWrite(cmsPort+1, cmsInitData[off*2]); + g_cmsEmu->portWrite(cmsPort, cmsInitData[off*2+1]); + } + } + + _mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); +} + +Player_V2CMS::~Player_V2CMS() { + mutex_up(); + _mixer->stopHandle(_soundHandle); + delete g_cmsEmu; + mutex_down(); +} + +void Player_V2CMS::setMusicVolume(int vol) { +} + +void Player_V2CMS::chainSound(int nr, byte *data) { + int offset = _header_len + 10; + + _current_nr = nr; + _current_data = data; + + for (int i = 0; i < 4; i++) { + clear_channel(i); + + _channels[i].d.music_script_nr = nr; + if (data) { + _channels[i].d.next_cmd = READ_LE_UINT16(data + offset + 2 * i); + if (_channels[i].d.next_cmd) { + _channels[i].d.time_left = 1; + } + } + } + _music_timer = 0; +} + +void Player_V2CMS::chainNextSound() { + if (_next_nr) { + chainSound(_next_nr, _next_data); + _next_nr = 0; + _next_data = 0; + } +} + +void Player_V2CMS::stopAllSounds() { + mutex_up(); + for (int i = 0; i < 4; i++) { + clear_channel(i); + } + _next_nr = _current_nr = 0; + _next_data = _current_data = 0; + _midiData = 0; + _midiSongBegin = 0; + _midiDelay = 0; + offAllChannels(); + mutex_down(); +} + +void Player_V2CMS::stopSound(int nr) { + mutex_up(); + if (_next_nr == nr) { + _next_nr = 0; + _next_data = 0; + } + if (_current_nr == nr) { + for (int i = 0; i < 4; i++) { + clear_channel(i); + } + _current_nr = 0; + _current_data = 0; + chainNextSound(); + } + if (_loadedMidiSong == nr) { + _midiData = 0; + _midiSongBegin = 0; + _midiDelay = 0; + offAllChannels(); + } + mutex_down(); +} + +void Player_V2CMS::startSound(int nr) { + byte *data = _vm->getResourceAddress(rtSound, nr); + assert(data); + + if (data[6] == 0x80) { + mutex_up(); + loadMidiData(data, nr); + mutex_down(); + } else { + mutex_up(); + + int cprio = _current_data ? *(_current_data + _header_len) : 0; + int prio = *(data + _header_len); + int nprio = _next_data ? *(_next_data + _header_len) : 0; + + int restartable = *(data + _header_len + 1); + + if (!_current_nr || cprio <= prio) { + int tnr = _current_nr; + int tprio = cprio; + byte *tdata = _current_data; + + chainSound(nr, data); + nr = tnr; + prio = tprio; + data = tdata; + restartable = data ? *(data + _header_len + 1) : 0; + } + + if (!_current_nr) { + nr = 0; + _next_nr = 0; + _next_data = 0; + } + + if (nr != _current_nr + && restartable + && (!_next_nr + || nprio <= prio)) { + + _next_nr = nr; + _next_data = data; + } + + mutex_down(); + } +} + +void Player_V2CMS::loadMidiData(byte *data, int sound) { + memset(_midiChannelUse, 0, sizeof(byte)*16); + + _tempo = data[7]; + _looping = data[8]; + + byte channels = data[14]; + byte curChannel = 0; + byte *voice2 = data + 23; + + for (; channels != 0; ++curChannel, --channels, voice2 += 16) { + if (*(data + 15 + curChannel)) { + byte channel = *(data + 15 + curChannel) - 1; + _midiChannelUse[channel] = 1; + + Voice *voiceDef = &_cmsVoicesBase[channel]; + + byte attackDecay = voice2[10]; + voiceDef->attack = attackRate[attackDecay >> 4]; + voiceDef->decay = decayRate[attackDecay & 0x0F]; + byte sustainRelease = voice2[11]; + voiceDef->sustain = sustainRate[sustainRelease >> 4]; + voiceDef->release = releaseRate[sustainRelease & 0x0F]; + + if (voice2[3] & 0x40) { + voiceDef->vibrato = 0x0301; + if (voice2[13] & 0x40) { + voiceDef->vibrato = 0x0601; + } + } else { + voiceDef->vibrato = 0; + } + + if (voice2[8] & 0x80) { + voiceDef->vibrato2 = 0x0506; + if (voice2[13] & 0x80) { + voiceDef->vibrato2 = 0x050C; + } + } else { + voiceDef->vibrato2 = 0; + } + + if ((voice2[8] & 0x0F) > 1) { + voiceDef->octadd = 0x01; + } else { + voiceDef->octadd = 0x00; + } + } + } + + for (int i = 0, channel = 0; i < 8; ++i, channel += 2) { + _cmsVoices[i].chanNumber = 0xFF; + _cmsVoices[i].curVolume = 0; + _cmsVoices[i].nextVoice = 0; + + _midiChannel[channel] = 0; + } + + _midiDelay = 0; + memset(_cmsChips, 0, sizeof(MusicChip)*2); + _midiData = data + 151; + _midiSongBegin = _midiData + data[9]; + + _loadedMidiSong = sound; +} + +int Player_V2CMS::getSoundStatus(int nr) const { + return _current_nr == nr || _next_nr == nr || _loadedMidiSong == nr; +} + + +void Player_V2CMS::clear_channel(int i) { + ChannelInfo *channel = &_channels[i]; + memset(channel, 0, sizeof(ChannelInfo)); +} + +int Player_V2CMS::getMusicTimer() const { + if (_isV3Game) + return _music_timer; + else + return _channels[0].d.music_timer; +} + +void Player_V2CMS::execute_cmd(ChannelInfo *channel) { + uint16 value; + int16 offset; + uint8 *script_ptr; + ChannelInfo * current_channel; + ChannelInfo * dest_channel; + + current_channel = channel; + + if (channel->d.next_cmd == 0) + goto check_stopped; + script_ptr = &_current_data[channel->d.next_cmd]; + + for (;;) { + uint8 opcode = *script_ptr++; + if (opcode >= 0xf8) { + switch (opcode) { + case 0xf8: // set hull curve + debug(7, "channels[%d]: hull curve %2d", + (uint)(channel - _channels), *script_ptr); + channel->d.hull_curve = hull_offsets[*script_ptr / 2]; + script_ptr++; + break; + + case 0xf9: // set freqmod curve + debug(7, "channels[%d]: freqmod curve %2d", + (uint)(channel - _channels), *script_ptr); + channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4]; + channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4]; + script_ptr++; + break; + + case 0xfd: // clear other channel + value = READ_LE_UINT16 (script_ptr) / sizeof (ChannelInfo); + debug(7, "clear channel %d", value); + script_ptr += 2; + // In Indy3, when traveling to Venice a command is + // issued to clear channel 4. So we introduce a 4th + // channel, which is never used. All OOB accesses are + // mapped to this channel. + // + // The original game had room for 8 channels, but only + // channels 0-3 are read, changes to other channels + // had no effect. + if (value >= ARRAYSIZE (_channels)) + value = 4; + channel = &_channels[value]; + // fall through + + case 0xfa: // clear current channel + if (opcode == 0xfa) + debug(7, "clear channel"); + channel->d.next_cmd = 0; + channel->d.base_freq = 0; + channel->d.freq_delta = 0; + channel->d.freq = 0; + channel->d.volume = 0; + channel->d.volume_delta = 0; + channel->d.inter_note_pause = 0; + channel->d.transpose = 0; + channel->d.hull_curve = 0; + channel->d.hull_offset = 0; + channel->d.hull_counter = 0; + channel->d.freqmod_table = 0; + channel->d.freqmod_offset = 0; + channel->d.freqmod_incr = 0; + channel->d.freqmod_multiplier = 0; + channel->d.freqmod_modulo = 0; + break; + + case 0xfb: // ret from subroutine + debug(7, "ret from sub"); + script_ptr = _retaddr; + break; + + case 0xfc: // call subroutine + offset = READ_LE_UINT16 (script_ptr); + debug(7, "subroutine %d", offset); + script_ptr += 2; + _retaddr = script_ptr; + script_ptr = _current_data + offset; + break; + + case 0xfe: // loop music + opcode = *script_ptr++; + offset = READ_LE_UINT16 (script_ptr); + script_ptr += 2; + debug(7, "loop if %d to %d", opcode, offset); + if (!channel->array[opcode / 2] || --channel->array[opcode/2]) + script_ptr += offset; + break; + + case 0xff: // set parameter + opcode = *script_ptr++; + value = READ_LE_UINT16 (script_ptr); + channel->array[opcode / 2] = value; + debug(7, "channels[%d]: set param %2d = %5d", + (uint)(channel - _channels), opcode, value); + script_ptr += 2; + if (opcode == 14) { + /* tempo var */ + _ticks_per_music_timer = 125; + } + if (opcode == 0) + goto end; + break; + } + } else { // opcode < 0xf8 + for (;;) { + int16 note, octave; + int is_last_note; + dest_channel = &_channels[(opcode >> 5) & 3]; + + if (!(opcode & 0x80)) { + + int tempo = channel->d.tempo; + if (!tempo) + tempo = 1; + channel->d.time_left = tempo * note_lengths[opcode & 0x1f]; + + note = *script_ptr++; + is_last_note = note & 0x80; + note &= 0x7f; + if (note == 0x7f) { + debug(8, "channels[%d]: pause %d", + (uint)(channel - _channels), channel->d.time_left); + goto end; + } + } else { + + channel->d.time_left = ((opcode & 7) << 8) | *script_ptr++; + + if ((opcode & 0x10)) { + debug(8, "channels[%d]: pause %d", + (uint)(channel - _channels), channel->d.time_left); + goto end; + } + + is_last_note = 0; + note = (*script_ptr++) & 0x7f; + } + + debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s", + (uint)(dest_channel - channel), script_ptr ? (uint)(script_ptr - _current_data - 2) : 0, + note, (signed short) dest_channel->d.transpose, channel->d.time_left, + dest_channel->d.hull_curve, dest_channel->d.freqmod_table, + dest_channel->d.freqmod_incr,dest_channel->d.freqmod_multiplier, + is_last_note ? "last":""); + + uint16 myfreq; + dest_channel->d.time_left = channel->d.time_left; + dest_channel->d.note_length = + channel->d.time_left - dest_channel->d.inter_note_pause; + note += dest_channel->d.transpose; + while (note < 0) + note += 12; + octave = note / 12; + note = note % 12; + dest_channel->d.hull_offset = 0; + dest_channel->d.hull_counter = 1; + if (dest_channel == &_channels[3]) { + dest_channel->d.hull_curve = 196 + note * 12; + myfreq = 384 - 64 * octave; + } else { + myfreq = pcjr_freq_table[note] >> octave; + } + dest_channel->d.freq = dest_channel->d.base_freq = myfreq; + if (is_last_note) + goto end; + opcode = *script_ptr++; + } + } + } + +end: + channel = current_channel; + if (channel->d.time_left) { + channel->d.next_cmd = script_ptr - _current_data; + return; + } + + channel->d.next_cmd = 0; + +check_stopped: + int i; + for (i = 0; i < 4; i++) { + if (_channels[i].d.time_left) + return; + } + + _current_nr = 0; + _current_data = 0; + chainNextSound(); + return; +} + +void Player_V2CMS::next_freqs(ChannelInfo *channel) { + channel->d.volume += channel->d.volume_delta; + channel->d.base_freq += channel->d.freq_delta; + + channel->d.freqmod_offset += channel->d.freqmod_incr; + if (channel->d.freqmod_offset != 0) + if (channel->d.freqmod_offset > channel->d.freqmod_modulo) + channel->d.freqmod_offset -= channel->d.freqmod_modulo; + + channel->d.freq = + (int) (freqmod_table[channel->d.freqmod_table + (channel->d.freqmod_offset >> 4)]) + * (int) channel->d.freqmod_multiplier / 256 + + channel->d.base_freq; + + debug(9, "Freq: %d/%d, %d/%d/%d*%d %d", + channel->d.base_freq, (int16)channel->d.freq_delta, + channel->d.freqmod_table, channel->d.freqmod_offset, + channel->d.freqmod_incr, channel->d.freqmod_multiplier, + channel->d.freq); + + if (channel->d.note_length && !--channel->d.note_length) { + channel->d.hull_offset = 16; + channel->d.hull_counter = 1; + } + + if (!--channel->d.time_left) { + execute_cmd(channel); + } + + if (channel->d.hull_counter && !--channel->d.hull_counter) { + for (;;) { + const int16 *hull_ptr = hulls + + channel->d.hull_curve + channel->d.hull_offset / 2; + if (hull_ptr[1] == -1) { + channel->d.volume = hull_ptr[0]; + if (hull_ptr[0] == 0) + channel->d.volume_delta = 0; + channel->d.hull_offset += 4; + } else { + channel->d.volume_delta = hull_ptr[0]; + channel->d.hull_counter = hull_ptr[1]; + channel->d.hull_offset += 4; + break; + } + } + } +} + +void Player_V2CMS::nextTick() { + for (int i = 0; i < 4; i++) { + if (!_channels[i].d.time_left) + continue; + next_freqs(&_channels[i]); + } + if (_music_timer_ctr++ >= _ticks_per_music_timer) { + _music_timer_ctr = 0; + _music_timer++; + } +} + +void Player_V2CMS::processMidiData(uint ticks) { + byte *currentData = _midiData; + byte command = 0x00; + int16 temp = 0; + + if (!_midiDelay) { + while (true) { + if ((command = *currentData++) == 0xFF) { + if ((command = *currentData++) == 0x2F) { + if (_looping == 0) { + currentData = _midiData = _midiSongBegin; + continue; + } + _midiData = _midiSongBegin = 0; + offAllChannels(); + return; + } else { + if (command == 0x58) { + currentData += 6; + } + } + } else { + _lastMidiCommand = command; + if (command < 0x90) { + clearNote(currentData); + } else { + playNote(currentData); + } + } + + temp = command = *currentData++; + if (command & 0x80) { + temp = (command & 0x7F) << 8; + command = *currentData++; + temp |= (command << 1); + temp >>= 1; + } + temp >>= 1; + int lastBit = temp & 1; + temp >>= 1; + temp += lastBit; + + if (temp) + break; + } + _midiData = currentData; + _midiDelay = temp; + } + + _midiDelay -= ticks; + if (_midiDelay < 0) + _midiDelay = 0; + + return; +} + +int Player_V2CMS::readBuffer(int16 *buffer, const int numSamples) { + mutex_up(); + uint step = 1; + int len = numSamples/2; + + // maybe this needs a complete rewrite + do { + if (_midiData) { + --_clkFrequenz; + if (!(_clkFrequenz & 0x01)) { + playVoice(); + } + + _tempoSum += _tempo; + // FIXME: _tempoSum is declared as char; on some systems char is unsigned. + // E.g. on OS X. Hence the following check is always false. + // Moral of the story: Use uint8, int8 or any of the other types provided by + // ScummVM if you want to ensure signedness and number of available bits. + if (_tempoSum < 0) { + // this have to be called in the same rate as in the original (I think) + processMidiData(1); + } + } + + if (!(_next_tick >> FIXP_SHIFT) && !_midiData) { + _next_tick += _tick_len; + nextTick(); + play(); + } + + step = len; + if (step > (_next_tick >> FIXP_SHIFT)) + step = (_next_tick >> FIXP_SHIFT); + g_cmsEmu->readBuffer(buffer, step); + buffer += 2 * step; + _next_tick -= step << FIXP_SHIFT; + } while (len -= step); + + mutex_down(); + return numSamples; +} + +void Player_V2CMS::playVoice() { + if (_outputTableReady) { + playMusicChips(_cmsChips); + _outputTableReady = 0; + } + + _octaveMask = 0xF0; + Voice2 *voice =0; + for (int i = 0; i < 8; ++i) { + voice = &_cmsVoices[i]; + _octaveMask = ~_octaveMask; + + if (voice->chanNumber != 0xFF) { + processChannel(voice); + continue; + } + + if (!voice->curVolume) { + *(voice->amplitudeOutput) = 0; + } + + int volume = voice->curVolume - voice->releaseRate; + voice->curVolume = volume; + + if (volume < 0) { + volume = voice->curVolume = 0; + } + + *(voice->amplitudeOutput) = ((volume >> 4) | (volume & 0xF0)) & voice->channel; + ++_outputTableReady; + } +} + +void Player_V2CMS::processChannel(Voice2 *channel) { + ++_outputTableReady; + switch (channel->nextProcessState) { + case PROCESS_RELEASE: + processRelease(channel); + break; + + case PROCESS_ATTACK: + processAttack(channel); + break; + + case PROCESS_DECAY: + processDecay(channel); + break; + + case PROCESS_SUSTAIN: + processSustain(channel); + break; + + case PROCESS_VIBRATO: + processVibrato(channel); + break; + + default: + break; + } +} + +void Player_V2CMS::processRelease(Voice2 *channel) { + channel->curVolume -= channel->releaseRate; + if (channel->curVolume < 0) + channel->curVolume = 0; + processVibrato(channel); +} + +void Player_V2CMS::processAttack(Voice2 *channel) { + channel->curVolume += channel->attackRate; + if (channel->curVolume >= 0) { + if (channel->curVolume <= channel->maxAmpl) + return processVibrato(channel); + } + channel->curVolume = channel->maxAmpl; + channel->nextProcessState = PROCESS_DECAY; + processVibrato(channel); +} + +void Player_V2CMS::processDecay(Voice2 *channel) { + channel->curVolume -= channel->decayRate; + if (channel->curVolume >= 0) { + if (channel->curVolume > channel->sustainRate) + return processVibrato(channel); + } + channel->curVolume = channel->sustainRate; + channel->nextProcessState = PROCESS_SUSTAIN; + processVibrato(channel); +} + +void Player_V2CMS::processSustain(Voice2 *channel) { + if (channel->unkVibratoRate) { + int volume = (int)channel->curVolume + (int)channel->unkRate; + if (volume & 0xFF00) { + volume = ((~volume) >> 8) & 0xFF; + } + channel->curVolume = volume; + --(channel->unkCount); + if (!channel->unkCount) { + channel->unkRate = ~(channel->unkRate); + channel->unkCount = (channel->unkVibratoDepth & 0x0F) << 1; + } + } + processVibrato(channel); +} + +void Player_V2CMS::processVibrato(Voice2 *channel) { + if (channel->vibratoRate) { + uint16 temp = channel->curFreq + channel->curVibratoRate; + channel->curOctave += (temp & 0xFF00) >> 8; + channel->curFreq = temp & 0xFF; + --(channel->curVibratoUnk); + if (!channel->curVibratoUnk) { + channel->curVibratoRate = ~(channel->curVibratoRate); + channel->curVibratoUnk = (channel->vibratoDepth & 0x0F) << 1; + } + } + + byte *output = channel->amplitudeOutput; + *output = ((channel->curVolume >> 4) | (channel->curVolume & 0xF0)) & channel->channel; + output = channel->freqOutput; + *output = channel->curFreq; + output = channel->octaveOutput; + *output = ((((channel->curOctave >> 4) | (channel->curOctave & 0x0F)) & _octaveMask) | ((~_octaveMask) & *output)); +} + +void Player_V2CMS::offAllChannels() { + warning("offAllChannels STUB"); +/* + // after using this sound can not be played anymore (since it would deinit the emulator) + static const byte cmsOffData[10*2] = { + 0x1C, 0x02, + 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, + 0x14, 0x3F, 0x15, 0x00, 0x16, 0x00 + }; + + for (int cmsPort = 0x220, i = 0; i < 2; cmsPort += 2, ++i) { + for (int off = 0; off < 10; ++off) { + g_cmsEmu->portWrite(cmsPort+1, cmsOffData[off*2]); + g_cmsEmu->portWrite(cmsPort, cmsOffData[off*2+1]); + } + }*/ +} + +Player_V2CMS::Voice2 *Player_V2CMS::getFreeVoice() { + Voice2 *curVoice = 0; + Voice2 *selected = 0; + uint8 volume = 0xFF; + + for (int i = 0; i < 8; ++i) { + curVoice = &_cmsVoices[i]; + + if (curVoice->chanNumber == 0xFF) { + if (!curVoice->curVolume) { + selected = curVoice; + break; + } + + if (curVoice->curVolume < volume) { + selected = curVoice; + volume = selected->curVolume; + } + } + } + + if (selected) { + selected->chanNumber = _lastMidiCommand & 0x0F; + + uint8 channel = selected->chanNumber; + Voice2 *oldChannel = _midiChannel[channel]; + _midiChannel[channel] = selected; + selected->nextVoice = oldChannel; + } + + return selected; +} + +void Player_V2CMS::playNote(byte *&data) { + byte channel = _lastMidiCommand & 0x0F; + if (_midiChannelUse[channel]) { + Voice2 *freeVoice = getFreeVoice(); + if (freeVoice) { + Voice *voice = &_cmsVoicesBase[freeVoice->chanNumber]; + freeVoice->attackRate = voice->attack; + freeVoice->decayRate = voice->decay; + freeVoice->sustainRate = voice->sustain; + freeVoice->releaseRate = voice->release; + freeVoice->octaveAdd = voice->octadd; + freeVoice->vibratoRate = freeVoice->curVibratoRate = voice->vibrato; + freeVoice->unkVibratoRate = freeVoice->unkRate = voice->vibrato2; + freeVoice->maxAmpl = 0xFF; + + uint8 rate = freeVoice->attackRate; + uint8 volume = freeVoice->curVolume >> 1; + + if (rate < volume) + rate = volume; + + rate -= freeVoice->attackRate; + freeVoice->curVolume = rate; + freeVoice->playingNote = *data; + int octave = octaveTable[(*data + 3) << 1] + freeVoice->octaveAdd - 3; + if (octave < 0) + octave = 0; + if (octave > 7) + octave = 7; + if (!octave) + ++octave; + freeVoice->curOctave = octave; + freeVoice->curFreq = freqTable[volume << 2]; + freeVoice->curVolume = 0; + freeVoice->nextProcessState = PROCESS_ATTACK; + if (_lastMidiCommand & 1) + freeVoice->channel = 0xF0; + else + freeVoice->channel = 0x0F; + } + } + data += 2; +} + +Player_V2CMS::Voice2 *Player_V2CMS::getPlayVoice(byte param) { + byte channelNum = _lastMidiCommand & 0x0F; + Voice2 *channel = _midiChannel[channelNum]; + + if (channel) { + Voice2 *backUp = 0; + while (true) { + if (channel->playingNote == param) + break; + + backUp = channel; + channel = channel->nextVoice; + if (!channel) + return 0; + } + + Voice2 *backUp2 = channel->nextVoice; + { + Voice2 *temp = backUp; + backUp = channel; + channel = temp; + } + if (channel) { + channel->nextVoice = backUp2; + } else { + _midiChannel[channelNum] = backUp2; + } + channel = backUp; + } + + return channel; +} + +void Player_V2CMS::clearNote(byte *&data) { + Voice2 *voice = getPlayVoice(*data); + if (voice) { + voice->chanNumber = 0xFF; + voice->nextVoice = 0; + voice->nextProcessState = PROCESS_RELEASE; + } + data += 2; +} + +void Player_V2CMS::play() { + _octaveMask = 0xF0; + channel_data *chan = &(_channels[0].d); + + static byte volumeReg[4] = { 0x00, 0x00, 0x00, 0x00 }; + static byte octaveReg[4] = { 0x66, 0x66, 0x66, 0x66 }; + static byte freqReg[4] = { 0xFF, 0xFF, 0xFF, 0xFF }; + + static byte freqEnable = 0x3E; + static byte noiseEnable = 0x01; + static byte noiseGen = 0x02; + for (int i = 1; i <= 4; ++i) { + if (chan->time_left) { + uint16 freq = chan->freq; + + if (i == 4) { + if ((freq >> 8) & 0x40) { + noiseGen = freq & 0xFF; + } else { + noiseGen = 3; + freqReg[0] = freqReg[3]; + octaveReg[0] = (octaveReg[0] & 0xF0) | ((octaveReg[1] & 0xF0) >> 4); + } + } else { + if (freq == 0) { + freq = 0xFFC0; + } + + int cmsOct = 2; + int freqOct = 0x8000; + + while (true) { + if (freq >= freqOct) { + break; + } + freqOct >>= 1; + ++cmsOct; + if (cmsOct == 8) { + --cmsOct; + freq = 1024; + break; + } + } + byte oct = cmsOct << 4; + oct |= cmsOct; + + oct &= _octaveMask; + oct |= ((~_octaveMask) & octaveReg[((i & 3) >> 1)]); + octaveReg[((i & 3) >> 1)] = oct; + + freq >>= -(cmsOct-9); + freqReg[(i&3)] = (-(freq-511)) & 0xFF; + } + volumeReg[i & 3] = volumeTable[chan->volume >> 12]; + } else { + volumeReg[i & 3] = 0; + } + chan = &(_channels[i].d); + _octaveMask ^= 0xFF; + } + + // with the high nibble of the volumeReg value + // the right channels amplitude is set + // with the low value the left channels amplitude + g_cmsEmu->portWrite(0x221, 0); + g_cmsEmu->portWrite(0x220, volumeReg[0]); + g_cmsEmu->portWrite(0x221, 1); + g_cmsEmu->portWrite(0x220, volumeReg[1]); + g_cmsEmu->portWrite(0x221, 2); + g_cmsEmu->portWrite(0x220, volumeReg[2]); + g_cmsEmu->portWrite(0x221, 3); + g_cmsEmu->portWrite(0x220, volumeReg[3]); + g_cmsEmu->portWrite(0x221, 8); + g_cmsEmu->portWrite(0x220, freqReg[0]); + g_cmsEmu->portWrite(0x221, 9); + g_cmsEmu->portWrite(0x220, freqReg[1]); + g_cmsEmu->portWrite(0x221, 10); + g_cmsEmu->portWrite(0x220, freqReg[2]); + g_cmsEmu->portWrite(0x221, 11); + g_cmsEmu->portWrite(0x220, freqReg[3]); + g_cmsEmu->portWrite(0x221, 0x10); + g_cmsEmu->portWrite(0x220, octaveReg[0]); + g_cmsEmu->portWrite(0x221, 0x11); + g_cmsEmu->portWrite(0x220, octaveReg[1]); + g_cmsEmu->portWrite(0x221, 0x14); + g_cmsEmu->portWrite(0x220, freqEnable); + g_cmsEmu->portWrite(0x221, 0x15); + g_cmsEmu->portWrite(0x220, noiseEnable); + g_cmsEmu->portWrite(0x221, 0x16); + g_cmsEmu->portWrite(0x220, noiseGen); +} + +void Player_V2CMS::playMusicChips(const MusicChip *table) { + int cmsPort = 0x21E; + + do { + cmsPort += 2; + g_cmsEmu->portWrite(cmsPort+1, 0); + g_cmsEmu->portWrite(cmsPort, table->ampl[0]); + g_cmsEmu->portWrite(cmsPort+1, 1); + g_cmsEmu->portWrite(cmsPort, table->ampl[1]); + g_cmsEmu->portWrite(cmsPort+1, 2); + g_cmsEmu->portWrite(cmsPort, table->ampl[2]); + g_cmsEmu->portWrite(cmsPort+1, 3); + g_cmsEmu->portWrite(cmsPort, table->ampl[3]); + g_cmsEmu->portWrite(cmsPort+1, 8); + g_cmsEmu->portWrite(cmsPort, table->freq[0]); + g_cmsEmu->portWrite(cmsPort+1, 9); + g_cmsEmu->portWrite(cmsPort, table->freq[1]); + g_cmsEmu->portWrite(cmsPort+1, 10); + g_cmsEmu->portWrite(cmsPort, table->freq[2]); + g_cmsEmu->portWrite(cmsPort+1, 11); + g_cmsEmu->portWrite(cmsPort, table->freq[3]); + g_cmsEmu->portWrite(cmsPort+1, 0x10); + g_cmsEmu->portWrite(cmsPort, table->octave[0]); + g_cmsEmu->portWrite(cmsPort+1, 0x11); + g_cmsEmu->portWrite(cmsPort, table->octave[1]); + g_cmsEmu->portWrite(cmsPort+1, 0x14); + g_cmsEmu->portWrite(cmsPort, 0x3F); + g_cmsEmu->portWrite(cmsPort+1, 0x15); + g_cmsEmu->portWrite(cmsPort, 0x00); + ++table; + } while ((cmsPort & 2) == 0); +} + +void Player_V2CMS::mutex_up() { + _mutex.lock(); +} + +void Player_V2CMS::mutex_down() { + _mutex.unlock(); +} +} // end of namespace Scumm diff --git a/engines/scumm/resource.cpp b/engines/scumm/resource.cpp index a3b1a5be77..8359675032 100644 --- a/engines/scumm/resource.cpp +++ b/engines/scumm/resource.cpp @@ -787,8 +787,6 @@ void ResourceManager::setResourceCounter(int type, int idx, byte flag) { #define SAFETY_AREA 2 byte *ResourceManager::createResource(int type, int idx, uint32 size) { - byte *ptr; - debugC(DEBUG_RESOURCE, "_res->createResource(%s,%d,%d)", resTypeFromId(type), idx, size); if (!validateResource("allocating", type, idx)) @@ -807,17 +805,17 @@ byte *ResourceManager::createResource(int type, int idx, uint32 size) { expireResources(size); - ptr = (byte *)calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); + void *ptr = calloc(size + sizeof(MemBlkHeader) + SAFETY_AREA, 1); if (ptr == NULL) { error("createResource(%s,%d): Out of memory while allocating %d", resTypeFromId(type), idx, size); } _allocatedSize += size; - address[type][idx] = ptr; + address[type][idx] = (byte *)ptr; ((MemBlkHeader *)ptr)->size = size; setResourceCounter(type, idx, 1); - return ptr + sizeof(MemBlkHeader); /* skip header */ + return (byte *)ptr + sizeof(MemBlkHeader); /* skip header */ } ResourceManager::ResourceManager(ScummEngine *vm) { @@ -1378,7 +1376,7 @@ const byte *ResourceIterator::findNext(uint32 tag) { const byte *ScummEngine::findResource(uint32 tag, const byte *searchin) { uint32 curpos, totalsize, size; - debugC(DEBUG_RESOURCE, "findResource(%s, %lx)", tag2str(tag), searchin); + debugC(DEBUG_RESOURCE, "findResource(%s, %p)", tag2str(tag), (const void *)searchin); if (!searchin) { if (_game.heversion >= 70) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index fe38bbf82f..c6ed7b71cc 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1596,6 +1596,13 @@ void ScummEngine::setupMusic(int midi) { case MD_PCJR: _musicType = MDT_PCSPK; break; + case MD_CMS: +#if 1 + _musicType = MDT_ADLIB; +#else + _musicType = MDT_CMS; // Still has number of bugs, disable by default +#endif + break; case MD_TOWNS: _musicType = MDT_TOWNS; break; @@ -1650,7 +1657,7 @@ void ScummEngine::setupMusic(int midi) { * automatically when samples need to be generated */ if (!_mixer->isReady()) { warning("Sound mixer initialization failed"); - if (_musicType == MDT_ADLIB || _musicType == MDT_PCSPK) { + if (_musicType == MDT_ADLIB || _musicType == MDT_PCSPK || _musicType == MDT_CMS) { midiDriver = MD_NULL; _musicType = MDT_NONE; warning("MIDI driver depends on sound mixer, switching to null MIDI driver"); @@ -1680,6 +1687,8 @@ void ScummEngine::setupMusic(int midi) { _musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK); } else if ((_musicType == MDT_PCSPK) && (_game.version > 2 && _game.version <= 4)) { _musicEngine = new Player_V2(this, _mixer, midiDriver != MD_PCSPK); + } else if (_musicType == MDT_CMS) { + _musicEngine = new Player_V2CMS(this, _mixer); } else if (_game.platform == Common::kPlatform3DO && _game.heversion == 61) { // 3DO versions use digital music and sound samples. } else if (_game.version >= 3 && _game.heversion <= 61) { diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 9682e5e1ee..badbb8ba9d 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -128,7 +128,7 @@ enum GameFeatures { }; /* SCUMM Debug Channels */ -void debugC(int level, const char *s, ...); +void debugC(int level, const char *s, ...) GCC_PRINTF(2, 3); enum { DEBUG_GENERAL = 1 << 0, // General debug @@ -528,7 +528,7 @@ protected: void versionDialog(); void scummMenuDialog(); - char displayMessage(const char *altButton, const char *message, ...); + char displayMessage(const char *altButton, const char *message, ...) GCC_PRINTF(3, 4); byte _fastMode; @@ -543,15 +543,13 @@ public: // VAR is a wrapper around scummVar, which attempts to include additional // useful information should an illegal var access be detected. #define VAR(x) scummVar(x, #x, __FILE__, __LINE__) - int32& scummVar(byte var, const char *varName, const char *file, int line) - { + int32& scummVar(byte var, const char *varName, const char *file, int line) { if (var == 0xFF) { error("Illegal access to variable %s in file %s, line %d", varName, file, line); } return _scummVars[var]; } - int32 scummVar(byte var, const char *varName, const char *file, int line) const - { + int32 scummVar(byte var, const char *varName, const char *file, int line) const { if (var == 0xFF) { error("Illegal access to variable %s in file %s, line %d", varName, file, line); } diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp index e39397eded..c1167a57c1 100644 --- a/engines/scumm/smush/imuse_channel.cpp +++ b/engines/scumm/smush/imuse_channel.cpp @@ -158,7 +158,7 @@ void ImuseChannel::decode() { _sbufferSize -= remaining_size; } else { debugC(DEBUG_SMUSH, "impossible ! : %p, %d, %d, %p(%d), %p(%d, %d)", - this, _dataSize, _inData, _tbuffer, _tbufferSize, _sbuffer, _sbufferSize, _srbufferSize); + (const void *)this, _dataSize, _inData, _tbuffer, _tbufferSize, _sbuffer, _sbufferSize, _srbufferSize); byte *old = _tbuffer; int new_size = remaining_size + _tbufferSize; _tbuffer = new byte[new_size]; diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index f1be5e0b17..ad48029bd2 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -1181,7 +1181,7 @@ int ScummEngine::readSoundResource(int idx) { break; } - if ((_musicType == MDT_PCSPK) && pri != 11) + if ((_musicType == MDT_PCSPK || _musicType == MDT_CMS) && pri != 11) pri = -1; debugC(DEBUG_RESOURCE, " tag: %s, total_size=%d, pri=%d", tag2str(tag), size, pri); @@ -1710,7 +1710,7 @@ static void convertADResource(ResourceManager *res, const GameSettings& game, in } else { dw = 500000 * 256 / ticks; } - debugC(DEBUG_SOUND, " ticks = %d, speed = %ld", ticks, dw); + debugC(DEBUG_SOUND, " ticks = %d, speed = %d", ticks, dw); // Write a tempo change Meta event memcpy(ptr, "\x00\xFF\x51\x03", 4); ptr += 4; @@ -2121,6 +2121,19 @@ int ScummEngine::readSoundResourceSmallHeader(int idx) { _fileHandle->read(_res->createResource(rtSound, idx, wa_size + 6), wa_size + 6); } return 1; + } else if (_musicType == MDT_CMS && ad_offs != 0) { + if (_game.features & GF_OLD_BUNDLE) { + _fileHandle->seek(wa_offs + wa_size + 6, SEEK_SET); + byte musType = _fileHandle->readByte(); + + if (musType == 0x80) { + _fileHandle->seek(ad_offs, SEEK_SET); + _fileHandle->read(_res->createResource(rtSound, idx, ad_size), ad_size); + } else { + _fileHandle->seek(wa_offs, SEEK_SET); + _fileHandle->read(_res->createResource(rtSound, idx, wa_size), wa_size); + } + } } else if (ad_offs != 0) { // AD resources have a header, instrument definitions and one MIDI track. // We build an 'ADL ' resource from that: diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 631c88ffa6..22487b43a3 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -706,6 +706,9 @@ void ScummEngine::resetScummVars() { case MDT_PCSPK: VAR(VAR_SOUNDCARD) = 0; break; + case MDT_CMS: + VAR(VAR_SOUNDCARD) = 2; + break; case MDT_ADLIB: VAR(VAR_SOUNDCARD) = 3; break; @@ -724,7 +727,7 @@ void ScummEngine::resetScummVars() { // Value only used by the Macintosh version of Indiana Jones and the Last Crusade else if (_game.platform == Common::kPlatformMacintosh && _game.version == 3) VAR(VAR_VIDEOMODE) = 50; - // Value only used by the Amiga of Monkey Island 2 + // Value only used by the Amiga version of Monkey Island 2 else if (_game.platform == Common::kPlatformAmiga) VAR(VAR_VIDEOMODE) = 82; else if (_renderMode == Common::kRenderCGA) |