diff --git a/360/main.c b/360/main.c new file mode 100644 index 0000000000..4470fcd65d --- /dev/null +++ b/360/main.c @@ -0,0 +1,36 @@ +/* SSNES - A Super Nintendo Entertainment System (SNES) Emulator frontend for libsnes. + * Copyright (C) 2010-2011 - Hans-Kristian Arntzen + * Copyright (C) 2011 - Daniel De Matteis + * + * Some code herein may be based on code found in BSNES. + * + * SSNES 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * SSNES 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 SSNES. + * If not, see . + */ + +#include +#include + +int ssnes_main(int argc, char *argv[]); + +#undef main +// Temporary, a more sane implementation should go here. +int main(int argc, char *argv[]) +{ + char arg1[] = "ssnes"; + char arg2[] = "\\Device\\Harddisk0\\Partition\\roms\\mario.sfc"; + char arg3[] = "-v"; + char arg4[] = "-c"; + char arg5[] = "D:/roms/ssnes.cfg"; + char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL }; + return ssnes_main(sizeof(argv_) / sizeof(argv_[0]) - 1, argv_); +} + diff --git a/conf/config_file.c b/conf/config_file.c index ef805367ce..968ddd5d29 100644 --- a/conf/config_file.c +++ b/conf/config_file.c @@ -26,11 +26,13 @@ #include "../posix_string.h" #include "../msvc/msvc_compat.h" -#if !defined(_WIN32) && !defined(__CELLOS_LV2__) +#if !defined(_WIN32) && !defined(__CELLOS_LV2__) && !defined(_XBOX) #include // PATH_MAX -#elif defined(_WIN32) +#elif defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN #include +#elif defined(_XBOX) +#include #endif #ifndef PATH_MAX diff --git a/msvc-360/SSNES-360/SSNES-360.vcxproj b/msvc-360/SSNES-360/SSNES-360.vcxproj index 0d56eeda86..58ff5c585b 100644 --- a/msvc-360/SSNES-360/SSNES-360.vcxproj +++ b/msvc-360/SSNES-360/SSNES-360.vcxproj @@ -106,14 +106,17 @@ true false MultiThreadedDebug - _DEBUG;_XBOX;PACKAGE_VERSION="0.9.3";%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + _DEBUG;_XBOX;PACKAGE_VERSION="0.9.3";%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE Callcap true $(OutDir)$(ProjectName).pdb - xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;%(AdditionalDependencies) + xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;$(SolutionDir)\Debug\snes9x-next-360-msvc2010.lib;%(AdditionalDependencies) + + CopyToHardDrive + @@ -126,7 +129,7 @@ AnalyzeOnly false MultiThreadedDebug - _DEBUG;_XBOX;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + _DEBUG;_XBOX;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE Callcap @@ -147,7 +150,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE Callcap @@ -173,7 +176,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE true @@ -196,7 +199,7 @@ false false MultiThreaded - NDEBUG;_XBOX;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + NDEBUG;_XBOX;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE true @@ -204,8 +207,11 @@ true $(OutDir)$(ProjectName).pdb true - xapilib.lib;d3d9.lib;d3dx9.lib;xgraphics.lib;xboxkrnl.lib;xnet.lib;xaudio2.lib;xact3.lib;x3daudio.lib;xmcore.lib;vcomp.lib;%(AdditionalDependencies) + xapilib.lib;d3d9.lib;d3dx9.lib;xgraphics.lib;xboxkrnl.lib;xnet.lib;xaudio2.lib;xact3.lib;x3daudio.lib;xmcore.lib;vcomp.lib;$(SolutionDir)\Release\snes9x-next-360-msvc2010.lib;%(AdditionalDependencies) + + CopyToHardDrive + @@ -219,7 +225,7 @@ false false MultiThreaded - NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS + NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);PACKAGE_VERSION="0.9.3";_CRT_SECURE_NO_WARNINGS;main=ssnes_main;HAVE_CONFIGFILE true @@ -231,6 +237,7 @@ + @@ -242,6 +249,7 @@ true true + @@ -274,6 +282,7 @@ + diff --git a/msvc-360/SSNES-360/SSNES-360.vcxproj.filters b/msvc-360/SSNES-360/SSNES-360.vcxproj.filters index b51a0b92b0..ea36fd3e71 100644 --- a/msvc-360/SSNES-360/SSNES-360.vcxproj.filters +++ b/msvc-360/SSNES-360/SSNES-360.vcxproj.filters @@ -1,25 +1,31 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd - - {b9371e8d-2e72-4ced-8bf6-6ee6a77a1f78} - {740056e8-6476-4e8c-b9cb-767bebdb5c60} + + {747ac5fa-bd8a-4e60-9246-7a8fb0d38b85} + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {b9371e8d-2e72-4ced-8bf6-6ee6a77a1f78} + {c8038d65-499b-493b-80e9-90bd7c57383f} - - {747ac5fa-bd8a-4e60-9246-7a8fb0d38b85} + + {755ce6db-d242-40fb-9c8b-c14154fc94e1} + + + {82e8787f-e939-4783-82e1-fcab34285121} @@ -98,6 +104,12 @@ Source Files\360 + + Source Files\360 + + + Source Files\conf + @@ -181,5 +193,8 @@ Header Files\audio + + Header Files\conf + \ No newline at end of file diff --git a/ps3/main.c b/ps3/main.c index b3569b1335..6b59d5a790 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -38,4 +38,3 @@ int main(int argc, char *argv[]) char *argv_[] = { arg1, arg2, arg3, arg4, arg5, NULL }; return ssnes_main(sizeof(argv_) / sizeof(argv_[0]) - 1, argv_); } - diff --git a/ssnes.cfg b/ssnes.cfg deleted file mode 100644 index 141ae2c8c0..0000000000 --- a/ssnes.cfg +++ /dev/null @@ -1,335 +0,0 @@ -##### Config file for SSNES - -# Save all save files (*.srm) to this directory. This includes related files like .bsv, .rtc, .psrm, etc ... -# This will be overridden by explicit command line options. -# savefile_directory = - -# Save all save states (*.state) to this directory. -# This will be overridden by explicit command line options. -# savestate_directory = - -## If enabled, load libsnes from a dynamic location. -# libsnes_path = "/path/to/libsnes.so" - -#### Video - -# Video driver to use. "gl", "xvideo", "sdl" or "ext" (external API driver) -# video_driver = "gl" - -# Path to external video driver using the SSNES driver API. -# video_external_driver = - -# Windowed xscale and yscale -# (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale) -# video_xscale = 3.0 -# video_yscale = 3.0 - -# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. -# video_fullscreen_x = 0 -# video_fullscreen_y = 0 - -# Start in fullscreen. Can be changed at runtime. -# video_fullscreen = false - -# Force 16-bit colors. Apparently some video cards in use today have troubles with 32-bit ... -# video_force_16bit = false - -# Forcibly disable composition. Only works in Windows Vista/7 for now. -# video_disable_composition = false - -# Video vsync. -# video_vsync = true - -# Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders. -# video_smooth = true - -# Forces rendering area to stay equal to SNES aspect ratio 4:3 or as defined in video_aspect_ratio. -# video_force_aspect = true - -# A floating point value for video aspect ratio (width / height) -# video_aspect_ratio = 1.333 - -# Forces cropping of overscanned frames. Crops away top 7 scanlines and 8 bottom scanlines. (15/15 for interlaced frames). -# video_crop_overscan = false - -# Path to Cg shader. -# video_cg_shader = "/path/to/cg/shader.cg" - -# Path to bSNES XML shader (GLSL only). If both Cg shader path and XML shader path are defined, -# Cg shader will take priority unless overridden in video_shader_type. -# video_bsnes_shader = "/path/to/bsnes/xml/shader.shader" - -# Which shader type to use. Valid values are "cg", "bsnes", "none" and "auto" -# video_shader_type = auto - -# Defines a directory where XML shaders are kept. -# video_shader_dir = - -# Render to texture first. Useful when doing multi-pass shaders or control the output of shaders better. -# video_render_to_texture = false - -# Defines the video scale of render-to-texture. -# The output FBO size is scaled by these amounts against the input size (typically 256 * 224 for SNES). -# video_fbo_scale_x = 2.0 -# video_fbo_scale_y = 2.0 - -# Define shader to use for second pass (needs render-to-texture). -# video_second_pass_shader = "/path/to/second/shader.{cg,shader}" - -# Defines if bilinear filtering is used during second pass (needs render-to-texture). -# video_second_pass_smooth = true - -# CPU-based filter. Path to a bSNES CPU filter (*.filter) -# video_filter = - -# Path to a TTF font used for rendering messages. This path must be defined to enable fonts. -# Do note that the _full_ path of the font is necessary! -# video_font_path = - -# Size of the TTF font rendered. -# video_font_size = 48 - -# Enable usage of OSD messages. -# video_font_enable = true - -# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. -# [0.0, 0.0] maps to the lower left corner of the screen. -# video_message_pos_x = 0.05 -# video_message_pos_y = 0.05 - -# Color for message. The value is treated as a hexadecimal value. -# It is a regular RGB hex number, i.e. red is "ff0000". -# video_message_color = ffffff - -# Video refresh rate of your monitor. -# Used to calculate a suitable audio input rate. -# video_refresh_rate = 59.95 - -#### Audio - -# Enable audio. -# audio_enable = true - -# Audio output samplerate. -# audio_out_rate = 48000 - -# When altering audio_in_rate on-the-fly, define by how much each time. -# audio_rate_step = 0.25 - -# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio and ext (external driver). -# audio_driver = - -# Path to external audio driver using the SSNES audio driver API. -# audio_external_driver = - -# Override the default audio device the audio_driver uses. This is driver dependant. E.g. ALSA wants a PCM device, OSS wants a path (e.g. /dev/dsp), Jack wants portnames (e.g. system:playback1,system:playback_2), and so on ... -# audio_device = - -# External DSP plugin that processes audio before it's sent to the driver. -# audio_dsp_plugin = - -# Will sync (block) on audio. Recommended. -# audio_sync = true - -# Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. -# audio_latency = 64 - - -### Input - -# Input driver. Depending on video driver, it might force a different input driver. -# input_driver = sdl - -# Defines axis threshold. Possible values are [0.0, 1.0] -# input_axis_threshold = 0.5 - -# Keyboard input. Will recognize normal keypresses and special keys like "left", "right", and so on. -# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, -# rather than relying on a default. -# input_player1_a = x -# input_player1_b = z -# input_player1_y = a -# input_player1_x = s -# input_player1_start = enter -# input_player1_select = rshift -# input_player1_l = q -# input_player1_r = w -# input_player1_left = left -# input_player1_right = right -# input_player1_up = up -# input_player1_down = down - -# If desired, it is possible to override which joypads are being used for player 1 through 5. First joypad available is 0. -# input_player1_joypad_index = 0 -# input_player2_joypad_index = 1 -# input_player3_joypad_index = 2 -# input_player4_joypad_index = 3 -# input_player5_joypad_index = 4 - -# Joypad buttons. Figure these out by looking at jstest /dev/input/js0 output, or use ssnes-joyconfig. -# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. -# E.g. "h0up" -# input_player1_a_btn = 1 -# input_player1_b_btn = 0 -# input_player1_y_btn = 2 -# input_player1_x_btn = 3 -# input_player1_start_btn = 7 -# input_player1_select_btn = 6 -# input_player1_l_btn = 4 -# input_player1_r_btn = 5 -# input_player1_left_btn = 11 -# input_player1_right_btn = 12 -# input_player1_up_btn = 13 -# input_player1_down_btn = 14 - -# Axis for SNES DPAD. -# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. -# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. -# input_player1_left_axis = -0 -# input_player1_right_axis = +0 -# input_player1_up_axis = +1 -# input_player1_down_axis = -1 - -# Same stuff, just for player two. -# input_player2_a = -# input_player2_b = -# input_player2_y = -# input_player2_x = -# input_player2_start = -# input_player2_select = -# input_player2_l = -# input_player2_r = -# input_player2_left = -# input_player2_right = -# input_player2_up = -# input_player2_down = - -# input_player2_a_btn = 1 -# input_player2_b_btn = 0 -# input_player2_y_btn = 2 -# input_player2_x_btn = 3 -# input_player2_start_btn = 7 -# input_player2_select_btn = 6 -# input_player2_l_btn = 4 -# input_player2_r_btn = 5 -# input_player2_left_btn = 11 -# input_player2_right_btn = 12 -# input_player2_up_btn = 13 -# input_player2_down_btn = 14 - - -# input_player2_left_axis = -0 -# input_player2_right_axis = +0 -# input_player2_up_axis = -1 -# input_player2_down_axis = +1 - -# This goes all the way to player 5, but again omitted for clarity. - -# Toggles fullscreen. -# input_toggle_fullscreen = f -# Saves state. -# input_save_state = f2 -# Loads state. -# input_load_state = f4 - -# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline). -# When slot is != 0, path will be $path%d, where %d is slot number. -# input_state_slot_increase = f7 -# input_state_slot_decrease = f6 - -# Toggles between fast-forwarding and normal speed. -# input_toggle_fast_forward = space - -# Hold for fast-forward. Releasing button disables fast-forward. -# input_hold_fast_forward = l - -# Key to exit emulator cleanly. -# Killing it in any hard way (SIGTERM, SIGKILL, etc, will terminate emulator without saving RAM, etc.) -# input_exit_emulator = escape - -# Decrease/increase input sample rate on the fly. Amount to decrease/increase is defined by audio_rate_step. -# input_rate_step_up = kp_plus -# input_rate_step_down = kp_minus - -# Applies next and previous XML shader in directory. -# input_shader_next = m -# input_shader_prev = n - -# Enable rewinding. This will take a performance hit when playing, so it is disabled by default. -# Do note that rewinding will only work properly when using bSNES libsnes core atm. -# rewind_enable = false - -# Rewinding buffer size in megabytes. Bigger rewinding buffer means you can rewind longer. -# The buffer should be approx. 20MB per minute of buffer time. -# rewind_buffer_size = 20 - -# Rewind granularity. When rewinding defined number of frames, you can rewind several frames at a time, increasing the rewinding speed. -# rewind_granularity = 1 - -# Hold button down to rewind. Rewinding must be enabled. -# input_rewind = r - -# Toggle between recording and not. -# input_movie_record_toggle = o - -# Toggle between paused and non-paused state -# input_pause_toggle = p - -# Frame advance when game is paused -# input_frame_advance = k - -# Reset the emulated SNES. -# input_reset = h - -# Configures DSP plugin -# input_dsp_config = c - -# Pause gameplay when window focus is lost. -# pause_nonactive = true - -# Autosaves the non-volatile SRAM at a regular interval. This is disabled by default unless set otherwise. -# The interval is measured in seconds. A value of 0 disables autosave. -# autosave_interval = - -# When being client over netplay, use keybinds for player 1. -# netplay_client_swap_input = false - - -# Path to XML cheat database (as used by bSNES). -# cheat_database_path = - -# Path to XML cheat config, a file which keeps track of which -# cheat settings are used for individual games. -# If the file does not exist, it will be created. -# cheat_settings_path = - -# Cheats. -# input_cheat_index_plus = y -# input_cheat_index_minus = t -# input_cheat_toggle = u - -# Mute/unmute audio -# input_audio_mute = f9 - -# Take screenshot -# input_screenshot = print_screen - -# Directory to dump screenshots to. -# screenshot_directory = - -# Records video assuming video is hi-res. -# video_hires_record = false - -# Records video after CPU video filter. -# video_post_filter_record = false - -# Block SRAM from being overwritten when loading save states. -# Might potentially lead to buggy games. -# block_sram_overwrite = false - -# When saving a savestate, save state index is automatically increased before -# it is saved. -# Also, when loading a ROM, the index will be set to the highest existing index. -# There is no upper bound on the index. -# savestate_auto_index = false -