2005-11-27 02:35:57 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2001-2006 The ScummVM project
|
2005-11-27 02:35:57 +00:00
|
|
|
* Copyright (C) 2005 Won Star - GP32 Backend
|
|
|
|
*
|
|
|
|
* 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
|
2005-12-04 08:49:08 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-11-27 02:35:57 +00:00
|
|
|
*
|
2006-02-11 12:47:47 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2005-11-27 02:35:57 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
|
2006-01-06 12:48:48 +00:00
|
|
|
#include "common/config-manager.h"
|
2005-11-27 02:35:57 +00:00
|
|
|
|
2006-04-02 00:08:22 +00:00
|
|
|
#include "base/main.h"
|
|
|
|
|
2005-11-27 02:35:57 +00:00
|
|
|
#include "backends/gp32/gp32std.h"
|
|
|
|
#include "backends/gp32/gp32std_grap.h"
|
|
|
|
|
|
|
|
#include "backends/gp32/gp32_launcher.h"
|
2006-04-07 11:37:46 +00:00
|
|
|
#include "backends/gp32/gp32_osys.h"
|
2006-01-06 12:48:48 +00:00
|
|
|
#include "backends/gp32/globals.h"
|
2005-11-27 02:35:57 +00:00
|
|
|
|
2006-01-06 12:48:48 +00:00
|
|
|
GlobalVars g_vars;
|
2005-11-27 02:35:57 +00:00
|
|
|
|
|
|
|
void init() {
|
2006-01-06 12:48:48 +00:00
|
|
|
gp_setCpuSpeed(40); // Default CPU Speed
|
2005-11-27 02:35:57 +00:00
|
|
|
|
|
|
|
GpGraphicModeSet(16, NULL);
|
|
|
|
|
|
|
|
//if (type == NLU || type == FLU || type == BLU)
|
|
|
|
// gp_initFramebuffer(frameBuffer, 16, 85);
|
|
|
|
//else if (type == BLUPLUS)
|
|
|
|
// gp_initFramebufferBP(frameBuffer, 16, 85);
|
|
|
|
// else
|
|
|
|
// error("Invalid Console");
|
|
|
|
gp_initFrameBuffer();
|
|
|
|
|
|
|
|
GpFatInit();
|
|
|
|
GpRelativePathSet("gp:\\gpmm");
|
|
|
|
}
|
|
|
|
|
|
|
|
void GpMain(void *arg) {
|
2006-06-29 09:17:04 +00:00
|
|
|
extern void memChunkInit();
|
|
|
|
memChunkInit();
|
|
|
|
|
2005-11-27 02:35:57 +00:00
|
|
|
init();
|
|
|
|
|
2006-01-06 12:48:48 +00:00
|
|
|
readConfigVars();
|
|
|
|
|
2005-11-27 02:35:57 +00:00
|
|
|
splashScreen();
|
2006-01-06 12:48:48 +00:00
|
|
|
|
2005-11-27 02:35:57 +00:00
|
|
|
//doConfig
|
2006-01-06 12:48:48 +00:00
|
|
|
gp_initGammaTable((float)g_vars.gammaRamp / 10000);
|
|
|
|
gp_setCpuSpeed(g_vars.cpuSpeed);
|
2005-11-27 02:35:57 +00:00
|
|
|
|
|
|
|
// FOR DEBUG PURPOSE!
|
2006-06-03 15:07:26 +00:00
|
|
|
//int argc = 4;
|
2005-11-27 02:35:57 +00:00
|
|
|
//char *argv[] = { "scummvm", "-enull", "-pgp:\\game\\dott\\", "tentacle" };
|
2006-06-03 15:07:26 +00:00
|
|
|
//int argc = 2;
|
|
|
|
//char *argv[] = { "scummvm", "-d5" };
|
2005-11-27 02:35:57 +00:00
|
|
|
|
2006-04-07 11:37:46 +00:00
|
|
|
extern OSystem *OSystem_GP32_create();
|
|
|
|
g_system = OSystem_GP32_create();
|
2006-04-02 14:16:31 +00:00
|
|
|
assert(g_system);
|
|
|
|
|
2006-04-02 14:31:23 +00:00
|
|
|
// Invoke the actual ScummVM main entry point:
|
2006-04-07 10:38:06 +00:00
|
|
|
//int res = scummvm_main(argc, argv);
|
2006-04-02 14:31:23 +00:00
|
|
|
int res = scummvm_main(1, NULL);
|
2006-06-29 05:15:45 +00:00
|
|
|
|
|
|
|
extern void memChunkDeinit();
|
|
|
|
memChunkDeinit();
|
2006-06-29 09:17:04 +00:00
|
|
|
|
2006-04-02 14:31:23 +00:00
|
|
|
g_system->quit(); // TODO: Consider removing / replacing this!
|
2006-04-07 11:37:46 +00:00
|
|
|
|
|
|
|
//return res;
|
2005-11-27 02:35:57 +00:00
|
|
|
}
|