[Scummvm-git-logs] scummvm master -> 9efe83bbb254f1c52b6ad24dbd9f9eb2b7a08fd3

bluegr noreply at scummvm.org
Fri Mar 20 01:32:30 UTC 2026


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

Summary:
3ce49b7b35 AGOS: PN - Fix palette for Amiga/ST inventory and fix the 'ROOM' button.
9efe83bbb2 AGOS - PN ST/Amiga - Save 16 colours in Inventory palette helpers


Commit: 3ce49b7b354d9ee8e031cf37c5e08ab163cc33c1
    https://github.com/scummvm/scummvm/commit/3ce49b7b354d9ee8e031cf37c5e08ab163cc33c1
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-03-20T03:32:24+02:00

Commit Message:
AGOS: PN - Fix palette for Amiga/ST inventory and fix the 'ROOM' button.

Changed paths:
    engines/agos/agos.h
    engines/agos/icons.cpp
    engines/agos/script_pn.cpp
    engines/agos/string_pn.cpp


diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 509775617e1..bf50d781ae6 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1394,7 +1394,10 @@ public:
 	void setupOpcodes() override;
 	void setupVideoOpcodes(VgaOpcodeProc *op) override;
 	void windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) override;
-
+	void saveInventoryPalette();
+	void applyInventoryPalette();
+	void restoreInventoryPalette();
+	
 	void executeOpcode(int opcode) override;
 
 	int actCallD(int n);
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 6182aac700d..7013c1fbe16 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -23,6 +23,7 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 
+#include "graphics/paletteman.h"
 #include "graphics/surface.h"
 
 #include "agos/agos.h"
@@ -30,6 +31,16 @@
 
 namespace AGOS {
 
+static bool g_pnInventoryPaletteSaved = false;
+static byte g_pnSavedInventoryPalette[768];
+
+static const uint16 kPnAmigaAtariStInventoryPalette[16] = {
+	0x000, 0x111, 0x500, 0x733,
+	0x740, 0x530, 0x131, 0x020,
+	0x211, 0x322, 0x004, 0x737,
+	0x333, 0x444, 0x777, 0x222
+};
+
 void AGOSEngine::loadIconFile() {
 	Common::File in;
 	uint32 srcSize;
@@ -1066,6 +1077,39 @@ void AGOSEngine_PN::drawIconHitBar() {
 	updateBackendSurface();
 }
 
+void AGOSEngine_PN::saveInventoryPalette() {
+	if (g_pnInventoryPaletteSaved)
+		return;
+
+	memcpy(g_pnSavedInventoryPalette, _currentPalette, sizeof(g_pnSavedInventoryPalette));
+	g_pnInventoryPaletteSaved = true;
+}
+
+void AGOSEngine_PN::applyInventoryPalette() {
+	for (int i = 0; i < 16; ++i) {
+		const uint16 color = kPnAmigaAtariStInventoryPalette[i];
+		_displayPalette[i * 3 + 0] = ((color & 0x0F00) >> 8) * 32;
+		_displayPalette[i * 3 + 1] = ((color & 0x00F0) >> 4) * 32;
+		_displayPalette[i * 3 + 2] = ((color & 0x000F) >> 0) * 32;
+	}
+
+	memcpy(_currentPalette, _displayPalette, sizeof(_displayPalette));
+	_system->getPaletteManager()->setPalette(_displayPalette, 0, 256);
+	_paletteFlag = 0;
+}
+
+void AGOSEngine_PN::restoreInventoryPalette() {
+	if (!g_pnInventoryPaletteSaved)
+		return;
+
+	memcpy(_displayPalette, g_pnSavedInventoryPalette, sizeof(g_pnSavedInventoryPalette));
+	memcpy(_currentPalette, g_pnSavedInventoryPalette, sizeof(g_pnSavedInventoryPalette));
+	_system->getPaletteManager()->setPalette(_displayPalette, 0, 256);
+	_paletteFlag = 0;
+
+	g_pnInventoryPaletteSaved = false;
+}
+
 void AGOSEngine_PN::iconPage() {
 	_objectCountS = -1;
 
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index 3711202c0b1..1e63709dd7e 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -705,6 +705,12 @@ void AGOSEngine_PN::opn_opcode63() {
 
 int AGOSEngine_PN::inventoryOn(int val) {
 	writeVariable(210, val);
+
+	if (getPlatform() == Common::kPlatformAtariST || getPlatform() == Common::kPlatformAmiga) {
+		saveInventoryPalette();
+		applyInventoryPalette();
+	}
+
 	if (_videoLockOut & 0x10) {
 		iconPage();
 	} else {
@@ -730,6 +736,10 @@ int AGOSEngine_PN::inventoryOff() {
 
 		restoreBlock(48, 2, 272, 130);
 
+		if (getPlatform() == Common::kPlatformAtariST || getPlatform() == Common::kPlatformAmiga) {
+			restoreInventoryPalette();
+		}
+
 		_hitAreaList = _hitAreas;
 		_videoLockOut &= ~0x10;
 		_vgaSpriteChanged++;
diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp
index f8a16950d28..e974ae551f6 100644
--- a/engines/agos/string_pn.cpp
+++ b/engines/agos/string_pn.cpp
@@ -67,7 +67,7 @@ void AGOSEngine_PN::uncomstr(char *c, uint32 x) {
 	*c = 0;
 }
 
-#define OBJECT_NAME_SIZE 15
+#define OBJECT_NAME_SIZE 18
 
 static const char *const objectNames[30] = {
 	"\0",


Commit: 9efe83bbb254f1c52b6ad24dbd9f9eb2b7a08fd3
    https://github.com/scummvm/scummvm/commit/9efe83bbb254f1c52b6ad24dbd9f9eb2b7a08fd3
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-03-20T03:32:24+02:00

Commit Message:
AGOS - PN ST/Amiga - Save 16 colours in Inventory palette helpers

Changed paths:
    engines/agos/icons.cpp


diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 7013c1fbe16..b391c180229 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -32,7 +32,7 @@
 namespace AGOS {
 
 static bool g_pnInventoryPaletteSaved = false;
-static byte g_pnSavedInventoryPalette[768];
+static byte g_pnSavedInventoryPalette[16 * 3];
 
 static const uint16 kPnAmigaAtariStInventoryPalette[16] = {
 	0x000, 0x111, 0x500, 0x733,
@@ -1093,8 +1093,8 @@ void AGOSEngine_PN::applyInventoryPalette() {
 		_displayPalette[i * 3 + 2] = ((color & 0x000F) >> 0) * 32;
 	}
 
-	memcpy(_currentPalette, _displayPalette, sizeof(_displayPalette));
-	_system->getPaletteManager()->setPalette(_displayPalette, 0, 256);
+	memcpy(_currentPalette, _displayPalette, sizeof(g_pnSavedInventoryPalette));
+	_system->getPaletteManager()->setPalette(_displayPalette, 0, 16);
 	_paletteFlag = 0;
 }
 
@@ -1104,7 +1104,7 @@ void AGOSEngine_PN::restoreInventoryPalette() {
 
 	memcpy(_displayPalette, g_pnSavedInventoryPalette, sizeof(g_pnSavedInventoryPalette));
 	memcpy(_currentPalette, g_pnSavedInventoryPalette, sizeof(g_pnSavedInventoryPalette));
-	_system->getPaletteManager()->setPalette(_displayPalette, 0, 256);
+	_system->getPaletteManager()->setPalette(_displayPalette, 0, 16);
 	_paletteFlag = 0;
 
 	g_pnInventoryPaletteSaved = false;




More information about the Scummvm-git-logs mailing list