[Scummvm-cvs-logs] SF.net SVN: scummvm: [24636] scummvm/trunk

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Nov 6 14:42:34 CET 2006


Revision: 24636
          http://svn.sourceforge.net/scummvm/?rev=24636&view=rev
Author:   sev
Date:     2006-11-06 05:40:24 -0800 (Mon, 06 Nov 2006)

Log Message:
-----------
Add support for HE CUP demos based on cyx's standalone player.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/intern_he.h
    scummvm/trunk/engines/scumm/module.mk
    scummvm/trunk/engines/scumm/plugin.cpp
    scummvm/trunk/engines/scumm/scumm-md5.h
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/scumm.h
    scummvm/trunk/tools/scumm-md5.txt

Added Paths:
-----------
    scummvm/trunk/engines/scumm/he/cup_player_he.cpp
    scummvm/trunk/engines/scumm/he/cup_player_he.h

Added: scummvm/trunk/engines/scumm/he/cup_player_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/cup_player_he.cpp	                        (rev 0)
+++ scummvm/trunk/engines/scumm/he/cup_player_he.cpp	2006-11-06 13:40:24 UTC (rev 24636)
@@ -0,0 +1,495 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/stdafx.h"
+#include "common/system.h"
+#include "scumm/scumm.h"
+#include "scumm/he/intern_he.h"
+#include "scumm/he/cup_player_he.h"
+
+namespace Scumm {
+
+bool CUP_Player::open(const char *filename) {
+	bool opened = false;
+	debug(1, "opening '%s'", filename);
+	if (_fd.open(filename)) {
+		uint32 tag = _fd.readUint32BE();
+		_fd.readUint32BE();
+		if (tag == 'BEAN') {
+			_playbackRate = 66;
+			_width = 640;
+			_height = 480;
+			parseHeaderTags();
+			debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);
+			_offscreenBuffer = (uint8 *)malloc(_width * _height);
+			memset(_offscreenBuffer, 0, _width * _height);
+			opened = true;
+		}
+	}
+	return opened;
+}
+
+void CUP_Player::close() {
+	_fd.close();
+	free(_offscreenBuffer);
+}
+
+uint32 CUP_Player::loadNextChunk() {
+	uint32 tag = _fd.readUint32BE();
+	uint32 size = _fd.readUint32BE() - 8;
+	if (_currentChunkSize < size) {
+		free(_currentChunkData);
+		_currentChunkSize = 0;
+		_currentChunkData = (uint8 *)malloc(size);
+	}
+	if (_currentChunkData) {
+		_currentChunkSize = size;
+		_fd.read(_currentChunkData, _currentChunkSize);
+	}
+	return tag;
+}
+
+void CUP_Player::parseHeaderTags() {
+	_dataSize = 0;
+	while (_dataSize == 0 && !_vm->_quit && !_fd.ioFailed()) {
+		uint32 tag = loadNextChunk();
+		switch (tag) {
+		case 'HEAD':
+			handleHEAD(_currentChunkData, _currentChunkSize);
+			break;
+		case 'SFXB':
+			handleSFXB(_currentChunkData, _currentChunkSize);
+			break;
+		case 'RGBS':
+			handleRGBS(_currentChunkData, _currentChunkSize);
+			break;
+		case 'DATA':
+			_dataSize = _currentChunkSize;
+			break;
+		case 'GFXB':
+			// this is never triggered
+		default:
+			warning("unhandled tag %c%c%c%c", tag>>24, (tag>>16)&0xFF, (tag>>8)&0xFF, tag&0xFF);
+			break;
+		}
+	}
+}
+
+void CUP_Player::play() {
+	int ticks = _system->getMillis();
+	Common::Rect r;
+	while (_currentChunkSize != 0 && !_vm->_quit) {
+		uint32 tag, size;
+		parseNextTag(_currentChunkData, &r, tag, size);
+		if (tag == 'BLOK') {
+			bool fastMode = false;
+			int diff = _system->getMillis() - ticks;
+			if (diff >= 0 && diff <= _playbackRate && !fastMode) {
+				_system->delayMillis(_playbackRate - diff);
+			} else {
+				_system->delayMillis(1);
+			}
+			_system->setPalette(_paletteData, 0, 256);
+			_system->copyRectToScreen(_offscreenBuffer, _width, 0, 0, _width, _height);
+			_system->updateScreen();
+			_vm->parseEvents();
+
+			ticks = _system->getMillis();
+			size = 8;
+		}
+		_currentChunkData += size;
+		_currentChunkSize -= size;
+	}
+}
+
+void CUP_Player::parseNextTag(const uint8 *data, Common::Rect *r1, uint32 &tag, uint32 &size) {
+	tag = READ_BE_UINT32(data);
+	size = READ_BE_UINT32(data + 4);
+	data += 8;
+	switch (tag) {
+	case 'FRAM':
+		handleFRAM(_offscreenBuffer, data, size);
+		break;
+	case 'LZSS':
+		data = handleLZSS(data, size);
+		if (data) {
+			uint32 t, s;
+			parseNextTag(data, r1, t, s);
+		}
+		break;
+	case 'RATE':
+		handleRATE(data, size);
+		break;
+	case 'RGBS':
+		handleRGBS(data, size);
+		break;
+	case 'SNDE':
+		handleSNDE(data, size);
+		break;
+	case 'TOIL':
+		handleTOIL(data, size);
+		break;
+	case 'BLOK':
+		// not handled here
+		break;
+	case 'SRLE':
+	case 'WRLE':
+		// these are never triggered
+	default:
+		warning("Unhandled tag %c%c%c%c", tag>>24, (tag>>16)&0xFF, (tag>>8)&0xFF, tag&0xFF);
+		break;
+	}
+}
+
+void CUP_Player::handleHEAD(const uint8 *data, uint32 dataSize) {
+	_playbackRate = READ_LE_UINT16(data);
+	_width = READ_LE_UINT16(data + 2);
+	_height = READ_LE_UINT16(data + 4);
+}
+
+void CUP_Player::handleSFXB(const uint8 *data, uint32 dataSize) {
+	// TODO
+	warning("unhandled SFXB");
+}
+
+void CUP_Player::handleRGBS(const uint8 *data, uint32 dataSize) {
+	int i;
+	uint8 *ptr = _paletteData;
+
+	for (i = 0; i < 256; i++) {
+		*ptr++ = *data++;
+		*ptr++ = *data++;
+		*ptr++ = *data++;
+		*ptr++ = 0;
+	}
+}
+
+void CUP_Player::handleFRAM(uint8 *dst, const uint8 *data, uint32 size) {
+	Common::Rect r1;
+	memset(&r1, 0, sizeof(r1));
+	int code = 256;
+	int flags = *data++;
+	if (flags & 1) {
+		code = *data++;
+	}
+	if (flags & 2) {
+		r1.left = READ_LE_UINT16(data); data += 2;
+		r1.top = READ_LE_UINT16(data); data += 2;
+		r1.right = READ_LE_UINT16(data); data += 2;
+		r1.bottom = READ_LE_UINT16(data); data += 2;
+	}
+	if (flags & 0x80) {
+		decodeFRAM(dst, &r1, data, code);
+	}
+}
+
+// decodeWiz, decodeTRLE
+void CUP_Player::decodeFRAM(uint8 *dst, Common::Rect *r1, const uint8 *data, int code1) {
+	if (code1 == 256) {
+		dst += r1->top * _width + r1->left;
+		int h = r1->bottom - r1->top + 1;
+		int w = r1->right - r1->left + 1;
+		if (h < 0 || w < 0) { warning("h=%d w=%d", h, w); return; }
+		while (h--) {
+			uint16 lineSize = READ_LE_UINT16(data); data += 2;
+			uint8 *dstNextLine = dst + _width;
+			const uint8 *dataNextLine = data + lineSize;
+			if (lineSize != 0) {
+				uint8 *dstEnd = dst + w;
+				while (dst < dstEnd) {
+					int code = *data++;
+					if (code & 1) { // skip
+						code >>= 1;
+						dst += code;
+					} else if (code & 2) { // set
+						code = (code >> 2) + 1;
+						const int sz = MIN(code, dstEnd - dst);
+						memset(dst, *data++, sz);
+						dst += sz;
+					} else { // copy
+						code = (code >> 2) + 1;
+						const int sz = MIN(code, dstEnd - dst);
+						memcpy(dst, data, sz);
+						dst += sz;
+						data += sz;
+					}
+				}
+			}
+			dst = dstNextLine;
+			data = dataNextLine;
+		}
+	}
+}
+
+uint8 *CUP_Player::handleLZSS(const uint8 *data, uint32 dataSize) {
+	uint32 compressionType = 0;
+	uint32 compressionSize = 0;
+	uint32 tag, size;
+
+	tag = READ_BE_UINT32(data);
+	size = READ_BE_UINT32(data + 4);
+	if (tag == 'LZHD') {
+		compressionType = READ_LE_UINT32(data + 8);
+		compressionSize = READ_LE_UINT32(data + 12);
+	}
+	data += size;
+
+	tag = READ_BE_UINT32(data);
+	size = READ_BE_UINT32(data + 4);
+	if (tag == 'DATA') {
+		if (compressionType == 0x2000) {
+			if (_bufferLzssSize < compressionSize) {
+				_bufferLzssSize = compressionSize;
+				free(_bufferLzssData);
+				_bufferLzssData = (uint8 *)malloc(_bufferLzssSize);
+			}
+			data += 8;
+			uint32 offset1 = READ_LE_UINT32(data);
+			uint32 offset2 = READ_LE_UINT32(data + 4);
+			decodeLzssData(_bufferLzssData, data + 8, data + offset1, data + offset2, _tempLzssBuffer);
+			return _bufferLzssData;
+		}
+	}
+	return 0;
+}
+
+void CUP_Player::decodeLzssData(uint8 *dst1, const uint8 *src1, const uint8 *src2, const uint8 *src3, uint8 *dst2) {
+	int index = 1;
+	while (1) {
+		int code = *src1++;
+		for (int b = 0; b < 8; ++b) {
+			if (code & (1 << b)) {
+				*dst1++ = dst2[index] = *src2++;
+				++index;
+				index &= 0xFFF;
+			} else {
+				int cmd = READ_LE_UINT16(src3); src3 += 2;
+				int count = (cmd >> 0xC) + 2;
+				int offs = cmd & 0xFFF;
+				if (offs == 0) {
+					return;
+				}
+				while (count--) {
+					*dst1++ = dst2[index] = dst2[offs];
+					++index;
+					index &= 0xFFF;
+					++offs;
+					offs &= 0xFFF;
+				}
+			}
+		}
+	}
+}
+
+void CUP_Player::handleRATE(const uint8 *data, uint32 dataSize) {
+	_playbackRate = (int16)READ_LE_UINT16(data);
+	if (_playbackRate > 4000) {
+		_playbackRate = 4000;
+	} else if (_playbackRate < 1) {
+		_playbackRate = 1;
+	}
+}
+
+void CUP_Player::handleSNDE(const uint8 *data, uint32 dataSize) {
+	// TODO
+	warning("unhandled SNDE");
+	// READ_LE_UINT32
+	// READ_LE_UINT16
+	// READ_LE_UINT16
+	// READ_LE_UINT16
+}
+
+void CUP_Player::handleTOIL(const uint8 *data, uint32 dataSize) {
+	int codesCount = READ_LE_UINT16(data); data += 2;
+	if (dataSize > 0) {
+		while (codesCount != 0) {
+			int codeSize = *data++;
+			if (codeSize == 0) {
+				codeSize = READ_LE_UINT16(data); data += 2;
+			}
+			int code = *data++;
+			if (code == 0) {
+				code = READ_LE_UINT16(data); data += 2;
+			}
+			switch (code) {
+			case 1:
+				_vm->_quit = true;
+				break;
+			case 2:
+				// display copyright/information messagebox
+				break;
+			case 3:
+				// READ_LE_UINT32(data);
+				break;
+			case 4:
+				// restart playback
+				break;
+			case 5:
+				// disable normal screen update
+				break;
+			case 6:
+				// perform offscreen buffers swapping
+				break;
+			case 7:
+				// pause playback at specific frame
+				// READ_LE_UINT32(data);
+				break;
+			default:
+				warning("Unhandled TOIL code=%d", code);
+				break;
+			}
+			dataSize -= codeSize;
+			data += codeSize;
+			--codesCount;
+		}
+	}
+}
+
+#if 0
+void CUP_Player::processSRLE(uint8 *dst1, uint8 *dst2, const uint8 *codeTable, uint8 *data, int32 unpackedSize) {
+	bool bit;
+	uint16 code;
+	while (unpackedSize > 0) {
+		code = *data++;
+		bit = (code & 1) == 1;
+		code >>= 1;
+		if (!bit) {
+			bit = (code & 1) == 1;
+			code >>= 1;
+			if (!bit) {
+				int size = code + 1;
+				unpackedSize -= size;
+				memcpy(dst1, dst2, size);
+				dst1 += size;
+				dst2 += size;
+			} else {
+				bit = (code & 1) == 1;
+				code >>= 1;
+				if (!bit) {
+					++dst2;
+					*dst1++ = codeTable[code];
+					--unpackedSize;
+				} else if (code == 0) {
+					size = 1 + *data++;
+					color = *data++;
+					color = _cup_colorRemapTable[color];
+					dst2 += size;
+					unpackedSize -= size;
+					memset(dst1, color, size);
+					dst1 += size;
+				} else {
+					size = code;
+					code = *data++;
+					code = _cup_colorRemapTable[code];
+					dst2 += size;
+					unpackedSize -= size;
+					memset(dst1, code, size);
+					dst1 += size;
+				}
+			}
+		} else if (code == 0) {
+			code = READ_LE_UINT16(data); data += 2;
+			++code;
+			dst1 += code;
+			dst2 += code;
+			unpackedSize -= code;
+		} else {
+			dst1 += code;
+			dst2 += code;
+			unpackedSize -= code;
+		}
+	}
+}
+
+void CUP_Player::processWRLE(uint8 *dst, uint8 *codeTable, const uint8 *data, int32 unpackedSize, uint8 rleCode, int pitch) {
+	uint8 color;
+	uint16 code;
+	if (unpackedSize <= 0) return;
+	do {
+		code = *data++;
+		if ((code & 1) != 0) {
+			int size = ((code & 6) >> 1) + 3;
+			code >>= 3;
+			unpackedSize -= var4;
+			color = codeTable[code];
+			if (color != rleCode) {
+				memset(dst, color, size);
+			} else {
+				memcpy(dst, dst + pitch, size);
+			}
+		} else if ((code & 2) == 0) {
+			code >>= 2;
+			if (code == 0) {
+				code = READ_LE_UINT16(data); data += 2;
+			}
+			dst += code;
+			unpackedSize -= code;
+		} else if ((code & 4) != 0) {
+			code >>= 3;
+			if (code == 0) {
+				code = *data++;
+			}
+			unpackedSize -= code;
+			color = *data++;
+			if (color != rleCode) {
+				memset(dst, color, code);
+			} else {
+				assert(code < pitch);
+				memcpy(dst, dst + pitch, code);
+			}
+			dst += code;
+		} else {
+			code >>= 3;
+			color = codeTable[code];
+			if (color == rleCode) {
+				color = dst[pitch];
+			}
+			*dst++ = code;
+			--unpackedSize;
+		}
+	} while (unpackedSize > 0);
+}
+
+void CUP_Player::handleSRLE(IMAGE *img1, IMAGE *img2, Common::Rect *r, const uint8 *data, uint32 dataSize) {
+	Common::Rect r1;
+	r1.left = READ_LE_UINT16(data);
+	r1.top = READ_LE_UINT16(data + 2);
+	r1.right = READ_LE_UINT16(data + 4);
+	r1.bottom = READ_LE_UINT16(data + 6);
+	const uint8 *codeData = data + 8;
+	uint32 size = READ_LE_UINT32(data + 40);
+	processSRLE(img1->ptr, img2->ptr, codeData, data + 44, size);
+}
+
+void CUP_Player::handleWRLE(IMAGE *img, Common::Rect *r, const uint8 *data, uint32 dataSize) {
+	Common::Rect r1;
+	r1.left = READ_LE_UINT16(data); data += 2;
+	r1.top = READ_LE_UINT16(data); data += 2;
+	r1.right = READ_LE_UINT16(data); data += 2;
+	r1.bottom = READ_LE_UINT16(data); data += 2;
+	const uint8 *codeData = data + 8;
+	uint32 size = READ_LE_UINT32(data + 40);
+	processWRLE(img->ptr, codeData, data + 44, size, 0, -img->w);
+}
+#endif
+
+} // End of namespace Scumm


