[Scummvm-git-logs] scummvm master -> 8e93d32b5458e1f5aedb7fb798aa77ea20b75d3c

Strangerke noreply at scummvm.org
Wed Feb 11 22:53:41 UTC 2026


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
d87a2395d0 M4: remove unused headers, some clean up
8fb38acd90 M4: Cleanup of FileIO
10ca544b18 M4: BURGER: Enforce the use of enums with series.show (room 145 and 802)
45ae2c83eb M4: BURGER: Enforce the use of enums with series.series_play (room 102 and 140_141)
d43fc5f112 M4: initialize variables in the definition of DrawRequestX, RendCell, RendGlobals, M4Rect, RectList and matte
59bfbf187d M4: Remove some unused functions in graphics
8e93d32b54 M4: RIDDLE: Remove kernel_examine_inventory_object with 8 parameters after a check in the IDB, remove some unused define


Commit: d87a2395d0e20c3387044b77d888d5859cefef7b
    https://github.com/scummvm/scummvm/commit/d87a2395d0e20c3387044b77d888d5859cefef7b
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:44+01:00

Commit Message:
M4: remove unused headers, some clean up

Changed paths:
  R engines/m4/dbg/dbg_defs.h
  R engines/m4/dbg/debug.h
    engines/m4/core/term.cpp
    engines/m4/core/term.h
    engines/m4/vars.cpp
    engines/m4/wscript/ws_cruncher.cpp
    engines/m4/wscript/ws_hal.cpp
    engines/m4/wscript/ws_machine.cpp


