aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS400
-rw-r--r--audio/midiparser.cpp210
-rw-r--r--audio/midiparser.h66
-rw-r--r--audio/midiparser_qt.cpp14
-rw-r--r--audio/midiparser_smf.cpp176
-rw-r--r--audio/midiparser_xmidi.cpp99
-rw-r--r--audio/softsynth/mt32/TVA.cpp2
-rwxr-xr-xbackends/platform/maemo/debian/rules2
-rw-r--r--devtools/create_project/config.h7
-rw-r--r--devtools/create_project/create_project.cpp28
-rw-r--r--devtools/create_project/create_project.h24
-rw-r--r--devtools/create_project/msbuild.cpp21
-rw-r--r--devtools/create_project/msvc.cpp19
-rw-r--r--devtools/create_project/msvc.h2
-rw-r--r--devtools/create_project/scripts/postbuild.cmd4
-rw-r--r--devtools/create_project/visualstudio.cpp8
-rwxr-xr-xdevtools/credits.pl20
-rw-r--r--dists/scummvm.rc3
-rw-r--r--engines/agos/midiparser_s1d.cpp38
-rw-r--r--engines/cine/anim.cpp60
-rw-r--r--engines/cine/cine.cpp13
-rw-r--r--engines/cine/cine.h2
-rw-r--r--engines/cine/console.cpp2
-rw-r--r--engines/cine/gfx.cpp87
-rw-r--r--engines/cine/gfx.h3
-rw-r--r--engines/cine/main_loop.cpp28
-rw-r--r--engines/cine/object.cpp2
-rw-r--r--engines/cine/pal.cpp3
-rw-r--r--engines/cine/part.cpp2
-rw-r--r--engines/cine/saveload.cpp2
-rw-r--r--engines/cine/saveload.h2
-rw-r--r--engines/cine/script_fw.cpp1584
-rw-r--r--engines/cine/sound.cpp8
-rw-r--r--engines/cine/texte.cpp2
-rw-r--r--engines/cine/texte.h2
-rw-r--r--engines/cine/various.cpp218
-rw-r--r--engines/parallaction/sound_br.cpp26
-rw-r--r--engines/sci/sound/midiparser_sci.cpp80
-rw-r--r--engines/sci/sound/midiparser_sci.h2
-rw-r--r--engines/scumm/midiparser_ro.cpp16
-rw-r--r--engines/tony/custom.cpp813
-rw-r--r--engines/tony/custom.h18
-rw-r--r--engines/tony/font.cpp59
-rw-r--r--engines/tony/game.cpp1
-rw-r--r--engines/tony/gfxengine.cpp33
-rw-r--r--engines/tony/mpal/mpal.cpp28
-rw-r--r--engines/wintermute/readme.txt155
-rw-r--r--gui/credits.h11
-rw-r--r--video/bink_decoder.cpp22
-rw-r--r--video/bink_decoder.h2
50 files changed, 2133 insertions, 2296 deletions
diff --git a/AUTHORS b/AUTHORS
index fe806c4490..e8f0b838f6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,8 +6,9 @@ ScummVM Team
PR Office
---------
- Arnaud Boutonne - Public Relations Officer, Project Administrator
- Eugene Sandulenko - Project Leader
+ Arnaud Boutonne - Public Relations Officer, Project
+ Administrator
+ Eugene Sandulenko - Project Leader
Core Team
---------
@@ -18,29 +19,30 @@ ScummVM Team
Retired Project Leaders
-----------------------
James Brown
- Vincent Hamm - ScummVM co-founder, Original Cruise/CinE author
+ Vincent Hamm - ScummVM co-founder, Original Cruise/CinE
+ author
Max Horn
- Ludvig Strigeus - Original ScummVM and SimonVM author
+ Ludvig Strigeus - Original ScummVM and SimonVM author
Engine Teams
------------
SCUMM:
Torbjorn Andersson
- James Brown - (retired)
- Jonathan Gray - (retired)
- Vincent Hamm - (retired)
- Max Horn - (retired)
+ James Brown - (retired)
+ Jonathan Gray - (retired)
+ Vincent Hamm - (retired)
+ Max Horn - (retired)
Travis Howell
- Pawel Kolodziejski - Codecs, iMUSE, Smush, etc.
- Gregory Montoir - (retired)
- Eugene Sandulenko - FT INSANE, MM NES, MM C64, game detection,
- Herc/CGA
- Ludvig Strigeus - (retired)
+ Pawel Kolodziejski - Codecs, iMUSE, Smush, etc.
+ Gregory Montoir - (retired)
+ Eugene Sandulenko - FT INSANE, MM NES, MM C64, game detection,
+ Herc/CGA
+ Ludvig Strigeus - (retired)
HE:
- Jonathan Gray - (retired)
+ Jonathan Gray - (retired)
Travis Howell
- Gregory Montoir - (retired)
+ Gregory Montoir - (retired)
Eugene Sandulenko
AGI:
@@ -48,26 +50,26 @@ ScummVM Team
Matthew Hoops
Filippos Karapetis
Pawel Kolodziejski
- Walter van Niftrik - (retired)
+ Walter van Niftrik - (retired)
Kari Salminen
Eugene Sandulenko
- David Symonds - (retired)
+ David Symonds - (retired)
AGOS:
Torbjorn Andersson
Paul Gilbert
Travis Howell
- Oliver Kiehl - (retired)
- Ludvig Strigeus - (retired)
+ Oliver Kiehl - (retired)
+ Ludvig Strigeus - (retired)
CGE:
Arnaud Boutonne
Paul Gilbert
Cine:
- Vincent Hamm - (retired)
+ Vincent Hamm - (retired)
Pawel Kolodziejski
- Gregory Montoir - (retired)
+ Gregory Montoir - (retired)
Kari Salminen
Eugene Sandulenko
@@ -76,7 +78,7 @@ ScummVM Team
CruisE:
Paul Gilbert
- Vincent Hamm - (retired)
+ Vincent Hamm - (retired)
Draci:
Denis Kasak
@@ -90,7 +92,7 @@ ScummVM Team
Torbjorn Andersson
Bertrand Augereau
Filippos Karapetis
- Vladimir Menshakov - (retired)
+ Vladimir Menshakov - (retired)
Willem Jan Palenstijn
Gob:
@@ -110,10 +112,10 @@ ScummVM Team
Eugene Sandulenko
Kyra:
- Torbjorn Andersson - VQA Player
+ Torbjorn Andersson - VQA Player
Oystein Eftevaag
Florian Kagerer
- Gregory Montoir - (retired)
+ Gregory Montoir - (retired)
Johannes Schickel
Lastexpress:
@@ -140,14 +142,14 @@ ScummVM Team
peres
Queen:
- David Eriksson - (retired)
- Gregory Montoir - (retired)
+ David Eriksson - (retired)
+ Gregory Montoir - (retired)
Joost Peters
SAGA:
Torbjorn Andersson
- Daniel Balsom - Original engine reimplementation author
- (retired)
+ Daniel Balsom - Original engine reimplementation author
+ (retired)
Filippos Karapetis
Andrew Kurushin
Eugene Sandulenko
@@ -155,46 +157,46 @@ ScummVM Team
SCI:
Greg Frieger
Paul Gilbert
- Max Horn - (retired)
+ Max Horn - (retired)
Filippos Karapetis
Martin Kiewitz
- Walter van Niftrik - (retired)
+ Walter van Niftrik - (retired)
Willem Jan Palenstijn
Jordi Vilalta Prat
Lars Skovlund
Sky:
- Robert Goeffringmann - (retired)
- Oliver Kiehl - (retired)
+ Robert Goeffringmann - (retired)
+ Oliver Kiehl - (retired)
Joost Peters
Sword1:
- Fabio Battaglia - PSX version support
- Thierry Crozat - Mac version support
- Robert Goeffringmann - (retired)
+ Fabio Battaglia - PSX version support
+ Thierry Crozat - Mac version support
+ Robert Goeffringmann - (retired)
Sword2:
Torbjorn Andersson
- Fabio Battaglia - PSX version support
- Jonathan Gray - (retired)
+ Fabio Battaglia - PSX version support
+ Jonathan Gray - (retired)
Sword25:
Torbjorn Andersson
Paul Gilbert
- Max Horn - (retired)
+ Max Horn - (retired)
Filippos Karapetis
Eugene Sandulenko
TeenAgent:
- Robert Megone - Help with callback rewriting
- Vladimir Menshakov - (retired)
+ Robert Megone - Help with callback rewriting
+ Vladimir Menshakov - (retired)
Tinsel:
Torbjorn Andersson
- Fabio Battaglia - PSX version support
+ Fabio Battaglia - PSX version support
Paul Gilbert
Sven Hesse
- Max Horn - (retired)
+ Max Horn - (retired)
Filippos Karapetis
Joost Peters
@@ -202,14 +204,17 @@ ScummVM Team
Sylvain Dupont
Touche:
- Gregory Montoir - (retired)
+ Gregory Montoir - (retired)
TsAGE:
Arnaud Boutonne
Paul Gilbert
Tucker:
- Gregory Montoir - (retired)
+ Gregory Montoir - (retired)
+
+ Wintermute:
+ Einar Johan T. Somaaen
Backend Teams
-------------
@@ -233,26 +238,26 @@ ScummVM Team
Lubomyr Lisen
Maemo:
- Frantisek Dufka - (retired)
+ Frantisek Dufka - (retired)
Tarek Soliman
Nintendo 64:
Fabio Battaglia
Nintendo DS:
- Bertrand Augereau - HQ software scaler
+ Bertrand Augereau - HQ software scaler
Neil Millstone
OpenPandora:
John Willis
PocketPC / WinCE:
- Nicolas Bacca - (retired)
+ Nicolas Bacca - (retired)
Ismail Khatib
- Kostas Nakos - (retired)
+ Kostas Nakos - (retired)
PlayStation 2:
- Robert Goeffringmann - (retired)
+ Robert Goeffringmann - (retired)
Max Lingua
PSP (PlayStation Portable):
@@ -260,8 +265,8 @@ ScummVM Team
Joost Peters
SDL (Win/Linux/OS X/etc.):
- Max Horn - (retired)
- Eugene Sandulenko - Asm routines, GFX layers
+ Max Horn - (retired)
+ Eugene Sandulenko - Asm routines, GFX layers
SymbianOS:
Jurgen Braam
@@ -276,8 +281,9 @@ ScummVM Team
Other subsystems
----------------
Infrastructure:
- Max Horn - Backend & Engine APIs, file API, sound mixer,
- audiostreams, data structures, etc. (retired)
+ Max Horn - Backend & Engine APIs, file API, sound
+ mixer, audiostreams, data structures, etc.
+ (retired)
Eugene Sandulenko
Johannes Schickel
@@ -287,30 +293,31 @@ ScummVM Team
Johannes Schickel
Miscellaneous:
- David Corrales-Lopez - Filesystem access improvements (GSoC 2007
- task) (retired)
- Jerome Fisher - MT-32 emulator
- Benjamin Haisch - Heavily improved de-/encoder for DXA videos
- Jochen Hoenicke - Speaker & PCjr sound support, AdLib work
- (retired)
- Chris Page - Return to launcher, savestate improvements,
- leak fixes, ... (GSoC 2008 task) (retired)
- Robin Watts - ARM assembly routines for nice speedups on
- several ports; improvements to the sound mixer
+ David Corrales-Lopez - Filesystem access improvements (GSoC 2007
+ task) (retired)
+ Jerome Fisher - MT-32 emulator
+ Benjamin Haisch - Heavily improved de-/encoder for DXA videos
+ Jochen Hoenicke - Speaker & PCjr sound support, AdLib work
+ (retired)
+ Chris Page - Return to launcher, savestate improvements,
+ leak fixes, ... (GSoC 2008 task) (retired)
+ Robin Watts - ARM assembly routines for nice speedups on
+ several ports; improvements to the sound
+ mixer
Website (code)
--------------
- Fredrik Wendel - (retired)
+ Fredrik Wendel - (retired)
Website (maintenance)
---------------------
- James Brown - IRC Logs maintainer
- Thierry Crozat - Wiki maintainer
- Andre Heider - Buildbot maintainer
- Joost Peters - Doxygen Project Documentation maintainer
- Jordi Vilalta Prat - Wiki maintainer
- Eugene Sandulenko - Forum, IRC channel, Screen Shots and Mailing
- list maintainer
+ James Brown - IRC Logs maintainer
+ Thierry Crozat - Wiki maintainer
+ Andre Heider - Buildbot maintainer
+ Joost Peters - Doxygen Project Documentation maintainer
+ Jordi Vilalta Prat - Wiki maintainer
+ Eugene Sandulenko - Forum, IRC channel, Screen Shots and Mailing
+ list maintainer
John Willis
Website (content)
@@ -319,31 +326,31 @@ ScummVM Team
Documentation
-------------
- Thierry Crozat - Numerous contributions to documentation
- Joachim Eberhard - Numerous contributions to documentation
- (retired)
- Matthew Hoops - Wiki editor
+ Thierry Crozat - Numerous contributions to documentation
+ Joachim Eberhard - Numerous contributions to documentation
+ (retired)
+ Matthew Hoops - Wiki editor
Retired Team Members
--------------------
- Chris Apers - Former PalmOS porter
- Ralph Brorsen - Help with GUI implementation
- Jamieson Christian - iMUSE, MIDI, all things musical
- Felix Jakschitsch - Zak256 reverse engineering
- Mutwin Kraus - Original MacOS porter
- Peter Moraliyski - Port: GP32
- Jeremy Newman - Former webmaster
- Lionel Ulmer - Port: X11
- Won Star - Former GP32 porter
+ Chris Apers - Former PalmOS porter
+ Ralph Brorsen - Help with GUI implementation
+ Jamieson Christian - iMUSE, MIDI, all things musical
+ Felix Jakschitsch - Zak256 reverse engineering
+ Mutwin Kraus - Original MacOS porter
+ Peter Moraliyski - Port: GP32
+ Jeremy Newman - Former webmaster
+ Lionel Ulmer - Port: X11
+ Won Star - Former GP32 porter
Other contributions
*******************
Packages
--------
AmigaOS 4:
- Hans-Joerg Frieden - (retired)
+ Hans-Joerg Frieden - (retired)
Hubert Maier
- Juha Niemimaki - (retired)
+ Juha Niemimaki - (retired)
Atari/FreeMiNT:
Keith Scroggins
@@ -353,22 +360,22 @@ Other contributions
Luc Schrijvers
Debian GNU/Linux:
- Tore Anderson - (retired)
+ Tore Anderson - (retired)
David Weinehall
Fedora / RedHat:
Willem Jan Palenstijn
Mac OS X:
- Max Horn - (retired)
+ Max Horn - (retired)
Oystein Eftevaag
Mandriva:
- Dominik Scherer - (retired)
+ Dominik Scherer - (retired)
MorphOS:
Fabien Coeurjoly
- Ruediger Hanke - (retired)
+ Ruediger Hanke - (retired)
OS/2:
Paul Smedley
@@ -386,12 +393,12 @@ Other contributions
Travis Howell
Win64:
- Chris Gray - (retired)
+ Chris Gray - (retired)
Johannes Schickel
Translations
------------
- Thierry Crozat - Translation Lead
+ Thierry Crozat - Translation Lead
Basque:
Mikel Iturbe Urretxa
@@ -449,92 +456,95 @@ Other contributions
Websites (design)
-----------------
- Dobo Balazs - Website design
- William Claydon - Skins for doxygen, buildbot and wiki
- Yaroslav Fedevych - HTML/CSS for the website
- Jean Marc Gimenez - ScummVM logo
- David Jensen - SVG logo conversion
- Raina - ScummVM forum buttons
+ Dobo Balazs - Website design
+ William Claydon - Skins for doxygen, buildbot and wiki
+ Yaroslav Fedevych - HTML/CSS for the website
+ Jean Marc Gimenez - ScummVM logo
+ David Jensen - SVG logo conversion
+ Raina - ScummVM forum buttons
Code contributions
------------------
- Ori Avtalion - Subtitle control options in the GUI; BASS GUI
- fixes
- Stuart Caie - Decoders for Amiga and AtariST data files (AGOS
- engine)
- Paolo Costabel - PSP port contributions
- Martin Doucha - CinE engine objectification
- Thomas Fach-Pedersen - ProTracker module player, Smacker video decoder
- Tobias Gunkel - Sound support for C64 version of MM/Zak, Loom
- PCE support
- Janne Huttunen - V3 actor mask support, Dig/FT SMUSH audio
- Kovacs Endre Janos - Several fixes for Simon1
- Jeroen Janssen - Numerous readability and bugfix patches
- Andreas Karlsson - Initial port for SymbianOS
- Claudio Matsuoka - Daily Linux builds
- Thomas Mayer - PSP port contributions
- Sean Murray - ScummVM tools GUI application (GSoC 2007 task)
- n0p - Windows CE port aspect ratio correction scaler
- and right click input method
- Mikesch Nepomuk - MI1 VGA floppy patches
- Nicolas Noble - Config file and ALSA support
- Tim Phillips - Initial MI1 CD music support
- Quietust - Sound support for Amiga SCUMM V2/V3 games, MM
- NES support
- Robert Crossfield - Improved support for Apple II/C64 versions of MM
- Andreas Roever - Broken Sword I & II MPEG2 cutscene support
- Edward Rudd - Fixes for playing MP3 versions of MI1/Loom audio
- Daniel Schepler - Final MI1 CD music support, initial Ogg Vorbis
- support
- Andre Souza - SDL-based OpenGL renderer
- Tom Frost - WebOS port contributions
+ Ori Avtalion - Subtitle control options in the GUI; BASS GUI
+ fixes
+ Stuart Caie - Decoders for Amiga and AtariST data files
+ (AGOS engine)
+ Paolo Costabel - PSP port contributions
+ Martin Doucha - CinE engine objectification
+ Thomas Fach-Pedersen - ProTracker module player, Smacker video
+ decoder
+ Tobias Gunkel - Sound support for C64 version of MM/Zak, Loom
+ PCE support
+ Janne Huttunen - V3 actor mask support, Dig/FT SMUSH audio
+ Kovacs Endre Janos - Several fixes for Simon1
+ Jeroen Janssen - Numerous readability and bugfix patches
+ Andreas Karlsson - Initial port for SymbianOS
+ Claudio Matsuoka - Daily Linux builds
+ Thomas Mayer - PSP port contributions
+ Sean Murray - ScummVM tools GUI application (GSoC 2007 task)
+ n0p - Windows CE port aspect ratio correction scaler
+ and right click input method
+ Mikesch Nepomuk - MI1 VGA floppy patches
+ Nicolas Noble - Config file and ALSA support
+ Tim Phillips - Initial MI1 CD music support
+ Quietust - Sound support for Amiga SCUMM V2/V3 games, MM
+ NES support
+ Robert Crossfield - Improved support for Apple II/C64 versions of
+ MM
+ Andreas Roever - Broken Sword I & II MPEG2 cutscene support
+ Edward Rudd - Fixes for playing MP3 versions of MI1/Loom
+ audio
+ Daniel Schepler - Final MI1 CD music support, initial Ogg Vorbis
+ support
+ Andre Souza - SDL-based OpenGL renderer
+ Tom Frost - WebOS port contributions
FreeSCI Contributors
--------------------
- Francois-R Boyer - MT-32 information and mapping code
- Rainer Canavan - IRIX MIDI driver and bug fixes
+ Francois-R Boyer - MT-32 information and mapping code
+ Rainer Canavan - IRIX MIDI driver and bug fixes
Xiaojun Chen
- Paul David Doherty - Game version information
- Vyacheslav Dikonov - Config script improvements
- Ruediger Hanke - Port to the MorphOS platform
- Matt Hargett - Clean-ups, bugfixes, Hardcore QA, Win32
- Max Horn - SetJump implementation
- Ravi I. - SCI0 sound resource specification
- Emmanuel Jeandel - Bugfixes and bug reports
- Dmitry Jemerov - Port to the Win32 platform, numerous bugfixes
- Chris Kehler - Makefile enhancements
- Christopher T. Lansdo - Original CVS maintainer, Alpha compatibility
- fixes
- Sergey Lapin - Port of Carl's type 2 decompression code
- Rickard Lind - MT-32->GM MIDI mapping magic, sound research
- Hubert Maier - AmigaOS 4 port
- Johannes Manhave - Document format translation
- Claudio Matsuoka - CVS snapshots, daily builds, BeOS and cygwin
- ports
- Dark Minister - SCI research (bytecode and parser)
- Carl Muckenhoupt - Sources to the SCI resource viewer tools that
- started it all
- Anders Baden Nielsen - PPC testing
- Walter van Niftrik - Ports to the Dreamcast and GP32 platforms
- Rune Orsval - Configuration file editor
- Solomon Peachy - SDL ports and much of the sound subsystem
- Robey Pointer - Bug tracking system hosting
- Magnus Reftel - Heap implementation, Python class viewer,
- bugfixes
- Christoph Reichenbach - UN*X code, VM/Graphics/Sound/other
- infrastructure
- George Reid - FreeBSD package management
- Lars Skovlund - Project maintenance, most documentation,
- bugfixes, SCI1 support
- Rink Springer - Port to the DOS platform, several bug fixes
- Rainer De Temple - SCI research
+ Paul David Doherty - Game version information
+ Vyacheslav Dikonov - Config script improvements
+ Ruediger Hanke - Port to the MorphOS platform
+ Matt Hargett - Clean-ups, bugfixes, Hardcore QA, Win32
+ Max Horn - SetJump implementation
+ Ravi I. - SCI0 sound resource specification
+ Emmanuel Jeandel - Bugfixes and bug reports
+ Dmitry Jemerov - Port to the Win32 platform, numerous bugfixes
+ Chris Kehler - Makefile enhancements
+ Christopher T. Lansdown - Original CVS maintainer, Alpha compatibility
+ fixes
+ Sergey Lapin - Port of Carl's type 2 decompression code
+ Rickard Lind - MT-32->GM MIDI mapping magic, sound research
+ Hubert Maier - AmigaOS 4 port
+ Johannes Manhave - Document format translation
+ Claudio Matsuoka - CVS snapshots, daily builds, BeOS and cygwin
+ ports
+ Dark Minister - SCI research (bytecode and parser)
+ Carl Muckenhoupt - Sources to the SCI resource viewer tools that
+ started it all
+ Anders Baden Nielsen - PPC testing
+ Walter van Niftrik - Ports to the Dreamcast and GP32 platforms
+ Rune Orsval - Configuration file editor
+ Solomon Peachy - SDL ports and much of the sound subsystem
+ Robey Pointer - Bug tracking system hosting
+ Magnus Reftel - Heap implementation, Python class viewer,
+ bugfixes
+ Christoph Reichenbach - UN*X code, VM/Graphics/Sound/other
+ infrastructure
+ George Reid - FreeBSD package management
+ Lars Skovlund - Project maintenance, most documentation,
+ bugfixes, SCI1 support
+ Rink Springer - Port to the DOS platform, several bug fixes
+ Rainer De Temple - SCI research
Sean Terrell
- Hugues Valois - Game selection menu
- Jordi Vilalta - Numerous code and website clean-up patches
- Petr Vyhnak - The DCL-INFLATE algorithm, many Win32
- improvements
- Bas Zoetekouw - Man pages, debian package management, CVS
- maintenance
+ Hugues Valois - Game selection menu
+ Jordi Vilalta - Numerous code and website clean-up patches
+ Petr Vyhnak - The DCL-INFLATE algorithm, many Win32
+ improvements
+ Bas Zoetekouw - Man pages, debian package management, CVS
+ maintenance
Special thanks to Prof. Dr. Gary Nutt for allowing the FreeSCI VM
extension as a course project in his Advanced OS course.
@@ -546,28 +556,27 @@ Other contributions
Special thanks to
*****************
- Daniel Balsom - For the original Reinherit (SAGA) code
- Sander Buskens - For his work on the initial reversing of Monkey2
- Canadacow - For the original MT-32 emulator
- Kevin Carnes - For Scumm16, the basis of ScummVM's older gfx codecs
- Curt Coder - For the original TrollVM (preAGI) code
- Patrick Combet - For the original Gobliiins ADL player
- Ivan Dubrov - For contributing the initial version of the Gobliiins
- engine
- Henrik Engqvist - For generously providing hosting for our buildbot, SVN
- repository, planet and doxygen sites as well as tons of
- HD space
- DOSBox Team - For their awesome OPL2 and OPL3 emulator
- Till Kresslein - For design of modern ScummVM GUI
- Jezar - For his freeverb filter implementation
- Jim Leiterman - Various info on his FM-TOWNS/Marty SCUMM ports
- lloyd - For deep tech details about C64 Zak & MM
- Sarien Team - Original AGI engine code
- Jimmi Thogersen - For ScummRev, and much obscure code/documentation
- Tristan - For additional work on the original MT-32 emulator
- James Woodcock - Soundtrack enhancements
-
- Some icons by Yusuke Kamiyamane
+ Daniel Balsom - For the original Reinherit (SAGA) code
+ Sander Buskens - For his work on the initial reversing of Monkey2
+ Canadacow - For the original MT-32 emulator
+ Kevin Carnes - For Scumm16, the basis of ScummVM's older gfx codecs
+ Curt Coder - For the original TrollVM (preAGI) code
+ Patrick Combet - For the original Gobliiins ADL player
+ Ivan Dubrov - For contributing the initial version of the Gobliiins
+ engine
+ Henrik Engqvist - For generously providing hosting for our buildbot, SVN
+ repository, planet and doxygen sites as well as tons
+ of HD space
+ DOSBox Team - For their awesome OPL2 and OPL3 emulator
+ Yusuke Kamiyamane - For contributing some GUI icons
+ Till Kresslein - For design of modern ScummVM GUI
+ Jezar - For his freeverb filter implementation
+ Jim Leiterman - Various info on his FM-TOWNS/Marty SCUMM ports
+ lloyd - For deep tech details about C64 Zak & MM
+ Sarien Team - Original AGI engine code
+ Jimmi Thogersen - For ScummRev, and much obscure code/documentation
+ Tristan - For additional work on the original MT-32 emulator
+ James Woodcock - Soundtrack enhancements
Tony Warriner and everyone at Revolution Software Ltd. for sharing with us
the source of some of their brilliant games, allowing us to release
@@ -606,6 +615,9 @@ Special thanks to
of Dreamweb and for their tremendous support.
Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe
- Avalon for providing full source code for Soltys and letting us to
+ Avalon for providing full source code for Soltys and letting us
redistribute the game.
+ Jan Nedoma for providing the sources to the Wintermute-engine, and for his
+ support while porting the engine to ScummVM.
+
diff --git a/audio/midiparser.cpp b/audio/midiparser.cpp
index 943a6067a4..eec32c05d1 100644
--- a/audio/midiparser.cpp
+++ b/audio/midiparser.cpp
@@ -32,24 +32,24 @@
//////////////////////////////////////////////////
MidiParser::MidiParser() :
-_hanging_notes_count(0),
+_hangingNotesCount(0),
_driver(0),
-_timer_rate(0x4A0000),
+_timerRate(0x4A0000),
_ppqn(96),
_tempo(500000),
-_psec_per_tick(5208), // 500000 / 96
+_psecPerTick(5208), // 500000 / 96
_autoLoop(false),
_smartJump(false),
_centerPitchWheelOnUnload(false),
_sendSustainOffOnNotesOff(false),
-_num_tracks(0),
-_active_track(255),
-_abort_parse(0) {
- memset(_active_notes, 0, sizeof(_active_notes));
- _next_event.start = NULL;
- _next_event.delta = 0;
- _next_event.event = 0;
- _next_event.length = 0;
+_numTracks(0),
+_activeTrack(255),
+_abortParse(0) {
+ memset(_activeNotes, 0, sizeof(_activeNotes));
+ _nextEvent.start = NULL;
+ _nextEvent.delta = 0;
+ _nextEvent.event = 0;
+ _nextEvent.length = 0;
}
void MidiParser::property(int prop, int value) {
@@ -76,7 +76,7 @@ void MidiParser::sendToDriver(uint32 b) {
void MidiParser::setTempo(uint32 tempo) {
_tempo = tempo;
if (_ppqn)
- _psec_per_tick = (tempo + (_ppqn >> 2)) / _ppqn;
+ _psecPerTick = (tempo + (_ppqn >> 2)) / _ppqn;
}
// This is the conventional (i.e. SMF) variable length quantity
@@ -100,44 +100,44 @@ void MidiParser::activeNote(byte channel, byte note, bool active) {
return;
if (active)
- _active_notes[note] |= (1 << channel);
+ _activeNotes[note] |= (1 << channel);
else
- _active_notes[note] &= ~(1 << channel);
+ _activeNotes[note] &= ~(1 << channel);
// See if there are hanging notes that we can cancel
- NoteTimer *ptr = _hanging_notes;
+ NoteTimer *ptr = _hangingNotes;
int i;
- for (i = ARRAYSIZE(_hanging_notes); i; --i, ++ptr) {
- if (ptr->channel == channel && ptr->note == note && ptr->time_left) {
- ptr->time_left = 0;
- --_hanging_notes_count;
+ for (i = ARRAYSIZE(_hangingNotes); i; --i, ++ptr) {
+ if (ptr->channel == channel && ptr->note == note && ptr->timeLeft) {
+ ptr->timeLeft = 0;
+ --_hangingNotesCount;
break;
}
}
}
-void MidiParser::hangingNote(byte channel, byte note, uint32 time_left, bool recycle) {
+void MidiParser::hangingNote(byte channel, byte note, uint32 timeLeft, bool recycle) {
NoteTimer *best = 0;
- NoteTimer *ptr = _hanging_notes;
+ NoteTimer *ptr = _hangingNotes;
int i;
- if (_hanging_notes_count >= ARRAYSIZE(_hanging_notes)) {
+ if (_hangingNotesCount >= ARRAYSIZE(_hangingNotes)) {
warning("MidiParser::hangingNote(): Exceeded polyphony");
return;
}
- for (i = ARRAYSIZE(_hanging_notes); i; --i, ++ptr) {
+ for (i = ARRAYSIZE(_hangingNotes); i; --i, ++ptr) {
if (ptr->channel == channel && ptr->note == note) {
- if (ptr->time_left && ptr->time_left < time_left && recycle)
+ if (ptr->timeLeft && ptr->timeLeft < timeLeft && recycle)
return;
best = ptr;
- if (ptr->time_left) {
+ if (ptr->timeLeft) {
if (recycle)
sendToDriver(0x80 | channel, note, 0);
- --_hanging_notes_count;
+ --_hangingNotesCount;
}
break;
- } else if (!best && ptr->time_left == 0) {
+ } else if (!best && ptr->timeLeft == 0) {
best = ptr;
}
}
@@ -146,14 +146,14 @@ void MidiParser::hangingNote(byte channel, byte note, uint32 time_left, bool rec
// length, if the note should be turned on and off in
// the same iteration. For now just set it to 1 and
// we'll turn it off in the next cycle.
- if (!time_left || time_left & 0x80000000)
- time_left = 1;
+ if (!timeLeft || timeLeft & 0x80000000)
+ timeLeft = 1;
if (best) {
best->channel = channel;
best->note = note;
- best->time_left = time_left;
- ++_hanging_notes_count;
+ best->timeLeft = timeLeft;
+ ++_hangingNotesCount;
} else {
// We checked this up top. We should never get here!
warning("MidiParser::hangingNote(): Internal error");
@@ -161,45 +161,45 @@ void MidiParser::hangingNote(byte channel, byte note, uint32 time_left, bool rec
}
void MidiParser::onTimer() {
- uint32 end_time;
- uint32 event_time;
+ uint32 endTime;
+ uint32 eventTime;
- if (!_position._play_pos || !_driver)
+ if (!_position._playPos || !_driver)
return;
- _abort_parse = false;
- end_time = _position._play_time + _timer_rate;
+ _abortParse = false;
+ endTime = _position._playTime + _timerRate;
// Scan our hanging notes for any
// that should be turned off.
- if (_hanging_notes_count) {
- NoteTimer *ptr = &_hanging_notes[0];
+ if (_hangingNotesCount) {
+ NoteTimer *ptr = &_hangingNotes[0];
int i;
- for (i = ARRAYSIZE(_hanging_notes); i; --i, ++ptr) {
- if (ptr->time_left) {
- if (ptr->time_left <= _timer_rate) {
+ for (i = ARRAYSIZE(_hangingNotes); i; --i, ++ptr) {
+ if (ptr->timeLeft) {
+ if (ptr->timeLeft <= _timerRate) {
sendToDriver(0x80 | ptr->channel, ptr->note, 0);
- ptr->time_left = 0;
- --_hanging_notes_count;
+ ptr->timeLeft = 0;
+ --_hangingNotesCount;
} else {
- ptr->time_left -= _timer_rate;
+ ptr->timeLeft -= _timerRate;
}
}
}
}
- while (!_abort_parse) {
- EventInfo &info = _next_event;
+ while (!_abortParse) {
+ EventInfo &info = _nextEvent;
- event_time = _position._last_event_time + info.delta * _psec_per_tick;
- if (event_time > end_time)
+ eventTime = _position._lastEventTime + info.delta * _psecPerTick;
+ if (eventTime > endTime)
break;
// Process the next info.
- _position._last_event_tick += info.delta;
+ _position._lastEventTick += info.delta;
if (info.event < 0x80) {
warning("Bad command or running status %02X", info.event);
- _position._play_pos = 0;
+ _position._playPos = 0;
return;
}
@@ -217,7 +217,7 @@ void MidiParser::onTimer() {
// as well as sending it to the output device.
if (_autoLoop) {
jumpToTick(0);
- parseNextEvent(_next_event);
+ parseNextEvent(_nextEvent);
} else {
stopPlaying();
_driver->metaEvent(info.ext.type, info.ext.data, (uint16)info.length);
@@ -234,7 +234,7 @@ void MidiParser::onTimer() {
activeNote(info.channel(), info.basic.param1, false);
} else if (info.command() == 0x9) {
if (info.length > 0)
- hangingNote(info.channel(), info.basic.param1, info.length * _psec_per_tick - (end_time - event_time));
+ hangingNote(info.channel(), info.basic.param1, info.length * _psecPerTick - (endTime - eventTime));
else
activeNote(info.channel(), info.basic.param1, true);
}
@@ -242,15 +242,15 @@ void MidiParser::onTimer() {
}
- if (!_abort_parse) {
- _position._last_event_time = event_time;
- parseNextEvent(_next_event);
+ if (!_abortParse) {
+ _position._lastEventTime = eventTime;
+ parseNextEvent(_nextEvent);
}
}
- if (!_abort_parse) {
- _position._play_time = end_time;
- _position._play_tick = (_position._play_time - _position._last_event_time) / _psec_per_tick + _position._last_event_tick;
+ if (!_abortParse) {
+ _position._playTime = endTime;
+ _position._playTick = (_position._playTime - _position._lastEventTime) / _psecPerTick + _position._lastEventTick;
}
}
@@ -263,20 +263,20 @@ void MidiParser::allNotesOff() {
// Turn off all active notes
for (i = 0; i < 128; ++i) {
for (j = 0; j < 16; ++j) {
- if (_active_notes[i] & (1 << j)) {
+ if (_activeNotes[i] & (1 << j)) {
sendToDriver(0x80 | j, i, 0);
}
}
}
// Turn off all hanging notes
- for (i = 0; i < ARRAYSIZE(_hanging_notes); i++) {
- if (_hanging_notes[i].time_left) {
- sendToDriver(0x80 | _hanging_notes[i].channel, _hanging_notes[i].note, 0);
- _hanging_notes[i].time_left = 0;
+ for (i = 0; i < ARRAYSIZE(_hangingNotes); i++) {
+ if (_hangingNotes[i].timeLeft) {
+ sendToDriver(0x80 | _hangingNotes[i].channel, _hangingNotes[i].note, 0);
+ _hangingNotes[i].timeLeft = 0;
}
}
- _hanging_notes_count = 0;
+ _hangingNotesCount = 0;
// To be sure, send an "All Note Off" event (but not all MIDI devices
// support this...).
@@ -287,7 +287,7 @@ void MidiParser::allNotesOff() {
sendToDriver(0xB0 | i, 0x40, 0); // Also send a sustain off event (bug #3116608)
}
- memset(_active_notes, 0, sizeof(_active_notes));
+ memset(_activeNotes, 0, sizeof(_activeNotes));
}
void MidiParser::resetTracking() {
@@ -295,7 +295,7 @@ void MidiParser::resetTracking() {
}
bool MidiParser::setTrack(int track) {
- if (track < 0 || track >= _num_tracks)
+ if (track < 0 || track >= _numTracks)
return false;
// We allow restarting the track via setTrack when
// it isn't playing anymore. This allows us to reuse
@@ -308,7 +308,7 @@ bool MidiParser::setTrack(int track) {
// TODO: Check if any engine has problem with this
// handling, if so we need to find a better way to handle
// track restarts. (KYRA relies on this working)
- else if (track == _active_track && isPlaying())
+ else if (track == _activeTrack && isPlaying())
return true;
if (_smartJump)
@@ -317,10 +317,10 @@ bool MidiParser::setTrack(int track) {
allNotesOff();
resetTracking();
- memset(_active_notes, 0, sizeof(_active_notes));
- _active_track = track;
- _position._play_pos = _tracks[track];
- parseNextEvent(_next_event);
+ memset(_activeNotes, 0, sizeof(_activeNotes));
+ _activeTrack = track;
+ _position._playPos = _tracks[track];
+ parseNextEvent(_nextEvent);
return true;
}
@@ -332,29 +332,29 @@ void MidiParser::stopPlaying() {
void MidiParser::hangAllActiveNotes() {
// Search for note off events until we have
// accounted for every active note.
- uint16 temp_active[128];
- memcpy(temp_active, _active_notes, sizeof (temp_active));
+ uint16 tempActive[128];
+ memcpy(tempActive, _activeNotes, sizeof (tempActive));
- uint32 advance_tick = _position._last_event_tick;
+ uint32 advanceTick = _position._lastEventTick;
while (true) {
int i;
for (i = 0; i < 128; ++i)
- if (temp_active[i] != 0)
+ if (tempActive[i] != 0)
break;
if (i == 128)
break;
- parseNextEvent(_next_event);
- advance_tick += _next_event.delta;
- if (_next_event.command() == 0x8) {
- if (temp_active[_next_event.basic.param1] & (1 << _next_event.channel())) {
- hangingNote(_next_event.channel(), _next_event.basic.param1, (advance_tick - _position._last_event_tick) * _psec_per_tick, false);
- temp_active[_next_event.basic.param1] &= ~(1 << _next_event.channel());
+ parseNextEvent(_nextEvent);
+ advanceTick += _nextEvent.delta;
+ if (_nextEvent.command() == 0x8) {
+ if (tempActive[_nextEvent.basic.param1] & (1 << _nextEvent.channel())) {
+ hangingNote(_nextEvent.channel(), _nextEvent.basic.param1, (advanceTick - _position._lastEventTick) * _psecPerTick, false);
+ tempActive[_nextEvent.basic.param1] &= ~(1 << _nextEvent.channel());
}
- } else if (_next_event.event == 0xFF && _next_event.ext.type == 0x2F) {
+ } else if (_nextEvent.event == 0xFF && _nextEvent.ext.type == 0x2F) {
// warning("MidiParser::hangAllActiveNotes(): Hit End of Track with active notes left");
for (i = 0; i < 128; ++i) {
for (int j = 0; j < 16; ++j) {
- if (temp_active[i] & (1 << j)) {
+ if (tempActive[i] & (1 << j)) {
activeNote(j, i, false);
sendToDriver(0x80 | j, i, 0);
}
@@ -366,33 +366,33 @@ void MidiParser::hangAllActiveNotes() {
}
bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes, bool dontSendNoteOn) {
- if (_active_track >= _num_tracks)
+ if (_activeTrack >= _numTracks)
return false;
Tracker currentPos(_position);
- EventInfo currentEvent(_next_event);
+ EventInfo currentEvent(_nextEvent);
resetTracking();
- _position._play_pos = _tracks[_active_track];
- parseNextEvent(_next_event);
+ _position._playPos = _tracks[_activeTrack];
+ parseNextEvent(_nextEvent);
if (tick > 0) {
while (true) {
- EventInfo &info = _next_event;
- if (_position._last_event_tick + info.delta >= tick) {
- _position._play_time += (tick - _position._last_event_tick) * _psec_per_tick;
- _position._play_tick = tick;
+ EventInfo &info = _nextEvent;
+ if (_position._lastEventTick + info.delta >= tick) {
+ _position._playTime += (tick - _position._lastEventTick) * _psecPerTick;
+ _position._playTick = tick;
break;
}
- _position._last_event_tick += info.delta;
- _position._last_event_time += info.delta * _psec_per_tick;
- _position._play_tick = _position._last_event_tick;
- _position._play_time = _position._last_event_time;
+ _position._lastEventTick += info.delta;
+ _position._lastEventTime += info.delta * _psecPerTick;
+ _position._playTick = _position._lastEventTick;
+ _position._playTime = _position._lastEventTime;
if (info.event == 0xFF) {
if (info.ext.type == 0x2F) { // End of track
_position = currentPos;
- _next_event = currentEvent;
+ _nextEvent = currentEvent;
return false;
} else {
if (info.ext.type == 0x51 && info.length >= 3) // Tempo
@@ -419,36 +419,36 @@ bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes, bool d
}
}
- parseNextEvent(_next_event);
+ parseNextEvent(_nextEvent);
}
}
if (stopNotes) {
- if (!_smartJump || !currentPos._play_pos) {
+ if (!_smartJump || !currentPos._playPos) {
allNotesOff();
} else {
- EventInfo targetEvent(_next_event);
+ EventInfo targetEvent(_nextEvent);
Tracker targetPosition(_position);
_position = currentPos;
- _next_event = currentEvent;
+ _nextEvent = currentEvent;
hangAllActiveNotes();
- _next_event = targetEvent;
+ _nextEvent = targetEvent;
_position = targetPosition;
}
}
- _abort_parse = true;
+ _abortParse = true;
return true;
}
void MidiParser::unloadMusic() {
resetTracking();
allNotesOff();
- _num_tracks = 0;
- _active_track = 255;
- _abort_parse = true;
+ _numTracks = 0;
+ _activeTrack = 255;
+ _abortParse = true;
if (_centerPitchWheelOnUnload) {
// Center the pitch wheels in preparation for the next piece of
diff --git a/audio/midiparser.h b/audio/midiparser.h
index f26da456b6..bb9749b97f 100644
--- a/audio/midiparser.h
+++ b/audio/midiparser.h
@@ -49,33 +49,33 @@ class MidiDriver_BASE;
* each Tracker location.
*/
struct Tracker {
- byte * _play_pos; ///< A pointer to the next event to be parsed
- uint32 _play_time; ///< Current time in microseconds; may be in between event times
- uint32 _play_tick; ///< Current MIDI tick; may be in between event ticks
- uint32 _last_event_time; ///< The time, in microseconds, of the last event that was parsed
- uint32 _last_event_tick; ///< The tick at which the last parsed event occurs
- byte _running_status; ///< Cached MIDI command, for MIDI streams that rely on implied event codes
+ byte * _playPos; ///< A pointer to the next event to be parsed
+ uint32 _playTime; ///< Current time in microseconds; may be in between event times
+ uint32 _playTick; ///< Current MIDI tick; may be in between event ticks
+ uint32 _lastEventTime; ///< The time, in microseconds, of the last event that was parsed
+ uint32 _lastEventTick; ///< The tick at which the last parsed event occurs
+ byte _runningStatus; ///< Cached MIDI command, for MIDI streams that rely on implied event codes
Tracker() { clear(); }
/// Copy constructor for each duplication of Tracker information.
Tracker(const Tracker &copy) :
- _play_pos(copy._play_pos),
- _play_time(copy._play_time),
- _play_tick(copy._play_tick),
- _last_event_time(copy._last_event_time),
- _last_event_tick(copy._last_event_tick),
- _running_status(copy._running_status)
+ _playPos(copy._playPos),
+ _playTime(copy._playTime),
+ _playTick(copy._playTick),
+ _lastEventTime(copy._lastEventTime),
+ _lastEventTick(copy._lastEventTick),
+ _runningStatus(copy._runningStatus)
{ }
/// Clears all data; used by the constructor for initialization.
void clear() {
- _play_pos = 0;
- _play_time = 0;
- _play_tick = 0;
- _last_event_time = 0;
- _last_event_tick = 0;
- _running_status = 0;
+ _playPos = 0;
+ _playTime = 0;
+ _playTick = 0;
+ _lastEventTime = 0;
+ _lastEventTick = 0;
+ _runningStatus = 0;
}
};
@@ -119,8 +119,8 @@ struct EventInfo {
struct NoteTimer {
byte channel; ///< The MIDI channel on which the note was played
byte note; ///< The note number for the active note
- uint32 time_left; ///< The time, in microseconds, remaining before the note should be turned off
- NoteTimer() : channel(0), note(0), time_left(0) {}
+ uint32 timeLeft; ///< The time, in microseconds, remaining before the note should be turned off
+ NoteTimer() : channel(0), note(0), timeLeft(0) {}
};
@@ -264,29 +264,29 @@ struct NoteTimer {
*/
class MidiParser {
protected:
- uint16 _active_notes[128]; ///< Each uint16 is a bit mask for channels that have that note on.
- NoteTimer _hanging_notes[32]; ///< Maintains expiration info for up to 32 notes.
+ uint16 _activeNotes[128]; ///< Each uint16 is a bit mask for channels that have that note on.
+ NoteTimer _hangingNotes[32]; ///< Maintains expiration info for up to 32 notes.
///< Used for "Smart Jump" and MIDI formats that do not include explicit Note Off events.
- byte _hanging_notes_count; ///< Count of hanging notes, used to optimize expiration.
+ byte _hangingNotesCount; ///< Count of hanging notes, used to optimize expiration.
MidiDriver_BASE *_driver; ///< The device to which all events will be transmitted.
- uint32 _timer_rate; ///< The time in microseconds between onTimer() calls. Obtained from the MidiDriver.
+ uint32 _timerRate; ///< The time in microseconds between onTimer() calls. Obtained from the MidiDriver.
uint32 _ppqn; ///< Pulses Per Quarter Note. (We refer to "pulses" as "ticks".)
uint32 _tempo; ///< Microseconds per quarter note.
- uint32 _psec_per_tick; ///< Microseconds per tick (_tempo / _ppqn).
+ uint32 _psecPerTick; ///< Microseconds per tick (_tempo / _ppqn).
bool _autoLoop; ///< For lightweight clients that don't provide their own flow control.
bool _smartJump; ///< Support smart expiration of hanging notes when jumping
bool _centerPitchWheelOnUnload; ///< Center the pitch wheels when unloading a song
bool _sendSustainOffOnNotesOff; ///< Send a sustain off on a notes off event, stopping hanging notes
byte *_tracks[120]; ///< Multi-track MIDI formats are supported, up to 120 tracks.
- byte _num_tracks; ///< Count of total tracks for multi-track MIDI formats. 1 for single-track formats.
- byte _active_track; ///< Keeps track of the currently active track, in multi-track formats.
+ byte _numTracks; ///< Count of total tracks for multi-track MIDI formats. 1 for single-track formats.
+ byte _activeTrack; ///< Keeps track of the currently active track, in multi-track formats.
Tracker _position; ///< The current time/position in the active track.
- EventInfo _next_event; ///< The next event to transmit. Events are preparsed
+ EventInfo _nextEvent; ///< The next event to transmit. Events are preparsed
///< so each event is parsed only once; this permits
///< simulated events in certain formats.
- bool _abort_parse; ///< If a jump or other operation interrupts parsing, flag to abort.
+ bool _abortParse; ///< If a jump or other operation interrupts parsing, flag to abort.
protected:
static uint32 readVLQ(byte * &data);
@@ -295,7 +295,7 @@ protected:
virtual void parseNextEvent(EventInfo &info) = 0;
void activeNote(byte channel, byte note, bool active);
- void hangingNote(byte channel, byte note, uint32 ticks_left, bool recycle = true);
+ void hangingNote(byte channel, byte note, uint32 ticksLeft, bool recycle = true);
void hangAllActiveNotes();
virtual void sendToDriver(uint32 b);
@@ -377,18 +377,18 @@ public:
virtual void property(int prop, int value);
void setMidiDriver(MidiDriver_BASE *driver) { _driver = driver; }
- void setTimerRate(uint32 rate) { _timer_rate = rate; }
+ void setTimerRate(uint32 rate) { _timerRate = rate; }
void setTempo(uint32 tempo);
void onTimer();
- bool isPlaying() const { return (_position._play_pos != 0); }
+ bool isPlaying() const { return (_position._playPos != 0); }
void stopPlaying();
bool setTrack(int track);
bool jumpToTick(uint32 tick, bool fireEvents = false, bool stopNotes = true, bool dontSendNoteOn = false);
uint32 getPPQN() { return _ppqn; }
- virtual uint32 getTick() { return _position._play_tick; }
+ virtual uint32 getTick() { return _position._playTick; }
static void defaultXMidiCallback(byte eventData, void *refCon);
diff --git a/audio/midiparser_qt.cpp b/audio/midiparser_qt.cpp
index d6440508df..2b8a02ba5e 100644
--- a/audio/midiparser_qt.cpp
+++ b/audio/midiparser_qt.cpp
@@ -110,17 +110,17 @@ void MidiParser_QT::resetTracking() {
}
void MidiParser_QT::parseNextEvent(EventInfo &info) {
- if (_position._play_pos >= _trackInfo[_active_track].data + _trackInfo[_active_track].size) {
+ if (_position._playPos >= _trackInfo[_activeTrack].data + _trackInfo[_activeTrack].size) {
// Manually insert end of track when we reach the end
info.event = 0xFF;
info.ext.type = 0x2F;
return;
}
- if (_loadedInstruments < _trackInfo[_active_track].noteRequests.size()) {
+ if (_loadedInstruments < _trackInfo[_activeTrack].noteRequests.size()) {
// Load instruments first
info.event = 0xC0 | _loadedInstruments;
- info.basic.param1 = _trackInfo[_active_track].noteRequests[_loadedInstruments].tone.gmNumber;
+ info.basic.param1 = _trackInfo[_activeTrack].noteRequests[_loadedInstruments].tone.gmNumber;
_loadedInstruments++;
return;
}
@@ -290,8 +290,8 @@ void MidiParser_QT::initCommon() {
// Now we have all our info needed in _trackInfo from whatever container
// form, we can fill in the MidiParser tracks.
- _num_tracks = _trackInfo.size();
- assert(_num_tracks > 0);
+ _numTracks = _trackInfo.size();
+ assert(_numTracks > 0);
for (uint32 i = 0; i < _trackInfo.size(); i++)
MidiParser::_tracks[i] = _trackInfo[i].data;
@@ -332,8 +332,8 @@ byte *MidiParser_QT::readWholeTrack(Common::QuickTimeParser::Track *track, uint3
}
uint32 MidiParser_QT::readUint32() {
- uint32 value = READ_BE_UINT32(_position._play_pos);
- _position._play_pos += 4;
+ uint32 value = READ_BE_UINT32(_position._playPos);
+ _position._playPos += 4;
return value;
}
diff --git a/audio/midiparser_smf.cpp b/audio/midiparser_smf.cpp
index e883471b54..4b0913cbfe 100644
--- a/audio/midiparser_smf.cpp
+++ b/audio/midiparser_smf.cpp
@@ -45,8 +45,8 @@ public:
};
-static const byte command_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 0 };
-static const byte special_lengths[16] = { 0, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
+static const byte commandLengths[8] = { 3, 3, 3, 3, 2, 2, 3, 0 };
+static const byte specialLengths[16] = { 0, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
MidiParser_SMF::~MidiParser_SMF() {
free(_buffer);
@@ -62,8 +62,8 @@ void MidiParser_SMF::property(int prop, int value) {
}
void MidiParser_SMF::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
- info.delta = readVLQ(_position._play_pos);
+ info.start = _position._playPos;
+ info.delta = readVLQ(_position._playPos);
// Process the next info. If mpMalformedPitchBends
// was set, we must skip over any pitch bend events
@@ -71,19 +71,19 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
// real pitch bend events, they're just two-byte
// prefixes before the real info.
do {
- if ((_position._play_pos[0] & 0xF0) >= 0x80)
- info.event = *(_position._play_pos++);
+ if ((_position._playPos[0] & 0xF0) >= 0x80)
+ info.event = *(_position._playPos++);
else
- info.event = _position._running_status;
- } while (_malformedPitchBends && (info.event & 0xF0) == 0xE0 && _position._play_pos++);
+ info.event = _position._runningStatus;
+ } while (_malformedPitchBends && (info.event & 0xF0) == 0xE0 && _position._playPos++);
if (info.event < 0x80)
return;
- _position._running_status = info.event;
+ _position._runningStatus = info.event;
switch (info.command()) {
case 0x9: // Note On
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
if (info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
@@ -91,7 +91,7 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
case 0xC:
case 0xD:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
@@ -99,20 +99,20 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
case 0xA:
case 0xB:
case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
info.length = 0;
break;
case 0xF: // System Common, Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
break;
case 0x3: // Song Select
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
@@ -126,16 +126,16 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
break;
case 0x0: // SysEx
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
break;
case 0xF: // META event
- info.ext.type = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.ext.type = *(_position._playPos++);
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
break;
default:
@@ -146,8 +146,8 @@ void MidiParser_SMF::parseNextEvent(EventInfo &info) {
bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
uint32 len;
- byte midi_type;
- uint32 total_size;
+ byte midiType;
+ uint32 totalSize;
bool isGMF;
unloadMusic();
@@ -171,10 +171,10 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
// Verify that this MIDI either is a Type 2
// or has only 1 track. We do not support
// multitrack Type 1 files.
- _num_tracks = pos[2] << 8 | pos[3];
- midi_type = pos[1];
- if (midi_type > 2 /*|| (midi_type < 2 && _num_tracks > 1)*/) {
- warning("No support for a Type %d MIDI with %d tracks", (int)midi_type, (int)_num_tracks);
+ _numTracks = pos[2] << 8 | pos[3];
+ midiType = pos[1];
+ if (midiType > 2 /*|| (midiType < 2 && _numTracks > 1)*/) {
+ warning("No support for a Type %d MIDI with %d tracks", (int)midiType, (int)_numTracks);
return false;
}
_ppqn = pos[4] << 8 | pos[5];
@@ -183,8 +183,8 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
// Older GMD/MUS file with no header info.
// Assume 1 track, 192 PPQN, and no MTrk headers.
isGMF = true;
- midi_type = 0;
- _num_tracks = 1;
+ midiType = 0;
+ _numTracks = 1;
_ppqn = 192;
pos += 7; // 'GMD\x1' + 3 bytes of useless (translate: unknown) information
} else {
@@ -193,14 +193,14 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
}
// Now we identify and store the location for each track.
- if (_num_tracks > ARRAYSIZE(_tracks)) {
- warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_num_tracks);
+ if (_numTracks > ARRAYSIZE(_tracks)) {
+ warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_numTracks);
return false;
}
- total_size = 0;
- int tracks_read = 0;
- while (tracks_read < _num_tracks) {
+ totalSize = 0;
+ int tracksRead = 0;
+ while (tracksRead < _numTracks) {
if (memcmp(pos, "MTrk", 4) && !isGMF) {
warning("Position: %p ('%c')", pos, *pos);
warning("Hit invalid block '%c%c%c%c' while scanning for track locations", pos[0], pos[1], pos[2], pos[3]);
@@ -208,11 +208,11 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
}
// If needed, skip the MTrk and length bytes
- _tracks[tracks_read] = pos + (isGMF ? 0 : 8);
+ _tracks[tracksRead] = pos + (isGMF ? 0 : 8);
if (!isGMF) {
pos += 4;
len = read4high(pos);
- total_size += len;
+ totalSize += len;
pos += len;
} else {
// An SMF End of Track meta event must be placed
@@ -222,7 +222,7 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
data[size++] = 0x00;
data[size++] = 0x00;
}
- ++tracks_read;
+ ++tracksRead;
}
// If this is a Type 1 MIDI, we need to now compress
@@ -230,13 +230,13 @@ bool MidiParser_SMF::loadMusic(byte *data, uint32 size) {
free(_buffer);
_buffer = 0;
- if (midi_type == 1) {
+ if (midiType == 1) {
// FIXME: Doubled the buffer size to prevent crashes with the
// Inherit the Earth MIDIs. Jamieson630 said something about a
// better fix, but this will have to do in the meantime.
_buffer = (byte *)malloc(size * 2);
compressToType0();
- _num_tracks = 1;
+ _numTracks = 1;
_tracks[0] = _buffer;
}
@@ -253,48 +253,48 @@ void MidiParser_SMF::compressToType0() {
// We assume that _buffer has been allocated
// to sufficient size for this operation.
- // using 0xFF since it could write track_pos[0 to _num_tracks] here
+ // using 0xFF since it could write trackPos[0 to _numTracks] here
// this would cause some illegal writes and could lead to segfaults
// (it crashed for some midis for me, they're not used in any game
// scummvm supports though). *Maybe* handle this in another way,
// it's at the moment only to be sure, that nothing goes wrong.
- byte *track_pos[0xFF];
- byte running_status[0xFF];
- uint32 track_timer[0xFF];
+ byte *trackPos[0xFF];
+ byte runningStatus[0xFF];
+ uint32 trackTimer[0xFF];
uint32 delta;
int i;
- for (i = 0; i < _num_tracks; ++i) {
- running_status[i] = 0;
- track_pos[i] = _tracks[i];
- track_timer[i] = readVLQ(track_pos[i]);
- running_status[i] = 0;
+ for (i = 0; i < _numTracks; ++i) {
+ runningStatus[i] = 0;
+ trackPos[i] = _tracks[i];
+ trackTimer[i] = readVLQ(trackPos[i]);
+ runningStatus[i] = 0;
}
- int best_i;
+ int bestTrack;
uint32 length;
byte *output = _buffer;
byte *pos, *pos2;
byte event;
- uint32 copy_bytes;
+ uint32 copyBytes;
bool write;
- byte active_tracks = (byte)_num_tracks;
+ byte activeTracks = (byte)_numTracks;
- while (active_tracks) {
+ while (activeTracks) {
write = true;
- best_i = 255;
- for (i = 0; i < _num_tracks; ++i) {
- if (track_pos[i] && (best_i == 255 || track_timer[i] < track_timer[best_i]))
- best_i = i;
+ bestTrack = 255;
+ for (i = 0; i < _numTracks; ++i) {
+ if (trackPos[i] && (bestTrack == 255 || trackTimer[i] < trackTimer[bestTrack]))
+ bestTrack = i;
}
- if (best_i == 255) {
+ if (bestTrack == 255) {
warning("Premature end of tracks");
break;
}
// Initial VLQ delta computation
delta = 0;
- length = track_timer[best_i];
+ length = trackTimer[bestTrack];
for (i = 0; length; ++i) {
delta = (delta << 8) | (length & 0x7F) | (i ? 0x80 : 0);
length >>= 7;
@@ -302,55 +302,55 @@ void MidiParser_SMF::compressToType0() {
// Process MIDI event.
bool implicitEvent = false;
- copy_bytes = 0;
- pos = track_pos[best_i];
+ copyBytes = 0;
+ pos = trackPos[bestTrack];
do {
event = *(pos++);
if (event < 0x80) {
- event = running_status[best_i];
+ event = runningStatus[bestTrack];
implicitEvent = true;
}
} while (_malformedPitchBends && (event & 0xF0) == 0xE0 && pos++);
- running_status[best_i] = event;
+ runningStatus[bestTrack] = event;
- if (command_lengths[(event >> 4) - 8] > 0) {
- copy_bytes = command_lengths[(event >> 4) - 8];
- } else if (special_lengths[(event & 0x0F)] > 0) {
- copy_bytes = special_lengths[(event & 0x0F)];
+ if (commandLengths[(event >> 4) - 8] > 0) {
+ copyBytes = commandLengths[(event >> 4) - 8];
+ } else if (specialLengths[(event & 0x0F)] > 0) {
+ copyBytes = specialLengths[(event & 0x0F)];
} else if (event == 0xF0) {
// SysEx
pos2 = pos;
length = readVLQ(pos);
- copy_bytes = 1 + (pos - pos2) + length;
+ copyBytes = 1 + (pos - pos2) + length;
} else if (event == 0xFF) {
// META
event = *(pos++);
- if (event == 0x2F && active_tracks > 1) {
- track_pos[best_i] = 0;
+ if (event == 0x2F && activeTracks > 1) {
+ trackPos[bestTrack] = 0;
write = false;
} else {
pos2 = pos;
length = readVLQ(pos);
- copy_bytes = 2 + (pos - pos2) + length;
+ copyBytes = 2 + (pos - pos2) + length;
}
if (event == 0x2F)
- --active_tracks;
+ --activeTracks;
} else {
warning("Bad MIDI command %02X", (int)event);
- track_pos[best_i] = 0;
+ trackPos[bestTrack] = 0;
}
// Update all tracks' deltas
if (write) {
- for (i = 0; i < _num_tracks; ++i) {
- if (track_pos[i] && i != best_i)
- track_timer[i] -= track_timer[best_i];
+ for (i = 0; i < _numTracks; ++i) {
+ if (trackPos[i] && i != bestTrack)
+ trackTimer[i] -= trackTimer[bestTrack];
}
}
- if (track_pos[best_i]) {
+ if (trackPos[bestTrack]) {
if (write) {
- track_timer[best_i] = 0;
+ trackTimer[bestTrack] = 0;
// Write VLQ delta
while (delta & 0x80) {
@@ -361,17 +361,17 @@ void MidiParser_SMF::compressToType0() {
// Write MIDI data
if (!implicitEvent)
- ++track_pos[best_i];
- --copy_bytes;
- *output++ = running_status[best_i];
- memcpy(output, track_pos[best_i], copy_bytes);
- output += copy_bytes;
+ ++trackPos[bestTrack];
+ --copyBytes;
+ *output++ = runningStatus[bestTrack];
+ memcpy(output, trackPos[bestTrack], copyBytes);
+ output += copyBytes;
}
// Fetch new VLQ delta for winning track
- track_pos[best_i] += copy_bytes;
- if (active_tracks)
- track_timer[best_i] += readVLQ(track_pos[best_i]);
+ trackPos[bestTrack] += copyBytes;
+ if (activeTracks)
+ trackTimer[bestTrack] += readVLQ(trackPos[bestTrack]);
}
}
diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp
index 85491faaf8..11690b0214 100644
--- a/audio/midiparser_xmidi.cpp
+++ b/audio/midiparser_xmidi.cpp
@@ -32,9 +32,6 @@
*/
class MidiParser_XMIDI : public MidiParser {
protected:
- NoteTimer _notes_cache[32];
- uint32 _inserted_delta; // Track simulated deltas for note-off events
-
struct Loop {
byte *pos;
byte repeat;
@@ -48,11 +45,10 @@ protected:
protected:
uint32 readVLQ2(byte * &data);
- void resetTracking();
void parseNextEvent(EventInfo &info);
public:
- MidiParser_XMIDI(XMidiCallbackProc proc, void *data) : _inserted_delta(0), _callbackProc(proc), _callbackData(data) {}
+ MidiParser_XMIDI(XMidiCallbackProc proc, void *data) : _callbackProc(proc), _callbackData(data) {}
~MidiParser_XMIDI() { }
bool loadMusic(byte *data, uint32 size);
@@ -69,17 +65,16 @@ uint32 MidiParser_XMIDI::readVLQ2(byte * &pos) {
}
void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
- info.delta = readVLQ2(_position._play_pos) - _inserted_delta;
+ info.start = _position._playPos;
+ info.delta = readVLQ2(_position._playPos);
// Process the next event.
- _inserted_delta = 0;
- info.event = *(_position._play_pos++);
+ info.event = *(_position._playPos++);
switch (info.event >> 4) {
case 0x9: // Note On
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
+ info.length = readVLQ(_position._playPos);
if (info.basic.param2 == 0) {
info.event = info.channel() | 0x80;
info.length = 0;
@@ -88,20 +83,20 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
case 0xC:
case 0xD:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
case 0x8:
case 0xA:
case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
break;
case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
// This isn't a full XMIDI implementation, but it should
// hopefully be "good enough" for most things.
@@ -109,7 +104,7 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
switch (info.basic.param1) {
// Simplified XMIDI looping.
case 0x74: { // XMIDI_CONTROLLER_FOR_LOOP
- byte *pos = _position._play_pos;
+ byte *pos = _position._playPos;
if (_loopCount < ARRAYSIZE(_loop) - 1)
_loopCount++;
else
@@ -131,9 +126,9 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
if (--_loop[_loopCount].repeat == 0)
_loopCount--;
else
- _position._play_pos = _loop[_loopCount].pos;
+ _position._playPos = _loop[_loopCount].pos;
} else {
- _position._play_pos = _loop[_loopCount].pos;
+ _position._playPos = _loop[_loopCount].pos;
}
}
}
@@ -169,12 +164,12 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
case 0xF: // Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
break;
case 0x3: // Song Select
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
@@ -188,16 +183,16 @@ void MidiParser_XMIDI::parseNextEvent(EventInfo &info) {
break;
case 0x0: // SysEx
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
break;
case 0xF: // META event
- info.ext.type = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.ext.type = *(_position._playPos++);
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
if (info.ext.type == 0x51 && info.length == 3) {
// Tempo event. We want to make these constant 500,000.
info.ext.data[0] = 0x07;
@@ -216,7 +211,7 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
uint32 i = 0;
byte *start;
uint32 len;
- uint32 chunk_len;
+ uint32 chunkLen;
char buf[32];
_loopCount = -1;
@@ -235,7 +230,7 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
if (!memcmp(pos, "XMID", 4)) {
warning("XMIDI doesn't have XDIR");
pos += 4;
- _num_tracks = 1;
+ _numTracks = 1;
} else if (memcmp(pos, "XDIR", 4)) {
// Not an XMIDI that we recognize
warning("Expected 'XDIR' but found '%c%c%c%c'", pos[0], pos[1], pos[2], pos[3]);
@@ -243,7 +238,7 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
} else {
// Seems Valid
pos += 4;
- _num_tracks = 0;
+ _numTracks = 0;
for (i = 4; i < len; i++) {
// Read 4 bytes of type
@@ -251,34 +246,34 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
pos += 4;
// Read length of chunk
- chunk_len = read4high(pos);
+ chunkLen = read4high(pos);
// Add eight bytes
i += 8;
if (memcmp(buf, "INFO", 4) == 0) {
// Must be at least 2 bytes long
- if (chunk_len < 2) {
- warning("Invalid chunk length %d for 'INFO' block", (int)chunk_len);
+ if (chunkLen < 2) {
+ warning("Invalid chunk length %d for 'INFO' block", (int)chunkLen);
return false;
}
- _num_tracks = (byte)read2low(pos);
+ _numTracks = (byte)read2low(pos);
- if (chunk_len > 2) {
- warning("Chunk length %d is greater than 2", (int)chunk_len);
- //pos += chunk_len - 2;
+ if (chunkLen > 2) {
+ warning("Chunk length %d is greater than 2", (int)chunkLen);
+ //pos += chunkLen - 2;
}
break;
}
// Must align
- pos += (chunk_len + 1) & ~1;
- i += (chunk_len + 1) & ~1;
+ pos += (chunkLen + 1) & ~1;
+ i += (chunkLen + 1) & ~1;
}
// Didn't get to fill the header
- if (_num_tracks == 0) {
+ if (_numTracks == 0) {
warning("Didn't find a valid track count");
return false;
}
@@ -308,13 +303,13 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
// Ok it's an XMIDI.
// We're going to identify and store the location for each track.
- if (_num_tracks > ARRAYSIZE(_tracks)) {
- warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_num_tracks);
+ if (_numTracks > ARRAYSIZE(_tracks)) {
+ warning("Can only handle %d tracks but was handed %d", (int)ARRAYSIZE(_tracks), (int)_numTracks);
return false;
}
- int tracks_read = 0;
- while (tracks_read < _num_tracks) {
+ int tracksRead = 0;
+ while (tracksRead < _numTracks) {
if (!memcmp(pos, "FORM", 4)) {
// Skip this plus the 4 bytes after it.
pos += 8;
@@ -330,11 +325,11 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
pos += (len + 1) & ~1;
} else if (!memcmp(pos, "EVNT", 4)) {
// Ahh! What we're looking for at last.
- _tracks[tracks_read] = pos + 8; // Skip the EVNT and length bytes
+ _tracks[tracksRead] = pos + 8; // Skip the EVNT and length bytes
pos += 4;
len = read4high(pos);
pos += (len + 1) & ~1;
- ++tracks_read;
+ ++tracksRead;
} else {
warning("Hit invalid block '%c%c%c%c' while scanning for track locations", pos[0], pos[1], pos[2], pos[3]);
return false;
@@ -349,7 +344,6 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
_ppqn = 60;
resetTracking();
setTempo(500000);
- _inserted_delta = 0;
setTrack(0);
return true;
}
@@ -357,11 +351,6 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
return false;
}
-void MidiParser_XMIDI::resetTracking() {
- MidiParser::resetTracking();
- _inserted_delta = 0;
-}
-
void MidiParser::defaultXMidiCallback(byte eventData, void *data) {
warning("MidiParser: defaultXMidiCallback(%d)", eventData);
}
diff --git a/audio/softsynth/mt32/TVA.cpp b/audio/softsynth/mt32/TVA.cpp
index c3be6db591..f3e3f7bbc7 100644
--- a/audio/softsynth/mt32/TVA.cpp
+++ b/audio/softsynth/mt32/TVA.cpp
@@ -274,7 +274,7 @@ void TVA::nextPhase() {
}
int newTarget;
- int newIncrement;
+ int newIncrement = 0;
int envPointIndex = phase;
if (!allLevelsZeroFromNowOn) {
diff --git a/backends/platform/maemo/debian/rules b/backends/platform/maemo/debian/rules
index 43a34399a3..c713403876 100755
--- a/backends/platform/maemo/debian/rules
+++ b/backends/platform/maemo/debian/rules
@@ -47,7 +47,7 @@ install: build
install -m0644 gui/themes/scummclassic.zip gui/themes/scummmodern.zip debian/scummvm/opt/scummvm/share
install -m0644 backends/vkeybd/packs/vkeybd_default.zip debian/scummvm/opt/scummvm/share
# for optified version we can also add engine datafiles
- install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share
+ install -m0644 dists/engine-data/drascula.dat dists/engine-data/hugo.dat dists/engine-data/kyra.dat dists/engine-data/lure.dat dists/engine-data/queen.tbl dists/engine-data/sky.cpt dists/engine-data/teenagent.dat dists/engine-data/tony.dat dists/engine-data/toon.dat debian/scummvm/opt/scummvm/share
install -m0644 -d debian/scummvm/usr/share/doc/scummvm
install -m0644 AUTHORS COPYING COPYING.BSD COPYING.FREEFONT COPYING.LGPL COPYRIGHT NEWS README debian/scummvm/usr/share/doc/scummvm
diff --git a/devtools/create_project/config.h b/devtools/create_project/config.h
index 20c1391cef..de4703a47d 100644
--- a/devtools/create_project/config.h
+++ b/devtools/create_project/config.h
@@ -28,7 +28,10 @@
#define LIBS_DEFINE "SCUMMVM_LIBS" // Name of the include environment variable
#define REVISION_DEFINE "SCUMMVM_INTERNAL_REVISION"
-//#define ADDITIONAL_LIBRARY ""
-#define NEEDS_RTTI 0
+#define ENABLE_LANGUAGE_EXTENSIONS "" // Comma separated list of projects that need language extensions
+#define DISABLE_EDIT_AND_CONTINUE "tinsel,tony" // Comma separated list of projects that need Edit&Continue to be disabled for co-routine support (the main project is automatically added)
+
+//#define ADDITIONAL_LIBRARY "" // Add a single library to the list of externally linked libraries
+#define NEEDS_RTTI 0 // Enable RTTI globally
#endif // TOOLS_CREATE_PROJECT_CONFIG_H
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 8499fec400..a8e09ff5eb 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -97,30 +97,6 @@ struct FSNode {
};
typedef std::list<FSNode> FileList;
-
-typedef StringList TokenList;
-
-/**
- * Takes a given input line and creates a list of tokens out of it.
- *
- * A token in this context is separated by whitespaces. A special case
- * are quotation marks though. A string inside quotation marks is treated
- * as single token, even when it contains whitespaces.
- *
- * Thus for example the input:
- * foo bar "1 2 3 4" ScummVM
- * will create a list with the following entries:
- * "foo", "bar", "1 2 3 4", "ScummVM"
- * As you can see the quotation marks will get *removed* too.
- *
- * You can also use this with non-whitespace by passing another separator
- * character (e.g. ',').
- *
- * @param input The text to be tokenized.
- * @param separator The token separator.
- * @return A list of tokens.
- */
-TokenList tokenize(const std::string &input, char separator = ' ');
} // End of anonymous namespace
enum ProjectType {
@@ -526,7 +502,7 @@ int main(int argc, char *argv[]) {
projectWarnings["agos"].push_back("4511");
projectWarnings["dreamweb"].push_back("4355");
-
+
projectWarnings["lure"].push_back("4189");
projectWarnings["lure"].push_back("4355");
@@ -787,6 +763,7 @@ bool parseEngine(const std::string &line, EngineDesc &engine) {
return true;
}
+} // End of anonymous namespace
TokenList tokenize(const std::string &input, char separator) {
TokenList result;
@@ -819,7 +796,6 @@ TokenList tokenize(const std::string &input, char separator) {
return result;
}
-} // End of anonymous namespace
namespace {
const Feature s_features[] = {
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index b4eda8f8d2..de77793ee7 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -31,6 +31,30 @@
typedef std::list<std::string> StringList;
+typedef StringList TokenList;
+
+/**
+ * Takes a given input line and creates a list of tokens out of it.
+ *
+ * A token in this context is separated by whitespaces. A special case
+ * are quotation marks though. A string inside quotation marks is treated
+ * as single token, even when it contains whitespaces.
+ *
+ * Thus for example the input:
+ * foo bar "1 2 3 4" ScummVM
+ * will create a list with the following entries:
+ * "foo", "bar", "1 2 3 4", "ScummVM"
+ * As you can see the quotation marks will get *removed* too.
+ *
+ * You can also use this with non-whitespace by passing another separator
+ * character (e.g. ',').
+ *
+ * @param input The text to be tokenized.
+ * @param separator The token separator.
+ * @return A list of tokens.
+ */
+TokenList tokenize(const std::string &input, char separator = ' ');
+
/**
* Structure to describe a game engine to be built into ScummVM.
*
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index c797770955..0f77d91852 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -241,9 +241,11 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
// Check for project-specific warnings:
std::map<std::string, StringList>::iterator warningsIterator = _projectWarnings.find(name);
+ bool enableLanguageExtensions = find(_enableLanguageExtensions.begin(), _enableLanguageExtensions.end(), name) != _enableLanguageExtensions.end();
+ bool disableEditAndContinue = find(_disableEditAndContinue.begin(), _disableEditAndContinue.end(), name) != _disableEditAndContinue.end();
// Nothing to add here, move along!
- if (!setup.devTools && name != setup.projectName && name != "sword25" && name != "scummvm" && name != "grim" && warningsIterator == _projectWarnings.end())
+ if (!setup.devTools && name != setup.projectName && !enableLanguageExtensions && !disableEditAndContinue && warningsIterator == _projectWarnings.end())
return;
std::string warnings = "";
@@ -254,16 +256,17 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
project << "\t<ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='" << configuration << "|" << (isWin32 ? "Win32" : "x64") << "'\">\n"
"\t\t<ClCompile>\n";
- // Compile configuration
- if (setup.devTools || name == setup.projectName || name == "sword25" || name == "grim") {
+ // Language Extensions
+ if (setup.devTools || name == setup.projectName || enableLanguageExtensions)
project << "\t\t\t<DisableLanguageExtensions>false</DisableLanguageExtensions>\n";
- if (name == setup.projectName && !isRelease)
- project << "\t\t\t<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n";
- } else {
- if (warningsIterator != _projectWarnings.end())
- project << "\t\t\t<DisableSpecificWarnings>" << warnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n";
- }
+ // Edit and Continue
+ if ((name == setup.projectName || disableEditAndContinue) && !isRelease)
+ project << "\t\t\t<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n";
+
+ // Warnings
+ if (warningsIterator != _projectWarnings.end())
+ project << "\t\t\t<DisableSpecificWarnings>" << warnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n";
project << "\t\t</ClCompile>\n";
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 96eaf643d1..b8d2401af9 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -33,6 +33,9 @@ namespace CreateProjectTool {
//////////////////////////////////////////////////////////////////////////
MSVCProvider::MSVCProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version)
: ProjectProvider(global_warnings, project_warnings, version) {
+
+ _enableLanguageExtensions = tokenize(ENABLE_LANGUAGE_EXTENSIONS, ',');
+ _disableEditAndContinue = tokenize(DISABLE_EDIT_AND_CONTINUE, ',');
}
void MSVCProvider::createWorkspace(const BuildSetup &setup) {
@@ -75,10 +78,10 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
solution << "Global\n"
"\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n"
"\t\tDebug|Win32 = Debug|Win32\n"
- "\t\tAnalysis|Win32 = Analysis|Win32\n"
+ "\t\tAnalysis|Win32 = Analysis|Win32\n"
"\t\tRelease|Win32 = Release|Win32\n"
"\t\tDebug|x64 = Debug|x64\n"
- "\t\tAnalysis|x64 = Analysis|x64\n"
+ "\t\tAnalysis|x64 = Analysis|x64\n"
"\t\tRelease|x64 = Release|x64\n"
"\tEndGlobalSection\n"
"\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n";
@@ -86,14 +89,14 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
solution << "\t\t{" << i->second << "}.Debug|Win32.ActiveCfg = Debug|Win32\n"
"\t\t{" << i->second << "}.Debug|Win32.Build.0 = Debug|Win32\n"
- "\t\t{" << i->second << "}.Analysis|Win32.ActiveCfg = Analysis|Win32\n"
- "\t\t{" << i->second << "}.Analysis|Win32.Build.0 = Analysis|Win32\n"
+ "\t\t{" << i->second << "}.Analysis|Win32.ActiveCfg = Analysis|Win32\n"
+ "\t\t{" << i->second << "}.Analysis|Win32.Build.0 = Analysis|Win32\n"
"\t\t{" << i->second << "}.Release|Win32.ActiveCfg = Release|Win32\n"
"\t\t{" << i->second << "}.Release|Win32.Build.0 = Release|Win32\n"
"\t\t{" << i->second << "}.Debug|x64.ActiveCfg = Debug|x64\n"
"\t\t{" << i->second << "}.Debug|x64.Build.0 = Debug|x64\n"
- "\t\t{" << i->second << "}.Analysis|x64.ActiveCfg = Analysis|x64\n"
- "\t\t{" << i->second << "}.Analysis|x64.Build.0 = Analysis|x64\n"
+ "\t\t{" << i->second << "}.Analysis|x64.ActiveCfg = Analysis|x64\n"
+ "\t\t{" << i->second << "}.Analysis|x64.Build.0 = Analysis|x64\n"
"\t\t{" << i->second << "}.Release|x64.ActiveCfg = Release|x64\n"
"\t\t{" << i->second << "}.Release|x64.Build.0 = Release|x64\n";
}
@@ -139,7 +142,7 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
StringList x64EngineDefines = getEngineDefines(setup.engines);
x64Defines.splice(x64Defines.end(), x64EngineDefines);
- // HACK: This definitly should not be here, but otherwise we would not define SDL_BACKEND for x64.
+ // HACK: This definitely should not be here, but otherwise we would not define SDL_BACKEND for x64.
x64Defines.push_back("WIN32");
x64Defines.push_back("SDL_BACKEND");
@@ -168,7 +171,7 @@ std::string MSVCProvider::getPostBuildEvent(bool isWin32, bool createInstaller)
cmdLine += (isWin32) ? "x86" : "x64";
- cmdLine += " %SCUMMVM_LIBS% ";
+ cmdLine += " %" LIBS_DEFINE "% ";
// Specify if installer needs to be built or not
cmdLine += (createInstaller ? "1" : "0");
diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h
index 0a994667fa..5a854b596a 100644
--- a/devtools/create_project/msvc.h
+++ b/devtools/create_project/msvc.h
@@ -32,6 +32,8 @@ public:
MSVCProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version);
protected:
+ StringList _enableLanguageExtensions;
+ StringList _disableEditAndContinue;
void createWorkspace(const BuildSetup &setup);
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index d78119d058..8b70ec3dd8 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -24,8 +24,10 @@ echo Copying data files
echo.
xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2" 1>NUL 2>&1
-xcopy /F /Y "%~4/lib/%~3/freetype6.dll" "%~2" 1>NUL 2>&1
+xcopy /F /Y "%~4/lib/%~3/freetype6.dll" "%~2" 1>NUL 2>&1
xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" "%~2" 1>NUL 2>&1
+xcopy /F /Y "%~1/gui/themes/translations.dat" "%~2" 1>NUL 2>&1
+
if "%~5"=="0" goto done
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index c301e78ad1..de2df96d78 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -103,6 +103,9 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
outputConfiguration(project, setup, libraries, "Release", "x64", "64", false);
} else {
+ bool enableLanguageExtensions = find(_enableLanguageExtensions.begin(), _enableLanguageExtensions.end(), name) != _enableLanguageExtensions.end();
+ bool disableEditAndContinue = find(_disableEditAndContinue.begin(), _disableEditAndContinue.end(), name) != _disableEditAndContinue.end();
+
std::string warnings = "";
if (warningsIterator != _projectWarnings.end())
for (StringList::const_iterator i = warningsIterator->second.begin(); i != warningsIterator->second.end(); ++i)
@@ -110,9 +113,8 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
std::string toolConfig;
toolConfig = (!warnings.empty() ? "DisableSpecificWarnings=\"" + warnings + "\"" : "");
- toolConfig += (name == setup.projectName ? "DebugInformationFormat=\"3\" " : "");
- toolConfig += (name == "sword25" ? "DisableLanguageExtensions=\"false\" " : "");
- toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : "");
+ toolConfig += (disableEditAndContinue ? "DebugInformationFormat=\"3\" " : "");
+ toolConfig += (enableLanguageExtensions ? "DisableLanguageExtensions=\"false\" " : "");
// Win32
outputConfiguration(setup, project, toolConfig, "Debug", "Win32", "");
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 7ce17a9df6..f7efa59d2f 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -48,7 +48,7 @@ if ($mode eq "") {
$Text::Wrap::unexpand = 0;
if ($mode eq "TEXT") {
$Text::Wrap::columns = 78;
- $max_name_width = 21; # The maximal width of a name.
+ $max_name_width = 23; # The maximal width of a name.
} elsif ($mode eq "CPP") {
$Text::Wrap::columns = 48; # Approx.
}
@@ -359,6 +359,9 @@ sub add_person {
my $min_name_width = length $desc > 0 ? $max_name_width : 0;
$name = $nick if $name eq "";
$name = html_entities_to_ascii($name);
+ if (length $name > $max_name_width) {
+ print STDERR "Warning: max_name_width is too small (" . $max_name_width . " < " . (length $name) . " for \"" . $name. "\")\n";
+ }
$desc = html_entities_to_ascii($desc);
$tab = " " x ($section_level * 2 + 1);
@@ -697,6 +700,10 @@ begin_credits("Credits");
add_person("Gregory Montoir", "cyx", "(retired)");
end_section();
+ begin_section("Wintermute");
+ add_person("Einar Johan T. S&oslash;m&aring;en", "somaen", "");
+ end_section();
+
end_section();
@@ -1067,7 +1074,7 @@ begin_credits("Credits");
# HACK!
- $max_name_width = 16;
+ $max_name_width = 17;
begin_section("Special thanks to");
begin_persons();
@@ -1080,6 +1087,7 @@ begin_credits("Credits");
add_person("Ivan Dubrov", "", "For contributing the initial version of the Gobliiins engine");
add_person("Henrik Engqvist", "qvist", "For generously providing hosting for our buildbot, SVN repository, planet and doxygen sites as well as tons of HD space");
add_person("DOSBox Team", "", "For their awesome OPL2 and OPL3 emulator");
+ add_person("Yusuke Kamiyamane", "", "For contributing some GUI icons ");
add_person("Till Kresslein", "Krest", "For design of modern ScummVM GUI");
add_person("", "Jezar", "For his freeverb filter implementation");
add_person("Jim Leiterman", "", "Various info on his FM-TOWNS/Marty SCUMM ports");
@@ -1090,8 +1098,6 @@ begin_credits("Credits");
add_person("James Woodcock", "", "Soundtrack enhancements");
end_persons();
- add_paragraph("Some icons by Yusuke Kamiyamane");
-
add_paragraph(
"Tony Warriner and everyone at Revolution Software Ltd. for sharing ".
"with us the source of some of their brilliant games, allowing us to ".
@@ -1141,7 +1147,11 @@ begin_credits("Credits");
add_paragraph(
"Janusz Wi&#347;niewski and Miroslaw Liminowicz from Laboratorium Komputerowe Avalon ".
- "for providing full source code for So&#322;tys and letting us to redistribute the game.");
+ "for providing full source code for So&#322;tys and letting us redistribute the game.");
+
+ add_paragraph(
+ "Jan Nedoma for providing the sources to the Wintermute-engine, and for his ".
+ "support while porting the engine to ScummVM.");
end_section();
diff --git a/dists/scummvm.rc b/dists/scummvm.rc
index 4a67100f9f..8527c668c8 100644
--- a/dists/scummvm.rc
+++ b/dists/scummvm.rc
@@ -44,6 +44,9 @@ teenagent.dat FILE "dists/engine-data/teenagent.dat"
#if ENABLE_TOON == STATIC_PLUGIN
toon.dat FILE "dists/engine-data/toon.dat"
#endif
+#if ENABLE_TONY == STATIC_PLUGIN
+tony.dat FILE "dists/engine-data/tony.dat"
+#endif
#if ENABLE_AGI == STATIC_PLUGIN
pred.dic FILE "dists/pred.dic"
#endif
diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index 9ca87436fc..54f0e9e03b 100644
--- a/engines/agos/midiparser_s1d.cpp
+++ b/engines/agos/midiparser_s1d.cpp
@@ -35,7 +35,7 @@ namespace AGOS {
class MidiParser_S1D : public MidiParser {
private:
byte *_data;
- bool _no_delta;
+ bool _noDelta;
struct Loop {
uint16 timer;
@@ -49,7 +49,7 @@ protected:
void resetTracking();
public:
- MidiParser_S1D() : _data(0), _no_delta(false) {}
+ MidiParser_S1D() : _data(0), _noDelta(false) {}
bool loadMusic(byte *data, uint32 size);
};
@@ -75,14 +75,14 @@ void MidiParser_S1D::chainEvent(EventInfo &info) {
}
void MidiParser_S1D::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
+ info.start = _position._playPos;
info.length = 0;
- info.delta = _no_delta ? 0 : readVLQ2(_position._play_pos);
- _no_delta = false;
+ info.delta = _noDelta ? 0 : readVLQ2(_position._playPos);
+ _noDelta = false;
- info.event = *_position._play_pos++;
+ info.event = *_position._playPos++;
if (!(info.event & 0x80)) {
- _no_delta = true;
+ _noDelta = true;
info.event |= 0x80;
}
@@ -94,34 +94,34 @@ void MidiParser_S1D::parseNextEvent(EventInfo &info) {
} else {
switch (info.command()) {
case 0x8: // note off
- info.basic.param1 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
info.basic.param2 = 0;
break;
case 0x9: // note on
- info.basic.param1 = *_position._play_pos++;
- info.basic.param2 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
+ info.basic.param2 = *_position._playPos++;
break;
case 0xA: { // loop control
// In case the stop mode(?) is set to 0x80 this will stop the
// track over here.
- const int16 loopIterations = int8(*_position._play_pos++);
+ const int16 loopIterations = int8(*_position._playPos++);
if (!loopIterations) {
- _loops[info.channel()].start = _position._play_pos;
+ _loops[info.channel()].start = _position._playPos;
} else {
if (!_loops[info.channel()].timer) {
if (_loops[info.channel()].start) {
_loops[info.channel()].timer = uint16(loopIterations);
- _loops[info.channel()].end = _position._play_pos;
+ _loops[info.channel()].end = _position._playPos;
// Go to the start of the loop
- _position._play_pos = _loops[info.channel()].start;
+ _position._playPos = _loops[info.channel()].start;
}
} else {
if (_loops[info.channel()].timer)
- _position._play_pos = _loops[info.channel()].start;
+ _position._playPos = _loops[info.channel()].start;
--_loops[info.channel()].timer;
}
}
@@ -141,13 +141,13 @@ void MidiParser_S1D::parseNextEvent(EventInfo &info) {
break;
case 0xC: // program change
- info.basic.param1 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
info.basic.param2 = 0;
break;
case 0xD: // jump to loop end
if (_loops[info.channel()].end)
- _position._play_pos = _loops[info.channel()].end;
+ _position._playPos = _loops[info.channel()].end;
// We need to read the next midi event here. Since we can not
// safely pass this event to the MIDI event processing.
@@ -178,7 +178,7 @@ bool MidiParser_S1D::loadMusic(byte *data, uint32 size) {
pos += 1;
// And now we're at the actual data. Only one track.
- _num_tracks = 1;
+ _numTracks = 1;
_data = pos;
_tracks[0] = pos;
@@ -194,7 +194,7 @@ bool MidiParser_S1D::loadMusic(byte *data, uint32 size) {
void MidiParser_S1D::resetTracking() {
MidiParser::resetTracking();
// The first event never contains any delta.
- _no_delta = true;
+ _noDelta = true;
memset(_loops, 0, sizeof(_loops));
}
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 60168831a1..9b2103687d 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -202,13 +202,13 @@ AnimData::AnimData(const AnimData &src) : _width(src._width),
if (src._data) {
_data = new byte[_size];
assert(_data);
- memcpy(_data, src._data, _size*sizeof(byte));
+ memcpy(_data, src._data, _size * sizeof(byte));
}
if (src._mask) {
_mask = new byte[_size];
assert(_mask);
- memcpy(_mask, src._mask, _size*sizeof(byte));
+ memcpy(_mask, src._mask, _size * sizeof(byte));
}
memset(_name, 0, sizeof(_name));
@@ -272,8 +272,7 @@ byte AnimData::getColor(int x, int y) {
* @param transparent Transparent color (for ANIM_MASKSPRITE)
*/
void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file,
- int16 frame, const char *n, byte transparent) {
-
+ int16 frame, const char *n, byte transparent) {
assert(d);
if (_data) {
@@ -299,7 +298,7 @@ void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file,
_size = w * h;
_data = new byte[_size];
assert(_data);
- memcpy(_data, d, _size*sizeof(byte));
+ memcpy(_data, d, _size * sizeof(byte));
break;
case ANIM_MASK:
@@ -546,9 +545,10 @@ int loadSpl(const char *resourceName, int16 idx) {
* Load 1bpp mask
* @param resourceName Mask filename
* @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded mask (-1 if error)
*/
-int loadMsk(const char *resourceName, int16 idx) {
+int loadMsk(const char *resourceName, int16 idx, int16 frameIndex) {
int16 foundFileIdx = findFileInBundle(resourceName);
if (foundFileIdx < 0) {
return -1;
@@ -563,9 +563,18 @@ int loadMsk(const char *resourceName, int16 idx) {
loadAnimHeader(animHeader, readS);
ptr = dataPtr + 0x16;
+ int16 startFrame = 0;
+ int16 endFrame = animHeader.numFrames;
+
+ if (frameIndex >= 0) {
+ startFrame = frameIndex;
+ endFrame = frameIndex + 1;
+ ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+ }
+
entry = idx < 0 ? emptyAnimSpace() : idx;
assert(entry >= 0);
- for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+ for (int16 i = startFrame; i < endFrame; i++, entry++) {
g_cine->_animDataTable[entry].load(ptr, ANIM_MASK, animHeader.frameWidth, animHeader.frameHeight, foundFileIdx, i, currentPartName);
ptr += animHeader.frameWidth * animHeader.frameHeight;
}
@@ -578,9 +587,10 @@ int loadMsk(const char *resourceName, int16 idx) {
* Load animation
* @param resourceName Animation filename
* @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded animation (-1 if error)
*/
-int loadAni(const char *resourceName, int16 idx) {
+int loadAni(const char *resourceName, int16 idx, int16 frameIndex) {
int16 foundFileIdx = findFileInBundle(resourceName);
if (foundFileIdx < 0) {
return -1;
@@ -596,6 +606,15 @@ int loadAni(const char *resourceName, int16 idx) {
loadAnimHeader(animHeader, readS);
ptr = dataPtr + 0x16;
+ int16 startFrame = 0;
+ int16 endFrame = animHeader.numFrames;
+
+ if (frameIndex >= 0) {
+ startFrame = frameIndex;
+ endFrame = frameIndex + 1;
+ ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+ }
+
transparentColor = getAnimTransparentColor(resourceName);
// TODO: Merge this special case hack into getAnimTransparentColor somehow.
@@ -609,7 +628,7 @@ int loadAni(const char *resourceName, int16 idx) {
entry = idx < 0 ? emptyAnimSpace() : idx;
assert(entry >= 0);
- for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+ for (int16 i = startFrame; i < endFrame; i++, entry++) {
// special case transparency handling
if (!strcmp(resourceName, "L2202.ANI")) {
transparentColor = i < 2 ? 0 : 7;
@@ -669,13 +688,13 @@ void convert8BBP2(byte *dest, byte *source, int16 width, int16 height) {
*(source + k) <<= 1;
if (k > 0 + m)
color <<= 1;
- } // end k
+ } // end k
*(dest++) = color;
- } // end i
- } // end m
+ } // end i
+ } // end m
source += 0x10;
- } // end j
+ } // end j
}
/**
@@ -685,7 +704,7 @@ void convert8BBP2(byte *dest, byte *source, int16 width, int16 height) {
* @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded image set (-1 if error)
*/
-int loadSet(const char *resourceName, int16 idx, int16 frameIndex =-1 ) {
+int loadSet(const char *resourceName, int16 idx, int16 frameIndex = -1) {
AnimHeader2Struct header2;
uint16 numSpriteInAnim;
int16 foundFileIdx = findFileInBundle(resourceName);
@@ -712,10 +731,9 @@ int loadSet(const char *resourceName, int16 idx, int16 frameIndex =-1 ) {
int16 startFrame = 0;
int16 endFrame = numSpriteInAnim;
- if(frameIndex>=0)
- {
+ if (frameIndex >= 0) {
startFrame = frameIndex;
- endFrame = frameIndex+1;
+ endFrame = frameIndex + 1;
ptr += 0x10 * frameIndex;
}
@@ -766,7 +784,7 @@ int loadSeq(const char *resourceName, int16 idx) {
byte *dataPtr = readBundleFile(foundFileIdx);
int entry = idx < 0 ? emptyAnimSpace() : idx;
- g_cine->_animDataTable[entry].load(dataPtr+0x16, ANIM_RAW, g_cine->_partBuffer[foundFileIdx].unpackedSize-0x16, 1, foundFileIdx, 0, currentPartName);
+ g_cine->_animDataTable[entry].load(dataPtr + 0x16, ANIM_RAW, g_cine->_partBuffer[foundFileIdx].unpackedSize - 0x16, 1, foundFileIdx, 0, currentPartName);
free(dataPtr);
return entry + 1;
}
@@ -783,11 +801,11 @@ int loadResource(const char *resourceName, int16 idx, int16 frameIndex) {
if (strstr(resourceName, ".SPL")) {
result = loadSpl(resourceName, idx);
} else if (strstr(resourceName, ".MSK")) {
- result = loadMsk(resourceName, idx);
+ result = loadMsk(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".ANI")) {
- result = loadAni(resourceName, idx);
+ result = loadAni(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".ANM")) {
- result = loadAni(resourceName, idx);
+ result = loadAni(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".SET")) {
result = loadSet(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".SEQ")) {
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index bbe2cd4896..aa7221f733 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -189,7 +189,18 @@ void CineEngine::initialize() {
g_cine->_messageTable.clear();
resetObjectTable();
- disableSystemMenu = 1;
+ if (getGameType() == Cine::GType_OS) {
+ disableSystemMenu = 1;
+ } else {
+ // WORKAROUND: We do not save this variable in FW's savegames.
+ // Initializing this to 1, like we do it in the OS case, will
+ // cause the menu disabled when loading from the launcher or
+ // command line.
+ // A proper fix here would be to save this variable in FW's saves.
+ // Since it seems these are unversioned so far, there would be need
+ // to properly add versioning to them first.
+ disableSystemMenu = 0;
+ }
var8 = 0;
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 55376dce29..47edf51c30 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -159,7 +159,7 @@ private:
bool _preLoad;
int _timerDelayMultiplier;
- public:
+public:
// TODO: These are pseudo-global vars
// They better belong to appropriate classes
Common::Array<AnimData> _animDataTable;
diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp
index 0a24b2408a..4af28592e7 100644
--- a/engines/cine/console.cpp
+++ b/engines/cine/console.cpp
@@ -28,7 +28,7 @@ namespace Cine {
bool labyrinthCheat;
CineConsole::CineConsole(CineEngine *vm) : GUI::Debugger(), _vm(vm) {
- DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat));
+ DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat));
labyrinthCheat = false;
}
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 7a988227f6..636c0cf8d9 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -113,7 +113,7 @@ FWRenderer::FWRenderer() : _background(NULL), _backupPal(), _cmd(""),
assert(_backBuffer);
memset(_backBuffer, 0, _screenSize);
- memset(_bgName, 0, sizeof (_bgName));
+ memset(_bgName, 0, sizeof(_bgName));
}
@@ -249,7 +249,7 @@ void FWRenderer::drawCommand() {
unsigned int i;
int x = 10, y = _cmdY;
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
drawPlainBox(x, y, 301, 11, 0);
drawBorder(x - 1, y - 1, 302, 12, 2);
@@ -307,7 +307,7 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color
i++;
line = fitLine(str + i, tw, words, cw);
- if ( str[i + line] != '\0' && str[i + line] != 0x7C && words) {
+ if (str[i + line] != '\0' && str[i + line] != 0x7C && words) {
space = (tw - cw) / words;
extraSpace = (tw - cw) % words;
} else {
@@ -471,6 +471,41 @@ int FWRenderer::drawChar(char character, int x, int y) {
return x;
}
+/**
+ * Clears the character glyph to black
+ * This function is called "undrawChar", because the original only applies
+ * this drawing after the original glyph has been drawn.
+ * Possible TODO: Find a better name.
+ * @param character Character to undraw
+ * @param x Character coordinate
+ * @param y Character coordinate
+ */
+int FWRenderer::undrawChar(char character, int x, int y) {
+ int width, idx;
+
+ if (character == ' ') {
+ x += 5;
+ } else if ((width = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterWidth)) {
+ idx = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterIdx;
+ const byte *sprite = g_cine->_textHandler.textTable[idx][FONT_DATA];
+ for (uint i = 0; i < FONT_HEIGHT; ++i) {
+ byte *dst = _backBuffer + (y + i) * 320 + x;
+ for (uint j = 0; j < FONT_WIDTH; ++j, ++dst) {
+ // The original does this based on whether bit 1 of the pixel
+ // is set. Since that's the only bit ever set in (FW) this
+ // check should be fine.
+ // TODO: Check how Operation Stealth Amiga works
+ if (*sprite++) {
+ *dst = 0;
+ }
+ }
+ }
+ x += width + 1;
+ }
+
+ return x;
+}
+
int FWRenderer::getStringWidth(const char *str) {
const char *p = str;
int width = 0;
@@ -969,20 +1004,29 @@ void SelectionMenu::drawMenu(FWRenderer &r, bool top) {
charX = x + 4;
if (i == _selection) {
+ int color;
+
if (isAmiga) {
- // The original Amiga version is using a different highlight color here,
- // but with our current code it is not possible to change the text color,
- // thus we can not use the Amiga's color, since otherwise the text
- // wouldn't be visible anymore.
- r.drawPlainBox(charX, lineY, _width - 8, FONT_HEIGHT, top ? r._messageBg/*2*/ : 18);
+ if (top) {
+ color = 2;
+ } else {
+ color = 18;
+ }
} else {
- r.drawPlainBox(charX, lineY, _width - 8, 9, 0);
+ color = 0;
}
+
+ r.drawPlainBox(x + 2, lineY - 1, _width - 3, 9, color);
}
const int size = _elements[i].size();
- for (int j = 0; j < size; ++j)
- charX = r.drawChar(_elements[i][j], charX, lineY);
+ for (int j = 0; j < size; ++j) {
+ if (isAmiga && i == _selection) {
+ charX = r.undrawChar(_elements[i][j], charX, lineY);
+ } else {
+ charX = r.drawChar(_elements[i][j], charX, lineY);
+ }
+ }
}
}
@@ -1244,6 +1288,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
drawSprite(&(*it), sprite->data(), sprite->_realWidth, sprite->_height, _backBuffer, g_cine->_objectTable[it->objIdx].x, g_cine->_objectTable[it->objIdx].y, g_cine->_objectTable[it->objIdx].part, sprite->_bpp);
break;
+
// game message
case 2:
if (it->objIdx >= g_cine->_messageTable.size()) {
@@ -1300,7 +1345,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
height = obj->costume;
drawPlainBox(obj->x, obj->y, width, height, color);
debug(5, "renderOverlay: type=%d, x=%d, y=%d, width=%d, height=%d, color=%d",
- it->type, obj->x, obj->y, width, height, color);
+ it->type, obj->x, obj->y, width, height, color);
break;
// something else
@@ -1424,7 +1469,7 @@ void OSRenderer::selectBg(unsigned int idx) {
if (_bgTable[idx].bg) {
assert(_bgTable[idx].pal.isValid() && !(_bgTable[idx].pal.empty()));
- _currentBg = idx;
+ _currentBg = idx;
} else
warning("OSRenderer::selectBg(%d) - attempt to select null background", idx);
reloadPalette();
@@ -1750,23 +1795,23 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
// draw the mask based on next objects in the list
Common::List<overlay>::iterator it;
- for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it) {
- if(&(*it) == overlayPtr) {
+ for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it) {
+ if (&(*it) == overlayPtr) {
break;
}
}
- while(it != g_cine->_overlayList.end()) {
+ while (it != g_cine->_overlayList.end()) {
overlay *pCurrentOverlay = &(*it);
if ((pCurrentOverlay->type == 5) || ((pCurrentOverlay->type == 21) && (pCurrentOverlay->x == overlayPtr->objIdx))) {
AnimData *sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
if (pMask == NULL) {
- pMask = new byte[width*height];
+ pMask = new byte[width * height];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
- byte spriteColor= spritePtr[width * i + j];
+ byte spriteColor = spritePtr[width * i + j];
pMask[width * i + j] = spriteColor;
}
}
@@ -1777,7 +1822,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
int inMaskX = (g_cine->_objectTable[it->objIdx].x + i) - x;
int inMaskY = (g_cine->_objectTable[it->objIdx].y + j) - y;
- if (inMaskX >=0 && inMaskX < width) {
+ if (inMaskX >= 0 && inMaskX < width) {
if (inMaskY >= 0 && inMaskY < height) {
if (sprite->_bpp == 1) {
if (!sprite->getColor(i, j)) {
@@ -1793,7 +1838,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
}
// now, draw with the mask we created
- if(pMask) {
+ if (pMask) {
spritePtr = pMask;
}
@@ -1808,7 +1853,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
destPtr += i * 320;
for (int j = 0; j < width; j++) {
- byte color= *(spritePtr++);
+ byte color = *(spritePtr++);
if ((transparentColor != color) && x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200) {
*(destPtr++) = color;
} else {
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 3434cf9fc2..8b8843fd72 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -152,6 +152,7 @@ protected:
void drawBorder(int x, int y, int width, int height, byte color);
void drawDoubleBorder(int x, int y, int width, int height, byte color);
virtual int drawChar(char character, int x, int y);
+ virtual int undrawChar(char character, int x, int y);
void drawLine(int x, int y, int width, int height, byte color);
void remaskSprite(byte *mask, Common::List<overlay>::iterator it);
virtual void drawBackground();
@@ -287,7 +288,7 @@ byte gfxGetColor(int16 x, int16 y, const byte *ptr, int16 width);
void gfxResetRawPage(byte *pageRaw);
void gfxConvertSpriteToRaw(byte *dst, const byte *src, uint16 w, uint16 h);
-void gfxCopyRawPage(byte *source, byte * dest);
+void gfxCopyRawPage(byte *source, byte *dest);
void gfxFlipRawPage(byte *frontBuffer);
void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int16 height, byte *page, int16 x, int16 y);
void gfxDrawPlainBoxRaw(int16 x1, int16 y1, int16 x2, int16 y2, byte color, byte *page);
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index f13f38a45e..c3eb78edb5 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -180,19 +180,19 @@ static void processEvent(Common::Event &event) {
case Common::KEYCODE_F11:
renderer->showCollisionPage(false);
break;
- case Common::KEYCODE_KP5: // Emulated left mouse button click
- case Common::KEYCODE_LEFT: // Left
- case Common::KEYCODE_KP4: // Left
+ case Common::KEYCODE_KP5: // Emulated left mouse button click
+ case Common::KEYCODE_LEFT: // Left
+ case Common::KEYCODE_KP4: // Left
case Common::KEYCODE_RIGHT: // Right
- case Common::KEYCODE_KP6: // Right
- case Common::KEYCODE_UP: // Up
- case Common::KEYCODE_KP8: // Up
- case Common::KEYCODE_DOWN: // Down
- case Common::KEYCODE_KP2: // Down
- case Common::KEYCODE_KP9: // Up & Right
- case Common::KEYCODE_KP7: // Up & Left
- case Common::KEYCODE_KP1: // Down & Left
- case Common::KEYCODE_KP3: // Down & Right
+ case Common::KEYCODE_KP6: // Right
+ case Common::KEYCODE_UP: // Up
+ case Common::KEYCODE_KP8: // Up
+ case Common::KEYCODE_DOWN: // Down
+ case Common::KEYCODE_KP2: // Down
+ case Common::KEYCODE_KP9: // Up & Right
+ case Common::KEYCODE_KP7: // Up & Left
+ case Common::KEYCODE_KP1: // Down & Left
+ case Common::KEYCODE_KP3: // Down & Right
// Stop ego movement made with keyboard when releasing a known key
moveUsingKeyboard(0, 0);
break;
@@ -434,9 +434,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
hideMouse();
g_sound->stopMusic();
- // if (g_cine->getGameType() == Cine::GType_OS) {
+ //if (g_cine->getGameType() == Cine::GType_OS) {
// freeUnkList();
- // }
+ //}
closePart();
}
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index afd95c04b0..a75828abb1 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -59,7 +59,7 @@ void loadObject(char *pObjectName) {
assert(numEntry <= NUM_MAX_OBJECT);
for (i = 0; i < numEntry; i++) {
- if (g_cine->_objectTable[i].costume != -2 && g_cine->_objectTable[i].costume != -3) { // flag is keep ?
+ if (g_cine->_objectTable[i].costume != -2 && g_cine->_objectTable[i].costume != -3) { // flag is keep?
Common::MemoryReadStream readS(ptr, entrySize);
g_cine->_objectTable[i].x = readS.readSint16BE();
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 779c279ea1..10077ecdc9 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -92,7 +92,8 @@ void loadRelatedPalette(const char *fileName) {
paletteIndex = findPaletteFromName(localName);
if (paletteIndex == -1) {
- for (i = 0; i < 16; i++) { // generate default palette
+ // generate default palette
+ for (i = 0; i < 16; i++) {
paletteBuffer1[i] = paletteBuffer2[i] = (i << 4) + i;
}
} else {
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index 03cb743b46..813cbe50af 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -263,7 +263,7 @@ byte *readBundleSoundFile(const char *entryName, uint32 *size) {
/** Rotate byte value to the left by n bits */
byte rolByte(byte value, uint n) {
n %= 8;
- return (byte) ((value << n) | (value >> (8 - n)));
+ return (byte)((value << n) | (value >> (8 - n)));
}
byte *readFile(const char *filename, bool crypted) {
diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp
index 20952eea52..51d2c1f6be 100644
--- a/engines/cine/saveload.cpp
+++ b/engines/cine/saveload.cpp
@@ -1002,7 +1002,7 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
const int entrySize = ((saveGameFormat == ANIMSIZE_23) ? 23 : 30);
const int fileStartPos = fHandle.pos();
- for(int resourceIndex=0; resourceIndex<NUM_MAX_ANIMDATA; resourceIndex++) {
+ for (int resourceIndex = 0; resourceIndex < NUM_MAX_ANIMDATA; resourceIndex++) {
// Seek to the start of the current animation's entry
fHandle.seek(fileStartPos + resourceIndex * entrySize);
// Read in the current animation entry
diff --git a/engines/cine/saveload.h b/engines/cine/saveload.h
index 49c9c0cef7..fd661904af 100644
--- a/engines/cine/saveload.h
+++ b/engines/cine/saveload.h
@@ -68,7 +68,7 @@ enum CineSaveGameFormat {
};
/** Identifier for the temporary Operation Stealth savegame format. */
-static const uint32 TEMP_OS_FORMAT_ID = MKTAG('T','E','M','P');
+static const uint32 TEMP_OS_FORMAT_ID = MKTAG('T', 'E', 'M', 'P');
/** The current version number of Operation Stealth's savegame format. */
static const uint32 CURRENT_OS_SAVE_VER = 1;
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index 9cbe3c3fab..885a43f2f5 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -352,7 +352,7 @@ void ScriptVars::load(Common::SeekableReadStream &fHandle, unsigned int len) {
* Reset all values to 0
*/
void ScriptVars::reset() {
- memset( _vars, 0, _size * sizeof(int16));
+ memset(_vars, 0, _size * sizeof(int16));
}
/**
@@ -380,10 +380,10 @@ RawScript::RawScript(const FWScriptInfo &info, const byte *data, uint16 s) :
* Copy constructor
*/
RawScript::RawScript(const RawScript &src) : _size(src._size),
- _data(new byte[_size+1]), _labels(src._labels) {
+ _data(new byte[_size + 1]), _labels(src._labels) {
assert(_data);
- memcpy(_data, src._data, _size+1);
+ memcpy(_data, src._data, _size + 1);
}
/**
@@ -398,7 +398,7 @@ RawScript::~RawScript() {
*/
RawScript &RawScript::operator=(const RawScript &src) {
assert(src._data);
- byte *tmp = new byte[src._size+1];
+ byte *tmp = new byte[src._size + 1];
assert(tmp);
_labels = src._labels;
@@ -443,14 +443,14 @@ int RawScript::getNextLabel(const FWScriptInfo &info, int offset) const {
pos += 2;
break;
case 'c': { // byte != 0 ? byte : word
- uint8 test = _data[pos];
+ uint8 test = _data[pos];
+ pos++;
+ if (test) {
pos++;
- if (test) {
- pos++;
- } else {
- pos += 2;
- }
+ } else {
+ pos += 2;
}
+ }
break;
case 'l': // label
return pos;
@@ -459,7 +459,7 @@ int RawScript::getNextLabel(const FWScriptInfo &info, int offset) const {
;
break;
case 'x': // exit script
- return -pos-1;
+ return -pos - 1;
}
}
}
@@ -498,9 +498,7 @@ void RawScript::computeLabels(const FWScriptInfo &info) {
*
* computeScriptStackFromScript replacement
*/
-uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset)
- const {
-
+uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset) const {
assert(_data);
int pos = offset;
@@ -519,7 +517,7 @@ uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset)
*/
void RawScript::setData(const FWScriptInfo &info, const byte *data) {
assert(!_data); // this function should be called only once per instance
- _data = new byte[_size+1];
+ _data = new byte[_size + 1];
assert(data && _data);
memcpy(_data, data, _size * sizeof(byte));
@@ -553,7 +551,7 @@ byte RawScript::getByte(unsigned int pos) const {
* @return Word of bytecode
*/
uint16 RawScript::getWord(unsigned int pos) const {
- assert(_data && pos+1 < _size);
+ assert(_data && pos + 1 < _size);
return READ_BE_UINT16(_data + pos);
}
@@ -566,7 +564,7 @@ uint16 RawScript::getWord(unsigned int pos) const {
const char *RawScript::getString(unsigned int pos) const {
assert(_data && pos < _size);
- return (const char*)(_data+pos);
+ return (const char *)(_data + pos);
}
/**
@@ -580,8 +578,8 @@ const char *RawScript::getString(unsigned int pos) const {
* instance can be used. It leaves the instance in partially invalid state.
*/
RawObjectScript::RawObjectScript(uint16 s, uint16 p1, uint16 p2, uint16 p3)
- : RawScript(s), _runCount(0), _param1(p1), _param2(p2), _param3(p3)
-{ }
+ : RawScript(s), _runCount(0), _param1(p1), _param2(p2), _param3(p3) {
+}
/**
* Complete constructor
@@ -592,8 +590,9 @@ RawObjectScript::RawObjectScript(uint16 s, uint16 p1, uint16 p2, uint16 p3)
* @param p3 Third object script parameter
*/
RawObjectScript::RawObjectScript(const FWScriptInfo &info, const byte *data,
- uint16 s, uint16 p1, uint16 p2, uint16 p3) : RawScript(info, data, s),
- _runCount(0), _param1(p1), _param2(p2), _param3(p3) { }
+ uint16 s, uint16 p1, uint16 p2, uint16 p3)
+ : RawScript(info, data, s), _runCount(0), _param1(p1), _param2(p2), _param3(p3) {
+}
/**
* Contructor for global scripts
@@ -603,7 +602,8 @@ RawObjectScript::RawObjectScript(const FWScriptInfo &info, const byte *data,
FWScript::FWScript(const RawScript &script, int16 idx) : _script(script),
_pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
- _globalVars(g_cine->_globalVars), _info(new FWScriptInfo) { }
+ _globalVars(g_cine->_globalVars), _info(new FWScriptInfo) {
+}
/**
* Copy constructor
@@ -611,25 +611,27 @@ FWScript::FWScript(const RawScript &script, int16 idx) : _script(script),
FWScript::FWScript(const FWScript &src) : _script(src._script), _pos(src._pos),
_line(src._line), _compare(src._compare), _index(src._index),
_labels(src._labels), _localVars(src._localVars),
- _globalVars(src._globalVars), _info(new FWScriptInfo) { }
+ _globalVars(src._globalVars), _info(new FWScriptInfo) {
+}
/**
* Contructor for global scripts in derived classes
* @param script Script bytecode reference
* @param idx Script bytecode index
*/
-FWScript::FWScript(const RawScript &script, int16 idx, FWScriptInfo *info) :
- _script(script), _pos(0), _line(0), _compare(0), _index(idx),
+FWScript::FWScript(const RawScript &script, int16 idx, FWScriptInfo *info)
+ : _script(script), _pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
- _globalVars(g_cine->_globalVars), _info(info) { }
+ _globalVars(g_cine->_globalVars), _info(info) {
+}
/**
* Constructor for object scripts in derived classes
* @param script Script bytecode reference
* @param idx Script bytecode index
*/
-FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info) :
- _script(script), _pos(0), _line(0), _compare(0), _index(idx),
+FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info)
+ : _script(script), _pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
_globalVars(g_cine->_globalVars), _info(info) {
@@ -639,8 +641,8 @@ FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info) :
/**
* Copy constructor for derived classes
*/
-FWScript::FWScript(const FWScript &src, FWScriptInfo *info) :
- _script(src._script), _pos(src._pos), _line(src._line),
+FWScript::FWScript(const FWScript &src, FWScriptInfo *info)
+ : _script(src._script), _pos(src._pos), _line(src._line),
_compare(src._compare), _index(src._index), _labels(src._labels),
_localVars(src._localVars), _globalVars(src._globalVars), _info(info) { }
@@ -704,7 +706,7 @@ void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 co
int FWScript::execute() {
int ret = 0;
- if(_script._size) {
+ if (_script._size) {
while (!ret) {
_line = _pos;
byte opcode = getNextByte();
@@ -2074,1034 +2076,970 @@ void decompileScript(const byte *scriptPtr, uint16 scriptSize, uint16 scriptIdx)
strcpy(lineBuffer, "");
switch (opcode - 1) {
- case -1:
- {
- break;
- }
- case 0x0:
- {
- byte param1;
- byte param2;
- int16 param3;
+ case -1: {
+ break;
+ }
+ case 0x0: {
+ byte param1;
+ byte param2;
+ int16 param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "obj[%d]%s = %d\n", param1, getObjPramName(param2), param3);
+ sprintf(lineBuffer, "obj[%d]%s = %d\n", param1, getObjPramName(param2), param3);
- break;
- }
- case 0x1:
- {
- byte param1;
- byte param2;
- byte param3;
+ break;
+ }
+ case 0x1: {
+ byte param1;
+ byte param2;
+ byte param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "var[%d]=obj[%d]%s\n", param3, param1, getObjPramName(param2));
- break;
- }
+ sprintf(lineBuffer, "var[%d]=obj[%d]%s\n", param3, param1, getObjPramName(param2));
+ break;
+ }
case 0x2:
case 0x3:
case 0x4:
case 0x5:
- case 0x6:
- {
- byte param1;
- byte param2;
- int16 param3;
-
- param1 = *(localScriptPtr + position);
- position++;
-
- param2 = *(localScriptPtr + position);
- position++;
-
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
-
- if (opcode - 1 == 0x2) {
- sprintf(lineBuffer, "obj[%d]%s+=%d\n", param1, getObjPramName(param2), param3);
- } else if (opcode - 1 == 0x3) {
- sprintf(lineBuffer, "obj[%d]%s-=%d\n", param1, getObjPramName(param2), param3);
- } else if (opcode - 1 == 0x4) {
- sprintf(lineBuffer, "obj[%d]%s+=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
- } else if (opcode - 1 == 0x5) {
- sprintf(lineBuffer, "obj[%d]%s-=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
- } else if (opcode - 1 == 0x6) {
- sprintf(compareString1, "obj[%d]%s", param1, getObjPramName(param2));
- sprintf(compareString2, "%d", param3);
- }
- break;
+ case 0x6: {
+ byte param1;
+ byte param2;
+ int16 param3;
+
+ param1 = *(localScriptPtr + position);
+ position++;
+
+ param2 = *(localScriptPtr + position);
+ position++;
+
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ if (opcode - 1 == 0x2) {
+ sprintf(lineBuffer, "obj[%d]%s+=%d\n", param1, getObjPramName(param2), param3);
+ } else if (opcode - 1 == 0x3) {
+ sprintf(lineBuffer, "obj[%d]%s-=%d\n", param1, getObjPramName(param2), param3);
+ } else if (opcode - 1 == 0x4) {
+ sprintf(lineBuffer, "obj[%d]%s+=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
+ } else if (opcode - 1 == 0x5) {
+ sprintf(lineBuffer, "obj[%d]%s-=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
+ } else if (opcode - 1 == 0x6) {
+ sprintf(compareString1, "obj[%d]%s", param1, getObjPramName(param2));
+ sprintf(compareString2, "%d", param3);
}
+ break;
+ }
case 0x7:
- case 0x8:
- {
- byte param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ case 0x8: {
+ byte param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0x7) {
- sprintf(lineBuffer, "setupObject(Idx:%d,X:%d,Y:%d,mask:%d,frame:%d)\n", param1, param2, param3, param4, param5);
- } else if (opcode - 1 == 0x8) {
- sprintf(lineBuffer, "checkCollision(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- }
- break;
+ if (opcode - 1 == 0x7) {
+ sprintf(lineBuffer, "setupObject(Idx:%d,X:%d,Y:%d,mask:%d,frame:%d)\n", param1, param2, param3, param4, param5);
+ } else if (opcode - 1 == 0x8) {
+ sprintf(lineBuffer, "checkCollision(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
}
- case 0x9:
- {
- byte param1;
- int16 param2;
+ break;
+ }
+ case 0x9: {
+ byte param1;
+ int16 param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
-
- param3 = *(localScriptPtr + position);
- position++;
-
- if (param2 == 1) {
- sprintf(lineBuffer, "var[%d]=var[%d]\n", param1, param3);
- } else if (param2 == 2) {
- sprintf(lineBuffer, "var[%d]=globalVar[%d]\n", param1, param3);
- } else if (param2 == 3) {
- sprintf(lineBuffer, "var[%d]=mouse.X\n", param1);
- } else if (param2 == 4) {
- sprintf(lineBuffer, "var[%d]=mouse.Y\n", param1);
- } else if (param2 == 5) {
- sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
- } else if (param2 == 8) {
- sprintf(lineBuffer, "var[%d]=file[%d].packedSize\n", param1, param3);
- } else if (param2 == 9) {
- sprintf(lineBuffer, "var[%d]=file[%d].unpackedSize\n", param1, param3);
- } else {
- error("decompileScript: 0x09: param2 = %d", param2);
- }
- } else {
- int16 param3;
+ if (param2) {
+ byte param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "var[%d]=%d\n", param1, param3);
+ if (param2 == 1) {
+ sprintf(lineBuffer, "var[%d]=var[%d]\n", param1, param3);
+ } else if (param2 == 2) {
+ sprintf(lineBuffer, "var[%d]=globalVar[%d]\n", param1, param3);
+ } else if (param2 == 3) {
+ sprintf(lineBuffer, "var[%d]=mouse.X\n", param1);
+ } else if (param2 == 4) {
+ sprintf(lineBuffer, "var[%d]=mouse.Y\n", param1);
+ } else if (param2 == 5) {
+ sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
+ } else if (param2 == 8) {
+ sprintf(lineBuffer, "var[%d]=file[%d].packedSize\n", param1, param3);
+ } else if (param2 == 9) {
+ sprintf(lineBuffer, "var[%d]=file[%d].unpackedSize\n", param1, param3);
+ } else {
+ error("decompileScript: 0x09: param2 = %d", param2);
}
+ } else {
+ int16 param3;
- break;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ sprintf(lineBuffer, "var[%d]=%d\n", param1, param3);
}
+
+ break;
+ }
case 0xA:
case 0xB:
case 0xC:
- case 0xD:
- {
- byte param1;
- byte param2;
+ case 0xD: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
+ param2 = *(localScriptPtr + position);
+ position++;
+
+ if (param2) {
+ byte param3;
+
+ param3 = *(localScriptPtr + position);
position++;
- if (param2) {
- byte param3;
+ if (opcode - 1 == 0xA) {
+ sprintf(lineBuffer, "var[%d]+=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xB) {
+ sprintf(lineBuffer, "var[%d]-=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xC) {
+ sprintf(lineBuffer, "var[%d]*=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xD) {
+ sprintf(lineBuffer, "var[%d]/=var[%d]\n", param1, param3);
+ }
+ } else {
+ int16 param3;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0xA) {
- sprintf(lineBuffer, "var[%d]+=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xB) {
- sprintf(lineBuffer, "var[%d]-=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xC) {
- sprintf(lineBuffer, "var[%d]*=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xD) {
- sprintf(lineBuffer, "var[%d]/=var[%d]\n", param1, param3);
- }
- } else {
- int16 param3;
-
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
-
- if (opcode - 1 == 0xA) {
- sprintf(lineBuffer, "var[%d]+=%d\n", param1, param3);
- } else if (opcode - 1 == 0xB) {
- sprintf(lineBuffer, "var[%d]-=%d\n", param1, param3);
- } else if (opcode - 1 == 0xC) {
- sprintf(lineBuffer, "var[%d]*=%d\n", param1, param3);
- } else if (opcode - 1 == 0xD) {
- sprintf(lineBuffer, "var[%d]/=%d\n", param1, param3);
- }
+ if (opcode - 1 == 0xA) {
+ sprintf(lineBuffer, "var[%d]+=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xB) {
+ sprintf(lineBuffer, "var[%d]-=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xC) {
+ sprintf(lineBuffer, "var[%d]*=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xD) {
+ sprintf(lineBuffer, "var[%d]/=%d\n", param1, param3);
}
- break;
}
- case 0xE:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0xE: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
+ if (param2) {
+ byte param3;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- if (param2 == 1) {
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "var[%d]", param3);
+ if (param2 == 1) {
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "var[%d]", param3);
- } else if (param2 == 2) {
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "globalVar[%d]", param3);
- } else {
- error("decompileScript: 0x0E: param2 = %d", param2);
- }
+ } else if (param2 == 2) {
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "globalVar[%d]", param3);
} else {
- int16 param3;
+ error("decompileScript: 0x0E: param2 = %d", param2);
+ }
+ } else {
+ int16 param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "%d", param3);
- }
- break;
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "%d", param3);
}
- case 0xF:
- {
- byte param1;
- byte param2;
- byte param3;
+ break;
+ }
+ case 0xF: {
+ byte param1;
+ byte param2;
+ byte param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "obj[%d]%s=var[%d]\n", param1, getObjPramName(param2), param3);
+ sprintf(lineBuffer, "obj[%d]%s=var[%d]\n", param1, getObjPramName(param2), param3);
- break;
- }
+ break;
+ }
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
- case 0x19:
- {
- byte param;
-
- param = *(localScriptPtr + position);
- position++;
-
- if (opcode - 1 == 0x13) {
- sprintf(lineBuffer, "loadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x14) {
- sprintf(lineBuffer, "unloadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x15) {
- sprintf(lineBuffer, "OP_15(%d)\n", param);
- } else if (opcode - 1 == 0x16) {
- sprintf(lineBuffer, "loadMask1(%d)\n", param);
- } else if (opcode - 1 == 0x17) {
- sprintf(lineBuffer, "unloadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x18) {
- sprintf(lineBuffer, "loadMask4(%d)\n", param);
- } else if (opcode - 1 == 0x19) {
- sprintf(lineBuffer, "unloadMask4(%d)\n", param);
- }
- break;
+ case 0x19: {
+ byte param;
+
+ param = *(localScriptPtr + position);
+ position++;
+
+ if (opcode - 1 == 0x13) {
+ sprintf(lineBuffer, "loadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x14) {
+ sprintf(lineBuffer, "unloadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x15) {
+ sprintf(lineBuffer, "OP_15(%d)\n", param);
+ } else if (opcode - 1 == 0x16) {
+ sprintf(lineBuffer, "loadMask1(%d)\n", param);
+ } else if (opcode - 1 == 0x17) {
+ sprintf(lineBuffer, "unloadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x18) {
+ sprintf(lineBuffer, "loadMask4(%d)\n", param);
+ } else if (opcode - 1 == 0x19) {
+ sprintf(lineBuffer, "unloadMask4(%d)\n", param);
}
- case 0x1A:
- {
- byte param;
+ break;
+ }
+ case 0x1A: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_1A(%d)\n", param);
+ sprintf(lineBuffer, "OP_1A(%d)\n", param);
- break;
- }
- case 0x1B:
- {
- sprintf(lineBuffer, "bgIncrustList.clear()\n");
- break;
- }
- case 0x1D:
- {
- byte param;
+ break;
+ }
+ case 0x1B: {
+ sprintf(lineBuffer, "bgIncrustList.clear()\n");
+ break;
+ }
+ case 0x1D: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "label(%d)\n", param);
+ sprintf(lineBuffer, "label(%d)\n", param);
- break;
- }
- case 0x1E:
- {
- byte param;
+ break;
+ }
+ case 0x1E: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "goto(%d)\n", param);
+ sprintf(lineBuffer, "goto(%d)\n", param);
- break;
- }
+ break;
+ }
// If cases
case 0x1F:
case 0x20:
case 0x21:
case 0x22:
case 0x23:
- case 0x24:
- {
- byte param;
-
- param = *(localScriptPtr + position);
- position++;
-
- if (opcode - 1 == 0x1F) {
- sprintf(lineBuffer, "if(%s>%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x20) {
- sprintf(lineBuffer, "if(%s>=%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x21) {
- sprintf(lineBuffer, "if(%s<%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x22) {
- sprintf(lineBuffer, "if(%s<=%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x23) {
- sprintf(lineBuffer, "if(%s==%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x24) {
- sprintf(lineBuffer, "if(%s!=%s) goto(%d)\n", compareString1, compareString2, param);
- }
- break;
+ case 0x24: {
+ byte param;
+
+ param = *(localScriptPtr + position);
+ position++;
+
+ if (opcode - 1 == 0x1F) {
+ sprintf(lineBuffer, "if(%s>%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x20) {
+ sprintf(lineBuffer, "if(%s>=%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x21) {
+ sprintf(lineBuffer, "if(%s<%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x22) {
+ sprintf(lineBuffer, "if(%s<=%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x23) {
+ sprintf(lineBuffer, "if(%s==%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x24) {
+ sprintf(lineBuffer, "if(%s!=%s) goto(%d)\n", compareString1, compareString2, param);
}
- case 0x25:
- {
- byte param;
+ break;
+ }
+ case 0x25: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "removeLabel(%d)\n", param);
+ sprintf(lineBuffer, "removeLabel(%d)\n", param);
- break;
- }
- case 0x26:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0x26: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "loop(--var[%d]) -> label(%d)\n", param1, param2);
+ sprintf(lineBuffer, "loop(--var[%d]) -> label(%d)\n", param1, param2);
- break;
- }
+ break;
+ }
case 0x31:
- case 0x32:
- {
- byte param;
+ case 0x32: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- if (opcode - 1 == 0x31) {
- sprintf(lineBuffer, "startGlobalScript(%d)\n", param);
- } else if (opcode - 1 == 0x32) {
- sprintf(lineBuffer, "endGlobalScript(%d)\n", param);
- }
- break;
+ if (opcode - 1 == 0x31) {
+ sprintf(lineBuffer, "startGlobalScript(%d)\n", param);
+ } else if (opcode - 1 == 0x32) {
+ sprintf(lineBuffer, "endGlobalScript(%d)\n", param);
}
+ break;
+ }
case 0x3B:
case 0x3C:
case 0x3D:
- case OP_loadPart:
- {
- if (opcode - 1 == 0x3B) {
- sprintf(lineBuffer, "loadResource(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == 0x3C) {
- sprintf(lineBuffer, "loadBg(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == 0x3D) {
- sprintf(lineBuffer, "loadCt(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == OP_loadPart) {
- sprintf(lineBuffer, "loadPart(%s)\n", localScriptPtr + position);
- }
-
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case 0x40:
- {
- sprintf(lineBuffer, "closePart()\n");
- break;
- }
- case OP_loadNewPrcName:
- {
- byte param;
+ case OP_loadPart: {
+ if (opcode - 1 == 0x3B) {
+ sprintf(lineBuffer, "loadResource(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == 0x3C) {
+ sprintf(lineBuffer, "loadBg(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == 0x3D) {
+ sprintf(lineBuffer, "loadCt(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == OP_loadPart) {
+ sprintf(lineBuffer, "loadPart(%s)\n", localScriptPtr + position);
+ }
+
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case 0x40: {
+ sprintf(lineBuffer, "closePart()\n");
+ break;
+ }
+ case OP_loadNewPrcName: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "loadPrc(%d,%s)\n", param, localScriptPtr + position);
+ sprintf(lineBuffer, "loadPrc(%d,%s)\n", param, localScriptPtr + position);
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case OP_requestCheckPendingDataLoad: // nop
- {
- sprintf(lineBuffer, "requestCheckPendingDataLoad()\n");
- break;
- }
- case 0x45:
- {
- sprintf(lineBuffer, "blitAndFade()\n");
- break;
- }
- case 0x46:
- {
- sprintf(lineBuffer, "fadeToBlack()\n");
- break;
- }
- case 0x47:
- {
- byte param1;
- byte param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case OP_requestCheckPendingDataLoad: { // nop
+ sprintf(lineBuffer, "requestCheckPendingDataLoad()\n");
+ break;
+ }
+ case 0x45: {
+ sprintf(lineBuffer, "blitAndFade()\n");
+ break;
+ }
+ case 0x46: {
+ sprintf(lineBuffer, "fadeToBlack()\n");
+ break;
+ }
+ case 0x47: {
+ byte param1;
+ byte param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "transformPaletteRange(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ sprintf(lineBuffer, "transformPaletteRange(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- break;
- }
- case 0x49:
- {
- byte param;
+ break;
+ }
+ case 0x49: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "setDefaultMenuBgColor(%d)\n", param);
+ sprintf(lineBuffer, "setDefaultMenuBgColor(%d)\n", param);
- break;
- }
- case 0x4F:
- {
- sprintf(lineBuffer, "break()\n");
- exitScript = 1;
- break;
- }
- case 0x50:
- {
- sprintf(lineBuffer, "endScript()\n\n");
- break;
- }
- case 0x51:
- {
- byte param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ break;
+ }
+ case 0x4F: {
+ sprintf(lineBuffer, "break()\n");
+ exitScript = 1;
+ break;
+ }
+ case 0x50: {
+ sprintf(lineBuffer, "endScript()\n\n");
+ break;
+ }
+ case 0x51: {
+ byte param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "message(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ sprintf(lineBuffer, "message(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- break;
- }
+ break;
+ }
case 0x52:
- case 0x53:
- {
- byte param1;
- byte param2;
+ case 0x53: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
-
- param3 = *(localScriptPtr + position);
- position++;
-
- if (param2 == 1) {
- if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0x53) {
- sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "var[%d]", param3);
- }
- } else if (param2 == 2) {
- if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
- } else if (opcode - 1 == 0x53) {
- sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "globalVar[%d]", param3);
- }
- } else {
- if (opcode - 1 == 0x52) {
- error("decompileScript: 0x52: param2 = %d", param2);
- } else if (opcode - 1 == 0x53) {
- error("decompileScript: 0x53: param2 = %d", param2);
- }
- }
- } else {
- int16 param3;
+ if (param2) {
+ byte param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = *(localScriptPtr + position);
+ position++;
+ if (param2 == 1) {
if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = %d\n", param1, param3);
+ sprintf(lineBuffer, "globalVar[%d] = var[%d]\n", param1, param3);
} else if (opcode - 1 == 0x53) {
sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "%d", param3);
+ sprintf(compareString2, "var[%d]", param3);
+ }
+ } else if (param2 == 2) {
+ if (opcode - 1 == 0x52) {
+ sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0x53) {
+ sprintf(compareString1, "globalVar[%d]", param1);
+ sprintf(compareString2, "globalVar[%d]", param3);
+ }
+ } else {
+ if (opcode - 1 == 0x52) {
+ error("decompileScript: 0x52: param2 = %d", param2);
+ } else if (opcode - 1 == 0x53) {
+ error("decompileScript: 0x53: param2 = %d", param2);
}
}
- break;
- }
- case 0x59:
- {
- sprintf(lineBuffer, "comment: %s\n", localScriptPtr + position);
+ } else {
+ int16 param3;
- position += strlen((const char *)localScriptPtr + position);
- break;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ if (opcode - 1 == 0x52) {
+ sprintf(lineBuffer, "globalVar[%d] = %d\n", param1, param3);
+ } else if (opcode - 1 == 0x53) {
+ sprintf(compareString1, "globalVar[%d]", param1);
+ sprintf(compareString2, "%d", param3);
+ }
}
- case 0x5A:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0x59: {
+ sprintf(lineBuffer, "comment: %s\n", localScriptPtr + position);
- param1 = *(localScriptPtr + position);
- position++;
+ position += strlen((const char *)localScriptPtr + position);
+ break;
+ }
+ case 0x5A: {
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "freePartRang(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x5B:
- {
- sprintf(lineBuffer, "unloadAllMasks()\n");
- break;
- }
- case 0x65:
- {
- sprintf(lineBuffer, "setupTableUnk1()\n");
- break;
- }
- case 0x66:
- {
- byte param1;
- int16 param2;
+ sprintf(lineBuffer, "freePartRang(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x5B: {
+ sprintf(lineBuffer, "unloadAllMasks()\n");
+ break;
+ }
+ case 0x65: {
+ sprintf(lineBuffer, "setupTableUnk1()\n");
+ break;
+ }
+ case 0x66: {
+ byte param1;
+ int16 param2;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "tableUnk1[%d] = %d\n", param1, param2);
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x68:
- {
- byte param;
+ sprintf(lineBuffer, "tableUnk1[%d] = %d\n", param1, param2);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x68: {
+ byte param;
- sprintf(lineBuffer, "setPlayerCommandPosY(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x69:
- {
- sprintf(lineBuffer, "allowPlayerInput()\n");
- break;
- }
- case 0x6A:
- {
- sprintf(lineBuffer, "disallowPlayerInput()\n");
- break;
- }
- case 0x6B:
- {
- byte newDisk;
+ sprintf(lineBuffer, "setPlayerCommandPosY(%d)\n", param);
- newDisk = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x69: {
+ sprintf(lineBuffer, "allowPlayerInput()\n");
+ break;
+ }
+ case 0x6A: {
+ sprintf(lineBuffer, "disallowPlayerInput()\n");
+ break;
+ }
+ case 0x6B: {
+ byte newDisk;
- sprintf(lineBuffer, "changeDataDisk(%d)\n", newDisk);
+ newDisk = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x6D:
- {
- sprintf(lineBuffer, "loadDat(%s)\n", localScriptPtr + position);
+ sprintf(lineBuffer, "changeDataDisk(%d)\n", newDisk);
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case 0x6E: // nop
- {
- sprintf(lineBuffer, "updateDat()\n");
- break;
- }
- case 0x6F:
- {
- sprintf(lineBuffer, "OP_6F() -> dat related\n");
- break;
- }
- case 0x70:
- {
- sprintf(lineBuffer, "stopSample()\n");
- break;
- }
- case 0x79:
- {
- byte param;
+ break;
+ }
+ case 0x6D: {
+ sprintf(lineBuffer, "loadDat(%s)\n", localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case 0x6E: { // nop
+ sprintf(lineBuffer, "updateDat()\n");
+ break;
+ }
+ case 0x6F: {
+ sprintf(lineBuffer, "OP_6F() -> dat related\n");
+ break;
+ }
+ case 0x70: {
+ sprintf(lineBuffer, "stopSample()\n");
+ break;
+ }
+ case 0x79: {
+ byte param;
- sprintf(lineBuffer, "disableSystemMenu(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x77:
- case 0x78:
- {
- byte param1;
- byte param2;
- int16 param3;
- byte param4;
- int16 param5;
- int16 param6;
+ sprintf(lineBuffer, "disableSystemMenu(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x77:
+ case 0x78: {
+ byte param1;
+ byte param2;
+ int16 param3;
+ byte param4;
+ int16 param5;
+ int16 param6;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = *(localScriptPtr + position);
- position++;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = *(localScriptPtr + position);
+ position++;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0x77) {
- sprintf(lineBuffer, "playSample(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
- } else if (opcode - 1 == 0x78) {
- sprintf(lineBuffer, "OP_78(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
- }
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
+ if (opcode - 1 == 0x77) {
+ sprintf(lineBuffer, "playSample(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
+ } else if (opcode - 1 == 0x78) {
+ sprintf(lineBuffer, "OP_78(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
}
- case 0x7A:
- {
- byte param;
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7A: {
+ byte param;
- sprintf(lineBuffer, "OP_7A(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x7B: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_7A(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7B: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_7B(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x7F: // OS only
- {
- byte param1;
- byte param2;
- byte param3;
- byte param4;
- int16 param5;
- int16 param6;
- int16 param7;
+ sprintf(lineBuffer, "OP_7B(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7F: { // OS only
+ byte param1;
+ byte param2;
+ byte param3;
+ byte param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = *(localScriptPtr + position);
+ position++;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param7 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "OP_7F(%d,%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6, param7);
+ param7 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x80: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_7F(%d,%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6, param7);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x80: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_80(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x82: // OS only
- {
- byte param1;
- byte param2;
- uint16 param3;
- uint16 param4;
- byte param5;
+ sprintf(lineBuffer, "OP_80(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x82: { // OS only
+ byte param1;
+ byte param2;
+ uint16 param3;
+ uint16 param4;
+ byte param5;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = *(localScriptPtr + position);
- position++;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "OP_82(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ param5 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x83: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_82(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x83: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_83(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x89: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_83(%d,%d)\n", param1, param2);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x89: { // OS only
+ byte param;
- sprintf(lineBuffer, "if(%s!=%s) goto next label(%d)\n", compareString1, compareString2, param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8B: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "if(%s!=%s) goto next label(%d)\n", compareString1, compareString2, param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8B: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8B(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8C: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_8B(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8C: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8C(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8D: // OS only
- {
- int16 param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
- int16 param6;
- int16 param7;
- int16 param8;
+ sprintf(lineBuffer, "OP_8C(%d)\n", param);
- param1 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ break;
+ }
+ case 0x8D: { // OS only
+ int16 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
+ int16 param8;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param1 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param7 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param8 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param7 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(compareString1, "obj[%d]", param1);
- sprintf(compareString2, "{%d,%d,%d,%d,%d,%d,%d}", param2, param3, param4, param5, param6, param7, param8);
+ param8 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x8E: // OS only
- {
- byte param1;
+ sprintf(compareString1, "obj[%d]", param1);
+ sprintf(compareString2, "{%d,%d,%d,%d,%d,%d,%d}", param2, param3, param4, param5, param6, param7, param8);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8E: { // OS only
+ byte param1;
- sprintf(lineBuffer, "ADDBG(%d,%s)\n", param1, localScriptPtr + position);
+ param1 = *(localScriptPtr + position);
+ position++;
- position += strlen((const char *)localScriptPtr + position);
+ sprintf(lineBuffer, "ADDBG(%d,%s)\n", param1, localScriptPtr + position);
- break;
- }
- case 0x8F: // OS only
- {
- byte param;
+ position += strlen((const char *)localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8F: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8F(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x90: // OS only
- {
- byte param1;
+ sprintf(lineBuffer, "OP_8F(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x90: { // OS only
+ byte param1;
- sprintf(lineBuffer, "loadABS(%d,%s)\n", param1, localScriptPtr + position);
+ param1 = *(localScriptPtr + position);
+ position++;
- position += strlen((const char *)localScriptPtr + position);
+ sprintf(lineBuffer, "loadABS(%d,%s)\n", param1, localScriptPtr + position);
- break;
- }
- case 0x91: // OS only
- {
- byte param;
+ position += strlen((const char *)localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x91: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_91(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x9D: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_91(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x9D: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_9D(%d) -> flip img idx\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x9E: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_9D(%d) -> flip img idx\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x9E: { // OS only
+ byte param;
- if (param) {
- byte param2;
+ param = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ if (param) {
+ byte param2;
- sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
- } else {
- int16 param2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
+ } else {
+ int16 param2;
- sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
- }
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
+ sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
}
- case 0xA0: // OS only
- {
- byte param1;
- byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0xA0: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_A0(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0xA1: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_A0(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0xA1: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_A1(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- default:
- {
- sprintf(lineBuffer, "Unsupported opcode %X in decompileScript\n\n", opcode - 1);
- position = scriptSize;
- break;
- }
+ sprintf(lineBuffer, "OP_A1(%d,%d)\n", param1, param2);
+
+ break;
+ }
+ default: {
+ sprintf(lineBuffer, "Unsupported opcode %X in decompileScript\n\n", opcode - 1);
+ position = scriptSize;
+ break;
+ }
}
- // printf(lineBuffer);
+ //printf(lineBuffer);
strcpy(decompileBuffer[decompileBufferPosition++], lineBuffer);
exitScript = 0;
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index 52e1cdac7e..b92c5374bd 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -153,7 +153,7 @@ const int AdLibSoundDriver::_freqTable[] = {
const int AdLibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdLibSoundDriver::_operatorsTable[] = {
- 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
+ 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
};
const int AdLibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
@@ -614,7 +614,7 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
}
MidiSoundDriverH32::MidiSoundDriverH32(MidiDriver *output)
- : _output(output), _callback(0), _mutex() {
+ : _output(output), _callback(0), _mutex() {
}
MidiSoundDriverH32::~MidiSoundDriverH32() {
@@ -731,13 +731,13 @@ void MidiSoundDriverH32::selectInstrument(int channel, int timbreGroup, int timb
0x00, 0x00, 0x00, // offset
0x00, // Timbre group _ timbreGroup * 64 + timbreNumber should be the
0x00, // Timbre number / MT-32 instrument in case timbreGroup is 0 or 1.
- 0x18, // Key shift (= 0)
+ 0x18, // Key shift (= 0)
0x32, // Fine tune (= 0)
0x0C, // Bender Range
0x03, // Assign Mode
0x01, // Reverb Switch (= enabled)
0x00, // dummy
- 0x00, // Output level
+ 0x00, // Output level
0x07, // Panpot (= balanced)
0x00, // dummy
0x00, // dummy
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index 33ea569df7..998075c6ce 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -88,7 +88,7 @@ static const CharacterEntry fontParamTable_standard[NUM_FONT_CHARS] = {
{64, 3}, {65, 3}, { 0, 0}, { 0, 0}, {62, 2}, {74, 6}, {66, 1}, {67, 6},
{52, 6}, {53, 6}, {54, 6}, {55, 6}, {56, 6}, {57, 6}, {58, 6}, {59, 6},
{60, 6}, {61, 6}, {76, 3}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {75, 6},
- { 0, 0}, { 0, 6}, //a
+ { 0, 0}, { 0, 6}, //a
{ 1, 6}, { 2, 6}, { 3, 6}, { 4, 6}, { 5, 6}, { 6, 6},
{ 7, 6}, { 8, 3}, { 9, 6}, {10, 6}, {11, 6}, {12, 7}, {13, 6}, {14, 6},
{15, 6}, {16, 6}, {17, 6}, {18, 6}, {19, 6}, {20, 6}, {21, 6}, {22, 7},
diff --git a/engines/cine/texte.h b/engines/cine/texte.h
index dd4b7e06ee..185dc53bfd 100644
--- a/engines/cine/texte.h
+++ b/engines/cine/texte.h
@@ -46,7 +46,7 @@ struct CharacterEntry {
};
struct TextHandler {
- byte textTable[NUM_FONT_CHARS][2][FONT_WIDTH * FONT_HEIGHT];
+ byte textTable[NUM_FONT_CHARS][2][FONT_WIDTH *FONT_HEIGHT];
CharacterEntry fontParamTable[NUM_FONT_CHARS];
};
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index eccd71cf05..23f439a7a7 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -99,8 +99,7 @@ byte isInPause = 0;
* Bit on = mouse button down
* Bit off = mouse button up
*/
-enum MouseButtonState
-{
+enum MouseButtonState {
kLeftMouseButton = (1 << 0),
kRightMouseButton = (1 << 1)
};
@@ -271,7 +270,7 @@ int16 getObjectUnderCursor(uint16 x, uint16 y) {
} else if (it->type == 1 && gfxGetBit(xdif, ydif, g_cine->_animDataTable[frame].data(), g_cine->_animDataTable[frame]._width * 4)) {
return it->objIdx;
}
- } else if (it->type == 0) { // use generated mask
+ } else if (it->type == 0) { // use generated mask
if (gfxGetBit(xdif, ydif, g_cine->_animDataTable[frame].mask(), g_cine->_animDataTable[frame]._width)) {
return it->objIdx;
}
@@ -358,128 +357,122 @@ void CineEngine::makeSystemMenu() {
systemCommand = makeMenuChoice(systemMenu, numEntry, mouseX, mouseY, 140);
switch (systemCommand) {
- case 0: // Pause
- {
- renderer->drawString(otherMessages[2], 0);
- waitPlayerInput();
- break;
- }
- case 1: // Restart Game
- {
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- _restartRequested = true;
- }
- break;
- }
- case 2: // Quit
- {
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- quitGame();
- }
- break;
+ case 0: { // Pause
+ renderer->drawString(otherMessages[2], 0);
+ waitPlayerInput();
+ break;
+ }
+ case 1: { // Restart Game
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ _restartRequested = true;
}
- case 3: // Select save drive... change ?
- {
- break;
+ break;
+ }
+ case 2: { // Quit
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ quitGame();
}
- case 4: // load game
- {
- if (loadSaveDirectory()) {
+ break;
+ }
+ case 3: { // Select save drive... change ?
+ break;
+ }
+ case 4: { // load game
+ if (loadSaveDirectory()) {
// int16 selectedSave;
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
- if (selectedSave >= 0) {
- char saveNameBuffer[256];
- sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), selectedSave);
+ if (selectedSave >= 0) {
+ char saveNameBuffer[256];
+ sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), selectedSave);
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- char loadString[256];
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ char loadString[256];
- sprintf(loadString, otherMessages[3], currentSaveName[selectedSave]);
- renderer->drawString(loadString, 0);
+ sprintf(loadString, otherMessages[3], currentSaveName[selectedSave]);
+ renderer->drawString(loadString, 0);
- makeLoad(saveNameBuffer);
- } else {
- renderer->drawString(otherMessages[4], 0);
- waitPlayerInput();
- checkDataDisk(-1);
- }
+ makeLoad(saveNameBuffer);
} else {
renderer->drawString(otherMessages[4], 0);
waitPlayerInput();
checkDataDisk(-1);
}
} else {
- renderer->drawString(otherMessages[5], 0);
+ renderer->drawString(otherMessages[4], 0);
waitPlayerInput();
checkDataDisk(-1);
}
- break;
+ } else {
+ renderer->drawString(otherMessages[5], 0);
+ waitPlayerInput();
+ checkDataDisk(-1);
}
- case 5: // Save game
- {
- loadSaveDirectory();
- selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
+ break;
+ }
+ case 5: { // Save game
+ loadSaveDirectory();
+ selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
- if (selectedSave >= 0) {
- char saveFileName[256];
- char saveName[20];
- saveName[0] = 0;
+ if (selectedSave >= 0) {
+ char saveFileName[256];
+ char saveName[20];
+ saveName[0] = 0;
- if (!makeTextEntryMenu(otherMessages[6], saveName, 20, 120))
- break;
+ if (!makeTextEntryMenu(otherMessages[6], saveName, 20, 120))
+ break;
- strncpy(currentSaveName[selectedSave], saveName, 20);
+ strncpy(currentSaveName[selectedSave], saveName, 20);
- sprintf(saveFileName, "%s.%1d", _targetName.c_str(), selectedSave);
+ sprintf(saveFileName, "%s.%1d", _targetName.c_str(), selectedSave);
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- char saveString[256];
- Common::String tmp = Common::String::format("%s.dir", _targetName.c_str());
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ char saveString[256];
+ Common::String tmp = Common::String::format("%s.dir", _targetName.c_str());
- Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp);
- if (!fHandle) {
- warning("Unable to open file %s for saving", tmp.c_str());
- break;
- }
+ Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp);
+ if (!fHandle) {
+ warning("Unable to open file %s for saving", tmp.c_str());
+ break;
+ }
- fHandle->write(currentSaveName, 200);
- delete fHandle;
+ fHandle->write(currentSaveName, 200);
+ delete fHandle;
- sprintf(saveString, otherMessages[3], currentSaveName[selectedSave]);
- renderer->drawString(saveString, 0);
+ sprintf(saveString, otherMessages[3], currentSaveName[selectedSave]);
+ renderer->drawString(saveString, 0);
- makeSave(saveFileName);
+ makeSave(saveFileName);
- checkDataDisk(-1);
- } else {
- renderer->drawString(otherMessages[4], 0);
- waitPlayerInput();
- checkDataDisk(-1);
- }
+ checkDataDisk(-1);
+ } else {
+ renderer->drawString(otherMessages[4], 0);
+ waitPlayerInput();
+ checkDataDisk(-1);
}
- break;
}
+ break;
+ }
}
inMenu = false;
}
}
-void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset, int16 color, byte* page) {
- gfxDrawLine(x + offset, y + offset, x + width - offset, y + offset, color, page); // top
- gfxDrawLine(x + offset, currentY + 4 - offset, x + width - offset, currentY + 4 - offset, color, page); // bottom
- gfxDrawLine(x + offset, y + offset, x + offset, currentY + 4 - offset, color, page); // left
- gfxDrawLine(x + width - offset, y + offset, x + width - offset, currentY + 4 - offset, color, page); // right
+void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset, int16 color, byte *page) {
+ gfxDrawLine(x + offset, y + offset, x + width - offset, y + offset, color, page); // top
+ gfxDrawLine(x + offset, currentY + 4 - offset, x + width - offset, currentY + 4 - offset, color, page); // bottom
+ gfxDrawLine(x + offset, y + offset, x + offset, currentY + 4 - offset, color, page); // left
+ gfxDrawLine(x + width - offset, y + offset, x + width - offset, currentY + 4 - offset, color, page); // right
}
-void drawDoubleMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 color, byte* page) {
+void drawDoubleMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 color, byte *page) {
drawMessageBox(x, y, width, currentY, 1, 0, page);
drawMessageBox(x, y, width, currentY, 0, color, page);
}
@@ -581,7 +574,7 @@ void makeCommandLine() {
g_cine->_commandBuffer = "";
}
- if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) { // need object selection ?
+ if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) { // need object selection?
int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -635,7 +628,7 @@ void makeCommandLine() {
}
if (g_cine->getGameType() == Cine::GType_OS && playerCommand != 2) {
- if (playerCommand != -1 && canUseOnObject != 0) { // call use on sub object
+ if (playerCommand != -1 && canUseOnObject != 0) { // call use on sub object
int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -742,11 +735,11 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
mainLoopSub6();
}
- if (menuVar4 && currentSelection > 0) { // go up
+ if (menuVar4 && currentSelection > 0) { // go up
currentSelection--;
}
- if (menuVar5) { // go down
+ if (menuVar5) { // go down
if (height - 1 > currentSelection) {
currentSelection++;
}
@@ -763,7 +756,7 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
}
}
- if (currentSelection != oldSelection) { // old != new
+ if (currentSelection != oldSelection) { // old != new
if (needMouseSave) {
hideMouse();
}
@@ -789,7 +782,7 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
getMouseData(mouseUpdateStatus, &button, &dummyU16, &dummyU16);
} while (button && !g_cine->shouldQuit());
- if (var_4 == 2) { // recheck
+ if (var_4 == 2) { // recheck
if (!recheckValue)
return -1;
else
@@ -809,7 +802,7 @@ void makeActionMenu() {
getMouseData(mouseUpdateStatus, &mouseButton, &mouseX, &mouseY);
if (g_cine->getGameType() == Cine::GType_OS) {
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70, true);
}
@@ -818,7 +811,7 @@ void makeActionMenu() {
canUseOnObject = canUseOnItemTable[playerCommand];
}
} else {
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
}
}
@@ -1185,7 +1178,7 @@ void removeMessages() {
Common::List<overlay>::iterator it;
bool remove;
- for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ) {
+ for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end();) {
if (g_cine->getGameType() == Cine::GType_OS) {
// NOTE: These are really removeOverlay calls that have been deferred.
// In Operation Stealth's disassembly elements are removed from the
@@ -1348,7 +1341,7 @@ void modifySeqListElement(uint16 objIdx, int16 var4Test, int16 param1, int16 par
}
void computeMove1(SeqListElement &element, int16 x, int16 y, int16 param1,
- int16 param2, int16 x2, int16 y2) {
+ int16 param2, int16 x2, int16 y2) {
element.var16 = 0;
element.var14 = 0;
@@ -1397,7 +1390,7 @@ uint16 addAni(uint16 param1, uint16 objIdx, const int8 *ptr, SeqListElement &ele
int16 di;
debug(5, "addAni: param1 = %d, objIdx = %d, ptr = %p, element.var8 = %d, element.var14 = %d param3 = %d",
- param1, objIdx, ptr, element.var8, element.var14, param3);
+ param1, objIdx, ptr, element.var8, element.var14, param3);
// In the original an error string is set and 0 is returned if the following doesn't hold
assert(ptr);
@@ -1413,16 +1406,16 @@ uint16 addAni(uint16 param1, uint16 objIdx, const int8 *ptr, SeqListElement &ele
di = (g_cine->_objectTable[objIdx].costume + 1) % (*ptrData);
++ptrData; // Jump over the just read byte
// Here ptr2 seems to be indexing a table of structs (8 bytes per struct):
- // struct {
- // int8 x; // 0 (Used with checkCollision)
- // int8 y; // 1 (Used with checkCollision)
- // int8 numZones; // 2 (Used with checkCollision)
- // int8 var3; // 3 (Not used in this function)
- // int8 xAdd; // 4 (Used with an object)
- // int8 yAdd; // 5 (Used with an object)
- // int8 maskAdd; // 6 (Used with an object)
- // int8 frameAdd; // 7 (Used with an object)
- // };
+ // struct {
+ // int8 x; // 0 (Used with checkCollision)
+ // int8 y; // 1 (Used with checkCollision)
+ // int8 numZones; // 2 (Used with checkCollision)
+ // int8 var3; // 3 (Not used in this function)
+ // int8 xAdd; // 4 (Used with an object)
+ // int8 yAdd; // 5 (Used with an object)
+ // int8 maskAdd; // 6 (Used with an object)
+ // int8 frameAdd; // 7 (Used with an object)
+ // };
ptr2 = ptrData + di * 8;
// We might probably safely discard the AND by 1 here because
@@ -1572,8 +1565,7 @@ void processSeqListElement(SeqListElement &element) {
var_4 = -1;
if ((element.var16 == 1
- && !addAni(3, element.objIdx, ptr1, element, 0, &var_4)) || (element.var16 == 2 && !addAni(2, element.objIdx, ptr1, element, 0,
- &var_4))) {
+ && !addAni(3, element.objIdx, ptr1, element, 0, &var_4)) || (element.var16 == 2 && !addAni(2, element.objIdx, ptr1, element, 0, &var_4))) {
if (element.varC == 255) {
g_cine->_globalVars[VAR_MOUSE_Y_POS] = 0;
}
@@ -1702,9 +1694,9 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
}
break;
default:
- if (((keycode >= 'a') && (keycode <='z')) ||
- ((keycode >= '0') && (keycode <='9')) ||
- ((keycode >= 'A') && (keycode <='Z')) ||
+ if (((keycode >= 'a') && (keycode <= 'z')) ||
+ ((keycode >= '0') && (keycode <= '9')) ||
+ ((keycode >= 'A') && (keycode <= 'Z')) ||
(keycode == ' ')) {
if (inputLength < stringMaxLength - 1) {
ch[0] = keycode;
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 0925e55309..fbafd36c9a 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -91,20 +91,20 @@ public:
};
void MidiParser_MSC::parseMetaEvent(EventInfo &info) {
- uint8 type = read1(_position._play_pos);
- uint8 len = read1(_position._play_pos);
+ uint8 type = read1(_position._playPos);
+ uint8 len = read1(_position._playPos);
info.ext.type = type;
info.length = len;
info.ext.data = 0;
if (type == 0x51) {
- info.ext.data = _position._play_pos;
+ info.ext.data = _position._playPos;
} else {
warning("unknown meta event 0x%02X", type);
info.ext.type = 0;
}
- _position._play_pos += len;
+ _position._playPos += len;
}
void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
@@ -116,13 +116,13 @@ void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
case 0xA:
case 0xB:
case 0xE:
- info.basic.param1 = read1(_position._play_pos);
- info.basic.param2 = read1(_position._play_pos);
+ info.basic.param1 = read1(_position._playPos);
+ info.basic.param2 = read1(_position._playPos);
break;
case 0xC:
case 0xD:
- info.basic.param1 = read1(_position._play_pos);
+ info.basic.param1 = read1(_position._playPos);
info.basic.param2 = 0;
break;
@@ -135,9 +135,9 @@ void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
}
void MidiParser_MSC::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
+ info.start = _position._playPos;
- if (_position._play_pos >= _trackEnd) {
+ if (_position._playPos >= _trackEnd) {
// fake an end-of-track meta event
info.delta = 0;
info.event = 0xFF;
@@ -146,8 +146,8 @@ void MidiParser_MSC::parseNextEvent(EventInfo &info) {
return;
}
- info.delta = readVLQ(_position._play_pos);
- info.event = read1(_position._play_pos);
+ info.delta = readVLQ(_position._playPos);
+ info.event = read1(_position._playPos);
if (info.event == 0xFF) {
parseMetaEvent(info);
@@ -155,7 +155,7 @@ void MidiParser_MSC::parseNextEvent(EventInfo &info) {
}
if (info.event < 0x80) {
- _position._play_pos--;
+ _position._playPos--;
info.event = _lastEvent;
}
@@ -185,7 +185,7 @@ bool MidiParser_MSC::loadMusic(byte *data, uint32 size) {
_lastEvent = 0;
_trackEnd = data + size;
- _num_tracks = 1;
+ _numTracks = 1;
_tracks[0] = pos;
setTempo(500000);
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 422948f975..4e54797960 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -98,7 +98,7 @@ bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, in
midiMixChannels();
}
- _num_tracks = 1;
+ _numTracks = 1;
_tracks[0] = _mixedData;
if (_pSnd)
setTrack(0);
@@ -144,7 +144,7 @@ byte *MidiParser_SCI::midiMixChannels() {
_mixedData = outData;
long ticker = 0;
byte channelNr, curDelta;
- byte midiCommand = 0, midiParam, global_prev = 0;
+ byte midiCommand = 0, midiParam, globalPrev = 0;
long newDelta;
SoundResource::Channel *channel;
@@ -190,13 +190,13 @@ byte *MidiParser_SCI::midiMixChannels() {
byte midiChannel = midiCommand & 0xF;
_channelUsed[midiChannel] = true;
- if (midiCommand != global_prev)
+ if (midiCommand != globalPrev)
*outData++ = midiCommand;
*outData++ = midiParam;
if (nMidiParams[(midiCommand >> 4) - 8] == 2)
*outData++ = channel->data[channel->curPos++];
channel->prev = midiCommand;
- global_prev = midiCommand;
+ globalPrev = midiCommand;
}
}
@@ -372,8 +372,8 @@ void MidiParser_SCI::unloadMusic() {
resetTracking();
allNotesOff();
}
- _num_tracks = 0;
- _active_track = 255;
+ _numTracks = 0;
+ _activeTrack = 255;
_resetOnPause = false;
if (_mixedData) {
@@ -454,26 +454,26 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
debugC(4, kDebugLevelSound, "signal %04x", _signalToSet);
}
- info.start = _position._play_pos;
+ info.start = _position._playPos;
info.delta = 0;
- while (*_position._play_pos == 0xF8) {
+ while (*_position._playPos == 0xF8) {
info.delta += 240;
- _position._play_pos++;
+ _position._playPos++;
}
- info.delta += *(_position._play_pos++);
+ info.delta += *(_position._playPos++);
// Process the next info.
- if ((_position._play_pos[0] & 0xF0) >= 0x80)
- info.event = *(_position._play_pos++);
+ if ((_position._playPos[0] & 0xF0) >= 0x80)
+ info.event = *(_position._playPos++);
else
- info.event = _position._running_status;
+ info.event = _position._runningStatus;
if (info.event < 0x80)
return;
- _position._running_status = info.event;
+ _position._runningStatus = info.event;
switch (info.command()) {
case 0xC:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
if (info.channel() == 0xF) {// SCI special case
if (info.basic.param1 != kSetSignalLoop) {
@@ -488,23 +488,23 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
// in glitches (e.g. the intro of LB1 Amiga gets stuck - bug
// #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp.
if (_soundVersion <= SCI_VERSION_0_LATE ||
- _position._play_tick || info.delta) {
+ _position._playTick || info.delta) {
_signalSet = true;
_signalToSet = info.basic.param1;
}
} else {
- _loopTick = _position._play_tick + info.delta;
+ _loopTick = _position._playTick + info.delta;
}
}
break;
case 0xD:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
// Reference for some events:
// http://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format#Status_Reference
@@ -588,8 +588,8 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case 0x9:
case 0xA:
case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
if (info.command() == 0x9 && info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
@@ -598,12 +598,12 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case 0xF: // System Common, Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
break;
case 0x3: // Song Select
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
@@ -617,16 +617,16 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
break;
case 0x0: // SysEx
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
break;
case 0xF: // META event
- info.ext.type = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.ext.type = *(_position._playPos++);
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
if (info.ext.type == 0x2F) {// end of track reached
if (_pSnd->loop)
_pSnd->loop--;
@@ -677,21 +677,21 @@ void MidiParser_SCI::allNotesOff() {
// Turn off all active notes
for (i = 0; i < 128; ++i) {
for (j = 0; j < 16; ++j) {
- if ((_active_notes[i] & (1 << j)) && (_channelRemap[j] != -1)){
+ if ((_activeNotes[i] & (1 << j)) && (_channelRemap[j] != -1)){
sendToDriver(0x80 | j, i, 0);
}
}
}
// Turn off all hanging notes
- for (i = 0; i < ARRAYSIZE(_hanging_notes); i++) {
- byte midiChannel = _hanging_notes[i].channel;
- if ((_hanging_notes[i].time_left) && (_channelRemap[midiChannel] != -1)) {
- sendToDriver(0x80 | midiChannel, _hanging_notes[i].note, 0);
- _hanging_notes[i].time_left = 0;
+ for (i = 0; i < ARRAYSIZE(_hangingNotes); i++) {
+ byte midiChannel = _hangingNotes[i].channel;
+ if ((_hangingNotes[i].timeLeft) && (_channelRemap[midiChannel] != -1)) {
+ sendToDriver(0x80 | midiChannel, _hangingNotes[i].note, 0);
+ _hangingNotes[i].timeLeft = 0;
}
}
- _hanging_notes_count = 0;
+ _hangingNotesCount = 0;
// To be sure, send an "All Note Off" event (but not all MIDI devices
// support this...).
@@ -703,7 +703,7 @@ void MidiParser_SCI::allNotesOff() {
}
}
- memset(_active_notes, 0, sizeof(_active_notes));
+ memset(_activeNotes, 0, sizeof(_activeNotes));
}
void MidiParser_SCI::setMasterVolume(byte masterVolume) {
diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
index 82f34070a4..d3fd337644 100644
--- a/engines/sci/sound/midiparser_sci.h
+++ b/engines/sci/sound/midiparser_sci.h
@@ -65,7 +65,7 @@ public:
void setMasterVolume(byte masterVolume);
void setVolume(byte volume);
void stop() {
- _abort_parse = true;
+ _abortParse = true;
allNotesOff();
}
void pause() {
diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp
index 1a31d1ca82..8549a9262d 100644
--- a/engines/scumm/midiparser_ro.cpp
+++ b/engines/scumm/midiparser_ro.cpp
@@ -62,13 +62,13 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
info.delta = 0;
do {
- info.start = _position._play_pos;
- info.event = *(_position._play_pos++);
+ info.start = _position._playPos;
+ info.event = *(_position._playPos++);
if (info.command() == 0xA) {
++_lastMarkerCount;
info.event = 0xF0;
} else if (info.event == 0xF0 || info.event == 0xF1) {
- byte delay = *(_position._play_pos++);
+ byte delay = *(_position._playPos++);
info.delta += delay;
if (info.event == 0xF1) {
// This event is, as far as we have been able
@@ -95,16 +95,16 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
if (info.event < 0x80)
return;
- _position._running_status = info.event;
+ _position._runningStatus = info.event;
switch (info.command()) {
case 0xC:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
case 0x8: case 0x9: case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
if (info.command() == 0x9 && info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
@@ -133,7 +133,7 @@ bool MidiParser_RO::loadMusic (byte *data, uint32 size) {
return false;
}
- _num_tracks = 1;
+ _numTracks = 1;
_ppqn = 120;
_tracks[0] = pos + 2;
_markerCount = _lastMarkerCount = 0;
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp
index f0a9197c6d..516e55b53b 100644
--- a/engines/tony/custom.cpp
+++ b/engines/tony/custom.cpp
@@ -41,7 +41,7 @@
namespace Tony {
-const char *ambianceFile[] = {
+static const char *kAmbianceFile[] = {
"None",
"1.ADP", // Grilli.WAV
"2.ADP", // Grilli-Ovattati.WAV
@@ -52,66 +52,38 @@ const char *ambianceFile[] = {
"6.ADP" // Mare1.WAV half volume
};
-struct MusicFileEntry {
- const char *name;
- int sync;
-};
-
-const MusicFileEntry musicFiles[] = {
- {"00.ADP", 0}, {"01.ADP", 0},
- {"02.ADP", 0}, {"03.ADP", 0},
- {"04.ADP", 0}, {"05.ADP", 0},
- {"06.ADP", 0}, {"07.ADP", 0},
- {"08.ADP", 2450}, {"09.ADP", 0},
- {"10.ADP", 0}, {"11.ADP", 0},
- {"12.ADP", 0}, {"13.ADP", 0},
- {"14.ADP", 0}, {"15.ADP", 0},
- {"16.ADP", 0}, {"17.ADP", 0},
- {"18.ADP", 0}, {"19.ADP", 0},
- {"20.ADP", 0}, {"21.ADP", 0},
- {"22.ADP", 0}, {"23.ADP", 0},
- {"24.ADP", 0}, {"25.ADP", 0},
- {"26.ADP", 0}, {"27.ADP", 0},
- {"28.ADP", 1670}, {"29.ADP", 0},
- {"30.ADP", 0}, {"31.ADP", 0},
- {"32.ADP", 2900}, {"33.ADP", 0},
- {"34.ADP", 0}, {"35.ADP", 0},
- {"36.ADP", 0}, {"37.ADP", 0},
- {"38.ADP", 0}, {"39.ADP", 0},
- {"40.ADP", 0}, {"41.ADP", 1920},
- {"42.ADP", 1560}, {"43.ADP", 1920},
- {"44.ADP", 1920}, {"45.ADP", 1920},
- {"46.ADP", 1920}, {"47.ADP", 1920},
- {"48.ADP", 1920}, {"49.ADP", 1920},
- {"50.ADP", 1920}, {"51.ADP", 1920},
- {"52.ADP", 1920}, {"53.ADP", 0},
- {"54.ADP", 0}, {"55.ADP", 0},
- {"56.ADP", 0}, {"57.ADP", 0},
- {"58.ADP", 0}, {"59.ADP", 0}
+static const MusicFileEntry kMusicFiles[] = {
+ {"00.ADP", 0}, {"01.ADP", 0}, {"02.ADP", 0}, {"03.ADP", 0},
+ {"04.ADP", 0}, {"05.ADP", 0}, {"06.ADP", 0}, {"07.ADP", 0},
+ {"08.ADP", 2450}, {"09.ADP", 0}, {"10.ADP", 0}, {"11.ADP", 0},
+ {"12.ADP", 0}, {"13.ADP", 0}, {"14.ADP", 0}, {"15.ADP", 0},
+ {"16.ADP", 0}, {"17.ADP", 0}, {"18.ADP", 0}, {"19.ADP", 0},
+ {"20.ADP", 0}, {"21.ADP", 0}, {"22.ADP", 0}, {"23.ADP", 0},
+ {"24.ADP", 0}, {"25.ADP", 0}, {"26.ADP", 0}, {"27.ADP", 0},
+ {"28.ADP", 1670}, {"29.ADP", 0}, {"30.ADP", 0}, {"31.ADP", 0},
+ {"32.ADP", 2900}, {"33.ADP", 0}, {"34.ADP", 0}, {"35.ADP", 0},
+ {"36.ADP", 0}, {"37.ADP", 0}, {"38.ADP", 0}, {"39.ADP", 0},
+ {"40.ADP", 0}, {"41.ADP", 1920}, {"42.ADP", 1560}, {"43.ADP", 1920},
+ {"44.ADP", 1920}, {"45.ADP", 1920}, {"46.ADP", 1920}, {"47.ADP", 1920},
+ {"48.ADP", 1920}, {"49.ADP", 1920}, {"50.ADP", 1920}, {"51.ADP", 1920},
+ {"52.ADP", 1920}, {"53.ADP", 0}, {"54.ADP", 0}, {"55.ADP", 0},
+ {"56.ADP", 0}, {"57.ADP", 0}, {"58.ADP", 0}, {"59.ADP", 0}
};
-const char *jingleFileNames[] = {
- "S00.ADP", "S01.ADP",
- "S02.ADP", "S03.ADP",
- "S04.ADP", "S05.ADP",
- "S06.ADP", "S07.ADP",
- "S08.ADP", "S09.ADP",
- "S10.ADP", "S11.ADP",
- "S12.ADP", "S13.ADP",
- "S14.ADP", "S15.ADP",
- "S16.ADP", "S17.ADP",
- "S18.ADP"
+static const char *kJingleFileNames[] = {
+ "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP",
+ "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP",
+ "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP",
+ "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP"
};
-
-void ReapplyChangedHotspot() {
- int i;
- for (i = 0; i < GLOBALS._curChangedHotspot; i++)
+void reapplyChangedHotspot() {
+ for (int i = 0; i < GLOBALS._curChangedHotspot; i++)
GLOBALS._loc->getItemFromCode(GLOBALS._changedHotspot[i]._dwCode)->changeHotspot(RMPoint(GLOBALS._changedHotspot[i]._nX, GLOBALS._changedHotspot[i]._nY));
}
-void SaveChangedHotspot(Common::OutSaveFile *f) {
+void saveChangedHotspot(Common::OutSaveFile *f) {
f->writeByte(GLOBALS._curChangedHotspot);
if (GLOBALS._curChangedHotspot > 0) {
for (int i = 0; i < GLOBALS._curChangedHotspot; ++i)
@@ -119,7 +91,7 @@ void SaveChangedHotspot(Common::OutSaveFile *f) {
}
}
-void LoadChangedHotspot(Common::InSaveFile *f) {
+void loadChangedHotspot(Common::InSaveFile *f) {
GLOBALS._curChangedHotspot = f->readByte();
if (GLOBALS._curChangedHotspot > 0) {
@@ -128,7 +100,6 @@ void LoadChangedHotspot(Common::InSaveFile *f) {
}
}
-
/**
* Classes required for custom functions
*
@@ -139,14 +110,14 @@ void LoadChangedHotspot(Common::InSaveFile *f) {
* AddInventory -> theEngine.AddInventory()
*/
-void MCharResetCodes() {
+void mCharResetCodes() {
for (int i = 0; i < 10; i++)
GLOBALS._mCharacter[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[i]._code);
for (int i = 0; i < 10; i++)
GLOBALS._character[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._character[i]._code);
}
-void CharsSaveAll(Common::OutSaveFile *f) {
+void charsSaveAll(Common::OutSaveFile *f) {
for (int i = 0; i < 10; i++) {
f->writeByte(GLOBALS._isMChar[i]);
if (GLOBALS._isMChar[i]) {
@@ -157,7 +128,7 @@ void CharsSaveAll(Common::OutSaveFile *f) {
}
}
-void CharsLoadAll(Common::InSaveFile *f) {
+void charsLoadAll(Common::InSaveFile *f) {
for (int i = 0; i < 10; i++) {
GLOBALS._isMChar[i] = f->readByte();
if (GLOBALS._isMChar[i])
@@ -167,28 +138,28 @@ void CharsLoadAll(Common::InSaveFile *f) {
}
}
-DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void faceToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDDOWN);
}
-DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void backToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDUP);
}
-DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void leftToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDLEFT);
}
-DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void rightToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDRIGHT);
}
-DECLARE_CUSTOM_FUNCTION(TonySetPerorate)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
+void tonySetPerorate(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
g_vm->getEngine()->setPerorate(bStatus);
}
-DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) {
+void mySleep(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
int i;
CORO_END_CONTEXT(_ctx);
@@ -201,12 +172,12 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) {
+void setAlwaysDisplay(CORO_PARAM, uint32 val, uint32, uint32, uint32) {
GLOBALS._bAlwaysDisplay = (val != 0);
}
-DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) {
+void setPointer(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) {
switch (dwPointer) {
case 1:
GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWUP);
@@ -230,7 +201,7 @@ DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32
}
}
-VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) {
+VoiceHeader *searchVoiceHeader(uint32 codehi, uint32 codelo) {
int code = (codehi << 16) | codelo;
if (g_vm->_voices.size() == 0)
@@ -245,7 +216,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) {
}
-DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) {
+void sendTonyMessage(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage msg;
int i;
@@ -266,7 +237,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
if (!_ctx->msg.isValid())
return;
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Is positioned within the database of entries beginning at the first
@@ -362,12 +333,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) {
+void changeBoxStatus(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) {
GLOBALS._boxes->changeBoxStatus(nLoc, nBox, nStatus);
}
-DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
+void custLoadLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
CORO_BEGIN_CONTEXT;
uint32 h;
CORO_END_CONTEXT(_ctx);
@@ -390,7 +361,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
+void sendFullscreenMsgStart(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
RMGfxClearTask clear;
@@ -449,7 +420,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void clearScreen(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
char buf[256];
RMGfxClearTask clear;
@@ -469,33 +440,33 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32)
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) {
+void sendFullscreenMsgEnd(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) {
g_vm->getEngine()->loadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1));
if (!bNotEnableTony)
GLOBALS._tony->show();
- MCharResetCodes();
- ReapplyChangedHotspot();
+ mCharResetCodes();
+ reapplyChangedHotspot();
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
+void sendFullscreenMessage(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(SendFullscreenMsgStart, nMsg, nFont, 0, 0);
- CORO_INVOKE_4(SendFullscreenMsgEnd, 0, 0, 0, 0);
+ CORO_INVOKE_4(sendFullscreenMsgStart, nMsg, nFont, 0, 0);
+ CORO_INVOKE_4(sendFullscreenMsgEnd, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(NoBullsEye)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void noBullsEye(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bNoBullsEye = true;
}
-DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void closeLocation(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -515,7 +486,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3
}
-DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
+void changeLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
CORO_BEGIN_CONTEXT;
uint32 h;
CORO_END_CONTEXT(_ctx);
@@ -543,7 +514,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) {
GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc];
if (GLOBALS._lastTappeto != 0)
- g_vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000);
+ g_vm->playMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true, 2000);
}
if (!GLOBALS._bNoBullsEye) {
@@ -566,51 +537,49 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
+void setLocStartPosition(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
GLOBALS._startLocPos[nLoc].set(lX, lY);
}
-DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void saveTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._saveTonyPos = GLOBALS._tony->position();
GLOBALS._saveTonyLoc = GLOBALS._loc->TEMPGetNumLoc();
}
-DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void restoreTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0);
+ CORO_INVOKE_4(changeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0);
- MCharResetCodes();
+ mCharResetCodes();
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void disableInput(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->getEngine()->disableInput();
}
-DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void enableInput(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->getEngine()->enableInput();
}
-DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopTony(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->stopNoAction(coroParam);
}
-DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void custEnableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.EnableGUI();
}
-DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void custDisableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.DisableGUI();
}
-
-
-void TonyGenericTake1(CORO_PARAM, uint32 nDirection) {
+void tonyGenericTake1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -624,7 +593,7 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericTake2(CORO_PARAM, uint32 nDirection) {
+void tonyGenericTake2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -640,7 +609,7 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericPut1(CORO_PARAM, uint32 nDirection) {
+void tonyGenericPut1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -654,7 +623,7 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericPut2(CORO_PARAM, uint32 nDirection) {
+void tonyGenericPut2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -671,71 +640,65 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) {
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 0);
+void tonyTakeUp1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 0);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 1);
+void tonyTakeMid1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 2);
+void tonyTakeDown1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 2);
}
-
-
-DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 0);
+void tonyTakeUp2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 0);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 1);
+void tonyTakeMid2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 2);
+void tonyTakeDown2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 2);
}
-
-
-DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 0);
+void tonyPutUp1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 0);
}
-
-DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 1);
+void tonyPutMid1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 2);
+void tonyPutDown1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 2);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 0);
+void tonyPutUp2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 0);
}
-
-DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 1);
+void tonyPutMid2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 2);
+void tonyPutDown2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 2);
}
-DECLARE_CUSTOM_FUNCTION(TonyOnTheFloor)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
+void tonyOnTheFloor(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
if (dwParte == 0)
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORLEFT);
else
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORRIGHT);
}
-DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
+void tonyGetUp(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -752,11 +715,11 @@ DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyShepherdess)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) {
+void tonyShepherdess(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) {
GLOBALS._tony->setShepherdess(bIsPast);
}
-DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWhistle(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -771,98 +734,97 @@ DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32)
CORO_END_CODE;
}
-
-void TonySetNumTexts(uint32 dwText) {
+void tonySetNumTexts(uint32 dwText) {
GLOBALS._dwTonyNumTexts = dwText;
GLOBALS._bTonyInTexts = false;
}
-DECLARE_CUSTOM_FUNCTION(TonyLaugh)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyLaugh(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH;
}
-DECLARE_CUSTOM_FUNCTION(TonyGiggle)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyGiggle(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH2;
}
-DECLARE_CUSTOM_FUNCTION(TonyHips)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyHips(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_HIPS;
}
-DECLARE_CUSTOM_FUNCTION(TonySing)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonySing(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SING;
}
-DECLARE_CUSTOM_FUNCTION(TonyIndicate)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyIndicate(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_INDICATE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredWithHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyScaredWithHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredWithoutHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyScaredWithoutHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED2;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithHammer)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithHammer(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHHAMMER;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHHAMMER);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithGlasses)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithGlasses(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHGLASSES;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHGLASSES);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithWorm)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithWorm(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHWORM;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHWORM);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRope)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRope(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHROPE;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHROPE);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSecretary)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithSecretary(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSECRETARY;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHSECRETARY);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRabbitANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRABBIT;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRecipeANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRECIPE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithCardsANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHCARDS;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithSnowmanANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSNOWMAN;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithSnowmanStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -875,7 +837,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithSnowmanEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -888,7 +850,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRabbitStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -901,7 +863,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRabbitEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -914,7 +876,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRecipeStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -927,7 +889,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRecipeEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -940,7 +902,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithCardsStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -953,7 +915,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithCardsEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -966,7 +928,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithNotebookStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -979,7 +941,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint3
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithNotebookEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -992,7 +954,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithMegaphoneStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1005,7 +967,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithMegaphoneEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1018,7 +980,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithBeardStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1031,7 +993,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithBeardEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1044,7 +1006,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyScaredStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1057,7 +1019,7 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyScaredEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1071,12 +1033,12 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint3
}
-DECLARE_CUSTOM_FUNCTION(TonyDisgusted)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyDisgusted(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_DISGUSTED;
}
-DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonySniffLeft(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1084,12 +1046,12 @@ DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint3
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_LEFT);
CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern);
- CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0);
+ CORO_INVOKE_4(leftToMe, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonySniffRight(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1097,17 +1059,17 @@ DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_RIGHT);
CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern);
- CORO_INVOKE_4(RightToMe, 0, 0, 0, 0);
+ CORO_INVOKE_4(rightToMe, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonySarcastic)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonySarcastic(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SARCASTIC;
}
-DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) {
+void tonyMacbeth(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) {
switch (nPos) {
case 1:
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH1;
@@ -1140,15 +1102,15 @@ DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, ui
}
-DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void enableTony(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->show();
}
-DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) {
+void disableTony(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) {
GLOBALS._tony->hide(bShowShadow);
}
-DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) {
+void waitForPatternEnd(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMItem *item;
CORO_END_CONTEXT(_ctx);
@@ -1164,11 +1126,11 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin
}
-DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) {
+void setTonyPosition(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) {
GLOBALS._tony->setPosition(RMPoint(nX, nY), nLoc);
}
-DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
+void moveTonyAndWait(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1187,11 +1149,11 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
+void moveTony(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
GLOBALS._tony->move(coroParam, RMPoint(nX, nY));
}
-DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
+void scrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
CORO_BEGIN_CONTEXT;
int lx, ly;
RMPoint pt;
@@ -1239,7 +1201,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
+void syncScrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
CORO_BEGIN_CONTEXT;
int lx, ly;
RMPoint pt, startpt;
@@ -1321,7 +1283,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
}
-DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) {
+void changeHotspot(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) {
int i;
for (i = 0; i < GLOBALS._curChangedHotspot; i++) {
@@ -1343,15 +1305,15 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin
}
-DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void autoSave(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->autoSave(coroParam);
}
-DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void abortGame(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->abortGame();
}
-DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
+void shakeScreen(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
uint32 i;
uint32 curTime;
@@ -1389,7 +1351,7 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32,
* Characters
*/
-DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
+void charSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._code = nCode;
GLOBALS._character[nChar]._item = GLOBALS._loc->getItemFromCode(nCode);
@@ -1404,26 +1366,26 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uin
GLOBALS._isMChar[nChar] = false;
}
-DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
+void charSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
assert(nChar < 16);
GLOBALS._character[nChar]._r = r;
GLOBALS._character[nChar]._g = g;
GLOBALS._character[nChar]._b = b;
}
-DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) {
+void charSetTalkPattern(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._talkPattern = tp;
GLOBALS._character[nChar]._standPattern = sp;
}
-DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) {
+void charSetStartEndTalkPattern(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._startTalkPattern = sp;
GLOBALS._character[nChar]._endTalkPattern = ep;
}
-DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) {
+void charSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
int i;
@@ -1450,7 +1412,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._talkPattern);
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Position within the database of entries, beginning at the first
@@ -1530,15 +1492,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
+void addInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
GLOBALS._inventory->addItem(dwCode);
}
-DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
+void removeInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
GLOBALS._inventory->removeItem(dwCode);
}
-DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) {
+void changeInventoryStatus(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) {
GLOBALS._inventory->changeItemStatus(dwCode, dwStatus);
}
@@ -1547,7 +1509,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32
* Master Characters
*/
-DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
+void mCharSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._code = nCode;
if (nCode == 0)
@@ -1569,56 +1531,52 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui
GLOBALS._isMChar[nChar] = true;
}
-DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) {
+void mCharResetCode(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) {
GLOBALS._mCharacter[nChar]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[nChar]._code);
}
-DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) {
+void mCharSetPosition(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._x = nX;
GLOBALS._mCharacter[nChar]._y = nY;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
+void mCharSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._r = r;
GLOBALS._mCharacter[nChar]._g = g;
GLOBALS._mCharacter[nChar]._b = b;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) {
+void mCharSetNumTalksInGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) {
assert(nChar < 10);
assert(nGroup < 10);
GLOBALS._mCharacter[nChar]._numTalks[nGroup] = nTalks;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) {
+void mCharSetCurrentGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) {
assert(nChar < 10);
assert(nGroup < 10);
GLOBALS._mCharacter[nChar]._curGroup = nGroup;
}
-DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) {
+void mCharSetNumTexts(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._numTexts = nTexts - 1;
GLOBALS._mCharacter[nChar]._bInTexts = false;
}
-DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) {
+void mCharSetAlwaysBack(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._bAlwaysBack = bAlwaysBack;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) {
+void mCharSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
int i;
@@ -1658,11 +1616,10 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
}
}
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Position within the database of entries, beginning at the first
- // fseek(g_vm->m_vdbFP, curVoc->offset, SEEK_SET);
g_vm->_vdbFP.seek(_ctx->curVoc->_offset);
_ctx->curOffset = _ctx->curVoc->_offset;
}
@@ -1744,9 +1701,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
* Dialogs
*/
-int g_curDialog;
-
-DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) {
+void sendDialogMessage(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) {
CORO_BEGIN_CONTEXT;
char *string;
RMTextDialog *text;
@@ -1766,7 +1721,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack)
_ctx->bIsBack = true;
- _ctx->curVoc = SearchVoiceHeader(g_curDialog, nMsg);
+ _ctx->curVoc = searchVoiceHeader(GLOBALS._curDialog, nMsg);
_ctx->voice = NULL;
if (_ctx->curVoc) {
@@ -1927,7 +1882,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
// @@@@ This cannot be skipped!!!!!!!!!!!!!!!!!!!
-DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) {
+void startDialog(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) {
CORO_BEGIN_CONTEXT;
uint32 nChoice;
uint32 *sl;
@@ -1939,7 +1894,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
CORO_BEGIN_CODE(_ctx);
- g_curDialog = nDialog;
+ GLOBALS._curDialog = nDialog;
// Call MPAL to start the dialog
mpalQueryDoDialog(nDialog, nStartGroup);
@@ -2010,7 +1965,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
* Sync between idle and mpal
*/
-DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
+void takeOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2028,7 +1983,7 @@ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
+void releaseOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
if (!GLOBALS._mut[num]._lockCount) {
warning("ReleaseOwnership tried to release mutex %d, which isn't held", num);
return;
@@ -2058,7 +2013,7 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32
*
*/
-void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) {
+void threadFadeInMusic(CORO_PARAM, const void *nMusic) {
CORO_BEGIN_CONTEXT;
int i;
CORO_END_CONTEXT(_ctx);
@@ -2083,7 +2038,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) {
CORO_END_CODE;
}
-void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) {
+void threadFadeOutMusic(CORO_PARAM, const void *nMusic) {
CORO_BEGIN_CONTEXT;
int i;
int startVolume;
@@ -2114,52 +2069,52 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) {
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(FadeInSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int));
+void fadeInSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ CoroScheduler.createProcess(threadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeOutSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeOutSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = false;
- CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int));
+ CoroScheduler.createProcess(threadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeOutJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeOutJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = false;
int channel = 2;
- CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int));
+ CoroScheduler.createProcess(threadFadeOutMusic, &channel, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeInJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeInJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
int channel = 2;
- CoroScheduler.createProcess(ThreadFadeInMusic, &channel, sizeof(int));
+ CoroScheduler.createProcess(threadFadeInMusic, &channel, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(StopSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->stopMusic(GLOBALS._curSoundEffect);
}
-DECLARE_CUSTOM_FUNCTION(StopJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->stopMusic(2);
}
-DECLARE_CUSTOM_FUNCTION(MuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void muteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(GLOBALS._curSoundEffect, 0);
}
-DECLARE_CUSTOM_FUNCTION(DemuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void demuteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = true;
g_vm->setMusicVolume(GLOBALS._curSoundEffect, 64);
}
-DECLARE_CUSTOM_FUNCTION(MuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void muteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(2, 0);
}
-DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void demuteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(2, 64);
}
-void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) {
+void custPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) {
if (nSync == 0)
nSync = 2000;
debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "Start CustPlayMusic");
@@ -2167,21 +2122,21 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int
debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "End CustPlayMusic");
}
-DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) {
+void playSoundEffect(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) {
if (nFX == 0 || nFX == 1 || nFX == 2) {
debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "PlaySoundEffect stop fadeout");
GLOBALS._bFadeOutStop = true;
}
GLOBALS._lastMusic = nMusic;
- CustPlayMusic(GLOBALS._curSoundEffect, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync);
+ custPlayMusic(GLOBALS._curSoundEffect, kMusicFiles[nMusic]._name, nFX, bNoLoop ? false : true, kMusicFiles[nMusic]._sync);
}
-DECLARE_CUSTOM_FUNCTION(PlayJingle)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) {
- CustPlayMusic(2, jingleFileNames[nMusic], nFX, bLoop);
+void playJingle(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) {
+ custPlayMusic(2, kJingleFileNames[nMusic], nFX, bLoop);
}
-DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) {
+void playItemSfx(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) {
if (nItem == 0) {
GLOBALS._tony->playSfx(nSFX);
} else {
@@ -2191,76 +2146,71 @@ DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint
}
}
-
-void RestoreMusic(CORO_PARAM) {
+void restoreMusic(CORO_PARAM) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0);
+ CORO_INVOKE_4(playSoundEffect, GLOBALS._lastMusic, 0, 0, 0);
if (GLOBALS._lastTappeto != 0)
- CustPlayMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true);
+ custPlayMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true);
CORO_END_CODE;
}
-void SaveMusic(Common::OutSaveFile *f) {
+void saveMusic(Common::OutSaveFile *f) {
f->writeByte(GLOBALS._lastMusic);
f->writeByte(GLOBALS._lastTappeto);
}
-void LoadMusic(Common::InSaveFile *f) {
+void loadMusic(Common::InSaveFile *f) {
GLOBALS._lastMusic = f->readByte();
GLOBALS._lastTappeto = f->readByte();
}
-
-DECLARE_CUSTOM_FUNCTION(JingleFadeStart)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
+void jingleFadeStart(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(FadeOutSoundEffect, 0, 0, 0, 0);
- CORO_INVOKE_4(MuteJingle, 0, 0, 0, 0);
- CORO_INVOKE_4(PlayJingle, nJingle, 0, bLoop, 0);
- CORO_INVOKE_4(FadeInJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeOutSoundEffect, 0, 0, 0, 0);
+ CORO_INVOKE_4(muteJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(playJingle, nJingle, 0, bLoop, 0);
+ CORO_INVOKE_4(fadeInJingle, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(JingleFadeEnd)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
+void jingleFadeEnd(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(FadeOutJingle, 0, 0, 0, 0);
- CORO_INVOKE_4(FadeInSoundEffect, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeOutJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeInSoundEffect, 0, 0, 0, 0);
CORO_END_CODE;
}
-
-
-
-DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void mustSkipIdleStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bSkipIdle = true;
CoroScheduler.setEvent(GLOBALS._hSkipIdle);
}
-DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void mustSkipIdleEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bSkipIdle = false;
CoroScheduler.resetEvent(GLOBALS._hSkipIdle);
}
-DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
+void patIrqFreeze(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
// Unused in ScummVM.
}
-DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void openInitLoadMenu(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2271,7 +2221,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void openInitOptions(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2282,8 +2232,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_END_CODE;
}
-
-DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) {
+void doCredits(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
RMTextDialog *text;
@@ -2355,159 +2304,157 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
CORO_END_CODE;
}
-
-
BEGIN_CUSTOM_FUNCTION_MAP()
-ASSIGN(1, CustLoadLocation)
-ASSIGN(2, MySleep)
-ASSIGN(3, SetPointer)
-ASSIGN(5, MoveTony)
-ASSIGN(6, FaceToMe)
-ASSIGN(7, BackToMe)
-ASSIGN(8, LeftToMe)
-ASSIGN(9, RightToMe)
-ASSIGN(10, SendTonyMessage)
-ASSIGN(11, ChangeBoxStatus)
-ASSIGN(12, ChangeLocation)
-ASSIGN(13, DisableTony)
-ASSIGN(14, EnableTony)
-ASSIGN(15, WaitForPatternEnd)
-ASSIGN(16, SetLocStartPosition)
-ASSIGN(17, ScrollLocation)
-ASSIGN(18, MoveTonyAndWait)
-ASSIGN(19, ChangeHotspot)
-ASSIGN(20, AddInventory)
-ASSIGN(21, RemoveInventory)
-ASSIGN(22, ChangeInventoryStatus)
-ASSIGN(23, SetTonyPosition)
-ASSIGN(24, SendFullscreenMessage)
-ASSIGN(25, SaveTonyPosition)
-ASSIGN(26, RestoreTonyPosition)
-ASSIGN(27, DisableInput)
-ASSIGN(28, EnableInput)
-ASSIGN(29, StopTony)
-
-ASSIGN(30, TonyTakeUp1)
-ASSIGN(31, TonyTakeMid1)
-ASSIGN(32, TonyTakeDown1)
-ASSIGN(33, TonyTakeUp2)
-ASSIGN(34, TonyTakeMid2)
-ASSIGN(35, TonyTakeDown2)
-
-ASSIGN(72, TonyPutUp1)
-ASSIGN(73, TonyPutMid1)
-ASSIGN(74, TonyPutDown1)
-ASSIGN(75, TonyPutUp2)
-ASSIGN(76, TonyPutMid2)
-ASSIGN(77, TonyPutDown2)
-
-ASSIGN(36, TonyOnTheFloor)
-ASSIGN(37, TonyGetUp)
-ASSIGN(38, TonyShepherdess)
-ASSIGN(39, TonyWhistle)
-
-ASSIGN(40, TonyLaugh)
-ASSIGN(41, TonyHips)
-ASSIGN(42, TonySing)
-ASSIGN(43, TonyIndicate)
-ASSIGN(44, TonyScaredWithHands)
-ASSIGN(49, TonyScaredWithoutHands)
-ASSIGN(45, TonyWithGlasses)
-ASSIGN(46, TonyWithWorm)
-ASSIGN(47, TonyWithHammer)
-ASSIGN(48, TonyWithRope)
-ASSIGN(90, TonyWithRabbitANIM)
-ASSIGN(91, TonyWithRecipeANIM)
-ASSIGN(92, TonyWithCardsANIM)
-ASSIGN(93, TonyWithSnowmanANIM)
-ASSIGN(94, TonyWithSnowmanStart)
-ASSIGN(95, TonyWithSnowmanEnd)
-ASSIGN(96, TonyWithRabbitStart)
-ASSIGN(97, TonyWithRabbitEnd)
-ASSIGN(98, TonyWithRecipeStart)
-ASSIGN(99, TonyWithRecipeEnd)
-ASSIGN(100, TonyWithCardsStart)
-ASSIGN(101, TonyWithCardsEnd)
-ASSIGN(102, TonyWithNotebookStart)
-ASSIGN(103, TonyWithNotebookEnd)
-ASSIGN(104, TonyWithMegaphoneStart)
-ASSIGN(105, TonyWithMegaphoneEnd)
-ASSIGN(106, TonyWithBeardStart)
-ASSIGN(107, TonyWithBeardEnd)
-ASSIGN(108, TonyGiggle)
-ASSIGN(109, TonyDisgusted)
-ASSIGN(110, TonySarcastic)
-ASSIGN(111, TonyMacbeth)
-ASSIGN(112, TonySniffLeft)
-ASSIGN(113, TonySniffRight)
-ASSIGN(114, TonyScaredStart)
-ASSIGN(115, TonyScaredEnd)
-ASSIGN(116, TonyWithSecretary)
-
-ASSIGN(50, CharSetCode)
-ASSIGN(51, CharSetColor)
-ASSIGN(52, CharSetTalkPattern)
-ASSIGN(53, CharSendMessage)
-ASSIGN(54, CharSetStartEndTalkPattern)
-
-ASSIGN(60, MCharSetCode)
-ASSIGN(61, MCharSetColor)
-ASSIGN(62, MCharSetCurrentGroup)
-ASSIGN(63, MCharSetNumTalksInGroup)
-ASSIGN(64, MCharSetNumTexts)
-ASSIGN(65, MCharSendMessage)
-ASSIGN(66, MCharSetPosition)
-ASSIGN(67, MCharSetAlwaysBack)
-ASSIGN(68, MCharResetCode)
-
-ASSIGN(70, StartDialog)
-ASSIGN(71, SendDialogMessage)
-
-ASSIGN(80, TakeOwnership)
-ASSIGN(81, ReleaseOwnership)
-
-ASSIGN(86, PlaySoundEffect)
-ASSIGN(87, PlayJingle)
-ASSIGN(88, FadeInSoundEffect)
-ASSIGN(89, FadeOutSoundEffect)
-ASSIGN(123, FadeInJingle)
-ASSIGN(124, FadeOutJingle)
-ASSIGN(125, MuteSoundEffect)
-ASSIGN(126, DemuteSoundEffect)
-ASSIGN(127, MuteJingle)
-ASSIGN(128, DemuteJingle)
-ASSIGN(84, StopSoundEffect)
-ASSIGN(85, StopJingle)
-ASSIGN(83, PlayItemSfx)
-ASSIGN(129, JingleFadeStart)
-ASSIGN(130, JingleFadeEnd)
-
-ASSIGN(120, ShakeScreen)
-ASSIGN(121, AutoSave)
-ASSIGN(122, AbortGame)
-ASSIGN(131, NoBullsEye)
-ASSIGN(132, SendFullscreenMsgStart)
-ASSIGN(133, SendFullscreenMsgEnd)
-ASSIGN(134, CustEnableGUI)
-ASSIGN(135, CustDisableGUI)
-ASSIGN(136, ClearScreen)
-ASSIGN(137, PatIrqFreeze)
-ASSIGN(138, TonySetPerorate)
-ASSIGN(139, OpenInitLoadMenu)
-ASSIGN(140, OpenInitOptions)
-ASSIGN(141, SyncScrollLocation)
-ASSIGN(142, CloseLocation)
-ASSIGN(143, SetAlwaysDisplay)
-ASSIGN(144, DoCredits)
-
-ASSIGN(200, MustSkipIdleStart);
-ASSIGN(201, MustSkipIdleEnd);
+ASSIGN(1, custLoadLocation)
+ASSIGN(2, mySleep)
+ASSIGN(3, setPointer)
+ASSIGN(5, moveTony)
+ASSIGN(6, faceToMe)
+ASSIGN(7, backToMe)
+ASSIGN(8, leftToMe)
+ASSIGN(9, rightToMe)
+ASSIGN(10, sendTonyMessage)
+ASSIGN(11, changeBoxStatus)
+ASSIGN(12, changeLocation)
+ASSIGN(13, disableTony)
+ASSIGN(14, enableTony)
+ASSIGN(15, waitForPatternEnd)
+ASSIGN(16, setLocStartPosition)
+ASSIGN(17, scrollLocation)
+ASSIGN(18, moveTonyAndWait)
+ASSIGN(19, changeHotspot)
+ASSIGN(20, addInventory)
+ASSIGN(21, removeInventory)
+ASSIGN(22, changeInventoryStatus)
+ASSIGN(23, setTonyPosition)
+ASSIGN(24, sendFullscreenMessage)
+ASSIGN(25, saveTonyPosition)
+ASSIGN(26, restoreTonyPosition)
+ASSIGN(27, disableInput)
+ASSIGN(28, enableInput)
+ASSIGN(29, stopTony)
+
+ASSIGN(30, tonyTakeUp1)
+ASSIGN(31, tonyTakeMid1)
+ASSIGN(32, tonyTakeDown1)
+ASSIGN(33, tonyTakeUp2)
+ASSIGN(34, tonyTakeMid2)
+ASSIGN(35, tonyTakeDown2)
+
+ASSIGN(72, tonyPutUp1)
+ASSIGN(73, tonyPutMid1)
+ASSIGN(74, tonyPutDown1)
+ASSIGN(75, tonyPutUp2)
+ASSIGN(76, tonyPutMid2)
+ASSIGN(77, tonyPutDown2)
+
+ASSIGN(36, tonyOnTheFloor)
+ASSIGN(37, tonyGetUp)
+ASSIGN(38, tonyShepherdess)
+ASSIGN(39, tonyWhistle)
+
+ASSIGN(40, tonyLaugh)
+ASSIGN(41, tonyHips)
+ASSIGN(42, tonySing)
+ASSIGN(43, tonyIndicate)
+ASSIGN(44, tonyScaredWithHands)
+ASSIGN(49, tonyScaredWithoutHands)
+ASSIGN(45, tonyWithGlasses)
+ASSIGN(46, tonyWithWorm)
+ASSIGN(47, tonyWithHammer)
+ASSIGN(48, tonyWithRope)
+ASSIGN(90, tonyWithRabbitANIM)
+ASSIGN(91, tonyWithRecipeANIM)
+ASSIGN(92, tonyWithCardsANIM)
+ASSIGN(93, tonyWithSnowmanANIM)
+ASSIGN(94, tonyWithSnowmanStart)
+ASSIGN(95, tonyWithSnowmanEnd)
+ASSIGN(96, tonyWithRabbitStart)
+ASSIGN(97, tonyWithRabbitEnd)
+ASSIGN(98, tonyWithRecipeStart)
+ASSIGN(99, tonyWithRecipeEnd)
+ASSIGN(100, tonyWithCardsStart)
+ASSIGN(101, tonyWithCardsEnd)
+ASSIGN(102, tonyWithNotebookStart)
+ASSIGN(103, tonyWithNotebookEnd)
+ASSIGN(104, tonyWithMegaphoneStart)
+ASSIGN(105, tonyWithMegaphoneEnd)
+ASSIGN(106, tonyWithBeardStart)
+ASSIGN(107, tonyWithBeardEnd)
+ASSIGN(108, tonyGiggle)
+ASSIGN(109, tonyDisgusted)
+ASSIGN(110, tonySarcastic)
+ASSIGN(111, tonyMacbeth)
+ASSIGN(112, tonySniffLeft)
+ASSIGN(113, tonySniffRight)
+ASSIGN(114, tonyScaredStart)
+ASSIGN(115, tonyScaredEnd)
+ASSIGN(116, tonyWithSecretary)
+
+ASSIGN(50, charSetCode)
+ASSIGN(51, charSetColor)
+ASSIGN(52, charSetTalkPattern)
+ASSIGN(53, charSendMessage)
+ASSIGN(54, charSetStartEndTalkPattern)
+
+ASSIGN(60, mCharSetCode)
+ASSIGN(61, mCharSetColor)
+ASSIGN(62, mCharSetCurrentGroup)
+ASSIGN(63, mCharSetNumTalksInGroup)
+ASSIGN(64, mCharSetNumTexts)
+ASSIGN(65, mCharSendMessage)
+ASSIGN(66, mCharSetPosition)
+ASSIGN(67, mCharSetAlwaysBack)
+ASSIGN(68, mCharResetCode)
+
+ASSIGN(70, startDialog)
+ASSIGN(71, sendDialogMessage)
+
+ASSIGN(80, takeOwnership)
+ASSIGN(81, releaseOwnership)
+
+ASSIGN(86, playSoundEffect)
+ASSIGN(87, playJingle)
+ASSIGN(88, fadeInSoundEffect)
+ASSIGN(89, fadeOutSoundEffect)
+ASSIGN(123, fadeInJingle)
+ASSIGN(124, fadeOutJingle)
+ASSIGN(125, muteSoundEffect)
+ASSIGN(126, demuteSoundEffect)
+ASSIGN(127, muteJingle)
+ASSIGN(128, demuteJingle)
+ASSIGN(84, stopSoundEffect)
+ASSIGN(85, stopJingle)
+ASSIGN(83, playItemSfx)
+ASSIGN(129, jingleFadeStart)
+ASSIGN(130, jingleFadeEnd)
+
+ASSIGN(120, shakeScreen)
+ASSIGN(121, autoSave)
+ASSIGN(122, abortGame)
+ASSIGN(131, noBullsEye)
+ASSIGN(132, sendFullscreenMsgStart)
+ASSIGN(133, sendFullscreenMsgEnd)
+ASSIGN(134, custEnableGUI)
+ASSIGN(135, custDisableGUI)
+ASSIGN(136, clearScreen)
+ASSIGN(137, patIrqFreeze)
+ASSIGN(138, tonySetPerorate)
+ASSIGN(139, openInitLoadMenu)
+ASSIGN(140, openInitOptions)
+ASSIGN(141, syncScrollLocation)
+ASSIGN(142, closeLocation)
+ASSIGN(143, setAlwaysDisplay)
+ASSIGN(144, doCredits)
+
+ASSIGN(200, mustSkipIdleStart);
+ASSIGN(201, mustSkipIdleEnd);
END_CUSTOM_FUNCTION_MAP()
void processKilledCallback(Common::PROCESS *p) {
- for (uint i = 0; i < 10; i++)
+ for (uint i = 0; i < 10; i++) {
if (GLOBALS._mut[i]._ownerPid == p->pid) {
// Handle scripts which don't call ReleaseOwnership, such as
// the one in loc37's vEnter when Tony is chasing the mouse.
@@ -2517,6 +2464,7 @@ void processKilledCallback(Common::PROCESS *p) {
GLOBALS._mut[i]._lockCount = 0;
CoroScheduler.setEvent(GLOBALS._mut[i]._eventId);
}
+ }
}
void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) {
@@ -2531,13 +2479,12 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation
GLOBALS.EnableGUI = mainEnableGUI;
GLOBALS._bAlwaysDisplay = false;
- int i;
CoroScheduler.setResourceCallback(processKilledCallback);
- for (i = 0; i < 10; i++)
+ for (int i = 0; i < 10; i++)
GLOBALS._mut[i]._eventId = CoroScheduler.createEvent(false, true);
- for (i = 0; i < 200; i++)
+ for (int i = 0; i < 200; i++)
GLOBALS._ambiance[i] = 0;
GLOBALS._ambiance[6] = AMBIANCE_CRICKETS;
diff --git a/engines/tony/custom.h b/engines/tony/custom.h
index 524ab14aab..0f1061e8cd 100644
--- a/engines/tony/custom.h
+++ b/engines/tony/custom.h
@@ -36,9 +36,12 @@ namespace Tony {
using namespace MPAL;
-#define INIT_CUSTOM_FUNCTION MapCustomFunctions
+struct MusicFileEntry {
+ const char *_name;
+ int _sync;
+};
-#define DECLARE_CUSTOM_FUNCTION(x) void x
+#define INIT_CUSTOM_FUNCTION MapCustomFunctions
#define BEGIN_CUSTOM_FUNCTION_MAP() \
static void AssignError(int num) { \
@@ -63,6 +66,17 @@ class RMLocation;
class RMInventory;
class RMInput;
+void charsSaveAll(Common::OutSaveFile *f);
+void charsLoadAll(Common::InSaveFile *f);
+void mCharResetCodes();
+void saveChangedHotspot(Common::OutSaveFile *f);
+void loadChangedHotspot(Common::InSaveFile *f);
+void reapplyChangedHotspot();
+
+void restoreMusic(CORO_PARAM);
+void saveMusic(Common::OutSaveFile *f);
+void loadMusic(Common::InSaveFile *f);
+
void INIT_CUSTOM_FUNCTION(LPCUSTOMFUNCTION *lpMap, Common::String *lpStrMap);
void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input);
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp
index 927adf9006..f4594f080d 100644
--- a/engines/tony/font.cpp
+++ b/engines/tony/font.cpp
@@ -84,10 +84,9 @@ void RMFont::unload() {
RMGfxPrimitive *RMFont::makeLetterPrimitive(byte bChar, int &nLength) {
RMFontPrimitive *prim;
- int nLett;
// Convert from character to glyph index
- nLett = convertToLetter(bChar);
+ int nLett = convertToLetter(bChar);
assert(nLett < _nLetters);
// Create primitive font
@@ -120,12 +119,11 @@ void RMFont::close() {
}
int RMFont::stringLen(const Common::String &text) {
- uint len, i;
-
if (text.empty())
return letterLength('\0');
- len = 0;
+ uint len = 0;
+ uint i;
for (i = 0; i < text.size() - 1; i++)
len += letterLength(text[i], text[i + 1]);
len += letterLength(text[i]);
@@ -157,7 +155,6 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
int gstep = g / 14;
int bstep = b / 14;
- int i;
byte pal[768 * 3];
// Check if we are already on the right color
@@ -169,7 +166,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
_fontB = b1;
// Constructs a new palette for the font
- for (i = 1; i < 16; i++) {
+ for (int i = 1; i < 16; i++) {
pal[i * 3 + 0] = r >> 16;
pal[i * 3 + 1] = g >> 16;
pal[i * 3 + 2] = b >> 16;
@@ -184,7 +181,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
pal[15 * 3 + 2] += 8;
// Puts in all the letters
- for (i = 0; i < _nLetters; i++)
+ for (int i = 0; i < _nLetters; i++)
_letter[i].loadPaletteWA(pal);
}
@@ -204,8 +201,6 @@ int RMFontWithTables::letterLength(int nChar, int nNext) {
\****************************************************************************/
void RMFontDialog::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
112 // base
@@ -222,7 +217,7 @@ void RMFontDialog::init() {
_hDefault = 18;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableDialog[i];
_lTable[i] = g_vm->_lTableDialog[i];
}
@@ -234,8 +229,6 @@ void RMFontDialog::init() {
\****************************************************************************/
void RMFontMacc::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
102 // base
@@ -245,7 +238,6 @@ void RMFontMacc::init() {
+ 8 // francais
+ 5; // deutsch
-
load(RES_F_MACC, nchars, 11, 16);
// Default
@@ -253,7 +245,7 @@ void RMFontMacc::init() {
_hDefault = 17;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableMacc[i];
_lTable[i] = g_vm->_lTableMacc[i];
}
@@ -264,8 +256,6 @@ void RMFontMacc::init() {
\****************************************************************************/
void RMFontCredits::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
112 // base
@@ -275,7 +265,6 @@ void RMFontCredits::init() {
+ 8 // french
+ 2; // deutsch
-
load(RES_F_CREDITS, nchars, 27, 28, RES_F_CPAL);
// Default
@@ -283,7 +272,7 @@ void RMFontCredits::init() {
_hDefault = 28;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableCred[i];
_lTable[i] = g_vm->_lTableCred[i];
}
@@ -305,10 +294,7 @@ void RMFontObj::setBothCase(int nChar, int nNext, signed char spiazz) {
_l2Table[TOLOWER(nChar)][TOLOWER(nNext)] = spiazz;
}
-
void RMFontObj::init() {
- int i;
-
//bernie: Number of characters in the font (solo maiuscolo)
int nchars =
85 // base
@@ -318,7 +304,6 @@ void RMFontObj::init() {
+ 0 // francais (no uppercase chars)
+ 1; // deutsch
-
load(RES_F_OBJ, nchars, 25, 30);
// Initialize the font table
@@ -326,7 +311,7 @@ void RMFontObj::init() {
_hDefault = 30;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableObj[i];
_lTable[i] = g_vm->_lTableObj[i];
}
@@ -345,7 +330,6 @@ void RMFontObj::init() {
setBothCase('R', 'U', 3);
}
-
/****************************************************************************\
* RMText Methods
\****************************************************************************/
@@ -409,11 +393,6 @@ void RMText::writeText(const Common::String &text, int nFont, int *time) {
void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
RMGfxPrimitive *prim;
- uint p, old_p;
- int j, x, y;
- int len;
- int numchar;
- int width, height;
// Set the base color
font->setBaseColor(_textR, _textG, _textB);
@@ -428,8 +407,9 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
// Divide the words into lines. In this cycle, X contains the maximum length reached by a line,
// and the number of lines
Common::Array<Common::String> lines;
- p = 0;
- j = x = 0;
+ uint p = 0;
+ int j = 0;
+ int x = 0;
while (p < text.size()) {
j += font->stringLen(text[p]);
if (j > (((_aHorType == HLEFTPAR) && (lines.size() > 0)) ? _maxLineLength - 25 : _maxLineLength)) {
@@ -443,7 +423,7 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
// width of a line caused discontinuation of the whole sentence.
// This workaround has the partial word broken up so it will still display
//
- old_p = p;
+ uint old_p = p;
while (text[p] != ' ' && text[p] != '-' && p > 0)
p--;
@@ -475,8 +455,8 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
x += 8;
// Starting position for the surface: X1, Y
- width = x;
- height = (lines.size() - 1) * font->letterHeight() + font->_fontDimy;
+ int width = x;
+ int height = (lines.size() - 1) * font->letterHeight() + font->_fontDimy;
// Create the surface
create(width, height);
@@ -484,8 +464,8 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
p = 0;
- y = 0;
- numchar = 0;
+ int y = 0;
+ int numchar = 0;
for (uint i = 0; i < lines.size(); ++i) {
const Common::String &line = lines[i];
@@ -522,6 +502,7 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
continue;
}
+ int len;
prim = font->makeLetterPrimitive(line[p], len);
prim->getDst()._x1 = x;
prim->getDst()._y1 = y;
@@ -987,8 +968,6 @@ void RMDialogChoice::close() {
}
void RMDialogChoice::setNumChoices(int num) {
- int i;
-
_numChoices = num;
_curAdded = 0;
@@ -997,7 +976,7 @@ void RMDialogChoice::setNumChoices(int num) {
_ptDrawStrings = new RMPoint[num];
// Initialization
- for (i = 0; i < _numChoices; i++) {
+ for (int i = 0; i < _numChoices; i++) {
_drawedStrings[i].setColor(0, 255, 0);
_drawedStrings[i].setAlignType(RMText::HLEFTPAR, RMText::VTOP);
_drawedStrings[i].setMaxLineLength(600);
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 2bcfdc7fc2..5b586611c9 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -34,7 +34,6 @@
#include "tony/mpal/memory.h"
#include "tony/mpal/mpal.h"
#include "tony/mpal/mpalutils.h"
-#include "tony/custom.h"
#include "tony/game.h"
#include "tony/gfxengine.h"
#include "tony/tony.h"
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 5c038e154d..abc9e03617 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -40,7 +40,7 @@ namespace Tony {
* RMGfxEngine Methods
\****************************************************************************/
-void ExitAllIdles(CORO_PARAM, const void *param) {
+void exitAllIdles(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -129,7 +129,7 @@ void RMGfxEngine::openOptionScreen(CORO_PARAM, int type) {
GLOBALS._bIdleExited = false;
- CoroScheduler.createProcess(ExitAllIdles, &_nCurLoc, sizeof(int));
+ CoroScheduler.createProcess(exitAllIdles, &_nCurLoc, sizeof(int));
}
}
@@ -532,17 +532,6 @@ void RMGfxEngine::disableMouse() {
_bAlwaysDrawMouse = false;
}
-void CharsSaveAll(Common::OutSaveFile *f);
-void CharsLoadAll(Common::InSaveFile *f);
-void MCharResetCodes();
-void SaveChangedHotspot(Common::OutSaveFile *f);
-void LoadChangedHotspot(Common::InSaveFile *f);
-void ReapplyChangedHotspot();
-
-void RestoreMusic(CORO_PARAM);
-void SaveMusic(Common::OutSaveFile *f);
-void LoadMusic(Common::InSaveFile *f);
-
#define TONY_SAVEGAME_VERSION 8
void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Common::String &name) {
@@ -617,7 +606,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
f->writeByte(bStat);
// Save the chars
- CharsSaveAll(f);
+ charsSaveAll(f);
// Save the options
f->writeByte(GLOBALS._bCfgInvLocked);
@@ -639,10 +628,10 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
f->writeByte(GLOBALS._nCfgSFXVolume);
// Save the hotspots
- SaveChangedHotspot(f);
+ saveChangedHotspot(f);
// Save the music
- SaveMusic(f);
+ saveMusic(f);
f->finalize();
delete f;
@@ -751,7 +740,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
bStat = _ctx->f->readByte();
_inter.setPerorate(bStat);
- CharsLoadAll(_ctx->f);
+ charsLoadAll(_ctx->f);
}
if (_ctx->ver >= 6) {
@@ -775,11 +764,11 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
GLOBALS._nCfgSFXVolume = _ctx->f->readByte();
// Load hotspots
- LoadChangedHotspot(_ctx->f);
+ loadChangedHotspot(_ctx->f);
}
if (_ctx->ver >= 7) {
- LoadMusic(_ctx->f);
+ loadMusic(_ctx->f);
}
delete _ctx->f;
@@ -793,13 +782,13 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
mpalQueryDoAction(0, _ctx->loc, 0);
else {
// In the new ones, we just reset the mcode
- MCharResetCodes();
+ mCharResetCodes();
}
if (_ctx->ver >= 6)
- ReapplyChangedHotspot();
+ reapplyChangedHotspot();
- CORO_INVOKE_0(RestoreMusic);
+ CORO_INVOKE_0(restoreMusic);
_bGUIInterface = true;
_bGUIInventory = true;
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index da18b538d5..8d83363c24 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -642,6 +642,9 @@ void ScriptThread(CORO_PARAM, const void *param) {
CORO_KILL_SELF();
return;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
}
@@ -710,6 +713,9 @@ void ActionThread(CORO_PARAM, const void *param) {
GLOBALS._mpalError = 1;
break;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
globalDestroy(_ctx->item);
@@ -1121,6 +1127,9 @@ void GroupThread(CORO_PARAM, const void *param) {
CORO_KILL_SELF();
return;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
// The gruop is finished, so we can return to the calling function.
@@ -1386,11 +1395,7 @@ bool doSelection(uint32 i, uint32 dwData) {
*/
bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings) {
- Common::File hMpc;
byte buf[5];
- uint32 nBytesRead;
- bool bCompress;
- uint32 dwSizeDecomp, dwSizeComp;
byte *cmpbuf;
// Save the array of custom functions
@@ -1398,21 +1403,22 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
GLOBALS._lplpFunctionStrings = lpcfStrings;
// OPen the MPC file for reading
+ Common::File hMpc;
if (!hMpc.open(lpszMpcFileName))
return false;
// Read and check the header
- nBytesRead = hMpc.read(buf, 5);
+ uint32 nBytesRead = hMpc.read(buf, 5);
if (nBytesRead != 5)
return false;
if (buf[0] != 'M' || buf[1] != 'P' || buf[2] != 'C' || buf[3] != 0x20)
return false;
- bCompress = buf[4];
+ bool bCompress = buf[4];
// Reads the size of the uncompressed file, and allocate memory
- dwSizeDecomp = hMpc.readUint32LE();
+ uint32 dwSizeDecomp = hMpc.readUint32LE();
if (hMpc.err())
return false;
@@ -1422,7 +1428,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
if (bCompress) {
// Get the compressed size and read the data in
- dwSizeComp = hMpc.readUint32LE();
+ uint32 dwSizeComp = hMpc.readUint32LE();
if (hMpc.err())
return false;
@@ -1463,7 +1469,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
// Seek to the end of the file to read overall information
GLOBALS._hMpr.seek(-12, SEEK_END);
- dwSizeComp = GLOBALS._hMpr.readUint32LE();
+ uint32 dwSizeComp = GLOBALS._hMpr.readUint32LE();
if (GLOBALS._hMpr.err())
return false;
@@ -1941,11 +1947,9 @@ uint32 mpalGetError() {
* @returns TRUE if the script 'was launched, FALSE on failure
*/
bool mpalExecuteScript(int nScript) {
- LpMpalScript s;
-
LockScripts();
int n = scriptGetOrderFromNum(nScript);
- s = (LpMpalScript)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizeof(MpalScript));
+ LpMpalScript s = (LpMpalScript)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizeof(MpalScript));
if (s == NULL)
return false;
diff --git a/engines/wintermute/readme.txt b/engines/wintermute/readme.txt
deleted file mode 100644
index 57592dac2a..0000000000
--- a/engines/wintermute/readme.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-Wintermute Engine - Copyright (c) 2011 Jan Nedoma
-ScummVM port by Einar Johan Trøan Sømåen (somaen)
-
-***************************
-*** General information ***
-***************************
-The Wintermute Engine is a game engine mainly aimed at creating adventure
-games, it supports both 3D, 2.5D, 2D and First-Person games, and has numerous
-games both free, open-source and commercial created with it. This port was
-created by somaen as part of Google Summer of Code 2012.
-
-****************
-*** Features ***
-****************
-This port of the Wintermute Engine (WME) is based on WME Lite, which lacks the following functionality
-originally found in WME: (from http://res.dead-code.org/doku.php/wmelite:start)
-
-The following features of WME 1.x are NOT supported by WME Lite:
-* 3D characters. WME Lite only supports 2D games.
-* Sprite frame mirroring.
-* Sprite rotations.
-* Sprite blending modes.
-* Video playback.
-* Plugins.
-* Calling external functions from DLL libraries from scripts.
-* Game Explorer support.
-* 'Directory' script object.
-
-This port does reimplement a few of these features, currently:
-* Sprite frame mirroring - WORKS.
-* Video playback - Theora PARTIALLY WORKING. (Slow, and doesn't support seeking)
-
-In addition, this port removes a few additional features that were never/rarely used:
-* 'File' script object - ScummVM doesn't have any easy way to write/read arbitrary files.
-* Debugger/Compiler - weren't properly accessible in WME Lite anyhow.
-* CD-numbering support in .dcp-files - was never used.
-* 'SaveDirectory'-property of 'Game' will not return anything usefull to the game-scripts (saving is handled through SaveFileMan)
-
-*******************************
-*** Additional limitations: ***
-*******************************
-* Only .OGG and RAW-.WAV sounds are supported at this point
-* TTF-fonts might behave a bit differently, owing to both the change to FreeType in WME Lite
- and the change in dpi in this port of WME.
-* The window-caption-setting in-game will be ignored, for the sake of concistency with ScummVM.
-* Most VKey-combinations might still be missing (as they already were in WME Lite)
-* Since we don't use FreeImage, some games might use odd files that weren't expected when the
- image-decoders in ScummVM were written. One example here is interlaced-PNGs.
-* UTF8-support is not ported, which means only games with western charsets will work for now.
-* Games that select language by moving .dcp-files around still need a bit more handling on detection/load
- adding support for those languages on a language-by-language basis.
-* Most games assume the availability of the Windows-fonts (particularly arial.ttf)
- at this point no fallback has been put in place for using FreeFonts as replacements,
- simply for lack of having them easily accessible to the engines at this point. So, at least
- arial.ttf should be put in either the game-folder or made available through the extras-folder
- for now, otherwise kGUIBigFont will be used as a replacement.
-
-
-*********************************
-*** Advanced engine-features: ***
-*********************************
-At this point the engine implements the following "advanced engine features":
-* RTL ("Return to Launcher") support
-* Global options dialog support
-* Listing savestates via command line or Launcher
-* Loading savestates via command line or Launcher
-* Deleting savestates via the Launcher and GMM
-* Savestate metadata support
-* Loading/Saving during run time
-
-and NOT the following:
-* Enhanced debug/error messages
-
-*****************
-*** Detection ***
-*****************
-Since Wintermute has authoring tools available, there will at any point in
-time be atleast a few games that are works-in-progress, and as the authors
-of these games might want to test their games in ScummVM, the engine has
-to be able to detect arbitrary Wintermute-games, to this end the detector
-code in this engine will check any folder containing "data.dcp", and try to
-read "startup.settings" and "default.game" (or optionally any other .game-file
-defined in startup.settings), the Name/Caption fields in the .game-file will
-be used as gameid/title (prefixing the gameid with "wmefan-" to avoid confusion
-with any other WME game that might happen to have taken that id.
-
-All COMPLETED games should have their md5s and gameid's properly added, IFF
-they don't require 3D.
-
-3D games may also be added, for the purpose of giving the user feedback
-as to why their game won't run, but at this point, any such MD5 should
-be added as a comment only, to avoid confusion, as no mechanism for giving
-the user feedback about 3D-games not being supported is currently added.
-
-*************************************
-*** Games targeted by the engine: ***
-*************************************
-This engine potentially targets a very large amount of games:
-http://res.dead-code.org/doku.php/games:start
-
-Since the feature-set of WME Lite differs from that of the full Wintermute Engine,
-games will need to be targeted on a case-by-case, feature-by-feature basis, this is
-a list of the games that are currently known to work (although perhaps with minor
-issues) through to completion:
-
-* Dirty Split (dirtysplit)
-* the white chamber (twc)
-* Chivalry is NOT dead (chivalry)
-* Rosemary (rosemary)
-* The Box (thebox)
-* J.U.L.I.A. (Demo) (julia)
-* Pigeons in the park (pigeons)
-
-Untested, but starts:
-* East Side Story (Demo) (eastside)
-* Actual Destination (actualdest)
-* Ghost in the sheet (ghostsheet)
-
-********************************
-*** Games with known issues: ***
-********************************
-Certain games will work mostly fine with this engine, but can still
-be impossible to complete for various reasons, this is a list of games
-that technically qualify (as in they do not require the 3D-parts of the engine)
-but have issues that make them problematic or not completable:
-
-Won't start:
-* Five Lethal Demons (5ld) - Requires support for interlaced PNGs
-* Five Magical Amulets (5ma) - Requires support for interlaced PNGs
-* Kulivoeko - Requires support for interlaced PNGs
-* Reversion (reversion) - Requires support for Non-V1.1 JPEGs and interlaced PNGs
-* Mirage (mirage) - Tries to seek in a vorbis-stream inside a ZipStream
-* Hamlet or the last game without MMORPS features, shaders and product placement (hamlet)
- - Requires support for interlaced PNGs
-
-Gameplay broken:
-* J.U.L.I.A. (Full game) (julia) - Requires sprite-rotation for a puzzle.
-
-Non-critical:
-* Ghost in the sheet (ghostsheet) - uses Non-V1.1-JPEGs
-* East Side Story (eastside) - wants "framd.ttf"
-
-*****************************
-*** General known issues: ***
-*****************************
-
-Mostly a TODO-section, to not forget fixing outstanding general issues:
-* Save/Load-screens are not shown during save/load
- this is probably a result of reducing the amount of redrawing done
- during save/load, and I'm not sure it should be put back, if that means
- making saves slower again.
-* Font-sizes are wrong enough to allow Dirty Split to draw text that is hidden in
- the original game (most visible on the coin-interface)
-* Alpha-masks for Theora-videos are broken on big-endian platforms
-
diff --git a/gui/credits.h b/gui/credits.h
index fdde2da821..35b5dcf1c2 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -249,6 +249,9 @@ static const char *credits[] = {
"C0""Gregory Montoir",
"C2""(retired)",
"",
+"C1""Wintermute",
+"C0""Einar Johan T. S\370m\345en",
+"",
"",
"C1""Backend Teams",
"C1""Android",
@@ -679,6 +682,8 @@ static const char *credits[] = {
"C2""For generously providing hosting for our buildbot, SVN repository, planet and doxygen sites as well as tons of HD space",
"C0""DOSBox Team",
"C2""For their awesome OPL2 and OPL3 emulator",
+"C0""Yusuke Kamiyamane",
+"C2""For contributing some GUI icons ",
"C0""Till Kresslein",
"C2""For design of modern ScummVM GUI",
"C0""Jezar",
@@ -695,8 +700,6 @@ static const char *credits[] = {
"C2""For additional work on the original MT-32 emulator",
"C0""James Woodcock",
"C2""Soundtrack enhancements",
-"C0""Some icons by Yusuke Kamiyamane",
-"C0""",
"C0""Tony Warriner and everyone at Revolution Software Ltd. for sharing with us the source of some of their brilliant games, allowing us to release Beneath a Steel Sky as freeware... and generally being supportive above and beyond the call of duty.",
"C0""",
"C0""John Passfield and Steve Stamatiadis for sharing the source of their classic title, Flight of the Amazon Queen and also being incredibly supportive.",
@@ -717,7 +720,9 @@ static const char *credits[] = {
"C0""",
"C0""Neil Dodwell and David Dew from Creative Reality for providing the source of Dreamweb and for their tremendous support.",
"C0""",
-"C0""Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe Avalon for providing full source code for Soltys and letting us to redistribute the game.",
+"C0""Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe Avalon for providing full source code for Soltys and letting us redistribute the game.",
+"C0""",
+"C0""Jan Nedoma for providing the sources to the Wintermute-engine, and for his support while porting the engine to ScummVM.",
"C0""",
"",
};
diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp
index 620316806f..30632cdd6c 100644
--- a/video/bink_decoder.cpp
+++ b/video/bink_decoder.cpp
@@ -260,7 +260,23 @@ BinkDecoder::BinkVideoTrack::BinkVideoTrack(uint32 width, uint32 height, const G
_colHighHuffman[i].symbols[j] = j;
}
- _surface.create(width, height, format);
+ // Make the surface even-sized:
+ _surfaceHeight = height;
+ _surfaceWidth = width;
+
+ if (height & 1) {
+ _surfaceHeight++;
+ }
+ if (width & 1) {
+ _surfaceWidth++;
+ }
+
+ _surface.create(_surfaceWidth, _surfaceHeight, format);
+ // Since we over-allocate to make surfaces even-sized
+ // we need to set the actual VIDEO size back into the
+ // surface.
+ _surface.h = height;
+ _surface.w = width;
// Give the planes a bit extra space
width = _surface.w + 32;
@@ -329,9 +345,11 @@ void BinkDecoder::BinkVideoTrack::decodePacket(VideoFrame &frame) {
// Convert the YUV data we have to our format
// We're ignoring alpha for now
+ // The width used here is the surface-width, and not the video-width
+ // to allow for odd-sized videos.
assert(_curPlanes[0] && _curPlanes[1] && _curPlanes[2]);
Graphics::convertYUV420ToRGB(&_surface, _curPlanes[0], _curPlanes[1], _curPlanes[2],
- _surface.w, _surface.h, _surface.w, _surface.w >> 1);
+ _surfaceWidth, _surfaceHeight, _surfaceWidth, _surfaceWidth >> 1);
// And swap the planes with the reference planes
for (int i = 0; i < 4; i++)
diff --git a/video/bink_decoder.h b/video/bink_decoder.h
index 150e91aab7..27d3aa3691 100644
--- a/video/bink_decoder.h
+++ b/video/bink_decoder.h
@@ -231,6 +231,8 @@ private:
int _frameCount;
Graphics::Surface _surface;
+ int _surfaceWidth; ///< The actual surface width
+ int _surfaceHeight; ///< The actual surface height
uint32 _id; ///< The BIK FourCC.