Property changes on: scummvm/trunk/engines/scumm/he/cup_player_he.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: scummvm/trunk/engines/scumm/he/cup_player_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/cup_player_he.h	                        (rev 0)
+++ scummvm/trunk/engines/scumm/he/cup_player_he.h	2006-11-06 13:40:24 UTC (rev 24636)
@@ -0,0 +1,76 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ *
+ * 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 2
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#if !defined(CUP_PLAYER_HE_H) && !defined(DISABLE_HE)
+#define CUP_PLAYER_HE_H
+
+namespace Scumm {
+
+struct CUP_Player {
+	Common::File _fd;
+	uint32 _dataSize;
+	int _playbackRate;
+	int _width, _height;
+	uint8 _paletteData[256 * 4];
+	uint8 *_offscreenBuffer;
+	uint8 _tempLzssBuffer[0x1000];
+	uint8 *_currentChunkData;
+	uint32 _currentChunkSize;
+	uint8 *_bufferLzssData;
+	uint32 _bufferLzssSize;
+
+	ScummEngine_vCUPhe *_vm;
+	Audio::Mixer *_mixer;
+	OSystem *_system;
+
+	CUP_Player(OSystem *sys, ScummEngine_vCUPhe *vm, Audio::Mixer *mixer) {
+		_currentChunkData = 0;
+		_currentChunkSize = 0;
+		_bufferLzssData = 0;
+		_bufferLzssSize = 0;
+		_vm = vm;
+		_mixer = mixer;
+		_system = sys;
+	}
+
+	bool open(const char *filename);
+	void close();
+	uint32 loadNextChunk();
+	void parseHeaderTags();
+	void play();
+	void parseNextTag(const uint8 *data, Common::Rect *r1, uint32 &tag, uint32 &size);
+	void handleHEAD(const uint8 *data, uint32 dataSize);
+	void handleSFXB(const uint8 *data, uint32 dataSize);
+	void handleRGBS(const uint8 *data, uint32 dataSize);
+	void handleFRAM(uint8 *dst, const uint8 *data, uint32 size);
+	void decodeFRAM(uint8 *dst, Common::Rect *r1, const uint8 *data, int code);
+	uint8 *handleLZSS(const uint8 *data, uint32 dataSize);
+	void decodeLzssData(uint8 *dst1, const uint8 *src1, const uint8 *src2, const uint8 *src3, uint8 *dst2);
+	void handleRATE(const uint8 *data, uint32 dataSize);
+	void handleSNDE(const uint8 *data, uint32 dataSize);
+	void handleTOIL(const uint8 *data, uint32 dataSize);
+};
+
+} // End of namespace Scumm
+
+#endif