diff --git a/engines/m4/core/term.cpp b/engines/m4/core/term.cpp
index 9694526a30a..261f0c6d34c 100644
--- a/engines/m4/core/term.cpp
+++ b/engines/m4/core/term.cpp
@@ -29,7 +29,6 @@ namespace M4 {
 
 void Term::init(bool use_me, bool use_log) {
 	_using_mono_screen = use_me;
-	_use_log_file = use_log;
 	set_mode(MESSAGE_MODE);
 
 	if (use_log) {
diff --git a/engines/m4/core/term.h b/engines/m4/core/term.h
index 4f929730f59..438fde938b3 100644
--- a/engines/m4/core/term.h
+++ b/engines/m4/core/term.h
@@ -36,7 +36,6 @@ class Term {
 private:
 	Common::WriteStream *_file = nullptr;
 	bool _using_mono_screen = false;
-	bool _use_log_file = false;
 	TermMode _mode = NO_MODE;
 
 public:
diff --git a/engines/m4/dbg/dbg_defs.h b/engines/m4/dbg/dbg_defs.h
deleted file mode 100644
index b426cbcb799..00000000000
--- a/engines/m4/dbg/dbg_defs.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef M4_DBG_DBG_DEFS_H
-#define M4_DBG_DBG_DEFS_H
-
-#include "m4/m4_types.h"
-#include "m4/dbg/dbg_defs.h"
-#include "m4/gui/gui_dialog.h"
-#include "m4/wscript/ws_machine.h"
-
-namespace M4 {
-
-struct DBGSequSR {
-	DBGSequSR *next;
-	int32 prevSequHash;
-	int32 returnOffset;
-};
-
-struct DBGWatch {
-	DBGWatch *next;
-	DBGWatch *prev;
-	machine *m;
-	Dialog *d;
-	bool moreInfo;
-	bool machStep;
-	int32 sequHash;
-	bool sequStep;
-};
-
-} // namespace M4
-
-#endif
diff --git a/engines/m4/dbg/debug.h b/engines/m4/dbg/debug.h
deleted file mode 100644
index f26de6b4ae4..00000000000
--- a/engines/m4/dbg/debug.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef M4_DBG_DEBUG_H
-#define M4_DBG_DEBUG_H
-
-#include "m4/dbg/dbg_wscript.h"
-
-#endif
diff --git a/engines/m4/vars.cpp b/engines/m4/vars.cpp
index 29c4c5f2da1..ebd77886ffc 100644
--- a/engines/m4/vars.cpp
+++ b/engines/m4/vars.cpp
@@ -26,7 +26,7 @@
 #include "m4/adv_r/adv.h"
 #include "m4/adv_r/adv_been.h"
 #include "m4/core/errors.h"
-#include "m4/dbg/debug.h"
+#include "m4/dbg/dbg_wscript.h"
 #include "m4/graphics/gr_pal.h"
 #include "m4/gui/game_menu.h"
 #include "m4/gui/gui_buffer.h"
diff --git a/engines/m4/wscript/ws_cruncher.cpp b/engines/m4/wscript/ws_cruncher.cpp
index 2e6299a0e5a..c8a37762e2d 100644
--- a/engines/m4/wscript/ws_cruncher.cpp
+++ b/engines/m4/wscript/ws_cruncher.cpp
@@ -24,7 +24,7 @@
 #include "m4/wscript/wst_regs.h"
 #include "m4/core/errors.h"
 #include "m4/core/imath.h"
-#include "m4/dbg/debug.h"
+#include "m4/dbg/dbg_wscript.h"
 #include "m4/mem/mem.h"
 #include "m4/vars.h"
 
diff --git a/engines/m4/wscript/ws_hal.cpp b/engines/m4/wscript/ws_hal.cpp
index e45d548c5e7..632ad5c7fdf 100644
--- a/engines/m4/wscript/ws_hal.cpp
+++ b/engines/m4/wscript/ws_hal.cpp
@@ -25,7 +25,7 @@
 #include "m4/wscript/wst_regs.h"
 #include "m4/core/errors.h"
 #include "m4/core/imath.h"
-#include "m4/dbg/debug.h"
+#include "m4/dbg/dbg_wscript.h"
 #include "m4/graphics/gr_sprite.h"
 #include "m4/graphics/rend.h"
 #include "m4/gui/gui_vmng.h"
diff --git a/engines/m4/wscript/ws_machine.cpp b/engines/m4/wscript/ws_machine.cpp
index 131193fbade..1cdfe81869c 100644
--- a/engines/m4/wscript/ws_machine.cpp
+++ b/engines/m4/wscript/ws_machine.cpp
@@ -26,7 +26,7 @@
 #include "m4/wscript/wscript.h"
 #include "m4/core/errors.h"
 #include "m4/core/imath.h"
-#include "m4/dbg/debug.h"
+#include "m4/dbg/dbg_wscript.h"
 #include "m4/mem/mem.h"
 #include "m4/platform/timer.h"
 #include "m4/vars.h"


Commit: 8fb38acd90bafc4b1b440a7186870081624bf1d1
    https://github.com/scummvm/scummvm/commit/8fb38acd90bafc4b1b440a7186870081624bf1d1
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:45+01:00

Commit Message:
M4: Cleanup of FileIO

Changed paths:
    engines/m4/fileio/extensions.cpp
    engines/m4/fileio/extensions.h
    engines/m4/fileio/fstream.cpp
    engines/m4/fileio/sys_file.cpp
    engines/m4/fileio/sys_file.h


diff --git a/engines/m4/fileio/extensions.cpp b/engines/m4/fileio/extensions.cpp
index 4daa23d6d07..a3b79341161 100644
--- a/engines/m4/fileio/extensions.cpp
+++ b/engines/m4/fileio/extensions.cpp
@@ -23,20 +23,12 @@
 
 namespace M4 {
 
-Common::String f_extension_add(const Common::String &name, const Common::String &ext) {
-	size_t dot = name.findFirstOf('.');
-	if (dot == Common::String::npos)
-		return name + "." + ext;
-	else
-		return name;
-}
-
 Common::String f_extension_new(const Common::String &name, const Common::String &ext) {
-	size_t dot = name.findFirstOf('.');
+	const size_t dot = name.findFirstOf('.');
 	if (dot != Common::String::npos)
 		return Common::String(name.c_str(), name.c_str() + dot + 1) + ext;
-	else
-		return name + "." + ext;
+
+	return name + "." + ext;
 }
 
 } // namespace M4
diff --git a/engines/m4/fileio/extensions.h b/engines/m4/fileio/extensions.h
index 0c768f91805..a82ca1bffd4 100644
--- a/engines/m4/fileio/extensions.h
+++ b/engines/m4/fileio/extensions.h
@@ -26,8 +26,6 @@
 
 namespace M4 {
 
-Common::String f_extension_add(const Common::String &name, const Common::String &ext);
-
 Common::String f_extension_new(const Common::String &name, const Common::String &ext);
 
 } // namespace M4
diff --git a/engines/m4/fileio/fstream.cpp b/engines/m4/fileio/fstream.cpp
index 4ea3cda93e2..ece5fb33762 100644
--- a/engines/m4/fileio/fstream.cpp
+++ b/engines/m4/fileio/fstream.cpp
@@ -225,8 +225,6 @@ void f_stream_DumpPreviouslyRead(strmRequest *myStream) {
 
 
 int32 f_stream_Read(strmRequest *myStream, uint8 **dest, int32 numBytes) {
-	int32 bytesAvail;
-
 	// Parameter verification
 	if (!myStream)
 		error_show(FL, "f_stream_Read() failed - invalid stream request");
@@ -243,6 +241,7 @@ int32 f_stream_Read(strmRequest *myStream, uint8 **dest, int32 numBytes) {
 	// Now either the strmHead is >= the strmTail, or there is enough data at the end of the buffer to fulfill numBytes      
 
 	// Calculate the number of bytes available
+	int32 bytesAvail;
 	if (myStream->strmTail <= myStream->strmHead) {
 		bytesAvail = (int32)(myStream->strmHead - myStream->strmTail);
 	} else {
@@ -272,7 +271,7 @@ int32 f_stream_Read(strmRequest *myStream, uint8 **dest, int32 numBytes) {
 	// If this has happened, since we "unwrapped" the stream buff, we can guarantee that strmTail < strmHead
 
 	// Calculate how much more must be read in
-	int32 bytesNeeded = numBytes - bytesAvail;
+	const int32 bytesNeeded = numBytes - bytesAvail;
 
 	// Make sure we have enough room at the end of the buffer to accommodate
 	if ((int32)(myStream->endStrmBuff - myStream->strmHead) < bytesNeeded) {
@@ -297,7 +296,7 @@ int32 f_stream_Read(strmRequest *myStream, uint8 **dest, int32 numBytes) {
 	}
 
 	// Read in the bytesNeeded
-	int32 bytesRead = myStream->srcFile->read(myStream->strmHead, bytesNeeded);
+	const int32 bytesRead = myStream->srcFile->read(myStream->strmHead, bytesNeeded);
 
 	if (bytesRead < bytesNeeded) {
 		// If we could not read that much in, close the srcFile
@@ -492,7 +491,7 @@ void f_stream_Process(int32 numToProcess) {
 			}
 		}
 
-		// If we were able, we serviced the above stream request. Get the next request and decriment the counter
+		// If we were able, we serviced the above stream request. Get the next request and decrement the counter
 		myStream = myStream->next;
 		numToProcess--;
 	}
diff --git a/engines/m4/fileio/sys_file.cpp b/engines/m4/fileio/sys_file.cpp
index 7668bbecc0c..f283295d8cc 100644
--- a/engines/m4/fileio/sys_file.cpp
+++ b/engines/m4/fileio/sys_file.cpp
@@ -209,12 +209,8 @@ void SysFile::open_read() {
 	}
 }
 
-void SysFile::open_write() {
-	error("open_write is not implemented in ScummVM");
-}
-
 Common::String SysFile::get_last_string(const Common::String &src) {
-	int len = src.size();
+	const int len = src.size();
 	Common::String result;
 
 	int j;
@@ -241,8 +237,8 @@ bool SysFile::open_hash_file() {
 		return false;
 	}
 
-	uint32 hash_table_size = hashfp->readUint32LE();
-	uint32 hash_address = key_to_hash_address(filename, hash_table_size);
+	const uint32 hash_table_size = hashfp->readUint32LE();
+	const uint32 hash_address = key_to_hash_address(filename, hash_table_size);
 
 	if (!hash_search(filename, &curr_hash_record, curr_hag_record, hash_address, hashfp, hash_table_size, show_error_flag)) {
 		hag_success = 0;
@@ -260,8 +256,8 @@ bool SysFile::open_hash_file() {
 
 	// Check if this Hag file already open or not
 	local_name = f_extension_new(local_name, "HAG");
-	Common::String temp_name = local_name;
-	Common::String hag_name = local_name; // Original used in cd_resource + name
+	const Common::String temp_name = local_name;
+	const Common::String hag_name = local_name; // Original used in cd_resource + name
 
 	bool found = false;
 	Hag_Record *temp_ptr = _G(hag).hag_file_list;
@@ -294,8 +290,6 @@ bool SysFile::open_hash_file() {
 				temp_fp = f_io_open(Common::Path(temp_name), "rb");
 				if (!temp_fp) {
 					error("hag file not found: %s", hag_name.c_str());
-					hag_success = 0;
-					return 0;
 				}
 
 				// Add this new open hag file in resource dir into open hag file list
@@ -410,12 +404,12 @@ int SysFile::hash_search(const Common::String &fname, Hash_Record *current_hash_
 			r.disks = hashfp->readByte();
 			r.offset = hashfp->readUint32LE();
 			r.size = hashfp->readUint32LE();
-			uint32 next_record = hashfp->readUint32LE();
+			const uint32 next_record = hashfp->readUint32LE();
 			r.filename = myfilename;
 
-			// As long as we find a hag file, use it immedeiately
+			// As long as we find a hag file, use it immediately
 			get_local_name_from_hagfile(local_name, current_hash_record_ptr->hagfile);
-			Common::String local_hag_name = f_extension_new(local_name, "HAG");
+			const Common::String local_hag_name = f_extension_new(local_name, "HAG");
 			local_name = local_hag_name;
 
 			if (!Common::File::exists(Common::Path(local_name))) {
@@ -444,7 +438,6 @@ int SysFile::hash_search(const Common::String &fname, Hash_Record *current_hash_
 		}
 	}
 
-
 	// get the best close one of hag file for multiple same fname
 	if (find_offset != offset) {
 		if (!hashfp->seek(find_offset))
diff --git a/engines/m4/fileio/sys_file.h b/engines/m4/fileio/sys_file.h
index 78e2d814f09..74bd6514d27 100644
--- a/engines/m4/fileio/sys_file.h
+++ b/engines/m4/fileio/sys_file.h
@@ -57,7 +57,6 @@ private:
 
 private:
 	void open_read();
-	void open_write();
 	void open_read_low_level();
 	bool open_hash_file();
 	Common::String get_last_string(const Common::String &src);


Commit: 10ca544b18cb548443e5cb813286d2ddeb29edaa
    https://github.com/scummvm/scummvm/commit/10ca544b18cb548443e5cb813286d2ddeb29edaa
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:46+01:00

Commit Message:
M4: BURGER: Enforce the use of enums with series.show (room 145 and 802)

Changed paths:
    engines/m4/burger/rooms/section1/room145.cpp
    engines/m4/burger/rooms/section8/room802.cpp


diff --git a/engines/m4/burger/rooms/section1/room145.cpp b/engines/m4/burger/rooms/section1/room145.cpp
index fd58d16631f..e5f36c23ae1 100644
--- a/engines/m4/burger/rooms/section1/room145.cpp
+++ b/engines/m4/burger/rooms/section1/room145.cpp
@@ -400,7 +400,7 @@ void Room145::daemon() {
 		case 31:
 			_duration = imath_ranged_rand(180, 360);
 			_roxyState = 32;
-			_roxy.show("145rx01", 0x900, 0, 4, _duration);
+			_roxy.show("145rx01", 0x900, 0, kCHANGE_ROXY_ANIMATION, _duration);
 			break;
 
 		case 32:
diff --git a/engines/m4/burger/rooms/section8/room802.cpp b/engines/m4/burger/rooms/section8/room802.cpp
index 770fd6333d0..9c7f2419b29 100644
--- a/engines/m4/burger/rooms/section8/room802.cpp
+++ b/engines/m4/burger/rooms/section8/room802.cpp
@@ -28,6 +28,10 @@ namespace M4 {
 namespace Burger {
 namespace Rooms {
 
+enum {
+	kCHANGE_FLUMIX_ANIMATION = 17
+};
+
 static const seriesStreamBreak SERIES1[] = {
 	{   0, "802_012", 1, 150, -1, 0, nullptr, 0 },
 	{   8, "802_003", 2, 175, -1, 0, nullptr, 0 },
@@ -233,7 +237,7 @@ void Room802::daemon() {
 			_G(wilbur_should) = getWilburShould();
 			_G(flumix_should) = 6;
 			kernel_trigger_dispatch_now(kCHANGE_WILBUR_ANIMATION);
-			kernel_trigger_dispatch_now(17);
+			kernel_trigger_dispatch_now(kCHANGE_FLUMIX_ANIMATION);
 
 			_series1 = series_play("802BFX03", 0x101, 0, -1, 6, -1);
 			_series2 = series_play("802BFX02", 0x100, 1, -1, 6, -1);
@@ -288,34 +292,33 @@ void Room802::daemon() {
 		release_trigger_on_digi_state(k10027, 1);
 		break;
 
-	case 17:
-		// Flumix
+	case kCHANGE_FLUMIX_ANIMATION:
 		switch (_val2) {
 		case 1:
 			switch (_G(flumix_should)) {
 			case 5:
 				_flag1 = true;
 				_val2 = 3;
-				_series3.play("802BF03", 0x100, 0, 17, 6);
+				_series3.play("802BF03", 0x100, 0, kCHANGE_FLUMIX_ANIMATION, 6);
 				break;
 
 			case 6:
 				_flag1 = true;
 				_val2 = 2;
-				_series3.play("802BF03", 0x100, 0, 17, 6);
+				_series3.play("802BF03", 0x100, 0, kCHANGE_FLUMIX_ANIMATION, 6);
 				break;
 
 			case 9:
 				_flag1 = false;
 				_G(flumix_should) = getFlumixShould();
-				series_play_with_breaks(PLAY2, "802BF02", 0x100, 17, 3);
+				series_play_with_breaks(PLAY2, "802BF02", 0x100, kCHANGE_FLUMIX_ANIMATION, 3);
 				break;
 
 			case 10:
 				_flag1 = false;
 				_G(flumix_should) = getFlumixShould();
 				_val4 = 30;
-				series_play_with_breaks(PLAY3, "802BF02", 0x100, 17, 1);
+				series_play_with_breaks(PLAY3, "802BF02", 0x100, kCHANGE_FLUMIX_ANIMATION, 1);
 				break;
 
 			case 19:
@@ -327,7 +330,7 @@ void Room802::daemon() {
 				_flag1 = false;
 				_val4 = 30;
 				_G(flumix_should) = getFlumixShould();
-				series_play_with_breaks(PLAY1, "802BF02", 0x100, 17, 3);
+				series_play_with_breaks(PLAY1, "802BF02", 0x100, kCHANGE_FLUMIX_ANIMATION, 3);
 				break;
 			}
 			break;
@@ -337,13 +340,13 @@ void Room802::daemon() {
 			case 5:
 				_flag1 = true;
 				_val2 = 3;
-				_series3.show("802BF01", 0x100, 0, 17, 1);
+				_series3.show("802BF01", 0x100, 0, kCHANGE_FLUMIX_ANIMATION, 1);
 				break;
 
 			case 6 :
 				_flag1 = true;
 				_G(flumix_should) = getFlumixShould();
-				_series3.show("802BF03", 0x100, 0, 17, 30, 1);
+				_series3.show("802BF03", 0x100, 0, kCHANGE_FLUMIX_ANIMATION, 30, 1);
 				break;
 
 			case 19:
@@ -354,7 +357,7 @@ void Room802::daemon() {
 			default:
 				_flag1 = true;
 				_val2 = 1;
-				_series3.show("802BF03", 0x100, 2, 17, 6);
+				_series3.show("802BF03", 0x100, 2, kCHANGE_FLUMIX_ANIMATION, 6);
 				break;
 			}
 			break;
@@ -366,7 +369,7 @@ void Room802::daemon() {
 				_G(flumix_should) = 20;
 				_G(wilbur_should) = 16;
 				_series3.play("802BF01", 0x100, 4, -1, 6, -1);
-				digi_play(conv_sound_to_play(), 1, 255, 17);
+				digi_play(conv_sound_to_play(), 1, 255, kCHANGE_FLUMIX_ANIMATION);
 				break;
 
 			case 19:
@@ -378,14 +381,14 @@ void Room802::daemon() {
 				_series3.terminate();
 				_G(flumix_should) = getFlumixShould();
 				_flag1 = true;
-				_series3.show("802BF01", 0x100, 0, 17, 30, 0);
+				_series3.show("802BF01", 0x100, 0, kCHANGE_FLUMIX_ANIMATION, 30, 0);
 				conv_resume_curr();
 				break;
 
 			default:
 				_val2 = 1;
 				_flag1 = true;
-				_series3.play("802BF03", 0x100, 2, 17, 6);
+				_series3.play("802BF03", 0x100, 2, kCHANGE_FLUMIX_ANIMATION, 6);
 				break;
 			}
 			break;


Commit: 45ae2c83ebe4031d89ecb217fded14c0d8fba8ec
    https://github.com/scummvm/scummvm/commit/45ae2c83ebe4031d89ecb217fded14c0d8fba8ec
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:47+01:00

Commit Message:
M4: BURGER: Enforce the use of enums with series.series_play (room 102 and 140_141)

Changed paths:
    engines/m4/burger/rooms/section1/room102.cpp
    engines/m4/burger/rooms/section1/room140_141.cpp


diff --git a/engines/m4/burger/rooms/section1/room102.cpp b/engines/m4/burger/rooms/section1/room102.cpp
index f274ea1590e..ee5b940f8e0 100644
--- a/engines/m4/burger/rooms/section1/room102.cpp
+++ b/engines/m4/burger/rooms/section1/room102.cpp
@@ -727,7 +727,7 @@ void Room102::daemon() {
 				terminateMachineAndNull(_series6);
 				_series3 = nullptr;
 				_harryShould = 54;
-				Series::series_play("102ha07", 0xf00, 2, 3, 6, 0, 100, 0, 0, 30, 30);
+				Series::series_play("102ha07", 0xf00, 2, kCHANGE_HARRY_ANIMATION, 6, 0, 100, 0, 0, 30, 30);
 			}
 			break;
 
diff --git a/engines/m4/burger/rooms/section1/room140_141.cpp b/engines/m4/burger/rooms/section1/room140_141.cpp
index 448f9ab9d62..1d55d29abf0 100644
--- a/engines/m4/burger/rooms/section1/room140_141.cpp
+++ b/engines/m4/burger/rooms/section1/room140_141.cpp
@@ -311,31 +311,31 @@ void Room140_141::daemon() {
 				if (imath_ranged_rand(1, 15) == 1) {
 					digi_stop(2);
 					_trufflesMode = 1;
-					Series::series_play("140tr01", 0xa00, 0, 6, 10, 0, 100, 0, 0, 0, 0);
+					Series::series_play("140tr01", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
 				} else {
 					playRandom();
 					frame = imath_ranged_rand(7, 8);
-					Series::series_play("140tr01", 0xa00, 0, 6, 10, 0, 100, 0, 0, frame, frame);
+					Series::series_play("140tr01", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 10, 0, 100, 0, 0, frame, frame);
 				}
 			} else {
 				digi_stop(2);
 				_trufflesMode = 1;
-				Series::series_play("140tr01", 0xa00, 0, 6, 10, 0, 100, 0, 0, 0, 0);
+				Series::series_play("140tr01", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 10, 0, 100, 0, 0, 0, 0);
 			}
 			break;
 
 		case 4:
 			_trufflesMode = 3;
-			Series::series_play("140tr01", 0xa00, 0, 6, 6, 0, 100, 0, 0, 9, 11);
+			Series::series_play("140tr01", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 6, 0, 100, 0, 0, 9, 11);
 			break;
 
 		case 7:
 			if (_trufflesShould == 7) {
 				frame = imath_ranged_rand(5, 6);
-				Series::series_play("140tr02", 0xa00, 0, 6, 7, 0, 100, 0, 0, frame, frame);
+				Series::series_play("140tr02", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 7, 0, 100, 0, 0, frame, frame);
 
 			} else {
-				Series::series_play("140tr02", 0xa00, 0, 6, 7, 0, 100, 0, 0, 7, 8);
+				Series::series_play("140tr02", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 7, 0, 100, 0, 0, 7, 8);
 			}
 			break;
 
@@ -344,14 +344,14 @@ void Room140_141::daemon() {
 			case 10:
 				digi_play("140t002", 2, 255, 12);
 				_trufflesMode = 10;
-				Series::series_play("140tr06", 0xa00, 0, 6, 8, 0, 100, 0, 0, 0, 4);
+				Series::series_play("140tr06", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 8, 0, 100, 0, 0, 0, 4);
 				break;
 
 			case 12:
 				digi_play(Common::String::format("140t004%c", 'a' + imath_ranged_rand(0, 3)).c_str(),
 					2, 255, 10);
 				_trufflesMode = 12;
-				Series::series_play("140tr07", 0xa00, 0, 6, 7, 0, 100, 0, 0, 0, 3);
+				Series::series_play("140tr07", 0xa00, 0, kCHANGE_TRUFFLES_ANIMATION, 7, 0, 100, 0, 0, 0, 3);
 
 				if (player_said("gear", "dock") || player_said("try to dock")) {
 					kernel_timing_trigger(90, 16);


Commit: d43fc5f11237e6653a70c887b9712d71b1a5362f
    https://github.com/scummvm/scummvm/commit/d43fc5f11237e6653a70c887b9712d71b1a5362f
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:48+01:00

Commit Message:
M4: initialize variables in the definition of DrawRequestX, RendCell, RendGlobals, M4Rect, RectList and matte

Changed paths:
    engines/m4/graphics/rend.h
    engines/m4/gui/gui.h


diff --git a/engines/m4/graphics/rend.h b/engines/m4/graphics/rend.h
index 46a66eb6f70..480c43b8f65 100644
--- a/engines/m4/graphics/rend.h
+++ b/engines/m4/graphics/rend.h
@@ -40,26 +40,26 @@ struct RendGrBuff {
 };
 
 struct DrawRequestX {
-	int32 x;			// X position relative	to GrBuff(0, 0)
-	int32 y;			// Y position relative	to GrBuff(0, 0)
-	int32 scale_x;		// X scale factor (can be negative for reverse draw)
-	int32 scale_y;		// Y scale factor (can't be negative)
-	uint8 *depth_map;	// Depth code array for destination (doesn't care if srcDepth is 0)
-	RGBcolor *Pal;		// Palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
-	uint8 *ICT;			// Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
-	uint8 depth;		// Depth code for source (0 if no depth processing)
+	int32 x = 0;				// X position relative	to GrBuff(0, 0)
+	int32 y = 0;				// Y position relative	to GrBuff(0, 0)
+	int32 scale_x = 0;			// X scale factor (can be negative for reverse draw)
+	int32 scale_y = 0;			// Y scale factor (can't be negative)
+	uint8 *depth_map = nullptr;	// Depth code array for destination (doesn't care if srcDepth is 0)
+	RGBcolor *Pal = nullptr;	// Palette for shadow draw (doesn't care if SHADOW bit is not set in Src.encoding)
+	uint8 *ICT = nullptr;		// Inverse Color Table (doesn't care if SHADOW bit is not set in Src.encoding)
+	uint8 depth = 0;			// Depth code for source (0 if no depth processing)
 };
 
 struct RendCell {
-	uint32 Pack;
-	uint32 Stream;
-	long   hot_x;
-	long   hot_y;
-	uint32 Width;
-	uint32 Height;
-	uint32 Comp;
-	uint32 Reserved[8];
-	uint8 *data;
+	uint32 Pack = 0;
+	uint32 Stream = 0;
+	long   hot_x = 0;
+	long   hot_y = 0;
+	uint32 Width = 0;
+	uint32 Height = 0;
+	uint32 Comp = 0;
+	uint32 Reserved[8] = {};
+	uint8 *data = nullptr;
 };
 
 enum {
@@ -73,10 +73,18 @@ typedef uint32 RenderResult;
 typedef RenderResult(*RenderFunc)();
 
 struct Rend_Globals {
-	uint8 *_sourceAddress, *_destinationAddress, *_depthAddress, _spriteDepth, *_InverseColorTable;
-	int32 _X_scale, _LeftPorch, _RightPorch, _StartingPixelPos, _X_error;
-	int _Increment;
-	RGBcolor *_Palette;
+	uint8 *_sourceAddress = nullptr;
+	uint8 *_destinationAddress = nullptr;
+	uint8 *_depthAddress = nullptr;
+	uint8 _spriteDepth = 0;
+	uint8 *_InverseColorTable = nullptr;
+	int32 _X_scale = 0;
+	int32 _LeftPorch = 0;
+	int32 _RightPorch = 0;
+	int32 _StartingPixelPos = 0;
+	int32 _X_error = 0;
+	int _Increment = 0;
+	RGBcolor *_Palette = nullptr;
 };
 
 void GetUpdateRectangle(int32 x, int32 y, int32 hot_x, int32 hot_y, int32 scale_x, int32 scale_y, int32 Width, int32 Height, M4Rect *UpdateRect);
diff --git a/engines/m4/gui/gui.h b/engines/m4/gui/gui.h
index 24909f3928f..8a989282a69 100644
--- a/engines/m4/gui/gui.h
+++ b/engines/m4/gui/gui.h
@@ -50,26 +50,32 @@ struct transSprite {
 
 
 struct M4Rect {
-	int32 x1, y1, x2, y2;
+	int32 x1 = 0;
+	int32 y1 = 0;
+	int32 x2 = 0;
+	int32 y2 = 0;
 };
 
 struct RectList {
-	RectList *next;
-	RectList *prev;
-	int32 x1, y1, x2, y2;
+	RectList *next = nullptr;
+	RectList *prev = nullptr;
+	int32 x1 = 0;
+	int32 y1 = 0;
+	int32 x2 = 0;
+	int32 y2 = 0;
 };
 
 struct matte {
-	matte *nextMatte;
-	void *myScreen;
-	int32 x1;
-	int32 y1;
-	int32 x2;
-	int32 y2;
-	int32 w;
-	int32 h;
-	uint8 *SrcBuffer;
-	uint32 SrcPitch;
+	matte *nextMatte = nullptr;
+	void *myScreen = nullptr;
+	int32 x1 = 0;
+	int32 y1 = 0;
+	int32 x2 = 0;
+	int32 y2 = 0;
+	int32 w = 0;
+	int32 h = 0;
+	uint8 *SrcBuffer = nullptr;
+	uint32 SrcPitch = 0;
 };
 
 } // End of namespace M4


Commit: 59bfbf187d17be9e74fd2093a3de19a2421100b1
    https://github.com/scummvm/scummvm/commit/59bfbf187d17be9e74fd2093a3de19a2421100b1
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:49+01:00

Commit Message:
M4: Remove some unused functions in graphics

Changed paths:
    engines/m4/graphics/gr_color.h
    engines/m4/graphics/gr_draw.cpp
    engines/m4/graphics/gr_draw.h
    engines/m4/graphics/gr_font.cpp
    engines/m4/graphics/gr_line.cpp
    engines/m4/graphics/gr_line.h
    engines/m4/graphics/gr_pal.cpp
    engines/m4/graphics/gr_pal.h
    engines/m4/graphics/gr_series.cpp
    engines/m4/graphics/gr_series.h
    engines/m4/graphics/krn_pal.cpp
    engines/m4/mem/reloc.h


diff --git a/engines/m4/graphics/gr_color.h b/engines/m4/graphics/gr_color.h
index d6c3de187f4..b1f8735315b 100644
--- a/engines/m4/graphics/gr_color.h
+++ b/engines/m4/graphics/gr_color.h
@@ -22,7 +22,6 @@
 #ifndef M4_GRAPHICS_GR_COLOR_H
 #define M4_GRAPHICS_GR_COLOR_H
 
-#include "m4/m4_types.h"
 #include "m4/mem/reloc.h"
 
 namespace M4 {
diff --git a/engines/m4/graphics/gr_draw.cpp b/engines/m4/graphics/gr_draw.cpp
index 7ace999711b..73ad1b9eda0 100644
--- a/engines/m4/graphics/gr_draw.cpp
+++ b/engines/m4/graphics/gr_draw.cpp
@@ -21,7 +21,6 @@
 
 #include "m4/graphics/gr_draw.h"
 #include "m4/graphics/gr_line.h"
-#include "m4/graphics/gr_pal.h"
 
 namespace M4 {
 
@@ -29,33 +28,4 @@ void buffer_put_pixel(Buffer *buf, int32 x, int32 y, byte c) {
 	*(buf->data + x + (y * buf->stride)) = (uint8)c;
 }
 
-byte buffer_get_pixel(Buffer *buf, int32 x, int32 y) {
-	return *(buf->data + x + (y * buf->stride));
-}
-
-void buffer_draw_box(Buffer *buf, int32 x1, int32 y1, int32 x2, int32 y2, byte color) {
-	gr_color_set(color);
-	gr_hline(buf, x1, x2, y1);
-	gr_hline(buf, x1, x2, y2);
-	gr_vline(buf, x1, y1, y2);
-	gr_vline(buf, x2, y1, y2);
-}
-
-void buffer_draw_box_xor(Buffer *buf, int32 x1, int32 y1, int32 x2, int32 y2) {
-	gr_hline_xor(buf, x1, x2, y1);
-	gr_hline_xor(buf, x1, x2, y2);
-	gr_vline_xor(buf, x1, y1 + 1, y2 - 1);
-	gr_vline_xor(buf, x2, y1 + 1, y2 - 1);
-}
-
-int32 buffer_fill(Buffer *target, byte value) {
-	if (!target)
-		return false;
-	if (!target->data)
-		return false;
-
-	memset(target->data, value, target->stride * target->h);
-	return true;
-}
-
 } // namespace M4
diff --git a/engines/m4/graphics/gr_draw.h b/engines/m4/graphics/gr_draw.h
index 6770693bc5c..63b43bda3eb 100644
--- a/engines/m4/graphics/gr_draw.h
+++ b/engines/m4/graphics/gr_draw.h
@@ -31,27 +31,6 @@ namespace M4 {
  */
 void buffer_put_pixel(Buffer *buf, int32 x, int32 y, byte c);
 
-/**
- * Given X, Y returns value of pixel at that address on the screen
- */
-byte buffer_get_pixel(Buffer *buf, int32 x, int32 y);
-
-/**
- * Draws outside edge of retangle given home and size along both axis
- */
-void buffer_draw_box(Buffer *buf, int32 x1, int32 y1, int32 x2, int32 y2, byte color);
-
-/**
- * Draws a rectangle using xor
- */
-void buffer_draw_box_xor(Buffer *buf, int32 x1, int32 y1, int32 x2, int32 y2);
-
-/**
- * Fills an entire buffer with a single byte value.
- * @returns Returns True if successful, FALSE if buffer invalid.
-*/
-int32 buffer_fill(Buffer *target, byte value);
-
 } // namespace M4
 
 #endif
diff --git a/engines/m4/graphics/gr_font.cpp b/engines/m4/graphics/gr_font.cpp
index 945667a5324..406f352e8e7 100644
--- a/engines/m4/graphics/gr_font.cpp
+++ b/engines/m4/graphics/gr_font.cpp
@@ -29,8 +29,6 @@
 
 namespace M4 {
 
-#define font_width 2		/* offset to width array */
-#define font_data 130		/* offset to data array	*/
 #define STR_FONTSTRUCT "font struct"
 #define STR_FONTWIDTH "font widths"
 #define STR_FONTOFF "font offsets"
diff --git a/engines/m4/graphics/gr_line.cpp b/engines/m4/graphics/gr_line.cpp
index e324e7711c0..228ca8b6fd9 100644
--- a/engines/m4/graphics/gr_line.cpp
+++ b/engines/m4/graphics/gr_line.cpp
@@ -24,37 +24,6 @@
 
 namespace M4 {
 
-void gr_vline_xor(Buffer *buf, int32 x, int32 y1, int32 y2) {
-	if (y1 > y2) {
-		SWAP(y1, y2);
-	}
-
-	if ((x > buf->w) || (y1 > buf->h))
-		return;
-
-	if (y2 > buf->h)
-		y2 = buf->h;	// Don't draw past bottom
-
-	byte *start = buf->data + x;
-
-	for (int32 i = y1; i < y2; i++, start += buf->stride)
-		*start ^= 0xff;
-}
-
-void gr_hline_xor(Buffer *buf, int32 x1, int32 x2, int32 y) {
-	if (x1 > x2) {
-		SWAP(x1, x2);
-	}
-
-	if ((y > buf->h) || (x1 > buf->w))
-		return;
-
-	byte *start = gr_buffer_pointer(buf, x1, y);
-
-	for (int32 i = x1; i < x2; i++, start++)
-		*start ^= 0xff;
-}
-
 void gr_vline(Buffer *buf, int32 x, int32 y1, int32 y2) {
 	if (y1 > y2) {
 		SWAP(y1, y2);
diff --git a/engines/m4/graphics/gr_line.h b/engines/m4/graphics/gr_line.h
index dc1adfe9199..286ee740618 100644
--- a/engines/m4/graphics/gr_line.h
+++ b/engines/m4/graphics/gr_line.h
@@ -37,8 +37,6 @@ void gr_hline(Buffer *buf, int32 x1, int32 x2, int32 y);
  * X value, draws a line in the given color on the live MCGA screen.
  */
 void gr_vline(Buffer *buf, int32 x, int32 y1, int32 y2);
-void gr_hline_xor(Buffer *buf, int32 x1, int32 x2, int32 y);
-void gr_vline_xor(Buffer *buf, int32 x, int32 y1, int32 y2);
 void gr_line(int32 x1, int32 y1, int32 x2, int32 y2, int32 color, Buffer *screen);
 
 } // namespace M4
diff --git a/engines/m4/graphics/gr_pal.cpp b/engines/m4/graphics/gr_pal.cpp
index af6e473d5f6..bb43160cd08 100644
--- a/engines/m4/graphics/gr_pal.cpp
+++ b/engines/m4/graphics/gr_pal.cpp
@@ -39,13 +39,6 @@ uint8 *gr_color_createInverseTable(RGB8 *pal, uint8 bitDepth, int begin_color, i
 	error("gr_color_createInverseTable is not implemented in ScummVM");
 }
 
-void gr_color_create_ipl5(uint8 *inverseColorTable, char *fname, int room_num) {
-	error("gr_color_create_ipl5 is not implemented in ScummVM");
-}
-
-uint8 *gr_color_load_ipl5(const char *filename, uint8 *inverseColors) {
-	error("gr_color_load_ipl5 is not implemented in ScummVM");
-}
 
 void gr_color_set(int32 c) {
 	_G(color) = c;
diff --git a/engines/m4/graphics/gr_pal.h b/engines/m4/graphics/gr_pal.h
index c5019171cdb..7e3505ded71 100644
--- a/engines/m4/graphics/gr_pal.h
+++ b/engines/m4/graphics/gr_pal.h
@@ -48,8 +48,6 @@ constexpr int MAX_PAL_ENTRY = 255;
 
 uint8 gr_pal_get_ega_color(uint8 myColor);
 
-void gr_color_create_ipl5(uint8 *inverseColorTable, char *fname, int room_num);
-uint8 *gr_color_load_ipl5(const char *filename, uint8 *inverseColors);
 void gr_color_set(int32 c);
 byte gr_color_get_current();
 
diff --git a/engines/m4/graphics/gr_series.cpp b/engines/m4/graphics/gr_series.cpp
index 76fe463bf49..5b2122c3b70 100644
--- a/engines/m4/graphics/gr_series.cpp
+++ b/engines/m4/graphics/gr_series.cpp
@@ -55,11 +55,6 @@ void Series::show(const char *series1, const char *series2, int layer) {
 	_seriesS = M4::series_show(series2, layer + 1);
 }
 
-void Series::show_index2(const char *series1, const char *series2, int layer, int index1, int index2) {
-	_series = M4::series_show(series1, layer, 0, -1, -1, index1);
-	_seriesS = M4::series_show(series2, layer + 1, 0, -1, -1, index1 + 1);
-}
-
 void Series::series_play(const char *seriesName, frac16 layer, uint32 flags,
 		int16 triggerNum, int32 frameRate, int32 loopCount, int32 s,
 		int32 x, int32 y, int32 firstFrame, int32 lastFrame) {
@@ -195,7 +190,7 @@ bool series_stream_break_on_frame(machine *m, int32 frameNum, int32 trigger) {
 }
 
 void series_set_frame_rate(machine *m, int32 newFrameRate) {
-	if ((!m) || (!m->myAnim8) || !verifyMachineExists(m)) {
+	if (!m || !m->myAnim8 || !verifyMachineExists(m)) {
 		if (g_engine->getGameType() == GType_Burger)
 			error_show(FL, "CHECK_SERIES");
 		return;
diff --git a/engines/m4/graphics/gr_series.h b/engines/m4/graphics/gr_series.h
index 2984832c9ec..577b2743ba6 100644
--- a/engines/m4/graphics/gr_series.h
+++ b/engines/m4/graphics/gr_series.h
@@ -37,18 +37,9 @@ constexpr uint32 SERIES_LOOP_TRIGGER = 32;	// get trigger back every loop
 constexpr uint32 SERIES_LOAD_PALETTE = 64;	// load master_palette with colours?
 constexpr uint32 SERIES_HORZ_FLIP = 128;	// horizontal flip
 
-// Old constants
-constexpr uint32 FORWARD = 0;
-constexpr uint32 PINGPONG = 1;
-constexpr uint32 BACKWARD = 2;
-constexpr uint32 STICK = 4;
-constexpr uint32 NO_TOSS = 8;
-
 enum {
 	HASH_SERIES_PLAY_MACHINE = 0,
 	HASH_SERIES_SHOW_MACHINE = 1,
-	// HASH_TIMER_MACHINE = 2,  // defined in adv.h
-
 	HASH_STREAM_MACHINE = 6
 };
 
@@ -66,7 +57,6 @@ struct Series {
 		int16 triggerNum = -1, int32 duration = -1, int32 index = 0, int32 s = 100,
 		int32 x = 0, int32 y = 0);
 	void show(const char *series1, const char *series2, int layer);
-	void show_index2(const char *series1, const char *series2, int layer, int index1, int index2);
 	void terminate();
 
 	operator bool() const {
diff --git a/engines/m4/graphics/krn_pal.cpp b/engines/m4/graphics/krn_pal.cpp
index 630dd7f3789..40839bb7ca6 100644
--- a/engines/m4/graphics/krn_pal.cpp
+++ b/engines/m4/graphics/krn_pal.cpp
@@ -305,7 +305,7 @@ void kernel_examine_inventory_object(const char *picName, RGB8 *pal, int steps,
 	// Play the sprite series as a loop
 	int32 status;
 	ScreenContext *game_buff_ptr = vmng_screen_find(_G(gameDrawBuff), &status);
-	_GP(seriesAnim8) = series_play_xy(picName, -1, FORWARD,
+	_GP(seriesAnim8) = series_play_xy(picName, -1, SERIES_FORWARD,
 		x - game_buff_ptr->x1, y - game_buff_ptr->y1, 100, 0, 7, -1);
 
 	if (digiName) {
diff --git a/engines/m4/mem/reloc.h b/engines/m4/mem/reloc.h
index 69a8d0f63b2..e503e8d1810 100644
--- a/engines/m4/mem/reloc.h
+++ b/engines/m4/mem/reloc.h
@@ -35,10 +35,6 @@ inline void HUnLock(Handle h) {}
 inline void HPurge(Handle h) {}
 inline void HNoPurge(Handle h) {}
 
-inline bool MakeMem(size_t FreeBlockNeeded, const char *) {
-	return true;
-}
-
 MemHandle MakeNewHandle(size_t size, const Common::String &);
 bool mem_ReallocateHandle(MemHandle h, size_t size, const Common::String &name);
 MemHandle NewHandle(size_t size, const Common::String &str);


Commit: 8e93d32b5458e1f5aedb7fb798aa77ea20b75d3c
    https://github.com/scummvm/scummvm/commit/8e93d32b5458e1f5aedb7fb798aa77ea20b75d3c
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-02-11T23:52:50+01:00

Commit Message:
M4: RIDDLE: Remove kernel_examine_inventory_object with 8 parameters after a check in the IDB, remove some unused defines

Changed paths:
    engines/m4/graphics/gr_sprite.cpp
    engines/m4/graphics/gr_surface.cpp
    engines/m4/graphics/graphics.h
    engines/m4/graphics/krn_pal.cpp
    engines/m4/graphics/krn_pal.h
    engines/m4/m4_types.h
    engines/m4/riddle/riddle.cpp
    engines/m4/riddle/rooms/section2/room205.cpp
    engines/m4/riddle/rooms/section4/room407.cpp
    engines/m4/riddle/rooms/section5/room504.cpp
    engines/m4/riddle/rooms/section5/room506.cpp
    engines/m4/riddle/rooms/section5/room508.cpp
    engines/m4/riddle/rooms/section5/room510.cpp
    engines/m4/riddle/rooms/section6/room603.cpp
    engines/m4/riddle/rooms/section6/room604.cpp
    engines/m4/riddle/rooms/section6/room605.cpp
    engines/m4/riddle/rooms/section6/room607.cpp
    engines/m4/riddle/rooms/section6/room608.cpp


diff --git a/engines/m4/graphics/gr_sprite.cpp b/engines/m4/graphics/gr_sprite.cpp
index b1694f0f1fa..b661085ace1 100644
--- a/engines/m4/graphics/gr_sprite.cpp
+++ b/engines/m4/graphics/gr_sprite.cpp
@@ -83,11 +83,6 @@ static uint8 scale_sprite(Buffer *S, Buffer *D, uint32 ScaleX, uint32 ScaleY) {
 
 #define Scaled	((drawReq->scaleY != 100) || (drawReq->scaleX != 100 && drawReq->scaleX != -100))
 #define Rle	(source.encoding == RLE8)
-#define Clipped ((drawReq->x < 0) || (drawReq->y < 0) || (drawReq->x + source.w > drawReq->Dest->w) || (drawReq->y + source.h > drawReq->Dest->h))
-#define Forward (drawReq->scaleX > 0)
-#define Depthed (drawReq->srcDepth)
-#define Shadow	(source.encoding & 0x80)
-#define ClipD	(leftOffset || rightOffset || bottomCut)
 
 uint8 gr_sprite_draw(DrawRequest *drawReq) {
 	Buffer source;
@@ -182,7 +177,6 @@ uint8 gr_sprite_draw(DrawRequest *drawReq) {
 #define ESC     ((uint8)0)
 #define EOL	((uint8)0)
 #define EOB	((uint8)1)
-#define DELTA	((uint8)2)
 
 #define OutBuffSize(x)	((x) + (((x) + 254) / 255 + 1) * 2 + 2)
 
diff --git a/engines/m4/graphics/gr_surface.cpp b/engines/m4/graphics/gr_surface.cpp
index 57ccd03cd2a..535028fb25b 100644
--- a/engines/m4/graphics/gr_surface.cpp
+++ b/engines/m4/graphics/gr_surface.cpp
@@ -56,14 +56,14 @@ void M4Surface::rleDraw(const byte *src, int x, int y) {
 	const byte *srcP = src;
 	byte *destData = data + y * w + x;
 	byte *destP = destData;
-	int destWidth = w;
-	byte count, val;
+	const int destWidth = w;
+	byte val;
 	int line = 0;
 
 	assert(x >= 0 && y >= 0 && x < w && y < h);
 
 	for (;;) {
-		count = *srcP++;
+		byte count = *srcP++;
 
 		if (count) {
 			// Basic run length
@@ -114,7 +114,7 @@ void M4Surface::draw(const Buffer &src, int x, int y, bool forwards,
 		} else {
 			// All other RLE drawing first decompresses the sprite, and then does
 			// the various clipping, reverse, etc. on that
-			M4Surface tmp(src.data, src.w, src.h);
+			const M4Surface tmp(src.data, src.w, src.h);
 			drawInner(tmp, depthCodes, x, y, forwards, srcDepth, palette, inverseColorTable);
 		}
 	} else {
@@ -138,9 +138,8 @@ void M4Surface::drawInner(const Buffer &src, const byte *depthCodes, int x, int
 		const byte *srcP = forwards ? src.getBasePtr(0, srcY) : src.getBasePtr(src.w - 1, srcY);
 		byte *destP = getBasePtr(x, y);
 		const byte *depthP = depthCodes ? depthCodes + y * w + x : nullptr;
-		int deltaX = forwards ? 1 : -1;
+		const int deltaX = forwards ? 1 : -1;
 		int destX = x;
-		uint32 adjusted, total;
 
 		for (int srcX = 0; srcX < src.w; ++srcX, srcP += deltaX, ++destX) {
 			if (destX >= w)
@@ -148,7 +147,7 @@ void M4Surface::drawInner(const Buffer &src, const byte *depthCodes, int x, int
 				break;
 
 			byte v = *srcP;
-			byte depth = depthP ? *depthP & 0xf : 0;
+			const byte depth = depthP ? *depthP & 0xf : 0;
 			if (destX >= 0 && v != 0 && (!depthP || depth == 0 || srcDepth < depth)) {
 				if (inverseColorTable) {
 					// Handling for shadows
@@ -159,9 +158,9 @@ void M4Surface::drawInner(const Buffer &src, const byte *depthCodes, int x, int
 						rgb >>= 2;
 
 						// Red component
-						adjusted = (rgb & 0xff) * v;
+						uint32 adjusted = (rgb & 0xff) * v;
 						adjusted = MIN((uint)(adjusted >> 8), 31U);
-						total = adjusted << 10;
+						uint32 total = adjusted << 10;
 
 						// Green component
 						rgb >>= 8;
diff --git a/engines/m4/graphics/graphics.h b/engines/m4/graphics/graphics.h
index cac2033e940..78c550ef714 100644
--- a/engines/m4/graphics/graphics.h
+++ b/engines/m4/graphics/graphics.h
@@ -22,8 +22,6 @@
 #ifndef M4_GRAPHICS_GRAPHICS_H
 #define M4_GRAPHICS_GRAPHICS_H
 
-#include "common/scummsys.h"
-
 namespace M4 {
 
 constexpr int SCREEN_WIDTH = 640;
@@ -32,12 +30,6 @@ constexpr int SCREEN_HEIGHT = 480;
 #define FILL_INTERIOR 1	// a flag for use by DrawTile
 #define BORDER 0
 
-#define COLOR_MAX_SHADOW_COLORS			3
-
-#define FONT_SIZE       128
-#define FONT_MAX_WIDTH  255
-#define FONT_MAX_HEIGHT 200
-
 //SS FILE DATA DEFINITIONS...
 #define HEAD_M4SS		0x4D345353	//'M4SS'
 #define HEAD_SS4M		0x5353344D	//'SS4M'
@@ -48,40 +40,26 @@ constexpr int SCREEN_HEIGHT = 480;
 #define CELS___SS		0x20205353	//'  SS'
 #define CELS_SS__		0x53532020	//INTEL '  SS'
 
-#define CELS_HEADER			0
 #define CELS_SRC_SIZE		1
-#define CELS_PACKING			2
+
 #define CELS_FRAME_RATE		3
 #define CELS_PIX_SPEED		4
 #define CELS_SS_MAX_W		5
 #define CELS_SS_MAX_H		6
-#define CELS_RSVD_3			7
-#define CELS_RSVD_4			8
-#define CELS_RSVD_5			9
-#define CELS_RSVD_6			10
-#define CELS_RSVD_7			11
-#define CELS_RSVD_8			12
+
 #define CELS_COUNT			13
-#define SS_HEAD_SIZE			14	//includes all the previous dwords
-#define CELS_OFFSETS			14
+#define SS_HEAD_SIZE		14	//includes all the previous dwords
+#define CELS_OFFSETS		14
 
-#define CELS_PACK				0
 #define CELS_STREAM			1
-#define CELS_X					2
-#define CELS_Y					3
-#define CELS_W					4
-#define CELS_H					5
-#define CELS_COMP				6
-#define INDV_RSVD_1			8
-#define INDV_RSVD_2			8
-#define INDV_RSVD_3			9
-#define INDV_RSVD_4			10
-#define INDV_RSVD_5			11
-#define INDV_RSVD_6			12
-#define INDV_RSVD_7			13
-#define INDV_RSVD_8			14
-#define SS_INDV_HEAD			15	//includes all the previous dwords
-#define CELS_DATA				15
+#define CELS_X				2
+#define CELS_Y				3
+#define CELS_W				4
+#define CELS_H				5
+#define CELS_COMP			6
+
+#define SS_INDV_HEAD		15	//includes all the previous dwords
+#define CELS_DATA			15
 
 } // namespace M4
 
diff --git a/engines/m4/graphics/krn_pal.cpp b/engines/m4/graphics/krn_pal.cpp
index 40839bb7ca6..c45aa3fd7e6 100644
--- a/engines/m4/graphics/krn_pal.cpp
+++ b/engines/m4/graphics/krn_pal.cpp
@@ -328,12 +328,6 @@ void kernel_examine_inventory_object(const char *picName, RGB8 *pal, int steps,
 	pauseEngines();
 }
 
-void kernel_examine_inventory_object(const char *picName, int steps, int delay,
-		int32 x, int32 y, int32 triggerNum, const char *digiName, int32 digiTrigger) {
-	kernel_examine_inventory_object(picName, _G(master_palette), steps, delay,
-		x, y, triggerNum, digiName, digiTrigger);
-}
-
 void kernel_unexamine_inventory_object(RGB8 *pal, int steps, int delay) {
 	if (!_GP(seriesAnim8) || _GP(seriesHash) < 0)
 		return;
@@ -372,7 +366,8 @@ void kernel_unexamine_inventory_object(RGB8 *pal, int steps, int delay) {
 // This is an inplace remap
 // fadeToMe must already have been set up to correspond to the image on the screen
 void remap_buffer_with_luminance_map(Buffer *src, int32 x1, int32 y1, int32 x2, int32 y2) {
-	if ((!src) || (!src->data)) return;
+	if ((!src) || (!src->data))
+		return;
 
 	// WORKAROUND: Fix original bounding that could result in buffer overruns on final y2 line
 	if (x1 < 0) x1 = 0;
@@ -710,7 +705,8 @@ static void pal_cycle_update() {
 }
 
 void pal_fx_update() {
-	int32 startA = 0, endA = 0, startB = 0, endB = 0, startDAC = 0, endDAC = 0;
+	int32 startA = 0, endA = 0, startB = 0, endB = 0;
+	int32 startDAC, endDAC;
 
 	if (!_GP(myCycleReq) && !_GP(myFadeReq))
 		// Crap out quickly if no effects required
@@ -854,9 +850,4 @@ void DAC_tint_range(const RGB8 *tintColor, int32 percent, int32 firstPalEntry, i
 	}
 }
 
-void DAC_restore() {
-	term_message("DAC restored");
-	gr_pal_set_range(&_G(master_palette)[0], 0, 256);
-}
-
 } // namespace M4
diff --git a/engines/m4/graphics/krn_pal.h b/engines/m4/graphics/krn_pal.h
index 9aa093b332f..3f262105b48 100644
--- a/engines/m4/graphics/krn_pal.h
+++ b/engines/m4/graphics/krn_pal.h
@@ -121,8 +121,7 @@ void DAC_tint_range(const RGB8 *tintColor, int32 percent, int32 firstPalEntry, i
 void kernel_examine_inventory_object(const char *picName, RGB8 *pal,
 	int steps, int delay, int32 x, int32 y, int32 trigger,
 	const char *digiName, int32 digiTrigger);
-void kernel_examine_inventory_object(const char *picName, int steps, int delay,
-	int32 x, int32 y, int32 triggerNum, const char *digiName = nullptr, int32 digiTrigger = -1);
+
 void kernel_unexamine_inventory_object(RGB8 *pal, int steps, int delay);
 
 void remap_buffer_with_luminance_map(Buffer *src, int32 x1, int32 y1, int32 x2, int32 y2);
diff --git a/engines/m4/m4_types.h b/engines/m4/m4_types.h
index 0a2fc5d38dd..10b5e6e5ca2 100644
--- a/engines/m4/m4_types.h
+++ b/engines/m4/m4_types.h
@@ -26,7 +26,6 @@
 
 namespace M4 {
 
-#define MAX_STRING_SIZE 144
 #define MAX_STRING_LEN 144
 #define MAX_FILENAME_SIZE 144
 #define MIN_VIDEO_X 0
@@ -53,11 +52,11 @@ enum {
 };
 
 struct Buffer {
-	int32 w;
-	int32 h;
-	uint8 *data;
-	uint8 encoding;
-	int32 stride;
+	int32 w = 0;
+	int32 h = 0;
+	uint8 *data = nullptr;
+	uint8 encoding = 0;
+	int32 stride = 0;
 
 	uint8 *getBasePtr(int x, int y) {
 		return data + y * w + x;
@@ -68,8 +67,8 @@ struct Buffer {
 };
 
 struct token {
-	char *sym_name;
-	int32 tag;
+	char *sym_name = nullptr;
+	int32 tag = 0;
 };
 
 #include "common/pack-start.h"  // START STRUCT PACKING
@@ -81,12 +80,8 @@ struct RGB8 {
 } PACKED_STRUCT;
 #include "common/pack-end.h"	// END STRUCT PACKING
 
-typedef void (*FuncPtr)();
-typedef bool (*FuncPtr_b_l)(int32);
 typedef void (*FuncPtr_v_vv)(void *, void *);
 
-typedef FuncPtr_b_l ExceptionPtr;
-
 typedef FuncPtr_v_vv M4CALLBACK;
 
 } // namespace M4
diff --git a/engines/m4/riddle/riddle.cpp b/engines/m4/riddle/riddle.cpp
index b13e964cf6e..080e1846ce4 100644
--- a/engines/m4/riddle/riddle.cpp
+++ b/engines/m4/riddle/riddle.cpp
@@ -166,8 +166,8 @@ void RiddleEngine::global_parser() {
 		splitItems("WOODEN LADDER", "BROWN VINE");
 	} else if (splitFlag && player_said("ENVELOPE")) {
 		splitItems("VON SELTSAM'S NOTE", "POSTAGE STAMP");
-		kernel_examine_inventory_object("PING VON SELTSAM'S NOTE",
-			5, 1, 270, 150, 10000, "406R18C");
+		kernel_examine_inventory_object("PING VON SELTSAM'S NOTE", _G(master_palette),
+			5, 1, 270, 150, 10000, "406R18C",-1);
 	} else if (splitFlag && player_said("LADDER/VINES")) {
 		splitItems("WOODEN LADDER", "VINES");
 	} else if (splitFlag && player_said("VINES")) {
@@ -460,8 +460,8 @@ void RiddleEngine::global_parser() {
 	} else if (_G(kernel).trigger == 10001) {
 		player_set_commands_allowed(true);
 		digi_stop(1);
-		kernel_examine_inventory_object("PING POSTAGE STAMP", 5, 1,
-			270, 150, 990, "406R19");
+		kernel_examine_inventory_object("PING POSTAGE STAMP", _G(master_palette), 5, 1,
+			270, 150, 990, "406R19", -1);
 	} else if (useFlag && HAS("TWELVETREES' NOTE")) {
 		inv_move_object("TWELVETREES' NOTE", NOWHERE);
 		inv_give_to_player("TWELVETREES' MAP");
@@ -721,7 +721,7 @@ void RiddleEngine::lookAtInventoryItem() {
 			str = "PING TWELVETREES' MAP";
 	}
 
-	kernel_examine_inventory_object(str.c_str(), 5, 1, 270, 150, kINVENTORY_CLOSEUP_END, digi);
+	kernel_examine_inventory_object(str.c_str(), _G(master_palette), 5, 1, 270, 150, kINVENTORY_CLOSEUP_END, digi, -1);
 }
 
 void sketchInJournal(const char *digiName) {
diff --git a/engines/m4/riddle/rooms/section2/room205.cpp b/engines/m4/riddle/rooms/section2/room205.cpp
index dd102dcf108..21262fe9fe8 100644
--- a/engines/m4/riddle/rooms/section2/room205.cpp
+++ b/engines/m4/riddle/rooms/section2/room205.cpp
@@ -536,7 +536,7 @@ void Room205::parser() {
 				break;
 
 			case 3:
-				kernel_examine_inventory_object("PING CHARCOAL", 5, 1, 144, 271, 4, nullptr, -1);
+				kernel_examine_inventory_object("PING CHARCOAL", _G(master_palette), 5, 1, 144, 271, 4, nullptr, -1);
 				break;
 
 			case 4:
diff --git a/engines/m4/riddle/rooms/section4/room407.cpp b/engines/m4/riddle/rooms/section4/room407.cpp
index c63a686411f..2a74f6bc732 100644
--- a/engines/m4/riddle/rooms/section4/room407.cpp
+++ b/engines/m4/riddle/rooms/section4/room407.cpp
@@ -5545,7 +5545,7 @@ void Room407::takeLeverKeyFromBench() {
 		terminateMachineAndNull(_lever);
 		inv_give_to_player("LEVER KEY");
 		hotspot_set_active("LEVER KEY ", false);
-		kernel_examine_inventory_object("PING LEVER KEY", 5, 1, 175, 200, 2, "407_s07a");
+		kernel_examine_inventory_object("PING LEVER KEY", _G(master_palette), 5, 1, 175, 200, 2, "407_s07a", -1);
 		break;
 
 	case 2:
diff --git a/engines/m4/riddle/rooms/section5/room504.cpp b/engines/m4/riddle/rooms/section5/room504.cpp
index 2ce6415205c..0468e0b01dd 100644
--- a/engines/m4/riddle/rooms/section5/room504.cpp
+++ b/engines/m4/riddle/rooms/section5/room504.cpp
@@ -1160,19 +1160,19 @@ void Room504::daemon() {
 		switch (_vineThrowType) {
 		case 1:
 			inv_give_to_player("ROPE");
-			kernel_examine_inventory_object("PING ROPE", 5, 1, 449, 90, 592);
+			kernel_examine_inventory_object("PING ROPE", _G(master_palette), 5, 1, 449, 90, 592, nullptr, -1);
 			break;
 		case 2:
 			inv_give_to_player("GREEN VINE");
-			kernel_examine_inventory_object("PING GREEN VINE", 5, 1, 449, 90, 592);
+			kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette), 5, 1, 449, 90, 592, nullptr, -1);
 			break;
 		case 3:
 			inv_give_to_player("BROWN VINE");
-			kernel_examine_inventory_object("PING BROWN VINE", 5, 1, 449, 90, 592);
+			kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette), 5, 1, 449, 90, 592, nullptr, -1);
 			break;
 		case 4:
 			inv_give_to_player("VINES");
-			kernel_examine_inventory_object("PING VINES", 5, 1, 449, 90, 592);
+			kernel_examine_inventory_object("PING VINES", _G(master_palette), 5, 1, 449, 90, 592, nullptr, -1);
 			break;
 		default:
 			break;
@@ -1313,26 +1313,26 @@ void Room504::daemon() {
 		switch (_vineThrowType) {
 		case 1:
 			inv_give_to_player("ROPE");
-			kernel_examine_inventory_object("PING ROPE",
-				5, 1, 449, 90, 608);
+			kernel_examine_inventory_object("PING ROPE", _G(master_palette),
+				5, 1, 449, 90, 608, nullptr, -1);
 			break;
 
 		case 2:
 			inv_give_to_player("GREEN VINE");
-			kernel_examine_inventory_object("PING GREEN VINE",
-				5, 1, 449, 90, 608);
+			kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette),
+				5, 1, 449, 90, 608, nullptr, -1);
 			break;
 
 		case 3:
 			inv_give_to_player("BROWN VINE");
-			kernel_examine_inventory_object("PING BROWN VINE",
-				5, 1, 449, 90, 608);
+			kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette),
+				5, 1, 449, 90, 608, nullptr, -1);
 			break;
 
 		case 4:
 			inv_give_to_player("VINES");
-			kernel_examine_inventory_object("PING VINES",
-				5, 1, 449, 90, 608);
+			kernel_examine_inventory_object("PING VINES", _G(master_palette),
+				5, 1, 449, 90, 608, nullptr, -1);
 			break;
 
 		default:
@@ -1706,8 +1706,8 @@ void Room504::daemon() {
 		break;
 
 	case 664:
-		kernel_examine_inventory_object("PING SHRUNKEN HEAD",
-			5, 1, 136, 120, 665);
+		kernel_examine_inventory_object("PING SHRUNKEN HEAD", _G(master_palette),
+			5, 1, 136, 120, 665, nullptr, -1);
 		break;
 
 	case 665:
@@ -1927,26 +1927,26 @@ void Room504::daemon() {
 		switch (_vineThrowType) {
 		case 1:
 			inv_give_to_player("ROPE");
-			kernel_examine_inventory_object("PING ROPE",
-				5, 1, 105, 60, 697);
+			kernel_examine_inventory_object("PING ROPE", _G(master_palette),
+				5, 1, 105, 60, 697, nullptr, -1);
 			break;
 
 		case 2:
 			inv_give_to_player("GREEN VINE");
-			kernel_examine_inventory_object("PING GREEN VINE",
-				5, 1, 105, 60, 697);
+			kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette),
+				5, 1, 105, 60, 697, nullptr, -1);
 			break;
 
 		case 3:
 			inv_give_to_player("BROWN VINE");
-			kernel_examine_inventory_object("PING BROWN VINE",
-				5, 1, 105, 60, 697);
+			kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette),
+				5, 1, 105, 60, 697, nullptr, -1);
 			break;
 
 		case 4:
 			inv_give_to_player("VINES");
-			kernel_examine_inventory_object("PING VINES",
-				5, 1, 105, 60, 697);
+			kernel_examine_inventory_object("PING VINES", _G(master_palette),
+				5, 1, 105, 60, 697, nullptr, -1);
 			break;
 
 		default:
@@ -2004,26 +2004,26 @@ void Room504::daemon() {
 		switch (_vineThrowType) {
 		case 1:
 			inv_give_to_player("ROPE");
-			kernel_examine_inventory_object("PING ROPE",
-				5, 1, 105, 60, 704);
+			kernel_examine_inventory_object("PING ROPE", _G(master_palette),
+				5, 1, 105, 60, 704, nullptr, -1);
 			break;
 
 		case 2:
 			inv_give_to_player("GREEN VINE");
-			kernel_examine_inventory_object("PING GREEN VINE",
-				5, 1, 105, 60, 704);
+			kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette),
+				5, 1, 105, 60, 704, nullptr, -1);
 			break;
 
 		case 3:
 			inv_give_to_player("BROWN VINE");
-			kernel_examine_inventory_object("PING BROWN VINE",
-				5, 1, 105, 60, 704);
+			kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette),
+				5, 1, 105, 60, 704, nullptr, -1);
 			break;
 
 		case 4:
 			inv_give_to_player("VINES");
-			kernel_examine_inventory_object("PING VINES",
-				5, 1, 105, 60, 704);
+			kernel_examine_inventory_object("PING VINES", _G(master_palette),
+				5, 1, 105, 60, 704, nullptr, -1);
 			break;
 
 		default:
diff --git a/engines/m4/riddle/rooms/section5/room506.cpp b/engines/m4/riddle/rooms/section5/room506.cpp
index c8661eb5338..54d64c51c4b 100644
--- a/engines/m4/riddle/rooms/section5/room506.cpp
+++ b/engines/m4/riddle/rooms/section5/room506.cpp
@@ -227,8 +227,7 @@ void Room506::parser() {
 			break;
 
 		case 2:
-			kernel_examine_inventory_object(_G(flags)[V152] == 6 ? "PING GREEN VINE" :
-				"PING BROWN VINE", 5, 1, 396, 180, 3);
+			kernel_examine_inventory_object(_G(flags)[V152] == 6 ? "PING GREEN VINE" : "PING BROWN VINE", _G(master_palette), 5, 1, 396, 180, 3, nullptr, -1);
 			break;
 
 		case 3:
diff --git a/engines/m4/riddle/rooms/section5/room508.cpp b/engines/m4/riddle/rooms/section5/room508.cpp
index b4dea3320ae..0dccdb92ec4 100644
--- a/engines/m4/riddle/rooms/section5/room508.cpp
+++ b/engines/m4/riddle/rooms/section5/room508.cpp
@@ -618,7 +618,7 @@ void Room508::parser() {
 		case 2:
 			player_set_commands_allowed(false);
 			hotspot_set_active("CRYSTAL SKULL ", false);
-			kernel_examine_inventory_object("PING CRYSTAL SKULL", 5, 1, 250, 170, 3, "508_s05", 7);
+			kernel_examine_inventory_object("PING CRYSTAL SKULL", _G(master_palette), 5, 1, 250, 170, 3, "508_s05", 7);
 			break;
 
 		case 3:
diff --git a/engines/m4/riddle/rooms/section5/room510.cpp b/engines/m4/riddle/rooms/section5/room510.cpp
index ef0b62f0c43..dff1b22e1d4 100644
--- a/engines/m4/riddle/rooms/section5/room510.cpp
+++ b/engines/m4/riddle/rooms/section5/room510.cpp
@@ -321,7 +321,7 @@ void Room510::parser() {
 			hotspot_set_active("NICHE", true);
 
 			if (inv_object_is_here("CRYSTAL SKULL")) {
-				kernel_examine_inventory_object("PING CRYSTAL SKULL", 5, 1, 330, 280, 2, nullptr, 2);
+				kernel_examine_inventory_object("PING CRYSTAL SKULL", _G(master_palette), 5, 1, 330, 280, 2, nullptr, 2);
 				inv_give_to_player("CRYSTAL SKULL");
 				terminateMachineAndNull(_skull);
 			}
@@ -446,19 +446,19 @@ void Room510::parser() {
 
 			if (inv_object_is_here("GREEN VINE")) {
 				inv_give_to_player("GREEN VINE");
-				kernel_examine_inventory_object("PING GREEN VINE", 5, 1, 325, 200, 8);
+				kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette), 5, 1, 325, 200, 8, nullptr, -1);
 			}
 			if (inv_object_is_here("BROWN VINE")) {
 				inv_give_to_player("BROWN VINE");
-				kernel_examine_inventory_object("PING BROWN VINE", 5, 1, 325, 200, 8);
+				kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette), 5, 1, 325, 200, 8, nullptr, -1);
 			}
 			if (inv_object_is_here("ROPE")) {
 				inv_give_to_player("ROPE");
-				kernel_examine_inventory_object("PING ROPE", 5, 1, 325, 200, 8);
+				kernel_examine_inventory_object("PING ROPE", _G(master_palette), 5, 1, 325, 200, 8, nullptr, -1);
 			}
 			if (inv_object_is_here("VINES")) {
 				inv_give_to_player("VINES");
-				kernel_examine_inventory_object("PING VINES", 5, 1, 325, 200, 8);
+				kernel_examine_inventory_object("PING VINES", _G(master_palette), 5, 1, 325, 200, 8, nullptr, -1);
 			}
 			break;
 		case 7:
@@ -469,7 +469,7 @@ void Room510::parser() {
 		case 9:
 			terminateMachineAndNull(_ladder);
 			inv_give_to_player("WOODEN LADDER");
-			kernel_examine_inventory_object("PING WOODEN LADDER", 5, 1, 300, 80, 10, nullptr, 10);
+			kernel_examine_inventory_object("PING WOODEN LADDER", _G(master_palette), 5, 1, 300, 80, 10, nullptr, 10);
 			break;
 		case 10:
 			sendWSMessage_140000(11);
@@ -1047,19 +1047,19 @@ bool Room510::takeVinesRope() {
 	case 4:
 		if (player_said("GREEN VINE")) {
 			inv_give_to_player("GREEN VINE");
-			kernel_examine_inventory_object("PING GREEN VINE", 5, 1, 325, 200, 5, nullptr, 10);
+			kernel_examine_inventory_object("PING GREEN VINE", _G(master_palette), 5, 1, 325, 200, 5, nullptr, 10);
 		}
 		if (player_said("BROWN VINE")) {
 			inv_give_to_player("BROWN VINE");
-			kernel_examine_inventory_object("PING BROWN VINE", 5, 1, 325, 200, 5, nullptr, 10);
+			kernel_examine_inventory_object("PING BROWN VINE", _G(master_palette), 5, 1, 325, 200, 5, nullptr, 10);
 		}
 		if (player_said("VINES")) {
 			inv_give_to_player("VINES");
-			kernel_examine_inventory_object("PING VINES", 5, 1, 325, 200, 5, nullptr, 10);
+			kernel_examine_inventory_object("PING VINES", _G(master_palette), 5, 1, 325, 200, 5, nullptr, 10);
 		}
 		if (player_said("ROPE")) {
 			inv_give_to_player("ROPE");
-			kernel_examine_inventory_object("PING ROPE", 5, 1, 325, 200, 5, nullptr, 10);
+			kernel_examine_inventory_object("PING ROPE", _G(master_palette), 5, 1, 325, 200, 5, nullptr, 10);
 		}
 		break;
 
diff --git a/engines/m4/riddle/rooms/section6/room603.cpp b/engines/m4/riddle/rooms/section6/room603.cpp
index 27864f10415..d08489ff4a6 100644
--- a/engines/m4/riddle/rooms/section6/room603.cpp
+++ b/engines/m4/riddle/rooms/section6/room603.cpp
@@ -1926,7 +1926,7 @@ bool Room603::takeSleeve() {
 		case 2:
 			hotspot_set_active("SLEEVE", false);
 			inv_give_to_player("SLEEVE");
-			kernel_examine_inventory_object("ping sleeve", 5, 1, 280, 220, 3, nullptr, -1);
+			kernel_examine_inventory_object("ping sleeve", _G(master_palette), 5, 1, 280, 220, 3, nullptr, -1);
 			terminateMachineAndNull(_sleeve);
 			return true;
 
@@ -2014,8 +2014,8 @@ bool Room603::takeNote() {
 		hotspot_set_active("NOTE", false);
 		inv_move_object("TWELVETREES' NOTE", NOWHERE);
 		inv_move_object("TWELVETREES' MAP", NOWHERE);
-		kernel_examine_inventory_object("PING TWELVETREES' NOTE", 5, 1, 205, 190, 3,
-			_G(flags)[V046] ? nullptr : "603R28");
+		kernel_examine_inventory_object("PING TWELVETREES' NOTE", _G(master_palette), 5, 1, 205, 190, 3,
+			_G(flags)[V046] ? nullptr : "603R28", -1);
 		_G(flags)[V046] = 1;
 		terminateMachineAndNull(_note);
 		break;
@@ -2025,8 +2025,8 @@ bool Room603::takeNote() {
 		break;
 
 	case 4:
-		kernel_examine_inventory_object("PING OBJ136", 5, 1, 205, 160, 5,
-			player_been_here(623) ? "603R30" : "603R31");
+		kernel_examine_inventory_object("PING OBJ136", _G(master_palette), 5, 1, 205, 160, 5,
+			player_been_here(623) ? "603R30" : "603R31", -1);
 		break;
 
 	case 5:
@@ -2082,7 +2082,7 @@ bool Room603::takePole() {
 		case 2:
 			hotspot_set_active("pole", false);
 			inv_give_to_player("pole");
-			kernel_examine_inventory_object("ping pole", 5, 1, 280, 220, 3);
+			kernel_examine_inventory_object("ping pole", _G(master_palette), 5, 1, 280, 220, 3, nullptr, -1);
 			terminateMachineAndNull(_pole);
 
 			if (inv_object_is_here("SLEEVE"))
@@ -2106,7 +2106,7 @@ bool Room603::takePole() {
 			if (inv_object_is_here("SLEEVE")) {
 				hotspot_set_active("SLEEVE", false);
 				inv_give_to_player("SLEEVE");
-				kernel_examine_inventory_object("ping sleeve", 5, 1, 280, 220, 4);
+				kernel_examine_inventory_object("ping sleeve", _G(master_palette) , 5, 1, 280, 220, 4, nullptr, -1);
 			} else {
 				kernel_timing_trigger(1, 4);
 			}
diff --git a/engines/m4/riddle/rooms/section6/room604.cpp b/engines/m4/riddle/rooms/section6/room604.cpp
index 8f3d7b944d0..b7d6d53c4de 100644
--- a/engines/m4/riddle/rooms/section6/room604.cpp
+++ b/engines/m4/riddle/rooms/section6/room604.cpp
@@ -995,7 +995,7 @@ void Room604::takePullCord() {
 		terminateMachineAndNull(_pullCord1);
 		hotspot_set_active("PULL CORD", false);
 		inv_give_to_player("PULL CORD");
-		kernel_examine_inventory_object("ping pull cord", 5, 1, 312, 250, 3);
+		kernel_examine_inventory_object("ping pull cord", _G(master_palette), 5, 1, 312, 250, 3, nullptr, -1);
 		break;
 
 	case 3:
@@ -1025,8 +1025,8 @@ void Room604::takeSparkPlugTool() {
 	case 2:
 		hotspot_set_active("SPARK PLUG TOOL", false);
 		inv_give_to_player("SPARK PLUG TOOL");
-		kernel_examine_inventory_object("ping spark plug tool",
-			5, 1, 282, 247, 3);
+		kernel_examine_inventory_object("ping spark plug tool", _G(master_palette),
+			5, 1, 282, 247, 3, nullptr, -1);
 		terminateMachineAndNull(_sparkPlugTool);
 		break;
 
diff --git a/engines/m4/riddle/rooms/section6/room605.cpp b/engines/m4/riddle/rooms/section6/room605.cpp
index 2ceb75d5356..4b2cfaa23a0 100644
--- a/engines/m4/riddle/rooms/section6/room605.cpp
+++ b/engines/m4/riddle/rooms/section6/room605.cpp
@@ -774,7 +774,7 @@ bool Room605::sleeveDisk2() {
 		hotspot_set_active("PUPIL", false);
 		hotspot_set_active("OBSIDIAN DISK", false);
 		inv_give_to_player("OBSIDIAN DISK");
-		kernel_examine_inventory_object("PING OBSIDIAN DISK", 5, 1, 260, 190, 3);
+		kernel_examine_inventory_object("PING OBSIDIAN DISK", _G(master_palette), 5, 1, 260, 190, 3, nullptr, -1);
 		terminateMachineAndNull(_pupil);
 		return true;
 
diff --git a/engines/m4/riddle/rooms/section6/room607.cpp b/engines/m4/riddle/rooms/section6/room607.cpp
index a97d611a1dd..61ef0109cf7 100644
--- a/engines/m4/riddle/rooms/section6/room607.cpp
+++ b/engines/m4/riddle/rooms/section6/room607.cpp
@@ -187,8 +187,8 @@ void Room607::parser() {
 				_G(player_info).scale, _G(player_info).x, _G(player_info).y);
 			hotspot_set_active("RONGORONGO TABLET", false);
 			terminateMachineAndNull(_tablet);
-			kernel_examine_inventory_object("ping rongorongo tablet", 5, 1, 212, 150, 5,
-				_val1 ? "607r09" : nullptr);
+			kernel_examine_inventory_object("ping rongorongo tablet", _G(master_palette), 5, 1, 212, 150, 5,
+				_val1 ? "607r09" : nullptr, -1);
 			_G(flags)[V203] = 8;
 			break;
 		case 5:
diff --git a/engines/m4/riddle/rooms/section6/room608.cpp b/engines/m4/riddle/rooms/section6/room608.cpp
index a0e2fff76a5..92cad10e790 100644
--- a/engines/m4/riddle/rooms/section6/room608.cpp
+++ b/engines/m4/riddle/rooms/section6/room608.cpp
@@ -1328,8 +1328,8 @@ void Room608::daemon() {
 	case 763:
 		inv_give_to_player("STICK AND SHELL MAP");
 		inv_give_to_player("WHALE BONE HORN");
-		kernel_examine_inventory_object("PING STICK AND SHELL MAP",
-			5, 1, 350, 224, 764);
+		kernel_examine_inventory_object("PING STICK AND SHELL MAP", _G(master_palette),
+			5, 1, 350, 224, 764, nullptr, -1);
 		break;
 
 	case 764:
@@ -1337,8 +1337,8 @@ void Room608::daemon() {
 		break;
 
 	case 765:
-		kernel_examine_inventory_object("PING WHALE BONE HORN",
-			5, 1, 350, 224, 766);
+		kernel_examine_inventory_object("PING WHALE BONE HORN", _G(master_palette),
+			5, 1, 350, 224, 766, nullptr, -1);
 		break;
 
 	case 766:
@@ -1842,8 +1842,8 @@ bool Room608::takeStump1() {
 	case 2:
 		hotspot_set_active("DRIFTWOOD STUMP", false);
 		inv_give_to_player("DRIFTWOOD STUMP");
-		kernel_examine_inventory_object("PING DRIFTWOOD STUMP",
-			5, 1, 230, 244, 3);
+		kernel_examine_inventory_object("PING DRIFTWOOD STUMP", _G(master_palette),
+			5, 1, 230, 244, 3, nullptr, -1);
 		terminateMachineAndNull(_stump);
 		break;
 
@@ -1877,8 +1877,8 @@ bool Room608::takePuffin() {
 	case 2:
 		hotspot_set_active("DRIFTWOOD PUFFIN", false);
 		inv_give_to_player("DRIFTWOOD PUFFIN");
-		kernel_examine_inventory_object("PING DRIFTWOOD PUFFIN",
-			5, 1, 142, 239, 3);
+		kernel_examine_inventory_object("PING DRIFTWOOD PUFFIN", _G(master_palette),
+			5, 1, 142, 239, 3, nullptr, -1);
 		terminateMachineAndNull(_puffin);
 		break;
 
@@ -1985,7 +1985,7 @@ bool Room608::takeLighter() {
 	case 2:
 		hotspot_set_active("LIGHTER", false);
 		inv_give_to_player("LIGHTER");
-		kernel_examine_inventory_object("PING LIGHTER", 5, 1, 455, 250, 3);
+		kernel_examine_inventory_object("PING LIGHTER", _G(master_palette), 5, 1, 455, 250, 3, nullptr, -1);
 		terminateMachineAndNull(_lighter);
 		return true;
 
@@ -2037,8 +2037,8 @@ bool Room608::hornCordWater() {
 		case 3:
 			inv_give_to_player("HORN/PULL CORD/WATER");
 			inv_move_object("HORN/PULL CORD", NOWHERE);
-			kernel_examine_inventory_object("PING HORN/PULL CORD/WATER",
-				5, 1, 42, 239, 4);
+			kernel_examine_inventory_object("PING HORN/PULL CORD/WATER", _G(master_palette),
+				5, 1, 42, 239, 4, nullptr, -1);
 			return true;
 
 		case 4:




More information about the Scummvm-git-logs mailing list