[Scummvm-git-logs] scummvm master -> 9258721a09ad347ceac1650d92d4e2098dfb69f4

sdelamarre noreply at scummvm.org
Tue Oct 24 21:35:33 UTC 2023


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

Summary:
9258721a09 GOB: Increase the (fake) amount of free memory returned by getFreeMem in Adibou2


Commit: 9258721a09ad347ceac1650d92d4e2098dfb69f4
    https://github.com/scummvm/scummvm/commit/9258721a09ad347ceac1650d92d4e2098dfb69f4
Author: Simon Delamarre (simon.delamarre14 at gmail.com)
Date: 2023-10-24T23:34:31+02:00

Commit Message:
GOB: Increase the (fake) amount of free memory returned by getFreeMem in Adibou2

This unlocks a nicer intro music.

Changed paths:
    engines/gob/inter.h
    engines/gob/inter_v7.cpp


diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index ee410260bc2..7f8ce4a94a5 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -695,6 +695,7 @@ protected:
 	void o7_setCursorToLoadFromExec();
 	void o7_freeMult();
 	void o7_loadMultObject();
+	void o7_getFreeMem(OpFuncParams &params);
 	void o7_displayWarning();
 	void o7_logString();
 	void o7_moveGoblin();
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index 004bc78716e..aa67735095e 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -96,6 +96,7 @@ void Inter_v7::setupOpcodesFunc() {
 	OPCODEFUNC(0x33, o7_fillRect);
 	OPCODEFUNC(0x34, o7_drawLine);
 	OPCODEFUNC(0x36, o7_invalidate);
+	OPCODEFUNC(0x3E, o7_getFreeMem);
 	OPCODEFUNC(0x3F, o7_checkData);
 	OPCODEFUNC(0x4D, o7_readData);
 	OPCODEFUNC(0x4E, o7_writeData);
@@ -1221,6 +1222,17 @@ void Inter_v7::o7_invalidate(OpFuncParams &params) {
 	_vm->_draw->spriteOperation(DRAW_INVALIDATE);
 }
 
+void Inter_v7::o7_getFreeMem(OpFuncParams &params) {
+	uint16 freeVar = _vm->_game->_script->readVarIndex();
+	uint16 maxFreeVar = _vm->_game->_script->readVarIndex();
+
+	// HACK, with a higher value than o2_getFreeMem (16M vs 1M)
+	// This unlocks a nicer intro music in Adibou2
+	WRITE_VAR_OFFSET(freeVar   , 16000000);
+	WRITE_VAR_OFFSET(maxFreeVar, 16000000);
+	WRITE_VAR(16, _vm->_game->_script->getVariablesCount() * 4);
+}
+
 void Inter_v7::o7_checkData(OpFuncParams &params) {
 	Common::String file = getFile(_vm->_game->_script->evalString());
 




More information about the Scummvm-git-logs mailing list