aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-05-18 00:46:30 +0000
committerEugene Sandulenko2005-05-18 00:46:30 +0000
commitcba94db699bb834bfa9b05472843c5825dec9d72 (patch)
treed1fa5abbf28b47990af2555fb37e3950e126280e
parent0ef8642bb535dc25bf7732a6f87951c4f9253049 (diff)
downloadscummvm-rg350-cba94db699bb834bfa9b05472843c5825dec9d72.tar.gz
scummvm-rg350-cba94db699bb834bfa9b05472843c5825dec9d72.tar.bz2
scummvm-rg350-cba94db699bb834bfa9b05472843c5825dec9d72.zip
Add C64 palette.
Fix Zak C64. Now it is playable. svn-id: r18148
-rw-r--r--scumm/palette.cpp19
-rw-r--r--scumm/saveload.cpp16
-rw-r--r--scumm/script_v2.cpp2
-rw-r--r--scumm/scumm.cpp18
-rw-r--r--scumm/scumm.h1
5 files changed, 43 insertions, 13 deletions
diff --git a/scumm/palette.cpp b/scumm/palette.cpp
index 0dda37dd15..bab8997516 100644
--- a/scumm/palette.cpp
+++ b/scumm/palette.cpp
@@ -31,6 +31,25 @@
namespace Scumm {
+void ScummEngine::setupC64Palette() {
+ setPalColor( 0, 0x00, 0x00, 0x00);
+ setPalColor( 1, 0xFF, 0xFF, 0xFF);
+ setPalColor( 2, 0x99, 0x00, 0x00);
+ setPalColor( 3, 0x00, 0xff, 0xcc);
+ setPalColor( 4, 0xcc, 0x00, 0xcc);
+ setPalColor( 5, 0x44, 0xcc, 0x44);
+ setPalColor( 6, 0x11, 0x00, 0x99);
+ setPalColor( 7, 0xff, 0xff, 0x00);
+ setPalColor( 8, 0xaa, 0x55, 0x00);
+ setPalColor( 9, 0x66, 0x33, 0x00);
+ setPalColor(10, 0xff, 0x66, 0x66);
+ setPalColor(11, 0x40, 0x40, 0x40);
+ setPalColor(12, 0x80, 0x80, 0x80);
+ setPalColor(13, 0x66, 0xff, 0x66);
+ setPalColor(14, 0x77, 0x77, 0xff);
+ setPalColor(15, 0xc0, 0xc0, 0xc0);
+}
+
void ScummEngine::setupNESPalette() {
setPalColor(0x00,0x24,0x24,0x24); // 0x1D
setPalColor(0x01,0x00,0x24,0x92);
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index ff9fe5b95c..1e3256fed9 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -266,13 +266,17 @@ bool ScummEngine::loadState(int slot, bool compat) {
// for backwards compatibility, and it may still prove useful if we
// ever add options for using different 16-colour palettes.
if (_version == 1) {
- if (_gameId == GID_MANIAC)
- if (_platform == Common::kPlatformNES)
- setupNESPalette();
+ if (_platform == Common::kPlatformC64)
+ setupC64Palette();
+ else {
+ if (_gameId == GID_MANIAC)
+ if (_platform == Common::kPlatformNES)
+ setupNESPalette();
+ else
+ setupV1ManiacPalette();
else
- setupV1ManiacPalette();
- else
- setupV1ZakPalette();
+ setupV1ZakPalette();
+ }
} else if (_features & GF_16COLOR) {
switch (_renderMode) {
case Common::kRenderEGA:
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a25c4eb0b1..122d77fa53 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1580,6 +1580,8 @@ void ScummEngine_v2::o2_switchCostumeSet() {
// groups of costumes it has
if (_platform == Common::kPlatformNES)
NES_loadCostumeSet(fetchScriptByte());
+ else if (_platform == Common::kPlatformC64)
+ fetchScriptByte();
else
o2_dummy();
}
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 9147c7ba96..f298790e0d 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -1568,13 +1568,17 @@ void ScummEngine::scummInit() {
// line
// Original games used some kind of dynamic
// color table remapping between rooms
- if (_gameId == GID_MANIAC) {
- if (_platform == Common::kPlatformNES)
- setupNESPalette();
- else
- setupV1ManiacPalette();
- } else
- setupV1ZakPalette();
+ if (_platform == Common::kPlatformC64)
+ setupC64Palette();
+ else {
+ if (_gameId == GID_MANIAC) {
+ if (_platform == Common::kPlatformNES)
+ setupNESPalette();
+ else
+ setupV1ManiacPalette();
+ } else
+ setupV1ZakPalette();
+ }
} else if (_features & GF_16COLOR) {
for (i = 0; i < 16; i++)
_shadowPalette[i] = i;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 2346eb1a12..baeac68c73 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -967,6 +967,7 @@ protected:
void actorFollowCamera(int act);
const byte *getPalettePtr(int palindex, int room);
+ void setupC64Palette();
void setupNESPalette();
void setupAmigaPalette();
void setupHercPalette();