Property changes on: scummvm/trunk/engines/scumm/he/cup_player_he.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: scummvm/trunk/engines/scumm/he/intern_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/intern_he.h	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/he/intern_he.h	2006-11-06 13:40:24 UTC (rev 24636)
@@ -42,6 +42,7 @@
 class LogicHE;
 class MoviePlayer;
 class Sprite;
+class CUP_Player;
 #endif
 
 class ScummEngine_v60he : public ScummEngine_v6 {
@@ -629,6 +630,27 @@
 	void o100_getWizData();
 	void o100_getVideoData();
 };
+
+class ScummEngine_vCUPhe : public Engine {
+protected:
+	CUP_Player *_cupPlayer;
+	FilenamePattern _filenamePattern;
+
+public:
+	ScummEngine_vCUPhe(OSystem *syst, const DetectorResult &dr);
+	~ScummEngine_vCUPhe();
+
+	int init();
+	int go();
+
+	void parseEvents();
+
+	bool _quit;
+	OSystem *_syst;
+
+	GameSettings _game;
+};
+
 #endif
 
 

Modified: scummvm/trunk/engines/scumm/module.mk
===================================================================
--- scummvm/trunk/engines/scumm/module.mk	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/module.mk	2006-11-06 13:40:24 UTC (rev 24636)
@@ -87,6 +87,7 @@
 ifndef DISABLE_HE
 MODULE_OBJS += \
 	he/animation_he.o \
+	he/cup_player_he.o \
 	he/floodfill_he.o \
 	he/logic_he.o \
 	he/palette_he.o \

Modified: scummvm/trunk/engines/scumm/plugin.cpp
===================================================================
--- scummvm/trunk/engines/scumm/plugin.cpp	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/plugin.cpp	2006-11-06 13:40:24 UTC (rev 24636)
@@ -271,6 +271,9 @@
 	{"puttputt", "Demo",  GID_PUTTDEMO, 6, 60, MDT_ADLIB | MDT_MIDI, GF_USE_KEY, UNK},
 
 #ifndef DISABLE_HE
+	// HE CUP demos
+	{"", "HE CUP",  GID_HECUP,  6, 200, MDT_NONE, 0, UNK},
+
 	// Humongous Entertainment Scumm Version 7.1
 	// The first version to use 640x480 resolution
 	// There are also 7.1 versions of freddemo, airdemo and farmdemo
@@ -500,6 +503,7 @@
 
 	{ "baseball", "baseball", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "baseball", "BaseBall", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+	{ "baseball", "basedemo.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
 
 	{ "baseball2001", "baseball2001", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "baseball2001", "bb2demo", kGenHEPC, UNK_LANG, UNK, 0 },
@@ -516,6 +520,7 @@
 	{ "bluesabctime", "bluesabctime", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "bluesabctime", "BluesABCTimeDemo", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "bluesabctime", "BluesABCTimeDemo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+	{ "bluesabctime", "abc-slideshow.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
 
 	{ "BluesBirthday", "Blue'sBirthday-Red", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "BluesBirthday", "Blue'sBirthday-Red", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -523,6 +528,7 @@
 	{ "BluesBirthday", "Blue'sBirthday-Yellow", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
 	{ "BluesBirthday", "BluesBirthdayDemo", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "BluesBirthday", "BluesBirthdayDemo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+	{ "BluesBirthday", "bda-slideshow.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
 
 	{ "catalog", "catalog", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "catalog", "catalog2", kGenHEPC, UNK_LANG, UNK, 0 },
@@ -691,6 +697,7 @@
 	{ "puttrace", "ToffRennen", kGenHEPC, Common::DE_DEU, UNK, 0 },
 	{ "puttrace", "ToffRennen", kGenHEMac, Common::DE_DEU, Common::kPlatformMacintosh, 0 },
 	{ "puttrace", "UKPuttRace", kGenHEPC, Common::RU_RUS, UNK, 0 }, // Russian
+	{ "puttrace", "racedemo.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
 
 	{ "PuttsFunShop", "PuttsFunShop", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "PuttsFunShop", "Putt's FunShop", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -775,6 +782,7 @@
 	{ "spyfox2", "spyfoxsr", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "spyfox2", "SpyFoxSR", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
 	{ "spyfox2", "SPYMini", kGenHEPC, UNK_LANG, UNK, 0 },
+	{ "spyfox2", "spy2preview.cup", kGenUnchanged, UNK_LANG, UNK, 0 },
 
 	{ "spyozon", "spyozon", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "spyozon", "sf3-demo", kGenHEPC, UNK_LANG, UNK, 0 },
@@ -782,6 +790,7 @@
 	{ "spyozon", "SPYFoxOZU", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "spyozon", "SPYFoxSOS", kGenHEPC, Common::FR_FRA, UNK, 0 },
 	{ "spyozon", "SpyOzon", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+	{ "spyozon", "ozonepre.cup", kGenUnchanged, UNK_LANG, UNK, "HE CUP" },
 
 	{ "thinker1", "1grademo", kGenHEPC, UNK_LANG, UNK, 0 },
 	{ "thinker1", "thinker1", kGenHEPC, UNK_LANG, UNK, 0 },
@@ -1495,6 +1504,9 @@
 	case 6:
 		switch (res.game.heversion) {
 #ifndef DISABLE_HE
+		case 200:
+			*engine = new ScummEngine_vCUPhe(syst, res);
+			break;
 		case 100:
 			*engine = new ScummEngine_v100he(syst, res);
 			break;

Modified: scummvm/trunk/engines/scumm/scumm-md5.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm-md5.h	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/scumm-md5.h	2006-11-06 13:40:24 UTC (rev 24636)
@@ -1,5 +1,5 @@
 /*
-  This file was generated by the md5table tool on Wed Oct 25 01:46:12 2006
+  This file was generated by the md5table tool on Mon Nov  6 00:03:35 2006
   DO NOT EDIT MANUALLY!
  */
 
@@ -128,6 +128,7 @@
 	{ "33e989f85da700e2014d00f345cab3d7", "puttrace", "HE 98.5", "", -1, Common::FR_FRA, Common::kPlatformWindows },
 	{ "3433be9866ca4261b2d5d25374e3f243", "monkey", "VGA", "VGA", -1, Common::FR_FRA, Common::kPlatformAmiga },
 	{ "3486ede0f904789267d4bcc5537a46d4", "puttzoo", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh },
+	{ "356fb5f680b68251333016175935d126", "BluesABCTime", "HE CUP", "Demo", 4133436, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "35a2d3040fa512f8232d9e443319d84d", "dig", "", "", 659335495, Common::EN_ANY, Common::kPlatformMacintosh },
 	{ "362c1d281fb9899254cda66ad246c66a", "dig", "Demo", "Demo", 3472, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "3686cf8f89e102ececf4366e1d2c8126", "monkey2", "", "", 11135, Common::EN_ANY, Common::kPlatformPC },
@@ -168,6 +169,7 @@
 	{ "49210e124e4c2b30f1290a9ef6306301", "monkey", "EGA", "EGA", 8357, Common::EN_ANY, Common::kPlatformPC },
 	{ "4973bbc3899e3826dbf316e1d7271ec7", "zak", "V1", "", -1, Common::DE_DEU, Common::kPlatformC64 },
 	{ "499c958affc394f2a3868f1eb568c3ee", "freddi4", "HE 99", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows },
+	{ "49a1739981a89066b1121fac04b710f4", "spyfox2", "HE CUP", "Demo", 5756234, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "4aa93cb30e485b728504ba3a693f12bf", "pajama", "HE 100", "", -1, Common::RU_RUS, Common::kPlatformWindows },
 	{ "4af4a6b248103c1fe9edef619677f540", "puttmoon", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh },
 	{ "4ba37f835be11a59d969f90f272f575b", "water", "HE 80", "", -1, Common::EN_USA, Common::kPlatformUnknown },
@@ -226,6 +228,7 @@
 	{ "62b8c16b6db226ba95aaa8be73f9885c", "indy3", "EGA", "EGA", -1, Common::ES_ESP, Common::kPlatformAmiga },
 	{ "63fdcdc95cdeea00060883aed38e5504", "PuttTime", "HE 85", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "6508fd55530e6915507e1cc37f7f045d", "indy3", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformPC },
+	{ "65563295c3a06493351870f20a1630cf", "spyozon", "HE CUP", "Demo", 5235008, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "659942b9a6b519f123a13cca3c333a13", "jungle", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh },
 	{ "65fa23d6884e8ca23d5d2406d70de7e8", "puttzoo", "", "Demo", -1, Common::FR_FRA, Common::kPlatformWindows },
 	{ "66236cd1aec24e1d4aff4c4cc93b7e18", "indy3", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformPC },
@@ -246,6 +249,7 @@
 	{ "6af2419fe3db5c2fdb091ae4e5833770", "puttrace", "HE 98.5", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown },
 	{ "6b19d0e25cbf720d05822379b8b90ed9", "PuttTime", "HE 90", "Demo", -1, Common::NL_NLD, Common::kPlatformWindows },
 	{ "6b257bb2827dd894b8109a50a1a18b5a", "freddicove", "HE 100", "Demo", -1, Common::NL_NLD, Common::kPlatformUnknown },
+	{ "6b27dbcd8d5697d5c918eeca0f68ef6a", "puttrace", "HE CUP", "Demo", 3901484, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "6b3ec67da214f558dc5ceaa2acd47453", "indy3", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformPC },
 	{ "6b5a3fef241e90d4b2e77f1e222773ee", "maniac", "NES", "extracted", -1, Common::SE_SWE, Common::kPlatformNES },
 	{ "6bf70eee5de3d24d2403e0dd3d267e8a", "spyfox", "", "", 49221, Common::UNK_LANG, Common::kPlatformWindows },
@@ -309,6 +313,7 @@
 	{ "89cfc425566003ff74b7dc7b3e6fd469 ", "indy3", "EGA", "EGA", -1, Common::FR_FRA, Common::kPlatformPC },
 	{ "8a484262363a8e18be87112454f1456b", "pjgames", "", "", -1, Common::EN_USA, Common::kPlatformUnknown },
 	{ "8aa05d3cdb0e795436043f0546af2da2", "tentacle", "", "CD?", -1, Common::FR_FRA, Common::kPlatformUnknown },
+	{ "8aed489aba45d2b9fb8a04079c9c6e6a", "baseball", "HE CUP", "Demo", 12876596, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "8afb3cf9f95abf208358e984f0c9e738", "funpack", "", "", -1, Common::EN_ANY, Common::kPlatform3DO },
 	{ "8bdb0bf87b5e303dd35693afb9351215", "ft", "", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
 	{ "8d479e36f35e80257dfc102cf4b8a912", "farm", "HE 72", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows },
@@ -331,6 +336,7 @@
 	{ "92e7727e67f5cd979d8a1070e4eb8cb3", "puttzoo", "HE 98.5", "Updated", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "92fc0073a4cf259ff36070ecb8628ba8", "thinkerk", "", "", -1, Common::EN_USA, Common::kPlatformUnknown },
 	{ "94aaedbb8f26d71ed3ad6dd34490e29e", "tentacle", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC },
+	{ "94db6519da85b8d08c976d8e9a858ea7", "baseball", "HE CUP", "Demo", 10044774, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "95b3806e043be08668c54c3ffe98650f", "BluesABCTime", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
 	{ "96a3069a3c63caa7329588ce1fef41ee", "spyozon", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
 	{ "9708cf716ed8bcc9ff3fcfc69413b746", "puttputt", "HE 61", "", -1, Common::EN_ANY, Common::kPlatformPC },
@@ -506,6 +512,7 @@
 	{ "f79e60c17cca601e411f1f75e8ee9b5a", "spyfox2", "", "", 51286, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "f8be685007a8b425ba2a455da732f59f", "pajama2", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformMacintosh },
 	{ "fa127d7c4bb47d05bb1c33ddcaa9f767", "loom", "EGA", "EGA", 5748, Common::DE_DEU, Common::kPlatformPC },
+	{ "fa30c4a7a806629626269b6dcab59a15", "BluesBirthday", "HE CUP", "Demo", 7819264, Common::UNK_LANG, Common::kPlatformUnknown },
 	{ "fb66aa42de21675116346213f176a366", "monkey", "VGA", "VGA", -1, Common::IT_ITA, Common::kPlatformAmiga },
 	{ "fbb697d89d2beca87360a145f467bdae", "PuttTime", "HE 90", "Demo", -1, Common::DE_DEU, Common::kPlatformUnknown },
 	{ "fbbbb38a81fc9d6a61d509278390a290", "farm", "", "", -1, Common::EN_ANY, Common::kPlatformMacintosh },

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-11-06 13:40:24 UTC (rev 24636)
@@ -60,6 +60,7 @@
 #include "scumm/sound.h"
 #include "scumm/imuse/sysex.h"
 #include "scumm/he/sprite_he.h"
+#include "scumm/he/cup_player_he.h"
 #include "scumm/util.h"
 #include "scumm/verbs.h"
 
@@ -765,6 +766,51 @@
 		free(_hePalettes);
 	}
 }
+
+ScummEngine_vCUPhe::ScummEngine_vCUPhe(OSystem *syst, const DetectorResult &dr) : Engine(syst){
+	_syst = syst;
+	_game = dr.game;
+	_filenamePattern = dr.fp,
+	
+	_cupPlayer = new CUP_Player(syst, this, _mixer);
+}
+
+ScummEngine_vCUPhe::~ScummEngine_vCUPhe() {
+	delete _cupPlayer;
+}
+
+int ScummEngine_vCUPhe::init() {
+	_system->beginGFXTransaction();
+		_system->initSize(640, 480);
+		initCommonGFX(true);
+	_system->endGFXTransaction();
+
+	return 0;
+}
+
+int ScummEngine_vCUPhe::go() {
+	_cupPlayer->open(_filenamePattern.pattern);
+	_cupPlayer->play();
+	_cupPlayer->close();
+
+	return 0;
+}
+
+void ScummEngine_vCUPhe::parseEvents() {
+	OSystem::Event event;
+	
+	while (_system->pollEvent(event)) {
+		switch (event.type) {
+		case OSystem::EVENT_QUIT:
+			_quit = true;
+			break;
+
+		default:
+			break;
+		}
+	}
+}
+
 #endif
 
 #ifndef DISABLE_SCUMM_7_8
@@ -868,7 +914,7 @@
 #endif
 
 
-	// The 	kGenAsIs method is only used for 'container files', i.e. files
+	// The 	kGenUnchanged method is only used for 'container files', i.e. files
 	// that contain the real game files bundled together in an archive format.
 	// This is the case of the NES, C64 and Mac versions of certain games.
 	// Note: All of these can also occur in 'extracted' form, in which case they
@@ -957,7 +1003,7 @@
 			_fileHandle->close();
 			
 		} else {
-			error("kGenAsIs used with unsupported platform");
+			error("kGenUnchanged used with unsupported platform");
 		}
 	} else {
 		// Regular access, no container file involved

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/engines/scumm/scumm.h	2006-11-06 13:40:24 UTC (rev 24636)
@@ -235,7 +235,8 @@
 	GID_PUTTRACE,
 	GID_FUNSHOP,	// Used for all three funshops
 	GID_FOOTBALL,
-	GID_SOCCER
+	GID_SOCCER,
+	GID_HECUP		// CUP demos
 };
 
 struct SentenceTab {

Modified: scummvm/trunk/tools/scumm-md5.txt
===================================================================
--- scummvm/trunk/tools/scumm-md5.txt	2006-11-06 13:19:12 UTC (rev 24635)
+++ scummvm/trunk/tools/scumm-md5.txt	2006-11-06 13:40:24 UTC (rev 24636)
@@ -349,6 +349,8 @@
 
 baseball	Backyard Baseball
 	cf8d13446ec6cb6222287a925fd47c1d	-1	en	All	-	-	-	sev
+	94db6519da85b8d08c976d8e9a858ea7	10044774	All	All	HE CUP	Demo	-	sev
+	8aed489aba45d2b9fb8a04079c9c6e6a	12876596	All	All	HE CUP	Demo	Updated	sev
 
 baseball2001	Backyard Baseball 2001
 	a86f9c49355579c30d4a55b477c0d869	-1	en	All	-	-	-	Kirben
@@ -393,12 +395,14 @@
 
 	7ddeaf52c8b9a50551ce0aa2ac811d07	-1	en	All	-	Demo	-	khalek, sev
 	810a9da887aefa597b0cf3c77d262897	-1	en	All	-	Demo	-	sev
+	356fb5f680b68251333016175935d126	4133436	All	All	HE CUP	Demo	-	sev
 
 BluesBirthday	Blue's Birthday Adventure
 	99128b6a5bdd9831d9682fb8b5cbf8d4	-1	en	All	-	-	-	
 
 	2d4acbdcfd8e374c9da8c2e7303a5cd0	-1	en	All	-	Demo	-	Kirben
 	dbf4d59d70b826733f379f998354d350	-1	en	All	-	Demo	-	Kirben
+	fa30c4a7a806629626269b6dcab59a15	7819264	All	All	HE CUP	Demo	-	sev
 
 fbear	Fatty Bear's Birthday Surprise
 	5b08000a9c47b2887df6506ac767ca68	-1	en	3DO	HE 61	-	-	sev
@@ -602,6 +606,7 @@
 	663743c03ae0c007f3d665cf631c0e6b	13135	de	All	HE 99	Demo	-	Joachim Eberhard
 	aaa587701cde7e74692c68c1024b85eb	-1	nl	All	HE 99	Demo	-	joostp
 	7c8100e360e8ef05f88069d4cfa0afd1	13108	gb	Windows	HE 99	Demo	-	eriktorbjorn
+	6b27dbcd8d5697d5c918eeca0f68ef6a	3901484	All	All	HE CUP	Demo	-	sev
 
 puttmoon	Putt-Putt Goes to the Moon
 	a9543ef0d79bcb47cd76ec197ad0a967	-1	en	3DO	-	-	-	sev
@@ -721,6 +726,7 @@
 	732845548b1d6c2da572cb6a1bf81b07	-1	de	All	-	Demo	-	Joachim Eberhard
 	e62056ba675ad65d8854ab3c5ad4b3c0	-1	en	Windows	-	Mini Game	-	Trekky
 	19bf6938a94698296bcb0c99c31c91a7	-1	gb	Windows	-	Demo	-	eriktorbjorn
+	49a1739981a89066b1121fac04b710f4	5756234	All	All	HE CUP	Demo	-	sev
 
 spyozon	SPY Fox 3: Operation Ozone
 	600abd3e9f47e63e670188b7e4e86ac7	47128	us	All	-	-	-	Kirben
@@ -729,6 +735,7 @@
 	be39a5d4db60e8aa736b9086778cb45c	-1	gb	Windows	-	-	-	
 
 	ebd0b2c8a387f18887282afe6cad894a	-1	en	All	-	Demo	-	Kirben
+	65563295c3a06493351870f20a1630cf	5235008	All	All	HE CUP	Demo	-	sev
 
 chase	SPY Fox in Cheese Chase
 	589601b676c98b1c0c987bc031ab68b3	-1	us	All	HE 95	-	-	Kirben


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list