Check that we are running a Windows NT kernel >= 4.0 and drivers are

installed correctly (namely cdenable.sys)
This commit is contained in:
gbeauche 2005-03-19 19:09:44 +00:00
parent 7b6d062c9d
commit 1fb076bc7b
3 changed files with 24 additions and 1 deletions

View File

@ -73,6 +73,8 @@ int64 BusClockSpeed; // Bus clock speed (Hz)
int64 TimebaseSpeed; // Timebase clock speed (Hz)
uint8 *RAMBaseHost; // Base address of Mac RAM (host address space)
uint8 *ROMBaseHost; // Base address of Mac ROM (host address space)
DWORD win_os; // Windows OS id
DWORD win_os_major; // Windows OS version major
// Global variables
@ -184,6 +186,25 @@ int main(int argc, char **argv)
}
}
// Check we are using a Windows NT kernel >= 4.0
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx(&osvi)) {
ErrorAlert("Could not determine OS type");
QuitEmulator();
}
win_os = osvi.dwPlatformId;
win_os_major = osvi.dwMajorVersion;
if (win_os != VER_PLATFORM_WIN32_NT || win_os_major < 4) {
ErrorAlert(GetString(STR_NO_WIN32_NT_4));
QuitEmulator();
}
// Check that drivers are installed
if (!check_drivers())
QuitEmulator();
// Initialize SDL system
int sdl_flags = 0;
#ifdef USE_SDL_VIDEO

View File

@ -45,6 +45,7 @@ user_string_def platform_strings[] = {
{STR_OPEN_WINDOW_ERR, "Cannot open Mac window."},
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_WIN32_NT_4, "SheepShaver does not run on Windows NT versions less than 4.0"},
{-1, NULL} // End marker
};

View File

@ -38,7 +38,8 @@ enum {
STR_KEYCODE_FILE_WARN,
STR_KEYCODE_VENDOR_WARN,
STR_OPEN_WINDOW_ERR,
STR_WINDOW_TITLE_GRABBED
STR_WINDOW_TITLE_GRABBED,
STR_NO_WIN32_NT_4,
};
#endif