aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-03 12:05:58 +1000
committerPaul Gilbert2011-07-03 12:05:58 +1000
commitbf6a5256fe325816626156703b389273e10f1ae5 (patch)
tree4f357d91cdbb51862fb012c6b5af691556899fa8
parentac0caf757950b960cba058800fa42eebc7becbd8 (diff)
downloadscummvm-rg350-bf6a5256fe325816626156703b389273e10f1ae5.tar.gz
scummvm-rg350-bf6a5256fe325816626156703b389273e10f1ae5.tar.bz2
scummvm-rg350-bf6a5256fe325816626156703b389273e10f1ae5.zip
CGE: Removed code for boot sector based copy protection check
-rw-r--r--engines/cge/boot.h75
-rw-r--r--engines/cge/cge_main.cpp38
-rw-r--r--engines/cge/general.cpp19
-rw-r--r--engines/cge/general.h2
-rw-r--r--engines/cge/ident.h42
-rw-r--r--engines/cge/startup.cpp3
6 files changed, 5 insertions, 174 deletions
diff --git a/engines/cge/boot.h b/engines/cge/boot.h
deleted file mode 100644
index 5c03a626d8..0000000000
--- a/engines/cge/boot.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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.
- *
- */
-
-/*
- * This code is based on original Soltys source code
- * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon
- */
-
-#ifndef __CGE_BOOT__
-#define __CGE_BOOT__
-
-#include "cge/jbw.h"
-
-namespace CGE {
-
-#define BOOTSECT_SIZ 512
-#define BOOTHEAD_SIZ 62
-#define BOOTCODE_SIZ BOOTSECT_SIZ-BOOTHEAD_SIZ
-#define FreeBoot(b) free(b)
-
-struct Boot {
- uint8 _jmp[3]; // NEAR jump machine code
- char _idOEM[8]; // OEM name and version
- uint16 _sectSize; // bytes per sector
- uint8 _clustSize; // sectors per cluster
- uint16 _resSecs; // sectors before 1st FAT
- uint8 _fatCnt; // number of FATs
- uint16 _rootSize; // root directory entries
- uint16 _totSecs; // total sectors on disk
- uint8 _media; // media descriptor byte
- uint16 _fatSize; // sectors per FAT
- uint16 _trkSecs; // sectors per track
- uint16 _headCnt; // number of sufraces
- uint16 _hidnSecs; // special hidden sectors
- uint16 __; // (unknown: reserved?)
- uint32 _lTotSecs; // total number of sectors
- uint16 _driveNum; // physical drive number
- uint8 _xSign; // extended boot signature
- uint32 _serial; // volume serial number
- char _label[11]; // volume label
- char _fileSysID[8]; // file system ID
- char _code[BOOTCODE_SIZ - 8]; // 8 = length of following
- uint32 _secret; // long secret number
- uint8 _bootCheck; // boot sector checksum
- uint8 _bootFlags; // secret flags
- uint16 _bootSig; // boot signature 0xAA55
-};
-
-
-Boot *readBoot(int drive);
-uint8 checkBoot(Boot *boot);
-bool writeBoot(int drive, Boot *boot);
-
-} // End of namespace CGE
-
-#endif
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 31a71cc16c..9f9bebad0c 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -27,8 +27,6 @@
#include "common/scummsys.h"
#include "cge/general.h"
-#include "cge/boot.h"
-#include "cge/ident.h"
#include "cge/sound.h"
#include "cge/startup.h"
#include "cge/config.h"
@@ -96,33 +94,6 @@ Snail *_snail_;
// 1.01 - 17VII95 - default savegame with sound ON
// coditionals EVA for 2-month evaluation version
-/*
- char Copr[] = "Common Game Engine "
- #ifdef EVA
- "ú"
- #else
- #ifdef CD
- "ù"
- #else
- " "
- #endif
- #endif
- " version 1.05 ["
- #if sizeof(INI_FILE) == sizeof(VFILE)
- "I"
- #else
- "i"
- #endif
- #if sizeof(PIC_FILE) == sizeof(VFILE)
- "B"
- #else
- "b"
- #endif
- "]\n"
- "Copyright (c) 1994 by Janusz B. Wi$niewski";
-*/
-char Copr[] = "To be fixed - Copr[]";
-
static char UsrFnam[15] = "\0ɱ%^þúȼ´ ÇÉ";
static int _oldLev = 0;
static int _demoText = DEMO_TEXT;
@@ -1793,12 +1764,9 @@ bool CGEEngine::showTitle(const char *name) {
#ifdef CD
STARTUP::Summa |= (0xC0 + (DriveCD(0) << 6)) & 0xFF;
#else
-// Boot * b = ReadBoot(getdisk());
- warning("ShowTitle: FIXME ReadBoot");
- Boot *b = readBoot(0);
- uint32 sn = (b->_xSign == 0x29) ? b->_serial : b->_lTotSecs;
- free(b);
- sn -= ((Ident *)Copr)->_disk;
+ // At this point the game originally read the boot sector to get
+ // the serial number for it's copy protection check
+ uint32 sn = 0;
STARTUP::Summa |= Lo(sn) | Hi(sn);
#endif
//-----------------------------------------
diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index faff3ada57..fe94bd4598 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -25,7 +25,6 @@
* Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon
*/
-#include "cge/boot.h"
#include "cge/general.h"
#include "cge/snddrv.h"
#include "cge/wav.h"
@@ -344,24 +343,6 @@ int takeEnum(const char **tab, const char *txt) {
return -1;
}
-Boot *readBoot(int drive) {
- /*
- struct fatinfo fi; Boot *b;
- getfat(drive+1, &fi);
- if (fi.fi_sclus & 0x80)
- return NULL;
- if ((b = malloc(fi.fi_bysec)) == NULL)
- return NULL;
- // read boot sector
- if (absread(drive, 1, 0L, b) == 0)
- return b;
- free(b);
- return NULL;
- */
- warning("STUB: readBoot");
- return NULL;
-}
-
long timer(void) {
/*
asm mov ax,0x40
diff --git a/engines/cge/general.h b/engines/cge/general.h
index fae47eed42..63b94d3872 100644
--- a/engines/cge/general.h
+++ b/engines/cge/general.h
@@ -34,7 +34,6 @@
#include "common/textconsole.h"
#include "common/str.h"
#include "cge/jbw.h"
-#include "cge/boot.h"
namespace CGE {
@@ -235,7 +234,6 @@ uint16 xtow(const char *x);
char *wtom(uint16 val, char *str, int radix, int len);
char *dwtom(uint32 val, char * str, int radix, int len);
int takeEnum(const char **tab, const char *txt);
-Boot *readBoot(int drive);
long timer(void);
int new_random(int range);
} // End of namespace CGE
diff --git a/engines/cge/ident.h b/engines/cge/ident.h
deleted file mode 100644
index 953f8a579d..0000000000
--- a/engines/cge/ident.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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.
- *
- */
-
-/*
- * This code is based on original Soltys source code
- * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon
- */
-
-#ifndef __CGE_IDENT__
-#define __CGE_IDENT__
-
-namespace CGE {
-
-struct Ident {
- char _copr[83];
- char _fill[8];
- unsigned long _disk;
- unsigned char _cork;
-};
-
-} // End of namespace CGE
-
-#endif
diff --git a/engines/cge/startup.cpp b/engines/cge/startup.cpp
index 028e4c61b1..b024701c93 100644
--- a/engines/cge/startup.cpp
+++ b/engines/cge/startup.cpp
@@ -28,7 +28,6 @@
#include "cge/startup.h"
#include "cge/text.h"
#include "cge/sound.h"
-#include "cge/ident.h"
#include "cge/cfile.h"
#include "cge/snddrv.h"
#include <stdio.h>
@@ -59,6 +58,8 @@ void quit_now(int ref) {
bool STARTUP::get_parms(void) {
+ Summa = 0;
+
/*
int i = _argc;
while (i > 1)