/* Written on 2004 by Bruno Vedder 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /***************************************************************************** * * File: main.cpp * * Project: Osmose emulator. * * Description: This file contains Osmose main loop, handling keyboard, SDL * event, and hardware emulation. * * Author: Vedder Bruno * Date: 28/10/2004, 13h00 * * URL: http://bcz.emu-france.com/ *****************************************************************************/ #include #include #include "OsmoseCore.h" #include "Options.h" #include "Version.h" #include "VideoFilterList.h" using namespace std; // Functions prototypes. void usage(); void parseCommandLine(int a, char *rv[]); void splashText(); Options opt; // SMS Machine related options. EmulatorOptions emu_opt; // Emulator related options. /*--------------------------------------------------------------------*/ /* This is the main method of osmose. It check args number, correct */ /* Emulator options, and start emulation is Ok. */ /*--------------------------------------------------------------------*/ int main(int argc,char *argv[]) { // Reset default options. emu_opt.reset(); opt.reset(); // Display Osmose version, author. splashText(); // Check arguments number. If not enough display usage. if (argc < 2) { usage(); exit(0); } // emu_opt will be corrected depending on cmd line. parseCommandLine(argc, argv); OsmoseCore core(argv[1]); core.run(); return 0; } /*--------------------------------------------------------------------*/ /* This method displays osmose usage. */ /*--------------------------------------------------------------------*/ void usage() { cout << "Usage is osmose filename, ex: osmose asterix.zip -fs -tv -nosound" << endl << endl; cout << "Options: "<< endl; cout << " -paddle emulates one axis paddle." << endl; cout << " -acceleration x.x paddle acceleration (0.1 to 5 default "<< DEFAULT_ACCELERATION << ")" << endl; cout << " -fs run in fullscreen (default: windowed)." << endl; cout << " -jap run as japanese sms (default: export)." << endl; cout << " -exp run as exported sms (default)." << endl; cout << " -nosound do not play sounds. (default: sound on)."<< endl; cout << " -cm codemaster games mem. mapper (EXPERIMENTAL default: off). " << endl; cout << " -dp use dark palette for screen emulation (default: off)." << endl; cout << " -inifile xxx use xxx as configuration file. " <