- // Get the cartridge ROM (if passed in)
- if (haveCart)
- {
- JaguarLoadCart(jaguar_mainRom, argv[1]);
- eeprom_init();
- }
-
- jaguar_reset();
-
- // Setting up the backbuffer
- int16 * backbuffer = (int16 *)malloc(845 * 525 * sizeof(int16));
- memset(backbuffer, 0xAA, tom_getVideoModeWidth() * tom_getVideoModeHeight() * sizeof(int16));
-
- // Setting up the primary SDL display
- surface = new Surface(tom_getVideoModeWidth(), tom_getVideoModeHeight(), format);
-
- // Initialize Joystick support under SDL
- if (console.JoyEnabled() == 1)
- {
- if (SDL_NumJoysticks() <= 0)
- {
- console.option("joystick disabled");
- printf("No joystick(s) or joypad(s) detected on your system. Using keyboard...\n");
- }
- else
- {
- if ((console.joystick = SDL_JoystickOpen(nJoyport)) == 0)
- {
- console.option("joystick disabled");
- printf("Unable to open a Joystick on port: %d\n", (int)nJoyport);
- }
- else
- printf("Using: %s\n", SDL_JoystickName(nJoyport));
- }
- }