aboutsummaryrefslogtreecommitdiff
path: root/engines/cryo
diff options
context:
space:
mode:
authorRetro-Junk2016-10-10 01:26:23 +0300
committerEugene Sandulenko2017-01-25 22:42:00 +0100
commit19038b2bce9f4454e0945ceadceb5cc6d8a0fd7e (patch)
treeb8d4e490609a43a60cd3fef6e5695b1eb290c86d /engines/cryo
parent9e7129f41709f21500c20a44005c293b934d99cd (diff)
downloadscummvm-rg350-19038b2bce9f4454e0945ceadceb5cc6d8a0fd7e.tar.gz
scummvm-rg350-19038b2bce9f4454e0945ceadceb5cc6d8a0fd7e.tar.bz2
scummvm-rg350-19038b2bce9f4454e0945ceadceb5cc6d8a0fd7e.zip
CRYO: Initial work on DOS and Demo versions support
Diffstat (limited to 'engines/cryo')
-rw-r--r--engines/cryo/eden.cpp74
1 files changed, 35 insertions, 39 deletions
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index c4b869fda8..2feaf47477 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -4674,6 +4674,11 @@ void EdenGame::closebigfile() {
}
void EdenGame::loadFile(uint16 num, void *buffer) {
+ if (g_ed->getPlatform() == Common::kPlatformDOS) {
+ if ((g_ed->isDemo() && num > 2204) || num > 2472) {
+ error("Trying to read invalid game resource");
+ }
+ }
assert(num < bigfile_header->count);
pakfile_t *file = &bigfile_header->files[num];
int32 size = PLE32(&file->size);
@@ -4693,8 +4698,9 @@ void EdenGame::shnmfl(uint16 num) {
}
int EdenGame::ssndfl(uint16 num) {
- assert(num + 660 < bigfile_header->count);
- pakfile_t *file = &bigfile_header->files[num + 660];
+ unsigned int resNum = num - 1 + ((g_ed->getPlatform() == Common::kPlatformDOS && g_ed->isDemo()) ? 656 : 661);
+ assert(resNum < bigfile_header->count);
+ pakfile_t *file = &bigfile_header->files[resNum];
int32 size = PLE32(&file->size);
int32 offs = PLE32(&file->offs);
if (_soundAllocated) {
@@ -4745,16 +4751,25 @@ void EdenGame::ConvertMacToPC() {
#endif
void EdenGame::loadpermfiles() {
- loadFile(2498, gameIcons);
- loadFile(2497, gameRooms);
- loadFile(2486, gameLipsync);
+ switch (g_ed->getPlatform()) {
+ case Common::kPlatformDOS:
+ // PC version uses hotspots and rooms info hardcoded to the executable
+ assert(0);
+ break;
+ case Common::kPlatformMacintosh:
+ loadFile(2498, gameIcons);
+ loadFile(2497, gameRooms);
+ loadFile(2486, gameLipsync);
+ ConvertMacToPC();
+ break;
+ default:
+ error("Unsupported platform");
+ }
+
loadFile(0, main_bank_buf);
loadFile(402, gameFont);
loadFile(404, gameDialogs);
loadFile(403, gameConditions);
-#if 1
- ConvertMacToPC();
-#endif
}
char EdenGame::ReadDataSync(uint16 num) {
@@ -5626,51 +5641,32 @@ void EdenGame::intro() {
return;
#endif
- int16 speed = 0;
- if (!machine_speed) {
- if (!word_378CC)
- speed = 4;
- else {
- if (CLComputer_Has68030())
- speed = 1;
- if (CLComputer_Has68040())
- speed = 2;
- }
- if (speed == 2)
- if (testcdromspeed())
- speed++;
- machine_speed = speed;
- }
- if (machine_speed == 1) {
- _doubledScreen = false;
- p_mainview->_doubled = _doubledScreen;
- if (ScreenView._width < 640 || ScreenView._height < 400)
- allow_doubled = 0;
- }
- if (machine_speed < 3)
- playHNM(98);
- else {
+ if (g_ed->getPlatform() == Common::kPlatformMacintosh) {
+ // Play intro videos in HQ
CLSoundChannel_Stop(hnmsound_ch);
CLHNM_CloseSound();
CLHNM_SetupSound(5, 0x2000, 16, 22050 * 65536.0, 0);
hnmsound_ch = CLHNM_GetSoundChannel();
playHNM(2012);
- }
- playHNM(171);
- CLBlitter_FillScreenView(0);
- specialTextMode = false;
- if (machine_speed < 3)
- playHNM(170);
- else {
+ playHNM(171);
+ CLBlitter_FillScreenView(0);
+ specialTextMode = false;
playHNM(2001);
CLSoundChannel_Stop(hnmsound_ch);
CLHNM_CloseSound();
CLHNM_SetupSound(5, 0x2000, 8, 11025 * 65536.0, 0);
hnmsound_ch = CLHNM_GetSoundChannel();
+ } else {
+ playHNM(98); // Cryo logo
+ playHNM(171); // Virgin logo
+ CLBlitter_FillScreenView(0);
+ specialTextMode = false;
+ playHNM(170); // Intro video
}
}
char EdenGame::testcdromspeed() {
+ //TODO: obsolete, remove me
return 1;
}