From 95bf2b5468e12f6bae9c3d874db87efaf0bcc5e0 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Fri, 18 Oct 2002 01:38:01 +0000 Subject: Time stuff moved to its own file. Program invocation strategy reworked. svn-id: r5174 --- backends/dc/dcmain.cpp | 76 ++++++++++---------------------------------------- 1 file changed, 14 insertions(+), 62 deletions(-) (limited to 'backends') diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp index 77a0afa236..d576701cbb 100644 --- a/backends/dc/dcmain.cpp +++ b/backends/dc/dcmain.cpp @@ -20,18 +20,18 @@ * */ -#define RONIN_TIMER_ACCESS + +#define REAL_MAIN #include #include #include -#include #include "dc.h" #include "icon.h" Icon icon; - +const char *gGameName; OSystem *OSystem_Dreamcast_create() { return OSystem_Dreamcast::create(); @@ -105,6 +105,10 @@ uint32 OSystem_Dreamcast::property(int param, Property *value) case PROP_GET_SAMPLE_RATE: return 22050; + case PROP_SET_WINDOW_CAPTION: + gGameName = value->caption; + break; + } return 0; @@ -118,32 +122,6 @@ void *OSystem_Dreamcast::create_thread(ThreadProc *proc, void *param) { warning("Creating a thread! (not supported.)\n"); } -uint32 OSystem_Dreamcast::get_msecs() -{ - static uint32 msecs=0; - static unsigned int t0=0; - - unsigned int t = Timer(); - unsigned int dm, dt = t - t0; - - t0 = t; - dm = (dt << 6)/3125U; - dt -= (dm * 3125U)>>6; - t0 -= dt; - - return msecs += dm; -} - -void OSystem_Dreamcast::delay_msecs(uint msecs) -{ - get_msecs(); - unsigned int t, start = Timer(); - int time = (((unsigned int)msecs)*100000U)>>11; - while(((int)((t = Timer())-start))mouse.x, oldmousey = s->mouse.y; - time = (((unsigned int)time)*100000U)>>11; - int mask = getimask(); - while(((int)((t = Timer())-start))0) { - setimask(15); - checkSound(); - handleInput(locked_get_pads(), s->mouse.x, s->mouse.y, - s->_leftBtnPressed, s->_rightBtnPressed, s->_keyPressed); - setimask(mask); - devpoll += USEC_TO_TIMER(17000); - if(s->mouse.x != oldmousex || s->mouse.y != oldmousey) { - extern void updateScreen(Scumm *s); - updateScreen(s); - oldmousex = s->mouse.x; - oldmousey = s->mouse.y; - } - } -} -*/ - void dc_init_hardware(void) { #ifndef NOSERIAL @@ -211,17 +160,20 @@ void dc_init_hardware(void) init_arm(); } -int dc_setup(GameDetector &detector) +int main() { + extern int scumm_main(int argc, char *argv[]); + static char *argv[] = { "scummvm", NULL, NULL, NULL }; static int argc = 3; + dc_init_hardware(); initSound(); - if(!selectGame(&detector, argv[2], argv[1], icon)) + if(!selectGame(argv[2], argv[1], icon)) exit(0); - detector.parseCommandLine(argc, argv); + scumm_main(argc, argv); - return 0; + exit(0); } -- cgit v1.2.3