Update minimalist (and broken) WinCE port
svn-id: r4000
This commit is contained in:
parent
6215c253d4
commit
44cc8c24a3
4 changed files with 654 additions and 500 deletions
|
@ -406,6 +406,9 @@ OSystem *GameDetector::createSystem() {
|
||||||
#else
|
#else
|
||||||
case GD_SDL:
|
case GD_SDL:
|
||||||
case GD_AUTO:
|
case GD_AUTO:
|
||||||
|
#ifdef _WIN32_WCE
|
||||||
|
return OSystem_WINCE3_create();
|
||||||
|
#endif
|
||||||
#if !defined(__MORPHOS__)
|
#if !defined(__MORPHOS__)
|
||||||
return OSystem_SDL_create(_gfx_mode, _fullScreen);
|
return OSystem_SDL_create(_gfx_mode, _fullScreen);
|
||||||
#endif
|
#endif
|
||||||
|
@ -435,7 +438,7 @@ OSystem *GameDetector::createSystem() {
|
||||||
MidiDriver *GameDetector::createMidi() {
|
MidiDriver *GameDetector::createMidi() {
|
||||||
int drv = _midi_driver;
|
int drv = _midi_driver;
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined (WIN32) && !defined(_WIN32_WCE)
|
||||||
/* MD_WINDOWS is default MidiDriver on windows targets */
|
/* MD_WINDOWS is default MidiDriver on windows targets */
|
||||||
if (drv == MD_AUTO) drv = MD_WINDOWS;
|
if (drv == MD_AUTO) drv = MD_WINDOWS;
|
||||||
#endif
|
#endif
|
||||||
|
@ -443,7 +446,7 @@ MidiDriver *GameDetector::createMidi() {
|
||||||
switch(drv) {
|
switch(drv) {
|
||||||
case MD_AUTO:
|
case MD_AUTO:
|
||||||
case MD_NULL: return MidiDriver_NULL_create();
|
case MD_NULL: return MidiDriver_NULL_create();
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(_WIN32_WCE)
|
||||||
case MD_WINDOWS: return MidiDriver_WIN_create();
|
case MD_WINDOWS: return MidiDriver_WIN_create();
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MORPHOS__
|
#ifdef __MORPHOS__
|
||||||
|
|
|
@ -27,7 +27,9 @@
|
||||||
#include "simon.h"
|
#include "simon.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
@ -601,7 +603,7 @@ bool SimonState::loadGamePcFile(const char *filename) {
|
||||||
_tbl_list = (byte*)malloc(file_size);
|
_tbl_list = (byte*)malloc(file_size);
|
||||||
if (_tbl_list == NULL)
|
if (_tbl_list == NULL)
|
||||||
error("Out of memory for strip table list");
|
error("Out of memory for strip table list");
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
fread(_tbl_list, file_size, 1, in);
|
fread(_tbl_list, file_size, 1, in);
|
||||||
fclose(in);
|
fclose(in);
|
||||||
|
|
||||||
|
@ -619,7 +621,7 @@ bool SimonState::loadGamePcFile(const char *filename) {
|
||||||
_stripped_txt_mem = (byte*)malloc(file_size);
|
_stripped_txt_mem = (byte*)malloc(file_size);
|
||||||
if (_stripped_txt_mem == NULL)
|
if (_stripped_txt_mem == NULL)
|
||||||
error("Out of memory for strip text list");
|
error("Out of memory for strip text list");
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
fread(_stripped_txt_mem, file_size, 1, in);
|
fread(_stripped_txt_mem, file_size, 1, in);
|
||||||
fclose(in);
|
fclose(in);
|
||||||
|
|
||||||
|
@ -2242,7 +2244,7 @@ uint SimonState::loadTextFile_simon1(const char *filename, byte *dst) {
|
||||||
|
|
||||||
fseek(fo, 0, SEEK_END);
|
fseek(fo, 0, SEEK_END);
|
||||||
size = ftell(fo);
|
size = ftell(fo);
|
||||||
rewind(fo);
|
fseek(fo, 0, SEEK_SET);
|
||||||
|
|
||||||
if (fread(dst, size,1, fo) != 1)
|
if (fread(dst, size,1, fo) != 1)
|
||||||
error("loadTextFile: fread failed");
|
error("loadTextFile: fread failed");
|
||||||
|
@ -3185,7 +3187,7 @@ void SimonState::loadIconFile() {
|
||||||
if (_icon_file_ptr == NULL)
|
if (_icon_file_ptr == NULL)
|
||||||
error("Out of icon memory");
|
error("Out of icon memory");
|
||||||
|
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
|
|
||||||
fread(_icon_file_ptr, size, 1, in);
|
fread(_icon_file_ptr, size, 1, in);
|
||||||
fclose(in);
|
fclose(in);
|
||||||
|
@ -6896,7 +6898,7 @@ void SimonState::readSfxFile(const char *filename) {
|
||||||
fseek(in, 0, SEEK_END);
|
fseek(in, 0, SEEK_END);
|
||||||
size = ftell(in);
|
size = ftell(in);
|
||||||
|
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
|
|
||||||
/* stop all sounds */
|
/* stop all sounds */
|
||||||
_mixer->stop_all();
|
_mixer->stop_all();
|
||||||
|
@ -7631,7 +7633,7 @@ void SimonState::read_vga_from_datfile_1(uint vga_id) {
|
||||||
|
|
||||||
fseek(in, 0, SEEK_END);
|
fseek(in, 0, SEEK_END);
|
||||||
size = ftell(in);
|
size = ftell(in);
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
|
|
||||||
if (fread(_vga_buffer_pointers[11].vgaFile2, size, 1, in) != 1)
|
if (fread(_vga_buffer_pointers[11].vgaFile2, size, 1, in) != 1)
|
||||||
error("read_vga_from_datfile_1: read failed");
|
error("read_vga_from_datfile_1: read failed");
|
||||||
|
@ -7660,7 +7662,7 @@ byte *SimonState::read_vga_from_datfile_2(uint id) {
|
||||||
|
|
||||||
fseek(in, 0, SEEK_END);
|
fseek(in, 0, SEEK_END);
|
||||||
size = ftell(in);
|
size = ftell(in);
|
||||||
rewind(in);
|
fseek(in, 0, SEEK_SET);
|
||||||
|
|
||||||
dst = setup_vga_destination(size);
|
dst = setup_vga_destination(size);
|
||||||
|
|
||||||
|
@ -7992,7 +7994,9 @@ bool SimonState::save_game(uint slot, const char *caption) {
|
||||||
|
|
||||||
_lock_word |= 0x100;
|
_lock_word |= 0x100;
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
f = fopen(gen_savename(slot), "wb");
|
f = fopen(gen_savename(slot), "wb");
|
||||||
if (f==NULL)
|
if (f==NULL)
|
||||||
|
@ -8084,8 +8088,12 @@ char *SimonState::gen_savename(int slot) {
|
||||||
const char *dir;
|
const char *dir;
|
||||||
|
|
||||||
/* perhaps getenv should be added to OSystem */
|
/* perhaps getenv should be added to OSystem */
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
dir = getenv("SCUMMVM_SAVEPATH");
|
dir = getenv("SCUMMVM_SAVEPATH");
|
||||||
if (dir == NULL) dir = "";
|
if (dir == NULL) dir = "";
|
||||||
|
#else
|
||||||
|
dir = _game_path;
|
||||||
|
#endif
|
||||||
|
|
||||||
sprintf(buf, "%sSAVE.%.3d", dir, slot);
|
sprintf(buf, "%sSAVE.%.3d", dir, slot);
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -8098,7 +8106,9 @@ bool SimonState::load_game(uint slot) {
|
||||||
|
|
||||||
_lock_word |= 0x100;
|
_lock_word |= 0x100;
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
f = fopen(gen_savename(slot), "rb");
|
f = fopen(gen_savename(slot), "rb");
|
||||||
if (f==NULL)
|
if (f==NULL)
|
||||||
|
@ -8200,8 +8210,10 @@ bool SimonState::load_game(uint slot) {
|
||||||
|
|
||||||
_lock_word &= ~0x100;
|
_lock_word &= ~0x100;
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
error("load failed");
|
error("load failed");
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
2
system.h
2
system.h
|
@ -121,6 +121,7 @@ OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen);
|
||||||
OSystem *OSystem_NULL_create();
|
OSystem *OSystem_NULL_create();
|
||||||
OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen);
|
OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen);
|
||||||
OSystem *OSystem_Dreamcast_create();
|
OSystem *OSystem_Dreamcast_create();
|
||||||
|
OSystem *OSystem_WINCE3_create();
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
GFX_NORMAL = 0,
|
GFX_NORMAL = 0,
|
||||||
|
@ -140,6 +141,7 @@ enum {
|
||||||
GD_X = 3,
|
GD_X = 3,
|
||||||
GD_NULL = 4,
|
GD_NULL = 4,
|
||||||
GD_MORPHOS = 5,
|
GD_MORPHOS = 5,
|
||||||
|
GD_WINCE = 6
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
1119
wince/pocketpc.cpp
1119
wince/pocketpc.cpp
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue