Ticket #8865: rtz_saturn_5-22-09.diff
File rtz_saturn_5-22-09.diff, 25.7 KB (added by , 16 years ago) |
---|
-
common/util.cpp
250 250 251 251 252 252 const PlatformDescription g_platforms[] = { 253 {"2gs", "2gs", "2gs", "Apple IIgs", kPlatformApple2GS 253 {"2gs", "2gs", "2gs", "Apple IIgs", kPlatformApple2GS}, 254 254 {"3do", "3do", "3do", "3DO", kPlatform3DO}, 255 255 {"acorn", "acorn", "acorn", "Acorn", kPlatformAcorn}, 256 256 {"amiga", "ami", "amiga", "Amiga", kPlatformAmiga}, 257 257 {"atari", "atari-st", "st", "Atari ST", kPlatformAtariST}, 258 258 {"c64", "c64", "c64", "Commodore 64", kPlatformC64}, 259 {"pc", "dos", "ibm", "DOS", kPlatformPC},260 {"pc98", "pc98", "pc98", "PC-98", kPlatformPC98},261 {"wii", "wii", "wii", "Nintendo Wii", kPlatformWii},262 259 263 260 // The 'official' spelling seems to be "FM-TOWNS" (e.g. in the Indy4 demo). 264 261 // However, on the net many variations can be seen, like "FMTOWNS", … … 267 264 268 265 {"linux", "linux", "linux", "Linux", kPlatformLinux}, 269 266 {"macintosh", "mac", "mac", "Macintosh", kPlatformMacintosh}, 270 {"pce", "pce", "pce", "PC-Engine", kPlatformPCEngine },271 267 {"nes", "nes", "nes", "NES", kPlatformNES}, 268 {"pc", "dos", "ibm", "DOS", kPlatformPC}, 269 {"pc98", "pc98", "pc98", "PC-98", kPlatformPC98}, 270 {"pce", "pce", "pce", "PC-Engine", kPlatformPCEngine}, 271 {"playstation", "psx", "PSX", "Playstation", kPlatformPSX}, 272 {"saturn", "saturn", "saturn", "Sega Saturn", kPlatformSaturn}, 272 273 {"segacd", "segacd", "sega", "SegaCD", kPlatformSegaCD}, 273 274 {"windows", "win", "win", "Windows", kPlatformWindows}, 274 {" playstation", "psx", "PSX", "Playstation", kPlatformPSX},275 {"wii", "wii", "wii", "Nintendo Wii", kPlatformWii}, 275 276 276 277 277 278 {0, 0, 0, "Default", kPlatformUnknown} -
common/util.h
210 210 kPlatformSegaCD, 211 211 kPlatform3DO, 212 212 kPlatformPCEngine, 213 214 213 kPlatformApple2GS, 215 214 kPlatformPC98, 216 215 kPlatformWii, 217 216 kPlatformPSX, 217 kPlatformSaturn, 218 218 219 219 kPlatformUnknown = -1 220 220 }; -
engines/made/cpkplayer.cpp
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL$ 22 * $Id$ 23 * 24 */ 25 26 #include "common/scummsys.h" 27 #include "common/endian.h" 28 29 #include "made/cpkplayer.h" 30 #include "made/screen.h" 31 32 #include "sound/adpcm.h" 33 34 namespace Made { 35 36 CpkPlayer::CpkPlayer(MadeEngine *vm, Audio::Mixer *mixer) : _fd(NULL), _vm(vm), _mixer(mixer) { 37 } 38 39 CpkPlayer::~CpkPlayer() { 40 } 41 42 struct SampleTableEntry { 43 uint32 offset; 44 uint32 length; 45 uint32 sampleInfo1; 46 uint32 sampleInfo2; 47 }; 48 49 void CpkPlayer::play(const char *filename) { 50 51 // Note: Most of this code is based off the document from http://wiki.multimedia.cx/index.php?title=Sega_FILM 52 53 _abort = false; 54 _surface = new Graphics::Surface(); 55 56 _fd = new Common::File(); 57 _fd->open(filename); 58 59 // FILM Chunk 60 assert(_fd->readUint32BE() == MKID_BE('FILM')); 61 uint32 filmHeaderLength = _fd->readUint32BE(); 62 uint32 filmVersion = _fd->readUint32BE(); 63 _fd->readUint32BE(); // Reserved??? 64 65 // FDSC Chunk 66 assert(_fd->readUint32BE() == MKID_BE('FDSC')); 67 uint32 fdscChunkSize = _fd->readUint32BE(); 68 uint32 videoCodec = _fd->readUint32BE(); 69 uint32 height = _fd->readUint32BE(); 70 uint32 width = _fd->readUint32BE(); 71 _fd->readByte(); // Unknown 72 byte audioChannels = _fd->readByte(); 73 byte audioSamplingBits = _fd->readByte(); 74 _fd->readByte(); // Unknown 75 uint16 audioFrequency = _fd->readUint16BE(); 76 77 // STAB Chunk 78 assert(_fd->readUint32BE() == MKID_BE('STAB')); 79 uint32 stabChunkSize = _fd->readUint32BE(); 80 uint32 frameRateBaseFreq = _fd->readUint32BE(); 81 uint32 sampleTableEntryCount = _fd->readUint32BE(); 82 SampleTableEntry *sampleTableEntries = new SampleTableEntry[sampleTableEntryCount]; 83 for (uint32 i = 0; i < sampleTableEntryCount; i++) { 84 sampleTableEntries[i].offset = _fd->readUint32BE(); 85 sampleTableEntries[i].length = _fd->readUint32BE(); 86 sampleTableEntries[i].sampleInfo1 = _fd->readUint32BE(); 87 sampleTableEntries[i].sampleInfo2 = _fd->readUint32BE(); 88 } 89 90 // Where's the actual frame rate? There is none! It's variable and can differ between frames. 91 92 _mixer->stopAll(); 93 94 byte audioFlags = 0; 95 if (audioChannels == 2) 96 audioFlags |= Audio::Mixer::FLAG_STEREO; 97 if (audioSamplingBits == 16) 98 audioFlags |= Audio::Mixer::FLAG_16BITS; 99 100 _audioStream = Audio::makeAppendableAudioStream(audioFrequency, audioFlags); 101 102 103 // Uh-oh.... is it 8bpp??? 104 _surface->create(width, height, 1); 105 106 for (uint32 i = 0; i < sampleTableEntryCount && !_abort && !_fd->eos(); i++) { 107 _fd->seek(sampleTableEntries[i].offset + filmHeaderLength); 108 109 // Audio Data 110 if (sampleTableEntries[i].sampleInfo1 == (uint32)~0) { 111 Common::SeekableSubReadStream *soundData = new Common::SeekableSubReadStream(_fd, 0, sampleTableEntries[i].length); 112 Audio::AudioStream *adpcmStream = Audio::makeADPCMStream(soundData, false, 0, Audio::kADPCMMS, audioFrequency, audioChannels, 0); 113 // TODO: L R L R L R L R 114 // The Sound data alternates left/right 115 } else { 116 // Video Data 117 // TODO: Cinepak for SEGA 118 } 119 120 handleEvents(); 121 updateScreen(); 122 } 123 124 _audioStream->finish(); 125 _mixer->stopHandle(_audioStreamHandle); 126 127 //delete _audioStream; 128 delete _fd; 129 delete _surface; 130 131 } 132 133 void CpkPlayer::handleEvents() { 134 Common::Event event; 135 while (_vm->_system->getEventManager()->pollEvent(event)) { 136 switch (event.type) { 137 case Common::EVENT_KEYDOWN: 138 if (event.kbd.keycode == Common::KEYCODE_ESCAPE) 139 _abort = true; 140 break; 141 default: 142 break; 143 } 144 } 145 } 146 147 void CpkPlayer::updateScreen() { 148 _vm->_system->copyRectToScreen((const byte*)_surface->pixels, _surface->pitch, 149 (320 - _surface->w) / 2, (200 - _surface->h) / 2, _surface->w, _surface->h); 150 _vm->_system->updateScreen(); 151 } 152 153 } -
engines/made/cpkplayer.h
Property changes on: engines\made\cpkplayer.cpp ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Rev Author URL Id Name: svn:eol-style + native
1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * $URL$ 22 * $Id$ 23 * 24 */ 25 26 #ifndef MADE_CPKPLAYER_H 27 #define MADE_CPKPLAYER_H 28 29 #include "common/system.h" 30 #include "common/events.h" 31 #include "common/file.h" 32 #include "common/endian.h" 33 #include "graphics/surface.h" 34 #include "sound/mixer.h" 35 #include "sound/audiostream.h" 36 37 #include "made/graphics.h" 38 #include "made/sound.h" 39 #include "made/made.h" 40 41 namespace Made { 42 43 class MadeEngine; 44 45 class CpkPlayer { 46 public: 47 CpkPlayer(MadeEngine *vm, Audio::Mixer *mixer); 48 ~CpkPlayer(); 49 void play(const char *filename); 50 protected: 51 MadeEngine *_vm; 52 Audio::Mixer *_mixer; 53 Common::File *_fd; 54 Audio::AppendableAudioStream *_audioStream; 55 Audio::SoundHandle _audioStreamHandle; 56 Graphics::Surface *_surface; 57 bool _abort; 58 void handleEvents(); 59 void updateScreen(); 60 }; 61 62 } 63 64 #endif -
engines/made/database.cpp
Property changes on: engines\made\cpkplayer.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Date Rev Author URL Id Name: svn:eol-style + native
249 249 return _objData + 6; 250 250 } 251 251 252 int ObjectSegaSaturn::load(Common::SeekableReadStream &source) { 253 _freeData = true; 254 source.readUint16BE(); // skip flags 255 uint16 type = source.readUint16BE(); 256 if (type == 0x7FFF) { 257 _objSize = source.readUint16BE(); 258 } else if (type == 0x7FFE) { 259 _objSize = source.readUint16BE() * 2; 260 } else if (type < 0x7FFE) { 261 byte count1 = source.readByte(); 262 byte count2 = source.readByte(); 263 _objSize = (count1 + count2) * 2; 264 } 265 source.seek(-6, SEEK_CUR); 266 _objSize += 6; 267 _objData = new byte[_objSize]; 268 source.read(_objData, _objSize); 269 return _objSize; 270 } 252 271 272 int ObjectSegaSaturn::load(byte *source) { 273 _objData = source; 274 _freeData = false; 275 if (getClass() < 0x7FFE) { 276 _objSize = (getCount1() + getCount2()) * 2; 277 } else { 278 _objSize = getSize(); 279 } 280 _objSize += 6; 281 return _objSize; 282 } 253 283 284 int ObjectSegaSaturn::save(Common::WriteStream &dest) { 285 // Not implemented/used for version 3 objects 286 return 0; 287 } 288 289 uint16 ObjectSegaSaturn::getFlags() { 290 return READ_BE_UINT16(_objData); 291 } 292 293 uint16 ObjectSegaSaturn::getClass() { 294 return READ_BE_UINT16(_objData + 2); 295 } 296 297 uint16 ObjectSegaSaturn::getSize() { 298 return READ_BE_UINT16(_objData + 4); 299 } 300 301 byte ObjectSegaSaturn::getCount1() { 302 return _objData[4]; 303 } 304 305 byte ObjectSegaSaturn::getCount2() { 306 return _objData[5]; 307 } 308 309 byte *ObjectSegaSaturn::getData() { 310 return _objData + 6; 311 } 312 313 int16 ObjectSegaSaturn::getVectorItem(int16 index) { 314 if (getClass() == 0x7FFF) { 315 byte *vector = (byte*)getData(); 316 return vector[index]; 317 } else if (getClass() == 0x7FFE) { 318 int16 *vector = (int16*)getData(); 319 return READ_BE_UINT16(&vector[index]); 320 } else if (getClass() < 0x7FFE) { 321 int16 *vector = (int16*)getData(); 322 return READ_BE_UINT16(&vector[index]); 323 } else { 324 // should never reach here 325 error("Unknown object class"); 326 return 0; 327 } 328 } 329 330 void ObjectSegaSaturn::setVectorItem(int16 index, int16 value) { 331 if (getClass() == 0x7FFF) { 332 byte *vector = (byte*)getData(); 333 vector[index] = value; 334 } else if (getClass() <= 0x7FFE) { 335 int16 *vector = (int16*)getData(); 336 WRITE_BE_UINT16(&vector[index], value); 337 } 338 } 339 340 254 341 GameDatabase::GameDatabase(MadeEngine *vm) : _vm(vm) { 255 342 } 256 343 … … 809 896 return NULL; 810 897 } 811 898 899 // GameDatabaseSegaSaturn 900 901 GameDatabaseSegaSaturn::GameDatabaseSegaSaturn(MadeEngine *vm) : GameDatabase(vm) { 902 } 903 904 int16 GameDatabaseSegaSaturn::getVar(int16 index) { 905 return (int16)READ_BE_UINT16(_gameState + index * 2); 906 } 907 908 void GameDatabaseSegaSaturn::setVar(int16 index, int16 value) { 909 WRITE_BE_UINT16(_gameState + index * 2, value); 910 } 911 912 int16 GameDatabaseSegaSaturn::getObjectProperty(int16 objectIndex, int16 propertyId) { 913 if (objectIndex == 0) 914 return 0; 915 916 int16 propertyFlag; 917 int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag); 918 919 if (property) { 920 return (int16)READ_BE_UINT16(property); 921 } else { 922 return 0; 923 } 924 } 925 926 int16 GameDatabaseSegaSaturn::setObjectProperty(int16 objectIndex, int16 propertyId, int16 value) { 927 if (objectIndex == 0) 928 return 0; 929 930 int16 propertyFlag; 931 int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag); 932 933 if (property) { 934 if (propertyFlag == 1) { 935 WRITE_BE_UINT16(property, value); 936 } else { 937 warning("GameDatabase::setObjectProperty(%04X, %04X, %04X) Trying to set constant property\n", 938 objectIndex, propertyId, value); 939 } 940 return value; 941 } else { 942 return 0; 943 } 944 } 945 946 void GameDatabaseSegaSaturn::load(Common::SeekableReadStream &sourceS) { 947 char header[6]; 948 sourceS.read(header, 6); 949 if (strncmp(header, "ADVSYS", 6)) 950 warning ("Unexpected database header, expected ADVSYS"); 951 952 /*uint32 unk = */sourceS.readUint32LE(); 953 954 sourceS.skip(20); 955 956 uint32 objectIndexOffs = sourceS.readUint32BE(); 957 uint16 objectCount = sourceS.readUint16BE(); 958 _gameStateOffs = sourceS.readUint32BE(); 959 _gameStateSize = sourceS.readUint32BE(); 960 uint32 objectsOffs = sourceS.readUint32BE(); 961 uint32 objectsSize = sourceS.readUint32BE(); 962 _mainCodeObjectIndex = sourceS.readUint16BE(); 963 964 debug(2, "objectIndexOffs = %08X; objectCount = %d; gameStateOffs = %08X; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", objectIndexOffs, objectCount, _gameStateOffs, _gameStateSize, objectsOffs, objectsSize); 965 966 _gameState = new byte[_gameStateSize]; 967 sourceS.seek(_gameStateOffs); 968 sourceS.read(_gameState, _gameStateSize); 969 970 Common::Array<uint32> objectOffsets; 971 sourceS.seek(objectIndexOffs); 972 for (uint32 i = 0; i < objectCount; i++) 973 objectOffsets.push_back(sourceS.readUint32BE()); 974 975 for (uint32 i = 0; i < objectCount; i++) { 976 Object *obj = new ObjectSegaSaturn(); 977 978 // The LSB indicates if it's a constant or variable object. 979 // Constant objects are loaded from disk, while variable objects exist 980 // in the _gameState buffer. 981 982 if (objectOffsets[i] & 1) { 983 sourceS.seek(objectsOffs + objectOffsets[i] - 1); 984 obj->load(sourceS); 985 } else { 986 obj->load(_gameState + objectOffsets[i]); 987 } 988 _objects.push_back(obj); 989 } 990 } 991 992 void GameDatabaseSegaSaturn::reloadFromStream(Common::SeekableReadStream &sourceS) { 993 sourceS.seek(_gameStateOffs); 994 sourceS.read(_gameState, _gameStateSize); 995 } 996 997 bool GameDatabaseSegaSaturn::getSavegameDescription(const char *filename, Common::String &description) { 998 Common::InSaveFile *in; 999 char desc[64]; 1000 if (!(in = g_system->getSavefileManager()->openForLoading(filename))) { 1001 return false; 1002 } 1003 in->skip(4); // TODO: Verify marker 'SGAM' 1004 in->skip(4); // TODO: Verify size 1005 in->skip(2); // TODO: Verify version 1006 in->read(desc, 64); 1007 description = desc; 1008 delete in; 1009 return true; 1010 } 1011 1012 int16 GameDatabaseSegaSaturn::savegame(const char *filename, const char *description, int16 version) { 1013 Common::OutSaveFile *out; 1014 char desc[64]; 1015 int16 result = 0; 1016 uint32 size = 4 + 4 + 2 + _gameStateSize; 1017 if (!(out = g_system->getSavefileManager()->openForSaving(filename))) { 1018 warning("Can't create file '%s', game not saved", filename); 1019 return 6; 1020 } 1021 strncpy(desc, description, 64); 1022 out->writeUint32BE(MKID_BE('SGAM')); 1023 out->writeUint32LE(size); 1024 out->writeUint16LE(version); 1025 out->write(desc, 64); 1026 out->write(_gameState, _gameStateSize); 1027 delete out; 1028 return result; 1029 } 1030 1031 int16 GameDatabaseSegaSaturn::loadgame(const char *filename, int16 version) { 1032 Common::InSaveFile *in; 1033 int16 result = 0; 1034 //uint32 expectedSize = 4 + 4 + 2 + _gameStateSize; 1035 if (!(in = g_system->getSavefileManager()->openForLoading(filename))) { 1036 warning("Can't open file '%s', game not loaded", filename); 1037 return 1; 1038 } 1039 in->skip(4); // TODO: Verify marker 'SGAM' 1040 in->skip(4); // TODO: Verify size 1041 in->skip(2); // TODO: Verify version 1042 in->skip(64); // skip savegame description 1043 in->read(_gameState, _gameStateSize); 1044 delete in; 1045 return result; 1046 } 1047 1048 int16 *GameDatabaseSegaSaturn::findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) { 1049 Object *obj = getObject(objectIndex); 1050 1051 int16 *prop = (int16*)obj->getData(); 1052 byte count1 = obj->getCount1(); 1053 byte count2 = obj->getCount2(); 1054 1055 int16 *propPtr1 = prop + count1; 1056 int16 *propPtr2 = prop + count2; 1057 1058 // First see if the property exists in the given object 1059 while (count2-- > 0) { 1060 if ((READ_BE_UINT16(prop) & 0x3FFF) == propertyId) { 1061 if (READ_BE_UINT16(prop) & 0x4000) { 1062 propertyFlag = 1; 1063 return (int16*)_gameState + READ_BE_UINT16(propPtr1); 1064 } else { 1065 propertyFlag = obj->getFlags() & 1; 1066 return propPtr1; 1067 } 1068 } 1069 prop++; 1070 propPtr1++; 1071 } 1072 1073 // Now check in the object hierarchy of the given object 1074 int16 parentObjectIndex = obj->getClass(); 1075 if (parentObjectIndex == 0) { 1076 return NULL; 1077 } 1078 1079 while (parentObjectIndex != 0) { 1080 1081 obj = getObject(parentObjectIndex); 1082 1083 prop = (int16*)obj->getData(); 1084 count1 = obj->getCount1(); 1085 count2 = obj->getCount2(); 1086 1087 propPtr1 = propPtr2 + count1 - count2; 1088 int16 *propertyPtr = prop + count1; 1089 1090 while (count2-- > 0) { 1091 if (!(READ_BE_UINT16(prop) & 0x8000)) { 1092 if ((READ_BE_UINT16(prop) & 0x3FFF) == propertyId) { 1093 if (READ_BE_UINT16(prop) & 0x4000) { 1094 propertyFlag = 1; 1095 return (int16*)_gameState + READ_BE_UINT16(propPtr1); 1096 } else { 1097 propertyFlag = obj->getFlags() & 1; 1098 return propPtr1; 1099 } 1100 } else { 1101 propPtr1++; 1102 } 1103 } else { 1104 if ((READ_BE_UINT16(prop) & 0x3FFF) == propertyId) { 1105 if (READ_BE_UINT16(prop) & 0x4000) { 1106 propertyFlag = 1; 1107 return (int16*)_gameState + READ_BE_UINT16(propertyPtr); 1108 } else { 1109 propertyFlag = obj->getFlags() & 1; 1110 return propertyPtr; 1111 } 1112 } 1113 } 1114 prop++; 1115 propertyPtr++; 1116 } 1117 1118 parentObjectIndex = obj->getClass(); 1119 1120 } 1121 1122 return NULL; 1123 1124 } 1125 1126 const char *GameDatabaseSegaSaturn::getString(uint16 offset) { 1127 // Not used in version 3 games 1128 return NULL; 1129 } 1130 812 1131 } // End of namespace Made -
engines/made/database.h
61 61 bool isVector(); 62 62 63 63 int16 getVectorSize(); 64 int16 getVectorItem(int16 index);65 v oid setVectorItem(int16 index, int16 value);64 virtual int16 getVectorItem(int16 index); 65 virtual void setVectorItem(int16 index, int16 value); 66 66 67 67 void dump(const char *filename); 68 68 … … 112 112 113 113 }; 114 114 115 class ObjectSegaSaturn : public Object { 116 public: 117 int load(Common::SeekableReadStream &source); 118 int load(byte *source); 119 int save(Common::WriteStream &dest); 120 uint16 getFlags(); 121 uint16 getClass(); 122 uint16 getSize(); 123 byte getCount1(); 124 byte getCount2(); 125 byte *getData(); 126 127 int16 getVectorItem(int16 index); 128 void setVectorItem(int16 index, int16 value); 129 130 bool isConstant() { 131 return !(getFlags() & 1); 132 } 133 134 }; 135 115 136 class GameDatabase { 116 137 public: 117 138 … … 134 155 135 156 int16 getMainCodeObjectIndex() const { return _mainCodeObjectIndex; } 136 157 137 int16 getVar(int16 index);138 v oid setVar(int16 index, int16 value);158 virtual int16 getVar(int16 index); 159 virtual void setVar(int16 index, int16 value); 139 160 140 161 const char *getObjectString(int16 index); 141 162 void setObjectString(int16 index, const char *str); 142 163 143 164 virtual int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) = 0; 144 165 virtual const char *getString(uint16 offset) = 0; 145 virtual bool getSavegameDescription(const char *filename, Common::String &description, int16 version) = 0;166 virtual bool getSavegameDescription(const char *filename, Common::String &description, int16 version) { return false; } 146 167 virtual int16 savegame(const char *filename, const char *description, int16 version) = 0; 147 168 virtual int16 loadgame(const char *filename, int16 version) = 0; 148 169 149 int16 getObjectProperty(int16 objectIndex, int16 propertyId);150 int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value);170 virtual int16 getObjectProperty(int16 objectIndex, int16 propertyId); 171 virtual int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value); 151 172 152 173 void dumpObject(int16 index); 153 174 … … 193 214 void reloadFromStream(Common::SeekableReadStream &sourceS); 194 215 }; 195 216 217 class GameDatabaseSegaSaturn : public GameDatabase { 218 public: 219 GameDatabaseSegaSaturn(MadeEngine *vm); 220 int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag); 221 const char *getString(uint16 offset); 222 bool getSavegameDescription(const char *filename, Common::String &description); 223 int16 savegame(const char *filename, const char *description, int16 version); 224 int16 loadgame(const char *filename, int16 version); 225 226 int16 getVar(int16 index); 227 void setVar(int16 index, int16 value); 228 229 int16 getObjectProperty(int16 objectIndex, int16 propertyId); 230 int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value); 231 protected: 232 char *_gameText; 233 uint32 _gameStateOffs; 234 void load(Common::SeekableReadStream &sourceS); 235 void reloadFromStream(Common::SeekableReadStream &sourceS); 236 }; 237 196 238 } // End of namespace Made 197 239 198 240 #endif /* MADE_H */ -
engines/made/detection.cpp
294 294 GF_FLOPPY, 295 295 3, 296 296 }, 297 298 { 299 // Return to Zork - Japanese Sega Saturn version 300 { 301 "rtz", 302 "", 303 AD_ENTRY1("rtz.dat", "023e46f6b43913792bd535558cce7bf7"), 304 Common::JA_JPN, 305 Common::kPlatformSaturn, 306 ADGF_NO_FLAGS 307 }, 308 GID_RTZ, 309 0, 310 GF_FLOPPY, 311 3, 312 }, 297 313 298 314 { 299 315 // Return to Zork - Demo … … 308 324 GID_RTZ, 309 325 0, 310 326 GF_DEMO, 311 3 ,327 3 312 328 }, 313 329 314 330 { -
engines/made/made.cpp
82 82 83 83 _pmvPlayer = new PmvPlayer(this, _mixer); 84 84 _res = new ResourceReader(); 85 _cpkPlayer = new CpkPlayer(this, _mixer); 85 86 _screen = new Screen(this); 86 87 87 if (get GameID() == GID_LGOP2 || getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) {88 if (getVersion() == 1 || getVersion() == 2) { 88 89 _dat = new GameDatabaseV2(this); 89 } else if (getGameID() == GID_RTZ) { 90 _dat = new GameDatabaseV3(this); 90 } else if (getVersion() == 3) { 91 if (getPlatform() == Common::kPlatformSaturn) 92 _dat = new GameDatabaseSegaSaturn(this); 93 else 94 _dat = new GameDatabaseV3(this); 91 95 } else { 92 96 error("Unknown GameID"); 93 97 } -
engines/made/made.h
47 47 48 48 #include "made/sound.h" 49 49 50 #include "made/cpkplayer.h" 51 50 52 namespace Made { 51 53 52 54 enum MadeGameID { … … 68 70 struct MadeGameDescription; 69 71 70 72 class ResourceReader; 73 class CpkPlayer; 71 74 class PmvPlayer; 72 75 class Screen; 73 76 class ScriptInterpreter; … … 103 106 private: 104 107 public: 105 108 PmvPlayer *_pmvPlayer; 109 CpkPlayer *_cpkPlayer; 106 110 ResourceReader *_res; 107 111 Screen *_screen; 108 112 GameDatabase *_dat; … … 134 138 Common::String getSavegameFilename(int16 saveNum); 135 139 136 140 void handleEvents(); 137 138 141 }; 139 142 140 143 } // End of namespace Made -
engines/made/module.mk
1 1 MODULE := engines/made 2 2 3 3 MODULE_OBJS = \ 4 cpkplayer.o \ 4 5 database.o \ 5 6 detection.o \ 6 7 graphics.o \ -
engines/made/scriptfuncs.cpp
46 46 _externalFuncs.push_back(new ExternalScriptFunc(this, &ScriptFunctions::x)); \ 47 47 _externalFuncNames.push_back(#x); 48 48 void ScriptFunctions::setupExternalsTable() { 49 50 49 External(sfSystemCall); 51 50 External(sfInitGraf); 52 51 External(sfRestoreGraf); … … 116 115 } 117 116 118 117 if (_vm->getGameID() == GID_RTZ) { 119 External(sfPrintf); 118 if (_vm->getPlatform() != Common::kPlatformSaturn) 119 External(sfPrintf); 120 120 External(sfClearMono); 121 121 External(sfGetSoundEnergy); 122 122 External(sfClearText); … … 151 151 External(sfReadMenu); 152 152 External(sfDrawMenu); 153 153 External(sfGetMenuCount); 154 External(sfSaveGame); 155 External(sfLoadGame); 156 External(sfGetGameDescription); 154 if (_vm->getPlatform() == Common::kPlatformSaturn) { 155 External(sfFaceIcon); 156 } else { 157 External(sfSaveGame); 158 External(sfLoadGame); 159 External(sfGetGameDescription); 160 } 157 161 External(sfShakeScreen); 158 162 External(sfPlaceMenu); 159 163 External(sfSetSoundVolume); … … 929 933 930 934 } 931 935 936 int16 ScriptFunctions::sfFaceIcon(int16 argc, int16 *argv) { 937 // TODO: Used in RTZ Sega Saturn 938 warning("Unimplemented opcode: sfFaceIcon"); 939 return 0; 940 } 941 932 942 int16 ScriptFunctions::sfShakeScreen(int16 argc, int16 *argv) { 933 943 // TODO: Used in RTZ 934 944 warning("Unimplemented opcode: sfShakeScreen"); -
engines/made/scriptfuncs.h
161 161 int16 sfSaveGame(int16 argc, int16 *argv); 162 162 int16 sfLoadGame(int16 argc, int16 *argv); 163 163 int16 sfGetGameDescription(int16 argc, int16 *argv); 164 int16 sfFaceIcon(int16 argc, int16 *argv); 164 165 int16 sfShakeScreen(int16 argc, int16 *argv); 165 166 int16 sfPlaceMenu(int16 argc, int16 *argv); 166 167 int16 sfSetSoundVolume(int16 argc, int16 *argv);