From afa3f50b8a2bc47a243156c196f88ab799fe4f8f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 23 Nov 2013 21:34:54 +0100 Subject: GRAPHICS: Let Font take uint32 as character codes. This is required to support UTF-32 strings but does not make them work automatically! --- engines/groovie/font.cpp | 4 ++-- engines/groovie/font.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index d29c22dd02..a55d8fad95 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -112,7 +112,7 @@ bool T7GFont::load(Common::SeekableReadStream &stream) { return true; } -void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const { +void T7GFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const { // We ignore the color, as the font is already colored const Glyph *glyph = getGlyph(chr); const byte *src = glyph->pixels; @@ -125,7 +125,7 @@ void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 co } } -const T7GFont::Glyph *T7GFont::getGlyph(byte chr) const { +const T7GFont::Glyph *T7GFont::getGlyph(uint32 chr) const { assert (chr < 128); byte numGlyph = _mapChar2Glyph[chr]; diff --git a/engines/groovie/font.h b/engines/groovie/font.h index 20aaa4cf23..49cf4b7b06 100644 --- a/engines/groovie/font.h +++ b/engines/groovie/font.h @@ -37,8 +37,8 @@ public: int getFontHeight() const { return _maxHeight; } int getMaxCharWidth() const { return _maxWidth; } - int getCharWidth(byte chr) const { return getGlyph(chr)->width; } - void drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const; + int getCharWidth(uint32 chr) const { return getGlyph(chr)->width; } + void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const; private: int _maxHeight, _maxWidth; @@ -55,7 +55,7 @@ private: byte _mapChar2Glyph[128]; Glyph *_glyphs; - const Glyph *getGlyph(byte chr) const; + const Glyph *getGlyph(uint32 chr) const; }; } // End of Groovie namespace -- cgit v1.2.3 From aa947c9474ad83aa9315bc585d1f0b79060fee61 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:33 +0100 Subject: BUILD: Split configure.engines down to a single file per engine. This is the first part of allowing engines to be added dynamically. They are placed into a folder in engines/ which must contain a file named "configure.engine" to add the engine, which is pulled into the top level configure script automatically. --- engines/groovie/configure.engine | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 engines/groovie/configure.engine (limited to 'engines/groovie') diff --git a/engines/groovie/configure.engine b/engines/groovie/configure.engine new file mode 100644 index 0000000000..84e95a70df --- /dev/null +++ b/engines/groovie/configure.engine @@ -0,0 +1,4 @@ +# This file is included from the main "configure" script +# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] +add_engine groovie "Groovie" yes "groovie2" "7th Guest" +add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" -- cgit v1.2.3 From d77cf95a185a6c8f201f417d08f246727784f728 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Split engines.mk down to a single file per engine. This is the second part of allowing engines to be added dynamically. Each folder in engines/ which must contain a file named "engine.mk" containing the make definitions for that engine. --- engines/groovie/engine.mk | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 engines/groovie/engine.mk (limited to 'engines/groovie') diff --git a/engines/groovie/engine.mk b/engines/groovie/engine.mk new file mode 100644 index 0000000000..a209860e84 --- /dev/null +++ b/engines/groovie/engine.mk @@ -0,0 +1,8 @@ +ifdef ENABLE_GROOVIE +DEFINES += -DENABLE_GROOVIE=$(ENABLE_GROOVIE) +MODULES += engines/groovie + +ifdef ENABLE_GROOVIE2 +DEFINES += -DENABLE_GROOVIE2 +endif +endif -- cgit v1.2.3 From 00c27a28f91cc2bbf512461e69c86be998462728 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Split engines/plugins_table header down to a file per engine. This is the third and final commit enabling fully pluggable engines. Now providing an engine folder contains a configure.engine, engine.mk and engine-plugin.h file, it will be picked up automatically by the configure script. --- engines/groovie/engine-plugin.h | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 engines/groovie/engine-plugin.h (limited to 'engines/groovie') diff --git a/engines/groovie/engine-plugin.h b/engines/groovie/engine-plugin.h new file mode 100644 index 0000000000..dcb05b1333 --- /dev/null +++ b/engines/groovie/engine-plugin.h @@ -0,0 +1,3 @@ +#if PLUGIN_ENABLED_STATIC(GROOVIE) +LINK_PLUGIN(GROOVIE) +#endif -- cgit v1.2.3 From 1ac01d2333af11d403ef84dd5192abb18814e5b3 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Remove need for engine-plugin.h in engines. This is now generated automatically by the configure script from the engine directory names. --- engines/groovie/engine-plugin.h | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 engines/groovie/engine-plugin.h (limited to 'engines/groovie') diff --git a/engines/groovie/engine-plugin.h b/engines/groovie/engine-plugin.h deleted file mode 100644 index dcb05b1333..0000000000 --- a/engines/groovie/engine-plugin.h +++ /dev/null @@ -1,3 +0,0 @@ -#if PLUGIN_ENABLED_STATIC(GROOVIE) -LINK_PLUGIN(GROOVIE) -#endif -- cgit v1.2.3 From ef85456859e466adc8913041e4f31809485c45ab Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 7 Nov 2013 12:58:34 +0100 Subject: BUILD: Remove need for engine.mk in each engine directory. Each engine now only has to provide a single configure.engine file adding the engine into the configure script, which then produces the required other files automatically. --- engines/groovie/engine.mk | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 engines/groovie/engine.mk (limited to 'engines/groovie') diff --git a/engines/groovie/engine.mk b/engines/groovie/engine.mk deleted file mode 100644 index a209860e84..0000000000 --- a/engines/groovie/engine.mk +++ /dev/null @@ -1,8 +0,0 @@ -ifdef ENABLE_GROOVIE -DEFINES += -DENABLE_GROOVIE=$(ENABLE_GROOVIE) -MODULES += engines/groovie - -ifdef ENABLE_GROOVIE2 -DEFINES += -DENABLE_GROOVIE2 -endif -endif -- cgit v1.2.3 From 8f55aed475fbc0e40761036fc98f19e4a2131e33 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:20 +0100 Subject: GROOVIE: Make GPL headers consistent in themselves. --- engines/groovie/cell.cpp | 4 ++-- engines/groovie/cell.h | 4 ++-- engines/groovie/cursor.cpp | 4 ++-- engines/groovie/cursor.h | 4 ++-- engines/groovie/debug.cpp | 4 ++-- engines/groovie/debug.h | 4 ++-- engines/groovie/detection.cpp | 4 ++-- engines/groovie/detection.h | 4 ++-- engines/groovie/font.cpp | 4 ++-- engines/groovie/font.h | 4 ++-- engines/groovie/graphics.cpp | 4 ++-- engines/groovie/graphics.h | 4 ++-- engines/groovie/groovie.cpp | 4 ++-- engines/groovie/groovie.h | 4 ++-- engines/groovie/lzss.cpp | 4 ++-- engines/groovie/lzss.h | 4 ++-- engines/groovie/music.cpp | 4 ++-- engines/groovie/music.h | 4 ++-- engines/groovie/player.cpp | 4 ++-- engines/groovie/player.h | 4 ++-- engines/groovie/resource.cpp | 4 ++-- engines/groovie/resource.h | 4 ++-- engines/groovie/roq.cpp | 4 ++-- engines/groovie/roq.h | 4 ++-- engines/groovie/saveload.cpp | 4 ++-- engines/groovie/saveload.h | 4 ++-- engines/groovie/script.cpp | 4 ++-- engines/groovie/script.h | 4 ++-- engines/groovie/stuffit.cpp | 4 ++-- engines/groovie/stuffit.h | 4 ++-- engines/groovie/vdx.cpp | 4 ++-- engines/groovie/vdx.h | 4 ++-- 32 files changed, 64 insertions(+), 64 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/cell.cpp b/engines/groovie/cell.cpp index 8241579156..24fac17e44 100644 --- a/engines/groovie/cell.cpp +++ b/engines/groovie/cell.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/cell.h b/engines/groovie/cell.h index 32c7b46547..d6f1ac97dc 100644 --- a/engines/groovie/cell.h +++ b/engines/groovie/cell.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index cac78a95a3..080463a8b3 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h index 87d994b077..bf91112ea4 100644 --- a/engines/groovie/cursor.h +++ b/engines/groovie/cursor.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 74fe22922c..8103e4f4c6 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/debug.h b/engines/groovie/debug.h index 76f6d16c65..b99d6c6e1b 100644 --- a/engines/groovie/debug.h +++ b/engines/groovie/debug.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 7c89114e83..a249b66858 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/detection.h b/engines/groovie/detection.h index aa900cc54d..e49474474b 100644 --- a/engines/groovie/detection.h +++ b/engines/groovie/detection.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index a55d8fad95..21a3bd07ae 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/font.h b/engines/groovie/font.h index 49cf4b7b06..23e060faf3 100644 --- a/engines/groovie/font.h +++ b/engines/groovie/font.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index a4d8a4330c..b85277fac7 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/graphics.h b/engines/groovie/graphics.h index c91d895c25..72ab01deb6 100644 --- a/engines/groovie/graphics.h +++ b/engines/groovie/graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 5ade442742..e65031ec38 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 79abc13b1c..c3d3146cca 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/lzss.cpp b/engines/groovie/lzss.cpp index a09f6e2311..2a185aeeab 100644 --- a/engines/groovie/lzss.cpp +++ b/engines/groovie/lzss.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/lzss.h b/engines/groovie/lzss.h index f60ea14815..06b07a946a 100644 --- a/engines/groovie/lzss.h +++ b/engines/groovie/lzss.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 95637fc407..390f47f084 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/music.h b/engines/groovie/music.h index 92e9c8b487..4853840673 100644 --- a/engines/groovie/music.h +++ b/engines/groovie/music.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index e2a1ff3d56..16cb3c47ff 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/player.h b/engines/groovie/player.h index c9258ffdbd..b1aac963f2 100644 --- a/engines/groovie/player.h +++ b/engines/groovie/player.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 42d76cabfa..8229d02d91 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index 33e15e6b98..11a861dd5c 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index e1ca7fb945..88f14b859e 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index c5d3f255d3..0e82983e63 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/saveload.cpp b/engines/groovie/saveload.cpp index 1a92c02e0e..78b79cfa26 100644 --- a/engines/groovie/saveload.cpp +++ b/engines/groovie/saveload.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/saveload.h b/engines/groovie/saveload.h index 15ce108c7d..6f20250e0a 100644 --- a/engines/groovie/saveload.h +++ b/engines/groovie/saveload.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 8e3bef9945..25c421f699 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/script.h b/engines/groovie/script.h index 8cd790af5e..35e52593de 100644 --- a/engines/groovie/script.h +++ b/engines/groovie/script.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/stuffit.cpp b/engines/groovie/stuffit.cpp index 60a57a0129..bbfcd3da82 100644 --- a/engines/groovie/stuffit.cpp +++ b/engines/groovie/stuffit.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/stuffit.h b/engines/groovie/stuffit.h index 44f593dbea..9b2bbd3543 100644 --- a/engines/groovie/stuffit.h +++ b/engines/groovie/stuffit.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 59d966a22f..4626a6f81b 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index a9bfaa1eb4..328e6e4da5 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 740b6e8fbdece44ae2a5295cb0549a53b6dc6ae7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 27 Feb 2014 21:27:23 -0500 Subject: IMAGE: Move all ImageDecoders to image/ --- engines/groovie/roq.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 88f14b859e..4b3fb81828 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -32,7 +32,7 @@ #include "common/textconsole.h" #include "graphics/palette.h" -#include "graphics/decoders/jpeg.h" +#include "image/jpeg.h" #ifdef USE_RGB_COLOR // Required for the YUV to RGB conversion @@ -435,20 +435,18 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { warning("Groovie::ROQ: JPEG frame (unfinished)"); - Graphics::JPEGDecoder *jpg = new Graphics::JPEGDecoder(); - jpg->setOutputColorSpace(Graphics::JPEGDecoder::kColorSpaceYUV); + Image::JPEGDecoder jpg; + jpg.setOutputColorSpace(Image::JPEGDecoder::kColorSpaceYUV); uint32 startPos = _file->pos(); Common::SeekableSubReadStream subStream(_file, startPos, startPos + blockHeader.size, DisposeAfterUse::NO); - jpg->loadStream(subStream); + jpg.loadStream(subStream); - const Graphics::Surface *srcSurf = jpg->getSurface(); + const Graphics::Surface *srcSurf = jpg.getSurface(); const byte *src = (const byte *)srcSurf->getPixels(); byte *ptr = (byte *)_currBuf->getPixels(); memcpy(ptr, src, _currBuf->w * _currBuf->h * srcSurf->format.bytesPerPixel); - delete jpg; - _file->seek(startPos + blockHeader.size); return true; } -- cgit v1.2.3 From 72a548c8bc92be9d01fde023d9490110aa3bab71 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 9 Mar 2014 22:12:52 +0100 Subject: GROOVIE: Remove two useless variables --- engines/groovie/roq.cpp | 5 ++--- engines/groovie/roq.h | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 4b3fb81828..cbaa992596 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -43,9 +43,8 @@ namespace Groovie { -ROQPlayer::ROQPlayer(GroovieEngine *vm) : - VideoPlayer(vm), _codingTypeCount(0), - _fg(&_vm->_graphicsMan->_foreground), _bg(&_vm->_graphicsMan->_background) { +ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), _bg(&_vm->_graphicsMan->_background) { + // _fg = &_vm->_graphicsMan->_foreground; // Create the work surfaces _currBuf = new Graphics::Surface(); diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index 0e82983e63..b5e63c2b4a 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -75,7 +75,8 @@ private: byte _codebook4[256 * 4]; // Buffers - Graphics::Surface *_fg, *_bg, *_thirdBuf; + // Graphics::Surface *_fg, *_thirdBuf; + Graphics::Surface *_bg; Graphics::Surface *_currBuf, *_prevBuf; void buildShowBuf(); byte _scaleX, _scaleY; -- cgit v1.2.3 From 4d02f67bd1dc3b7fc9eb8729f92a4d5d41a6831a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 10 Dec 2013 18:34:48 +0100 Subject: ALL: Resolve multiple clang warnings --- engines/groovie/roq.cpp | 5 +++-- engines/groovie/roq.h | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index cbaa992596..2776a0455d 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -43,8 +43,9 @@ namespace Groovie { -ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), _bg(&_vm->_graphicsMan->_background) { - // _fg = &_vm->_graphicsMan->_foreground; +ROQPlayer::ROQPlayer(GroovieEngine *vm) : + VideoPlayer(vm), _codingTypeCount(0), + _bg(&_vm->_graphicsMan->_background) { // Create the work surfaces _currBuf = new Graphics::Surface(); diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index b5e63c2b4a..cd5e91c82b 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -75,7 +75,6 @@ private: byte _codebook4[256 * 4]; // Buffers - // Graphics::Surface *_fg, *_thirdBuf; Graphics::Surface *_bg; Graphics::Surface *_currBuf, *_prevBuf; void buildShowBuf(); -- cgit v1.2.3 From daa8d57a866e2866369e432cf1d624179edc8875 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2014 02:04:07 +0200 Subject: ALL: Rename Debugger::DebugPrintf to Debugger::debugPrintf. --- engines/groovie/debug.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 8103e4f4c6..85b9b87652 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -81,7 +81,7 @@ bool Debugger::cmd_pc(int argc, const char **argv) { int val = getNumber(argv[1]); _script->_currentInstruction = val; } - DebugPrintf("pc = 0x%04X (%d)\n", _script->_currentInstruction, _script->_currentInstruction); + debugPrintf("pc = 0x%04X (%d)\n", _script->_currentInstruction, _script->_currentInstruction); return true; } @@ -97,9 +97,9 @@ bool Debugger::cmd_mem(int argc, const char **argv) { // Get val = _script->_variables[pos]; } - DebugPrintf("mem[0x%04X] = 0x%02X\n", pos, val); + debugPrintf("mem[0x%04X] = 0x%02X\n", pos, val); } else { - DebugPrintf("Syntax: mem []\n"); + debugPrintf("Syntax: mem []\n"); } return true; } @@ -109,7 +109,7 @@ bool Debugger::cmd_loadgame(int argc, const char **argv) { int slot = getNumber(argv[1]); _script->loadgame(slot); } else { - DebugPrintf("Syntax: load \n"); + debugPrintf("Syntax: load \n"); } return true; } @@ -119,7 +119,7 @@ bool Debugger::cmd_savegame(int argc, const char **argv) { int slot = getNumber(argv[1]); _script->savegame(slot); } else { - DebugPrintf("Syntax: save \n"); + debugPrintf("Syntax: save \n"); } return true; } @@ -129,7 +129,7 @@ bool Debugger::cmd_playref(int argc, const char **argv) { int ref = getNumber(argv[1]); _script->playvideofromref(ref); } else { - DebugPrintf("Syntax: playref \n"); + debugPrintf("Syntax: playref \n"); } return true; } @@ -140,7 +140,7 @@ bool Debugger::cmd_dumppal(int argc, const char **argv) { _vm->_system->getPaletteManager()->grabPalette(palettedump, 0, 256); for (i = 0; i < 256; i++) { - DebugPrintf("%3d: %3d,%3d,%3d\n", i, palettedump[(i * 3)], palettedump[(i * 3) + 1], palettedump[(i * 3) + 2]); + debugPrintf("%3d: %3d,%3d,%3d\n", i, palettedump[(i * 3)], palettedump[(i * 3) + 1], palettedump[(i * 3) + 2]); } return true; } -- cgit v1.2.3 From ae4ffe01f0e4354938714c546034cd0f9806bfc3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2014 02:04:08 +0200 Subject: ALL: Rename Debugger::DCmd_Register to Debugger::registerCmd. --- engines/groovie/debug.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index 85b9b87652..16db20413f 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -36,16 +36,16 @@ Debugger::Debugger(GroovieEngine *vm) : _vm(vm), _script(_vm->_script) { // Register the debugger comands - DCmd_Register("step", WRAP_METHOD(Debugger, cmd_step)); - DCmd_Register("go", WRAP_METHOD(Debugger, cmd_go)); - DCmd_Register("pc", WRAP_METHOD(Debugger, cmd_pc)); - DCmd_Register("fg", WRAP_METHOD(Debugger, cmd_fg)); - DCmd_Register("bg", WRAP_METHOD(Debugger, cmd_bg)); - DCmd_Register("mem", WRAP_METHOD(Debugger, cmd_mem)); - DCmd_Register("load", WRAP_METHOD(Debugger, cmd_loadgame)); - DCmd_Register("save", WRAP_METHOD(Debugger, cmd_savegame)); - DCmd_Register("playref", WRAP_METHOD(Debugger, cmd_playref)); - DCmd_Register("dumppal", WRAP_METHOD(Debugger, cmd_dumppal)); + registerCmd("step", WRAP_METHOD(Debugger, cmd_step)); + registerCmd("go", WRAP_METHOD(Debugger, cmd_go)); + registerCmd("pc", WRAP_METHOD(Debugger, cmd_pc)); + registerCmd("fg", WRAP_METHOD(Debugger, cmd_fg)); + registerCmd("bg", WRAP_METHOD(Debugger, cmd_bg)); + registerCmd("mem", WRAP_METHOD(Debugger, cmd_mem)); + registerCmd("load", WRAP_METHOD(Debugger, cmd_loadgame)); + registerCmd("save", WRAP_METHOD(Debugger, cmd_savegame)); + registerCmd("playref", WRAP_METHOD(Debugger, cmd_playref)); + registerCmd("dumppal", WRAP_METHOD(Debugger, cmd_dumppal)); } Debugger::~Debugger() { -- cgit v1.2.3 From 5d4fd2e1540ae9ced60b68c3253d3b5b04254403 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 13 Jan 2014 19:05:07 -0500 Subject: GROOVIE: Remove groovie2 8bpp mode It didn't work properly, it's not what the original did, and spooky mode needs to be implemented completely differently --- engines/groovie/configure.engine | 2 +- engines/groovie/groovie.cpp | 11 ++++++++--- engines/groovie/groovie.h | 2 +- engines/groovie/roq.cpp | 30 +++++------------------------- 4 files changed, 15 insertions(+), 30 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/configure.engine b/engines/groovie/configure.engine index 84e95a70df..212a49bec8 100644 --- a/engines/groovie/configure.engine +++ b/engines/groovie/configure.engine @@ -1,4 +1,4 @@ # This file is included from the main "configure" script # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] add_engine groovie "Groovie" yes "groovie2" "7th Guest" -add_engine groovie2 "Groovie 2 games" no "" "" "jpeg" +add_engine groovie2 "Groovie 2 games" no "" "" "jpeg 16bit" diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index e65031ec38..f2801881f1 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -50,7 +50,8 @@ namespace Groovie { GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : Engine(syst), _gameDescription(gd), _debugger(NULL), _script(NULL), _resMan(NULL), _grvCursorMan(NULL), _videoPlayer(NULL), _musicPlayer(NULL), - _graphicsMan(NULL), _macResFork(NULL), _waitingForInput(false), _font(NULL) { + _graphicsMan(NULL), _macResFork(NULL), _waitingForInput(false), _font(NULL), + _spookyMode(false) { // Adding the default directories const Common::FSNode gameDataDir(ConfMan.get("path")); @@ -107,9 +108,13 @@ Common::Error GroovieEngine::run() { // Request the mode with the highest precision available initGraphics(640, 480, true, NULL); - // Save the enabled mode as it can be both an RGB mode or CLUT8 + // Save the enabled mode _pixelFormat = _system->getScreenFormat(); - _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8()); + + // TODO: Eventually drop 16bpp mode + if (_pixelFormat.bytesPerPixel == 1) + return Common::kUnsupportedColorMode; + break; case kGroovieT7G: initGraphics(640, 480, true); diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index c3d3146cca..9fe6b0c2f5 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -110,7 +110,7 @@ public: void waitForInput(); Graphics::PixelFormat _pixelFormat; - bool _mode8bit; + bool _spookyMode; Script *_script; ResMan *_resMan; GrvCursorMan *_grvCursorMan; diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 2776a0455d..5eebc6a6bb 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -50,19 +50,6 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) : // Create the work surfaces _currBuf = new Graphics::Surface(); _prevBuf = new Graphics::Surface(); - - if (_vm->_mode8bit) { - byte pal[256 * 3]; - - // Set a grayscale palette - for (int i = 0; i < 256; i++) { - pal[(i * 3) + 0] = i; - pal[(i * 3) + 1] = i; - pal[(i * 3) + 2] = i; - } - - _syst->getPaletteManager()->setPalette(pal, 0, 256); - } } ROQPlayer::~ROQPlayer() { @@ -118,18 +105,11 @@ void ROQPlayer::buildShowBuf() { byte *out = (byte *)_bg->getBasePtr(0, line); byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY); for (int x = 0; x < _bg->w; x++) { - if (_vm->_mode8bit) { - // Just use the luminancy component - *out = *in; -#ifdef USE_RGB_COLOR - } else { - // Do the format conversion (YUV -> RGB -> Screen format) - byte r, g, b; - Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b); - // FIXME: this is fixed to 16bit - *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b); -#endif // USE_RGB_COLOR - } + // Do the format conversion (YUV -> RGB -> Screen format) + byte r, g, b; + Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b); + // FIXME: this is fixed to 16bit + *(uint16 *)out = _vm->_pixelFormat.RGBToColor(r, g, b); // Skip to the next pixel out += _vm->_pixelFormat.bytesPerPixel; -- cgit v1.2.3 From 3638f1191cda18f47939aa36eae7a695fbe727c6 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 13 Jan 2014 19:27:16 -0500 Subject: GROOVIE: Switch roq decoding to do YUV decoding on codebook load --- engines/groovie/roq.cpp | 104 +++++++++++++++++++++--------------------------- engines/groovie/roq.h | 2 +- 2 files changed, 46 insertions(+), 60 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 5eebc6a6bb..118b77edce 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -28,6 +28,7 @@ #include "groovie/groovie.h" #include "common/debug.h" +#include "common/rect.h" #include "common/substream.h" #include "common/textconsole.h" @@ -104,12 +105,10 @@ void ROQPlayer::buildShowBuf() { for (int line = 0; line < _bg->h; line++) { byte *out = (byte *)_bg->getBasePtr(0, line); byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY); + for (int x = 0; x < _bg->w; x++) { - // Do the format conversion (YUV -> RGB -> Screen format) - byte r, g, b; - Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b); - // FIXME: this is fixed to 16bit - *(uint16 *)out = _vm->_pixelFormat.RGBToColor(r, g, b); + // Copy a pixel + memcpy(out, in, _vm->_pixelFormat.bytesPerPixel); // Skip to the next pixel out += _vm->_pixelFormat.bytesPerPixel; @@ -262,27 +261,14 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { _prevBuf->free(); // Allocate new buffers - // These buffers use YUV data, since we can not describe it with a - // PixelFormat struct we just add some dummy PixelFormat with the - // correct bytes per pixel value. Since the surfaces are only used - // internally and no code assuming RGB data is present is used on - // them it should be just fine. - _currBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); - _prevBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); - } - - // Clear the buffers with black YUV values - byte *ptr1 = (byte *)_currBuf->getPixels(); - byte *ptr2 = (byte *)_prevBuf->getPixels(); - for (int i = 0; i < width * height; i++) { - *ptr1++ = 0; - *ptr1++ = 128; - *ptr1++ = 128; - *ptr2++ = 0; - *ptr2++ = 128; - *ptr2++ = 128; + _currBuf->create(width, height, _vm->_pixelFormat); + _prevBuf->create(width, height, _vm->_pixelFormat); } + // Clear the buffers with black + _currBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0)); + _prevBuf->fillRect(Common::Rect(width, height), _vm->_pixelFormat.RGBToColor(0, 0, 0)); + return true; } @@ -304,15 +290,28 @@ bool ROQPlayer::processBlockQuadCodebook(ROQBlockHeader &blockHeader) { } // Read the 2x2 codebook + uint32 *codebook = _codebook2; + for (int i = 0; i < newNum2blocks; i++) { // Read the 4 Y components and their alpha channel + byte y[4]; + byte a[4]; + for (int j = 0; j < 4; j++) { - _codebook2[i * 10 + j * 2] = _file->readByte(); - _codebook2[i * 10 + j * 2 + 1] = _alpha ? _file->readByte() : 255; + y[j] = _file->readByte(); + a[j] = _alpha ? _file->readByte() : 255; } // Read the subsampled Cb and Cr - _file->read(&_codebook2[i * 10 + 8], 2); + byte u = _file->readByte(); + byte v = _file->readByte(); + + // Convert the codebook to RGB right here + for (int j = 0; j < 4; j++) { + byte r, g, b; + Graphics::YUV2RGB(y[j], u, v, r, g, b); + *codebook++ = _vm->_pixelFormat.ARGBToColor(a[j], r, g, b); + } } // Read the 4x4 codebook @@ -416,16 +415,15 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { warning("Groovie::ROQ: JPEG frame (unfinished)"); Image::JPEGDecoder jpg; - jpg.setOutputColorSpace(Image::JPEGDecoder::kColorSpaceYUV); uint32 startPos = _file->pos(); Common::SeekableSubReadStream subStream(_file, startPos, startPos + blockHeader.size, DisposeAfterUse::NO); jpg.loadStream(subStream); const Graphics::Surface *srcSurf = jpg.getSurface(); - const byte *src = (const byte *)srcSurf->getPixels(); - byte *ptr = (byte *)_currBuf->getPixels(); - memcpy(ptr, src, _currBuf->w * _currBuf->h * srcSurf->format.bytesPerPixel); + _currBuf->free(); + delete _currBuf; + _currBuf = srcSurf->convertTo(_vm->_pixelFormat); _file->seek(startPos + blockHeader.size); return true; @@ -551,24 +549,17 @@ void ROQPlayer::paint2(byte i, int destx, int desty) { error("Groovie::ROQ: Invalid 2x2 block %d (%d available)", i, _num2blocks); } - byte *block = &_codebook2[i * 10]; - byte u = block[8]; - byte v = block[9]; + uint32 *block = _codebook2 + i * 4; - byte *ptr = (byte *)_currBuf->getBasePtr(destx, desty); for (int y = 0; y < 2; y++) { for (int x = 0; x < 2; x++) { - // Basic alpha test - // TODO: Blending - if (*(block + 1) > 128) { - *ptr = *block; - *(ptr + 1) = u; - *(ptr + 2) = v; - } - ptr += 3; - block += 2; + if (_vm->_pixelFormat.bytesPerPixel == 2) + *((uint16 *)_currBuf->getBasePtr(destx + x, desty + y)) = *block; + else + *((uint32 *)_currBuf->getBasePtr(destx + x, desty + y)) = *block; + + block++; } - ptr += _currBuf->pitch - 6; } } @@ -594,25 +585,20 @@ void ROQPlayer::paint8(byte i, int destx, int desty) { byte *block4 = &_codebook4[i * 4]; for (int y4 = 0; y4 < 2; y4++) { for (int x4 = 0; x4 < 2; x4++) { - byte *block2 = &_codebook2[(*block4) * 10]; - byte u = block2[8]; - byte v = block2[9]; - block4++; + uint32 *block2 = _codebook2 + *block4++ * 4; + for (int y2 = 0; y2 < 2; y2++) { for (int x2 = 0; x2 < 2; x2++) { for (int repy = 0; repy < 2; repy++) { for (int repx = 0; repx < 2; repx++) { - // Basic alpha test - // TODO: Blending - if (*(block2 + 1) > 128) { - byte *ptr = (byte *)_currBuf->getBasePtr(destx + x4*4 + x2*2 + repx, desty + y4*4 + y2*2 + repy); - *ptr = *block2; - *(ptr + 1) = u; - *(ptr + 2) = v; - } + if (_vm->_pixelFormat.bytesPerPixel == 2) + *((uint16 *)_currBuf->getBasePtr(destx + x4 * 4 + x2 * 2 + repx, desty + y4 * 4 + y2 * 2 + repy)) = *block2; + else + *((uint32 *)_currBuf->getBasePtr(destx + x4 * 4 + x2 * 2 + repx, desty + y4 * 4 + y2 * 2 + repy)) = *block2; } } - block2 += 2; + + block2++; } } } @@ -633,7 +619,7 @@ void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) { // Move to the beginning of the next line dst += _currBuf->pitch; - src += _currBuf->pitch; + src += _prevBuf->pitch; } } diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index cd5e91c82b..af68d6c14a 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -71,7 +71,7 @@ private: // Codebooks uint16 _num2blocks; uint16 _num4blocks; - byte _codebook2[256 * 10]; + uint32 _codebook2[256 * 4]; byte _codebook4[256 * 4]; // Buffers -- cgit v1.2.3 From c0a172bc71adeaed22fa53c539c5e3743fb87191 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 14 Jan 2014 19:18:15 -0500 Subject: GROOVIE: Fix various roq glitches They should now all decode correctly --- engines/groovie/roq.cpp | 17 ++++++++++++++--- engines/groovie/roq.h | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 118b77edce..c7c8831c34 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -46,7 +46,8 @@ namespace Groovie { ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), - _bg(&_vm->_graphicsMan->_background) { + _bg(&_vm->_graphicsMan->_background), + _firstFrame(true) { // Create the work surfaces _currBuf = new Graphics::Surface(); @@ -83,6 +84,9 @@ uint16 ROQPlayer::loadInternal() { _num2blocks = 0; _num4blocks = 0; + // Reset the first frame flag + _firstFrame = true; + if ((blockHeader.size == 0) && (blockHeader.param == 0)) { // Set the offset scaling to 2 _offScale = 2; @@ -117,6 +121,12 @@ void ROQPlayer::buildShowBuf() { } } + // On the first frame, copy from the current buffer to the prev buffer + if (_firstFrame) { + _prevBuf->copyFrom(*_currBuf); + _firstFrame = false; + } + // Swap buffers SWAP(_prevBuf, _currBuf); } @@ -237,6 +247,9 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { return false; } + // Reset the first frame flag + _firstFrame = true; + // Save the alpha channel size _alpha = blockHeader.param; @@ -412,8 +425,6 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block"); - warning("Groovie::ROQ: JPEG frame (unfinished)"); - Image::JPEGDecoder jpg; uint32 startPos = _file->pos(); diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h index af68d6c14a..7e7d38580e 100644 --- a/engines/groovie/roq.h +++ b/engines/groovie/roq.h @@ -82,7 +82,7 @@ private: byte _offScale; bool _dirty; byte _alpha; - + bool _firstFrame; }; } // End of Groovie namespace -- cgit v1.2.3 From 3c287aad182d7769f50642e9035f8dad1101d8d3 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 14 Jan 2014 22:13:26 -0500 Subject: GROOVIE: Switch to 32bpp only in groovie2 Needed for alpha --- engines/groovie/cursor.cpp | 14 +++++++------- engines/groovie/groovie.cpp | 14 +++++++------- engines/groovie/roq.cpp | 39 ++++++++++++++------------------------- 3 files changed, 28 insertions(+), 39 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 080463a8b3..65f3e108b8 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -260,7 +260,7 @@ Cursor_v2::Cursor_v2(Common::File &file) { _width = file.readUint16LE(); _height = file.readUint16LE(); - _img = new byte[_width * _height * _numFrames * 2]; + _img = new byte[_width * _height * _numFrames * 4]; debugC(1, kGroovieDebugCursor | kGroovieDebugAll, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); @@ -285,7 +285,7 @@ Cursor_v2::Cursor_v2(Common::File &file) { byte *data = new byte[tmp32]; file.read(data, tmp32); - decodeFrame(pal, data, _img + (f * _width * _height * 2)); + decodeFrame(pal, data, _img + (f * _width * _height * 4)); delete[] data; } @@ -364,16 +364,16 @@ void Cursor_v2::decodeFrame(byte *pal, byte *data, byte *dest) { } // Convert to screen format - // NOTE: Currently locked to 16bit + // NOTE: Currently locked to 32bpp ptr = tmp; for (int y = 0; y < _height; y++) { for (int x = 0; x < _width; x++) { if (*ptr == 1) { - *(uint16 *)dest = (uint16)_format.RGBToColor(*(ptr + 1), *(ptr + 2), *(ptr + 3)); + *(uint32 *)dest = _format.RGBToColor(*(ptr + 1), *(ptr + 2), *(ptr + 3)); } else { - *(uint16 *)dest = 0; + *(uint32 *)dest = 0; } - dest += 2; + dest += 4; ptr += 4; } } @@ -385,7 +385,7 @@ void Cursor_v2::enable() { } void Cursor_v2::showFrame(uint16 frame) { - int offset = _width * _height * frame * 2; + int offset = _width * _height * frame * 4; CursorMan.replaceCursor((const byte *)(_img + offset), _width, _height, _width >> 1, _height >> 1, 0, false, &_format); } diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index f2801881f1..8ba193e0e9 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -104,18 +104,18 @@ Common::Error GroovieEngine::run() { // Initialize the graphics switch (_gameDescription->version) { - case kGroovieV2: + case kGroovieV2: { // Request the mode with the highest precision available - initGraphics(640, 480, true, NULL); - - // Save the enabled mode - _pixelFormat = _system->getScreenFormat(); + Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0); + initGraphics(640, 480, true, &format); - // TODO: Eventually drop 16bpp mode - if (_pixelFormat.bytesPerPixel == 1) + if (_system->getScreenFormat() != format) return Common::kUnsupportedColorMode; + // Save the enabled mode + _pixelFormat = format; break; + } case kGroovieT7G: initGraphics(640, 480, true); _pixelFormat = Graphics::PixelFormat::createFormatCLUT8(); diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index c7c8831c34..3b82543695 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -107,17 +107,16 @@ uint16 ROQPlayer::loadInternal() { void ROQPlayer::buildShowBuf() { for (int line = 0; line < _bg->h; line++) { - byte *out = (byte *)_bg->getBasePtr(0, line); - byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY); + uint32 *out = (uint32 *)_bg->getBasePtr(0, line); + uint32 *in = (uint32 *)_currBuf->getBasePtr(0, line / _scaleY); for (int x = 0; x < _bg->w; x++) { // Copy a pixel - memcpy(out, in, _vm->_pixelFormat.bytesPerPixel); + *out++ = *in; // Skip to the next pixel - out += _vm->_pixelFormat.bytesPerPixel; if (!(x % _scaleX)) - in += _currBuf->format.bytesPerPixel; + in++; } } @@ -561,17 +560,13 @@ void ROQPlayer::paint2(byte i, int destx, int desty) { } uint32 *block = _codebook2 + i * 4; + uint32 *ptr = (uint32 *)_currBuf->getBasePtr(destx, desty); + uint32 pitch = _currBuf->pitch / 4; - for (int y = 0; y < 2; y++) { - for (int x = 0; x < 2; x++) { - if (_vm->_pixelFormat.bytesPerPixel == 2) - *((uint16 *)_currBuf->getBasePtr(destx + x, desty + y)) = *block; - else - *((uint32 *)_currBuf->getBasePtr(destx + x, desty + y)) = *block; - - block++; - } - } + ptr[0] = block[0]; + ptr[1] = block[1]; + ptr[pitch] = block[2]; + ptr[pitch + 1] = block[3]; } void ROQPlayer::paint4(byte i, int destx, int desty) { @@ -600,16 +595,10 @@ void ROQPlayer::paint8(byte i, int destx, int desty) { for (int y2 = 0; y2 < 2; y2++) { for (int x2 = 0; x2 < 2; x2++) { - for (int repy = 0; repy < 2; repy++) { - for (int repx = 0; repx < 2; repx++) { - if (_vm->_pixelFormat.bytesPerPixel == 2) - *((uint16 *)_currBuf->getBasePtr(destx + x4 * 4 + x2 * 2 + repx, desty + y4 * 4 + y2 * 2 + repy)) = *block2; - else - *((uint32 *)_currBuf->getBasePtr(destx + x4 * 4 + x2 * 2 + repx, desty + y4 * 4 + y2 * 2 + repy)) = *block2; - } - } - - block2++; + uint32 *ptr = (uint32 *)_currBuf->getBasePtr(destx + x4 * 4 + x2 * 2, desty + y4 * 4 + y2 * 2); + uint32 pitch = _currBuf->pitch / 4; + uint32 color = *block2++; + ptr[0] = ptr[1] = ptr[pitch] = ptr[pitch + 1] = color; } } } -- cgit v1.2.3 From 98dbb8070b11d2a98a5e9af784a753777a56c9fb Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 2 Jun 2014 06:44:53 -0400 Subject: GROOVIE: Only compile ROQ when groovie2 is enabled --- engines/groovie/groovie.cpp | 7 ++++++- engines/groovie/module.mk | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 8ba193e0e9..427b1c866a 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -29,10 +29,13 @@ #include "groovie/graphics.h" #include "groovie/music.h" #include "groovie/resource.h" -#include "groovie/roq.h" #include "groovie/stuffit.h" #include "groovie/vdx.h" +#ifdef ENABLE_GROOVIE2 +#include "groovie/roq.h" +#endif + #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" @@ -159,7 +162,9 @@ Common::Error GroovieEngine::run() { case kGroovieV2: _resMan = new ResMan_v2(); _grvCursorMan = new GrvCursorMan_v2(_system); +#ifdef ENABLE_GROOVIE2 _videoPlayer = new ROQPlayer(this); +#endif break; } diff --git a/engines/groovie/module.mk b/engines/groovie/module.mk index b47eed912b..84d6222c59 100644 --- a/engines/groovie/module.mk +++ b/engines/groovie/module.mk @@ -12,12 +12,16 @@ MODULE_OBJS := \ music.o \ player.o \ resource.o \ - roq.o \ saveload.o \ script.o \ stuffit.o \ vdx.o +ifdef ENABLE_GROOVIE2 +MODULE_OBJS += \ + roq.o +endif + # This module can be built as a plugin ifeq ($(ENABLE_GROOVIE), DYNAMIC_PLUGIN) PLUGIN := 1 -- cgit v1.2.3 From 86b3a075d48eed0e71f0237107449ea6dd64673f Mon Sep 17 00:00:00 2001 From: D G Turner Date: Mon, 2 Jun 2014 22:09:53 +0100 Subject: GROOVIE: Add sanity checks and range limits to copyRect opcode param. This prevents segfault crashes in "The 11th Hour" when you open the Gamebook palmtop from the top of the screen. The opcode needs some work on the changes from 7th Guest, but this will prevent crashes while this is being worked on. --- engines/groovie/script.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'engines/groovie') diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 25c421f699..308811635e 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -1219,6 +1219,45 @@ void Script::o_copyrecttobg() { // 0x37 uint16 top = readScript16bits(); uint16 right = readScript16bits(); uint16 bottom = readScript16bits(); + + // Sanity checks to prevent bad pointer access crashes + if (left > right) { + warning("COPYRECT left:%d > right:%d", left, right); + // swap over left and right parameters + uint16 j; + j = right; + right = left; + left = j; + } + if (top > bottom) { + warning("COPYRECT top:%d > bottom:%d", top, bottom); + // swap over top and bottom parameters + uint16 j; + j = bottom; + bottom = top; + top = j; + } + if (top < 80) { + warning("COPYRECT top < 80... clamping"); + top = 80; + } + if (top >= 480) { + warning("COPYRECT top >= 480... clamping"); + top = 480 - 1; + } + if (bottom >= 480) { + warning("COPYRECT bottom >= 480... clamping"); + bottom = 480 - 1; + } + if (left >= 640) { + warning("COPYRECT left >= 640... clamping"); + left = 640 - 1; + } + if (right >= 640) { + warning("COPYRECT right >= 640... clamping"); + right = 640 - 1; + } + uint16 i, width = right - left, height = bottom - top; uint32 offset = 0; byte *fg, *bg; -- cgit v1.2.3 From d8751516ccd4c695696985b330b0ac65475f5170 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 5 Jun 2014 03:01:12 +0100 Subject: GROOVIE: Remove engine-specific "all" debugflag. Minor naming cleanup. This is now uneeded as the GUI debugger superclass implements the same functionality and this removes a bunch of complexity from the Groovie engine debug calls. Also, removed groovie prefix from the debug flag naming as unecessary as these are within the Groovie namespace. --- engines/groovie/cursor.cpp | 18 +++++++++--------- engines/groovie/groovie.cpp | 21 ++++++++++----------- engines/groovie/groovie.h | 24 ++++++++++++------------ engines/groovie/music.cpp | 38 +++++++++++++++++++------------------- engines/groovie/player.cpp | 6 +++--- engines/groovie/resource.cpp | 10 +++++----- engines/groovie/roq.cpp | 26 +++++++++++++------------- engines/groovie/script.cpp | 19 +++++++++---------- engines/groovie/vdx.cpp | 37 ++++++++++++++++++------------------- 9 files changed, 98 insertions(+), 101 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index 65f3e108b8..442f0bfada 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -107,8 +107,8 @@ Cursor_t7g::Cursor_t7g(uint8 *img, uint8 *pal) : _img = img + 5; - debugC(1, kGroovieDebugCursor | kGroovieDebugAll, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); - debugC(1, kGroovieDebugCursor | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::Cursor: elinor: 0x%02X (%d), 0x%02X (%d)", elinor1, elinor1, elinor2, elinor2); + debugC(1, kDebugCursor, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); + debugC(1, kDebugCursor | kDebugUnknown, "Groovie::Cursor: elinor: 0x%02X (%d), 0x%02X (%d)", elinor1, elinor1, elinor2, elinor2); } void Cursor_t7g::enable() { @@ -262,26 +262,26 @@ Cursor_v2::Cursor_v2(Common::File &file) { _img = new byte[_width * _height * _numFrames * 4]; - debugC(1, kGroovieDebugCursor | kGroovieDebugAll, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); + debugC(1, kDebugCursor, "Groovie::Cursor: width: %d, height: %d, frames:%d", _width, _height, _numFrames); uint16 tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "hotspot x?: %d\n", tmp16); + debugC(5, kDebugCursor, "hotspot x?: %d\n", tmp16); tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "hotspot y?: %d\n", tmp16); + debugC(5, kDebugCursor, "hotspot y?: %d\n", tmp16); int loop2count = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2count?: %d\n", loop2count); + debugC(5, kDebugCursor, "loop2count?: %d\n", loop2count); for (int l = 0; l < loop2count; l++) { tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2a: %d\n", tmp16); // Index frame can merge to/from? + debugC(5, kDebugCursor, "loop2a: %d\n", tmp16); // Index frame can merge to/from? tmp16 = file.readUint16LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop2b: %d\n", tmp16); // Number of frames? + debugC(5, kDebugCursor, "loop2b: %d\n", tmp16); // Number of frames? } file.read(pal, 0x20 * 3); for (int f = 0; f < _numFrames; f++) { uint32 tmp32 = file.readUint32LE(); - debugC(5, kGroovieDebugCursor | kGroovieDebugAll, "loop3: %d\n", tmp32); + debugC(5, kDebugCursor, "loop3: %d\n", tmp32); byte *data = new byte[tmp32]; file.read(data, tmp32); diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 427b1c866a..b42cf09245 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -68,17 +68,16 @@ GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) : _modeSpeed = kGroovieSpeedFast; // Initialize the custom debug levels - DebugMan.addDebugChannel(kGroovieDebugAll, "All", "Debug everything"); - DebugMan.addDebugChannel(kGroovieDebugVideo, "Video", "Debug video and audio playback"); - DebugMan.addDebugChannel(kGroovieDebugResource, "Resource", "Debug resouce management"); - DebugMan.addDebugChannel(kGroovieDebugScript, "Script", "Debug the scripts"); - DebugMan.addDebugChannel(kGroovieDebugUnknown, "Unknown", "Report values of unknown data in files"); - DebugMan.addDebugChannel(kGroovieDebugHotspots, "Hotspots", "Show the hotspots"); - DebugMan.addDebugChannel(kGroovieDebugCursor, "Cursor", "Debug cursor decompression / switching"); - DebugMan.addDebugChannel(kGroovieDebugMIDI, "MIDI", "Debug MIDI / XMIDI files"); - DebugMan.addDebugChannel(kGroovieDebugScriptvars, "Scriptvars", "Print out any change to script variables"); - DebugMan.addDebugChannel(kGroovieDebugCell, "Cell", "Debug the cell game (in the microscope)"); - DebugMan.addDebugChannel(kGroovieDebugFast, "Fast", "Play videos quickly, with no sound (unstable)"); + DebugMan.addDebugChannel(kDebugVideo, "Video", "Debug video and audio playback"); + DebugMan.addDebugChannel(kDebugResource, "Resource", "Debug resouce management"); + DebugMan.addDebugChannel(kDebugScript, "Script", "Debug the scripts"); + DebugMan.addDebugChannel(kDebugUnknown, "Unknown", "Report values of unknown data in files"); + DebugMan.addDebugChannel(kDebugHotspots, "Hotspots", "Show the hotspots"); + DebugMan.addDebugChannel(kDebugCursor, "Cursor", "Debug cursor decompression / switching"); + DebugMan.addDebugChannel(kDebugMIDI, "MIDI", "Debug MIDI / XMIDI files"); + DebugMan.addDebugChannel(kDebugScriptvars, "Scriptvars", "Print out any change to script variables"); + DebugMan.addDebugChannel(kDebugCell, "Cell", "Debug the cell game (in the microscope)"); + DebugMan.addDebugChannel(kDebugFast, "Fast", "Play videos quickly, with no sound (unstable)"); } GroovieEngine::~GroovieEngine() { diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index 9fe6b0c2f5..d442d39cb2 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -58,18 +58,18 @@ class Script; class VideoPlayer; enum DebugLevels { - kGroovieDebugAll = 1 << 0, - kGroovieDebugVideo = 1 << 1, - kGroovieDebugResource = 1 << 2, - kGroovieDebugScript = 1 << 3, - kGroovieDebugUnknown = 1 << 4, - kGroovieDebugHotspots = 1 << 5, - kGroovieDebugCursor = 1 << 6, - kGroovieDebugMIDI = 1 << 7, - kGroovieDebugScriptvars = 1 << 8, - kGroovieDebugCell = 1 << 9, - kGroovieDebugFast = 1 << 10 - // the current limitation is 32 debug levels (1 << 31 is the last one) + kDebugVideo = 1 << 0, + kDebugResource = 1 << 1, + kDebugScript = 1 << 2, + kDebugUnknown = 1 << 3, + kDebugHotspots = 1 << 4, + kDebugCursor = 1 << 5, + kDebugMIDI = 1 << 6, + kDebugScriptvars = 1 << 7, + kDebugCell = 1 << 8, + kDebugFast = 1 << 9 + // the current limitation is 32 debug levels (1 << 31 is the last one) + // but some are used by system, so avoid high values. }; /** diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 390f47f084..2c164e020c 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -64,7 +64,7 @@ void MusicPlayer::playSong(uint32 fileref) { void MusicPlayer::setBackgroundSong(uint32 fileref) { Common::StackLock lock(_mutex); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Changing the background song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Changing the background song: %04X", fileref); _backgroundFileRef = fileref; } @@ -86,7 +86,7 @@ void MusicPlayer::playCD(uint8 track) { // Stop the MIDI playback unload(); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Playing CD track %d", track); + debugC(1, kDebugMIDI, "Groovie::Music: Playing CD track %d", track); if (track == 3) { // This is the credits song, start at 23:20 @@ -136,9 +136,9 @@ void MusicPlayer::playCD(uint8 track) { } void MusicPlayer::startBackground() { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: startBackground()"); + debugC(3, kDebugMIDI, "Groovie::Music: startBackground()"); if (!_isPlaying && _backgroundFileRef) { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the background song (0x%4X)", _backgroundFileRef); + debugC(3, kDebugMIDI, "Groovie::Music: Starting the background song (0x%4X)", _backgroundFileRef); play(_backgroundFileRef, true); } } @@ -158,7 +158,7 @@ void MusicPlayer::setUserVolume(uint16 volume) { void MusicPlayer::setGameVolume(uint16 volume, uint16 time) { Common::StackLock lock(_mutex); - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting game volume from %d to %d in %dms", _gameVolume, volume, time); + debugC(1, kDebugMIDI, "Groovie::Music: Setting game volume from %d to %d in %dms", _gameVolume, volume, time); // Save the start parameters of the fade _fadingStartTime = _vm->_system->getMillis(); @@ -183,12 +183,12 @@ bool MusicPlayer::play(uint32 fileref, bool loop) { } void MusicPlayer::applyFading() { - debugC(6, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: applyFading() _fadingStartTime = %d, _fadingDuration = %d, _fadingStartVolume = %d, _fadingEndVolume = %d", _fadingStartTime, _fadingDuration, _fadingStartVolume, _fadingEndVolume); + debugC(6, kDebugMIDI, "Groovie::Music: applyFading() _fadingStartTime = %d, _fadingDuration = %d, _fadingStartVolume = %d, _fadingEndVolume = %d", _fadingStartTime, _fadingDuration, _fadingStartVolume, _fadingEndVolume); Common::StackLock lock(_mutex); // Calculate the passed time uint32 time = _vm->_system->getMillis() - _fadingStartTime; - debugC(6, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: time = %d, _gameVolume = %d", time, _gameVolume); + debugC(6, kDebugMIDI, "Groovie::Music: time = %d, _gameVolume = %d", time, _gameVolume); if (time >= _fadingDuration) { // Set the end volume _gameVolume = _fadingEndVolume; @@ -200,7 +200,7 @@ void MusicPlayer::applyFading() { if (_gameVolume == _fadingEndVolume) { // If we were fading to 0, stop the playback and restore the volume if (_fadingEndVolume == 0) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Faded to zero: end of song. _fadingEndVolume set to 100"); + debugC(1, kDebugMIDI, "Groovie::Music: Faded to zero: end of song. _fadingEndVolume set to 100"); unload(); } } @@ -210,7 +210,7 @@ void MusicPlayer::applyFading() { } void MusicPlayer::onTimer(void *refCon) { - debugC(9, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: onTimer()"); + debugC(9, kDebugMIDI, "Groovie::Music: onTimer()"); MusicPlayer *music = (MusicPlayer *)refCon; Common::StackLock lock(music->_mutex); @@ -225,7 +225,7 @@ void MusicPlayer::onTimer(void *refCon) { } void MusicPlayer::unload() { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Stopping the playback"); + debugC(1, kDebugMIDI, "Groovie::Music: Stopping the playback"); // Set the new state _isPlaying = false; @@ -319,7 +319,7 @@ void MusicPlayerMidi::updateChanVolume(byte channel) { } void MusicPlayerMidi::endTrack() { - debugC(3, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: endTrack()"); + debugC(3, kDebugMIDI, "Groovie::Music: endTrack()"); unload(); } @@ -439,7 +439,7 @@ void MusicPlayerXMI::send(uint32 b) { byte chan = b & 0xF; byte bank = (b >> 16) & 0xFF; - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Selecting bank %X for channel %X", bank, chan); + debugC(5, kDebugMIDI, "Groovie::Music: Selecting bank %X for channel %X", bank, chan); _chanBanks[chan] = bank; return; } else if ((b & 0xF0) == 0xC0) { // Program change @@ -450,7 +450,7 @@ void MusicPlayerXMI::send(uint32 b) { byte chan = b & 0xF; byte patch = (b >> 8) & 0xFF; - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting custom patch %X from bank %X to channel %X", patch, _chanBanks[chan], chan); + debugC(5, kDebugMIDI, "Groovie::Music: Setting custom patch %X from bank %X to channel %X", patch, _chanBanks[chan], chan); // Try to find the requested patch from the previously // specified bank @@ -475,7 +475,7 @@ void MusicPlayerXMI::send(uint32 b) { } bool MusicPlayerXMI::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // Open the song resource Common::SeekableReadStream *file = _vm->_resMan->open(fileref); @@ -489,7 +489,7 @@ bool MusicPlayerXMI::load(uint32 fileref, bool loop) { void MusicPlayerXMI::loadTimbres(const Common::String &filename) { // Load the Global Timbre Library format as documented in AIL2 - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Loading the GTL file %s", filename.c_str()); + debugC(1, kDebugMIDI, "Groovie::Music: Loading the GTL file %s", filename.c_str()); // Does it exist? if (!Common::File::exists(filename)) { @@ -537,7 +537,7 @@ void MusicPlayerXMI::loadTimbres(const Common::String &filename) { // Read the timbre data gtl->read(_timbres[i].data, _timbres[i].size); - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Loaded patch %x in bank %x with size %d", + debugC(5, kDebugMIDI, "Groovie::Music: Loaded patch %x in bank %x with size %d", _timbres[i].patch, _timbres[i].bank, _timbres[i].size); } @@ -636,7 +636,7 @@ void setRolandInstrument(MidiDriver *drv, byte channel, byte *instrument) { // Show the timbre name as extra debug information Common::String name((char *)instrument, 10); - debugC(5, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Setting MT32 timbre '%s' to channel %d", name.c_str(), channel); + debugC(5, kDebugMIDI, "Groovie::Music: Setting MT32 timbre '%s' to channel %d", name.c_str(), channel); sysex.roland_id = 0x41; sysex.device_id = channel; // Unit# @@ -702,7 +702,7 @@ MusicPlayerMac_t7g::MusicPlayerMac_t7g(GroovieEngine *vm) : MusicPlayerMidi(vm) } bool MusicPlayerMac_t7g::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // First try for compressed MIDI Common::SeekableReadStream *file = _vm->_macResFork->getResource(MKTAG('c','m','i','d'), fileref & 0x3FF); @@ -789,7 +789,7 @@ MusicPlayerMac_v2::MusicPlayerMac_v2(GroovieEngine *vm) : MusicPlayerMidi(vm) { } bool MusicPlayerMac_v2::load(uint32 fileref, bool loop) { - debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Starting the playback of song: %04X", fileref); + debugC(1, kDebugMIDI, "Groovie::Music: Starting the playback of song: %04X", fileref); // Find correct filename ResInfo info; diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 16cb3c47ff..c1b90fbd2c 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -94,13 +94,13 @@ void VideoPlayer::waitFrame() { } else { uint32 millisDiff = currTime - _lastFrameTime; if (millisDiff < _millisBetweenFrames) { - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Delaying %d (currTime=%d, _lastFrameTime=%d, millisDiff=%d, _millisBetweenFrame=%d)", + debugC(7, kDebugVideo, "Groovie::Player: Delaying %d (currTime=%d, _lastFrameTime=%d, millisDiff=%d, _millisBetweenFrame=%d)", _millisBetweenFrames - millisDiff, currTime, _lastFrameTime, millisDiff, _millisBetweenFrames); _syst->delayMillis(_millisBetweenFrames - millisDiff); currTime = _syst->getMillis(); - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Finished delay at %d", currTime); + debugC(7, kDebugVideo, "Groovie::Player: Finished delay at %d", currTime); } - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::Player: Frame displayed at %d (%f FPS)", currTime, 1000.0 / (currTime - _lastFrameTime)); + debugC(6, kDebugVideo, "Groovie::Player: Frame displayed at %d (%f FPS)", currTime, 1000.0 / (currTime - _lastFrameTime)); _lastFrameTime = currTime; } } diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 8229d02d91..75eba95240 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -47,7 +47,7 @@ Common::SeekableReadStream *ResMan::open(uint32 fileRef) { return NULL; } - debugC(1, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Opening resource 0x%04X (%s, %d, %d)", fileRef, _gjds[resInfo.gjd].c_str(), resInfo.offset, resInfo.size); + debugC(1, kDebugResource, "Groovie::Resource: Opening resource 0x%04X (%s, %d, %d)", fileRef, _gjds[resInfo.gjd].c_str(), resInfo.offset, resInfo.size); // Does it exist? if (!Common::File::exists(_gjds[resInfo.gjd])) { @@ -120,7 +120,7 @@ uint32 ResMan_t7g::getRef(Common::String name, Common::String scriptname) { // Test whether it's the resource we're searching Common::String resname(readname, 12); if (resname.hasPrefix(name.c_str())) { - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); + debugC(2, kDebugResource, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); found = true; } @@ -173,7 +173,7 @@ bool ResMan_t7g::getResInfo(uint32 fileRef, ResInfo &resInfo) { char resname[13]; rlFile->read(resname, 12); resname[12] = 0; - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %12s", resname); + debugC(2, kDebugResource, "Groovie::Resource: Resource name: %12s", resname); resInfo.filename = resname; // Read the resource information @@ -240,7 +240,7 @@ uint32 ResMan_v2::getRef(Common::String name, Common::String scriptname) { // Test whether it's the resource we're searching Common::String resname(readname, 18); if (resname.hasPrefix(name.c_str())) { - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %18s matches %s", readname, name.c_str()); + debugC(2, kDebugResource, "Groovie::Resource: Resource %18s matches %s", readname, name.c_str()); found = true; break; } @@ -284,7 +284,7 @@ bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) { char resname[19]; resname[18] = 0; rlFile.read(resname, 18); - debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %18s", resname); + debugC(2, kDebugResource, "Groovie::Resource: Resource name: %18s", resname); resInfo.filename = resname; // 6 padding bytes? (it looks like they're always 0) diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 3b82543695..379fcabc07 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -64,7 +64,7 @@ ROQPlayer::~ROQPlayer() { uint16 ROQPlayer::loadInternal() { // Begin reading the file - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Loading video"); + debugC(1, kDebugVideo, "Groovie::ROQ: Loading video"); // Read the file header ROQBlockHeader blockHeader; @@ -131,7 +131,7 @@ void ROQPlayer::buildShowBuf() { } bool ROQPlayer::playFrameInternal() { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Playing frame"); + debugC(5, kDebugVideo, "Groovie::ROQ: Playing frame"); // Process the needed blocks until the next video frame bool endframe = false; @@ -168,9 +168,9 @@ bool ROQPlayer::readBlockHeader(ROQBlockHeader &blockHeader) { blockHeader.size = _file->readUint32LE(); blockHeader.param = _file->readUint16LE(); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block type = 0x%02X", blockHeader.type); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block size = 0x%08X", blockHeader.size); - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Block param = 0x%04X", blockHeader.param); + debugC(10, kDebugVideo, "Groovie::ROQ: Block type = 0x%02X", blockHeader.type); + debugC(10, kDebugVideo, "Groovie::ROQ: Block size = 0x%08X", blockHeader.size); + debugC(10, kDebugVideo, "Groovie::ROQ: Block param = 0x%04X", blockHeader.param); return true; } @@ -238,7 +238,7 @@ bool ROQPlayer::processBlock() { } bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing info block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing info block"); // Verify the block header if (blockHeader.type != 0x1001 || blockHeader.size != 8 || (blockHeader.param != 0 && blockHeader.param != 1)) { @@ -285,7 +285,7 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockQuadCodebook(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad codebook block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing quad codebook block"); // Get the number of 2x2 pixel blocks to read int newNum2blocks = blockHeader.param >> 8; @@ -333,7 +333,7 @@ bool ROQPlayer::processBlockQuadCodebook(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockQuadVector(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad vector block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing quad vector block"); // Get the mean motion vectors int8 Mx = blockHeader.param >> 8; @@ -396,7 +396,7 @@ void ROQPlayer::processBlockQuadVectorBlock(int baseX, int baseY, int8 Mx, int8 } void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, int8 My) { - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing quad vector sub block"); + debugC(6, kDebugVideo, "Groovie::ROQ: Processing quad vector sub block"); uint16 codingType = getCodingType(); switch (codingType) { @@ -422,7 +422,7 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in } bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing still (JPEG) block"); Image::JPEGDecoder jpg; @@ -440,7 +440,7 @@ bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing mono sound block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing mono sound block"); // Verify the block header if (blockHeader.type != 0x1020) { @@ -483,7 +483,7 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing stereo sound block"); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing stereo sound block"); // Verify the block header if (blockHeader.type != 0x1021) { @@ -539,7 +539,7 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } bool ROQPlayer::processBlockAudioContainer(ROQBlockHeader &blockHeader) { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing audio container block: 0x%04X", blockHeader.param); + debugC(5, kDebugVideo, "Groovie::ROQ: Processing audio container block: 0x%04X", blockHeader.param); return true; } diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 308811635e..27a18450d4 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -47,14 +47,14 @@ namespace Groovie { +// FIXME - Outdated. Can be replaced by debugC() and debugCN() calls. static void debugScript(int level, bool nl, const char *s, ...) GCC_PRINTF(3, 4); static void debugScript(int level, bool nl, const char *s, ...) { char buf[STRINGBUFLEN]; va_list va; - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugScript) && - !DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) + if (!DebugMan.isDebugChannelEnabled(kDebugScript)) return; va_start(va, s); @@ -120,7 +120,7 @@ Script::~Script() { void Script::setVariable(uint16 variablenum, byte value) { _variables[variablenum] = value; - debugC(1, kGroovieDebugScriptvars | kGroovieDebugAll, "script variable[0x%03X] = %d (0x%04X)", variablenum, value, value); + debugC(1, kDebugScriptvars, "script variable[0x%03X] = %d (0x%04X)", variablenum, value, value); } void Script::setDebugger(Debugger *debugger) { @@ -369,8 +369,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) { bool contained = rect.contains(mousepos); // Show hotspots when debugging - if (DebugMan.isDebugChannelEnabled(kGroovieDebugHotspots) || - DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { + if (DebugMan.isDebugChannelEnabled(kDebugHotspots)) { rect.translate(0, -80); _vm->_graphicsMan->_foreground.frameRect(rect, 250); _vm->_system->copyRectToScreen(_vm->_graphicsMan->_foreground.getPixels(), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320); @@ -416,7 +415,7 @@ void Script::savegame(uint slot) { Common::OutSaveFile *file = SaveLoad::openForSaving(ConfMan.getActiveDomainName(), slot); if (!file) { - debugC(9, kGroovieDebugScript, "Save file pointer is null"); + debugC(9, kDebugScript, "Save file pointer is null"); GUI::MessageDialog dialog(_("Failed to save game"), _("OK")); dialog.runModal(); return; @@ -532,7 +531,7 @@ void Script::o_videofromref() { // 0x09 // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, false, "VIDEOFROMREF(0x%04X) (Not fully imp): Play video file from ref", fileref); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%04X via 0x09", fileref); + debugC(5, kDebugVideo, "Playing video 0x%04X via 0x09", fileref); } switch (fileref) { case 0x1C03: // Trilobyte logo @@ -913,7 +912,7 @@ void Script::o_vdxtransition() { // 0x1C // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VDX transition fileref = 0x%04X", fileref); - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%04X with transition", fileref); + debugC(1, kDebugVideo, "Playing video 0x%04X with transition", fileref); } // Set bit 1 @@ -1654,7 +1653,7 @@ void Script::o2_videofromref() { // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X via 0x09", fileref); + debugC(5, kDebugVideo, "Playing video 0x%08X via 0x09", fileref); } // Play the video @@ -1670,7 +1669,7 @@ void Script::o2_vdxtransition() { // Show the debug information just when starting the playback if (fileref != _videoRef) { debugScript(1, true, "VDX transition fileref = 0x%08X", fileref); - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X with transition", fileref); + debugC(1, kDebugVideo, "Playing video 0x%08X with transition", fileref); } // Set bit 1 diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 4626a6f81b..09c2e0d3ea 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -56,8 +56,7 @@ void VDXPlayer::setOrigin(int16 x, int16 y) { } uint16 VDXPlayer::loadInternal() { - if (DebugMan.isDebugChannelEnabled(kGroovieDebugVideo) || - DebugMan.isDebugChannelEnabled(kGroovieDebugAll)) { + if (DebugMan.isDebugChannelEnabled(kDebugVideo)) { int8 i; debugN(1, "Groovie::VDX: New VDX: bitflags are "); for (i = 15; i >= 0; i--) { @@ -106,24 +105,24 @@ uint16 VDXPlayer::loadInternal() { //_flagUpdateStill = _flagNine || _flagSix; // Begin reading the file - debugC(1, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Playing video"); + debugC(1, kDebugVideo, "Groovie::VDX: Playing video"); if (_file->readUint16LE() != VDX_IDENT) { error("Groovie::VDX: This does not appear to be a 7th guest VDX file"); return 0; } else { - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: VDX file identified correctly"); + debugC(5, kDebugVideo, "Groovie::VDX: VDX file identified correctly"); } uint16 tmp; // Skip unknown data: 6 bytes, ref Martine tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine1 = 0x%04X", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine1 = 0x%04X", tmp); tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine2 = 0x%04X", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine2 = 0x%04X", tmp); tmp = _file->readUint16LE(); - debugC(2, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Martine3 (FPS?) = %d", tmp); + debugC(2, kDebugVideo | kDebugUnknown, "Groovie::VDX: Martine3 (FPS?) = %d", tmp); return tmp; } @@ -144,7 +143,7 @@ bool VDXPlayer::playFrameInternal() { if (_file->eos()) break; - debugC(5, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Edward = 0x%04X", tmp); + debugC(5, kDebugVideo | kDebugUnknown, "Groovie::VDX: Edward = 0x%04X", tmp); // Read the chunk data and decompress if needed if (compSize) @@ -159,18 +158,18 @@ bool VDXPlayer::playFrameInternal() { // Use the current chunk switch (currRes) { case 0x00: - debugC(6, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Replay frame"); + debugC(6, kDebugVideo, "Groovie::VDX: Replay frame"); break; case 0x20: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Still frame"); + debugC(5, kDebugVideo, "Groovie::VDX: Still frame"); getStill(vdxData); break; case 0x25: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Animation frame"); + debugC(5, kDebugVideo, "Groovie::VDX: Animation frame"); getDelta(vdxData); break; case 0x80: - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Sound resource"); + debugC(5, kDebugVideo, "Groovie::VDX: Sound resource"); chunkSound(vdxData); break; default: @@ -182,7 +181,7 @@ bool VDXPlayer::playFrameInternal() { // Wait until the current frame can be shown - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) { + if (!DebugMan.isDebugChannelEnabled(kDebugFast)) { waitFrame(); } // TODO: Move it to a better place @@ -344,13 +343,13 @@ void VDXPlayer::getDelta(Common::ReadStream *in) { void VDXPlayer::getStill(Common::ReadStream *in) { uint16 numXTiles = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numXTiles=%d", numXTiles); + debugC(5, kDebugVideo, "Groovie::VDX: numXTiles=%d", numXTiles); uint16 numYTiles = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: numYTiles=%d", numYTiles); + debugC(5, kDebugVideo, "Groovie::VDX: numYTiles=%d", numYTiles); // It's skipped in the original: uint16 colorDepth = in->readUint16LE(); - debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: colorDepth=%d", colorDepth); + debugC(5, kDebugVideo, "Groovie::VDX: colorDepth=%d", colorDepth); uint16 imageWidth = TILE_SIZE * numXTiles; @@ -423,7 +422,7 @@ void VDXPlayer::getStill(Common::ReadStream *in) { */ } else { // Skip the remaining data - debugC(10, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Skipping still frame"); + debugC(10, kDebugVideo, "Groovie::VDX: Skipping still frame"); while (!in->eos()) { in->readByte(); } @@ -538,7 +537,7 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { byte *data = (byte *)malloc(60000); int chunksize = in->read(data, 60000); - if (!DebugMan.isDebugChannelEnabled(kGroovieDebugFast)) { + if (!DebugMan.isDebugChannelEnabled(kDebugFast)) { _audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); } } @@ -563,7 +562,7 @@ void VDXPlayer::setPalette(uint8 *palette) { if (_flagSkipPalette) return; - debugC(7, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::VDX: Setting palette"); + debugC(7, kDebugVideo, "Groovie::VDX: Setting palette"); _syst->getPaletteManager()->setPalette(palette, 0, 256); } -- cgit v1.2.3 From 025556d9a54b8b53c2cf8d3d6627d7ce2d42c934 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 5 Jun 2014 03:30:18 +0100 Subject: GROOVIE: Use debugC() and debugCN() functions directly in script debug. This removes the debugScript() wrapper, which can now be implemented directly using the relevant debug function. This avoids the variadic debug functions being wrapped in a second layer of variadic function which is probably causing a significant overhead. --- engines/groovie/script.cpp | 250 +++++++++++++++++++++------------------------ 1 file changed, 115 insertions(+), 135 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 27a18450d4..7625151082 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -47,26 +47,6 @@ namespace Groovie { -// FIXME - Outdated. Can be replaced by debugC() and debugCN() calls. -static void debugScript(int level, bool nl, const char *s, ...) GCC_PRINTF(3, 4); - -static void debugScript(int level, bool nl, const char *s, ...) { - char buf[STRINGBUFLEN]; - va_list va; - - if (!DebugMan.isDebugChannelEnabled(kDebugScript)) - return; - - va_start(va, s); - vsnprintf(buf, STRINGBUFLEN, s, va); - va_end(va); - - if (nl) - debug(level, "%s", buf); - else - debugN(level, "%s", buf); -} - Script::Script(GroovieEngine *vm, EngineVersion version) : _code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm), _videoFile(NULL), _videoRef(0), _staufsMove(NULL), _lastCursor(0xff), @@ -229,7 +209,7 @@ void Script::step() { // Only output if we're not re-doing the previous instruction if (_currentInstruction != _oldInstruction) { - debugScript(1, false, "%s", _debugString.c_str()); + debugCN(1, kDebugScript, "%s", _debugString.c_str()); _oldInstruction = _currentInstruction; } @@ -354,7 +334,7 @@ uint32 Script::getVideoRefString() { // Add a trailing dot str += 0x2E; - debugScript(0, false, "%s", str.c_str()); + debugCN(0, kDebugScript, "%s", str.c_str()); // Extract the script name. Common::String scriptname(_scriptFile.c_str(), _scriptFile.size() - 4); @@ -461,32 +441,32 @@ void Script::o_invalid() { } void Script::o_nop() { - debugScript(1, true, "NOP"); + debugC(1, kDebugScript, "NOP"); } void Script::o_nop8() { uint8 tmp = readScript8bits(); - debugScript(1, true, "NOP8: 0x%02X", tmp); + debugC(1, kDebugScript, "NOP8: 0x%02X", tmp); } void Script::o_nop16() { uint16 tmp = readScript16bits(); - debugScript(1, true, "NOP16: 0x%04X", tmp); + debugC(1, kDebugScript, "NOP16: 0x%04X", tmp); } void Script::o_nop32() { uint32 tmp = readScript32bits(); - debugScript(1, true, "NOP32: 0x%08X", tmp); + debugC(1, kDebugScript, "NOP32: 0x%08X", tmp); } void Script::o_nop8or16() { uint16 tmp = readScript8or16bits(); - debugScript(1, true, "NOP8OR16: 0x%04X", tmp); + debugC(1, kDebugScript, "NOP8OR16: 0x%04X", tmp); } void Script::o_playsong() { // 0x02 uint16 fileref = readScript16bits(); - debugScript(1, true, "PlaySong(0x%04X): Play xmidi file", fileref); + debugC(1, kDebugScript, "PlaySong(0x%04X): Play xmidi file", fileref); if (fileref == 0x4C17) { warning("this song is special somehow"); // don't save the reference? @@ -495,33 +475,33 @@ void Script::o_playsong() { // 0x02 } void Script::o_bf9on() { // 0x03 - debugScript(1, true, "BF9ON: bitflag 9 turned on"); + debugC(1, kDebugScript, "BF9ON: bitflag 9 turned on"); _bitflags |= 1 << 9; } void Script::o_palfadeout() { - debugScript(1, true, "PALFADEOUT"); + debugC(1, kDebugScript, "PALFADEOUT"); _vm->_graphicsMan->fadeOut(); } void Script::o_bf8on() { // 0x05 - debugScript(1, true, "BF8ON: bitflag 8 turned on"); + debugC(1, kDebugScript, "BF8ON: bitflag 8 turned on"); _bitflags |= 1 << 8; } void Script::o_bf6on() { // 0x06 - debugScript(1, true, "BF6ON: bitflag 6 turned on"); + debugC(1, kDebugScript, "BF6ON: bitflag 6 turned on"); _bitflags |= 1 << 6; } void Script::o_bf7on() { // 0x07 - debugScript(1, true, "BF7ON: bitflag 7 turned on"); + debugC(1, kDebugScript, "BF7ON: bitflag 7 turned on"); _bitflags |= 1 << 7; } void Script::o_setbackgroundsong() { // 0x08 uint16 fileref = readScript16bits(); - debugScript(1, true, "SetBackgroundSong(0x%04X)", fileref); + debugC(1, kDebugScript, "SetBackgroundSong(0x%04X)", fileref); _vm->_musicPlayer->setBackgroundSong(fileref); } @@ -530,7 +510,7 @@ void Script::o_videofromref() { // 0x09 // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(1, false, "VIDEOFROMREF(0x%04X) (Not fully imp): Play video file from ref", fileref); + debugC(1, kDebugScript, "VIDEOFROMREF(0x%04X) (Not fully imp): Play video file from ref", fileref); debugC(5, kDebugVideo, "Playing video 0x%04X via 0x09", fileref); } switch (fileref) { @@ -538,7 +518,7 @@ void Script::o_videofromref() { // 0x09 case 0x1C04: // Virgin logo case 0x1C05: // Credits if (fileref != _videoRef) { - debugScript(1, true, "Use external file if available"); + debugC(1, kDebugScript, "Use external file if available"); } break; @@ -550,12 +530,12 @@ void Script::o_videofromref() { // 0x09 case 0x206D: // Cards on table puzzle (bedroom) case 0x2001: // Coins on table puzzle (bedroom) if (fileref != _videoRef) { - debugScript(1, false, " (This video is special somehow!)"); + debugCN(1, kDebugScript, " (This video is special somehow!)"); warning("(This video (0x%04X) is special somehow!)", fileref); } } if (fileref != _videoRef) { - debugScript(1, false, "\n"); + debugCN(1, kDebugScript, "\n"); } // Play the video if (!playvideofromref(fileref)) { @@ -569,14 +549,14 @@ bool Script::playvideofromref(uint32 fileref) { if (fileref != _videoRef) { // Debug bitflags - debugScript(1, false, "Play video 0x%04X (bitflags:", fileref); + debugCN(1, kDebugScript, "Play video 0x%04X (bitflags:", fileref); for (int i = 15; i >= 0; i--) { - debugScript(1, false, "%d", _bitflags & (1 << i)? 1 : 0); + debugCN(1, kDebugScript, "%d", _bitflags & (1 << i)? 1 : 0); if (i % 4 == 0) { - debugScript(1, false, " "); + debugCN(1, kDebugScript, " "); } } - debugScript(1, true, " <- 0)"); + debugC(1, kDebugScript, " <- 0)"); // Close the previous video file if (_videoFile) { @@ -633,7 +613,7 @@ bool Script::playvideofromref(uint32 fileref) { _eventKbdChar = 0; // Newline - debugScript(1, false, "\n"); + debugCN(1, kDebugScript, "\n"); } // Let the caller know if the video has ended @@ -645,12 +625,12 @@ bool Script::playvideofromref(uint32 fileref) { } void Script::o_bf5on() { // 0x0A - debugScript(1, true, "BF5ON: bitflag 5 turned on"); + debugC(1, kDebugScript, "BF5ON: bitflag 5 turned on"); _bitflags |= 1 << 5; } void Script::o_inputloopstart() { //0x0B - debugScript(5, true, "Input loop start"); + debugC(5, kDebugScript, "Input loop start"); // Reset the input action and the mouse cursor _inputAction = -1; @@ -674,7 +654,7 @@ void Script::o_keyboardaction() { uint8 val = readScript8bits(); uint16 address = readScript16bits(); - debugScript(5, true, "Test key == 0x%02X @0x%04X", val, address); + debugC(5, kDebugScript, "Test key == 0x%02X @0x%04X", val, address); // If there's an already planned action, do nothing if (_inputAction != -1) { @@ -699,7 +679,7 @@ void Script::o_hotspot_rect() { uint16 address = readScript16bits(); uint8 cursor = readScript8bits(); - debugScript(5, true, "HOTSPOT-RECT(%d,%d,%d,%d) @0x%04X cursor=%d", left, top, right, bottom, address, cursor); + debugC(5, kDebugScript, "HOTSPOT-RECT(%d,%d,%d,%d) @0x%04X cursor=%d", left, top, right, bottom, address, cursor); // Mark the specified rectangle Common::Rect rect(left, top, right, bottom); @@ -709,7 +689,7 @@ void Script::o_hotspot_rect() { void Script::o_hotspot_left() { uint16 address = readScript16bits(); - debugScript(5, true, "HOTSPOT-LEFT @0x%04X", address); + debugC(5, kDebugScript, "HOTSPOT-LEFT @0x%04X", address); // Mark the leftmost 100 pixels of the game area Common::Rect rect(0, 80, 100, 400); @@ -719,7 +699,7 @@ void Script::o_hotspot_left() { void Script::o_hotspot_right() { uint16 address = readScript16bits(); - debugScript(5, true, "HOTSPOT-RIGHT @0x%04X", address); + debugC(5, kDebugScript, "HOTSPOT-RIGHT @0x%04X", address); // Mark the rightmost 100 pixels of the game area Common::Rect rect(540, 80, 640, 400); @@ -729,7 +709,7 @@ void Script::o_hotspot_right() { void Script::o_hotspot_center() { uint16 address = readScript16bits(); - debugScript(5, true, "HOTSPOT-CENTER @0x%04X", address); + debugC(5, kDebugScript, "HOTSPOT-CENTER @0x%04X", address); // Mark the centermost 240 pixels of the game area Common::Rect rect(200, 80, 440, 400); @@ -739,7 +719,7 @@ void Script::o_hotspot_center() { void Script::o_hotspot_current() { uint16 address = readScript16bits(); - debugScript(5, true, "HOTSPOT-CURRENT @0x%04X", address); + debugC(5, kDebugScript, "HOTSPOT-CURRENT @0x%04X", address); // The original interpreter doesn't check the position, so accept the // whole screen @@ -748,7 +728,7 @@ void Script::o_hotspot_current() { } void Script::o_inputloopend() { - debugScript(5, true, "Input loop end"); + debugC(5, kDebugScript, "Input loop end"); // Handle the predefined hotspots if (_hotspotTopAction) { @@ -801,7 +781,7 @@ void Script::o_random() { uint16 varnum = readScript8or16bits(); uint8 maxnum = readScript8bits(); - debugScript(1, true, "RANDOM: var[0x%04X] = rand(%d)", varnum, maxnum); + debugC(1, kDebugScript, "RANDOM: var[0x%04X] = rand(%d)", varnum, maxnum); setVariable(varnum, _random.getRandomNumber(maxnum)); } @@ -809,7 +789,7 @@ void Script::o_random() { void Script::o_jmp() { uint16 address = readScript16bits(); - debugScript(1, true, "JMP @0x%04X", address); + debugC(1, kDebugScript, "JMP @0x%04X", address); // Set the current address _currentInstruction = address; @@ -818,18 +798,18 @@ void Script::o_jmp() { void Script::o_loadstring() { uint16 varnum = readScript8or16bits(); - debugScript(1, false, "LOADSTRING var[0x%04X..] =", varnum); + debugCN(1, kDebugScript, "LOADSTRING var[0x%04X..] =", varnum); do { setVariable(varnum++, readScriptChar(true, true, true)); - debugScript(1, false, " 0x%02X", _variables[varnum - 1]); + debugCN(1, kDebugScript, " 0x%02X", _variables[varnum - 1]); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); - debugScript(1, false, "\n"); + debugCN(1, kDebugScript, "\n"); } void Script::o_ret() { uint8 val = readScript8bits(); - debugScript(1, true, "RET %d", val); + debugC(1, kDebugScript, "RET %d", val); // Set the return value setVariable(0x102, val); @@ -846,7 +826,7 @@ void Script::o_ret() { void Script::o_call() { uint16 address = readScript16bits(); - debugScript(1, true, "CALL @0x%04X", address); + debugC(1, kDebugScript, "CALL @0x%04X", address); // Save return address in the call stack _stack[_stacktop] = _currentInstruction; @@ -859,7 +839,7 @@ void Script::o_call() { void Script::o_sleep() { uint16 time = readScript16bits(); - debugScript(1, true, "SLEEP 0x%04X", time); + debugC(1, kDebugScript, "SLEEP 0x%04X", time); _vm->_system->delayMillis(time * 3); } @@ -868,7 +848,7 @@ void Script::o_strcmpnejmp() { // 0x1A uint16 varnum = readScript8or16bits(); uint8 result = 1; - debugScript(1, false, "STRCMP-NEJMP: var[0x%04X..],", varnum); + debugCN(1, kDebugScript, "STRCMP-NEJMP: var[0x%04X..],", varnum); do { uint8 val = readScriptChar(true, true, true); @@ -877,33 +857,33 @@ void Script::o_strcmpnejmp() { // 0x1A result = 0; } varnum++; - debugScript(1, false, " 0x%02X", val); + debugCN(1, kDebugScript, " 0x%02X", val); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); uint16 address = readScript16bits(); if (!result) { - debugScript(1, true, " jumping to @0x%04X", address); + debugC(1, kDebugScript, " jumping to @0x%04X", address); _currentInstruction = address; } else { - debugScript(1, true, " not jumping"); + debugC(1, kDebugScript, " not jumping"); } } void Script::o_xor_obfuscate() { uint16 varnum = readScript8or16bits(); - debugScript(1, false, "XOR OBFUSCATE: var[0x%04X..] = ", varnum); + debugCN(1, kDebugScript, "XOR OBFUSCATE: var[0x%04X..] = ", varnum); do { uint8 val = readScript8bits(); _firstbit = ((val & 0x80) != 0); val &= 0x4F; setVariable(varnum, _variables[varnum] ^ val); - debugScript(1, false, "%c", _variables[varnum]); + debugCN(1, kDebugScript, "%c", _variables[varnum]); varnum++; } while (!_firstbit); - debugScript(1, false, "\n"); + debugCN(1, kDebugScript, "\n"); } void Script::o_vdxtransition() { // 0x1C @@ -911,7 +891,7 @@ void Script::o_vdxtransition() { // 0x1C // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(1, true, "VDX transition fileref = 0x%04X", fileref); + debugC(1, kDebugScript, "VDX transition fileref = 0x%04X", fileref); debugC(1, kDebugVideo, "Playing video 0x%04X with transition", fileref); } @@ -937,7 +917,7 @@ void Script::o_swap() { uint16 varnum1 = readScript8or16bits(); uint16 varnum2 = readScript16bits(); - debugScript(1, true, "SWAP var[0x%04X] <-> var[0x%04X]", varnum1, varnum2); + debugC(1, kDebugScript, "SWAP var[0x%04X] <-> var[0x%04X]", varnum1, varnum2); uint8 tmp = _variables[varnum1]; setVariable(varnum1, _variables[varnum2]); @@ -947,7 +927,7 @@ void Script::o_swap() { void Script::o_inc() { uint16 varnum = readScript8or16bits(); - debugScript(1, true, "INC var[0x%04X]", varnum); + debugC(1, kDebugScript, "INC var[0x%04X]", varnum); setVariable(varnum, _variables[varnum] + 1); } @@ -955,7 +935,7 @@ void Script::o_inc() { void Script::o_dec() { uint16 varnum = readScript8or16bits(); - debugScript(1, true, "DEC var[0x%04X]", varnum); + debugC(1, kDebugScript, "DEC var[0x%04X]", varnum); setVariable(varnum, _variables[varnum] - 1); } @@ -981,7 +961,7 @@ void Script::o_strcmpnejmp_var() { // 0x21 } void Script::o_copybgtofg() { // 0x22 - debugScript(1, true, "COPY_BG_TO_FG"); + debugC(1, kDebugScript, "COPY_BG_TO_FG"); memcpy(_vm->_graphicsMan->_foreground.getPixels(), _vm->_graphicsMan->_background.getPixels(), 640 * 320); } @@ -989,7 +969,7 @@ void Script::o_strcmpeqjmp() { // 0x23 uint16 varnum = readScript8or16bits(); uint8 result = 1; - debugScript(1, false, "STRCMP-EQJMP: var[0x%04X..],", varnum); + debugCN(1, kDebugScript, "STRCMP-EQJMP: var[0x%04X..],", varnum); do { uint8 val = readScriptChar(true, true, true); @@ -997,15 +977,15 @@ void Script::o_strcmpeqjmp() { // 0x23 result = 0; } varnum++; - debugScript(1, false, " 0x%02X", val); + debugCN(1, kDebugScript, " 0x%02X", val); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); uint16 address = readScript16bits(); if (result) { - debugScript(1, true, " jumping to @0x%04X", address); + debugC(1, kDebugScript, " jumping to @0x%04X", address); _currentInstruction = address; } else { - debugScript(1, true, " not jumping"); + debugC(1, kDebugScript, " not jumping"); } } @@ -1013,7 +993,7 @@ void Script::o_mov() { uint16 varnum1 = readScript8or16bits(); uint16 varnum2 = readScript16bits(); - debugScript(1, true, "MOV var[0x%04X] = var[0x%04X]", varnum1, varnum2); + debugC(1, kDebugScript, "MOV var[0x%04X] = var[0x%04X]", varnum1, varnum2); setVariable(varnum1, _variables[varnum2]); } @@ -1022,7 +1002,7 @@ void Script::o_add() { uint16 varnum1 = readScript8or16bits(); uint16 varnum2 = readScript16bits(); - debugScript(1, true, "ADD var[0x%04X] += var[0x%04X]", varnum1, varnum2); + debugC(1, kDebugScript, "ADD var[0x%04X] += var[0x%04X]", varnum1, varnum2); setVariable(varnum1, _variables[varnum1] + _variables[varnum2]); } @@ -1033,7 +1013,7 @@ void Script::o_videofromstring1() { // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(0, true, "VIDEOFROMSTRING1 0x%04X", fileref); + debugC(0, kDebugScript, "VIDEOFROMSTRING1 0x%04X", fileref); } // Play the video @@ -1049,7 +1029,7 @@ void Script::o_videofromstring2() { // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(0, true, "VIDEOFROMSTRING2 0x%04X", fileref); + debugC(0, kDebugScript, "VIDEOFROMSTRING2 0x%04X", fileref); } // Set bit 1 @@ -1068,11 +1048,11 @@ void Script::o_videofromstring2() { } void Script::o_stopmidi() { - debugScript(1, true, "STOPMIDI (TODO)"); + debugC(1, kDebugScript, "STOPMIDI (TODO)"); } void Script::o_endscript() { - debugScript(1, true, "END OF SCRIPT"); + debugC(1, kDebugScript, "END OF SCRIPT"); _vm->quitGame(); } @@ -1080,7 +1060,7 @@ void Script::o_sethotspottop() { uint16 address = readScript16bits(); uint8 cursor = readScript8bits(); - debugScript(5, true, "SETHOTSPOTTOP @0x%04X cursor=%d", address, cursor); + debugC(5, kDebugScript, "SETHOTSPOTTOP @0x%04X cursor=%d", address, cursor); _hotspotTopAction = address; _hotspotTopCursor = cursor; @@ -1090,7 +1070,7 @@ void Script::o_sethotspotbottom() { uint16 address = readScript16bits(); uint8 cursor = readScript8bits(); - debugScript(5, true, "SETHOTSPOTBOTTOM @0x%04X cursor=%d", address, cursor); + debugC(5, kDebugScript, "SETHOTSPOTBOTTOM @0x%04X cursor=%d", address, cursor); _hotspotBottomAction = address; _hotspotBottomCursor = cursor; @@ -1100,7 +1080,7 @@ void Script::o_loadgame() { uint16 varnum = readScript8or16bits(); uint8 slot = _variables[varnum]; - debugScript(1, true, "LOADGAME var[0x%04X] -> slot=%d (TODO)", varnum, slot); + debugC(1, kDebugScript, "LOADGAME var[0x%04X] -> slot=%d (TODO)", varnum, slot); loadgame(slot); _vm->_system->fillScreen(0); @@ -1110,7 +1090,7 @@ void Script::o_savegame() { uint16 varnum = readScript8or16bits(); uint8 slot = _variables[varnum]; - debugScript(1, true, "SAVEGAME var[0x%04X] -> slot=%d (TODO)", varnum, slot); + debugC(1, kDebugScript, "SAVEGAME var[0x%04X] -> slot=%d (TODO)", varnum, slot); savegame(slot); } @@ -1118,7 +1098,7 @@ void Script::o_savegame() { void Script::o_hotspotbottom_4() { //0x30 uint16 address = readScript16bits(); - debugScript(5, true, "HOTSPOT-BOTTOM @0x%04X", address); + debugC(5, kDebugScript, "HOTSPOT-BOTTOM @0x%04X", address); // Mark the 80 pixels under the game area Common::Rect rect(0, 400, 640, 480); @@ -1129,7 +1109,7 @@ void Script::o_midivolume() { uint16 arg1 = readScript16bits(); uint16 arg2 = readScript16bits(); - debugScript(1, true, "MIDI volume: %d %d", arg1, arg2); + debugC(1, kDebugScript, "MIDI volume: %d %d", arg1, arg2); _vm->_musicPlayer->setGameVolume(arg1, arg2); } @@ -1138,13 +1118,13 @@ void Script::o_jne() { uint16 varnum2 = readScript16bits(); uint16 address = readScript16bits(); - debugScript(1, false, "JNE: var[var[0x%04X] - 0x31] != var[0x%04X] @0x%04X", varnum1, varnum2, address); + debugCN(1, kDebugScript, "JNE: var[var[0x%04X] - 0x31] != var[0x%04X] @0x%04X", varnum1, varnum2, address); if (_variables[_variables[varnum1] - 0x31] != _variables[varnum2]) { _currentInstruction = address; - debugScript(1, true, " jumping to @0x%04X", address); + debugC(1, kDebugScript, " jumping to @0x%04X", address); } else { - debugScript(1, true, " not jumping"); + debugC(1, kDebugScript, " not jumping"); } } @@ -1152,19 +1132,19 @@ void Script::o_loadstringvar() { uint16 varnum = readScript8or16bits(); varnum = _variables[varnum] - 0x31; - debugScript(1, false, "LOADSTRINGVAR var[0x%04X..] =", varnum); + debugCN(1, kDebugScript, "LOADSTRINGVAR var[0x%04X..] =", varnum); do { setVariable(varnum++, readScriptChar(true, true, true)); - debugScript(1, false, " 0x%02X", _variables[varnum - 1]); + debugCN(1, kDebugScript, " 0x%02X", _variables[varnum - 1]); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); - debugScript(1, false, "\n"); + debugCN(1, kDebugScript, "\n"); } void Script::o_chargreatjmp() { uint16 varnum = readScript8or16bits(); uint8 result = 0; - debugScript(1, false, "CHARGREAT-JMP: var[0x%04X..],", varnum); + debugCN(1, kDebugScript, "CHARGREAT-JMP: var[0x%04X..],", varnum); do { uint8 val = readScriptChar(true, true, true); @@ -1172,20 +1152,20 @@ void Script::o_chargreatjmp() { result = 1; } varnum++; - debugScript(1, false, " 0x%02X", val); + debugCN(1, kDebugScript, " 0x%02X", val); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); uint16 address = readScript16bits(); if (result) { - debugScript(1, true, " jumping to @0x%04X", address); + debugC(1, kDebugScript, " jumping to @0x%04X", address); _currentInstruction = address; } else { - debugScript(1, true, " not jumping"); + debugC(1, kDebugScript, " not jumping"); } } void Script::o_bf7off() { - debugScript(1, true, "BF7OFF: bitflag 7 turned off"); + debugC(1, kDebugScript, "BF7OFF: bitflag 7 turned off"); _bitflags &= ~(1 << 7); } @@ -1193,7 +1173,7 @@ void Script::o_charlessjmp() { uint16 varnum = readScript8or16bits(); uint8 result = 0; - debugScript(1, false, "CHARLESS-JMP: var[0x%04X..],", varnum); + debugCN(1, kDebugScript, "CHARLESS-JMP: var[0x%04X..],", varnum); do { uint8 val = readScriptChar(true, true, true); @@ -1201,15 +1181,15 @@ void Script::o_charlessjmp() { result = 1; } varnum++; - debugScript(1, false, " 0x%02X", val); + debugCN(1, kDebugScript, " 0x%02X", val); } while (!(getCodeByte(_currentInstruction - 1) & 0x80)); uint16 address = readScript16bits(); if (result) { - debugScript(1, true, " jumping to @0x%04X", address); + debugC(1, kDebugScript, " jumping to @0x%04X", address); _currentInstruction = address; } else { - debugScript(1, true, " not jumping"); + debugC(1, kDebugScript, " not jumping"); } } @@ -1261,7 +1241,7 @@ void Script::o_copyrecttobg() { // 0x37 uint32 offset = 0; byte *fg, *bg; - debugScript(1, true, "COPYRECT((%d,%d)->(%d,%d))", left, top, right, bottom); + debugC(1, kDebugScript, "COPYRECT((%d,%d)->(%d,%d))", left, top, right, bottom); fg = (byte *)_vm->_graphicsMan->_foreground.getBasePtr(left, top - 80); bg = (byte *)_vm->_graphicsMan->_background.getBasePtr(left, top - 80); @@ -1274,13 +1254,13 @@ void Script::o_copyrecttobg() { // 0x37 } void Script::o_restorestkpnt() { - debugScript(1, true, "Restore stack pointer from saved (TODO)"); + debugC(1, kDebugScript, "Restore stack pointer from saved (TODO)"); } void Script::o_obscureswap() { uint16 var1, var2, tmp; - debugScript(1, true, "OBSCSWAP"); + debugC(1, kDebugScript, "OBSCSWAP"); // Read the first variable var1 = readScriptChar(false, true, true) * 10; @@ -1300,7 +1280,7 @@ void Script::o_printstring() { char stringstorage[15]; uint8 counter = 0; - debugScript(1, true, "PRINTSTRING"); + debugC(1, kDebugScript, "PRINTSTRING"); memset(stringstorage, 0, 15); do { @@ -1338,7 +1318,7 @@ void Script::o_hotspot_slot() { uint16 address = readScript16bits(); uint16 cursor = readScript8bits(); - debugScript(1, true, "HOTSPOT-SLOT %d (%d,%d,%d,%d) @0x%04X cursor=%d (TODO)", slot, left, top, right, bottom, address, cursor); + debugC(1, kDebugScript, "HOTSPOT-SLOT %d (%d,%d,%d,%d) @0x%04X cursor=%d (TODO)", slot, left, top, right, bottom, address, cursor); Common::Rect rect(left, top, right, bottom); if (hotspot(rect, address, cursor)) { @@ -1376,7 +1356,7 @@ void Script::o_hotspot_slot() { } void Script::o_checkvalidsaves() { - debugScript(1, true, "CHECKVALIDSAVES"); + debugC(1, kDebugScript, "CHECKVALIDSAVES"); // Reset the array of valid saves and the savegame names cache for (int i = 0; i < 10; i++) { @@ -1393,7 +1373,7 @@ void Script::o_checkvalidsaves() { while (it != list.end()) { int8 slot = it->getSaveSlot(); if (SaveLoad::isSlotValid(slot)) { - debugScript(2, true, " Found valid savegame: %s", it->getDescription().c_str()); + debugC(2, kDebugScript, " Found valid savegame: %s", it->getDescription().c_str()); // Mark this slot as used setVariable(slot, 1); @@ -1407,11 +1387,11 @@ void Script::o_checkvalidsaves() { // Save the number of valid saves setVariable(0x104, count); - debugScript(1, true, " Found %d valid savegames", count); + debugC(1, kDebugScript, " Found %d valid savegames", count); } void Script::o_resetvars() { - debugScript(1, true, "RESETVARS"); + debugC(1, kDebugScript, "RESETVARS"); for (int i = 0; i < 0x100; i++) { setVariable(i, 0); } @@ -1421,7 +1401,7 @@ void Script::o_mod() { uint16 varnum = readScript8or16bits(); uint8 val = readScript8bits(); - debugScript(1, true, "MOD var[0x%04X] %%= %d", varnum, val); + debugC(1, kDebugScript, "MOD var[0x%04X] %%= %d", varnum, val); setVariable(varnum, _variables[varnum] % val); } @@ -1433,7 +1413,7 @@ void Script::o_loadscript() { while ((c = readScript8bits())) { filename += c; } - debugScript(1, true, "LOADSCRIPT %s", filename.c_str()); + debugC(1, kDebugScript, "LOADSCRIPT %s", filename.c_str()); // Just 1 level of sub-scripts are allowed if (_savedCode) { @@ -1468,7 +1448,7 @@ void Script::o_setvideoorigin() { // Set bitflag 7 _bitflags |= 1 << 7; - debugScript(1, true, "SetVideoOrigin(0x%04X,0x%04X) (%d, %d)", origX, origY, origX, origY); + debugC(1, kDebugScript, "SetVideoOrigin(0x%04X,0x%04X) (%d, %d)", origX, origY, origX, origY); _vm->_videoPlayer->setOrigin(origX, origY); } @@ -1476,7 +1456,7 @@ void Script::o_sub() { uint16 varnum1 = readScript8or16bits(); uint16 varnum2 = readScript16bits(); - debugScript(1, true, "SUB var[0x%04X] -= var[0x%04X]", varnum1, varnum2); + debugC(1, kDebugScript, "SUB var[0x%04X] -= var[0x%04X]", varnum1, varnum2); setVariable(varnum1, _variables[varnum1] - _variables[varnum2]); } @@ -1486,7 +1466,7 @@ void Script::o_cellmove() { byte *scriptBoard = &_variables[0x19]; byte startX, startY, endX, endY; - debugScript(1, true, "CELL MOVE var[0x%02X]", depth); + debugC(1, kDebugScript, "CELL MOVE var[0x%02X]", depth); if (!_staufsMove) _staufsMove = new CellGame; @@ -1509,7 +1489,7 @@ void Script::o_cellmove() { void Script::o_returnscript() { uint8 val = readScript8bits(); - debugScript(1, true, "RETURNSCRIPT @0x%02X", val); + debugC(1, kDebugScript, "RETURNSCRIPT @0x%02X", val); // Are we returning from a sub-script? if (!_savedCode) { @@ -1542,7 +1522,7 @@ void Script::o_returnscript() { void Script::o_sethotspotright() { uint16 address = readScript16bits(); - debugScript(1, true, "SETHOTSPOTRIGHT @0x%04X", address); + debugC(1, kDebugScript, "SETHOTSPOTRIGHT @0x%04X", address); _hotspotRightAction = address; } @@ -1550,13 +1530,13 @@ void Script::o_sethotspotright() { void Script::o_sethotspotleft() { uint16 address = readScript16bits(); - debugScript(1, true, "SETHOTSPOTLEFT @0x%04X", address); + debugC(1, kDebugScript, "SETHOTSPOTLEFT @0x%04X", address); _hotspotLeftAction = address; } void Script::o_getcd() { - debugScript(1, true, "GETCD"); + debugC(1, kDebugScript, "GETCD"); // By default set it to no CD available int8 cd = -1; @@ -1583,7 +1563,7 @@ void Script::o_getcd() { void Script::o_playcd() { uint8 val = readScript8bits(); - debugScript(1, true, "PLAYCD %d", val); + debugC(1, kDebugScript, "PLAYCD %d", val); if (val == 2) { // TODO: Play the alternative logo @@ -1595,7 +1575,7 @@ void Script::o_playcd() { void Script::o_musicdelay() { uint16 delay = readScript16bits(); - debugScript(1, true, "MUSICDELAY %d", delay); + debugC(1, kDebugScript, "MUSICDELAY %d", delay); _vm->_musicPlayer->setBackgroundDelay(delay); } @@ -1607,7 +1587,7 @@ void Script::o_hotspot_outrect() { uint16 bottom = readScript16bits(); uint16 address = readScript16bits(); - debugScript(1, true, "HOTSPOT-OUTRECT(%d,%d,%d,%d) @0x%04X (TODO)", left, top, right, bottom, address); + debugC(1, kDebugScript, "HOTSPOT-OUTRECT(%d,%d,%d,%d) @0x%04X (TODO)", left, top, right, bottom, address); // Test if the current mouse position is outside the specified rectangle Common::Rect rect(left, top, right, bottom); @@ -1625,25 +1605,25 @@ void Script::o_stub56() { uint8 val2 = readScript8bits(); uint8 val3 = readScript8bits(); - debugScript(1, true, "STUB56: 0x%08X 0x%02X 0x%02X", val1, val2, val3); + debugC(1, kDebugScript, "STUB56: 0x%08X 0x%02X 0x%02X", val1, val2, val3); } void Script::o_stub59() { uint16 val1 = readScript8or16bits(); uint8 val2 = readScript8bits(); - debugScript(1, true, "STUB59: 0x%04X 0x%02X", val1, val2); + debugC(1, kDebugScript, "STUB59: 0x%04X 0x%02X", val1, val2); } void Script::o2_playsong() { uint32 fileref = readScript32bits(); - debugScript(1, true, "PlaySong(0x%08X): Play xmidi file", fileref); + debugC(1, kDebugScript, "PlaySong(0x%08X): Play xmidi file", fileref); _vm->_musicPlayer->playSong(fileref); } void Script::o2_setbackgroundsong() { uint32 fileref = readScript32bits(); - debugScript(1, true, "SetBackgroundSong(0x%08X)", fileref); + debugC(1, kDebugScript, "SetBackgroundSong(0x%08X)", fileref); _vm->_musicPlayer->setBackgroundSong(fileref); } @@ -1652,7 +1632,7 @@ void Script::o2_videofromref() { // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref); + debugC(1, kDebugScript, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref); debugC(5, kDebugVideo, "Playing video 0x%08X via 0x09", fileref); } @@ -1668,7 +1648,7 @@ void Script::o2_vdxtransition() { // Show the debug information just when starting the playback if (fileref != _videoRef) { - debugScript(1, true, "VDX transition fileref = 0x%08X", fileref); + debugC(1, kDebugScript, "VDX transition fileref = 0x%08X", fileref); debugC(1, kDebugVideo, "Playing video 0x%08X with transition", fileref); } @@ -1690,30 +1670,30 @@ void Script::o2_vdxtransition() { void Script::o2_copyscreentobg() { uint16 val = readScript16bits(); - debugScript(1, true, "CopyScreenToBG3: 0x%04X", val); + debugC(1, kDebugScript, "CopyScreenToBG3: 0x%04X", val); error("Unimplemented Opcode 0x4F"); } void Script::o2_copybgtoscreen() { uint16 val = readScript16bits(); - debugScript(1, true, "CopyBG3ToScreen: 0x%04X", val); + debugC(1, kDebugScript, "CopyBG3ToScreen: 0x%04X", val); error("Unimplemented Opcode 0x50"); } void Script::o2_setvideoskip() { _videoSkipAddress = readScript16bits(); - debugScript(1, true, "SetVideoSkip (0x%04X)", _videoSkipAddress); + debugC(1, kDebugScript, "SetVideoSkip (0x%04X)", _videoSkipAddress); } void Script::o2_stub52() { uint8 arg = readScript8bits(); - debugScript(1, true, "STUB52 (0x%02X)", arg); + debugC(1, kDebugScript, "STUB52 (0x%02X)", arg); } void Script::o2_setscriptend() { uint16 arg = readScript16bits(); - debugScript(1, true, "SetScriptEnd (0x%04X)", arg); + debugC(1, kDebugScript, "SetScriptEnd (0x%04X)", arg); } Script::OpcodeFunc Script::_opcodesT7G[NUM_OPCODES] = { -- cgit v1.2.3