diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..3f524b0e --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,206 @@ +# vim: sts=2 sw=2 ai + +################################################################################ +# snes9x +################################################################################ + +snes9x_linux-gtk-amd64_task: + container: + image: gcc:latest + + setup_script: + - git submodule update --init --recursive + - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install meson gettext libsdl2-dev libgtkmm-3.0-dev libgtk-3-dev libminizip-dev portaudio19-dev glslang-dev + + compile_script: + - meson build gtk --buildtype=release --strip + - ninja -j2 -C build + + package_script: + - mkdir snes9x + - cp -ar build/snes9x-gtk README.md LICENSE docs data gtk/AUTHORS snes9x/ + - tar -caf "snes9x-gtk-${CIRRUS_CHANGE_IN_REPO}.txz" snes9x + + build_artifacts: + path: "snes9x-gtk-${CIRRUS_CHANGE_IN_REPO}.txz" + + +snes9x_linux-x11-amd64_task: + container: + image: gcc:latest + + setup_script: + - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install libxv-dev libxinerama-dev + + compile_script: + - cd unix + - touch configure + - ./configure + - make -j2 + + package_script: + - mkdir snes9x + - cp -ar unix/snes9x unix/docs unix/snes9x.conf.default README.md LICENSE data snes9x/ + - tar -caf "snes9x-x11-${CIRRUS_CHANGE_IN_REPO}.txz" snes9x + + build_artifacts: + path: "snes9x-x11-${CIRRUS_CHANGE_IN_REPO}.txz" + + +snes9x_freebsd-x11-amd64_task: + freebsd_instance: + image: freebsd-12-1-release-amd64 + + setup_script: + - pkg install -y gmake pkgconf minizip libX11 libXext + + compile_script: + - cd unix + - touch configure + - ./configure + - gmake -j2 + + package_script: + - mkdir snes9x + - cp -a unix/snes9x unix/docs unix/snes9x.conf.default README.md LICENSE data snes9x/ + - tar -caf "snes9x-x11-${CIRRUS_CHANGE_IN_REPO}.txz" snes9x + + build_artifacts: + path: "snes9x-x11-${CIRRUS_CHANGE_IN_REPO}.txz" + + +snes9x_macOS-amd64_task: + osx_instance: + image: mojave-xcode + + compile_script: + - xcodebuild -project macosx/snes9x.xcodeproj -target Snes9x -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + + package_script: + - mkdir snes9x + - cp -R macosx/build/Release/Snes9x.app macosx/docs README.md LICENSE snes9x/ + - zip -r "snes9x-${CIRRUS_CHANGE_IN_REPO}.zip" snes9x + + build_artifacts: + path: "snes9x-${CIRRUS_CHANGE_IN_REPO}.zip" + +################################################################################ +# libretro +################################################################################ + +libretro_linux-amd64_task: + container: + image: gcc:latest + compile_script: + - make -j2 -C libretro + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_linux-i386_task: + container: + image: dockcross/linux-x86 + compile_script: + - make -j2 -C libretro + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_linux-armhf_task: + container: + image: dockcross/linux-armv7 + compile_script: + - make -j2 -C libretro + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_linux-armv7-neon-hf_task: + container: + image: dockcross/linux-armv7 + compile_script: + - make -j2 -C libretro platform=unix-armv7-neon-hardfloat + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_linux-arm64_task: + container: + image: dockcross/linux-arm64 + compile_script: + - make -j2 -C libretro + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_android-arm_task: + container: + image: dockcross/android-arm + compile_script: + - make -j2 -C libretro platform=unix + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_android-arm64_task: + container: + image: dockcross/android-arm64 + compile_script: + - make -j2 -C libretro platform=unix-arm64 + build_artifacts: + path: "libretro/snes9x_libretro.so" + + +libretro_emscripten_task: + container: + image: gcc:latest + compile_script: + - make -j2 -C libretro platform=emscripten + build_artifacts: + path: "libretro/snes9x_libretro_emscripten.bc" + + +libretro_macOS-amd64_task: + osx_instance: + image: mojave-xcode + compile_script: + - make -j2 -C libretro + build_artifacts: + path: "libretro/snes9x_libretro.dylib" + + +libretro_nintendo-wii_task: + container: + image: devkitpro/devkitppc + compile_script: + - make -j2 -C libretro platform=wii + build_artifacts: + path: "libretro/snes9x_libretro_wii.a" + + +libretro_nintendo-switch-libnx_task: + container: + image: devkitpro/devkita64 + compile_script: + - make -j2 -C libretro platform=libnx + build_artifacts: + path: "libretro/snes9x_libretro_libnx.a" + + +libretro_nintendo-ngc_task: + container: + image: devkitpro/devkitppc + compile_script: + - make -j2 -C libretro platform=ngc + build_artifacts: + path: "libretro/snes9x_libretro_ngc.a" + + +libretro_playstation-psp_task: + container: + image: bkcsoft/psptoolchain + compile_script: + - make -j2 -C libretro platform=unix + build_artifacts: + path: "libretro/snes9x_libretro.so" + diff --git a/.gitignore b/.gitignore index f0cf4db1..b9ed61c2 100644 --- a/.gitignore +++ b/.gitignore @@ -495,3 +495,11 @@ healthchecksdb MigrationBackup/ # End of https://www.gitignore.io/api/c,c++,xcode,visualstudio + +# vim +*.swp + +# OS X temporary files +.DS_Store +*.lock +profile diff --git a/.gitmodules b/.gitmodules index 2e542f5b..b1a72f44 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,6 @@ [submodule "shaders/SPIRV-Cross"] path = shaders/SPIRV-Cross url = https://github.com/KhronosGroup/SPIRV-Cross.git -[submodule "win32/glslang/src"] - path = win32/glslang/src +[submodule "shaders/glslang"] + path = shaders/glslang url = https://github.com/KhronosGroup/glslang.git diff --git a/README.md b/README.md index 9014f5da..54b38fbc 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,58 @@ This is the official source code repository for the Snes9x project. Please check the [Wiki](https://github.com/snes9xgit/snes9x/wiki) for additional information. + +## Nightly builds + +Download nightly builds from continuous integration: + +### snes9x + +| OS | status | +|---------------|--------------------------------------------------| +| Windows | [![Status][s9x-win-all]][appveyor] | +| Linux (GTK) | [![Status][snes9x_linux-gtk-amd64]][cirrus-ci] | +| Linux (X11) | [![Status][snes9x_linux-x11-amd64]][cirrus-ci] | +| FreeBSD (X11) | [![Status][snes9x_freebsd-x11-amd64]][cirrus-ci] | +| macOS | [![Status][snes9x_macOS-amd64]][cirrus-ci] | + +[appveyor]: https://ci.appveyor.com/project/snes9x/snes9x +[cirrus-ci]: http://cirrus-ci.com/github/snes9xgit/snes9x + +[s9x-win-all]: https://ci.appveyor.com/api/projects/status/github/snes9xgit/snes9x?branch=master&svg=true +[snes9x_linux-gtk-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=snes9x_linux-gtk-amd64 +[snes9x_linux-x11-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=snes9x_linux-x11-amd64 +[snes9x_freebsd-x11-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=snes9x_freebsd-x11-amd64 +[snes9x_macOS-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=snes9x_macOS-amd64 + +### libretro core + +| OS | status | +|---------------------|---------------------------------------------------------| +| Linux/amd64 | [![Status][libretro_linux-amd64]][cirrus-ci] | +| Linux/i386 | [![Status][libretro_linux-i386]][cirrus-ci] | +| Linux/armhf | [![Status][libretro_linux-armhf]][cirrus-ci] | +| Linux/armv7-neon-hf | [![Status][libretro_linux-armv7-neon-hf]][cirrus-ci] | +| Linux/arm64 | [![Status][libretro_linux-arm64]][cirrus-ci] | +| Android/arm | [![Status][libretro_android-arm]][cirrus-ci] | +| Android/arm64 | [![Status][libretro_android-arm64]][cirrus-ci] | +| Emscripten | [![Status][libretro_emscripten]][cirrus-ci] | +| macOS/amd64 | [![Status][libretro_macOS-amd64]][cirrus-ci] | +| Nintendo Wii | [![Status][libretro_nintendo-wii]][cirrus-ci] | +| Nintendo Switch | [![Status][libretro_nintendo-switch-libnx]][cirrus-ci] | +| Nintendo GameCube | [![Status][libretro_nintendo-ngc]][cirrus-ci] | +| PSP | [![Status][libretro_playstation-psp]][cirrus-ci] | + +[libretro_linux-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_linux-amd64 +[libretro_linux-i386]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_linux-i386 +[libretro_linux-armhf]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_linux-armhf +[libretro_linux-armv7-neon-hf]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_linux-armv7-neon-hf +[libretro_linux-arm64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_linux-arm64 +[libretro_android-arm]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_android-arm +[libretro_android-arm64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_android-arm64 +[libretro_emscripten]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_emscripten +[libretro_macOS-amd64]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_macOS-amd64 +[libretro_nintendo-wii]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_nintendo-wii +[libretro_nintendo-switch-libnx]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_nintendo-switch-libnx +[libretro_nintendo-ngc]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_nintendo-ngc +[libretro_playstation-psp]: https://api.cirrus-ci.com/github/snes9xgit/snes9x.svg?task=libretro_playstation-psp diff --git a/appveyor.yml b/appveyor.yml index d5f6ea49..24ecd1b3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -43,8 +43,7 @@ build_script: - if "%config%"=="libretro Release" msbuild libretro\libretro-win32.vcxproj /t:build /p:Configuration="%config%";Platform="%platform%" /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" after_build: - - ps: $env:gitrev = git describe --tags - - ps: $env:my_version = "$env:gitrev" + - ps: $env:my_version = "$env:APPVEYOR_BUILD_VERSION-$($env:APPVEYOR_REPO_COMMIT.substring(0,7))" - set package_name=snes9x-%my_version%-%arch% - if exist artifacts rmdir /s /q artifacts - mkdir artifacts diff --git a/compat.cpp b/compat.cpp new file mode 100644 index 00000000..e03d3d83 --- /dev/null +++ b/compat.cpp @@ -0,0 +1,67 @@ +#include +#include "port.h" + +void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext) +{ + char *slash = strrchr((char *)path, SLASH_CHAR); + char *dot = strrchr((char *)path, '.'); + + *drive = '\0'; + + if (dot && slash && dot < slash) + { + dot = 0; + } + + if (!slash) + { + *dir = '\0'; + strcpy(fname, path); + + if (dot) + { + fname[dot - path] = '\0'; + strcpy(ext, dot + 1); + } + else + { + *ext = '\0'; + } + } + else + { + strcpy(dir, path); + dir[slash - path] = '\0'; + strcpy(fname, slash + 1); + + if (dot) + { + fname[(dot - slash) - 1] = '\0'; + strcpy(ext, dot + 1); + } + else + { + *ext = '\0'; + } + } +} + +void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext) +{ + if (dir && *dir) + { + strcpy(path, dir); + strcat(path, "/"); + } + else + *path = '\0'; + + strcat(path, fname); + + if (ext && *ext) + { + if (*ext != '.') + strcat(path, "."); + strcat(path, ext); + } +} diff --git a/conffile.cpp b/conffile.cpp index 5e121e2c..fa7de3fa 100644 --- a/conffile.cpp +++ b/conffile.cpp @@ -452,7 +452,7 @@ void ConfigFile::ClearLines() } } -bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const ConfigEntry &a, const ConfigEntry &b) const { +bool ConfigFile::ConfigEntry::section_then_key_less::operator()(const ConfigEntry &a, const ConfigEntry &b) const{ if(curConfigFile && a.section!=b.section){ const int sva = curConfigFile->GetSectionSize(a.section); const int svb = curConfigFile->GetSectionSize(b.section); diff --git a/conffile.h b/conffile.h index c09cea36..d92128cb 100644 --- a/conffile.h +++ b/conffile.h @@ -94,15 +94,15 @@ class ConfigFile { }; struct key_less { - bool operator()(const ConfigEntry &a, const ConfigEntry &b) const { + bool operator()(const ConfigEntry &a, const ConfigEntry &b) const{ if(a.section!=b.section) return a.sectioninternal)); + + #undef COPY + #define COPY(x) { memcpy((char *) s->internal_macs + i, &(x), sizeof(x)); i += sizeof(x); } + i = 0; + COPY(macsrifle.x); COPY(macsrifle.y); COPY(macsrifle.buttons); - assert(i == sizeof(s->internal) + sizeof(s->internal_macs)); + assert(i == sizeof(s->internal_macs)); #undef COPY @@ -3594,11 +3598,15 @@ void S9xControlPostLoadState (struct SControlSnapshot *s) if (s->ver > 3) { + #undef COPY + #define COPY(x) { memcpy(&(x), (char *) s->internal_macs + i, sizeof(x)); i += sizeof(x); } + i = 0; + COPY(macsrifle.x); COPY(macsrifle.y); COPY(macsrifle.buttons); - assert(i == sizeof(s->internal) + sizeof(s->internal_macs)); + assert(i == sizeof(s->internal_macs)); } #undef COPY diff --git a/display.h b/display.h index bafb5c83..a2f12670 100644 --- a/display.h +++ b/display.h @@ -40,7 +40,6 @@ void S9xInitDisplay (int, char **); void S9xDeinitDisplay (void); void S9xTextMode (void); void S9xGraphicsMode (void); -void S9xSetPalette (void); void S9xToggleSoundChannel (int); bool8 S9xOpenSnapshotFile (const char *, bool8, STREAM *); void S9xCloseSnapshotFile (STREAM); @@ -48,7 +47,6 @@ const char * S9xStringInput (const char *); const char * S9xGetDirectory (enum s9x_getdirtype); const char * S9xGetFilename (const char *, enum s9x_getdirtype); const char * S9xGetFilenameInc (const char *, enum s9x_getdirtype); -const char * S9xChooseFilename (bool8); const char * S9xBasename (const char *); // Routines the port has to implement if it uses command-line diff --git a/docs/porting.html b/docs/porting.html index cde540dd..86e5d12c 100644 --- a/docs/porting.html +++ b/docs/porting.html @@ -298,14 +298,6 @@

Called when Snes9x wants to know the directory dirtype.

-

const char *S9xChooseFilename (bool8 read_only)

-

- If your port can match Snes9x's built-in LoadFreezeFile/SaveFreezeFile command (see controls.cpp), you may choose to use this function. Otherwise return NULL. -

-

const char *S9xChooseMovieFilename (bool8 read_only)

-

- If your port can match Snes9x's built-in BeginRecordingMovie/LoadMovie command (see controls.cpp), you may choose to use this function. Otherwise return NULL. -

const char *S9xBasename (const char *path)

Called when Snes9x wants to know the name of the ROM image. Typically, extract the filename from path and return it. @@ -318,10 +310,6 @@

If your port can match Snes9x's built-in SoundChannelXXX command (see controls.cpp), you may choose to use this function. Otherwise return NULL. Basically, turn on/off the sound channel c (0-7), and turn on all channels if c is 8.

-

void S9xSetPalette (void)

-

- Called when the SNES color palette has changed. Use this function if your system needs to change its color palette to match the SNES's. Otherwise, leave it empty. -

void S9xSyncSpeed (void)

Called at the end of S9xMainLoop function, when emulating one frame has been done. You should adjust the frame rate in this function. diff --git a/gfx.cpp b/gfx.cpp index b7dbed71..bbeae228 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -221,7 +221,6 @@ void S9xEndScreenRefresh (void) { uint32 saved = PPU.CGDATA[0]; IPPU.ColorsChanged = FALSE; - S9xSetPalette(); PPU.CGDATA[0] = saved; } @@ -796,7 +795,7 @@ static void DrawOBJS (int D) BG.InterlaceLine = GFX.InterlaceFrame ? 8 : 0; GFX.Z1 = 2; int sprite_limit = (Settings.MaxSpriteTilesPerLine == 128) ? 128 : 32; - + for (uint32 Y = GFX.StartY, Offset = Y * GFX.PPL; Y <= GFX.EndY; Y++, Offset += GFX.PPL) { int I = 0; diff --git a/gfx.h b/gfx.h index 9b4f6d74..f4deca3b 100644 --- a/gfx.h +++ b/gfx.h @@ -216,7 +216,6 @@ bool8 S9xInitUpdate (void); bool8 S9xDeinitUpdate (int, int); bool8 S9xContinueUpdate (int, int); void S9xReRefresh (void); -void S9xSetPalette (void); void S9xSyncSpeed (void); // called instead of S9xDisplayString if set to non-NULL diff --git a/gtk/data/mini_icon.png b/gtk/data/mini_icon.png new file mode 100644 index 00000000..716ad923 Binary files /dev/null and b/gtk/data/mini_icon.png differ diff --git a/gtk/meson.build b/gtk/meson.build index 05f8d2e0..39df4ea2 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -1,13 +1,15 @@ project('snes9x-gtk', ['c', 'cpp'], version: '1.60', - default_options: ['cpp_std=c++11']) + meson_version: '>=0.46.0', + default_options: ['cpp_std=c++17']) args = ['-DSNES9X_GTK', '-DUNZIP_SUPPORT', '-DNETPLAY_SUPPORT', '-DJMA_SUPPORT', '-Wall', '-W', '-Wno-unused-parameter'] srcs = [] deps = [] includes = ['../apu/bapu', '../', 'src'] warns = [] +libs = [] prefix = get_option('prefix') localedir = join_paths(prefix, get_option('localedir')) @@ -23,12 +25,9 @@ args += [ '-DDATADIR="' + appdatadir + '"', '-DSNES9XLOCALEDIR="' + localedir + subdir('data') subdir('po') -glib_dep = dependency('glib-2.0', version: '> 2.28') -gthread_dep = dependency('gthread-2.0', version: '>= 2.6') -gobject_dep = dependency('gobject-2.0', version: '>= 2.6') sdl2_dep = dependency('sdl2') -deps += [ glib_dep, gthread_dep, gobject_dep, sdl2_dep ] +deps += sdl2_dep c_compiler = meson.get_compiler('c') @@ -36,18 +35,12 @@ if c_compiler.version().version_compare('>=7.0.0') and c_compiler.get_id() == 'g args += '-Wno-format-truncation' endif -if get_option('gtk3') and not get_option('gtk2') - message('Building with GTK+-3.0') - gtk_dep = dependency('gtk+-3.0', version: '>= 3.22') - gtk_ver = 3 -else - message('Building with GTK+-2.0') - gtk_dep = dependency('gtk+-2.0', version: '>= 2.16') - gtk_ver = 2 -endif - +gtk_dep = dependency('gtkmm-3.0', version: '>= 3.22') deps += gtk_dep +gthread_dep = dependency('gthread-2.0') +deps += gthread_dep + x11_dep = c_compiler.find_library('X11') xext_dep = c_compiler.find_library('Xext') dl_dep = c_compiler.find_library('dl') @@ -62,7 +55,7 @@ opengl = get_option('opengl') if opengl opengl_dep = dependency('epoxy', required: false) - if opengl_dep.found() + if opengl_dep.found() args += '-DUSE_OPENGL' srcs += [ 'src/gtk_display_driver_opengl.cpp', 'src/gtk_display_driver_opengl.h', @@ -79,52 +72,101 @@ if opengl endif slang = get_option('slang') - if slang and opengl - spirv_cross_hpp = join_paths(meson.source_root(), '../shaders/SPIRV-Cross/spirv_cross.hpp') - if not meson.get_compiler('cpp').compiles('#include "' + spirv_cross_hpp + '"') - slang = false - warns += 'Slang support needs the SPIRV-Cross directory in ../shaders' - warns += 'It can be downloaded with:' - warns += ' git submodule init ../shaders/SPIRV-Cross' - warns += ' git submodule update ../shaders/SPIRV-Cross' - endif -endif + glslang_args = ['-w', '-fno-exceptions', '-DNV_EXTENSIONS', '-DAMD_EXTENSIONS', '-DGLSLANG_OSINCLUDE_UNIX', '-DENABLE_OPT=0'] -if slang and opengl - glslang_dep = c_compiler.find_library('glslang', required: false) - spirv_dep = c_compiler.find_library('SPIRV', required: false) - osdependent_dep = c_compiler.find_library('OSDependent', required: false) - ogl_compiler_dep = c_compiler.find_library('OGLCompiler', required: false) - spv_remapper_dep = c_compiler.find_library('SPVRemapper', required: false) + OSDependent_src = ['../shaders/glslang/glslang/OSDependent/Unix/ossource.cpp'] + OSDependent_lib = static_library('OSDependent', + OSDependent_src, + include_directories: include_directories('../shaders/glslang'), + cpp_args: glslang_args) + libs += OSDependent_lib - if glslang_dep.found() and spirv_dep.found() and osdependent_dep.found() and ogl_compiler_dep.found() and spv_remapper_dep.found() - deps += [glslang_dep, spirv_dep, osdependent_dep, ogl_compiler_dep, spv_remapper_dep] + glslang_src = [ + '../shaders/glslang/glslang/MachineIndependent/glslang_tab.cpp', + '../shaders/glslang/glslang/MachineIndependent/attribute.cpp', + '../shaders/glslang/glslang/MachineIndependent/Constant.cpp', + '../shaders/glslang/glslang/MachineIndependent/iomapper.cpp', + '../shaders/glslang/glslang/MachineIndependent/InfoSink.cpp', + '../shaders/glslang/glslang/MachineIndependent/Initialize.cpp', + '../shaders/glslang/glslang/MachineIndependent/IntermTraverse.cpp', + '../shaders/glslang/glslang/MachineIndependent/Intermediate.cpp', + '../shaders/glslang/glslang/MachineIndependent/ParseContextBase.cpp', + '../shaders/glslang/glslang/MachineIndependent/ParseHelper.cpp', + '../shaders/glslang/glslang/MachineIndependent/PoolAlloc.cpp', + '../shaders/glslang/glslang/MachineIndependent/RemoveTree.cpp', + '../shaders/glslang/glslang/MachineIndependent/Scan.cpp', + '../shaders/glslang/glslang/MachineIndependent/ShaderLang.cpp', + '../shaders/glslang/glslang/MachineIndependent/SymbolTable.cpp', + '../shaders/glslang/glslang/MachineIndependent/Versions.cpp', + '../shaders/glslang/glslang/MachineIndependent/intermOut.cpp', + '../shaders/glslang/glslang/MachineIndependent/limits.cpp', + '../shaders/glslang/glslang/MachineIndependent/linkValidate.cpp', + '../shaders/glslang/glslang/MachineIndependent/parseConst.cpp', + '../shaders/glslang/glslang/MachineIndependent/reflection.cpp', + '../shaders/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp', + '../shaders/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp', + '../shaders/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp', + '../shaders/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp', + '../shaders/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp', + '../shaders/glslang/glslang/MachineIndependent/propagateNoContraction.cpp', + '../shaders/glslang/glslang/GenericCodeGen/CodeGen.cpp', + '../shaders/glslang/glslang/GenericCodeGen/Link.cpp', + '../shaders/glslang/StandAlone/ResourceLimits.cpp' + ] - args += ['-DUSE_SLANG', '-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS'] - srcs += ['../shaders/slang.cpp'] - srcs += ['../shaders/SPIRV-Cross/spirv_cfg.cpp', - '../shaders/SPIRV-Cross/spirv_cfg.hpp', - '../shaders/SPIRV-Cross/spirv_common.hpp', - '../shaders/SPIRV-Cross/spirv_cross.cpp', - '../shaders/SPIRV-Cross/spirv_cross.hpp', - '../shaders/SPIRV-Cross/spirv_glsl.cpp', - '../shaders/SPIRV-Cross/spirv_glsl.hpp', - '../shaders/SPIRV-Cross/spirv_cross_parsed_ir.cpp', - '../shaders/SPIRV-Cross/spirv_cross_parsed_ir.hpp', - '../shaders/SPIRV-Cross/spirv_parser.cpp', - '../shaders/SPIRV-Cross/spirv_parser.hpp', - '../shaders/SPIRV-Cross/spirv.hpp'] - else - slang = false - warns += 'glslang libraries not found. Slang shaders will be disabled.' - endif + glslang_lib = static_library('glslang', + glslang_src, + include_directories: include_directories('../shaders/glslang'), + cpp_args: glslang_args) + libs += glslang_lib + + OGLCompilersDLL_src = ['../shaders/glslang/OGLCompilersDLL/InitializeDll.cpp'] + OGLCompilersDLL_lib = static_library('OGLCompilersDLL', + OGLCompilersDLL_src, + include_directories: include_directories('../shaders/glslang'), + cpp_args: glslang_args) + libs += OGLCompilersDLL_lib + + SPIRV_src = [ + '../shaders/glslang/SPIRV/GlslangToSpv.cpp', + '../shaders/glslang/SPIRV/InReadableOrder.cpp', + '../shaders/glslang/SPIRV/Logger.cpp', + '../shaders/glslang/SPIRV/SpvBuilder.cpp', + '../shaders/glslang/SPIRV/SpvPostProcess.cpp', + '../shaders/glslang/SPIRV/SpvTools.cpp', + '../shaders/glslang/SPIRV/disassemble.cpp', + '../shaders/glslang/SPIRV/SPVRemapper.cpp', + '../shaders/glslang/SPIRV/doc.cpp' + ] + SPIRV_lib = static_library('SPIRV', + SPIRV_src, + include_directories: include_directories('../shaders/glslang'), + cpp_args: glslang_args) + libs += SPIRV_lib + + args += ['-DUSE_SLANG', + '-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS'] + srcs += ['../shaders/slang.cpp'] + srcs += ['../shaders/SPIRV-Cross/spirv_cfg.cpp', + '../shaders/SPIRV-Cross/spirv_cfg.hpp', + '../shaders/SPIRV-Cross/spirv_common.hpp', + '../shaders/SPIRV-Cross/spirv_cross.cpp', + '../shaders/SPIRV-Cross/spirv_cross.hpp', + '../shaders/SPIRV-Cross/spirv_glsl.cpp', + '../shaders/SPIRV-Cross/spirv_glsl.hpp', + '../shaders/SPIRV-Cross/spirv_cross_parsed_ir.cpp', + '../shaders/SPIRV-Cross/spirv_cross_parsed_ir.hpp', + '../shaders/SPIRV-Cross/spirv_parser.cpp', + '../shaders/SPIRV-Cross/spirv_parser.hpp', + '../shaders/SPIRV-Cross/spirv.hpp'] + includes += '../shaders/glslang' endif wayland = get_option('wayland') -if wayland and gtk_ver == 3 +if wayland wayland_dep = dependency('wayland-egl', required: false) - + if wayland_dep.found() args += '-DUSE_WAYLAND' srcs += ['src/gtk_wayland_egl_context.cpp', 'src/gtk_wayland_egl_context.h'] @@ -138,7 +180,7 @@ endif xv = get_option('xv') if xv xv_dep = dependency('xv', required: false) - + if xv_dep.found() args += '-DUSE_XV' srcs += ['src/gtk_display_driver_xv.cpp', 'src/gtk_display_driver_xv.h'] @@ -152,7 +194,7 @@ endif portaudio = get_option('portaudio') if portaudio portaudio_dep = dependency('portaudio-2.0', version: '>= 10', required: false) - + if portaudio_dep.found() args += '-DUSE_PORTAUDIO' srcs += ['src/gtk_sound_driver_portaudio.cpp', 'src/gtk_sound_driver_portaudio.h'] @@ -177,7 +219,7 @@ endif alsa = get_option('alsa') if alsa alsa_dep = dependency('alsa', required: false) - + if alsa_dep.found() args += '-DUSE_ALSA' srcs += ['src/gtk_sound_driver_alsa.cpp', 'src/gtk_sound_driver_alsa.h'] @@ -191,7 +233,7 @@ endif pulseaudio = get_option('pulseaudio') if pulseaudio pulseaudio_dep = dependency('libpulse', required: false) - + if pulseaudio_dep.found() args += '-DUSE_PULSEAUDIO' srcs += ['src/gtk_sound_driver_pulse.cpp', 'src/gtk_sound_driver_pulse.h'] @@ -225,7 +267,7 @@ else includes += '../unzip' srcs += ['../unzip/unzip.c', '../unzip/ioapi.c', '../unzip/zip.c'] endif - + zlib = get_option('zlib') if zlib zlib_dep = dependency('zlib', required: false) @@ -317,7 +359,7 @@ srcs += [ '../filter/snes_ntsc.h', '../filter/snes_ntsc_impl.h', '../filter/snes_ntsc.c', - 'src/gtk_2_3_compat.h', + 'src/gtk_compat.h', 'src/gtk_sound_driver_sdl.h', 'src/gtk_sound_driver_sdl.cpp', '../fxinst.cpp', @@ -379,10 +421,13 @@ srcs += [ '../netplay.cpp', '../server.cpp', '../loadzip.cpp', + '../compat.cpp', 'src/gtk_netplay_dialog.cpp', 'src/gtk_netplay_dialog.h', 'src/gtk_netplay.cpp', - 'src/gtk_netplay.h' + 'src/gtk_netplay.h', + 'src/background_particles.cpp', + 'src/background_particles.h' ] libjma_srcs = [ @@ -397,26 +442,33 @@ libjma_srcs = [ '../jma/winout.cpp' ] -libjma = static_library('jma', - libjma_srcs, - c_args: args, - cpp_args: [args, '-fexceptions'], +libjma = static_library('jma', + libjma_srcs, + c_args: args, + cpp_args: args, include_directories: include_directories(includes)) +libs += libjma sourcify = executable('sourcify', 'src/sourcify.c', native: true) -gtk_snes9x_ui_cpp = custom_target('sourcify', - input: 'src/snes9x.ui', +gtk_snes9x_ui_cpp = custom_target('sourcify', + input: 'src/snes9x.ui', output: 'gtk_snes9x_ui.cpp', command: [sourcify, '@INPUT@', '@OUTPUT@', 'snes9x_ui']) -snes9x_gtk = executable('snes9x-gtk', - srcs, +mini_icon = custom_target('mini_icon', + input: 'data/mini_icon.png', + output: 'mini_icon.cpp', + command: [sourcify, '@INPUT@', '@OUTPUT@', 'mini_icon']) + +snes9x_gtk = executable('snes9x-gtk', + srcs, gtk_snes9x_ui_cpp, - c_args: args, - cpp_args: [args, '-fno-exceptions', '-fno-rtti'], + mini_icon, + c_args: args, + cpp_args: args, dependencies: deps, include_directories: include_directories(includes), - link_with: libjma, + link_with: libs, install: true) summary = [ @@ -426,7 +478,6 @@ summary = [ ' appdatadir: ' + appdatadir, ' localedir: ' + localedir, '[Options] Build type: ' + get_option('buildtype'), - ' GTK+ version: ' + gtk_ver.to_string(), ' Wayland: ' + wayland.to_string(), ' OpenGL: ' + opengl.to_string(), ' slang shaders: ' + slang.to_string(), diff --git a/gtk/meson_options.txt b/gtk/meson_options.txt index b458b3b5..2f6a7964 100644 --- a/gtk/meson_options.txt +++ b/gtk/meson_options.txt @@ -11,8 +11,6 @@ option('xbrz', type: 'boolean', value: true, description: 'Enable th option('zlib', type: 'boolean', value: true, description: 'Enable gzip compression') option('system-zip', type: 'boolean', value: true, description: 'Build using system minizip library') option('screenshot', type: 'boolean', value: true, description: 'Enable screenshots') -option('gtk3', type: 'boolean', value: true, description: 'Build with GTK+ 3.0 as the toolkit') option('wayland', type: 'boolean', value: true, description: 'Build support for Wayland') -option('gtk2', type: 'boolean', value: false, description: 'Build with GTK+ 2.0 as the toolkit') option('dangerous-hacks', type: 'boolean', value: false, description: 'Allow dangerous hacks to be enabled') option('appdatadir', type: 'string' , value: '', description: 'Snes9x-only data directory (default: datadir/snes9x)') diff --git a/gtk/po/LINGUAS b/gtk/po/LINGUAS index b8fb87be..e2172561 100644 --- a/gtk/po/LINGUAS +++ b/gtk/po/LINGUAS @@ -6,3 +6,4 @@ ja pt_BR ru sr@latin +zh_CN diff --git a/gtk/po/es.po b/gtk/po/es.po index c9c962c9..1460a9a5 100644 --- a/gtk/po/es.po +++ b/gtk/po/es.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: Snes9x\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" -"PO-Revision-Date: 2019-07-17 17:44-0400\n" -"Last-Translator: Pablo \"Jota\" Lezaeta Reyes \n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" +"PO-Revision-Date: 2020-06-12 02:49-0400\n" +"Last-Translator: Pablo \"Jota\" Lezaeta \n" "Language-Team: Spanish / Español\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Snes9x-gtk: 1.5.2\n" -"X-Generator: Poedit 2.2.1\n" +"X-Generator: Poedit 2.3.1\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-Basepath: ../..\n" @@ -246,7 +246,7 @@ msgid "SNES Movies" msgstr "Vídeos SNES" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 msgid "All Files" msgstr "Todos los archivos" @@ -259,7 +259,7 @@ msgstr "No puedo cargar el archivo «%s»" msgid "Load Saved State" msgstr "Cargar estado guardado" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "Estados guardados" @@ -355,14 +355,14 @@ msgid "Shader Preset" msgstr "Sombra preconfigurada" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "Parámetros de sombra GLSL" +msgid "Shader Parameters" +msgstr "Parametros de sombras..." -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 msgid "Open SNES ROM Image" msgstr "Abrir imagen ROM" -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 msgid "SNES ROM Images" msgstr "Imagenes SNES" @@ -428,497 +428,505 @@ msgstr "Diseños de píxeles" #: src/snes9x.ui:821 msgid "Dithered gradient" -msgstr "Gradiente azul" +msgstr "Degradado azul" #: src/snes9x.ui:824 msgid "Color bars and patterns" msgstr "Barras de colores y diseños" -#: src/snes9x.ui:835 +#: src/snes9x.ui:827 +msgid "Starfield" +msgstr "Campo de estrellas" + +#: src/snes9x.ui:830 +msgid "Snow" +msgstr "Nieve" + +#: src/snes9x.ui:841 msgid "Game Genie" msgstr "Game Genie" -#: src/snes9x.ui:838 +#: src/snes9x.ui:844 msgid "Pro Action Replay" msgstr "Pro Action Replay" -#: src/snes9x.ui:841 +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "Goldfinger" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "12,5 %" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "25 %" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "50 %" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "100 %" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "0 %" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "Nada" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 msgid "SuperEagle" msgstr "Superáguila" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "2xSai" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "Super2xSai" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "EPX" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "EPX suave" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "NTSC de Blargg" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 msgid "Scanlines" msgstr "Líneas de escaneado" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "Simple 2x" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "Simple 3x" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "Simple 4x" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "8:7 píxeles cuadrados" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 msgid "8:7 Square pixels, integer multiples" msgstr "8:7 píxeles cuadrados, múltiplos enteros" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 msgid "4:3 SNES correct aspect" msgstr "4:3 aspecto del SNES" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 msgid "4:3 SNES correct aspect, integer multiples" msgstr "4:3 aspecto del SNES, múltiplos enteros" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "8*8:7*7 NTSC" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "8*8:7*7 NTSC, múltiplos enteros" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "Mezclar pares adyacentes" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "Salida directa" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "Escalar pantallas de baja resolución" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 msgid "1" msgstr "1" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 msgid "2" msgstr "2" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 msgid "3" msgstr "3" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 msgid "4" msgstr "4" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 msgid "5" msgstr "5" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "1 +" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "2 +" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "3 +" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "4 +" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "5 +" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 msgid "Toggle the menu bar" msgstr "Activa o desactiva la barra de menú" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 msgid "Exit fullscreen mode" msgstr "Salir del modo pantalla completa" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Salir de Snes9x" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "Basado en temporizador" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "Basado en temporizador con omisión automática de cuadros" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "Sincronización de búfer de sonido" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "Sin regulación, pero puede usar vsync para controlar la velocidad" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "48.000 hz" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "44.100 hz" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 msgid "32000 hz" msgstr "32.000 hz" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "22.050 hz" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "16.000 hz" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "11.025 hz" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "8.000 hz" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "0 hz" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "16 bits (GL_RGB)" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "32 bits (GL_BGRA)" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "Punto" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "Lineal" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "Gaussian (correcto)" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "Cubic" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "Sinc" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "Snes9x" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "Arc_hivo" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 msgid "_Open ROM Image..." msgstr "Abrir imagen R_OM..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "Abrir reciente" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "Abrir con juego e_n red..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "Abrir la ROM para usar con juego en red" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 msgid "Open _MultiCart..." msgstr "Abrir _multicartucho..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "_Cargar estado" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "Ranura _0" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "Ranura _1" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "Ranura _2" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "Ranura _3" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "Ranura _4" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "Ranura _5" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "Ranura _6" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "Ranura _7" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "Ranura _8" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 msgid "Slot _9" msgstr "Ranura _9" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "Desde de un arc_hivo..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 msgid "_Undo Load State" msgstr "_Deshacer guardado de estado" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "_Guardar estado" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "En un archi_vo..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "Guardar SPC..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "Mostrar _infomación de la ROM..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "_Salir" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "_Emulación" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "Correr / _Continuar" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "_Pausar" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "Cargar _vídeo..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "Grabar víd_eo..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "_Detener grabación" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "_Ir al cuadro..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "Si_ncronizar clientes" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "Reiniciar" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "_Reinicio suave" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "_Ver" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 msgid "_Toggle Menubar" msgstr "Activa o desactiva la barra de menú" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "_Cambiar tamaño" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "_1x" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "_2x" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "_3x" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "_4x" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "_5x" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "_Pantalla completa" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "_Opciones" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "Control de mandos" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "Mando SNES 1" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "Mando" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "Ratón" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "Súper Escopeta Nintendo" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "Mando SNES 2" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "Toques múltiples" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "_Trucos..." -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "Parametro_s de sombras..." -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "_Preferencias..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "Abrir múltiples imágenes ROM (multicartucho)" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 msgid "Slot A:" msgstr "Ranura A:" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "Seleccione una imagen para la ranura A" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 msgid "Slot B:" msgstr "Ranura B:" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "Seleccione una imagen para la ranura B" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Juego en red de Snes9x" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -926,50 +934,50 @@ msgstr "" "El juego seleccionado será cargado antes de conectarse. Este campo debe " "estar en blanco si el servidor envía la ROM" -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "Explorar..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "Limpiar entrada" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "Imagen ROM" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "Conectar a otro equipo" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "" "Conectar a otro equipo que este ejecutando el juego en red de Snes9x como " "servidor" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "Nombre o dirección IP:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "Nombre de dominio o dirección IP del equipo remoto" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "Puerto:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "Conectar al puerto TCP especifico de un equipo remoto" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "Ser un servidor" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -977,15 +985,15 @@ msgstr "" "Ser el anfitrión del juego como el jugador 1, requiere salidas extras para " "soportar múltiples clientes" -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "Servidor" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "Sincronizar usando reiniciar" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" @@ -993,11 +1001,11 @@ msgstr "" "Reiniciar el juego cuando los jugadores se unan en lugar de transferir " "estados de congelación potencialmente poco fiables" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "Enviar imagen ROM a los clientes" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -1005,199 +1013,199 @@ msgstr "" "Enviar el juego actual a los jugadores en lugar de exigir que ellos tengan " "sus propias copias" -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "Puerto estándar:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "El puerto TCP usado como punto de conexión para clientes remotos" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "Preguntar al servidor cuando pausar" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "cuadros de retraso" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "Configuraciones" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Configuración de Snes9x" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "Usar la pantalla completa al abrir una imagen ROM" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "Ir a pantalla completa inmediatamente tras abrir una ROM" -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 msgid "Show local time" msgstr "Mostrar tiempo local" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "Mostrar cuadros por segundo" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "Mostrar teclas pulsadas" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "Usar altura sobrescaneada" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "Usar altura extendida del SNES. Esto podría causar bordes negros" -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "Cambiar la resolución a pantalla completa:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "Cambiar la resolución cuando se ejecute Snes9x a pantalla completa" -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 msgid "Basic Settings" msgstr "Configuraciones básicas" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "Ajustar la imagen hasta encajar en la ventana" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "Ajustar la imagen hasta que los bordes negros desaparezcan" -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 msgid "Aspect ratio:" msgstr "Relación de aspecto:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 msgid "Maintain aspect-ratio" msgstr "Mantener la relación de aspecto" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "Ajusta la imagen lo más grande posible sin distorcionarla" -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "Usar " -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "Permitir el uso de múltiples hilos de procesos para ajuste y filtrado" -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "hilos para filtrar y ajustar" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "Efectos de alta resolución:" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "Aplicar ajustes de filtros:" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 msgid "Video preset:" msgstr "Predeterminados del vídeo:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 msgid "Composite" msgstr "Composición" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 msgid "S-Video" msgstr "S-Video" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "RVA (RGB)" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "Monócromo" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 msgid "Artifacts:" msgstr "Artefactos:" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "Nitidez:" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "Brillo:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "Contraste:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "Saturación:" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "Matiz:" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "Gama:" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "Margen:" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "Purga:" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 msgid "Resolution:" msgstr "Resolución:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "Mezclar los campos pares e impares" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "Intensidad de líneas de escaneado:" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "Lineas de escaneado" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "Salida con filtro bilinear" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "Sincronizar con blanco vertical" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "Sincronizar la imagen con el refresco vertical para evitar el desgarro" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 msgid "Reduce input lag with glFinish" msgstr "Reducir el retraso de entrada con glFinish" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" @@ -1205,11 +1213,11 @@ msgstr "" "Sincronizar el programa con la salida de vídeo después de cada cuadro " "mostrado para reducir la latencia de entrada" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 msgid "Reduce input lag with sync control" msgstr "Reducir el retraso de entrada con sync_control" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 msgid "" "More modern method for syncing the program with the video output to reduce " "input latency. Allows GUI events to occur in the meantime" @@ -1218,39 +1226,39 @@ msgstr "" "mostrado para reducir la latencia de entrada, pero permite que ocurran " "eventos de GUI mientras tanto" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "Permitir texturas que no sean múltiplos de dos" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "Previene artefactos en los bordes, pero puede disminuir el rendimiento" -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "Usar objetos del búfer de píxeles" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "Puede ser más rápido o más lento dependiendo de los controladores" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "Diferentes formatos pueden producir rendimientos muy diferentes" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "Formato del búfer de píxeles:" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 msgid "Shader:" msgstr "Sombras:" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "Fuerza una orden de bytes invertido" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" @@ -1258,73 +1266,75 @@ msgstr "" "Fuerza un orden de bytes intercambiado para los casos en que se utiliza " "endian del sistema en lugar del de la tarjeta de vídeo" -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 msgid "Hardware Acceleration" msgstr "Aceleración por hardware" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "Pantalla" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "Controlador de sonido:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "Ajustar automáticamente la tasa de entrada a mostrar" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" "Establece la velocidad de entrada correcta en función de la frecuencia de " "actualización de la pantalla" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "Control de velocidad dinámica" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "Suavizar los pequeños contratiempos en la tasa de entrada de sonido" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "Silenciar la salida de sonido" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "Desactivar la salida de sonido" -#: src/snes9x.ui:4200 -msgid "Mute sound when using turbo" +#: src/snes9x.ui:4206 +#, fuzzy +msgid "Mute sound when using turbo or rewind" msgstr "Silenciar el sonido cuando se esté en turbo" -#: src/snes9x.ui:4204 -msgid "Disables output of sound when using turbo" +#: src/snes9x.ui:4210 +#, fuzzy +msgid "Disables output of sound when using turbo or rewind" msgstr "Deshabilitar la salida de sonido cuando se esté en turbo" -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "Velocidad de reproducción:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "milisegundos" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "Tamaño del búfer:" -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "Límite de velocidad dinámica:" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "Tasa de entrada:" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " @@ -1334,47 +1344,47 @@ msgstr "" "chisporroteo. Aumentar la tasa si experimentar tartamudeo en la velocidad de " "los cuadros por segundo. Mejor usa con la opción «Sincronizar con sonido»" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 msgid "Video rate:" msgstr "Tasa de refresco del vídeo:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "etiqueta" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "Configuraciones del sonido" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "Sonido" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" -msgstr "Método de regulación" +msgstr "Método de regulación:" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 msgid "Speed Control" msgstr "Control de Velocidad" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 msgid "Rewind buffer size (MB):" msgstr "Tamaño del búfer de rebobinado (MB):" -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "Número de cuadros entre instantáneas rebobinadas:" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 msgid "Rewind Settings" msgstr "Configuración Rebobinado" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 msgid "Allow invalid VRAM access" msgstr "Permitir accesos no validos a la VRAM" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" @@ -1382,91 +1392,91 @@ msgstr "" "Permite que los ROM hackeadas escriban en la pantalla en el momento " "equivocado. Úselo solo si sabe que su ROM hackeada espera que esto pase" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "Permitir direcciones opuestas en el mando" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "" "Permitir que izquierda y derecha o arriba y abajo puedan ser pulsados al " "mismo tiempo" -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "Overclock CPU" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "Reduce la ralentización, pero tiene potencial para romper juegos" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "Eliminar el límite de sprite" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "Reduce el parpadeo, pero puede causar artefactos gráficos" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "Redireccionar el eco de desbordamiento de búfer" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" "Permite que funcionen los viejos hacks de addmusic, pero es probable que " "dañen otros juegos" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "Velocidad de reloj SuperFX %:" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "Gaussian es el comportamiento correcto del SNES" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 msgid "Sound filter:" msgstr "Interpolación sonido:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 msgid "Hacks" msgstr "Hacks" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "Emulación" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 msgid "SRAM:" msgstr "SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 msgid "Save states:" msgstr "Estados guardados:" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 msgid "Cheats:" msgstr "Trucos:" -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "Parches:" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "Exportaciones:" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 msgid "Game Data Locations" msgstr "Ubicación de los datos del juego" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "Guardar SRAM:" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1474,144 +1484,144 @@ msgstr "" "Guardar automáticamente la SRAM del juego en este intervalo. Al establecerla " "en 0 solamente cuando se cambie o finalize la ROM" -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "segundos después del cambiar" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 msgid "Automatic Saving" msgstr "Guardado automático" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "Archivos" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "Mando:" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "_Reiniciar" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "Intercambiar con:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "_Intercambiar" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "Usar las teclas modificadoras (CTL, Mayús, ALT) directamente" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "" "Permitir usa las teclas modificadoras como teclas independientes en lugar de " "modificadoras" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "Arriba" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "Abajo" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "Izquierda" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "Derecha" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "Start" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "Select" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "A" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "B" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "X" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "Y" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "L" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "R" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "Botones" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "Pegajoso" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "Turbo" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "Turbo / Botones pegajosos" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "Establecer nuevos enlaces de ejes en:" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "" "Cambia la cantidad que un mando debe estar inclinado para registrar una " "pulsación del botón" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "por ciento" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "Umbral del eje del mando" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "Centre todos los ejes de todas las palancas de mando y pulse Calibrar." -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "Cali_brar" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "Calibración" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "Opciones del mando" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" @@ -1621,271 +1631,271 @@ msgstr "" "Escape: Pasa al siguiente Mayús-Escape: Borrar el " "seleccionado" -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "Mandos" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "Atajos de teclado del emulador Snes9x" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "Reinicio suave" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "Reinicio por hardware" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "Aumentar los tiempos de los cuadros" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "Disminuir los tiempos de los cuadros" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "Aumentar los cuadros por segundo" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "Disminuir los cuadros por segundo" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "Pausa" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "Alternar turbo" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "Activar Turbo" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "Abrir ROM" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "Alternar capa de fondo 0" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "Alternar capa de fondo 1" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "Alternar capa de fondo 2" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "Alternar capa de fondo 3" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "Alternar «sprites»" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "Hack de capas de fondo" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "Captura de pantalla" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "Alternar pantalla completa" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "Gráficos" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "Guardar ranura actual" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "Cargar ranura actual" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "Incremento y guardado" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "Decremento y carga" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "Incrementar ranura" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "Decrementar ranura" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "Guardado rápido de estado" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "Carga rápida de estado" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "Ranura 0" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "Ranura 1" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "Ranura 2" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "Ranura 3" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "Ranura 4" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "Ranura 5" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "Ranura 6" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "Ranura 7" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "Ranura 8" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 msgid "Slot 9" msgstr "Ranura 9" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "Alternar canal de sonido 0" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "Alternar canal de sonido 1" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "Alternar canal de sonido 2" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "Alternar canal de sonido 3" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "Alternar canal de sonido 4" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "Alternar canal de sonido 5" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "Alternar canal de sonido 6" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "Alternar canal de sonido 7" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "Alternar todos los canales de sonido" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "Tratar de enmarcar" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "Cargar vídeo" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "Detener grabación de vídeo" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "Iniciar grabación de vídeo" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "Guardar SPC" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "Intercambiar controles 1 y 2" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "Rebobinar" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "Capturar/Soltar el ratón" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "Varios" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "Atajos" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "Pausar la emulación cuando el foco no esté en Snes9x" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "Mostrar iconos en menús y botones" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "La tecla ESC permite:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "Pantalla inicial:" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 msgid "Window Behavior" msgstr "Comportamiento de la Ventana" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "Prevenir que el protector de pantalla se active" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "Protector de pantalla" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" -msgstr "UI" +msgstr "IU" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" @@ -1950,6 +1960,9 @@ msgstr "" " Super NES y Super Nintendo Entertainment System son marcas comerciales de\n" " Nintendo Co., Limited y sus filiales." +#~ msgid "GLSL Shader Parameters" +#~ msgstr "Parámetros de sombra GLSL" + #~ msgid "Speed throttle:" #~ msgstr "Acelerador de velocidad:" diff --git a/gtk/po/fr_FR.po b/gtk/po/fr_FR.po index ccf85e23..efc3b9fc 100644 --- a/gtk/po/fr_FR.po +++ b/gtk/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" "PO-Revision-Date: 2009-03-14 HO:MI+ZONE\n" "Last-Translator: tukuyomi \n" "Language-Team: LANGUAGE \n" @@ -221,7 +221,7 @@ msgid "SNES Movies" msgstr "Vidéos SNES" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 msgid "All Files" msgstr "Tous les fichiers" @@ -234,7 +234,7 @@ msgstr "Impossible de charger le fichier '%s'" msgid "Load Saved State" msgstr "Charger une sauvegarde instantanée" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "Sauvegardes instantanées" @@ -332,15 +332,16 @@ msgid "Shader Preset" msgstr "Reset matériel" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "" +#, fuzzy +msgid "Shader Parameters" +msgstr "Reset matériel" -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 #, fuzzy msgid "Open SNES ROM Image" msgstr "_Ouvrir une image ROM..." -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 #, fuzzy msgid "SNES ROM Images" msgstr "Vidéos SNES" @@ -414,499 +415,507 @@ msgstr "" msgid "Color bars and patterns" msgstr "" -#: src/snes9x.ui:835 -msgid "Game Genie" +#: src/snes9x.ui:827 +msgid "Starfield" msgstr "" -#: src/snes9x.ui:838 -msgid "Pro Action Replay" +#: src/snes9x.ui:830 +msgid "Snow" msgstr "" #: src/snes9x.ui:841 +msgid "Game Genie" +msgstr "" + +#: src/snes9x.ui:844 +msgid "Pro Action Replay" +msgstr "" + +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 msgid "SuperEagle" msgstr "" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 #, fuzzy msgid "Scanlines" msgstr "Intensité des scanlines:" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 msgid "8:7 Square pixels, integer multiples" msgstr "" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 #, fuzzy msgid "4:3 SNES correct aspect" msgstr "" "8:7 Pixels carrés\n" "4:3 Aspect correct de la SNES" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 msgid "4:3 SNES correct aspect, integer multiples" msgstr "" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 msgid "1" msgstr "" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 msgid "2" msgstr "" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 msgid "3" msgstr "" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 msgid "4" msgstr "" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 msgid "5" msgstr "" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 #, fuzzy msgid "Toggle the menu bar" msgstr "Basculer le turbo" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 #, fuzzy msgid "Exit fullscreen mode" msgstr "Plein-écran au chargement d'une image ROM" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Quitter Snes9x" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 msgid "32000 hz" msgstr "" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "_Fichier" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 msgid "_Open ROM Image..." msgstr "_Ouvrir une image ROM..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "Jeux récents" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "Ouvrir avec le réseau (_N)..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "Charger une image ROM pour jouer en réseau" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 msgid "Open _MultiCart..." msgstr "Ouvrir une _MultiCart..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "Charger une sauvegarde (_L)" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 msgid "Slot _9" msgstr "" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "Depuis un _Fichier..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 #, fuzzy msgid "_Undo Load State" msgstr "Charger une sauvegarde (_L)" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "_Sauvegarde instantanée" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "Vers un _Fichier..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "Sauver les données SPC..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "Afficher les _Informations de l'image ROM..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "_Quitter" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "_Emulation" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "Exécuter / _Continuer" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "Charger une vidéo (_M)..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "Enr_egistrer une vidéo..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "_Stopper l'enregistrement" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "Aller à l'image (_J)..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "Sy_nchroniser les clients" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "_Reset logiciel" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "Affichage (_V)" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 #, fuzzy msgid "_Toggle Menubar" msgstr "Basculer le turbo" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "_Changer la taille" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "Plein-écran (_F)" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "Ports manette" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "Port SNES 1" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "Manette" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "Souris" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "Port SNES 2" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "_Cheats..." -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "" -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "_Préférences..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "Ouvrir une MultiCart" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 msgid "Slot A:" msgstr "" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 msgid "Slot B:" msgstr "" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Snes9x Jeu en réseau" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -914,49 +923,49 @@ msgstr "" "Le jeu choisi sera chargé avant la connection. Ce champ peut rester vide si " "le serveur envoie l'image ROM" -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "Parcourir..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "Effacer l'entrée" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "Image ROM" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "Se connecter à un autre ordinateur" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "" "Se connecter à un autre ordinateur qui héberge une partie avec Snes9x Netplay" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "Nom ou adresse IP:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "Nom de domaine ou adresse IP de l'ordinateur distant" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "Port:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "Se connecter à un port TCP spécifique sur l'ordinateur distant" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "Faire office de serveur" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -964,25 +973,25 @@ msgstr "" "Héberger une partie sur cet ordinateur en tant que 'Joueur 1'; requiert un " "débit plus important pour supporter plusieurs utilisateurs" -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "Serveur" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "Synchroniser en utilisant le Reset" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" msgstr "Réinitialiser le jeu quand des joueurs se connectent" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "Envoyer l'image ROM aux clients" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -990,324 +999,324 @@ msgstr "" "Envoyer l'image du jeu en cours aux joueurs plutot que de les obliger à " "posséder leur propre copie" -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "Port par défaut:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "Écouter les clients sur ce port TCP" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "Demander au serveur de mettre en pause" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "images en arrière" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "Réglages" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Snes9x Préférences" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "Plein-écran au chargement d'une image ROM" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "Passer en plein-écran après avoir chargé un jeu" -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 #, fuzzy msgid "Show local time" msgstr "Afficher le taux d'images par seconde" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "Afficher le taux d'images par seconde" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "Utiliser la hauteur étendue SNES. Peut causer l'effet letterbox" -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "Changer la résolution du plein-écran:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "Change la résolution lorsque Snes9x utilise le plein-écran" -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 #, fuzzy msgid "Basic Settings" msgstr "Réglages de base" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "Ajuster l'image pour s'adapter à la fenêtre" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "Ajuste l'image à l'écran" -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 #, fuzzy msgid "Aspect ratio:" msgstr "Maintenir les proportions de l'image:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 #, fuzzy msgid "Maintain aspect-ratio" msgstr "Maintenir les proportions de l'image:" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "Ajuste l'image au maximum sans distorsion" -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "Utiliser " -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "Autoriser les filtres à utiliser plusieurs processeurs" -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "threads pour le filtrage et le zoom" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "Appliquer un filtre d'agrandissement:" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 msgid "Video preset:" msgstr "Pré-réglages vidéo:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 msgid "Composite" msgstr "" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 msgid "S-Video" msgstr "" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "RVB" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 msgid "Artifacts:" msgstr "Artefacts:" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "Netteté:" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "Brillance:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "Contraste:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "Teinte:" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 msgid "Resolution:" msgstr "Résolution:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "Fusionner les champs pairs et impairs" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "Intensité des scanlines:" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "Sortie bi-linéraire" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "Synchroniser avec le vertical blank" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "Synchroniser l'image avec le retracement vertical" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 msgid "Reduce input lag with glFinish" msgstr "" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" msgstr "" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 msgid "Reduce input lag with sync control" msgstr "" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 msgid "" "More modern method for syncing the program with the video output to reduce " "input latency. Allows GUI events to occur in the meantime" msgstr "" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "Autoriser les textures non puissance de 2" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "Empêche les artefacts de bords, mais peut ralentir le jeu" -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "Peut être plus rapide ou plus lent selon le pilote" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "Des formats différents peuvent mener à des performances différentes" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "Format du pixel-buffer:" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 msgid "Shader:" msgstr "" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "Inverser l'ordre des octets" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" msgstr "" -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 #, fuzzy msgid "Hardware Acceleration" msgstr "Accélération matérielle" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "Affichage" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "Pilote audio:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "Sourdine" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "Désactiver la sortie audio" -#: src/snes9x.ui:4200 +#: src/snes9x.ui:4206 #, fuzzy -msgid "Mute sound when using turbo" +msgid "Mute sound when using turbo or rewind" msgstr "Sourdine" -#: src/snes9x.ui:4204 +#: src/snes9x.ui:4210 #, fuzzy -msgid "Disables output of sound when using turbo" +msgid "Disables output of sound when using turbo or rewind" msgstr "Désactiver la sortie audio" -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "Fréquence de lecture:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "millisecondes" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "Taille du tampon:" -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "Fréquence d'entrée:" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " @@ -1317,144 +1326,144 @@ msgstr "" "son craque. Augmenter si les images sautent. Utiliser de préférence avec " "l'option \"Synchroniser avec le son\"" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 #, fuzzy msgid "Video rate:" msgstr "Pré-réglages vidéo:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "Réglages audio" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "Son" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" msgstr "" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 #, fuzzy msgid "Speed Control" msgstr "Serveur" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 #, fuzzy msgid "Rewind buffer size (MB):" msgstr "Taille du tampon:" -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 #, fuzzy msgid "Rewind Settings" msgstr "Réglages audio" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 #, fuzzy msgid "Allow invalid VRAM access" msgstr "Bloquer les accès VRAM invalides" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" msgstr "" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "Autoriser Haut/Bas et Gauche/Droite" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "Gauche et droite ou haut et bas peuvent être pressés en même temps" -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 #, fuzzy msgid "Sound filter:" msgstr "Pilote audio:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 #, fuzzy msgid "Hacks" msgstr "Précision" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "Émulation" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 #, fuzzy msgid "SRAM:" msgstr "Sauver la SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 #, fuzzy msgid "Save states:" msgstr "Sauvegardes instantanées" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 #, fuzzy msgid "Cheats:" msgstr "_Cheats..." -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 #, fuzzy msgid "Game Data Locations" msgstr "Données de Jeu" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "Sauver la SRAM:" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1462,142 +1471,142 @@ msgstr "" "Sauver automatiquement la SRAM à cet intervalle. Régler à 0 pour ne sauver " "qu'en quittant ou en changeant de ROM" -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "secondes après un changement" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 #, fuzzy msgid "Automatic Saving" msgstr "Réglages de base" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "Fichiers" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "Manette:" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "_Reset" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "Inverser avec:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "Inver_Ser" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "Utiliser MAJ, CTRL, ALT comme touches à part entière" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "" "Autoriser l'usage des touches de combinaison comme touches à part entière" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "Haut" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "Bas" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "Gauche" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "Droite" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "Boutons" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "Boutons Turbo / Sticky" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "Régler les axes à:" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "Seuil de détection des boutons pour les joysticks analogiques" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "pourcent" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "Seuil des axes du joystick" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "Centrer tous les axes des joysticks puis presser Calibrer" -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "Cali_brer" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "Étalonnage" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "Options du joystick" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" @@ -1606,272 +1615,272 @@ msgstr "" "Échap: Passer au suivant Shift-Échap: Effacer l'entrée en " "cours" -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "Manettes" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "Raccourcis clavier" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "Reset logiciel" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "Reset matériel" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "Augmenter le temps entre chaque image" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "Diminuer le temps entre chaque image" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "Augmenter le saut d'image" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "Diminuer le saut d'image" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "Basculer le turbo" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "Activer le turbo" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "Charger une image ROM" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "Afficher/Masquer le calque BG 0" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "Afficher/Masquer le calque BG 1" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "Afficher/Masquer le calque BG 2" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "Afficher/Masquer le calque BG 3" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "Afficher/Masquer les sprites" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "Hack pour le calque BG" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "Capture d'écran" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "Basculer le plein-écran" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "Graphiques" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "Sauvegarde rapide" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "Chargement rapide" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 msgid "Slot 9" msgstr "" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "Basculer le canal son 0" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "Basculer le canal son 1" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "Basculer le canal son 2" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "Basculer le canal son 3" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "Basculer le canal son 4" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "Basculer le canal son 5" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "Basculer le canal son 6" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "Basculer le canal son 7" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "Basculer tous les canaux audio" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "Aller à l'image" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "Charger une vidéo" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "Stopper l'enregistrement de la vidéo" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "Commencer l'enregistrement d'une vidéo" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "Sauver les données SPC" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "Inverser les manettes 1 et 2" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "Divers" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "Raccourcis" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "Mettre en pause quand Snes9x n'a plus le focus" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "La touche ESC doit:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 #, fuzzy msgid "Window Behavior" msgstr "Changement de la fenêtre" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "Désactiver l'écran de veille" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "Écran de veille" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" msgstr "" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" diff --git a/gtk/po/ja.po b/gtk/po/ja.po index 224e16d8..f6bfe6ae 100644 --- a/gtk/po/ja.po +++ b/gtk/po/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" "PO-Revision-Date: 2016-01-09 21:35+0900\n" "Last-Translator: trickart \n" "Language-Team: \n" @@ -216,7 +216,7 @@ msgid "SNES Movies" msgstr "SNESムービー" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 msgid "All Files" msgstr "すべてのファイル" @@ -229,7 +229,7 @@ msgstr "%s が開けません" msgid "Load Saved State" msgstr "ステートセーブをロード" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "ステートセーブ" @@ -311,15 +311,16 @@ msgid "Shader Preset" msgstr "ハードウェアリセット" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "" +#, fuzzy +msgid "Shader Parameters" +msgstr "ハードウェアリセット" -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 #, fuzzy msgid "Open SNES ROM Image" msgstr "ROMイメージを開く(_O)..." -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 #, fuzzy msgid "SNES ROM Images" msgstr "SNESムービー" @@ -392,497 +393,505 @@ msgstr "" msgid "Color bars and patterns" msgstr "" -#: src/snes9x.ui:835 +#: src/snes9x.ui:827 +msgid "Starfield" +msgstr "" + +#: src/snes9x.ui:830 +msgid "Snow" +msgstr "" + +#: src/snes9x.ui:841 msgid "Game Genie" msgstr "" -#: src/snes9x.ui:838 +#: src/snes9x.ui:844 msgid "Pro Action Replay" msgstr "プロアクションリプレイ" -#: src/snes9x.ui:841 +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "なし" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 msgid "SuperEagle" msgstr "" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 msgid "Scanlines" msgstr "走査線" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "8:7 正方形ドット" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 #, fuzzy msgid "8:7 Square pixels, integer multiples" msgstr "8:7 正方形ドット" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 msgid "4:3 SNES correct aspect" msgstr "4:3 SNESのアスペクト比" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 #, fuzzy msgid "4:3 SNES correct aspect, integer multiples" msgstr "4:3 SNESのアスペクト比" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 msgid "1" msgstr "" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 msgid "2" msgstr "" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 msgid "3" msgstr "" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 msgid "4" msgstr "" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 msgid "5" msgstr "" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 msgid "Toggle the menu bar" msgstr "メニューバーの表示/非表示を切り替え" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 msgid "Exit fullscreen mode" msgstr "フルスクリーンモードをやめる" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Snes9xを終了" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "48000 Hz" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "44100 Hz" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 #, fuzzy msgid "32000 hz" msgstr "8000 Hz" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "22050 Hz" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "16000 Hz" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "11025 Hz" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "8000 Hz" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "0 Hz" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "ファイル(_F)" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 msgid "_Open ROM Image..." msgstr "ROMイメージを開く(_O)..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "最近開いたROM" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "ネットプレイ(_N)..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "ネットプレイするROMを開く" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 msgid "Open _MultiCart..." msgstr "マルチROMを開く(_M)..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "ステートセーブをロード(_L)" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "スロット0 (_0)" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "スロット1 (_1)" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "スロット2 (_2)" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "スロット3 (_3)" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "スロット4 (_4)" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "スロット5 (_5)" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "スロット6 (_6)" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "スロット7 (_7)" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "スロット8 (_8)" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 #, fuzzy msgid "Slot _9" msgstr "スロット0 (_0)" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "ファイルを読み込む(_F)..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 #, fuzzy msgid "_Undo Load State" msgstr "ステートセーブをロード(_L)" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "ステートセーブ(_S)" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "ファイルに保存(_F)..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "SPCを保存..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "ROM情報を表示(_I)..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "終了(_Q)" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "エミュレーション(_E)" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "実行/再開(_C)" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "ポーズ(_P)" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "ムービーをロード(_M)..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "ムービーを録画(_E)..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "録画を停止(_S)" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "フレームに飛ぶ(_J)..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "クライアントと同期(_N)" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "リセット" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "ソフトリセット(_R)" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "表示(_V)" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 #, fuzzy msgid "_Toggle Menubar" msgstr "メニューバーの表示/非表示を切り替え" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "サイズ変更(_C)" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "1x (_1)" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "2x (_2)" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "3x (_3)" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "4x (_4)" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "5x (_5)" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "フルスクリーン(_F)" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "オプション(_O)" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "コントローラーポート" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "ポート1" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "ジョイパッド" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "マウス" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "スーパースコープ" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "ポート2" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "マルチタップ" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "チート(_C)..." -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "" -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "設定(_P)..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "マルチROMを開く" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 msgid "Slot A:" msgstr "スロットA:" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "スロットAのイメージを選択" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 msgid "Slot B:" msgstr "スロットB:" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "スロットBのイメージを選択" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Snes9x ネットプレイ" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -890,48 +899,48 @@ msgstr "" "選んだROMはサーバー接続前にロードされます。この欄はサーバーからROMイメージを" "転送する場合空欄でも構いません" -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "参照..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "エントリをクリア" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "ROMイメージ" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "別のマシンに接続" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "Snes9xをネットプレイサーバーとして実行してる別のマシンに接続します" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "ドメイン名またはIPアドレス:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "接続先のドメイン名またはIPアドレスを入力してください" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "ポート:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "指定したTCPポートに接続します" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "サーバーになる" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -939,25 +948,25 @@ msgstr "" "プレイヤー1としてゲームをホストします。\n" "シングルプレイよりも処理が重くなります" -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "サーバー" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "リセットして同期" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" msgstr "" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "クライアントにROMイメージを送信" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -965,464 +974,464 @@ msgstr "" "各プレイヤーがROMを用意する代わりにサーバーから実行するゲームのROMイメージを" "送ります" -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "デフォルトポート:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "TCPポートはクライアントがこのマシンに接続するために使われます" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "クライアントが" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "フレーム遅れた時サーバーをポーズする" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "設定" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Snes9x 設定" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "ROMを開いたらフルスクリーンモードに" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "ROMを開いたらフルスクリーンモードにします" -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 #, fuzzy msgid "Show local time" msgstr "フレームレートを表示" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "フレームレートを表示" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "オーバースキャンの高さで表示する" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "" -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "フルスクリーン時の解像度を変更する:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "フルスクリーンモード時の解像度を変更します" -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 #, fuzzy msgid "Basic Settings" msgstr "基本設定" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "ウィンドウに合わせて映像を拡大縮小します" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "黒い縁が表示されないように映像を拡大縮小します" -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 msgid "Aspect ratio:" msgstr "アスペクト比を維持する:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 msgid "Maintain aspect-ratio" msgstr "アスペクト比を維持する" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "アスペクト比を維持して映像を拡大する" -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "フィルタリングやスケーリングに" -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "フィルタリングとスケーリングに複数プロセスを使用することを許可します" -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "スレッド使用する" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "ハイレゾリューションエフェクト:" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "スケーリングフィルターを有効にする:" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 msgid "Video preset:" msgstr "ビデオプリセット:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 msgid "Composite" msgstr "コンポジット" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 msgid "S-Video" msgstr "S端子" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "モノクロ" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 msgid "Artifacts:" msgstr "" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "シャープネス" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "輝度:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "コントラスト:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "ガンマ:" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 msgid "Resolution:" msgstr "解像度:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "バイリニアフィルタ出力" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "垂直同期" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 #, fuzzy msgid "Reduce input lag with glFinish" msgstr "入力ラグを軽減する" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" msgstr "" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 #, fuzzy msgid "Reduce input lag with sync control" msgstr "入力ラグを軽減する" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 msgid "" "More modern method for syncing the program with the video output to reduce " "input latency. Allows GUI events to occur in the meantime" msgstr "" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "non-power-of-twoテクスチャを許可する" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "" -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "ピクセルバッファオブジェクトを使用する" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "速度はドライバに依存します" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "ピクセルバッファフォーマット:" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 #, fuzzy msgid "Shader:" msgstr "GLSLシェーダを使用:" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "バイトオーダーの反転を強制する" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" msgstr "" -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 #, fuzzy msgid "Hardware Acceleration" msgstr "ハードウェアアクセラレーション" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "ディスプレイ" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "サウンドドライバ:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "サウンドをミュートする" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "音声出力を無効にします" -#: src/snes9x.ui:4200 +#: src/snes9x.ui:4206 #, fuzzy -msgid "Mute sound when using turbo" +msgid "Mute sound when using turbo or rewind" msgstr "サウンドをミュートする" -#: src/snes9x.ui:4204 +#: src/snes9x.ui:4210 #, fuzzy -msgid "Disables output of sound when using turbo" +msgid "Disables output of sound when using turbo or rewind" msgstr "音声出力を無効にします" -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "出力周波数:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "ミリ秒" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "バッファサイズ:" -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "入力周波数:" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " "used with the \"Synchronize with sound\" option" msgstr "" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 msgid "Video rate:" msgstr "ビデオレート:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "ラベル" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "サウンド設定" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "サウンド" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" msgstr "" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 #, fuzzy msgid "Speed Control" msgstr "サーバー" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 #, fuzzy msgid "Rewind buffer size (MB):" msgstr "バッファサイズ:" -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 #, fuzzy msgid "Rewind Settings" msgstr "サウンド設定" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 #, fuzzy msgid "Allow invalid VRAM access" msgstr "不正なVRAMアクセスをブロックする" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" msgstr "" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "上下または左右の同時入力を許可する" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "左右もしくは上下を同時に押した時" -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 #, fuzzy msgid "Sound filter:" msgstr "サウンドドライバ:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 #, fuzzy msgid "Hacks" msgstr "押しっぱなし" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "エミュレーション" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 msgid "SRAM:" msgstr "SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 msgid "Save states:" msgstr "ステートセーブ:" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 msgid "Cheats:" msgstr "チート:" -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "パッチ:" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 msgid "Game Data Locations" msgstr "ゲームデータフォルダ" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "SRAMを" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1430,142 +1439,142 @@ msgstr "" "自動セーブの間隔です。0に設定した時はゲーム終了時とROM変更時のみセーブされま" "す" -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "秒ごとに保存" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 msgid "Automatic Saving" msgstr "自動セーブ" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "ファイル" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "ジョイパッド:" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "リセット(_R)" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "設定を入れ替える:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "と入れ替え(_S)" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "装飾キー(Ctrl,Shift,Alt)を単体で使用する" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "" "装飾キーを組み合わせてではなく\n" "単体のキーとして使用することを許可します" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "上" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "下" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "左" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "右" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "START" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "SELECT" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "ボタン" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "押しっぱなし" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "ターボ" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "ターボ / 押しっぱなし" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "アナログパッドの感度を変更します" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "%" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "アナログパッドのしきい値" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "アナログパットに触っていない状態で調整ボタンを押してください" -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "調整(_B)" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "アナログパッド調整" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "ジョイスティックオプション" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" @@ -1573,273 +1582,273 @@ msgstr "" "エントリを選びキーかボタンを押してください\n" "ESC: 次へ移動 Shift+ESC: クリア" -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "ジョイパッド" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "ショートカットキー" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "ソフトリセット" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "ハードウェアリセット" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "ポーズ" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "ターボをオン/オフ" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "ターボ(押してる間だけ)" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "ROMを開く" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "背景レイヤー0を表示/非表示" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "背景レイヤー1を表示/非表示" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "背景レイヤー2を表示/非表示" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "背景レイヤー3を表示/非表示" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "スプライトを表示/非表示" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "背景レイヤリングハック" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "スクリーンショット" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "フルスクリーン" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "グラフィックス" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "クイックセーブ" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "クイックロード" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "スロット0" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "スロット1" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "スロット2" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "スロット3" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "スロット4" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "スロット5" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "スロット6" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "スロット7" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "スロット8" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 #, fuzzy msgid "Slot 9" msgstr "スロット1" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "音声チャンネル0をオン/オフ" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "音声チャンネル1をオン/オフ" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "音声チャンネル2をオン/オフ" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "音声チャンネル3をオン/オフ" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "音声チャンネル4をオン/オフ" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "音声チャンネル5をオン/オフ" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "音声チャンネル6をオン/オフ" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "音声チャンネル7をオン/オフ" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "全ての音声チャンネルをオン/オフ" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "フレームにシーク" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "ムービーをロード" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "ムービー録画を停止" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "録画を開始する" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "SPCを保存" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "コントローラー1と2を入れ替える" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "その他" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "ショートカット" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "ウィンドウが非アクティブ時にポーズする" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "ESCキー:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 #, fuzzy msgid "Window Behavior" msgstr "ウィンドウ切り替え" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "スクリーンセーバーを抑止" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "スクリーンセーバー" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" msgstr "" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" diff --git a/gtk/po/pt_BR.po b/gtk/po/pt_BR.po index b3d45607..e2fc9ed8 100644 --- a/gtk/po/pt_BR.po +++ b/gtk/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" "PO-Revision-Date: 2009-09-12 23:32-0300\n" "Last-Translator: Tibério Vítor \n" "Language-Team: LANGUAGE \n" @@ -223,7 +223,7 @@ msgid "SNES Movies" msgstr "Filmes de SNES" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 msgid "All Files" msgstr "Todos os arquivos" @@ -236,7 +236,7 @@ msgstr "Não foi possível carregar o arquivo '%s'" msgid "Load Saved State" msgstr "Carregar estado de memória" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "Estados salvos" @@ -335,15 +335,16 @@ msgid "Shader Preset" msgstr "Reiniciar máquina" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "" +#, fuzzy +msgid "Shader Parameters" +msgstr "Reiniciar máquina" -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 #, fuzzy msgid "Open SNES ROM Image" msgstr "_Abrir uma ROM..." -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 #, fuzzy msgid "SNES ROM Images" msgstr "Filmes de SNES" @@ -417,510 +418,518 @@ msgstr "" msgid "Color bars and patterns" msgstr "" -#: src/snes9x.ui:835 -msgid "Game Genie" +#: src/snes9x.ui:827 +msgid "Starfield" msgstr "" -#: src/snes9x.ui:838 -msgid "Pro Action Replay" +#: src/snes9x.ui:830 +msgid "Snow" msgstr "" #: src/snes9x.ui:841 +msgid "Game Genie" +msgstr "" + +#: src/snes9x.ui:844 +msgid "Pro Action Replay" +msgstr "" + +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 #, fuzzy msgid "SuperEagle" msgstr "Superscope" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 #, fuzzy msgid "Scanlines" msgstr "Intensidade das scanlines:" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 msgid "8:7 Square pixels, integer multiples" msgstr "" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 #, fuzzy msgid "4:3 SNES correct aspect" msgstr "" "8:7 Pontos definidos\n" "4:3 Aspecto correto do SNES" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 msgid "4:3 SNES correct aspect, integer multiples" msgstr "" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 #, fuzzy msgid "1" msgstr "1x" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 #, fuzzy msgid "2" msgstr "2x" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 #, fuzzy msgid "3" msgstr "3x" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 #, fuzzy msgid "4" msgstr "4x" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 #, fuzzy msgid "5" msgstr "5x" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 #, fuzzy msgid "Toggle the menu bar" msgstr "Ligar ou desligar o turbo" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 #, fuzzy msgid "Exit fullscreen mode" msgstr "Usar tela cheia ao abrir a ROM" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Sair do Snes9x" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 msgid "32000 hz" msgstr "" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "Snes9x" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "_Arquivo" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 #, fuzzy msgid "_Open ROM Image..." msgstr "_Abrir uma ROM..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "ROMs recentes" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "Abrir com jogo em _rede..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "Abrir uma ROM para usar com jogo em rede" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 #, fuzzy msgid "Open _MultiCart..." msgstr "_Abrir uma ROM..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "_Carregar estado" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "Unidade _0" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "Unidade _1" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "Unidade _2" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "Unidade _3" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "Unidade _4" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "Unidade _5" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "Unidade _6" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "Unidade _7" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "Unidade _8" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 #, fuzzy msgid "Slot _9" msgstr "Unidade _0" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "De _arquivo..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 #, fuzzy msgid "_Undo Load State" msgstr "_Carregar estado" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "_Salvar estado" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "Para o _arquivo..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "Salvar SPC..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "Mostrar _informações da ROM..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "_Sair" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "_Emulação" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "Executar / _Continuar" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "_Pause" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "Carregar _Filme..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "_Gravar filme..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "_Parar gravação" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "_Pular para quadro..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "Si_ncronizar clientes" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "Reiniciar" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "_Reiniciar jogo" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "_Visualizar" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 #, fuzzy msgid "_Toggle Menubar" msgstr "Ligar ou desligar o turbo" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "_Mudar tamanho" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "_1x" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "_2x" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "_3x" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "_4x" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "_5x" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "_Tela cheia" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "_Opções" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "Entradas de controles" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "Controle 1" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "Controle" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "Mouse" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "Superscope" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "Controle 2" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "Multitap" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "_Trapaças..." -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "" -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "_Preferências..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 #, fuzzy msgid "Slot A:" msgstr "Unidade 0" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 #, fuzzy msgid "Slot B:" msgstr "Unidade 0" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Jogo em rede do Snes9x" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -928,48 +937,48 @@ msgstr "" "O jogo escolhido será carregado antes de conectar. Esse campo pode ficar " "embranco se o servidor mandar a imagem da ROM." -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "Navegar..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "Limpar entrada" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "Imagem de ROM" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "Conectar-se a outro computador" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "Conectar-se a um computador que está rodando o Snes9x como servidor" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "Nome ou endereço de IP:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "Nome do domínio ou endereço protocolado de um computador remoto" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "Porta:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "Conectar-se a uma porta TCP específica de um computador remoto" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "Ser o servidor" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -977,15 +986,15 @@ msgstr "" "Hospedar um jogo nesse computador como Jogador 1, requer uma banda largapara " "suportar múltiplos jogadores." -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "Servidor" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "Sincronizar os reinícios" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" @@ -993,11 +1002,11 @@ msgstr "" "Reinicia o jogo somente quando novos jogadores entrarem, prevenindoestados " "de memória quebrados" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "Enviar imagem de ROM para os clientes" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -1005,121 +1014,121 @@ msgstr "" "Envia a ROM do jogo atual para os jogadores ao invés de requerer uma cópiade " "cada um." -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "Porta padrão:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "Porta TCP usada como ponto de conexão entre clientes" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "Perguntar ao servidor quando deve pausar" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "quadros atrasados" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "Opções" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Preferências do Snes9x" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "Usar tela cheia ao abrir a ROM" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "Ir para tela cheia assim que abrir a ROM." -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 #, fuzzy msgid "Show local time" msgstr "Mostrar taxa de quadros" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "Mostrar taxa de quadros" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "Usar altura extendida" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "Usar a altura extendida do SNES. Pode causar problema nas fontes." -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "Mudar a resolução em tela cheia:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "Muda a resolução da tela quando for rodar em tela cheia." -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 #, fuzzy msgid "Basic Settings" msgstr "Configurações básicas" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "Escalonar imagem para o tamanho da janela" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "Escalonar a imagem para tirar as bordas negras." -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 #, fuzzy msgid "Aspect ratio:" msgstr "Manter proporção de aspecto:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 #, fuzzy msgid "Maintain aspect-ratio" msgstr "Manter proporção de aspecto:" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "Escalonar a imagem o mais largo possível, sem distorções." -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "Usar " -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "" "Permitir que o escalonamento e a filtragem usem múltiplos processadores." -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "processos para filtragem e escalonamento" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "Aplicar um filtro:" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 #, fuzzy msgid "Video preset:" msgstr "Formato do vídeo:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 #, fuzzy msgid "Composite" msgstr "" @@ -1127,140 +1136,140 @@ msgstr "" "S-Video\n" "RGB" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 #, fuzzy msgid "S-Video" msgstr " XVideo" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 #, fuzzy msgid "Artifacts:" msgstr "Artefatos" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "Precisão:" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "Brilho:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "Contraste:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "Saturação:" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "Matiz:" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 #, fuzzy msgid "Resolution:" msgstr "Descrição:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "Intensidade das scanlines:" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "Saída em filtro bilinear" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "Sincronização vertical" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "" "Sincronizar a imagem de acordo com o alinhamento vertical para evitar " "imagens cortadas" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 msgid "Reduce input lag with glFinish" msgstr "" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" msgstr "" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 msgid "Reduce input lag with sync control" msgstr "" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 msgid "" "More modern method for syncing the program with the video output to reduce " "input latency. Allows GUI events to occur in the meantime" msgstr "" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "Permitir texturas não quadradas" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "Previne sujeira nas bordas, mas pode comprometer o desempenho" -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "Usar objetos do buffer de pixels" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "Pode ser mais rápido ou lento dependendo dos drivers" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "Formatos diferentes geram perfomances bem diferentes" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "Formato do buffer de pixels:" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 msgid "Shader:" msgstr "" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "Forçar finalização invertida de bytes" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" @@ -1268,219 +1277,219 @@ msgstr "" "Força uma finalização invertida de bytes nos casos onde a finalização " "dosistema é usada ao invés da placa de vídeo." -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 #, fuzzy msgid "Hardware Acceleration" msgstr "Aceleração de hardware" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "Tela" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "Driver de som:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "Saída de áudio muda" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "Desativar saída de áudio." -#: src/snes9x.ui:4200 +#: src/snes9x.ui:4206 #, fuzzy -msgid "Mute sound when using turbo" +msgid "Mute sound when using turbo or rewind" msgstr "Saída de áudio muda" -#: src/snes9x.ui:4204 +#: src/snes9x.ui:4210 #, fuzzy -msgid "Disables output of sound when using turbo" +msgid "Disables output of sound when using turbo or rewind" msgstr "Desativar saída de áudio." -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "Frequência de saída:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "milissegundos" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "Tamanho do buffer:" -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " "used with the \"Synchronize with sound\" option" msgstr "" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 #, fuzzy msgid "Video rate:" msgstr "Formato do vídeo:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "Configurações de som" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "Som" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" msgstr "" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 #, fuzzy msgid "Speed Control" msgstr "Servidor" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 #, fuzzy msgid "Rewind buffer size (MB):" msgstr "Tamanho do buffer:" -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 #, fuzzy msgid "Rewind Settings" msgstr "Configurações de som" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 #, fuzzy msgid "Allow invalid VRAM access" msgstr "Bloquear acesso inválido a VRAM" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" msgstr "" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "Permitir entradas opostas no direcional" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "" "Deixa direita e esquerda ou cima e baixo serem pressionados ao mesmo tempo." -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 #, fuzzy msgid "Sound filter:" msgstr "Driver de som:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 #, fuzzy msgid "Hacks" msgstr "Fixo" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "Emulação" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 #, fuzzy msgid "SRAM:" msgstr "Salvar SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 #, fuzzy msgid "Save states:" msgstr "Estados salvos" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 #, fuzzy msgid "Cheats:" msgstr "Trapaça" -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 #, fuzzy msgid "Game Data Locations" msgstr "Dados do jogo" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "Salvar SRAM:" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1488,141 +1497,141 @@ msgstr "" "Salva automaticamente a SRAM nesse intervalo. Colocando 0, o jogo só será " "salvo ao sair do emulador ou trocar de ROM." -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "segundos após mudança" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 #, fuzzy msgid "Automatic Saving" msgstr "Configurações básicas" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "Arquivos" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "Controle:" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "_Padrão" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "Trocar por:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "_Inverter" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "Cima" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "Baixo" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "Esquerda" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "Direita" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "Start" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "Select" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "A" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "B" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "X" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "Y" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "L" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "R" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "Botões" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "Fixo" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "Ao pressionar" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "Configurar turbo" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "Colocar novas posições do eixo em:" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "Muda o valor da pressão para o controle registrar uma entrada no botão" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "porcento" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "Limites dos eixos do controle" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "Centralize todos os eixos em todos os controles e clique em Calibrar." -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "Cali_brar" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "Calibração" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "Opções do controle" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" @@ -1630,273 +1639,273 @@ msgstr "" "Clique em uma entrada e aperte a tecla ou botão desejado\n" "Esc: Vai para a próxima. Shift+Esc: Limpa a entrada." -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "Controles" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "Teclas de atalho" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "Reiniciar jogo" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "Reiniciar máquina" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "Aumentar intervalo entre quadros" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "Diminuir intervalo entre quadros" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "Aumentar a taxa de quadros" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "Diminuir taxa de quadros" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "Pause" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "Ligar ou desligar o turbo" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "Turbo pressionado" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "Abrir uma ROM" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "Ligar ou desligar a camada BG 0" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "Ligar ou desligar a camada BG 1" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "Ligar ou desligar a camada BG 2" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "Ligar ou desligar a camada BG 3" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "Ligar ou desligar sprites" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "Hack nas camadas do fundo" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "Captura de tela" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "Ligar ou desligar a tela cheia" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "Gráficos" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "Salvar estado rapidamente" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "Carregar estado rapidamente" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "Unidade 0" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "Unidade 1" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "Unidade 2" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "Unidade 3" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "Unidade 4" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "Unidade 5" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "Unidade 6" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "Unidade 7" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "Unidade 8" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 #, fuzzy msgid "Slot 9" msgstr "Unidade 0" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "Ligar ou desligar o canal de som 0" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "Ligar ou desligar o canal de som 1" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "Ligar ou desligar o canal de som 2" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "Ligar ou desligar o canal de som 3" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "Ligar ou desligar o canal de som 4" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "Ligar ou desligar o canal de som 5" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "Ligar ou desligar o canal de som 6" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "Ligar ou desligar o canal de som 7" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "Ligar ou desligar todos os canais de som" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "Ir para um quadro" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "Carregar filme" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "Parar gravação de filme" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "Começar a gravar um filme" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "Salvar SPC" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "Trocar controles 1 e 2" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "Miscelânea" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "Atalhos" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "Pausar emulação ao desfocalizar a janela do Snes9x" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "A tecla ESC deve:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 #, fuzzy msgid "Window Behavior" msgstr "Comportamento da janela" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "Desativar a proteção de tela" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "Protetor de tela" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" msgstr "" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" diff --git a/gtk/po/ru.po b/gtk/po/ru.po index 20c1e379..a20419e0 100644 --- a/gtk/po/ru.po +++ b/gtk/po/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: snes9x 1.52\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" "PO-Revision-Date: 2011-04-12 22:54+0600\n" "Last-Translator: Sergey Basalaev \n" "Language-Team: Russian \n" @@ -221,7 +221,7 @@ msgid "SNES Movies" msgstr "" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 #, fuzzy msgid "All Files" msgstr "Файлы" @@ -236,7 +236,7 @@ msgstr "" msgid "Load Saved State" msgstr "_Загрузить состояние" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "Состояния" @@ -314,15 +314,16 @@ msgid "Shader Preset" msgstr "Питание" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "" +#, fuzzy +msgid "Shader Parameters" +msgstr "Питание" -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 #, fuzzy msgid "Open SNES ROM Image" msgstr "_Открыть образ ROM..." -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 #, fuzzy msgid "SNES ROM Images" msgstr "_Открыть образ ROM..." @@ -395,11 +396,19 @@ msgstr "" msgid "Color bars and patterns" msgstr "" -#: src/snes9x.ui:835 +#: src/snes9x.ui:827 +msgid "Starfield" +msgstr "" + +#: src/snes9x.ui:830 +msgid "Snow" +msgstr "" + +#: src/snes9x.ui:841 msgid "Game Genie" msgstr "" -#: src/snes9x.ui:838 +#: src/snes9x.ui:844 #, fuzzy msgid "Pro Action Replay" msgstr "" @@ -407,498 +416,498 @@ msgstr "" "Pro Action Replay\n" "Goldfinger" -#: src/snes9x.ui:841 +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 #, fuzzy msgid "SuperEagle" msgstr "Superscope" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 #, fuzzy msgid "Scanlines" msgstr "Плотность сканлиний:" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 msgid "8:7 Square pixels, integer multiples" msgstr "" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 #, fuzzy msgid "4:3 SNES correct aspect" msgstr "" "8:7 Квадратные пикселы\n" "4:3 правильное соотношение SNES" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 msgid "4:3 SNES correct aspect, integer multiples" msgstr "" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 #, fuzzy msgid "1" msgstr "1x" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 #, fuzzy msgid "2" msgstr "2x" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 #, fuzzy msgid "3" msgstr "3x" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 #, fuzzy msgid "4" msgstr "4x" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 #, fuzzy msgid "5" msgstr "5x" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 #, fuzzy msgid "Toggle the menu bar" msgstr "Переключить турбо" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 #, fuzzy msgid "Exit fullscreen mode" msgstr "Полный экран после открытия ROM" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Выйти из Snes9x" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 msgid "32000 hz" msgstr "" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "Snes9x" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "_Файл" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 msgid "_Open ROM Image..." msgstr "_Открыть образ ROM..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "Открыть недавние" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "Открыть с _NetPlay..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "Открыть ROM, чтобы использовать с NetPlay" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 msgid "Open _MultiCart..." msgstr "Открыть _MultiCart..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "_Загрузить состояние" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "Слот _0" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "Слот _1" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "Слот _2" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "Слот _3" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "Слот _4" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "Слот _5" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "Слот _6" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "Слот _7" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "Слот _8" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 #, fuzzy msgid "Slot _9" msgstr "Слот _0" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "Из _файла..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 #, fuzzy msgid "_Undo Load State" msgstr "_Загрузить состояние" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "_Сохранить состояние" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "В _файл..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "Сохранить SPC..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "_Информация о ROM..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "В_ыход" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "_Эмуляция" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "_Старт / Продолжить" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "_Приостановить" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "Загрузить _видео..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "_Запись видео..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "_Остановить запись" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "Перейти на _кадр..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "Си_нхронизировать клиенты" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "Питание" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "С_брос" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "_Вид" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 #, fuzzy msgid "_Toggle Menubar" msgstr "Переключить турбо" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "_Изменить размер" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "_1x" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "_2x" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "_3x" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "_4x" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "_5x" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "_Полный экран" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "_Опции" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "Порты контроллера" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "Порт SNES 1" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "Джойстик" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "Мышь" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "Superscope" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "Порт SNES 2" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "Multitap" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "_Читы..." -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "" -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "_Настройки..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "Открыть несколько образов ROM (MultiCart)" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 msgid "Slot A:" msgstr "Слот A:" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "Выберите образ для слота A" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 msgid "Slot B:" msgstr "Слот B:" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "Выберите образ для слота B" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Snes9x NetPlay" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -906,49 +915,49 @@ msgstr "" "Выбранная игра будет загружена перед соединением. Это поле может быть " "пустым, если сервер посылает образ ROM" -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "Обзор..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "Очистить запись" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "Образ ROM" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "Соединиться с другим копьютером" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "" "Соединиться с другим компьютером, на котором запущен сервер Snes9x NetPlay" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "Имя или адрес IP:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "Доменное имя или адрес IP удалённого компьютера" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "Порт:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "Соединиться с указанным портом TCP на удалённом компьютере" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "Быть сервером" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -956,15 +965,15 @@ msgstr "" "Запускать игру на этом компьютере как Игрок 1, требует дополнительной " "настройки для поддержки нескольких пользователей" -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "Сервер" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "Синхронизировать через сброс" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" @@ -972,11 +981,11 @@ msgstr "" "Сбрасывать игру, когда игроки присоединяются вместо того, чтобы отсылать " "потенциально ненадёжные состояния" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "Посылать образы ROM клиентам" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -984,210 +993,210 @@ msgstr "" "Посылать образы игры игрокам, вместо того чтобы требовать от них иметь " "собственные копии" -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "Порт по умолчанию:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "Порт TCP, используемый для соединения с удалёнными клиентами" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "Просить сервер приостановиться при отставании на" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "фреймов" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "Настройки" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Настройки Snes9x" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "Полный экран после открытия ROM" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "Переключаться на полный экран сразу после открытия ROM'а" -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 #, fuzzy msgid "Show local time" msgstr "Показывать частоту кадров" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "Показывать частоту кадров" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "Показывать расширенную высоту" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "" "Использовать расширенную высоту SNES. Может вызвать чёрные полосы сверху и " "снизу." -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "Разрешение полного экрана:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "Изменяет разрешение экрана при переходе Snes9x в полноэкранный режим" -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 #, fuzzy msgid "Basic Settings" msgstr "Основные настройки" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "Растягивать изображение во всё окно" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "Растягивать изображение, чтобы не оставалось чёрных полос" -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 #, fuzzy msgid "Aspect ratio:" msgstr "Соотношение сторон:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 #, fuzzy msgid "Maintain aspect-ratio" msgstr "Соотношение сторон:" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "Растягивает изображение насколько возможно без искажений" -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "Использовать " -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "" "Позволяет процессам масштабирования и фильтрации использовать несколько " "процессоров" -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "потоков для фильтрации и масштабирования" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "Эффект высокого разрешения:" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "Применять фильтр масштабирования:" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 msgid "Video preset:" msgstr "Предустановка видео:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 msgid "Composite" msgstr "Композитная" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 msgid "S-Video" msgstr "S-Video" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "RGB" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "Монохромная" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 msgid "Artifacts:" msgstr "Помехи:" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "Резкость:" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "Яркость:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "Контраст:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "Насыщенность:" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "Тон:" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "Гамма:" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "Окантовка:" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "Края:" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 msgid "Resolution:" msgstr "Разрешение:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "Совместить чётные и нечётные поля" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "Плотность сканлиний:" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "Билинейная фильтрация вывода" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "Синхронизировать с VBlank" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "" "Синхронизировать изображение с обратным ходом вертикальной развёртки, чтобы " "изображение не рвалось" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 #, fuzzy msgid "Reduce input lag with glFinish" msgstr "Уменьшить лаг ввода" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" @@ -1195,12 +1204,12 @@ msgstr "" "Синхронизировать программу с выводом видео после каждого кадра для " "уменьшения задержки ввода" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 #, fuzzy msgid "Reduce input lag with sync control" msgstr "Уменьшить лаг ввода" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 #, fuzzy msgid "" "More modern method for syncing the program with the video output to reduce " @@ -1209,40 +1218,40 @@ msgstr "" "Синхронизировать программу с выводом видео после каждого кадра для " "уменьшения задержки ввода" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "Позволить текстуры не-степени-двойки" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "Предотвращает помехи по краям, но может снизить производительность" -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "Использовать объекты буферов пикселей" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "Может быть быстрее или медленнее в зависимости от драйверов" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "Разные форматы могут дать очень разную производительность" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "Формат буфера пикселей:" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 #, fuzzy msgid "Shader:" msgstr "Использовать шейдер GLSL:" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "Требовать обратный порядок байтов" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" @@ -1250,74 +1259,74 @@ msgstr "" "Устанавливает обратный порядок байтов в случае, когда используется порядок " "байтов системы, а не видеокарты" -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 #, fuzzy msgid "Hardware Acceleration" msgstr "Аппаратное ускорение" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "Видео" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "Звуковой драйвер:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "Отключить звук" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "Запрещает вывод звука" -#: src/snes9x.ui:4200 +#: src/snes9x.ui:4206 #, fuzzy -msgid "Mute sound when using turbo" +msgid "Mute sound when using turbo or rewind" msgstr "Отключить звук" -#: src/snes9x.ui:4204 +#: src/snes9x.ui:4210 #, fuzzy -msgid "Disables output of sound when using turbo" +msgid "Disables output of sound when using turbo or rewind" msgstr "Запрещает вывод звука" -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "Частота воспроизведения:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "миллисекунд" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "Размер буфера:" -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "Частота входа:" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " @@ -1327,139 +1336,139 @@ msgstr "" "если наблюдается треск. Увеличьте частоту, если наблюдается заикание. Лучше " "всего использовать с опцией «Синхронизировать со звуком»" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 msgid "Video rate:" msgstr "Частота видео:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "label" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "Настройки звука" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "Звук" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" msgstr "" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 #, fuzzy msgid "Speed Control" msgstr "Сервер" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 #, fuzzy msgid "Rewind buffer size (MB):" msgstr "Размер буфера:" -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 #, fuzzy msgid "Rewind Settings" msgstr "Настройки звука" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 #, fuzzy msgid "Allow invalid VRAM access" msgstr "Блокировать некорректный доступ к VRAM" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" msgstr "" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "Разрешать противоположные направления" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "Позволять влево и вправо или вверх и вниз быть нажатыми одновременно" -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 #, fuzzy msgid "Sound filter:" msgstr "Звуковой драйвер:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 #, fuzzy msgid "Hacks" msgstr "Залипающие" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "Эмуляция" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 msgid "SRAM:" msgstr "SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 msgid "Save states:" msgstr "Состояния:" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 msgid "Cheats:" msgstr "Читы:" -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "Патчи:" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "Экспорты:" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 msgid "Game Data Locations" msgstr "данных игры" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "Сохранять SRAM:" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1467,141 +1476,141 @@ msgstr "" "Автоматически сохранять память игры через указанный интервал времени. Когда " "установлено в 0, сохранение будет производиться при выходе или смене ROM'а" -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "секунд после изменения" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 msgid "Automatic Saving" msgstr "Автоматическое сохранение" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "Файлы" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "Джойстик:" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "_Сбросить" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "Поменять с:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "_Поменять" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "Использовать клавиши-модификаторы (CTRL, SHIFT, ALT) напрямую" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "Позволить использование клавиш-модификаторов, как независимых клавиш" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "Вверх" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "Вниз" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "Налево" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "Направо" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "Start" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "Select" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "A" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "B" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "X" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "Y" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "L" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "R" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "Кнопки" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "Залипающие" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "Турбо" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "Турбо и залипающие кнопки" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "Установить новый привязки осей на:" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "" "Изменяет величину отклонения джойстика, чтобы зафиксировать нажатие кнопки" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "процентах" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "Порог осей джойстика" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "Установите все оси на всех джойстиках по центру и нажмите Калибровать." -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "Кали_бровать" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "Калибровка" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "Настройки джойстика" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" @@ -1611,273 +1620,273 @@ msgstr "" "Escape: Перейти к следующему Shift-Escape: Очистить " "выбранное" -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "Джойстики" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "Привязки клавиш эмулятора Snes9x" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "Сброс" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "Питание" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "Увеличить время кадра" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "Уменьшить время кадра" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "Увеличить частоту кадров" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "Уменьшить частоту кадров" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "Приостановить" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "Переключить турбо" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "Включить турбо" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "Открыть ROM" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "Переключить задний слой 1" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "Переключить задний слой 1" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "Переключить задний слой 2" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "Переключить задний слой 3" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "Переключить спрайты" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "Хак слоёв заднего фона" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "Снимок экрана" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "Переключить полный экран" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "Графика" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "Быстрое сохранение" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "Быстрая загрузка" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "Слот 0" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "Слот 1" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "Слот 2" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "Слот 3" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "Слот 4" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "Слот 5" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "Слот 6" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "Слот 7" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "Слот 8" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 #, fuzzy msgid "Slot 9" msgstr "Слот 1" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "Переключить звуковой канал 0" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "Переключить звуковой канал 1" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "Переключить звуковой канал 2" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "Переключить звуковой канал 3" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "Переключить звуковой канал 4" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "Переключить звуковой канал 5" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "Переключить звуковой канал 6" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "Переключить звуковой канал 7" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "Переключить все звуковые каналы" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "Перейти на фрейм" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "Загрузить видео" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "Остановить запись видео" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "Начать запись видео" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "Сохранить SPC" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "Поменять местами контроллеры 1 и 2" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "Ещё" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "Клавиши" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "Приостанавливать эмуляцию при переключении на другое окно" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "Клавиша ESC должна:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 #, fuzzy msgid "Window Behavior" msgstr "Смена окон" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "Предотвращать запуск хранителя экрана" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "Хранитель экрана" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" msgstr "" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" diff --git a/gtk/po/snes9x-gtk.pot b/gtk/po/snes9x-gtk.pot new file mode 100644 index 00000000..50ff9f03 --- /dev/null +++ b/gtk/po/snes9x-gtk.pot @@ -0,0 +1,1836 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the snes9x-gtk package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: snes9x-gtk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/gtk_binding.cpp:249 +#, c-format +msgid "Unknown" +msgstr "" + +#: src/gtk_binding.cpp:264 +#, c-format +msgid "Keyboard %s%s%s%s" +msgstr "" + +#: src/gtk_binding.cpp:275 +#, c-format +msgid "Axis %u %s %u%%" +msgstr "" + +#: src/gtk_binding.cpp:280 +#, c-format +msgid "Button %u" +msgstr "" + +#: src/gtk_binding.cpp:282 +#, c-format +msgid "Joystick %u %s" +msgstr "" + +#: src/gtk_binding.cpp:287 +#, c-format +msgid "Unset" +msgstr "" + +#: src/gtk_cheat.cpp:31 src/gtk_s9xwindow.cpp:864 src/gtk_s9xwindow.cpp:995 +#: src/gtk_s9xwindow.cpp:1292 +msgid "Error" +msgstr "" + +#: src/gtk_cheat.cpp:161 +msgid "Description" +msgstr "" + +#: src/gtk_cheat.cpp:172 +msgid "Cheat" +msgstr "" + +#: src/gtk_cheat.cpp:343 src/gtk_cheat.cpp:362 src/gtk_cheat.cpp:532 +msgid "No description" +msgstr "" + +#: src/gtk_cheat.cpp:366 src/gtk_cheat.cpp:537 +msgid "Couldn't find any cheat codes in input." +msgstr "" + +#: src/gtk_cheat.cpp:472 +msgid "Couldn't Find Cheats Database" +msgstr "" + +#: src/gtk_cheat.cpp:473 +msgid "No Matching Game Found" +msgstr "" + +#: src/gtk_cheat.cpp:476 +msgid "" +"The database file cheats.bml was not found. It is normally installed " +"with Snes9x, but you may also place a custom copy in your configuration or " +"cheats directory." +msgstr "" + +#: src/gtk_cheat.cpp:478 +msgid "" +"No matching game was found in the databases. If you are using a non-official " +"translation or modified copy, you may be able to find and manually enter the " +"codes." +msgstr "" + +#: src/gtk_config.cpp:442 +#, c-format +msgid "Couldn't create config directory: %s\n" +msgstr "" + +#: src/gtk_netplay.cpp:62 +msgid "Connection Error" +msgstr "" + +#: src/gtk_preferences.cpp:18 +msgid "Same location as current game" +msgstr "" + +#: src/gtk_preferences.cpp:417 +msgid "Current joystick centers have been saved." +msgstr "" + +#: src/gtk_preferences.cpp:418 +msgid "Calibration Complete" +msgstr "" + +#: src/gtk_preferences.cpp:460 +msgid "Snes9x version: " +msgstr "" + +#: src/gtk_preferences.cpp:461 +msgid "GTK+ port version: " +msgstr "" + +#: src/gtk_preferences.cpp:463 +msgid "English localization by Brandon Wright" +msgstr "" + +#: src/gtk_preferences.cpp:945 +msgid "" +"Changing the SRAM directory with a game loaded will replace the .srm file in " +"the selected directory with the SRAM from the running game. If this is not " +"what you want, click 'cancel'." +msgstr "" + +#: src/gtk_preferences.cpp:946 +msgid "Warning: Possible File Overwrite" +msgstr "" + +#: src/gtk_preferences.cpp:1027 +msgid "Select Folder" +msgstr "" + +#: src/gtk_preferences.cpp:1104 +msgid "HQ2x" +msgstr "" + +#: src/gtk_preferences.cpp:1105 +msgid "HQ3x" +msgstr "" + +#: src/gtk_preferences.cpp:1106 +msgid "HQ4x" +msgstr "" + +#: src/gtk_preferences.cpp:1111 +msgid "2xBRZ" +msgstr "" + +#: src/gtk_preferences.cpp:1112 +msgid "3xBRZ" +msgstr "" + +#: src/gtk_preferences.cpp:1113 +msgid "4xBRZ" +msgstr "" + +#: src/gtk_preferences.cpp:1118 +msgid "None - Use software scaler" +msgstr "" + +#: src/gtk_preferences.cpp:1122 +msgid "OpenGL - Use 3D graphics hardware" +msgstr "" + +#: src/gtk_preferences.cpp:1126 +msgid "XVideo - Use hardware video blitter" +msgstr "" + +#: src/gtk_preferences.cpp:1132 +msgid "PortAudio" +msgstr "" + +#: src/gtk_preferences.cpp:1136 +msgid "Open Sound System" +msgstr "" + +#: src/gtk_preferences.cpp:1139 +msgid "SDL" +msgstr "" + +#: src/gtk_preferences.cpp:1142 +msgid "ALSA" +msgstr "" + +#: src/gtk_preferences.cpp:1146 +msgid "PulseAudio" +msgstr "" + +#: src/gtk_s9x.cpp:205 +#, c-format +msgid "Error opening: %s\n" +msgstr "" + +#: src/gtk_s9xwindow.cpp:863 +msgid "Couldn't load files." +msgstr "" + +#: src/gtk_s9xwindow.cpp:892 +msgid "Open SNES Movie" +msgstr "" + +#: src/gtk_s9xwindow.cpp:911 +msgid "New SNES Movie" +msgstr "" + +#: src/gtk_s9xwindow.cpp:924 +msgid "SNES Movies" +msgstr "" + +#: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 +msgid "All Files" +msgstr "" + +#: src/gtk_s9xwindow.cpp:993 +#, c-format +msgid "Couldn't load file '%s'" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1052 +msgid "Load Saved State" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 +msgid "Save States" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1120 +#, c-format +msgid "The current frame in the movie is %d." +msgstr "" + +#: src/gtk_s9xwindow.cpp:1170 +msgid "Save State" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1246 +msgid "Save SPC file..." +msgstr "" + +#: src/gtk_s9xwindow.cpp:1259 +msgid "SPC Files" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1290 +#, c-format +msgid "Couldn't save SPC file '%s'" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1330 +#, c-format +msgid "" +"Information for %s\n" +"\n" +"Name: %s\n" +"Speed: %02X/%s\n" +"Map: %s\n" +"Type: %02x\n" +"Contents: %s\n" +"ROM Size: %s\n" +"Calculated Size: %d\n" +"SRAM Size: %s\n" +"Header Checksum: %04X\n" +"Checksum Compliment: %04X\n" +"Actual Checksum: %04X\n" +"Video: %s\n" +"CRC32: %08X\n" +"Revision: %s%s%s" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1366 +msgid "" +"\n" +"\n" +"This ROM has been auto-patched with " +msgstr "" + +#: src/gtk_s9xwindow.cpp:1369 +msgid "" +"\n" +"\n" +"This ROM has been modified or damaged" +msgstr "" + +#: src/gtk_s9xwindow.cpp:1375 +msgid "File Information" +msgstr "" + +#: src/gtk_shader_parameters.cpp:99 +msgid "Export Shader Preset to:" +msgstr "" + +#: src/gtk_shader_parameters.cpp:124 +msgid "Shader Preset" +msgstr "" + +#: src/gtk_shader_parameters.cpp:169 +msgid "Shader Parameters" +msgstr "" + +#: src/gtk_file.cpp:424 +msgid "Open SNES ROM Image" +msgstr "" + +#: src/gtk_file.cpp:432 +msgid "SNES ROM Images" +msgstr "" + +#: src/snes9x.ui:9 +msgid "About Snes9x" +msgstr "" + +#: src/snes9x.ui:48 +msgid "label106" +msgstr "" + +#: src/snes9x.ui:271 +msgid "Snes9x Cheats" +msgstr "" + +#: src/snes9x.ui:389 +msgid "Update Cheat" +msgstr "" + +#: src/snes9x.ui:404 +msgid "Disable All" +msgstr "" + +#: src/snes9x.ui:420 +msgid "Delete All Cheats" +msgstr "" + +#: src/snes9x.ui:435 +msgid "Search Cheat Database" +msgstr "" + +#: src/snes9x.ui:477 +msgid "Code:" +msgstr "" + +#: src/snes9x.ui:514 +msgid "Description:" +msgstr "" + +#: src/snes9x.ui:561 +msgid "Advance to Frame" +msgstr "" + +#: src/snes9x.ui:630 +msgid "The current frame in the movie is" +msgstr "" + +#: src/snes9x.ui:651 +msgid "Fast-forward to frame" +msgstr "" + +#: src/snes9x.ui:812 +msgid "Black" +msgstr "" + +#: src/snes9x.ui:815 +msgid "Color bars" +msgstr "" + +#: src/snes9x.ui:818 +msgid "Pixel art patterns" +msgstr "" + +#: src/snes9x.ui:821 +msgid "Dithered gradient" +msgstr "" + +#: src/snes9x.ui:824 +msgid "Color bars and patterns" +msgstr "" + +#: src/snes9x.ui:827 +msgid "Starfield" +msgstr "" + +#: src/snes9x.ui:830 +msgid "Snow" +msgstr "" + +#: src/snes9x.ui:841 +msgid "Game Genie" +msgstr "" + +#: src/snes9x.ui:844 +msgid "Pro Action Replay" +msgstr "" + +#: src/snes9x.ui:847 +msgid "Goldfinger" +msgstr "" + +#: src/snes9x.ui:858 src/snes9x.ui:881 +msgid "12.5%" +msgstr "" + +#: src/snes9x.ui:861 src/snes9x.ui:884 +msgid "25%" +msgstr "" + +#: src/snes9x.ui:864 src/snes9x.ui:887 +msgid "50%" +msgstr "" + +#: src/snes9x.ui:867 src/snes9x.ui:890 +msgid "100%" +msgstr "" + +#: src/snes9x.ui:878 +msgid "0%" +msgstr "" + +#: src/snes9x.ui:901 src/snes9x.ui:1928 +msgid "None" +msgstr "" + +#: src/snes9x.ui:904 +msgid "SuperEagle" +msgstr "" + +#: src/snes9x.ui:907 +msgid "2xSaI" +msgstr "" + +#: src/snes9x.ui:910 +msgid "Super2xSaI" +msgstr "" + +#: src/snes9x.ui:913 +msgid "EPX" +msgstr "" + +#: src/snes9x.ui:916 +msgid "EPX Smooth" +msgstr "" + +#: src/snes9x.ui:919 +msgid "Blargg's NTSC" +msgstr "" + +#: src/snes9x.ui:922 +msgid "Scanlines" +msgstr "" + +#: src/snes9x.ui:925 +msgid "Simple2x" +msgstr "" + +#: src/snes9x.ui:928 +msgid "Simple3x" +msgstr "" + +#: src/snes9x.ui:931 +msgid "Simple4x" +msgstr "" + +#: src/snes9x.ui:942 +msgid "8:7 Square pixels" +msgstr "" + +#: src/snes9x.ui:945 +msgid "8:7 Square pixels, integer multiples" +msgstr "" + +#: src/snes9x.ui:948 +msgid "4:3 SNES correct aspect" +msgstr "" + +#: src/snes9x.ui:951 +msgid "4:3 SNES correct aspect, integer multiples" +msgstr "" + +#: src/snes9x.ui:954 +msgid "8*8:7*7 NTSC" +msgstr "" + +#: src/snes9x.ui:957 +msgid "8*8:7*7 NTSC, integer multiples" +msgstr "" + +#: src/snes9x.ui:974 +msgid "Merge adjacent pairs" +msgstr "" + +#: src/snes9x.ui:977 +msgid "Output directly" +msgstr "" + +#: src/snes9x.ui:980 +msgid "Scale low-resolution screens" +msgstr "" + +#: src/snes9x.ui:991 src/snes9x.ui:1029 +msgid "1" +msgstr "" + +#: src/snes9x.ui:994 src/snes9x.ui:1032 +msgid "2" +msgstr "" + +#: src/snes9x.ui:997 src/snes9x.ui:1035 +msgid "3" +msgstr "" + +#: src/snes9x.ui:1000 src/snes9x.ui:1038 +msgid "4" +msgstr "" + +#: src/snes9x.ui:1003 src/snes9x.ui:1041 +msgid "5" +msgstr "" + +#: src/snes9x.ui:1006 src/snes9x.ui:1044 +msgid "1+" +msgstr "" + +#: src/snes9x.ui:1009 src/snes9x.ui:1047 +msgid "2+" +msgstr "" + +#: src/snes9x.ui:1012 src/snes9x.ui:1050 +msgid "3+" +msgstr "" + +#: src/snes9x.ui:1015 src/snes9x.ui:1053 +msgid "4+" +msgstr "" + +#: src/snes9x.ui:1018 src/snes9x.ui:1056 +msgid "5+" +msgstr "" + +#: src/snes9x.ui:1067 +msgid "Toggle the menu bar" +msgstr "" + +#: src/snes9x.ui:1070 +msgid "Exit fullscreen mode" +msgstr "" + +#: src/snes9x.ui:1073 src/snes9x.ui:6917 +msgid "Quit Snes9x" +msgstr "" + +#: src/snes9x.ui:1084 +msgid "Timer-based" +msgstr "" + +#: src/snes9x.ui:1087 +msgid "Timer-based with automatic frame-skipping" +msgstr "" + +#: src/snes9x.ui:1090 +msgid "Sound buffer synchronization" +msgstr "" + +#: src/snes9x.ui:1093 +msgid "No throttling, use vsync to control speed" +msgstr "" + +#: src/snes9x.ui:1104 +msgid "48000 hz" +msgstr "" + +#: src/snes9x.ui:1107 +msgid "44100 hz" +msgstr "" + +#: src/snes9x.ui:1110 +msgid "32000 hz" +msgstr "" + +#: src/snes9x.ui:1113 +msgid "22050 hz" +msgstr "" + +#: src/snes9x.ui:1116 +msgid "16000 hz" +msgstr "" + +#: src/snes9x.ui:1119 +msgid "11025 hz" +msgstr "" + +#: src/snes9x.ui:1122 +msgid "8000 hz" +msgstr "" + +#: src/snes9x.ui:1125 +msgid "0 hz" +msgstr "" + +#: src/snes9x.ui:1142 +msgid "16-bit (GL_RGB)" +msgstr "" + +#: src/snes9x.ui:1145 +msgid "32-bit (GL_BGRA)" +msgstr "" + +#: src/snes9x.ui:1156 +msgid "Nearest" +msgstr "" + +#: src/snes9x.ui:1159 +msgid "Linear" +msgstr "" + +#: src/snes9x.ui:1162 +msgid "Gaussian (correct)" +msgstr "" + +#: src/snes9x.ui:1165 +msgid "Cubic" +msgstr "" + +#: src/snes9x.ui:1168 +msgid "Sinc" +msgstr "" + +#: src/snes9x.ui:1181 +msgid "Snes9x" +msgstr "" + +#: src/snes9x.ui:1201 +msgid "_File" +msgstr "" + +#: src/snes9x.ui:1208 +msgid "_Open ROM Image..." +msgstr "" + +#: src/snes9x.ui:1222 +msgid "Open Recent" +msgstr "" + +#: src/snes9x.ui:1234 +msgid "Open with _NetPlay..." +msgstr "" + +#: src/snes9x.ui:1237 +msgid "Open a ROM to use with NetPlay" +msgstr "" + +#: src/snes9x.ui:1248 +msgid "Open _MultiCart..." +msgstr "" + +#: src/snes9x.ui:1263 +msgid "_Load State" +msgstr "" + +#: src/snes9x.ui:1273 src/snes9x.ui:1407 +msgid "Slot _0" +msgstr "" + +#: src/snes9x.ui:1282 src/snes9x.ui:1416 +msgid "Slot _1" +msgstr "" + +#: src/snes9x.ui:1291 src/snes9x.ui:1425 +msgid "Slot _2" +msgstr "" + +#: src/snes9x.ui:1300 src/snes9x.ui:1434 +msgid "Slot _3" +msgstr "" + +#: src/snes9x.ui:1309 src/snes9x.ui:1443 +msgid "Slot _4" +msgstr "" + +#: src/snes9x.ui:1318 src/snes9x.ui:1452 +msgid "Slot _5" +msgstr "" + +#: src/snes9x.ui:1327 src/snes9x.ui:1461 +msgid "Slot _6" +msgstr "" + +#: src/snes9x.ui:1336 src/snes9x.ui:1470 +msgid "Slot _7" +msgstr "" + +#: src/snes9x.ui:1345 src/snes9x.ui:1479 +msgid "Slot _8" +msgstr "" + +#: src/snes9x.ui:1354 src/snes9x.ui:1488 +msgid "Slot _9" +msgstr "" + +#: src/snes9x.ui:1369 +msgid "From _File..." +msgstr "" + +#: src/snes9x.ui:1384 +msgid "_Undo Load State" +msgstr "" + +#: src/snes9x.ui:1397 +msgid "_Save State" +msgstr "" + +#: src/snes9x.ui:1503 +msgid "To _File..." +msgstr "" + +#: src/snes9x.ui:1520 +msgid "Save SPC..." +msgstr "" + +#: src/snes9x.ui:1537 +msgid "Show ROM _Info..." +msgstr "" + +#: src/snes9x.ui:1554 +msgid "_Quit" +msgstr "" + +#: src/snes9x.ui:1571 +msgid "_Emulation" +msgstr "" + +#: src/snes9x.ui:1578 +msgid "Run / _Continue" +msgstr "" + +#: src/snes9x.ui:1589 +msgid "_Pause" +msgstr "" + +#: src/snes9x.ui:1607 +msgid "Load _Movie..." +msgstr "" + +#: src/snes9x.ui:1619 +msgid "R_ecord Movie..." +msgstr "" + +#: src/snes9x.ui:1631 +msgid "_Stop Recording" +msgstr "" + +#: src/snes9x.ui:1643 +msgid "_Jump to Frame..." +msgstr "" + +#: src/snes9x.ui:1661 +msgid "Sy_nc Clients" +msgstr "" + +#: src/snes9x.ui:1678 +msgid "Reset" +msgstr "" + +#: src/snes9x.ui:1690 +msgid "Soft _Reset" +msgstr "" + +#: src/snes9x.ui:1707 +msgid "_View" +msgstr "" + +#: src/snes9x.ui:1715 +msgid "_Toggle Menubar" +msgstr "" + +#: src/snes9x.ui:1732 +msgid "_Change Size" +msgstr "" + +#: src/snes9x.ui:1746 +msgid "_1x" +msgstr "" + +#: src/snes9x.ui:1755 +msgid "_2x" +msgstr "" + +#: src/snes9x.ui:1764 +msgid "_3x" +msgstr "" + +#: src/snes9x.ui:1773 +msgid "_4x" +msgstr "" + +#: src/snes9x.ui:1782 +msgid "_5x" +msgstr "" + +#: src/snes9x.ui:1799 +msgid "_Fullscreen" +msgstr "" + +#: src/snes9x.ui:1816 +msgid "_Options" +msgstr "" + +#: src/snes9x.ui:1825 +msgid "Controller Ports" +msgstr "" + +#: src/snes9x.ui:1834 +msgid "SNES Port 1" +msgstr "" + +#: src/snes9x.ui:1844 src/snes9x.ui:1888 +msgid "Joypad" +msgstr "" + +#: src/snes9x.ui:1853 src/snes9x.ui:1897 +msgid "Mouse" +msgstr "" + +#: src/snes9x.ui:1863 src/snes9x.ui:1917 +msgid "Superscope" +msgstr "" + +#: src/snes9x.ui:1878 +msgid "SNES Port 2" +msgstr "" + +#: src/snes9x.ui:1907 +msgid "Multitap" +msgstr "" + +#: src/snes9x.ui:1954 +msgid "_Cheats..." +msgstr "" + +#: src/snes9x.ui:1968 +msgid "_Shader Parameters..." +msgstr "" + +#: src/snes9x.ui:1984 +msgid "_Preferences..." +msgstr "" + +#: src/snes9x.ui:2029 +msgid "Open Multiple ROM Images (MultiCart)" +msgstr "" + +#: src/snes9x.ui:2092 +msgid "Slot A:" +msgstr "" + +#: src/snes9x.ui:2104 +msgid "Select an Image for Slot A" +msgstr "" + +#: src/snes9x.ui:2128 +msgid "Slot B:" +msgstr "" + +#: src/snes9x.ui:2140 +msgid "Select an Image for Slot B" +msgstr "" + +#: src/snes9x.ui:2172 +msgid "Snes9x NetPlay" +msgstr "" + +#: src/snes9x.ui:2249 +msgid "" +"The game chosen will be loaded before connecting. This field can be blank if " +"the server will send the ROM image" +msgstr "" + +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 +msgid "Browse..." +msgstr "" + +#: src/snes9x.ui:2286 +msgid "Clear entry" +msgstr "" + +#: src/snes9x.ui:2306 +msgid "ROM Image" +msgstr "" + +#: src/snes9x.ui:2335 +msgid "Connect to another computer" +msgstr "" + +#: src/snes9x.ui:2339 +msgid "Connect to another computer that is running Snes9x NetPlay as a server" +msgstr "" + +#: src/snes9x.ui:2359 +msgid "Name or IP address:" +msgstr "" + +#: src/snes9x.ui:2371 +msgid "Domain name or internet protocol address of a remote computer" +msgstr "" + +#: src/snes9x.ui:2387 +msgid "Port:" +msgstr "" + +#: src/snes9x.ui:2399 +msgid "Connect to specified TCP port on remote computer" +msgstr "" + +#: src/snes9x.ui:2424 +msgid "Act as a server" +msgstr "" + +#: src/snes9x.ui:2428 +msgid "" +"Host a game on this computer as Player 1, requiring extra throughput to " +"support multitple users" +msgstr "" + +#: src/snes9x.ui:2448 +msgid "Server" +msgstr "" + +#: src/snes9x.ui:2478 +msgid "Sync using reset" +msgstr "" + +#: src/snes9x.ui:2482 +msgid "" +"Reset the game when players join instead of transferring potentially " +"unreliable freeze states" +msgstr "" + +#: src/snes9x.ui:2493 +msgid "Send ROM image to clients" +msgstr "" + +#: src/snes9x.ui:2497 +msgid "" +"Send the running game image to players instead of requiring them to have " +"their own copies" +msgstr "" + +#: src/snes9x.ui:2515 +msgid "Default port:" +msgstr "" + +#: src/snes9x.ui:2527 +msgid "TCP port used as a connection point for remote clients" +msgstr "" + +#: src/snes9x.ui:2559 +msgid "Ask server to pause when" +msgstr "" + +#: src/snes9x.ui:2589 +msgid "frames behind" +msgstr "" + +#: src/snes9x.ui:2612 +msgid "Settings" +msgstr "" + +#: src/snes9x.ui:2640 +msgid "Snes9x Preferences" +msgstr "" + +#: src/snes9x.ui:2756 +msgid "Use fullscreen on ROM open" +msgstr "" + +#: src/snes9x.ui:2760 +msgid "Go to fullscreen mode immediately after opening a ROM" +msgstr "" + +#: src/snes9x.ui:2772 +msgid "Show local time" +msgstr "" + +#: src/snes9x.ui:2787 +msgid "Show frame rate" +msgstr "" + +#: src/snes9x.ui:2802 +msgid "Show pressed keys" +msgstr "" + +#: src/snes9x.ui:2817 +msgid "Use overscanned height" +msgstr "" + +#: src/snes9x.ui:2821 +msgid "Use SNES extended height. Will probably cause letterboxing" +msgstr "" + +#: src/snes9x.ui:2838 +msgid "Change fullscreen resolution:" +msgstr "" + +#: src/snes9x.ui:2842 +msgid "Changes the screen resolution when running Snes9x in fullscreen mode" +msgstr "" + +#: src/snes9x.ui:2885 +msgid "Basic Settings" +msgstr "" + +#: src/snes9x.ui:2926 +msgid "Scale image to fit window" +msgstr "" + +#: src/snes9x.ui:2930 +msgid "Scales the image so no black bars are present" +msgstr "" + +#: src/snes9x.ui:2950 +msgid "Aspect ratio:" +msgstr "" + +#: src/snes9x.ui:2985 +msgid "Maintain aspect-ratio" +msgstr "" + +#: src/snes9x.ui:2989 +msgid "Scales the image as large as possible without distortion" +msgstr "" + +#: src/snes9x.ui:3006 +msgid "Use " +msgstr "" + +#: src/snes9x.ui:3010 +msgid "Allows scaling and filtering to use multiple processors" +msgstr "" + +#: src/snes9x.ui:3042 +msgid "threads for filtering and scaling" +msgstr "" + +#: src/snes9x.ui:3066 +msgid "High-resolution effect:" +msgstr "" + +#: src/snes9x.ui:3109 +msgid "Apply scaling filter:" +msgstr "" + +#: src/snes9x.ui:3177 +msgid "Video preset:" +msgstr "" + +#: src/snes9x.ui:3191 +msgid "Composite" +msgstr "" + +#: src/snes9x.ui:3205 +msgid "S-Video" +msgstr "" + +#: src/snes9x.ui:3219 +msgid "RGB" +msgstr "" + +#: src/snes9x.ui:3233 +msgid "Monochrome" +msgstr "" + +#: src/snes9x.ui:3274 +msgid "Artifacts:" +msgstr "" + +#: src/snes9x.ui:3289 +msgid "Sharpness:" +msgstr "" + +#: src/snes9x.ui:3304 +msgid "Brightness:" +msgstr "" + +#: src/snes9x.ui:3319 +msgid "Contrast:" +msgstr "" + +#: src/snes9x.ui:3334 +msgid "Saturation:" +msgstr "" + +#: src/snes9x.ui:3349 +msgid "Hue:" +msgstr "" + +#: src/snes9x.ui:3550 +msgid "Gamma:" +msgstr "" + +#: src/snes9x.ui:3565 +msgid "Fringing:" +msgstr "" + +#: src/snes9x.ui:3580 +msgid "Bleed:" +msgstr "" + +#: src/snes9x.ui:3595 +msgid "Resolution:" +msgstr "" + +#: src/snes9x.ui:3625 +msgid "Merge odd and even fields" +msgstr "" + +#: src/snes9x.ui:3647 src/snes9x.ui:3706 +msgid "Scanline intensity:" +msgstr "" + +#: src/snes9x.ui:3751 +msgid "Scaling" +msgstr "" + +#: src/snes9x.ui:3793 +msgid "Bilinear-filter output" +msgstr "" + +#: src/snes9x.ui:3814 +msgid "Sync to vertical blank" +msgstr "" + +#: src/snes9x.ui:3818 +msgid "Sync the image to the vertical retrace to stop tearing" +msgstr "" + +#: src/snes9x.ui:3830 +msgid "Reduce input lag with glFinish" +msgstr "" + +#: src/snes9x.ui:3834 +msgid "" +"Sync the program with the video output after every displayed frame to reduce " +"input latency" +msgstr "" + +#: src/snes9x.ui:3845 +msgid "Reduce input lag with sync control" +msgstr "" + +#: src/snes9x.ui:3849 +msgid "" +"More modern method for syncing the program with the video output to reduce " +"input latency. Allows GUI events to occur in the meantime" +msgstr "" + +#: src/snes9x.ui:3860 +msgid "Allow non-power-of-two textures" +msgstr "" + +#: src/snes9x.ui:3864 +msgid "Prevents edge artifacts, but can slow performance" +msgstr "" + +#: src/snes9x.ui:3875 +msgid "Use pixel-buffer objects" +msgstr "" + +#: src/snes9x.ui:3880 +msgid "Can be faster or slower depending on drivers" +msgstr "" + +#: src/snes9x.ui:3900 +msgid "Different formats can yield highly different performance" +msgstr "" + +#: src/snes9x.ui:3907 +msgid "Pixel-buffer format:" +msgstr "" + +#: src/snes9x.ui:3950 +msgid "Shader:" +msgstr "" + +#: src/snes9x.ui:4014 +msgid "Force an inverted byte-ordering" +msgstr "" + +#: src/snes9x.ui:4018 +msgid "" +"Forces a swapped byte-ordering for cases where the system's endian is used " +"instead of the video card" +msgstr "" + +#: src/snes9x.ui:4042 +msgid "Hardware Acceleration" +msgstr "" + +#: src/snes9x.ui:4071 +msgid "Display" +msgstr "" + +#: src/snes9x.ui:4124 +msgid "Sound driver:" +msgstr "" + +#: src/snes9x.ui:4159 +msgid "Automatically adjust input rate to display" +msgstr "" + +#: src/snes9x.ui:4163 +msgid "Sets the correct input rate based on the display's refresh rate" +msgstr "" + +#: src/snes9x.ui:4175 +msgid "Dynamic rate control" +msgstr "" + +#: src/snes9x.ui:4179 +msgid "Smooth out slight hiccups in sound input rate" +msgstr "" + +#: src/snes9x.ui:4190 +msgid "Mute sound output" +msgstr "" + +#: src/snes9x.ui:4194 +msgid "Disables output of sound" +msgstr "" + +#: src/snes9x.ui:4206 +msgid "Mute sound when using turbo" +msgstr "" + +#: src/snes9x.ui:4210 +msgid "Disables output of sound when using turbo" +msgstr "" + +#: src/snes9x.ui:4233 +msgid "Playback rate:" +msgstr "" + +#: src/snes9x.ui:4268 +msgid "milliseconds" +msgstr "" + +#: src/snes9x.ui:4291 +msgid "Buffer size:" +msgstr "" + +#: src/snes9x.ui:4305 +msgid "Dynamic rate limit:" +msgstr "" + +#: src/snes9x.ui:4350 +msgid "Input rate:" +msgstr "" + +#: src/snes9x.ui:4363 +msgid "" +"Adjust to produce more or less data. Decrease the rate if experiencing " +"crackling. Increase the rate if experiencing frame-rate stuttering. Best " +"used with the \"Synchronize with sound\" option" +msgstr "" + +#: src/snes9x.ui:4412 +msgid "Video rate:" +msgstr "" + +#: src/snes9x.ui:4425 +msgid "label" +msgstr "" + +#: src/snes9x.ui:4450 +msgid "Sound Settings" +msgstr "" + +#: src/snes9x.ui:4484 src/snes9x.ui:8715 +msgid "Sound" +msgstr "" + +#: src/snes9x.ui:4542 +msgid "Throttling method:" +msgstr "" + +#: src/snes9x.ui:4584 +msgid "Speed Control" +msgstr "" + +#: src/snes9x.ui:4622 +msgid "Rewind buffer size (MB):" +msgstr "" + +#: src/snes9x.ui:4664 +msgid "Number of frames between rewind snapshots:" +msgstr "" + +#: src/snes9x.ui:4705 +msgid "Rewind Settings" +msgstr "" + +#: src/snes9x.ui:4736 +msgid "Allow invalid VRAM access" +msgstr "" + +#: src/snes9x.ui:4740 +msgid "" +"Allows ROM hacks to write to screen at the wrong time. Only use if you know " +"your ROM hack expects this" +msgstr "" + +#: src/snes9x.ui:4750 +msgid "Allow opposing dpad directions" +msgstr "" + +#: src/snes9x.ui:4754 +msgid "Let left and right or up and down be pressed at the same time" +msgstr "" + +#: src/snes9x.ui:4765 +msgid "Overclock CPU" +msgstr "" + +#: src/snes9x.ui:4769 +msgid "Reduces slowdown, but has potential to break games" +msgstr "" + +#: src/snes9x.ui:4780 +msgid "Remove sprite limit" +msgstr "" + +#: src/snes9x.ui:4784 +msgid "Reduces flicker, but may cause graphical artifacts" +msgstr "" + +#: src/snes9x.ui:4795 +msgid "Redirect echo buffer overflow" +msgstr "" + +#: src/snes9x.ui:4799 +msgid "Allows old addmusic hacks to work, but will likely hurt other games" +msgstr "" + +#: src/snes9x.ui:4817 +msgid "SuperFX clock speed %:" +msgstr "" + +#: src/snes9x.ui:4856 +msgid "Gaussian is the correct behavior for SNES hardware" +msgstr "" + +#: src/snes9x.ui:4863 +msgid "Sound filter:" +msgstr "" + +#: src/snes9x.ui:4900 +msgid "Hacks" +msgstr "" + +#: src/snes9x.ui:4942 src/snes9x.ui:7132 +msgid "Emulation" +msgstr "" + +#: src/snes9x.ui:5183 +msgid "SRAM:" +msgstr "" + +#: src/snes9x.ui:5195 +msgid "Save states:" +msgstr "" + +#: src/snes9x.ui:5209 +msgid "Cheats:" +msgstr "" + +#: src/snes9x.ui:5223 +msgid "Patches:" +msgstr "" + +#: src/snes9x.ui:5237 +msgid "Exports:" +msgstr "" + +#: src/snes9x.ui:5261 +msgid "Game Data Locations" +msgstr "" + +#: src/snes9x.ui:5294 +msgid "Save SRAM:" +msgstr "" + +#: src/snes9x.ui:5306 +msgid "" +"Automatically save the game's SRAM at this interval. Setting this to 0 will " +"only save when quitting or changing ROMs" +msgstr "" + +#: src/snes9x.ui:5325 +msgid "seconds after change" +msgstr "" + +#: src/snes9x.ui:5341 +msgid "Automatic Saving" +msgstr "" + +#: src/snes9x.ui:5378 +msgid "Files" +msgstr "" + +#: src/snes9x.ui:5409 +msgid "Joypad:" +msgstr "" + +#: src/snes9x.ui:5450 +msgid "_Reset" +msgstr "" + +#: src/snes9x.ui:5478 +msgid "Swap with:" +msgstr "" + +#: src/snes9x.ui:5506 +msgid "_Swap" +msgstr "" + +#: src/snes9x.ui:5528 +msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" +msgstr "" + +#: src/snes9x.ui:5532 +msgid "Allow using modifier keys as independent keys instead of modifiers" +msgstr "" + +#: src/snes9x.ui:5566 +msgid "Up" +msgstr "" + +#: src/snes9x.ui:5578 +msgid "Down" +msgstr "" + +#: src/snes9x.ui:5592 +msgid "Left" +msgstr "" + +#: src/snes9x.ui:5606 +msgid "Right" +msgstr "" + +#: src/snes9x.ui:5620 +msgid "Start" +msgstr "" + +#: src/snes9x.ui:5634 +msgid "Select" +msgstr "" + +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 +msgid "A" +msgstr "" + +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 +msgid "B" +msgstr "" + +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 +msgid "X" +msgstr "" + +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 +msgid "Y" +msgstr "" + +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 +msgid "L" +msgstr "" + +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 +msgid "R" +msgstr "" + +#: src/snes9x.ui:5977 +msgid "Buttons" +msgstr "" + +#: src/snes9x.ui:6418 +msgid "Sticky" +msgstr "" + +#: src/snes9x.ui:6434 +msgid "Turbo" +msgstr "" + +#: src/snes9x.ui:6453 +msgid "Turbo / Sticky Buttons" +msgstr "" + +#: src/snes9x.ui:6490 +msgid "Set new axis bindings at:" +msgstr "" + +#: src/snes9x.ui:6502 +msgid "" +"Changes the amount a joystick should be tilted to register a button press" +msgstr "" + +#: src/snes9x.ui:6521 +msgid "percent" +msgstr "" + +#: src/snes9x.ui:6538 +msgid "Joystick Axis Threshold" +msgstr "" + +#: src/snes9x.ui:6575 +msgid "Center all axes on all joysticks and press Calibrate." +msgstr "" + +#: src/snes9x.ui:6590 +msgid "Cali_brate" +msgstr "" + +#: src/snes9x.ui:6623 +msgid "Calibration" +msgstr "" + +#: src/snes9x.ui:6644 +msgid "Joystick Options" +msgstr "" + +#: src/snes9x.ui:6662 src/snes9x.ui:9014 +msgid "" +"Click an entry and then press the desired keys or joystick button\n" +"Escape: Move to next Shift-Escape: Clear selected" +msgstr "" + +#: src/snes9x.ui:6700 +msgid "Joypads" +msgstr "" + +#: src/snes9x.ui:6727 +msgid "Snes9x Emulator Shortcut Keys" +msgstr "" + +#: src/snes9x.ui:6778 +msgid "Soft reset" +msgstr "" + +#: src/snes9x.ui:6792 +msgid "Hardware reset" +msgstr "" + +#: src/snes9x.ui:6806 +msgid "Increase frame time" +msgstr "" + +#: src/snes9x.ui:6820 +msgid "Decrease frame time" +msgstr "" + +#: src/snes9x.ui:6834 +msgid "Increase frame rate" +msgstr "" + +#: src/snes9x.ui:6848 +msgid "Decrease frame rate" +msgstr "" + +#: src/snes9x.ui:6862 +msgid "Pause" +msgstr "" + +#: src/snes9x.ui:6876 +msgid "Toggle turbo" +msgstr "" + +#: src/snes9x.ui:6890 +msgid "Enable turbo" +msgstr "" + +#: src/snes9x.ui:6905 +msgid "Open ROM" +msgstr "" + +#: src/snes9x.ui:7164 +msgid "Toggle BG layer 0" +msgstr "" + +#: src/snes9x.ui:7176 +msgid "Toggle BG layer 1" +msgstr "" + +#: src/snes9x.ui:7190 +msgid "Toggle BG layer 2" +msgstr "" + +#: src/snes9x.ui:7204 +msgid "Toggle BG layer 3" +msgstr "" + +#: src/snes9x.ui:7218 +msgid "Toggle sprites" +msgstr "" + +#: src/snes9x.ui:7232 +msgid "BG layering hack" +msgstr "" + +#: src/snes9x.ui:7246 +msgid "Screenshot" +msgstr "" + +#: src/snes9x.ui:7260 +msgid "Toggle fullscreen" +msgstr "" + +#: src/snes9x.ui:7424 +msgid "Graphics" +msgstr "" + +#: src/snes9x.ui:7461 +msgid "Save current slot" +msgstr "" + +#: src/snes9x.ui:7494 +msgid "Load current slot" +msgstr "" + +#: src/snes9x.ui:7527 +msgid "Increment and save" +msgstr "" + +#: src/snes9x.ui:7560 +msgid "Decrement and load" +msgstr "" + +#: src/snes9x.ui:7593 +msgid "Increment slot" +msgstr "" + +#: src/snes9x.ui:7626 +msgid "Decrement slot" +msgstr "" + +#: src/snes9x.ui:7670 +msgid "Quick save state" +msgstr "" + +#: src/snes9x.ui:7685 +msgid "Quick load state" +msgstr "" + +#: src/snes9x.ui:7700 src/snes9x.ui:7840 +msgid "Slot 0" +msgstr "" + +#: src/snes9x.ui:7714 src/snes9x.ui:7856 +msgid "Slot 1" +msgstr "" + +#: src/snes9x.ui:7728 src/snes9x.ui:7872 +msgid "Slot 2" +msgstr "" + +#: src/snes9x.ui:7742 src/snes9x.ui:7888 +msgid "Slot 3" +msgstr "" + +#: src/snes9x.ui:7756 src/snes9x.ui:7904 +msgid "Slot 4" +msgstr "" + +#: src/snes9x.ui:7770 src/snes9x.ui:7920 +msgid "Slot 5" +msgstr "" + +#: src/snes9x.ui:7784 src/snes9x.ui:7936 +msgid "Slot 6" +msgstr "" + +#: src/snes9x.ui:7798 src/snes9x.ui:7952 +msgid "Slot 7" +msgstr "" + +#: src/snes9x.ui:7812 src/snes9x.ui:7968 +msgid "Slot 8" +msgstr "" + +#: src/snes9x.ui:7826 src/snes9x.ui:7984 +msgid "Slot 9" +msgstr "" + +#: src/snes9x.ui:8423 +msgid "Toggle sound channel 0" +msgstr "" + +#: src/snes9x.ui:8435 +msgid "Toggle sound channel 1" +msgstr "" + +#: src/snes9x.ui:8449 +msgid "Toggle sound channel 2" +msgstr "" + +#: src/snes9x.ui:8463 +msgid "Toggle sound channel 3" +msgstr "" + +#: src/snes9x.ui:8477 +msgid "Toggle sound channel 4" +msgstr "" + +#: src/snes9x.ui:8491 +msgid "Toggle sound channel 5" +msgstr "" + +#: src/snes9x.ui:8505 +msgid "Toggle sound channel 6" +msgstr "" + +#: src/snes9x.ui:8519 +msgid "Toggle sound channel 7" +msgstr "" + +#: src/snes9x.ui:8533 +msgid "Toggle all sound channels" +msgstr "" + +#: src/snes9x.ui:8738 +msgid "Seek to frame" +msgstr "" + +#: src/snes9x.ui:8753 +msgid "Load Movie" +msgstr "" + +#: src/snes9x.ui:8768 +msgid "Stop movie recording" +msgstr "" + +#: src/snes9x.ui:8783 +msgid "Begin movie recording" +msgstr "" + +#: src/snes9x.ui:8798 +msgid "Save SPC" +msgstr "" + +#: src/snes9x.ui:8898 +msgid "Swap controllers 1 & 2" +msgstr "" + +#: src/snes9x.ui:8929 +msgid "Rewind" +msgstr "" + +#: src/snes9x.ui:8960 +msgid "Capture/release mouse" +msgstr "" + +#: src/snes9x.ui:8996 +msgid "Misc" +msgstr "" + +#: src/snes9x.ui:9052 +msgid "Shortcuts" +msgstr "" + +#: src/snes9x.ui:9091 +msgid "Pause emulation when switching away from Snes9x" +msgstr "" + +#: src/snes9x.ui:9105 +msgid "Force-enable button and menu icons" +msgstr "" + +#: src/snes9x.ui:9126 +msgid "The ESC key should:" +msgstr "" + +#: src/snes9x.ui:9168 +msgid "Initial background:" +msgstr "" + +#: src/snes9x.ui:9209 +msgid "Window Behavior" +msgstr "" + +#: src/snes9x.ui:9239 +msgid "Prevent the screensaver from activating" +msgstr "" + +#: src/snes9x.ui:9259 +msgid "Screensaver" +msgstr "" + +#: src/snes9x.ui:9293 +msgid "UI" +msgstr "" + +#: src/snes9x.ui:9327 +msgid "" +" Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" +"\n" +" Snes9x homepage: http://www.snes9x.com/\n" +" Snes9x source code: https://github.com/snes9xgit/snes9x/\n" +"\n" +" Permission to use, copy, modify and/or distribute Snes9x in both binary\n" +" and source form, for non-commercial purposes, is hereby granted without\n" +" fee, providing that this license information and copyright notice appear\n" +" with all copies and any derived work.\n" +"\n" +" This software is provided 'as-is', without any express or implied\n" +" warranty. In no event shall the authors be held liable for any damages\n" +" arising from the use of this software or it's derivatives.\n" +"\n" +" Snes9x is freeware for PERSONAL USE only. Commercial users should\n" +" seek permission of the copyright holders first. Commercial use includes,\n" +" but is not limited to, charging money for Snes9x or software derived from\n" +" Snes9x, including Snes9x or derivatives in commercial game bundles, and/" +"or\n" +" using Snes9x as a promotion for your commercial product.\n" +"\n" +" The copyright holders request that bug fixes and improvements to the code\n" +" should be forwarded to them so everyone can benefit from the " +"modifications\n" +" in future versions.\n" +"\n" +" Super NES and Super Nintendo Entertainment System are trademarks of\n" +" Nintendo Co., Limited and its subsidiary companies." +msgstr "" diff --git a/gtk/po/sr@latin.po b/gtk/po/sr@latin.po index f94f4835..e2f87246 100644 --- a/gtk/po/sr@latin.po +++ b/gtk/po/sr@latin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-17 17:35-0400\n" +"POT-Creation-Date: 2020-06-12 02:37-0400\n" "PO-Revision-Date: 2010-01-02 12:20+0100\n" "Last-Translator: Milan Kostić \n" "Language-Team: Serbian / Srpski \n" @@ -222,7 +222,7 @@ msgid "SNES Movies" msgstr "SNES Filmovi" #: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 -#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:433 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 msgid "All Files" msgstr "Svi Fajlovi" @@ -235,7 +235,7 @@ msgstr "Ne mogu učitati fajl '%s'" msgid "Load Saved State" msgstr "Učitaj Snimljenu Poziciju" -#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8384 +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 msgid "Save States" msgstr "Pozicije" @@ -310,15 +310,16 @@ msgid "Shader Preset" msgstr "Hardverski reset" #: src/gtk_shader_parameters.cpp:169 -msgid "GLSL Shader Parameters" -msgstr "" +#, fuzzy +msgid "Shader Parameters" +msgstr "Hardverski reset" -#: src/gtk_file.cpp:417 +#: src/gtk_file.cpp:424 #, fuzzy msgid "Open SNES ROM Image" msgstr "_Otvori ROM..." -#: src/gtk_file.cpp:425 +#: src/gtk_file.cpp:432 #, fuzzy msgid "SNES ROM Images" msgstr "SNES Filmovi" @@ -392,505 +393,513 @@ msgstr "" msgid "Color bars and patterns" msgstr "" -#: src/snes9x.ui:835 -msgid "Game Genie" +#: src/snes9x.ui:827 +msgid "Starfield" msgstr "" -#: src/snes9x.ui:838 -msgid "Pro Action Replay" +#: src/snes9x.ui:830 +msgid "Snow" msgstr "" #: src/snes9x.ui:841 +msgid "Game Genie" +msgstr "" + +#: src/snes9x.ui:844 +msgid "Pro Action Replay" +msgstr "" + +#: src/snes9x.ui:847 msgid "Goldfinger" msgstr "" -#: src/snes9x.ui:852 src/snes9x.ui:875 +#: src/snes9x.ui:858 src/snes9x.ui:881 msgid "12.5%" msgstr "" -#: src/snes9x.ui:855 src/snes9x.ui:878 +#: src/snes9x.ui:861 src/snes9x.ui:884 msgid "25%" msgstr "" -#: src/snes9x.ui:858 src/snes9x.ui:881 +#: src/snes9x.ui:864 src/snes9x.ui:887 msgid "50%" msgstr "" -#: src/snes9x.ui:861 src/snes9x.ui:884 +#: src/snes9x.ui:867 src/snes9x.ui:890 msgid "100%" msgstr "" -#: src/snes9x.ui:872 +#: src/snes9x.ui:878 msgid "0%" msgstr "" -#: src/snes9x.ui:895 src/snes9x.ui:1922 +#: src/snes9x.ui:901 src/snes9x.ui:1928 msgid "None" msgstr "" -#: src/snes9x.ui:898 +#: src/snes9x.ui:904 #, fuzzy msgid "SuperEagle" msgstr "Superscope" -#: src/snes9x.ui:901 +#: src/snes9x.ui:907 msgid "2xSaI" msgstr "" -#: src/snes9x.ui:904 +#: src/snes9x.ui:910 msgid "Super2xSaI" msgstr "" -#: src/snes9x.ui:907 +#: src/snes9x.ui:913 msgid "EPX" msgstr "" -#: src/snes9x.ui:910 +#: src/snes9x.ui:916 msgid "EPX Smooth" msgstr "" -#: src/snes9x.ui:913 +#: src/snes9x.ui:919 msgid "Blargg's NTSC" msgstr "" -#: src/snes9x.ui:916 +#: src/snes9x.ui:922 #, fuzzy msgid "Scanlines" msgstr "Scanline intenzitet:" -#: src/snes9x.ui:919 +#: src/snes9x.ui:925 msgid "Simple2x" msgstr "" -#: src/snes9x.ui:922 +#: src/snes9x.ui:928 msgid "Simple3x" msgstr "" -#: src/snes9x.ui:925 +#: src/snes9x.ui:931 msgid "Simple4x" msgstr "" -#: src/snes9x.ui:936 +#: src/snes9x.ui:942 msgid "8:7 Square pixels" msgstr "" -#: src/snes9x.ui:939 +#: src/snes9x.ui:945 msgid "8:7 Square pixels, integer multiples" msgstr "" -#: src/snes9x.ui:942 +#: src/snes9x.ui:948 #, fuzzy msgid "4:3 SNES correct aspect" msgstr "Ispravan prizor" -#: src/snes9x.ui:945 +#: src/snes9x.ui:951 msgid "4:3 SNES correct aspect, integer multiples" msgstr "" -#: src/snes9x.ui:948 +#: src/snes9x.ui:954 msgid "8*8:7*7 NTSC" msgstr "" -#: src/snes9x.ui:951 +#: src/snes9x.ui:957 msgid "8*8:7*7 NTSC, integer multiples" msgstr "" -#: src/snes9x.ui:968 +#: src/snes9x.ui:974 msgid "Merge adjacent pairs" msgstr "" -#: src/snes9x.ui:971 +#: src/snes9x.ui:977 msgid "Output directly" msgstr "" -#: src/snes9x.ui:974 +#: src/snes9x.ui:980 msgid "Scale low-resolution screens" msgstr "" -#: src/snes9x.ui:985 src/snes9x.ui:1023 +#: src/snes9x.ui:991 src/snes9x.ui:1029 #, fuzzy msgid "1" msgstr "Original" -#: src/snes9x.ui:988 src/snes9x.ui:1026 +#: src/snes9x.ui:994 src/snes9x.ui:1032 #, fuzzy msgid "2" msgstr "2 puta" -#: src/snes9x.ui:991 src/snes9x.ui:1029 +#: src/snes9x.ui:997 src/snes9x.ui:1035 #, fuzzy msgid "3" msgstr "3 puta" -#: src/snes9x.ui:994 src/snes9x.ui:1032 +#: src/snes9x.ui:1000 src/snes9x.ui:1038 #, fuzzy msgid "4" msgstr "4 puta" -#: src/snes9x.ui:997 src/snes9x.ui:1035 +#: src/snes9x.ui:1003 src/snes9x.ui:1041 #, fuzzy msgid "5" msgstr "5 puta" -#: src/snes9x.ui:1000 src/snes9x.ui:1038 +#: src/snes9x.ui:1006 src/snes9x.ui:1044 msgid "1+" msgstr "" -#: src/snes9x.ui:1003 src/snes9x.ui:1041 +#: src/snes9x.ui:1009 src/snes9x.ui:1047 msgid "2+" msgstr "" -#: src/snes9x.ui:1006 src/snes9x.ui:1044 +#: src/snes9x.ui:1012 src/snes9x.ui:1050 msgid "3+" msgstr "" -#: src/snes9x.ui:1009 src/snes9x.ui:1047 +#: src/snes9x.ui:1015 src/snes9x.ui:1053 msgid "4+" msgstr "" -#: src/snes9x.ui:1012 src/snes9x.ui:1050 +#: src/snes9x.ui:1018 src/snes9x.ui:1056 msgid "5+" msgstr "" -#: src/snes9x.ui:1061 +#: src/snes9x.ui:1067 #, fuzzy msgid "Toggle the menu bar" msgstr "Uključi/Isključi turbo" -#: src/snes9x.ui:1064 +#: src/snes9x.ui:1070 #, fuzzy msgid "Exit fullscreen mode" msgstr "Koristi ceo ekran pri otvaranju ROMa" -#: src/snes9x.ui:1067 src/snes9x.ui:6911 +#: src/snes9x.ui:1073 src/snes9x.ui:6917 msgid "Quit Snes9x" msgstr "Isključi Snes9x" -#: src/snes9x.ui:1078 +#: src/snes9x.ui:1084 msgid "Timer-based" msgstr "" -#: src/snes9x.ui:1081 +#: src/snes9x.ui:1087 msgid "Timer-based with automatic frame-skipping" msgstr "" -#: src/snes9x.ui:1084 +#: src/snes9x.ui:1090 msgid "Sound buffer synchronization" msgstr "" -#: src/snes9x.ui:1087 +#: src/snes9x.ui:1093 msgid "No throttling, use vsync to control speed" msgstr "" -#: src/snes9x.ui:1098 +#: src/snes9x.ui:1104 msgid "48000 hz" msgstr "" -#: src/snes9x.ui:1101 +#: src/snes9x.ui:1107 msgid "44100 hz" msgstr "" -#: src/snes9x.ui:1104 +#: src/snes9x.ui:1110 msgid "32000 hz" msgstr "" -#: src/snes9x.ui:1107 +#: src/snes9x.ui:1113 msgid "22050 hz" msgstr "" -#: src/snes9x.ui:1110 +#: src/snes9x.ui:1116 msgid "16000 hz" msgstr "" -#: src/snes9x.ui:1113 +#: src/snes9x.ui:1119 msgid "11025 hz" msgstr "" -#: src/snes9x.ui:1116 +#: src/snes9x.ui:1122 msgid "8000 hz" msgstr "" -#: src/snes9x.ui:1119 +#: src/snes9x.ui:1125 msgid "0 hz" msgstr "" -#: src/snes9x.ui:1136 +#: src/snes9x.ui:1142 msgid "16-bit (GL_RGB)" msgstr "" -#: src/snes9x.ui:1139 +#: src/snes9x.ui:1145 msgid "32-bit (GL_BGRA)" msgstr "" -#: src/snes9x.ui:1150 +#: src/snes9x.ui:1156 msgid "Nearest" msgstr "" -#: src/snes9x.ui:1153 +#: src/snes9x.ui:1159 msgid "Linear" msgstr "" -#: src/snes9x.ui:1156 +#: src/snes9x.ui:1162 msgid "Gaussian (correct)" msgstr "" -#: src/snes9x.ui:1159 +#: src/snes9x.ui:1165 msgid "Cubic" msgstr "" -#: src/snes9x.ui:1162 +#: src/snes9x.ui:1168 msgid "Sinc" msgstr "" -#: src/snes9x.ui:1175 +#: src/snes9x.ui:1181 msgid "Snes9x" msgstr "Snes9x" -#: src/snes9x.ui:1195 +#: src/snes9x.ui:1201 msgid "_File" msgstr "_Fajl" -#: src/snes9x.ui:1202 +#: src/snes9x.ui:1208 #, fuzzy msgid "_Open ROM Image..." msgstr "_Otvori ROM..." -#: src/snes9x.ui:1216 +#: src/snes9x.ui:1222 msgid "Open Recent" msgstr "Otvori poslednje" -#: src/snes9x.ui:1228 +#: src/snes9x.ui:1234 msgid "Open with _NetPlay..." msgstr "Otvori uz _NetPlay..." -#: src/snes9x.ui:1231 +#: src/snes9x.ui:1237 msgid "Open a ROM to use with NetPlay" msgstr "Otvori ROM koji ćeš koristiti za NetPlay" -#: src/snes9x.ui:1242 +#: src/snes9x.ui:1248 #, fuzzy msgid "Open _MultiCart..." msgstr "_Otvori ROM..." -#: src/snes9x.ui:1257 +#: src/snes9x.ui:1263 msgid "_Load State" msgstr "_Učitaj poziciju" -#: src/snes9x.ui:1267 src/snes9x.ui:1401 +#: src/snes9x.ui:1273 src/snes9x.ui:1407 msgid "Slot _0" msgstr "" -#: src/snes9x.ui:1276 src/snes9x.ui:1410 +#: src/snes9x.ui:1282 src/snes9x.ui:1416 msgid "Slot _1" msgstr "" -#: src/snes9x.ui:1285 src/snes9x.ui:1419 +#: src/snes9x.ui:1291 src/snes9x.ui:1425 msgid "Slot _2" msgstr "" -#: src/snes9x.ui:1294 src/snes9x.ui:1428 +#: src/snes9x.ui:1300 src/snes9x.ui:1434 msgid "Slot _3" msgstr "" -#: src/snes9x.ui:1303 src/snes9x.ui:1437 +#: src/snes9x.ui:1309 src/snes9x.ui:1443 msgid "Slot _4" msgstr "" -#: src/snes9x.ui:1312 src/snes9x.ui:1446 +#: src/snes9x.ui:1318 src/snes9x.ui:1452 msgid "Slot _5" msgstr "" -#: src/snes9x.ui:1321 src/snes9x.ui:1455 +#: src/snes9x.ui:1327 src/snes9x.ui:1461 msgid "Slot _6" msgstr "" -#: src/snes9x.ui:1330 src/snes9x.ui:1464 +#: src/snes9x.ui:1336 src/snes9x.ui:1470 msgid "Slot _7" msgstr "" -#: src/snes9x.ui:1339 src/snes9x.ui:1473 +#: src/snes9x.ui:1345 src/snes9x.ui:1479 msgid "Slot _8" msgstr "" -#: src/snes9x.ui:1348 src/snes9x.ui:1482 +#: src/snes9x.ui:1354 src/snes9x.ui:1488 msgid "Slot _9" msgstr "" -#: src/snes9x.ui:1363 +#: src/snes9x.ui:1369 msgid "From _File..." msgstr "Iz _Fajla..." -#: src/snes9x.ui:1378 +#: src/snes9x.ui:1384 #, fuzzy msgid "_Undo Load State" msgstr "_Učitaj poziciju" -#: src/snes9x.ui:1391 +#: src/snes9x.ui:1397 msgid "_Save State" msgstr "_Snimi poziciju" -#: src/snes9x.ui:1497 +#: src/snes9x.ui:1503 msgid "To _File..." msgstr "Ka _Fajlu..." -#: src/snes9x.ui:1514 +#: src/snes9x.ui:1520 msgid "Save SPC..." msgstr "Snimi SPC..." -#: src/snes9x.ui:1531 +#: src/snes9x.ui:1537 msgid "Show ROM _Info..." msgstr "Prikaži informacije o ROMu..." -#: src/snes9x.ui:1548 +#: src/snes9x.ui:1554 msgid "_Quit" msgstr "_Izlaz" -#: src/snes9x.ui:1565 +#: src/snes9x.ui:1571 msgid "_Emulation" msgstr "_Emulacija" -#: src/snes9x.ui:1572 +#: src/snes9x.ui:1578 msgid "Run / _Continue" msgstr "Pokreni / _Nastavi" -#: src/snes9x.ui:1583 +#: src/snes9x.ui:1589 msgid "_Pause" msgstr "_Pauza" -#: src/snes9x.ui:1601 +#: src/snes9x.ui:1607 msgid "Load _Movie..." msgstr "Učitaj _film..." -#: src/snes9x.ui:1613 +#: src/snes9x.ui:1619 msgid "R_ecord Movie..." msgstr "S_nimi film..." -#: src/snes9x.ui:1625 +#: src/snes9x.ui:1631 msgid "_Stop Recording" msgstr "_Zaustavi snimanje" -#: src/snes9x.ui:1637 +#: src/snes9x.ui:1643 msgid "_Jump to Frame..." msgstr "_Pređi na frejm..." -#: src/snes9x.ui:1655 +#: src/snes9x.ui:1661 msgid "Sy_nc Clients" msgstr "Si_nhronizuj klijente" -#: src/snes9x.ui:1672 +#: src/snes9x.ui:1678 msgid "Reset" msgstr "Hardverski reset" -#: src/snes9x.ui:1684 +#: src/snes9x.ui:1690 msgid "Soft _Reset" msgstr "Softverski _reset" -#: src/snes9x.ui:1701 +#: src/snes9x.ui:1707 msgid "_View" msgstr "_Pregled" -#: src/snes9x.ui:1709 +#: src/snes9x.ui:1715 #, fuzzy msgid "_Toggle Menubar" msgstr "Uključi/Isključi turbo" -#: src/snes9x.ui:1726 +#: src/snes9x.ui:1732 msgid "_Change Size" msgstr "_Promeni veličinu" -#: src/snes9x.ui:1740 +#: src/snes9x.ui:1746 msgid "_1x" msgstr "_Original" -#: src/snes9x.ui:1749 +#: src/snes9x.ui:1755 msgid "_2x" msgstr "_2 puta" -#: src/snes9x.ui:1758 +#: src/snes9x.ui:1764 msgid "_3x" msgstr "_3 puta" -#: src/snes9x.ui:1767 +#: src/snes9x.ui:1773 msgid "_4x" msgstr "_4 puta" -#: src/snes9x.ui:1776 +#: src/snes9x.ui:1782 msgid "_5x" msgstr "_5 puta" -#: src/snes9x.ui:1793 +#: src/snes9x.ui:1799 msgid "_Fullscreen" msgstr "_Ceo ekran" -#: src/snes9x.ui:1810 +#: src/snes9x.ui:1816 msgid "_Options" msgstr "_Opcije" -#: src/snes9x.ui:1819 +#: src/snes9x.ui:1825 msgid "Controller Ports" msgstr "Portovi kontrolera" -#: src/snes9x.ui:1828 +#: src/snes9x.ui:1834 msgid "SNES Port 1" msgstr "" -#: src/snes9x.ui:1838 src/snes9x.ui:1882 +#: src/snes9x.ui:1844 src/snes9x.ui:1888 msgid "Joypad" msgstr "Dzojped" -#: src/snes9x.ui:1847 src/snes9x.ui:1891 +#: src/snes9x.ui:1853 src/snes9x.ui:1897 msgid "Mouse" msgstr "Miš" -#: src/snes9x.ui:1857 src/snes9x.ui:1911 +#: src/snes9x.ui:1863 src/snes9x.ui:1917 msgid "Superscope" msgstr "Superscope" -#: src/snes9x.ui:1872 +#: src/snes9x.ui:1878 msgid "SNES Port 2" msgstr "" -#: src/snes9x.ui:1901 +#: src/snes9x.ui:1907 msgid "Multitap" msgstr "" -#: src/snes9x.ui:1948 +#: src/snes9x.ui:1954 msgid "_Cheats..." msgstr "_Varanja" -#: src/snes9x.ui:1962 +#: src/snes9x.ui:1968 msgid "_Shader Parameters..." msgstr "" -#: src/snes9x.ui:1978 +#: src/snes9x.ui:1984 msgid "_Preferences..." msgstr "_Podešavanja..." -#: src/snes9x.ui:2023 +#: src/snes9x.ui:2029 msgid "Open Multiple ROM Images (MultiCart)" msgstr "" -#: src/snes9x.ui:2086 +#: src/snes9x.ui:2092 msgid "Slot A:" msgstr "" -#: src/snes9x.ui:2098 +#: src/snes9x.ui:2104 msgid "Select an Image for Slot A" msgstr "" -#: src/snes9x.ui:2122 +#: src/snes9x.ui:2128 msgid "Slot B:" msgstr "" -#: src/snes9x.ui:2134 +#: src/snes9x.ui:2140 msgid "Select an Image for Slot B" msgstr "" -#: src/snes9x.ui:2166 +#: src/snes9x.ui:2172 msgid "Snes9x NetPlay" msgstr "Snes9x NetPlay" -#: src/snes9x.ui:2243 +#: src/snes9x.ui:2249 msgid "" "The game chosen will be loaded before connecting. This field can be blank if " "the server will send the ROM image" @@ -898,48 +907,48 @@ msgstr "" "Izabrana igra biće učitana pre konekcije. Ovo polje može biti prazno ako će " "server da pošalje ROM" -#: src/snes9x.ui:2258 src/snes9x.ui:3976 src/snes9x.ui:5091 src/snes9x.ui:5106 -#: src/snes9x.ui:5123 src/snes9x.ui:5140 src/snes9x.ui:5157 +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 msgid "Browse..." msgstr "Pretraži..." -#: src/snes9x.ui:2280 +#: src/snes9x.ui:2286 msgid "Clear entry" msgstr "Očisti upis" -#: src/snes9x.ui:2300 +#: src/snes9x.ui:2306 msgid "ROM Image" msgstr "ROM slika" -#: src/snes9x.ui:2329 +#: src/snes9x.ui:2335 msgid "Connect to another computer" msgstr "Poveži se sa drugim računarom" -#: src/snes9x.ui:2333 +#: src/snes9x.ui:2339 msgid "Connect to another computer that is running Snes9x NetPlay as a server" msgstr "Poveži se sa računarom kod koga je Snes9x NetPlay server" -#: src/snes9x.ui:2353 +#: src/snes9x.ui:2359 msgid "Name or IP address:" msgstr "Naziv ili IP adresa:" -#: src/snes9x.ui:2365 +#: src/snes9x.ui:2371 msgid "Domain name or internet protocol address of a remote computer" msgstr "Naziv domena ili adresa interent protokola udaljenog računara" -#: src/snes9x.ui:2381 +#: src/snes9x.ui:2387 msgid "Port:" msgstr "Port:" -#: src/snes9x.ui:2393 +#: src/snes9x.ui:2399 msgid "Connect to specified TCP port on remote computer" msgstr "Poveži se specifičnim TCP portom ka udaljenom računaru" -#: src/snes9x.ui:2418 +#: src/snes9x.ui:2424 msgid "Act as a server" msgstr "Radi kao server" -#: src/snes9x.ui:2422 +#: src/snes9x.ui:2428 msgid "" "Host a game on this computer as Player 1, requiring extra throughput to " "support multitple users" @@ -947,15 +956,15 @@ msgstr "" "Hostuj igru na ovom računaru kao Igrač 1. Ovo će zahtevati više propusne " "moći za podršku većeg broja korisnika" -#: src/snes9x.ui:2442 +#: src/snes9x.ui:2448 msgid "Server" msgstr "Server" -#: src/snes9x.ui:2472 +#: src/snes9x.ui:2478 msgid "Sync using reset" msgstr "Resetuj igru radi sinhronizacije" -#: src/snes9x.ui:2476 +#: src/snes9x.ui:2482 msgid "" "Reset the game when players join instead of transferring potentially " "unreliable freeze states" @@ -963,11 +972,11 @@ msgstr "" "Resetuj igru kada se igrači priključe, zbog mogućeg zamrzavanja i zbog " "pouzdanog prenosa" -#: src/snes9x.ui:2487 +#: src/snes9x.ui:2493 msgid "Send ROM image to clients" msgstr "Pošalji ROM sliku drugim klijentima" -#: src/snes9x.ui:2491 +#: src/snes9x.ui:2497 msgid "" "Send the running game image to players instead of requiring them to have " "their own copies" @@ -975,256 +984,256 @@ msgstr "" "Pošalji trenutnu igru drugim igračima, umesto da im tražite da imaju iste " "takve kopije" -#: src/snes9x.ui:2509 +#: src/snes9x.ui:2515 msgid "Default port:" msgstr "Podrazumevani port:" -#: src/snes9x.ui:2521 +#: src/snes9x.ui:2527 msgid "TCP port used as a connection point for remote clients" msgstr "" "Podrazumevani TCP port koji će se koristi za povezivanje sa udaljenim " "računarom" -#: src/snes9x.ui:2553 +#: src/snes9x.ui:2559 msgid "Ask server to pause when" msgstr "Server će pauzirati nakon" -#: src/snes9x.ui:2583 +#: src/snes9x.ui:2589 msgid "frames behind" msgstr "frejmova" -#: src/snes9x.ui:2606 +#: src/snes9x.ui:2612 msgid "Settings" msgstr "Podešavanja" -#: src/snes9x.ui:2634 +#: src/snes9x.ui:2640 msgid "Snes9x Preferences" msgstr "Snes9x Podešavanja" -#: src/snes9x.ui:2750 +#: src/snes9x.ui:2756 msgid "Use fullscreen on ROM open" msgstr "Koristi ceo ekran pri otvaranju ROMa" -#: src/snes9x.ui:2754 +#: src/snes9x.ui:2760 msgid "Go to fullscreen mode immediately after opening a ROM" msgstr "Pređi na ceo ekran odmah nakon otvaranja ROMa" -#: src/snes9x.ui:2766 +#: src/snes9x.ui:2772 #, fuzzy msgid "Show local time" msgstr "Prikaži vrednost frejmova" -#: src/snes9x.ui:2781 +#: src/snes9x.ui:2787 msgid "Show frame rate" msgstr "Prikaži vrednost frejmova" -#: src/snes9x.ui:2796 +#: src/snes9x.ui:2802 msgid "Show pressed keys" msgstr "" -#: src/snes9x.ui:2811 +#: src/snes9x.ui:2817 msgid "Use overscanned height" msgstr "Koristi prekomernu visinu" -#: src/snes9x.ui:2815 +#: src/snes9x.ui:2821 msgid "Use SNES extended height. Will probably cause letterboxing" msgstr "Korišćenje prekomerne visine će verovatno izazvati letterboxing" -#: src/snes9x.ui:2832 +#: src/snes9x.ui:2838 msgid "Change fullscreen resolution:" msgstr "Promena rezolucije za ceo ekran:" -#: src/snes9x.ui:2836 +#: src/snes9x.ui:2842 msgid "Changes the screen resolution when running Snes9x in fullscreen mode" msgstr "Ekranska rezolucija kada slika bude prekrila ceo ekran" -#: src/snes9x.ui:2879 +#: src/snes9x.ui:2885 #, fuzzy msgid "Basic Settings" msgstr "Osnovna podešavanja" -#: src/snes9x.ui:2920 +#: src/snes9x.ui:2926 msgid "Scale image to fit window" msgstr "Prilagodi sliku prozoru" -#: src/snes9x.ui:2924 +#: src/snes9x.ui:2930 msgid "Scales the image so no black bars are present" msgstr "Prilagodi sliku tako da se ne vide crni delovi" -#: src/snes9x.ui:2944 +#: src/snes9x.ui:2950 #, fuzzy msgid "Aspect ratio:" msgstr "Očuvaj proporciju prizora:" -#: src/snes9x.ui:2979 +#: src/snes9x.ui:2985 #, fuzzy msgid "Maintain aspect-ratio" msgstr "Očuvaj proporciju prizora:" -#: src/snes9x.ui:2983 +#: src/snes9x.ui:2989 msgid "Scales the image as large as possible without distortion" msgstr "Prilagodi sliku što je god moguće veću, ali bez izobličenja" -#: src/snes9x.ui:3000 +#: src/snes9x.ui:3006 msgid "Use " msgstr "Koristi " -#: src/snes9x.ui:3004 +#: src/snes9x.ui:3010 msgid "Allows scaling and filtering to use multiple processors" msgstr "Omogući većem broju CPU jezgara da ubrzaju skaliranje/filtere" -#: src/snes9x.ui:3036 +#: src/snes9x.ui:3042 msgid "threads for filtering and scaling" msgstr "niti za za filtriranje i prilagođavanje slike" -#: src/snes9x.ui:3060 +#: src/snes9x.ui:3066 msgid "High-resolution effect:" msgstr "" -#: src/snes9x.ui:3103 +#: src/snes9x.ui:3109 msgid "Apply scaling filter:" msgstr "Potvrdi filter za skaliranje" -#: src/snes9x.ui:3171 +#: src/snes9x.ui:3177 msgid "Video preset:" msgstr "Video postavke:" -#: src/snes9x.ui:3185 +#: src/snes9x.ui:3191 msgid "Composite" msgstr "Composite" -#: src/snes9x.ui:3199 +#: src/snes9x.ui:3205 msgid "S-Video" msgstr "" -#: src/snes9x.ui:3213 +#: src/snes9x.ui:3219 msgid "RGB" msgstr "RedGreenBlue" -#: src/snes9x.ui:3227 +#: src/snes9x.ui:3233 msgid "Monochrome" msgstr "MonoChrome" -#: src/snes9x.ui:3268 +#: src/snes9x.ui:3274 msgid "Artifacts:" msgstr "Artifakti:" -#: src/snes9x.ui:3283 +#: src/snes9x.ui:3289 msgid "Sharpness:" msgstr "Oštrina:" -#: src/snes9x.ui:3298 +#: src/snes9x.ui:3304 msgid "Brightness:" msgstr "Osvetljenje:" -#: src/snes9x.ui:3313 +#: src/snes9x.ui:3319 msgid "Contrast:" msgstr "Kontrast:" -#: src/snes9x.ui:3328 +#: src/snes9x.ui:3334 msgid "Saturation:" msgstr "Zasićenje:" -#: src/snes9x.ui:3343 +#: src/snes9x.ui:3349 msgid "Hue:" msgstr "Nijansa boje:" -#: src/snes9x.ui:3544 +#: src/snes9x.ui:3550 msgid "Gamma:" msgstr "Gama:" -#: src/snes9x.ui:3559 +#: src/snes9x.ui:3565 msgid "Fringing:" msgstr "" -#: src/snes9x.ui:3574 +#: src/snes9x.ui:3580 msgid "Bleed:" msgstr "Bledilo:" -#: src/snes9x.ui:3589 +#: src/snes9x.ui:3595 msgid "Resolution:" msgstr "Rezolucija:" -#: src/snes9x.ui:3619 +#: src/snes9x.ui:3625 msgid "Merge odd and even fields" msgstr "" -#: src/snes9x.ui:3641 src/snes9x.ui:3700 +#: src/snes9x.ui:3647 src/snes9x.ui:3706 msgid "Scanline intensity:" msgstr "Scanline intenzitet:" -#: src/snes9x.ui:3745 +#: src/snes9x.ui:3751 msgid "Scaling" msgstr "" -#: src/snes9x.ui:3787 +#: src/snes9x.ui:3793 msgid "Bilinear-filter output" msgstr "Bilinearno filtriranje" -#: src/snes9x.ui:3808 +#: src/snes9x.ui:3814 msgid "Sync to vertical blank" msgstr "Sinhronizacija sa vertikalnim osvežavanjem ekrana" -#: src/snes9x.ui:3812 +#: src/snes9x.ui:3818 msgid "Sync the image to the vertical retrace to stop tearing" msgstr "" "Sinhronizuje sliku sa vertikalnim osvežavanjem da bi se izbeglo 'suzenje'" -#: src/snes9x.ui:3824 +#: src/snes9x.ui:3830 msgid "Reduce input lag with glFinish" msgstr "" -#: src/snes9x.ui:3828 +#: src/snes9x.ui:3834 msgid "" "Sync the program with the video output after every displayed frame to reduce " "input latency" msgstr "" -#: src/snes9x.ui:3839 +#: src/snes9x.ui:3845 msgid "Reduce input lag with sync control" msgstr "" -#: src/snes9x.ui:3843 +#: src/snes9x.ui:3849 msgid "" "More modern method for syncing the program with the video output to reduce " "input latency. Allows GUI events to occur in the meantime" msgstr "" -#: src/snes9x.ui:3854 +#: src/snes9x.ui:3860 msgid "Allow non-power-of-two textures" msgstr "Dozvoli NPOT teksture" -#: src/snes9x.ui:3858 +#: src/snes9x.ui:3864 msgid "Prevents edge artifacts, but can slow performance" msgstr "" "Sprečava moguću pojavu artifakata na rubovima prikaza. Može usporiti, ali i " "ubrzati performanse - zavisno od drajvera." -#: src/snes9x.ui:3869 +#: src/snes9x.ui:3875 msgid "Use pixel-buffer objects" msgstr "Koristi pixel-buffer objects" -#: src/snes9x.ui:3874 +#: src/snes9x.ui:3880 msgid "Can be faster or slower depending on drivers" msgstr "Može biti i sporije i brže... zavisno od drajvera" -#: src/snes9x.ui:3894 +#: src/snes9x.ui:3900 msgid "Different formats can yield highly different performance" msgstr "Različiti formati mogu doprineti drugačijim performansama" -#: src/snes9x.ui:3901 +#: src/snes9x.ui:3907 msgid "Pixel-buffer format:" msgstr "" -#: src/snes9x.ui:3944 +#: src/snes9x.ui:3950 msgid "Shader:" msgstr "" -#: src/snes9x.ui:4008 +#: src/snes9x.ui:4014 msgid "Force an inverted byte-ordering" msgstr "Prisili na preinačeni poredak bajtova" -#: src/snes9x.ui:4012 +#: src/snes9x.ui:4018 msgid "" "Forces a swapped byte-ordering for cases where the system's endian is used " "instead of the video card" @@ -1232,74 +1241,74 @@ msgstr "" "Prisiljava na izmenu poretka bajtova u slučajevima kada se koristi sistemski " "endian umesto video kartice" -#: src/snes9x.ui:4036 +#: src/snes9x.ui:4042 #, fuzzy msgid "Hardware Acceleration" msgstr "Hardversko ubrzanje" -#: src/snes9x.ui:4065 +#: src/snes9x.ui:4071 msgid "Display" msgstr "Prikaz" -#: src/snes9x.ui:4118 +#: src/snes9x.ui:4124 msgid "Sound driver:" msgstr "Pokretač zvuka:" -#: src/snes9x.ui:4153 +#: src/snes9x.ui:4159 msgid "Automatically adjust input rate to display" msgstr "" -#: src/snes9x.ui:4157 +#: src/snes9x.ui:4163 msgid "Sets the correct input rate based on the display's refresh rate" msgstr "" -#: src/snes9x.ui:4169 +#: src/snes9x.ui:4175 msgid "Dynamic rate control" msgstr "" -#: src/snes9x.ui:4173 +#: src/snes9x.ui:4179 msgid "Smooth out slight hiccups in sound input rate" msgstr "" -#: src/snes9x.ui:4184 +#: src/snes9x.ui:4190 msgid "Mute sound output" msgstr "Priguši izvor zvuka" -#: src/snes9x.ui:4188 +#: src/snes9x.ui:4194 msgid "Disables output of sound" msgstr "Isključuje izvor zvuka" -#: src/snes9x.ui:4200 +#: src/snes9x.ui:4206 #, fuzzy -msgid "Mute sound when using turbo" +msgid "Mute sound when using turbo or rewind" msgstr "Priguši izvor zvuka" -#: src/snes9x.ui:4204 +#: src/snes9x.ui:4210 #, fuzzy -msgid "Disables output of sound when using turbo" +msgid "Disables output of sound when using turbo or rewind" msgstr "Isključuje izvor zvuka" -#: src/snes9x.ui:4227 +#: src/snes9x.ui:4233 msgid "Playback rate:" msgstr "Plejbek vrednost:" -#: src/snes9x.ui:4262 +#: src/snes9x.ui:4268 msgid "milliseconds" msgstr "milisekunde" -#: src/snes9x.ui:4285 +#: src/snes9x.ui:4291 msgid "Buffer size:" msgstr "Vrednost bafera: " -#: src/snes9x.ui:4299 +#: src/snes9x.ui:4305 msgid "Dynamic rate limit:" msgstr "" -#: src/snes9x.ui:4344 +#: src/snes9x.ui:4350 msgid "Input rate:" msgstr "Ulazna vrednost:" -#: src/snes9x.ui:4357 +#: src/snes9x.ui:4363 msgid "" "Adjust to produce more or less data. Decrease the rate if experiencing " "crackling. Increase the rate if experiencing frame-rate stuttering. Best " @@ -1310,144 +1319,144 @@ msgstr "" "zastajkivanje 'frejm-rejta'. Najbolje se koristi uz opciju \"Sinhronizacija " "sa zvukom\"" -#: src/snes9x.ui:4406 +#: src/snes9x.ui:4412 #, fuzzy msgid "Video rate:" msgstr "Video postavke:" -#: src/snes9x.ui:4419 +#: src/snes9x.ui:4425 msgid "label" msgstr "" -#: src/snes9x.ui:4444 +#: src/snes9x.ui:4450 msgid "Sound Settings" msgstr "Podešavanje zvuka" -#: src/snes9x.ui:4478 src/snes9x.ui:8709 +#: src/snes9x.ui:4484 src/snes9x.ui:8715 msgid "Sound" msgstr "Zvuk" -#: src/snes9x.ui:4536 +#: src/snes9x.ui:4542 msgid "Throttling method:" msgstr "" -#: src/snes9x.ui:4578 +#: src/snes9x.ui:4584 #, fuzzy msgid "Speed Control" msgstr "Server" -#: src/snes9x.ui:4616 +#: src/snes9x.ui:4622 #, fuzzy msgid "Rewind buffer size (MB):" msgstr "Vrednost bafera: " -#: src/snes9x.ui:4658 +#: src/snes9x.ui:4664 msgid "Number of frames between rewind snapshots:" msgstr "" -#: src/snes9x.ui:4699 +#: src/snes9x.ui:4705 #, fuzzy msgid "Rewind Settings" msgstr "Podešavanje zvuka" -#: src/snes9x.ui:4730 +#: src/snes9x.ui:4736 #, fuzzy msgid "Allow invalid VRAM access" msgstr "Blokiraj pogrešan pristup video memoriji" -#: src/snes9x.ui:4734 +#: src/snes9x.ui:4740 msgid "" "Allows ROM hacks to write to screen at the wrong time. Only use if you know " "your ROM hack expects this" msgstr "" -#: src/snes9x.ui:4744 +#: src/snes9x.ui:4750 msgid "Allow opposing dpad directions" msgstr "Dozvoli suprotne dpad pravce" -#: src/snes9x.ui:4748 +#: src/snes9x.ui:4754 msgid "Let left and right or up and down be pressed at the same time" msgstr "Levo-desno ili gore-dole će biti moguće istovremeno koristiti" -#: src/snes9x.ui:4759 +#: src/snes9x.ui:4765 msgid "Overclock CPU" msgstr "" -#: src/snes9x.ui:4763 +#: src/snes9x.ui:4769 msgid "Reduces slowdown, but has potential to break games" msgstr "" -#: src/snes9x.ui:4774 +#: src/snes9x.ui:4780 msgid "Remove sprite limit" msgstr "" -#: src/snes9x.ui:4778 +#: src/snes9x.ui:4784 msgid "Reduces flicker, but may cause graphical artifacts" msgstr "" -#: src/snes9x.ui:4789 +#: src/snes9x.ui:4795 msgid "Redirect echo buffer overflow" msgstr "" -#: src/snes9x.ui:4793 +#: src/snes9x.ui:4799 msgid "Allows old addmusic hacks to work, but will likely hurt other games" msgstr "" -#: src/snes9x.ui:4811 +#: src/snes9x.ui:4817 msgid "SuperFX clock speed %:" msgstr "" -#: src/snes9x.ui:4850 +#: src/snes9x.ui:4856 msgid "Gaussian is the correct behavior for SNES hardware" msgstr "" -#: src/snes9x.ui:4857 +#: src/snes9x.ui:4863 #, fuzzy msgid "Sound filter:" msgstr "Pokretač zvuka:" -#: src/snes9x.ui:4894 +#: src/snes9x.ui:4900 #, fuzzy msgid "Hacks" msgstr "Lepljiva" -#: src/snes9x.ui:4936 src/snes9x.ui:7126 +#: src/snes9x.ui:4942 src/snes9x.ui:7132 msgid "Emulation" msgstr "Emulacija" -#: src/snes9x.ui:5177 +#: src/snes9x.ui:5183 #, fuzzy msgid "SRAM:" msgstr "Sačuvaj SRAM:" -#: src/snes9x.ui:5189 +#: src/snes9x.ui:5195 #, fuzzy msgid "Save states:" msgstr "Pozicije" -#: src/snes9x.ui:5203 +#: src/snes9x.ui:5209 #, fuzzy msgid "Cheats:" msgstr "Varanja" -#: src/snes9x.ui:5217 +#: src/snes9x.ui:5223 msgid "Patches:" msgstr "" -#: src/snes9x.ui:5231 +#: src/snes9x.ui:5237 msgid "Exports:" msgstr "" -#: src/snes9x.ui:5255 +#: src/snes9x.ui:5261 #, fuzzy msgid "Game Data Locations" msgstr "Podaci igre" -#: src/snes9x.ui:5288 +#: src/snes9x.ui:5294 msgid "Save SRAM:" msgstr "Sačuvaj SRAM:" -#: src/snes9x.ui:5300 +#: src/snes9x.ui:5306 msgid "" "Automatically save the game's SRAM at this interval. Setting this to 0 will " "only save when quitting or changing ROMs" @@ -1455,414 +1464,414 @@ msgstr "" "Automatski snimaj SRAM igre u ovom intervalu. Vrednost 0 (nula) će snimati " "jedino pri izlasku iz emulatora ili pak pri promeni ROMova" -#: src/snes9x.ui:5319 +#: src/snes9x.ui:5325 msgid "seconds after change" msgstr "sekundi nakon promene" -#: src/snes9x.ui:5335 +#: src/snes9x.ui:5341 #, fuzzy msgid "Automatic Saving" msgstr "Osnovna podešavanja" -#: src/snes9x.ui:5372 +#: src/snes9x.ui:5378 msgid "Files" msgstr "Fajlovi" -#: src/snes9x.ui:5403 +#: src/snes9x.ui:5409 msgid "Joypad:" msgstr "Dzojped" -#: src/snes9x.ui:5444 +#: src/snes9x.ui:5450 msgid "_Reset" msgstr "_Resetuj" -#: src/snes9x.ui:5472 +#: src/snes9x.ui:5478 msgid "Swap with:" msgstr "Zameni sa:" -#: src/snes9x.ui:5500 +#: src/snes9x.ui:5506 msgid "_Swap" msgstr "_Zamena" -#: src/snes9x.ui:5522 +#: src/snes9x.ui:5528 msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" msgstr "Koristi mod. tastere (CTRL, SHIFT, ALT) direktno" -#: src/snes9x.ui:5526 +#: src/snes9x.ui:5532 msgid "Allow using modifier keys as independent keys instead of modifiers" msgstr "Dozvoli korišćenje modifikacijskih tastera kao nezavisnih tastera" -#: src/snes9x.ui:5560 +#: src/snes9x.ui:5566 msgid "Up" msgstr "Gore" -#: src/snes9x.ui:5572 +#: src/snes9x.ui:5578 msgid "Down" msgstr "Dole" -#: src/snes9x.ui:5586 +#: src/snes9x.ui:5592 msgid "Left" msgstr "Levo" -#: src/snes9x.ui:5600 +#: src/snes9x.ui:5606 msgid "Right" msgstr "Levo" -#: src/snes9x.ui:5614 +#: src/snes9x.ui:5620 msgid "Start" msgstr "Početak" -#: src/snes9x.ui:5628 +#: src/snes9x.ui:5634 msgid "Select" msgstr "Odaberi" -#: src/snes9x.ui:5769 src/snes9x.ui:5999 src/snes9x.ui:6211 +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 msgid "A" msgstr "A" -#: src/snes9x.ui:5781 src/snes9x.ui:6011 src/snes9x.ui:6223 +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 msgid "B" msgstr "B" -#: src/snes9x.ui:5795 src/snes9x.ui:6025 src/snes9x.ui:6237 +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 msgid "X" msgstr "X" -#: src/snes9x.ui:5809 src/snes9x.ui:6039 src/snes9x.ui:6251 +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 msgid "Y" msgstr "Y" -#: src/snes9x.ui:5823 src/snes9x.ui:6053 src/snes9x.ui:6265 +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 msgid "L" msgstr "L" -#: src/snes9x.ui:5837 src/snes9x.ui:6067 src/snes9x.ui:6279 +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 msgid "R" msgstr "R" -#: src/snes9x.ui:5971 +#: src/snes9x.ui:5977 msgid "Buttons" msgstr "Dugmad" -#: src/snes9x.ui:6412 +#: src/snes9x.ui:6418 msgid "Sticky" msgstr "Lepljiva" -#: src/snes9x.ui:6428 +#: src/snes9x.ui:6434 msgid "Turbo" msgstr "Turbo" -#: src/snes9x.ui:6447 +#: src/snes9x.ui:6453 msgid "Turbo / Sticky Buttons" msgstr "Turbo / Lepljiva Dugmad" -#: src/snes9x.ui:6484 +#: src/snes9x.ui:6490 msgid "Set new axis bindings at:" msgstr "Prilagodi nove tastere na:" -#: src/snes9x.ui:6496 +#: src/snes9x.ui:6502 msgid "" "Changes the amount a joystick should be tilted to register a button press" msgstr "" "Menja vredost koliko treba palicu dzojstika nakriviti da bi registrovao " "taster" -#: src/snes9x.ui:6515 +#: src/snes9x.ui:6521 msgid "percent" msgstr "procenat" -#: src/snes9x.ui:6532 +#: src/snes9x.ui:6538 msgid "Joystick Axis Threshold" msgstr "Smerovi dzojstika" -#: src/snes9x.ui:6569 +#: src/snes9x.ui:6575 msgid "Center all axes on all joysticks and press Calibrate." msgstr "Centriraj prvo sve ose na svim dzojsticima, tek onda Kalibracija!" -#: src/snes9x.ui:6584 +#: src/snes9x.ui:6590 msgid "Cali_brate" msgstr "Kali_bracija" -#: src/snes9x.ui:6617 +#: src/snes9x.ui:6623 msgid "Calibration" msgstr "Kalibracija" -#: src/snes9x.ui:6638 +#: src/snes9x.ui:6644 msgid "Joystick Options" msgstr "Opcije za dzojstik" -#: src/snes9x.ui:6656 src/snes9x.ui:9008 +#: src/snes9x.ui:6662 src/snes9x.ui:9014 msgid "" "Click an entry and then press the desired keys or joystick button\n" "Escape: Move to next Shift-Escape: Clear selected" msgstr "" -#: src/snes9x.ui:6694 +#: src/snes9x.ui:6700 msgid "Joypads" msgstr "Dzojpedi" -#: src/snes9x.ui:6721 +#: src/snes9x.ui:6727 msgid "Snes9x Emulator Shortcut Keys" msgstr "Tastaturne prečice za Snes9x Emulator" -#: src/snes9x.ui:6772 +#: src/snes9x.ui:6778 msgid "Soft reset" msgstr "Softverski reset" -#: src/snes9x.ui:6786 +#: src/snes9x.ui:6792 msgid "Hardware reset" msgstr "Hardverski reset" -#: src/snes9x.ui:6800 +#: src/snes9x.ui:6806 msgid "Increase frame time" msgstr "Ubrzaj frejmove" -#: src/snes9x.ui:6814 +#: src/snes9x.ui:6820 msgid "Decrease frame time" msgstr "Uspori frejmove" -#: src/snes9x.ui:6828 +#: src/snes9x.ui:6834 msgid "Increase frame rate" msgstr "Ubrzaj frejmove" -#: src/snes9x.ui:6842 +#: src/snes9x.ui:6848 msgid "Decrease frame rate" msgstr "Uspori frajmove" -#: src/snes9x.ui:6856 +#: src/snes9x.ui:6862 msgid "Pause" msgstr "Pauza" -#: src/snes9x.ui:6870 +#: src/snes9x.ui:6876 msgid "Toggle turbo" msgstr "Uključi/Isključi turbo" -#: src/snes9x.ui:6884 +#: src/snes9x.ui:6890 msgid "Enable turbo" msgstr "Omogući turbo" -#: src/snes9x.ui:6899 +#: src/snes9x.ui:6905 msgid "Open ROM" msgstr "Otvori ROM" -#: src/snes9x.ui:7158 +#: src/snes9x.ui:7164 msgid "Toggle BG layer 0" msgstr "Uključi BG sloj 0" -#: src/snes9x.ui:7170 +#: src/snes9x.ui:7176 msgid "Toggle BG layer 1" msgstr "Uključi BG sloj 1" -#: src/snes9x.ui:7184 +#: src/snes9x.ui:7190 msgid "Toggle BG layer 2" msgstr "Uključi BG sloj 2" -#: src/snes9x.ui:7198 +#: src/snes9x.ui:7204 msgid "Toggle BG layer 3" msgstr "Uključi BG sloj 3" -#: src/snes9x.ui:7212 +#: src/snes9x.ui:7218 msgid "Toggle sprites" msgstr "Uključi sprajtove" -#: src/snes9x.ui:7226 +#: src/snes9x.ui:7232 msgid "BG layering hack" msgstr "BG hak za sloj" -#: src/snes9x.ui:7240 +#: src/snes9x.ui:7246 msgid "Screenshot" msgstr "Snimak ekrana" -#: src/snes9x.ui:7254 +#: src/snes9x.ui:7260 msgid "Toggle fullscreen" msgstr "Pređi na ceo ekran" -#: src/snes9x.ui:7418 +#: src/snes9x.ui:7424 msgid "Graphics" msgstr "Grafika" -#: src/snes9x.ui:7455 +#: src/snes9x.ui:7461 msgid "Save current slot" msgstr "" -#: src/snes9x.ui:7488 +#: src/snes9x.ui:7494 msgid "Load current slot" msgstr "" -#: src/snes9x.ui:7521 +#: src/snes9x.ui:7527 msgid "Increment and save" msgstr "" -#: src/snes9x.ui:7554 +#: src/snes9x.ui:7560 msgid "Decrement and load" msgstr "" -#: src/snes9x.ui:7587 +#: src/snes9x.ui:7593 msgid "Increment slot" msgstr "" -#: src/snes9x.ui:7620 +#: src/snes9x.ui:7626 msgid "Decrement slot" msgstr "" -#: src/snes9x.ui:7664 +#: src/snes9x.ui:7670 msgid "Quick save state" msgstr "Brzo snimi" -#: src/snes9x.ui:7679 +#: src/snes9x.ui:7685 msgid "Quick load state" msgstr "Brzo učitaj" -#: src/snes9x.ui:7694 src/snes9x.ui:7834 +#: src/snes9x.ui:7700 src/snes9x.ui:7840 msgid "Slot 0" msgstr "" -#: src/snes9x.ui:7708 src/snes9x.ui:7850 +#: src/snes9x.ui:7714 src/snes9x.ui:7856 msgid "Slot 1" msgstr "" -#: src/snes9x.ui:7722 src/snes9x.ui:7866 +#: src/snes9x.ui:7728 src/snes9x.ui:7872 msgid "Slot 2" msgstr "" -#: src/snes9x.ui:7736 src/snes9x.ui:7882 +#: src/snes9x.ui:7742 src/snes9x.ui:7888 msgid "Slot 3" msgstr "" -#: src/snes9x.ui:7750 src/snes9x.ui:7898 +#: src/snes9x.ui:7756 src/snes9x.ui:7904 msgid "Slot 4" msgstr "" -#: src/snes9x.ui:7764 src/snes9x.ui:7914 +#: src/snes9x.ui:7770 src/snes9x.ui:7920 msgid "Slot 5" msgstr "" -#: src/snes9x.ui:7778 src/snes9x.ui:7930 +#: src/snes9x.ui:7784 src/snes9x.ui:7936 msgid "Slot 6" msgstr "" -#: src/snes9x.ui:7792 src/snes9x.ui:7946 +#: src/snes9x.ui:7798 src/snes9x.ui:7952 msgid "Slot 7" msgstr "" -#: src/snes9x.ui:7806 src/snes9x.ui:7962 +#: src/snes9x.ui:7812 src/snes9x.ui:7968 msgid "Slot 8" msgstr "" -#: src/snes9x.ui:7820 src/snes9x.ui:7978 +#: src/snes9x.ui:7826 src/snes9x.ui:7984 msgid "Slot 9" msgstr "" -#: src/snes9x.ui:8417 +#: src/snes9x.ui:8423 msgid "Toggle sound channel 0" msgstr "Uključi zvučni kanal 0" -#: src/snes9x.ui:8429 +#: src/snes9x.ui:8435 msgid "Toggle sound channel 1" msgstr "Uključi zvučni kanal 1" -#: src/snes9x.ui:8443 +#: src/snes9x.ui:8449 msgid "Toggle sound channel 2" msgstr "Uključi zvučni kanal 2" -#: src/snes9x.ui:8457 +#: src/snes9x.ui:8463 msgid "Toggle sound channel 3" msgstr "Uključi zvučni kanal 3" -#: src/snes9x.ui:8471 +#: src/snes9x.ui:8477 msgid "Toggle sound channel 4" msgstr "Uključi zvučni kanal 4" -#: src/snes9x.ui:8485 +#: src/snes9x.ui:8491 msgid "Toggle sound channel 5" msgstr "Uključi zvučni kanal 5" -#: src/snes9x.ui:8499 +#: src/snes9x.ui:8505 msgid "Toggle sound channel 6" msgstr "Uključi zvučni kanal 6" -#: src/snes9x.ui:8513 +#: src/snes9x.ui:8519 msgid "Toggle sound channel 7" msgstr "Uključi zvučni kanal 7" -#: src/snes9x.ui:8527 +#: src/snes9x.ui:8533 msgid "Toggle all sound channels" msgstr "Uključi sve zvučne kanale" -#: src/snes9x.ui:8732 +#: src/snes9x.ui:8738 msgid "Seek to frame" msgstr "Pređi na frejm" -#: src/snes9x.ui:8747 +#: src/snes9x.ui:8753 msgid "Load Movie" msgstr "Učitaj film" -#: src/snes9x.ui:8762 +#: src/snes9x.ui:8768 msgid "Stop movie recording" msgstr "Zaustavi snimanje filma" -#: src/snes9x.ui:8777 +#: src/snes9x.ui:8783 msgid "Begin movie recording" msgstr "Započni snimanje filma" -#: src/snes9x.ui:8792 +#: src/snes9x.ui:8798 msgid "Save SPC" msgstr "Sačuvaj SPC" -#: src/snes9x.ui:8892 +#: src/snes9x.ui:8898 msgid "Swap controllers 1 & 2" msgstr "Zameni mesta kontrolerima 1 i 2" -#: src/snes9x.ui:8923 +#: src/snes9x.ui:8929 msgid "Rewind" msgstr "" -#: src/snes9x.ui:8954 +#: src/snes9x.ui:8960 msgid "Capture/release mouse" msgstr "" -#: src/snes9x.ui:8990 +#: src/snes9x.ui:8996 msgid "Misc" msgstr "Razno" -#: src/snes9x.ui:9046 +#: src/snes9x.ui:9052 msgid "Shortcuts" msgstr "Prečice" -#: src/snes9x.ui:9085 +#: src/snes9x.ui:9091 msgid "Pause emulation when switching away from Snes9x" msgstr "Pauziraj emulaciju kada istovremeno koristiš i druge GUI programe" -#: src/snes9x.ui:9099 +#: src/snes9x.ui:9105 msgid "Force-enable button and menu icons" msgstr "" -#: src/snes9x.ui:9120 +#: src/snes9x.ui:9126 msgid "The ESC key should:" msgstr "ESC taster će:" -#: src/snes9x.ui:9162 +#: src/snes9x.ui:9168 msgid "Initial background:" msgstr "" -#: src/snes9x.ui:9203 +#: src/snes9x.ui:9209 #, fuzzy msgid "Window Behavior" msgstr "Prebacivanje izmedju prozora" -#: src/snes9x.ui:9233 +#: src/snes9x.ui:9239 msgid "Prevent the screensaver from activating" msgstr "Spreči aktiviranje čuvara ekrana" -#: src/snes9x.ui:9253 +#: src/snes9x.ui:9259 msgid "Screensaver" msgstr "Čuvar ekrana" -#: src/snes9x.ui:9287 +#: src/snes9x.ui:9293 msgid "UI" msgstr "" -#: src/snes9x.ui:9321 +#: src/snes9x.ui:9327 msgid "" " Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" "\n" diff --git a/gtk/po/zh_CN.po b/gtk/po/zh_CN.po new file mode 100644 index 00000000..1aaa760b --- /dev/null +++ b/gtk/po/zh_CN.po @@ -0,0 +1,1853 @@ +# Chinese translations for snes9x-gtk package +# snes9x-gtk 软件包的简体中文翻译. +# Copyright (C) 2019-2020 +# This file is distributed under the same license as the snes9x-gtk package. +# +msgid "" +msgstr "" +"Project-Id-Version: snes9x-gtk\n" +"Report-Msgid-Bugs-To:\n" +"POT-Creation-Date: 2019-01-21 23:57+0800\n" +"PO-Revision-Date: 2020-03-04 21:46+0800\n" +"Last-Translator:\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/gtk_binding.cpp:249 +#, c-format +msgid "Unknown" +msgstr "未知" + +#: src/gtk_binding.cpp:264 +#, c-format +msgid "Keyboard %s%s%s%s" +msgstr "键盘 %s%s%s%s" + +#: src/gtk_binding.cpp:275 +#, c-format +msgid "Axis %u %s %u%%" +msgstr "轴 %u %s %u%%" + +#: src/gtk_binding.cpp:280 +#, c-format +msgid "Button %u" +msgstr "按键 %u" + +#: src/gtk_binding.cpp:282 +#, c-format +msgid "Joystick %u %s" +msgstr "模拟摇杆 %u %s" + +#: src/gtk_binding.cpp:287 +#, c-format +msgid "Unset" +msgstr "重置" + +#: src/gtk_cheat.cpp:31 src/gtk_s9xwindow.cpp:864 src/gtk_s9xwindow.cpp:995 +#: src/gtk_s9xwindow.cpp:1292 +msgid "Error" +msgstr "错误" + +#: src/gtk_cheat.cpp:161 +msgid "Description" +msgstr "说明" + +#: src/gtk_cheat.cpp:172 +msgid "Cheat" +msgstr "作弊" + +#: src/gtk_cheat.cpp:343 src/gtk_cheat.cpp:362 src/gtk_cheat.cpp:532 +msgid "No description" +msgstr "无说明" + +#: src/gtk_cheat.cpp:366 src/gtk_cheat.cpp:537 +msgid "Couldn't find any cheat codes in input." +msgstr "未找到作弊码." + +#: src/gtk_cheat.cpp:472 +msgid "Couldn't Find Cheats Database" +msgstr "未找到作弊码数据库" + +#: src/gtk_cheat.cpp:473 +msgid "No Matching Game Found" +msgstr "未找到匹配的游戏" + +#: src/gtk_cheat.cpp:476 +msgid "" +"The database file cheats.bml was not found. It is normally installed " +"with Snes9x, but you may also place a custom copy in your configuration or " +"cheats directory." +msgstr "数据库文件cheats.bml 未找到. 该文件通常在安装Snes9x时附带,你当然也可以将它置于cheats目录下." + +#: src/gtk_cheat.cpp:478 +msgid "" +"No matching game was found in the databases. If you are using a non-official " +"translation or modified copy, you may be able to find and manually enter the " +"codes." +msgstr "数据库中无匹配的游戏. 如果你使用非官方的翻译或修改过的游戏, 你需要手动输入可用的作弊码." + +#: src/gtk_config.cpp:442 +#, c-format +msgid "Couldn't create config directory: %s\n" +msgstr "无法创建设置文件目录: %s\n" + +#: src/gtk_netplay.cpp:62 +msgid "Connection Error" +msgstr "连接错误" + +#: src/gtk_preferences.cpp:18 +msgid "Same location as current game" +msgstr "当前游戏目录位置" + +#: src/gtk_preferences.cpp:417 +msgid "Current joystick centers have been saved." +msgstr "已保存当前摇杆的中心位置" + +#: src/gtk_preferences.cpp:418 +msgid "Calibration Complete" +msgstr "校准完成" + +#: src/gtk_preferences.cpp:460 +msgid "Snes9x version: " +msgstr "Snes9x 版本: " + +#: src/gtk_preferences.cpp:461 +msgid "GTK+ port version: " +msgstr "GTK+ 移植版: " + +#: src/gtk_preferences.cpp:463 +msgid "English localization by Brandon Wright" +msgstr "中文本地化 By" + +#: src/gtk_preferences.cpp:945 +msgid "" +"Changing the SRAM directory with a game loaded will replace the .srm file in " +"the selected directory with the SRAM from the running game. If this is not " +"what you want, click 'cancel'." +msgstr "在游戏运行时变更SRAM目录将会使用运行时的SRAM替换已选目录下的srm文件. 如果你不想这样, 请点击 '取消'." + +#: src/gtk_preferences.cpp:946 +msgid "Warning: Possible File Overwrite" +msgstr "警告: 可能会覆盖文件" + +#: src/gtk_preferences.cpp:1027 +msgid "Select Folder" +msgstr "选择文件夹" + +#: src/gtk_preferences.cpp:1104 +msgid "HQ2x" +msgstr "HQ2x" + +#: src/gtk_preferences.cpp:1105 +msgid "HQ3x" +msgstr "HQ3x" + +#: src/gtk_preferences.cpp:1106 +msgid "HQ4x" +msgstr "HQ4x" + +#: src/gtk_preferences.cpp:1111 +msgid "2xBRZ" +msgstr "2xBRZ" + +#: src/gtk_preferences.cpp:1112 +msgid "3xBRZ" +msgstr "3xBRZ" + +#: src/gtk_preferences.cpp:1113 +msgid "4xBRZ" +msgstr "4xBRZ" + +#: src/gtk_preferences.cpp:1118 +msgid "None - Use software scaler" +msgstr "无 - 使用软件渲染" + +#: src/gtk_preferences.cpp:1122 +msgid "OpenGL - Use 3D graphics hardware" +msgstr "OpenGL - 使用3D图形处理器" + +#: src/gtk_preferences.cpp:1126 +msgid "XVideo - Use hardware video blitter" +msgstr "XVideo - Use hardware video blitter" + +#: src/gtk_preferences.cpp:1132 +msgid "PortAudio" +msgstr "PortAudio" + +#: src/gtk_preferences.cpp:1136 +msgid "Open Sound System" +msgstr "Open Sound System" + +#: src/gtk_preferences.cpp:1139 +msgid "SDL" +msgstr "SDL" + +#: src/gtk_preferences.cpp:1142 +msgid "ALSA" +msgstr "ALSA" + +#: src/gtk_preferences.cpp:1146 +msgid "PulseAudio" +msgstr "PulseAudio" + +#: src/gtk_s9x.cpp:205 +#, c-format +msgid "Error opening: %s\n" +msgstr "打开时发生错误: %s\n" + +#: src/gtk_s9xwindow.cpp:863 +msgid "Couldn't load files." +msgstr "无法载入文件." + +#: src/gtk_s9xwindow.cpp:892 +msgid "Open SNES Movie" +msgstr "打开SNES影片" + +#: src/gtk_s9xwindow.cpp:911 +msgid "New SNES Movie" +msgstr "新SNES影片" + +#: src/gtk_s9xwindow.cpp:924 +msgid "SNES Movies" +msgstr "SNES影片" + +#: src/gtk_s9xwindow.cpp:932 src/gtk_s9xwindow.cpp:1080 +#: src/gtk_s9xwindow.cpp:1200 src/gtk_s9xwindow.cpp:1265 src/gtk_file.cpp:440 +msgid "All Files" +msgstr "所有文件" + +#: src/gtk_s9xwindow.cpp:993 +#, c-format +msgid "Couldn't load file '%s'" +msgstr "无法载入文件 '%s'" + +#: src/gtk_s9xwindow.cpp:1052 +msgid "Load Saved State" +msgstr "载入存档" + +#: src/gtk_s9xwindow.cpp:1063 src/gtk_s9xwindow.cpp:1183 src/snes9x.ui:8390 +msgid "Save States" +msgstr "存档" + +#: src/gtk_s9xwindow.cpp:1120 +#, c-format +msgid "The current frame in the movie is %d." +msgstr "影片的当前帧为 %d." + +#: src/gtk_s9xwindow.cpp:1170 +msgid "Save State" +msgstr "存档" + +#: src/gtk_s9xwindow.cpp:1246 +msgid "Save SPC file..." +msgstr "保存 SPC 文件..." + +#: src/gtk_s9xwindow.cpp:1259 +msgid "SPC Files" +msgstr "SPC文件" + +#: src/gtk_s9xwindow.cpp:1290 +#, c-format +msgid "Couldn't save SPC file '%s'" +msgstr "无法保存SPC文件 '%s'" + +#: src/gtk_s9xwindow.cpp:1330 +#, c-format +msgid "" +"Information for %s\n" +"\n" +"Name: %s\n" +"Speed: %02X/%s\n" +"Map: %s\n" +"Type: %02x\n" +"Contents: %s\n" +"ROM Size: %s\n" +"Calculated Size: %d\n" +"SRAM Size: %s\n" +"Header Checksum: %04X\n" +"Checksum Compliment: %04X\n" +"Actual Checksum: %04X\n" +"Video: %s\n" +"CRC32: %08X\n" +"Revision: %s%s%s" +msgstr "" +"%s 信息\n" +"\n" +"Name: %s\n" +"Speed: %02X/%s\n" +"Map: %s\n" +"Type: %02x\n" +"Contents: %s\n" +"ROM 大小: %s\n" +"Calculated Size: %d\n" +"SRAM 大小: %s\n" +"Header Checksum: %04X\n" +"Checksum Compliment: %04X\n" +"Actual Checksum: %04X\n" +"Video: %s\n" +"CRC32: %08X\n" +"Revision: %s%s%s" + +#: src/gtk_s9xwindow.cpp:1366 +msgid "" +"\n" +"\n" +"This ROM has been auto-patched with " +msgstr "\n\n此ROM已自动应用补丁 " + +#: src/gtk_s9xwindow.cpp:1369 +msgid "" +"\n" +"\n" +"This ROM has been modified or damaged" +msgstr "\n\n此ROM已被修改或损坏" + +#: src/gtk_s9xwindow.cpp:1375 +msgid "File Information" +msgstr "文件信息" + +#: src/gtk_shader_parameters.cpp:99 +msgid "Export Shader Preset to:" +msgstr "导出预置着色器至:" + +#: src/gtk_shader_parameters.cpp:124 +msgid "Shader Preset" +msgstr "预置着色器" + +#: src/gtk_shader_parameters.cpp:169 +msgid "Shader Parameters" +msgstr "着色器参数" + +#: src/gtk_file.cpp:424 +msgid "Open SNES ROM Image" +msgstr "打开SNES ROM镜像" + +#: src/gtk_file.cpp:432 +msgid "SNES ROM Images" +msgstr "SNES ROM 镜像" + +#: src/snes9x.ui:9 +msgid "About Snes9x" +msgstr "关于 Snes9x" + +#: src/snes9x.ui:48 +msgid "label106" +msgstr "" + +#: src/snes9x.ui:271 +msgid "Snes9x Cheats" +msgstr "Snes9x 作弊码" + +#: src/snes9x.ui:389 +msgid "Update Cheat" +msgstr "更新作弊码" + +#: src/snes9x.ui:404 +msgid "Disable All" +msgstr "禁用全部" + +#: src/snes9x.ui:420 +msgid "Delete All Cheats" +msgstr "删除全部作弊码" + +#: src/snes9x.ui:435 +msgid "Search Cheat Database" +msgstr "查找作弊码数据库" + +#: src/snes9x.ui:477 +msgid "Code:" +msgstr "作弊码:" + +#: src/snes9x.ui:514 +msgid "Description:" +msgstr "说明:" + +#: src/snes9x.ui:561 +msgid "Advance to Frame" +msgstr "步进帧" + +#: src/snes9x.ui:630 +msgid "The current frame in the movie is" +msgstr "影片的当前帧为" + +#: src/snes9x.ui:651 +msgid "Fast-forward to frame" +msgstr "快进帧" + +#: src/snes9x.ui:812 +msgid "Black" +msgstr "黑色" + +#: src/snes9x.ui:815 +msgid "Color bars" +msgstr "彩色检验图" + +#: src/snes9x.ui:818 +msgid "Pixel art patterns" +msgstr "像素风" + +#: src/snes9x.ui:821 +msgid "Dithered gradient" +msgstr "渐变" + +#: src/snes9x.ui:824 +msgid "Color bars and patterns" +msgstr "彩条检验图" + +#: src/snes9x.ui:827 +msgid "Starfield" +msgstr "星空" + +#: src/snes9x.ui:830 +msgid "Snow" +msgstr "雪" + +#: src/snes9x.ui:841 +msgid "Game Genie" +msgstr "" + +#: src/snes9x.ui:844 +msgid "Pro Action Replay" +msgstr "" + +#: src/snes9x.ui:847 +msgid "Goldfinger" +msgstr "金手指" + +#: src/snes9x.ui:858 src/snes9x.ui:881 +msgid "12.5%" +msgstr "12.5%" + +#: src/snes9x.ui:861 src/snes9x.ui:884 +msgid "25%" +msgstr "25%" + +#: src/snes9x.ui:864 src/snes9x.ui:887 +msgid "50%" +msgstr "50%" + +#: src/snes9x.ui:867 src/snes9x.ui:890 +msgid "100%" +msgstr "100%" + +#: src/snes9x.ui:878 +msgid "0%" +msgstr "0%" + +#: src/snes9x.ui:901 src/snes9x.ui:1928 +msgid "None" +msgstr "无" + +#: src/snes9x.ui:904 +msgid "SuperEagle" +msgstr "SuperEagle" + +#: src/snes9x.ui:907 +msgid "2xSaI" +msgstr "2xSaI" + +#: src/snes9x.ui:910 +msgid "Super2xSaI" +msgstr "Super2xSaI" + +#: src/snes9x.ui:913 +msgid "EPX" +msgstr "EPX" + +#: src/snes9x.ui:916 +msgid "EPX Smooth" +msgstr "EPX Smooth" + +#: src/snes9x.ui:919 +msgid "Blargg's NTSC" +msgstr "Blargg's NTSC" + +#: src/snes9x.ui:922 +msgid "Scanlines" +msgstr "Scanlines" + +#: src/snes9x.ui:925 +msgid "Simple2x" +msgstr "Simple2x" + +#: src/snes9x.ui:928 +msgid "Simple3x" +msgstr "Simple3x" + +#: src/snes9x.ui:931 +msgid "Simple4x" +msgstr "Simple4x" + +#: src/snes9x.ui:942 +msgid "8:7 Square pixels" +msgstr "8:7 正方形像素" + +#: src/snes9x.ui:945 +msgid "8:7 Square pixels, integer multiples" +msgstr "8:7 正方形像素, 整数倍数" + +#: src/snes9x.ui:948 +msgid "4:3 SNES correct aspect" +msgstr "" + +#: src/snes9x.ui:951 +msgid "4:3 SNES correct aspect, integer multiples" +msgstr "4:3 SNES correct aspect, 整数倍" + +#: src/snes9x.ui:954 +msgid "8*8:7*7 NTSC" +msgstr "8*8:7*7 NTSC" + +#: src/snes9x.ui:957 +msgid "8*8:7*7 NTSC, integer multiples" +msgstr "8*8:7*7 NTSC, 整数倍" + +#: src/snes9x.ui:974 +msgid "Merge adjacent pairs" +msgstr "邻对合并" + +#: src/snes9x.ui:977 +msgid "Output directly" +msgstr "直接输出" + +#: src/snes9x.ui:980 +msgid "Scale low-resolution screens" +msgstr "缩放低分辨率画面" + +#: src/snes9x.ui:991 src/snes9x.ui:1029 +msgid "1" +msgstr "1" + +#: src/snes9x.ui:994 src/snes9x.ui:1032 +msgid "2" +msgstr "2" + +#: src/snes9x.ui:997 src/snes9x.ui:1035 +msgid "3" +msgstr "3" + +#: src/snes9x.ui:1000 src/snes9x.ui:1038 +msgid "4" +msgstr "4" + +#: src/snes9x.ui:1003 src/snes9x.ui:1041 +msgid "5" +msgstr "5" + +#: src/snes9x.ui:1006 src/snes9x.ui:1044 +msgid "1+" +msgstr "1+" + +#: src/snes9x.ui:1009 src/snes9x.ui:1047 +msgid "2+" +msgstr "2+" + +#: src/snes9x.ui:1012 src/snes9x.ui:1050 +msgid "3+" +msgstr "3+" + +#: src/snes9x.ui:1015 src/snes9x.ui:1053 +msgid "4+" +msgstr "4+" + +#: src/snes9x.ui:1018 src/snes9x.ui:1056 +msgid "5+" +msgstr "5+" + +#: src/snes9x.ui:1067 +msgid "Toggle the menu bar" +msgstr "切换菜单栏" + +#: src/snes9x.ui:1070 +msgid "Exit fullscreen mode" +msgstr "退出全屏模式" + +#: src/snes9x.ui:1073 src/snes9x.ui:6917 +msgid "Quit Snes9x" +msgstr "退出 Snex9x" + +#: src/snes9x.ui:1084 +msgid "Timer-based" +msgstr "基于时间同步" + +#: src/snes9x.ui:1087 +msgid "Timer-based with automatic frame-skipping" +msgstr "基于时间的自动跳帧" + +#: src/snes9x.ui:1090 +msgid "Sound buffer synchronization" +msgstr "基于音频缓存的同步" + +#: src/snes9x.ui:1093 +msgid "No throttling, use vsync to control speed" +msgstr "不使用调速策略, 使用vsync控制速度" + +#: src/snes9x.ui:1104 +msgid "48000 hz" +msgstr "48000 hz" + +#: src/snes9x.ui:1107 +msgid "44100 hz" +msgstr "44100 hz" + +#: src/snes9x.ui:1110 +msgid "32000 hz" +msgstr "32000 hz" + +#: src/snes9x.ui:1113 +msgid "22050 hz" +msgstr "22050 hz" + +#: src/snes9x.ui:1116 +msgid "16000 hz" +msgstr "16000 hz" + +#: src/snes9x.ui:1119 +msgid "11025 hz" +msgstr "11025 hz" + +#: src/snes9x.ui:1122 +msgid "8000 hz" +msgstr "8000 hz" + +#: src/snes9x.ui:1125 +msgid "0 hz" +msgstr "0 hz" + +#: src/snes9x.ui:1142 +msgid "16-bit (GL_RGB)" +msgstr "16-bit (GL_RGB)" + +#: src/snes9x.ui:1145 +msgid "32-bit (GL_BGRA)" +msgstr "32-bit (GL_BGRA)" + +#: src/snes9x.ui:1156 +msgid "Nearest" +msgstr "近似" + +#: src/snes9x.ui:1159 +msgid "Linear" +msgstr "线性" + +#: src/snes9x.ui:1162 +msgid "Gaussian (correct)" +msgstr "高斯修正" + +#: src/snes9x.ui:1165 +msgid "Cubic" +msgstr "" + +#: src/snes9x.ui:1168 +msgid "Sinc" +msgstr "" + +#: src/snes9x.ui:1181 +msgid "Snes9x" +msgstr "Snes9x" + +#: src/snes9x.ui:1201 +msgid "_File" +msgstr "文件(_F)" + +#: src/snes9x.ui:1208 +msgid "_Open ROM Image..." +msgstr "载入ROM(_O)..." + +#: src/snes9x.ui:1222 +msgid "Open Recent" +msgstr "最近打开" + +#: src/snes9x.ui:1234 +msgid "Open with _NetPlay..." +msgstr "使用NetPlay打开(_N)..." + +#: src/snes9x.ui:1237 +msgid "Open a ROM to use with NetPlay" +msgstr "打开用于NetPlay的ROM" + +#: src/snes9x.ui:1248 +msgid "Open _MultiCart..." +msgstr "打开 MultiCart(_M)..." + +#: src/snes9x.ui:1263 +msgid "_Load State" +msgstr "载入即时存档(_L)" + +#: src/snes9x.ui:1273 src/snes9x.ui:1407 +msgid "Slot _0" +msgstr "插槽 _0" + +#: src/snes9x.ui:1282 src/snes9x.ui:1416 +msgid "Slot _1" +msgstr "插槽 _1" + +#: src/snes9x.ui:1291 src/snes9x.ui:1425 +msgid "Slot _2" +msgstr "插槽 _2" + +#: src/snes9x.ui:1300 src/snes9x.ui:1434 +msgid "Slot _3" +msgstr "插槽 _3" + +#: src/snes9x.ui:1309 src/snes9x.ui:1443 +msgid "Slot _4" +msgstr "插槽 _4" + +#: src/snes9x.ui:1318 src/snes9x.ui:1452 +msgid "Slot _5" +msgstr "插槽 _5" + +#: src/snes9x.ui:1327 src/snes9x.ui:1461 +msgid "Slot _6" +msgstr "插槽 _6" + +#: src/snes9x.ui:1336 src/snes9x.ui:1470 +msgid "Slot _7" +msgstr "插槽 _7" + +#: src/snes9x.ui:1345 src/snes9x.ui:1479 +msgid "Slot _8" +msgstr "插槽 _8" + +#: src/snes9x.ui:1354 src/snes9x.ui:1488 +msgid "Slot _9" +msgstr "插槽 _9" + +#: src/snes9x.ui:1369 +msgid "From _File..." +msgstr "从文件(_F)..." + +#: src/snes9x.ui:1384 +msgid "_Undo Load State" +msgstr "撤消载入即时存档(_U)" + +#: src/snes9x.ui:1397 +msgid "_Save State" +msgstr "保存即时存档(_S)" + +#: src/snes9x.ui:1503 +msgid "To _File..." +msgstr "至文件(_F)..." + +#: src/snes9x.ui:1520 +msgid "Save SPC..." +msgstr "保存SPC..." + +#: src/snes9x.ui:1537 +msgid "Show ROM _Info..." +msgstr "ROM信息(_I)..." + +#: src/snes9x.ui:1554 +msgid "_Quit" +msgstr "退出(_Q)" + +#: src/snes9x.ui:1571 +msgid "_Emulation" +msgstr "模拟(_E)" + +#: src/snes9x.ui:1578 +msgid "Run / _Continue" +msgstr "运行/继续(_C)" + +#: src/snes9x.ui:1589 +msgid "_Pause" +msgstr "暂停(_P)" + +#: src/snes9x.ui:1607 +msgid "Load _Movie..." +msgstr "载入影片(_M)..." + +#: src/snes9x.ui:1619 +msgid "R_ecord Movie..." +msgstr "录制影片(_e)..." + +#: src/snes9x.ui:1631 +msgid "_Stop Recording" +msgstr "停止录制(_S)" + +#: src/snes9x.ui:1643 +msgid "_Jump to Frame..." +msgstr "跳转至帧(_J)..." + +#: src/snes9x.ui:1661 +msgid "Sy_nc Clients" +msgstr "同步客户端(_n)" + +#: src/snes9x.ui:1678 +msgid "Reset" +msgstr "复位" + +#: src/snes9x.ui:1690 +msgid "Soft _Reset" +msgstr "软重置(_R)" + +#: src/snes9x.ui:1707 +msgid "_View" +msgstr "显示(_V)" + +#: src/snes9x.ui:1715 +msgid "_Toggle Menubar" +msgstr "切换菜单栏(_T)" + +#: src/snes9x.ui:1732 +msgid "_Change Size" +msgstr "更改尺寸(_C)" + +#: src/snes9x.ui:1746 +msgid "_1x" +msgstr "_1x" + +#: src/snes9x.ui:1755 +msgid "_2x" +msgstr "_2x" + +#: src/snes9x.ui:1764 +msgid "_3x" +msgstr "_3x" + +#: src/snes9x.ui:1773 +msgid "_4x" +msgstr "_4x" + +#: src/snes9x.ui:1782 +msgid "_5x" +msgstr "_5x" + +#: src/snes9x.ui:1799 +msgid "_Fullscreen" +msgstr "全屏(_F)" + +#: src/snes9x.ui:1816 +msgid "_Options" +msgstr "选项(_O)" + +#: src/snes9x.ui:1825 +msgid "Controller Ports" +msgstr "控制器端口" + +#: src/snes9x.ui:1834 +msgid "SNES Port 1" +msgstr "SNES端口1" + +#: src/snes9x.ui:1844 src/snes9x.ui:1888 +msgid "Joypad" +msgstr "手柄" + +#: src/snes9x.ui:1853 src/snes9x.ui:1897 +msgid "Mouse" +msgstr "鼠标" + +#: src/snes9x.ui:1863 src/snes9x.ui:1917 +msgid "Superscope" +msgstr "光线枪(Superscope)" + +#: src/snes9x.ui:1878 +msgid "SNES Port 2" +msgstr "SNES端口2" + +#: src/snes9x.ui:1907 +msgid "Multitap" +msgstr "多人游戏接口(Multitap)" + +#: src/snes9x.ui:1954 +msgid "_Cheats..." +msgstr "作弊码(_C)..." + +#: src/snes9x.ui:1968 +msgid "_Shader Parameters..." +msgstr "着色器参数(_S)..." + +#: src/snes9x.ui:1984 +msgid "_Preferences..." +msgstr "设置(_P)..." + +#: src/snes9x.ui:2029 +msgid "Open Multiple ROM Images (MultiCart)" +msgstr "打开多个ROM文件(Multicart)" + +#: src/snes9x.ui:2092 +msgid "Slot A:" +msgstr "插槽A:" + +#: src/snes9x.ui:2104 +msgid "Select an Image for Slot A" +msgstr "选取用于插槽A的镜像" + +#: src/snes9x.ui:2128 +msgid "Slot B:" +msgstr "插槽B:" + +#: src/snes9x.ui:2140 +msgid "Select an Image for Slot B" +msgstr "选取用于插槽B的镜像" + +#: src/snes9x.ui:2172 +msgid "Snes9x NetPlay" +msgstr "Snes9x NetPlay" + +#: src/snes9x.ui:2249 +msgid "" +"The game chosen will be loaded before connecting. This field can be blank if " +"the server will send the ROM image" +msgstr "选中的游戏将在建立连接前载入. 如果服务器可以发送ROM镜像, 此处也可以不填." + +#: src/snes9x.ui:2264 src/snes9x.ui:3982 src/snes9x.ui:5097 src/snes9x.ui:5112 +#: src/snes9x.ui:5129 src/snes9x.ui:5146 src/snes9x.ui:5163 +msgid "Browse..." +msgstr "浏览..." + +#: src/snes9x.ui:2286 +msgid "Clear entry" +msgstr "清空条目" + +#: src/snes9x.ui:2306 +msgid "ROM Image" +msgstr "ROM 镜像" + +#: src/snes9x.ui:2335 +msgid "Connect to another computer" +msgstr "连接到另一台计算机" + +#: src/snes9x.ui:2339 +msgid "Connect to another computer that is running Snes9x NetPlay as a server" +msgstr "连接到另一台作为服务器运行Snex9x NetPlay的计算机" + +#: src/snes9x.ui:2359 +msgid "Name or IP address:" +msgstr "主机名或IP地址:" + +#: src/snes9x.ui:2371 +msgid "Domain name or internet protocol address of a remote computer" +msgstr "域名或远程计算机的IP地址" + +#: src/snes9x.ui:2387 +msgid "Port:" +msgstr "端口:" + +#: src/snes9x.ui:2399 +msgid "Connect to specified TCP port on remote computer" +msgstr "连接到远程计算机特定的TCP端口" + +#: src/snes9x.ui:2424 +msgid "Act as a server" +msgstr "作为服务器" + +#: src/snes9x.ui:2428 +msgid "" +"Host a game on this computer as Player 1, requiring extra throughput to " +"support multitple users" +msgstr "在这台计算机作为玩家一建立游戏, 需要额外的带宽以维持多个玩家联机" + +#: src/snes9x.ui:2448 +msgid "Server" +msgstr "服务器" + +#: src/snes9x.ui:2478 +msgid "Sync using reset" +msgstr "使用复位进行同步" + +#: src/snes9x.ui:2482 +msgid "" +"Reset the game when players join instead of transferring potentially " +"unreliable freeze states" +msgstr "当新玩家加入时重置游戏以避免传输潜在的不可用堵塞状态" + +#: src/snes9x.ui:2493 +msgid "Send ROM image to clients" +msgstr "向客户端发送ROM文件" + +#: src/snes9x.ui:2497 +msgid "" +"Send the running game image to players instead of requiring them to have " +"their own copies" +msgstr "向玩家发送运行中的游戏文件以避免玩家自备游戏镜像" + +#: src/snes9x.ui:2515 +msgid "Default port:" +msgstr "默认端口:" + +#: src/snes9x.ui:2527 +msgid "TCP port used as a connection point for remote clients" +msgstr "用于连接远程主机的TCP端口" + +#: src/snes9x.ui:2559 +msgid "Ask server to pause when" +msgstr "向服务器请求暂停当" + +#: src/snes9x.ui:2589 +msgid "frames behind" +msgstr "帧延迟" + +#: src/snes9x.ui:2612 +msgid "Settings" +msgstr "设置" + +#: src/snes9x.ui:2640 +msgid "Snes9x Preferences" +msgstr "Snes9x 首选项" + +#: src/snes9x.ui:2756 +msgid "Use fullscreen on ROM open" +msgstr "启动游戏时自动全屏" + +#: src/snes9x.ui:2760 +msgid "Go to fullscreen mode immediately after opening a ROM" +msgstr "打开ROM文件时立即进入全屏模式" + +#: src/snes9x.ui:2772 +msgid "Show local time" +msgstr "显示本地时间" + +#: src/snes9x.ui:2787 +msgid "Show frame rate" +msgstr "显示帧率" + +#: src/snes9x.ui:2802 +msgid "Show pressed keys" +msgstr "显示按键屏显" + +#: src/snes9x.ui:2817 +msgid "Use overscanned height" +msgstr "使用过扫描时的高度" + +#: src/snes9x.ui:2821 +msgid "Use SNES extended height. Will probably cause letterboxing" +msgstr "使用SNES扩展高度. 这很可能导致\"信箱模式\"的黑边" + +#: src/snes9x.ui:2838 +msgid "Change fullscreen resolution:" +msgstr "更改全屏分辨率:" + +#: src/snes9x.ui:2842 +msgid "Changes the screen resolution when running Snes9x in fullscreen mode" +msgstr "更改Snes9x处于全屏模式时的屏幕分辨率" + +#: src/snes9x.ui:2885 +msgid "Basic Settings" +msgstr "常规设置" + +#: src/snes9x.ui:2926 +msgid "Scale image to fit window" +msgstr "缩放图像以适应窗口" + +#: src/snes9x.ui:2930 +msgid "Scales the image so no black bars are present" +msgstr "缩放图像以避免出现黑边" + +#: src/snes9x.ui:2950 +msgid "Aspect ratio:" +msgstr "纵横比:" + +#: src/snes9x.ui:2985 +msgid "Maintain aspect-ratio" +msgstr "锁定纵横比" + +#: src/snes9x.ui:2989 +msgid "Scales the image as large as possible without distortion" +msgstr "在避免变形的前提下尽可能放大图像" + +#: src/snes9x.ui:3006 +msgid "Use " +msgstr "使用 " + +#: src/snes9x.ui:3010 +msgid "Allows scaling and filtering to use multiple processors" +msgstr "允许在缩放和过滤时使用多进程" + +#: src/snes9x.ui:3042 +msgid "threads for filtering and scaling" +msgstr "线程用于过滤和缩放" + +#: src/snes9x.ui:3066 +msgid "High-resolution effect:" +msgstr "高分辨率效果:" + +#: src/snes9x.ui:3109 +msgid "Apply scaling filter:" +msgstr "应用纹理过滤:" + +#: src/snes9x.ui:3177 +msgid "Video preset:" +msgstr "预置视频:" + +#: src/snes9x.ui:3191 +msgid "Composite" +msgstr "混成" + +#: src/snes9x.ui:3205 +msgid "S-Video" +msgstr "S-Video" + +#: src/snes9x.ui:3219 +msgid "RGB" +msgstr "RGB" + +#: src/snes9x.ui:3233 +msgid "Monochrome" +msgstr "单色" + +#: src/snes9x.ui:3274 +msgid "Artifacts:" +msgstr "伪影:" + +#: src/snes9x.ui:3289 +msgid "Sharpness:" +msgstr "锐度:" + +#: src/snes9x.ui:3304 +msgid "Brightness:" +msgstr "亮度:" + +#: src/snes9x.ui:3319 +msgid "Contrast:" +msgstr "对比度:" + +#: src/snes9x.ui:3334 +msgid "Saturation:" +msgstr "饱和度:" + +#: src/snes9x.ui:3349 +msgid "Hue:" +msgstr "色度:" + +#: src/snes9x.ui:3550 +msgid "Gamma:" +msgstr "伽马值:" + +#: src/snes9x.ui:3565 +msgid "Fringing:" +msgstr "" + +#: src/snes9x.ui:3580 +msgid "Bleed:" +msgstr "" + +#: src/snes9x.ui:3595 +msgid "Resolution:" +msgstr "分辨率:" + +#: src/snes9x.ui:3625 +msgid "Merge odd and even fields" +msgstr "" + +#: src/snes9x.ui:3647 src/snes9x.ui:3706 +msgid "Scanline intensity:" +msgstr "扫描线强度:" + +#: src/snes9x.ui:3751 +msgid "Scaling" +msgstr "缩放" + +#: src/snes9x.ui:3793 +msgid "Bilinear-filter output" +msgstr "启用双线性过滤" + +#: src/snes9x.ui:3814 +msgid "Sync to vertical blank" +msgstr "垂直消隐同步" + +#: src/snes9x.ui:3818 +msgid "Sync the image to the vertical retrace to stop tearing" +msgstr "对垂直消隐进行图像同步以停止撕裂" + +#: src/snes9x.ui:3830 +msgid "Reduce input lag with glFinish" +msgstr "使用glFinish以降低输入延迟" + +#: src/snes9x.ui:3834 +msgid "" +"Sync the program with the video output after every displayed frame to reduce " +"input latency" +msgstr "与视频输出同步帧以降低输入延迟" + +#: src/snes9x.ui:3845 +msgid "Reduce input lag with sync control" +msgstr "使用同步控制以降低输入延迟" + +#: src/snes9x.ui:3849 +msgid "" +"More modern method for syncing the program with the video output to reduce " +"input latency. Allows GUI events to occur in the meantime" +msgstr "更加现代化地, 程序同步视频输出以降低输入延迟. 同时允许GUI事件响应" + +#: src/snes9x.ui:3860 +msgid "Allow non-power-of-two textures" +msgstr "允许非二次幂(NPOT)纹理" + +#: src/snes9x.ui:3864 +msgid "Prevents edge artifacts, but can slow performance" +msgstr "避免边缘伪影, 但会降低性能" + +#: src/snes9x.ui:3875 +msgid "Use pixel-buffer objects" +msgstr "使用像素缓冲区对象(PBO)" + +#: src/snes9x.ui:3880 +msgid "Can be faster or slower depending on drivers" +msgstr "与硬件驱动有关, 可能加快或减慢" + +#: src/snes9x.ui:3900 +msgid "Different formats can yield highly different performance" +msgstr "不同格式对性能影响迥异" + +#: src/snes9x.ui:3907 +msgid "Pixel-buffer format:" +msgstr "像素缓冲格式" + +#: src/snes9x.ui:3950 +msgid "Shader:" +msgstr "着色器" + +#: src/snes9x.ui:4014 +msgid "Force an inverted byte-ordering" +msgstr "强制字节序翻转" + +#: src/snes9x.ui:4018 +msgid "" +"Forces a swapped byte-ordering for cases where the system's endian is used " +"instead of the video card" +msgstr "当使用系统而非显卡的字节序时, 强制字节序翻转" + +#: src/snes9x.ui:4042 +msgid "Hardware Acceleration" +msgstr "硬件加速" + +#: src/snes9x.ui:4071 +msgid "Display" +msgstr "图形" + +#: src/snes9x.ui:4124 +msgid "Sound driver:" +msgstr "音频驱动:" + +#: src/snes9x.ui:4159 +msgid "Automatically adjust input rate to display" +msgstr "自动调整对屏音频采样率" + +#: src/snes9x.ui:4163 +msgid "Sets the correct input rate based on the display's refresh rate" +msgstr "基于屏幕的刷新率设置正确的采样率" + +#: src/snes9x.ui:4175 +msgid "Dynamic rate control" +msgstr "动态频率控制" + +#: src/snes9x.ui:4179 +msgid "Smooth out slight hiccups in sound input rate" +msgstr "平滑处理音频采样时的轻微突越" + +#: src/snes9x.ui:4190 +msgid "Mute sound output" +msgstr "静音" + +#: src/snes9x.ui:4194 +msgid "Disables output of sound" +msgstr "停用音频输出" + +#: src/snes9x.ui:4206 +msgid "Mute sound when using turbo" +msgstr "变速时静音" + +#: src/snes9x.ui:4210 +msgid "Disables output of sound when using turbo" +msgstr "在变速模式下停用音频输出" + +#: src/snes9x.ui:4233 +msgid "Playback rate:" +msgstr "播放频率" + +#: src/snes9x.ui:4268 +msgid "milliseconds" +msgstr "毫秒" + +#: src/snes9x.ui:4291 +msgid "Buffer size:" +msgstr "缓冲大小:" + +#: src/snes9x.ui:4305 +msgid "Dynamic rate limit:" +msgstr "动态频率限制:" + +#: src/snes9x.ui:4350 +msgid "Input rate:" +msgstr "采样率:" + +#: src/snes9x.ui:4363 +msgid "" +"Adjust to produce more or less data. Decrease the rate if experiencing " +"crackling. Increase the rate if experiencing frame-rate stuttering. Best " +"used with the \"Synchronize with sound\" option" +msgstr "调整滑块以更改数据量. 当发生音频撕裂时降低采样率. 当发生帧率骤降时升高采样率.与\"音频同步\"选项搭配使用时效果最佳" + +#: src/snes9x.ui:4412 +msgid "Video rate:" +msgstr "刷新率:" + +#: src/snes9x.ui:4425 +msgid "label" +msgstr "标签" + +#: src/snes9x.ui:4450 +msgid "Sound Settings" +msgstr "音频设置" + +#: src/snes9x.ui:4484 src/snes9x.ui:8715 +msgid "Sound" +msgstr "音频" + +#: src/snes9x.ui:4542 +msgid "Throttling method:" +msgstr "调速策略" + +#: src/snes9x.ui:4584 +msgid "Speed Control" +msgstr "速度控制" + +#: src/snes9x.ui:4622 +msgid "Rewind buffer size (MB):" +msgstr "倒带缓存大小 (MB):" + +#: src/snes9x.ui:4664 +msgid "Number of frames between rewind snapshots:" +msgstr "倒带间隔帧数:" + +#: src/snes9x.ui:4705 +msgid "Rewind Settings" +msgstr "倒带设置" + +#: src/snes9x.ui:4736 +msgid "Allow invalid VRAM access" +msgstr "允许未识别的VRAM访问" + +#: src/snes9x.ui:4740 +msgid "" +"Allows ROM hacks to write to screen at the wrong time. Only use if you know " +"your ROM hack expects this" +msgstr "" + +#: src/snes9x.ui:4750 +msgid "Allow opposing dpad directions" +msgstr "允许逆向Dpad同步输入" + +#: src/snes9x.ui:4754 +msgid "Let left and right or up and down be pressed at the same time" +msgstr "允许同时按下上、下方向键或左、右方向键" + +#: src/snes9x.ui:4765 +msgid "Overclock CPU" +msgstr "CPU超频" + +#: src/snes9x.ui:4769 +msgid "Reduces slowdown, but has potential to break games" +msgstr "降低延迟, 可能使游戏运行失败" + +#: src/snes9x.ui:4780 +msgid "Remove sprite limit" +msgstr "移除精灵图限制" + +#: src/snes9x.ui:4784 +msgid "Reduces flicker, but may cause graphical artifacts" +msgstr "减少抖动, 可能导致图像伪影" + +#: src/snes9x.ui:4795 +msgid "Redirect echo buffer overflow" +msgstr "" + +#: src/snes9x.ui:4799 +msgid "Allows old addmusic hacks to work, but will likely hurt other games" +msgstr "" + +#: src/snes9x.ui:4817 +msgid "SuperFX clock speed %:" +msgstr "SuperFX 时钟速度 %:" + +#: src/snes9x.ui:4856 +msgid "Gaussian is the correct behavior for SNES hardware" +msgstr "" + +#: src/snes9x.ui:4863 +msgid "Sound filter:" +msgstr "音频过滤:" + +#: src/snes9x.ui:4900 +msgid "Hacks" +msgstr "" + +#: src/snes9x.ui:4942 src/snes9x.ui:7132 +msgid "Emulation" +msgstr "模拟" + +#: src/snes9x.ui:5183 +msgid "SRAM:" +msgstr "SRAM:" + +#: src/snes9x.ui:5195 +msgid "Save states:" +msgstr "即时存档:" + +#: src/snes9x.ui:5209 +msgid "Cheats:" +msgstr "作弊码:" + +#: src/snes9x.ui:5223 +msgid "Patches:" +msgstr "补丁:" + +#: src/snes9x.ui:5237 +msgid "Exports:" +msgstr "导出:" + +#: src/snes9x.ui:5261 +msgid "Game Data Locations" +msgstr "游戏数据位置" + +#: src/snes9x.ui:5294 +msgid "Save SRAM:" +msgstr "保存SRAM:" + +#: src/snes9x.ui:5306 +msgid "" +"Automatically save the game's SRAM at this interval. Setting this to 0 will " +"only save when quitting or changing ROMs" +msgstr "以设定的间隔自动保存游戏的SRAM. 此值为0时将仅在退出或更改ROM文件时进行SRAM保存" + +#: src/snes9x.ui:5325 +msgid "seconds after change" +msgstr "秒每次" + +#: src/snes9x.ui:5341 +msgid "Automatic Saving" +msgstr "自动保存" + +#: src/snes9x.ui:5378 +msgid "Files" +msgstr "文件" + +#: src/snes9x.ui:5409 +msgid "Joypad:" +msgstr "手柄:" + +#: src/snes9x.ui:5450 +msgid "_Reset" +msgstr "重置(_R)" + +#: src/snes9x.ui:5478 +msgid "Swap with:" +msgstr "与右侧编号手柄交换按键映射:" + +#: src/snes9x.ui:5506 +msgid "_Swap" +msgstr "交换(_S)" + +#: src/snes9x.ui:5528 +msgid "Use modifier keys (CTRL, SHIFT, ALT) directly" +msgstr "直接使用修饰键(CTRL, SHIFT, ALT)" + +#: src/snes9x.ui:5532 +msgid "Allow using modifier keys as independent keys instead of modifiers" +msgstr "允许使用修饰键作为独立的按键映射" + +#: src/snes9x.ui:5566 +msgid "Up" +msgstr "Up" + +#: src/snes9x.ui:5578 +msgid "Down" +msgstr "Down" + +#: src/snes9x.ui:5592 +msgid "Left" +msgstr "Left" + +#: src/snes9x.ui:5606 +msgid "Right" +msgstr "Right" + +#: src/snes9x.ui:5620 +msgid "Start" +msgstr "Start" + +#: src/snes9x.ui:5634 +msgid "Select" +msgstr "Select" + +#: src/snes9x.ui:5775 src/snes9x.ui:6005 src/snes9x.ui:6217 +msgid "A" +msgstr "A" + +#: src/snes9x.ui:5787 src/snes9x.ui:6017 src/snes9x.ui:6229 +msgid "B" +msgstr "B" + +#: src/snes9x.ui:5801 src/snes9x.ui:6031 src/snes9x.ui:6243 +msgid "X" +msgstr "X" + +#: src/snes9x.ui:5815 src/snes9x.ui:6045 src/snes9x.ui:6257 +msgid "Y" +msgstr "Y" + +#: src/snes9x.ui:5829 src/snes9x.ui:6059 src/snes9x.ui:6271 +msgid "L" +msgstr "L" + +#: src/snes9x.ui:5843 src/snes9x.ui:6073 src/snes9x.ui:6285 +msgid "R" +msgstr "R" + +#: src/snes9x.ui:5977 +msgid "Buttons" +msgstr "按键" + +#: src/snes9x.ui:6418 +msgid "Sticky" +msgstr "粘滞" + +#: src/snes9x.ui:6434 +msgid "Turbo" +msgstr "连发" + +#: src/snes9x.ui:6453 +msgid "Turbo / Sticky Buttons" +msgstr "连发/粘滞 按键" + +#: src/snes9x.ui:6490 +msgid "Set new axis bindings at:" +msgstr "更新参考轴线于:" + +#: src/snes9x.ui:6502 +msgid "" +"Changes the amount a joystick should be tilted to register a button press" +msgstr "更改摇杆注册按键事件的轴倾值" + +#: src/snes9x.ui:6521 +msgid "percent" +msgstr "%" + +#: src/snes9x.ui:6538 +msgid "Joystick Axis Threshold" +msgstr "摇杆轴阈值" + +#: src/snes9x.ui:6575 +msgid "Center all axes on all joysticks and press Calibrate." +msgstr "先将摇杆和中轴对中再按下校准按钮." + +#: src/snes9x.ui:6590 +msgid "Cali_brate" +msgstr "校准(_b)" + +#: src/snes9x.ui:6623 +msgid "Calibration" +msgstr "校准" + +#: src/snes9x.ui:6644 +msgid "Joystick Options" +msgstr "摇杆选项" + +#: src/snes9x.ui:6662 src/snes9x.ui:9014 +msgid "" +"Click an entry and then press the desired keys or joystick button\n" +"Escape: Move to next Shift-Escape: Clear selected" +msgstr "" +"选定项目后按下相应的按键组合或手柄按钮\n" +"Escape: 移至下一个 Shift-Escape: 清空已选" + +#: src/snes9x.ui:6700 +msgid "Joypads" +msgstr "手柄" + +#: src/snes9x.ui:6727 +msgid "Snes9x Emulator Shortcut Keys" +msgstr "Snes9x快捷键" + +#: src/snes9x.ui:6778 +msgid "Soft reset" +msgstr "软重置" + +#: src/snes9x.ui:6792 +msgid "Hardware reset" +msgstr "复位" + +#: src/snes9x.ui:6806 +msgid "Increase frame time" +msgstr "提高帧延迟" + +#: src/snes9x.ui:6820 +msgid "Decrease frame time" +msgstr "降低帧延迟" + +#: src/snes9x.ui:6834 +msgid "Increase frame rate" +msgstr "提高帧率" + +#: src/snes9x.ui:6848 +msgid "Decrease frame rate" +msgstr "降低帧率" + +#: src/snes9x.ui:6862 +msgid "Pause" +msgstr "暂停" + +#: src/snes9x.ui:6876 +msgid "Toggle turbo" +msgstr "切换变速模式" + +#: src/snes9x.ui:6890 +msgid "Enable turbo" +msgstr "启用变速模式" + +#: src/snes9x.ui:6905 +msgid "Open ROM" +msgstr "打开ROM" + +#: src/snes9x.ui:7164 +msgid "Toggle BG layer 0" +msgstr "" + +#: src/snes9x.ui:7176 +msgid "Toggle BG layer 1" +msgstr "" + +#: src/snes9x.ui:7190 +msgid "Toggle BG layer 2" +msgstr "" + +#: src/snes9x.ui:7204 +msgid "Toggle BG layer 3" +msgstr "" + +#: src/snes9x.ui:7218 +msgid "Toggle sprites" +msgstr "" + +#: src/snes9x.ui:7232 +msgid "BG layering hack" +msgstr "" + +#: src/snes9x.ui:7246 +msgid "Screenshot" +msgstr "屏幕截图" + +#: src/snes9x.ui:7260 +msgid "Toggle fullscreen" +msgstr "切换全屏" + +#: src/snes9x.ui:7424 +msgid "Graphics" +msgstr "图形" + +#: src/snes9x.ui:7461 +msgid "Save current slot" +msgstr "" + +#: src/snes9x.ui:7494 +msgid "Load current slot" +msgstr "" + +#: src/snes9x.ui:7527 +msgid "Increment and save" +msgstr "" + +#: src/snes9x.ui:7560 +msgid "Decrement and load" +msgstr "" + +#: src/snes9x.ui:7593 +msgid "Increment slot" +msgstr "" + +#: src/snes9x.ui:7626 +msgid "Decrement slot" +msgstr "" + +#: src/snes9x.ui:7670 +msgid "Quick save state" +msgstr "快速存档" + +#: src/snes9x.ui:7685 +msgid "Quick load state" +msgstr "快速读档" + +#: src/snes9x.ui:7700 src/snes9x.ui:7840 +msgid "Slot 0" +msgstr "插槽 0" + +#: src/snes9x.ui:7714 src/snes9x.ui:7856 +msgid "Slot 1" +msgstr "插槽 1" + +#: src/snes9x.ui:7728 src/snes9x.ui:7872 +msgid "Slot 2" +msgstr "插槽 2" + +#: src/snes9x.ui:7742 src/snes9x.ui:7888 +msgid "Slot 3" +msgstr "插槽 3" + +#: src/snes9x.ui:7756 src/snes9x.ui:7904 +msgid "Slot 4" +msgstr "插槽 4" + +#: src/snes9x.ui:7770 src/snes9x.ui:7920 +msgid "Slot 5" +msgstr "插槽 5" + +#: src/snes9x.ui:7784 src/snes9x.ui:7936 +msgid "Slot 6" +msgstr "插槽 6" + +#: src/snes9x.ui:7798 src/snes9x.ui:7952 +msgid "Slot 7" +msgstr "插槽 7" + +#: src/snes9x.ui:7812 src/snes9x.ui:7968 +msgid "Slot 8" +msgstr "插槽 8" + +#: src/snes9x.ui:7826 src/snes9x.ui:7984 +msgid "Slot 9" +msgstr "插槽 9" + +#: src/snes9x.ui:8423 +msgid "Toggle sound channel 0" +msgstr "切换音频信道 0" + +#: src/snes9x.ui:8435 +msgid "Toggle sound channel 1" +msgstr "切换音频信道 1" + +#: src/snes9x.ui:8449 +msgid "Toggle sound channel 2" +msgstr "切换音频信道 2" + +#: src/snes9x.ui:8463 +msgid "Toggle sound channel 3" +msgstr "切换音频信道 3" + +#: src/snes9x.ui:8477 +msgid "Toggle sound channel 4" +msgstr "切换音频信道 4" + +#: src/snes9x.ui:8491 +msgid "Toggle sound channel 5" +msgstr "切换音频信道 5" + +#: src/snes9x.ui:8505 +msgid "Toggle sound channel 6" +msgstr "切换音频信道 6" + +#: src/snes9x.ui:8519 +msgid "Toggle sound channel 7" +msgstr "切换音频信道 7" + +#: src/snes9x.ui:8533 +msgid "Toggle all sound channels" +msgstr "切换全音频信道" + +#: src/snes9x.ui:8738 +msgid "Seek to frame" +msgstr "" + +#: src/snes9x.ui:8753 +msgid "Load Movie" +msgstr "载入影片" + +#: src/snes9x.ui:8768 +msgid "Stop movie recording" +msgstr "停止影片录制" + +#: src/snes9x.ui:8783 +msgid "Begin movie recording" +msgstr "开始影片录制" + +#: src/snes9x.ui:8798 +msgid "Save SPC" +msgstr "保存SPC" + +#: src/snes9x.ui:8898 +msgid "Swap controllers 1 & 2" +msgstr "对调1 & 2控制器" + +#: src/snes9x.ui:8929 +msgid "Rewind" +msgstr "倒带" + +#: src/snes9x.ui:8960 +msgid "Capture/release mouse" +msgstr "捕获/释放 鼠标" + +#: src/snes9x.ui:8996 +msgid "Misc" +msgstr "杂项" + +#: src/snes9x.ui:9052 +msgid "Shortcuts" +msgstr "热键" + +#: src/snes9x.ui:9091 +msgid "Pause emulation when switching away from Snes9x" +msgstr "Snes9x失去焦点时暂停模拟" + +#: src/snes9x.ui:9105 +msgid "Force-enable button and menu icons" +msgstr "强制启用按键和菜单图标" + +#: src/snes9x.ui:9126 +msgid "The ESC key should:" +msgstr "ESC按键应当:" + +#: src/snes9x.ui:9168 +msgid "Initial background:" +msgstr "初始背景:" + +#: src/snes9x.ui:9209 +msgid "Window Behavior" +msgstr "窗口行为" + +#: src/snes9x.ui:9239 +msgid "Prevent the screensaver from activating" +msgstr "防止激活屏幕保护程序" + +#: src/snes9x.ui:9259 +msgid "Screensaver" +msgstr "屏幕保护程序" + +#: src/snes9x.ui:9293 +msgid "UI" +msgstr "UI" + +#: src/snes9x.ui:9327 +msgid "" +" Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.\n" +"\n" +" Snes9x homepage: http://www.snes9x.com/\n" +" Snes9x source code: https://github.com/snes9xgit/snes9x/\n" +"\n" +" Permission to use, copy, modify and/or distribute Snes9x in both binary\n" +" and source form, for non-commercial purposes, is hereby granted without\n" +" fee, providing that this license information and copyright notice appear\n" +" with all copies and any derived work.\n" +"\n" +" This software is provided 'as-is', without any express or implied\n" +" warranty. In no event shall the authors be held liable for any damages\n" +" arising from the use of this software or it's derivatives.\n" +"\n" +" Snes9x is freeware for PERSONAL USE only. Commercial users should\n" +" seek permission of the copyright holders first. Commercial use includes,\n" +" but is not limited to, charging money for Snes9x or software derived from\n" +" Snes9x, including Snes9x or derivatives in commercial game bundles, and/" +"or\n" +" using Snes9x as a promotion for your commercial product.\n" +"\n" +" The copyright holders request that bug fixes and improvements to the code\n" +" should be forwarded to them so everyone can benefit from the " +"modifications\n" +" in future versions.\n" +"\n" +" Super NES and Super Nintendo Entertainment System are trademarks of\n" +" Nintendo Co., Limited and its subsidiary companies." +msgstr "" diff --git a/gtk/src/background_particles.cpp b/gtk/src/background_particles.cpp new file mode 100644 index 00000000..2b6a8056 --- /dev/null +++ b/gtk/src/background_particles.cpp @@ -0,0 +1,192 @@ +#include "background_particles.h" +#include +#include +#include +#include + +static const double pi = 3.141592; + +namespace Background +{ + +Particles::Particles(enum Mode mode) +{ + this->mode = Invalid; + setmode(mode); +} + +Particles::~Particles() +{ +} + +void Particles::setmode(enum Mode mode) +{ + if (mode == this->mode) + return; + std::random_device device; + mt.seed(device()); + output.resize(256 * 224 * 2); + gameimage.resize(256 * 224 * 2); + + uint16_t r, g, b; + if (mode == Snow) + { + r = 0; g = 2; b = 6; + } + else + { + r = 0; g = 0; b = 0; + } + + for (int i = 0; i < 256 * 224; i++) + { + output[i] = (r << 11) | (g << 6) | (b); + } + particles.clear(); + + this->mode = mode; + std::uniform_real_distribution real(-0.8, 0.8); + wind = real(mt); + + for (int l = 0; l < 32; l++) + { + int mixr = r + (l / 31.0) * (31 - r); + int mixg = g + (l / 31.0) * (31 - g); + int mixb = b + (l / 31.0) * (31 - b); + color_table[l] = (mixr << 11) | (mixg << 6) | mixb; + } +} + +void Particles::copyto(uint16_t *dst, int pitch) +{ + for (int y = 0; y < 224; y++) + { + memcpy((uint8_t *)dst + y * pitch, &output[y * 256], 512); + } +} + +void Particles::set_game_image(uint16_t *src, int pitch) +{ + for (int y = 0; y < 224; y++) + memcpy(&gameimage[y * 256], &src[y * pitch / 2], 512); +} + +void Particles::advance() +{ + if (mode == Snow) + advance_snow(); + else + advance_starfield(); +} + +inline void Particles::setpixel(int x, int y, uint16_t l) +{ + output[x + (y << 8)] = color_table[l]; +} + +void Particles::advance_starfield() +{ + rate = 0.5; + + std::uniform_real_distribution realrand(0.0, 1.0); + if (realrand(mt) <= rate) + { + Particle pt; + + double angle = realrand(mt) * 2 * pi; + pt.dx = cos(angle); + pt.dy = sin(angle) * 0.7; + pt.x = 128.5 + pt.dx * 5.0; + pt.y = 112.5 + pt.dy * 5.0; + pt.intensity = 0; + + particles.push_back(pt); + } + + for (auto p = particles.begin(); p != particles.end(); p++) + { + setpixel(p->x - 0.5, p->y - 0.5, 0); + setpixel(p->x + 0.5, p->y + 0.5, 0); + setpixel(p->x + 0.5, p->y - 0.5, 0); + setpixel(p->x - 0.5, p->y + 0.5, 0); + + p->x += p->dx; + p->y += p->dy; + + if ((int)p->x < 1 || (int)p->x > 255 || (int)p->y < 1 || (int)p->y > 223) + { + p = particles.erase(p); + continue; + } + + p->intensity = (p->intensity + 1); + if (p->intensity > 63) + p->intensity = 63; + + uint16_t lum = p->intensity >> 1; + + // primitive bilinear filter effect + double dx = p->x - 0.5; + dx = dx - floor(dx); + double dy = p->y - 0.5; + dy = dy - floor(dy); + + uint16_t cul = (1.0 - dx) * (1.0 - dy) * lum; + uint16_t cur = (dx) * (1.0 - dy) * lum; + uint16_t cll = (1.0 - dx) * (dy)*lum; + uint16_t clr = (dx) * (dy)*lum; + + setpixel(p->x - 0.5, p->y - 0.5, cul); + setpixel(p->x + 0.5, p->y - 0.5, cur); + setpixel(p->x - 0.5, p->y + 0.5, cll); + setpixel(p->x + 0.5, p->y + 0.5, clr); + } +} + +void Particles::advance_snow() +{ + rate = 1.0; + + std::uniform_real_distribution realrand; + + realrand = std::uniform_real_distribution(-0.01, std::nextafter(0.01, 1.0)); + wind += realrand(mt); + + if (wind < -0.8) + wind = -0.8; + if (wind > 0.8) + wind = 0.8; + + for (double new_snowflakes = rate; new_snowflakes >= 1.0; new_snowflakes -= 1.0) + { + Particle pt; + + realrand = std::uniform_real_distribution(0.0, 1.0); + pt.x = ((wind + 0.8) / 1.6) * -192.0 + realrand(mt) * 384.0; + pt.y = 0.0; + pt.dx = 0.0; + pt.dy = 0.6 + (realrand(mt) * 0.8); + std::uniform_int_distribution intrand(8, 31); + pt.intensity = intrand(mt); + + particles.push_back(pt); + } + + for (auto p = particles.begin(); p != particles.end(); p++) + { + if (p->x > 0.0 && p->x < 256.0) + setpixel(p->x, p->y, 0); + + p->x += wind; + p->y += p->dy; + + if ((int)p->y > 223) + { + p = particles.erase(p); + } + else if (p->x > 0.0 && p->x < 256.0) + setpixel(p->x, p->y, p->intensity); + } +} + +} // namespace Background \ No newline at end of file diff --git a/gtk/src/background_particles.h b/gtk/src/background_particles.h new file mode 100644 index 00000000..c0dfbb4e --- /dev/null +++ b/gtk/src/background_particles.h @@ -0,0 +1,54 @@ +#ifndef __BACKGROUND_PARTICLES_H +#define __BACKGROUND_PARTICLES_H +#include +#include +#include +#include + +namespace Background +{ + +class Particles +{ + public: + double rate = 0.5; + + enum Mode + { + Stars, + Snow, + Invalid + }; + + struct Particle + { + double x, y, dx, dy; + unsigned int intensity; + }; + + Particles(enum Mode = Stars); + ~Particles(); + void advance(); + void copyto(uint16_t *dst, int pitch); + enum Mode getmode(); + void setmode(enum Mode); + void set_game_image(uint16_t *src, int pitch); + + std::vector output; + + private: + inline void setpixel(int x, int y, uint16_t l); + void advance_snow(); + void advance_starfield(); + + std::minstd_rand mt; + std::uniform_real_distribution dis; + std::vector gameimage; + std::list particles; + enum Mode mode; + double wind; + uint16_t color_table[32]; +}; + +} // namespace Background +#endif // __BACKGROUND_PARTICLES_H \ No newline at end of file diff --git a/gtk/src/gtk_2_3_compat.h b/gtk/src/gtk_2_3_compat.h deleted file mode 100644 index acef998b..00000000 --- a/gtk/src/gtk_2_3_compat.h +++ /dev/null @@ -1,60 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -#ifndef __GTK_2_3_COMPAT_H -#define __GTK_2_3_COMPAT_H - -#include -#include -#include - -#if GTK_MAJOR_VERSION >= 3 - -#include - -#ifndef USE_WAYLAND -#undef GDK_WINDOWING_WAYLAND -#endif - -#ifdef GDK_WINDOWING_WAYLAND -#include -#endif - -#else // GTK+ 2.0 - -#define GDK_WINDOWING_X11 -#define GDK_IS_X11_WINDOW(window) true -#define GDK_IS_X11_DISPLAY(display) true -#define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window) - -inline void gdk_x11_display_error_trap_push(GdkDisplay *dpy) -{ - gdk_error_trap_push(); -} - -inline void gdk_x11_display_error_trap_pop_ignored(GdkDisplay *dpy) -{ - if (gdk_error_trap_pop()) - { - } -} - -inline void gdk_window_get_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height) -{ - gdk_window_get_geometry (window, x, y, width, height, NULL); -} - -#endif - -#ifdef GDK_WINDOWING_X11 -#include -#endif - -#endif diff --git a/gtk/src/gtk_binding.cpp b/gtk/src/gtk_binding.cpp index d1efffe4..51241d5e 100644 --- a/gtk/src/gtk_binding.cpp +++ b/gtk/src/gtk_binding.cpp @@ -10,22 +10,22 @@ #include "gtk_s9x.h" #include "gtk_binding.h" -Binding::Binding () +Binding::Binding() { value = 0; } -Binding::Binding (GdkEventKey *event) +Binding::Binding(GdkEventKey *event) { - event->keyval = gdk_keyval_to_lower (event->keyval); + event->keyval = gdk_keyval_to_lower(event->keyval); value = BINDING_KEY | (event->keyval & BINDING_KEY_MASK); /* Strip modifiers from modifiers */ if (event->keyval == GDK_Control_L || event->keyval == GDK_Control_R || - event->keyval == GDK_Shift_L || - event->keyval == GDK_Shift_R || - event->keyval == GDK_Alt_L || + event->keyval == GDK_Shift_L || + event->keyval == GDK_Shift_R || + event->keyval == GDK_Alt_L || event->keyval == GDK_Alt_R) { return; @@ -41,7 +41,7 @@ Binding::Binding (GdkEventKey *event) value |= BINDING_ALT; } -Binding::Binding (unsigned int key, bool ctrl, bool shift, bool alt) +Binding::Binding(unsigned int key, bool ctrl, bool shift, bool alt) { value = BINDING_KEY; @@ -54,23 +54,21 @@ Binding::Binding (unsigned int key, bool ctrl, bool shift, bool alt) value |= BINDING_ALT; } -Binding::Binding (unsigned int device, - unsigned int button, - unsigned int threshold) +Binding::Binding(unsigned int device, unsigned int button, unsigned int threshold) { value = BINDING_JOY; - value |= JOY_DEVICE_MASK (device + 1); + value |= JOY_DEVICE_MASK(device + 1); value |= BINDING_KEY_MASK & button; if (button >= 512) - value |= THRESHOLD_MASK (threshold); + value |= THRESHOLD_MASK(threshold); } -Binding::Binding (unsigned int val) +Binding::Binding(unsigned int val) { value = val; } -Binding::Binding (const Binding& binding) +Binding::Binding(const Binding &binding) { this->value = binding.value; } @@ -81,91 +79,77 @@ Binding &Binding::operator=(const Binding &binding) return *this; } -bool -Binding::matches (Binding &binding) +bool Binding::operator==(const Binding &binding) { - if ((value & ~BINDING_THRESHOLD_MASK) == - (binding.value & ~BINDING_THRESHOLD_MASK)) + if ((value & ~BINDING_THRESHOLD_MASK) == (binding.value & ~BINDING_THRESHOLD_MASK)) return true; return false; } -void -Binding::clear () +void Binding::clear() { value = 0; } -unsigned int -Binding::hex () +unsigned int Binding::hex() { return value; } -unsigned int -Binding::base_hex () +unsigned int Binding::base_hex() { return (value & ~BINDING_THRESHOLD_MASK); } -bool -Binding::is_joy () +bool Binding::is_joy() { return (value & BINDING_JOY); } -bool -Binding::is_key () +bool Binding::is_key() { return (value & BINDING_KEY); } -unsigned int -Binding::get_key () +unsigned int Binding::get_key() { return (value & BINDING_KEY_MASK); } -unsigned int -Binding::get_device () +unsigned int Binding::get_device() { - return JOY_DEVICE_UNMASK (value); + return JOY_DEVICE_UNMASK(value); } -unsigned int -Binding::get_threshold () +unsigned int Binding::get_threshold() { - return THRESHOLD_UNMASK (value); + return THRESHOLD_UNMASK(value); } -unsigned int -Binding::get_axis () +unsigned int Binding::get_axis() { - return JOY_AXIS_UNMASK (value); + return JOY_AXIS_UNMASK(value); } -GdkModifierType -Binding::get_gdk_modifiers () +Gdk::ModifierType Binding::get_gdk_modifiers() { - return (GdkModifierType) (((BINDING_CTRL & value) ? GDK_CONTROL_MASK : 0) | - ((BINDING_ALT & value) ? GDK_MOD1_MASK : 0) | - ((BINDING_SHIFT & value) ? GDK_SHIFT_MASK : 0)); + return (Gdk::ModifierType)(((BINDING_CTRL & value) ? Gdk::CONTROL_MASK : 0) | + ((BINDING_ALT & value) ? Gdk::MOD1_MASK : 0) | + ((BINDING_SHIFT & value) ? Gdk::SHIFT_MASK : 0)); } -bool -Binding::is_positive () +bool Binding::is_positive() { - return JOY_DIRECTION_UNMASK (value) == AXIS_POS; + return JOY_DIRECTION_UNMASK(value) == AXIS_POS; } -bool -Binding::is_negative () +bool Binding::is_negative() { - return JOY_DIRECTION_UNMASK (value) == AXIS_NEG; + return JOY_DIRECTION_UNMASK(value) == AXIS_NEG; } -Binding::Binding (const char *raw_string) +Binding::Binding(const char *raw_string) { value = 0; @@ -173,33 +157,33 @@ Binding::Binding (const char *raw_string) return; char substr[80]; - if (sscanf (raw_string, "Keyboard %79s", substr) == 1) + if (sscanf(raw_string, "Keyboard %79s", substr) == 1) { bool ctrl = false; bool shift = false; - bool alt= false; + bool alt = false; bool direct = false; unsigned int keyval = 0; char *key; - if (!strchr (substr, '+')) + if (!strchr(substr, '+')) direct = true; - key = strtok (substr, "+"); + key = strtok(substr, "+"); while (key) { - if (strstr (key, "Alt") && !direct) + if (strstr(key, "Alt") && !direct) alt = true; - else if (strstr (key, "Ctrl") && !direct) + else if (strstr(key, "Ctrl") && !direct) ctrl = true; - else if (strstr (key, "Shift") && !direct) + else if (strstr(key, "Shift") && !direct) shift = true; else { - keyval = gdk_keyval_from_name (key); + keyval = gdk_keyval_from_name(key); } - key = strtok (NULL, "+"); + key = strtok(NULL, "+"); } if (keyval != GDK_KEY_VoidSymbol) @@ -207,7 +191,7 @@ Binding::Binding (const char *raw_string) else value = 0; } - else if (!strncmp (raw_string, "Joystick", 8)) + else if (!strncmp(raw_string, "Joystick", 8)) { unsigned int axis; unsigned int button; @@ -216,20 +200,25 @@ Binding::Binding (const char *raw_string) char posneg; const char *substr = &raw_string[8]; - if (sscanf (substr, "%u Axis %u %c %u", &device, &axis, &posneg, &percent) == 4) + if (sscanf(substr, "%u Axis %u %c %u", &device, &axis, &posneg, &percent) == 4) { - value = Binding(device - 1, JOY_AXIS (axis, posneg == '+' ? AXIS_POS : AXIS_NEG), percent).value; + value = Binding(device - 1, JOY_AXIS(axis, posneg == '+' ? AXIS_POS : AXIS_NEG), percent).value; } - else if (sscanf (substr, "%u Button %u", &device, &button) == 2) + else if (sscanf(substr, "%u Button %u", &device, &button) == 2) { value = Binding(device - 1, button, 0).value; } - } } -void -Binding::to_string (char *str, bool translate) +std::string Binding::as_string() +{ + char buf[PATH_MAX]; + to_string(buf, false); + return std::string(buf); +} + +void Binding::to_string(char *str, bool translate) { char buf[256]; @@ -238,22 +227,22 @@ Binding::to_string (char *str, bool translate) str[0] = '\0'; - if (is_key ()) + if (is_key()) { char *keyval_name = NULL; - unsigned int keyval = gdk_keyval_to_lower (get_key ()); - keyval_name = gdk_keyval_name (keyval); + unsigned int keyval = gdk_keyval_to_lower(get_key()); + keyval_name = gdk_keyval_name(keyval); if (keyval_name == NULL) { - sprintf (buf, _("Unknown")); + sprintf(buf, _("Unknown")); } else { - memset (buf, 0, 256); - strncpy (buf, - keyval_name, - 255); + memset(buf, 0, 256); + strncpy(buf, + keyval_name, + 255); } if (translate) @@ -261,29 +250,29 @@ Binding::to_string (char *str, bool translate) if (buf[i] == '_') buf[i] = ' '; - sprintf (str, _("Keyboard %s%s%s%s"), - (value & BINDING_SHIFT) ? "Shift+" : "", - (value & BINDING_CTRL) ? "Ctrl+" : "", - (value & BINDING_ALT) ? "Alt+" : "", - buf); + sprintf(str, _("Keyboard %s%s%s%s"), + (value & BINDING_SHIFT) ? "Shift+" : "", + (value & BINDING_CTRL) ? "Ctrl+" : "", + (value & BINDING_ALT) ? "Alt+" : "", + buf); } - else if (is_joy ()) + else if (is_joy()) { - if ((get_key ()) >= 512) - sprintf (buf, - _("Axis %u %s %u%%"), - get_axis (), - is_positive () ? "+" : "-", - get_threshold ()); + if ((get_key()) >= 512) + sprintf(buf, + _("Axis %u %s %u%%"), + get_axis(), + is_positive() ? "+" : "-", + get_threshold()); else - sprintf (buf, _("Button %u"), get_key ()); + sprintf(buf, _("Button %u"), get_key()); - sprintf (str, _("Joystick %u %s"), get_device (), buf); + sprintf(str, _("Joystick %u %s"), get_device(), buf); } else { - sprintf (str, _("Unset")); + sprintf(str, _("Unset")); } } diff --git a/gtk/src/gtk_binding.h b/gtk/src/gtk_binding.h index c4129bff..1c2ec3ed 100644 --- a/gtk/src/gtk_binding.h +++ b/gtk/src/gtk_binding.h @@ -7,7 +7,8 @@ #ifndef __GTK_BINDING_H #define __GTK_BINDING_H -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" +#include #define AXIS_POS 1 #define AXIS_NEG 0 @@ -31,35 +32,36 @@ #define BINDING_MOUSE_BUTTON1 0x42000001 #define BINDING_MOUSE_BUTTON2 0x42000002 -class Binding +class Binding { - public: - Binding (unsigned int key, bool ctrl, bool shift, bool alt); - Binding (unsigned int device, unsigned int button, unsigned int threshold); - Binding (const Binding &binding); - Binding &operator=(const Binding &binding); - Binding (GdkEventKey *event); - Binding (unsigned int); - Binding (); - Binding (const char *str); - void to_string (char *str, bool translate = true); - unsigned int hex (); - unsigned int base_hex (); - bool matches (Binding &binding); - void clear (); - bool is_joy (); - bool is_key (); - bool is_mouse (); - bool is_positive (); - bool is_negative (); - unsigned int get_key (); - unsigned int get_device (); - unsigned int get_threshold (); - unsigned int get_axis (); - GdkModifierType get_gdk_modifiers (); - - private: - unsigned int value; + public: + Binding(unsigned int key, bool ctrl, bool shift, bool alt); + Binding(unsigned int device, unsigned int button, unsigned int threshold); + Binding(const Binding &binding); + Binding &operator=(const Binding &binding); + bool operator==(const Binding &binding); + Binding(GdkEventKey *event); + Binding(unsigned int); + Binding(); + Binding(const char *str); + void to_string(char *str, bool translate = true); + std::string as_string(); + unsigned int hex(); + unsigned int base_hex(); + void clear(); + bool is_joy(); + bool is_key(); + bool is_mouse(); + bool is_positive(); + bool is_negative(); + unsigned int get_key(); + unsigned int get_device(); + unsigned int get_threshold(); + unsigned int get_axis(); + Gdk::ModifierType get_gdk_modifiers(); + + private: + unsigned int value; }; - + #endif /* __GTK_BINDING_H_ */ diff --git a/gtk/src/gtk_builder_window.cpp b/gtk/src/gtk_builder_window.cpp index 846301e4..4fc5cb5f 100644 --- a/gtk/src/gtk_builder_window.cpp +++ b/gtk/src/gtk_builder_window.cpp @@ -9,242 +9,147 @@ #include "gtk_builder_window.h" extern const unsigned char snes9x_ui[]; -extern const int snes9x_ui_size; +extern const int snes9x_ui_size; -GtkBuilderWindow::GtkBuilderWindow (const char *root) +Glib::RefPtr global_builder; +bool global_builder_created = false; + +GtkBuilderWindow::GtkBuilderWindow(const char *root) { - builder = gtk_builder_new (); - gtk_builder_add_from_string (builder, - (const gchar *) snes9x_ui, - snes9x_ui_size, - NULL); - - window = get_widget (root); -} - -GtkBuilderWindow::~GtkBuilderWindow () -{ - gtk_widget_destroy (window); - g_object_unref (builder); -} - -GtkWidget * -GtkBuilderWindow::get_widget (const char *name) -{ - return GTK_WIDGET (gtk_builder_get_object (builder, name)); -} - -void -GtkBuilderWindow::signal_connection_func (GtkBuilder *builder, - GObject *object, - const gchar *signal_name, - const char *handler_name, - GObject *connect_object, - GConnectFlags flags, - gpointer data) -{ - GCallback function = NULL; - GtkBuilderWindow *window = (GtkBuilderWindow *) data; - GtkBuilderWindowCallbacks *callbacks = window->callbacks; - - for (int i = 0; callbacks[i].signal; i++) + if (!global_builder_created) { - if (!strcmp (handler_name, callbacks[i].signal)) - { - function = callbacks[i].function; - break; - } + global_builder = Gtk::Builder::create(); + global_builder->add_from_string((const gchar *)snes9x_ui, snes9x_ui_size); + global_builder_created = true; } - if (function) - { - if (connect_object) - { - fprintf (stderr, "Error: found a persistent object signal.\n"); - g_signal_connect_object (object, - signal_name, - function, - connect_object, - flags); - } - else - { - g_signal_connect_data (object, - signal_name, - function, - data, - NULL, - flags); - } - } - else - { - } + window = get_object(root); } -void -GtkBuilderWindow::signal_connect (GtkBuilderWindowCallbacks *callbacks) +GtkBuilderWindow::~GtkBuilderWindow() { - if (!callbacks) - return; - - this->callbacks = callbacks; - - gtk_builder_connect_signals_full (builder, - signal_connection_func, - (gpointer) this); - - this->callbacks = NULL; } -void -GtkBuilderWindow::enable_widget (const char *name, bool state) +void GtkBuilderWindow::enable_widget(const char *name, bool state) { - gtk_widget_set_sensitive (get_widget (name), state); + auto widget = get_object(name); + widget->set_sensitive(state); } -void -GtkBuilderWindow::resize (int width, int height) +void GtkBuilderWindow::show_widget(const char *name, bool state) { - if (width > 0 && height > 0) - gtk_window_resize (GTK_WINDOW (window), width, height); + auto widget = get_object(name); + widget->set_visible(state); } -void -GtkBuilderWindow::refresh () +void GtkBuilderWindow::resize(int width, int height) { - gtk_widget_queue_draw (GTK_WIDGET (window)); + window->resize(width, height); } -int -GtkBuilderWindow::get_width () +void GtkBuilderWindow::refresh() { - int width, height; - - gtk_window_get_size (GTK_WINDOW (window), &width, &height); - - return width; + window->queue_draw(); } -int -GtkBuilderWindow::get_height () +int GtkBuilderWindow::get_width() { - int width, height; - - gtk_window_get_size (GTK_WINDOW (window), &width, &height); - - return height; + return window->get_width(); } -void -GtkBuilderWindow::set_button_label (const char *name, const char *label) +int GtkBuilderWindow::get_height() { - gtk_button_set_label (GTK_BUTTON (get_widget (name)), label); + return window->get_height(); } -unsigned char -GtkBuilderWindow::get_check (const char *name) +void GtkBuilderWindow::set_button_label(const char *name, const char *label) { - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (get_widget (name)))) - return 1; - return 0; + get_object(name)->set_label(label); +} + +bool GtkBuilderWindow::get_check(const char *name) +{ + return get_object(name)->get_active(); } int GtkBuilderWindow::get_entry_value(const char *name) { - return atoi (gtk_entry_get_text (GTK_ENTRY (get_widget (name))));; + auto text = get_object(name)->get_text(); + return std::stoi(text); } -const char * -GtkBuilderWindow::get_entry_text (const char *name) +std::string GtkBuilderWindow::get_entry_text(const char *name) { - return gtk_entry_get_text (GTK_ENTRY (get_widget (name))); + return get_object(name)->get_text(); } -float -GtkBuilderWindow::get_slider (const char *name) +void GtkBuilderWindow::set_entry_value(const char *name, unsigned int value) { - return (float) gtk_range_get_value (GTK_RANGE (get_widget (name))); + get_object(name)->set_text(std::to_string(value)); } -unsigned char -GtkBuilderWindow::get_combo (const char *name) +void GtkBuilderWindow::set_entry_text(const char *name, const char *text) { - return gtk_combo_box_get_active (GTK_COMBO_BOX (get_widget (name))); + get_object(name)->set_text(text); } -void -GtkBuilderWindow::set_slider (const char *name, float value) +float GtkBuilderWindow::get_slider(const char *name) { - gtk_range_set_value (GTK_RANGE (get_widget (name)), (double) value); + return get_object(name)->get_value(); } -void -GtkBuilderWindow::set_check (const char *name, bool value) +int GtkBuilderWindow::get_combo(const char *name) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget (name)), - value); + return get_object(name)->get_active_row_number(); } -void -GtkBuilderWindow::set_entry_value (const char *name, unsigned int value) +void GtkBuilderWindow::set_slider(const char *name, float value) { - char text[80]; - - snprintf (text, 80, "%u", value); - gtk_entry_set_text (GTK_ENTRY (get_widget (name)), text); + get_object(name)->set_value(value); } -void -GtkBuilderWindow::set_entry_text (const char *name, const char *text) +void GtkBuilderWindow::set_check(const char *name, bool value) { - gtk_entry_set_text (GTK_ENTRY (get_widget (name)), text); + get_object(name)->set_active(value); } -void -GtkBuilderWindow::set_combo (const char *name, unsigned char value) +void GtkBuilderWindow::set_combo(const char *name, unsigned char value) { - gtk_combo_box_set_active (GTK_COMBO_BOX (get_widget (name)), value); + get_object(name)->set_active(value); } -void -GtkBuilderWindow::set_spin (const char *name, double value) +void GtkBuilderWindow::set_spin(const char *name, double value) { - gtk_spin_button_set_value (GTK_SPIN_BUTTON (get_widget (name)), - (double) value); + get_object(name)->set_value(value); } -void -GtkBuilderWindow::combo_box_append (const char *name, const char *value) +double GtkBuilderWindow::get_spin(const char *name) { - combo_box_append (GTK_COMBO_BOX (get_widget (name)), value); + return get_object(name)->get_value(); } -void -GtkBuilderWindow::combo_box_append (GtkComboBox *combo, const char *value) +void GtkBuilderWindow::combo_box_append(const char *name, const char *value) +{ + return combo_box_append(get_object(name).get(), value); +} + +void GtkBuilderWindow::combo_box_append(Gtk::ComboBox *combo, const char *value) { GtkListStore *store; GtkTreeIter iter; - store = GTK_LIST_STORE (gtk_combo_box_get_model (combo)); + store = GTK_LIST_STORE(combo->get_model()->gobj()); - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, value, -1); + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0, value, -1); } -GtkWindow * -GtkBuilderWindow::get_window () +GtkWindow *GtkBuilderWindow::get_window() { - return GTK_WINDOW (window); -} - -double -GtkBuilderWindow::get_spin (const char *name) -{ - return gtk_spin_button_get_value (GTK_SPIN_BUTTON (get_widget (name))); + return window->gobj(); } bool GtkBuilderWindow::has_focus(const char *widget) { - return gtk_widget_is_focus (get_widget (widget)); + return get_object(widget)->is_focus(); } diff --git a/gtk/src/gtk_builder_window.h b/gtk/src/gtk_builder_window.h index 95abd06e..a5bbc3db 100644 --- a/gtk/src/gtk_builder_window.h +++ b/gtk/src/gtk_builder_window.h @@ -7,51 +7,54 @@ #ifndef __GTK_BUILDER_WINDOW_H #define __GTK_BUILDER_WINDOW_H -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" -typedef struct -{ - const char *signal; - GCallback function; -} GtkBuilderWindowCallbacks; +extern Glib::RefPtr global_builder; class GtkBuilderWindow { - public: - GtkBuilderWindow (const char *root); - ~GtkBuilderWindow (); - GtkWidget *get_widget (const char *name); - void resize (int width, int height); - GtkWindow *get_window (); - void refresh (); - int get_width (); - int get_height (); + public: + GtkBuilderWindow(const char *root); + ~GtkBuilderWindow(); - void signal_connect (GtkBuilderWindowCallbacks *callbacks); - void enable_widget (const char *name, bool state); - void set_button_label (const char *name, const char *label); - unsigned char get_check (const char *name); - int get_entry_value (const char *name); - const char *get_entry_text (const char *name); - unsigned char get_combo (const char *name); - void combo_box_append (const char *name, const char *value); - void combo_box_append (GtkComboBox *combo, const char *value); - double get_spin (const char *name); - float get_slider (const char *name); - void set_check (const char *name, bool value); - void set_entry_value (const char *name, unsigned int value); - void set_entry_text (const char *name, const char *text); - void set_combo (const char *name, unsigned char value); - void set_spin (const char *name, double value); - void set_slider (const char *name, float value); - bool has_focus (const char *widget); + template + Glib::RefPtr get_object(const char *name) + { + auto object = global_builder->get_object(name); + if (!object) + { + printf("No object named %s\n", name); + exit(1); + } + return Glib::RefPtr::cast_static(object); + } -protected: - static void signal_connection_func (GtkBuilder *, GObject *, const gchar *, const char *, GObject *, GConnectFlags, gpointer); + void resize(int width, int height); + GtkWindow *get_window(); + void refresh(); + int get_width(); + int get_height(); - GtkWidget *window; - GtkBuilder *builder; - GtkBuilderWindowCallbacks *callbacks; + void enable_widget(const char *name, bool state); + void show_widget(const char *name, bool state); + void set_button_label(const char *name, const char *label); + bool get_check(const char *name); + int get_entry_value(const char *name); + std::string get_entry_text(const char *name); + int get_combo(const char *name); + void combo_box_append(const char *name, const char *value); + void combo_box_append(Gtk::ComboBox *combo, const char *value); + double get_spin(const char *name); + float get_slider(const char *name); + void set_check(const char *name, bool value); + void set_entry_value(const char *name, unsigned int value); + void set_entry_text(const char *name, const char *text); + void set_combo(const char *name, unsigned char value); + void set_spin(const char *name, double value); + void set_slider(const char *name, float value); + bool has_focus(const char *widget); + + Glib::RefPtr window; }; #endif /* __GTK_BUILDER_WINDOW_H */ diff --git a/gtk/src/gtk_cheat.cpp b/gtk/src/gtk_cheat.cpp index d6a4c3a1..edc37a5f 100644 --- a/gtk/src/gtk_cheat.cpp +++ b/gtk/src/gtk_cheat.cpp @@ -4,13 +4,12 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_s9xcore.h" - #include "gtk_s9x.h" #include "gtk_cheat.h" +#include "cheats.h" +#include "display.h" -enum -{ +enum { COLUMN_ENABLED = 0, COLUMN_DESCRIPTION = 1, COLUMN_CHEAT = 2, @@ -19,225 +18,128 @@ enum extern SCheatData Cheat; -static void -display_errorbox (const char *error) +static void display_errorbox(const char *error) { - GtkWidget *dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", - error); - gtk_window_set_title (GTK_WINDOW (dialog), _("Error")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); + auto dialog = Gtk::MessageDialog(error, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); + dialog.set_title(_("Error")); + dialog.run(); + dialog.hide(); } -static void -event_add_code (GtkButton *button, gpointer data) +static Snes9xCheats *cheats_dialog = nullptr; +void open_snes9x_cheats_dialog() { - ((Snes9xCheats *) data)->add_code (); + if (!cheats_dialog) + cheats_dialog = new Snes9xCheats; + + cheats_dialog->show(); } -static void -event_update_code (GtkButton *button, gpointer data) +Snes9xCheats::Snes9xCheats() + : GtkBuilderWindow("cheat_window") { - ((Snes9xCheats *) data)->update_code (); -} - -static void -event_disable_all (GtkButton *button, gpointer data) -{ - ((Snes9xCheats *) data)->disable_all (); -} - -static void -event_remove_code (GtkButton *button, gpointer data) -{ - ((Snes9xCheats *) data)->remove_code (); -} - -static void -event_search_database (GtkButton *button, gpointer data) -{ - ((Snes9xCheats *) data)->search_database (); -} - -static void -event_delete_all_cheats (GtkButton *button, gpointer data) -{ - ((Snes9xCheats *) data)->delete_all_cheats (); -} - -static void -event_code_toggled (GtkCellRendererToggle *cell_renderer, - gchar *path, - gpointer data) -{ - int enabled = !gtk_cell_renderer_toggle_get_active (cell_renderer); - - ((Snes9xCheats *) data)->toggle_code (path, enabled); -} - -static void -event_row_activated (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer data) -{ - ((Snes9xCheats *) data)->row_activated (path); -} - -static void -event_row_inserted (GtkTreeModel *tree_model, - GtkTreePath *path, - GtkTreeIter *iter, - gpointer data) -{ - int *indices = gtk_tree_path_get_indices (path); - ((Snes9xCheats *) data)->row_inserted (indices[0]); -} - -static void -event_row_deleted (GtkTreeModel *tree_model, - GtkTreePath *path, - gpointer data) -{ - int *indices = gtk_tree_path_get_indices (path); - ((Snes9xCheats *) data)->row_deleted (indices[0]); -} - -void -event_enabled_column_clicked (GtkTreeViewColumn *treeviewcolumn, - gpointer data) -{ - ((Snes9xCheats *) data)->sort_cheats (); -} - -Snes9xCheats::Snes9xCheats () - : GtkBuilderWindow ("cheat_window") -{ - GtkTreeView *view; - GtkCellRenderer *renderer; - GtkBuilderWindowCallbacks callbacks[] = - { - { "add_code", G_CALLBACK (event_add_code) }, - { "update_code", G_CALLBACK (event_update_code) }, - { "remove_code", G_CALLBACK (event_remove_code) }, - { "search_database", G_CALLBACK (event_search_database) }, - { "disable_all", G_CALLBACK (event_disable_all) }, - { "delete_all_cheats", G_CALLBACK (event_delete_all_cheats) }, - { NULL, NULL} - }; - dst_row = -1; - view = GTK_TREE_VIEW (get_widget ("cheat_treeview")); + auto view = get_object("cheat_treeview"); + view->signal_row_activated().connect(sigc::mem_fun(*this, &Snes9xCheats::row_activated)); + view->set_reorderable(); - g_signal_connect (view, "row-activated", G_CALLBACK (event_row_activated), (gpointer) this); + auto toggle_renderer = new Gtk::CellRendererToggle(); + toggle_renderer->set_activatable(); + toggle_renderer->signal_toggled().connect(sigc::mem_fun(*this, &Snes9xCheats::toggle_code)); - gtk_tree_view_set_reorderable (view, true); + view->insert_column("\xe2\x86\x91", *toggle_renderer, COLUMN_ENABLED); + auto column = view->get_column(COLUMN_ENABLED); + column->set_clickable(); + column->set_alignment(0.5); + column->add_attribute(*toggle_renderer, "active", COLUMN_ENABLED); + column->signal_clicked().connect([&] { + sort_cheats(); + }); - renderer = gtk_cell_renderer_toggle_new (); - gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), true); - gtk_tree_view_insert_column_with_attributes (view, - -1, - "\xe2\x86\x91", - renderer, - "active", COLUMN_ENABLED, - NULL); - GtkTreeViewColumn *column = gtk_tree_view_get_column (view, 0); - gtk_tree_view_column_set_clickable (column, true); - gtk_tree_view_column_set_alignment (column, 0.5f); - g_signal_connect (column, "clicked", G_CALLBACK (event_enabled_column_clicked), (gpointer) this); + auto text_renderer = new Gtk::CellRendererText(); + view->insert_column(_("Description"), *text_renderer, COLUMN_DESCRIPTION); + column = view->get_column(COLUMN_DESCRIPTION); + column->set_resizable(); + column->set_min_width(40); + column->add_attribute(*text_renderer, "text", COLUMN_DESCRIPTION); - g_signal_connect (renderer, - "toggled", - G_CALLBACK (event_code_toggled), - (gpointer) this); + view->insert_column(_("Cheat"), *text_renderer, COLUMN_CHEAT); + column = view->get_column(COLUMN_CHEAT); + column->set_resizable(); + column->set_min_width(40); + column->add_attribute(*text_renderer, "text", COLUMN_CHEAT); - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (view, - -1, - _("Description"), - renderer, - "text", COLUMN_DESCRIPTION, - NULL); - column = gtk_tree_view_get_column (view, 1); - gtk_tree_view_column_set_resizable (column, true); - gtk_tree_view_column_set_min_width (column, 40); + Gtk::TreeModelColumn column1; + Gtk::TreeModelColumn column2; + Gtk::TreeModelColumn column3; + Gtk::TreeModelColumnRecord record; + record.add(column1); + record.add(column2); + record.add(column3); - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (view, - -1, - _("Cheat"), - renderer, - "text", COLUMN_CHEAT, - NULL); - column = gtk_tree_view_get_column (view, 2); - gtk_tree_view_column_set_resizable (column, true); - gtk_tree_view_column_set_min_width (column, 40); + store = Gtk::ListStore::create(record); + view->set_model(store); - store = gtk_list_store_new (NUM_COLS, - G_TYPE_BOOLEAN, - G_TYPE_STRING, - G_TYPE_STRING); + delete_id = store->signal_row_deleted().connect([&](const Gtk::TreeModel::Path &path) { + row_deleted(get_index_from_path(path)); + }); - gtk_tree_view_set_model (view, GTK_TREE_MODEL (store)); - delete_id = g_signal_connect (store, "row-deleted", G_CALLBACK (event_row_deleted), (gpointer) this); - insert_id = g_signal_connect (store, "row-inserted", G_CALLBACK (event_row_inserted), (gpointer) this); + insert_id = store->signal_row_inserted().connect([&](const Gtk::TreeModel::Path &path, const Gtk::TreeModel::iterator &iter) { + row_inserted(get_index_from_path(path)); + }); - gtk_widget_realize (window); + get_object("add_code")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::add_code)); + get_object("remove_code")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::remove_code)); + get_object("update_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::update_code)); + get_object("disable_all_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::disable_all)); + get_object("delete_all_cheats_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::delete_all_cheats)); + get_object("cheat_search_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::search_database)); + get_object("update_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xCheats::update_code)); - signal_connect (callbacks); + gtk_widget_realize(GTK_WIDGET(window->gobj())); } -Snes9xCheats::~Snes9xCheats () +Snes9xCheats::~Snes9xCheats() { - gtk_widget_destroy (window); - - g_object_unref (store); } -void -Snes9xCheats::enable_dnd (bool enable) +void Snes9xCheats::enable_dnd(bool enable) { if (enable) { - g_signal_handler_unblock (G_OBJECT (store), delete_id); - g_signal_handler_unblock (G_OBJECT (store), insert_id); + delete_id.unblock(); + insert_id.unblock(); } else { - g_signal_handler_block (G_OBJECT (store), delete_id); - g_signal_handler_block (G_OBJECT (store), insert_id); + delete_id.block(); + insert_id.unblock(); } } -void -Snes9xCheats::show () +void Snes9xCheats::show() { - top_level->pause_from_focus_change (); + top_level->pause_from_focus_change(); - gtk_window_set_transient_for (GTK_WINDOW (window), - top_level->get_window ()); + window->set_transient_for(*top_level->window.get()); - refresh_tree_view (); + refresh_tree_view(); + Glib::RefPtr::cast_static(window)->run(); + window->hide(); - gtk_dialog_run (GTK_DIALOG (window)); - - top_level->unpause_from_focus_change (); + top_level->unpause_from_focus_change(); } -static void cheat_move (int src, int dst) +static void cheat_move(int src, int dst) { - Cheat.g.insert (Cheat.g.begin() + dst, Cheat.g[src]); + Cheat.g.insert(Cheat.g.begin() + dst, Cheat.g[src]); if (dst < src) src++; - Cheat.g.erase (Cheat.g.begin() + src); + Cheat.g.erase(Cheat.g.begin() + src); } -static void cheat_gather_enabled () +static void cheat_gather_enabled() { unsigned int enabled = 0; @@ -251,311 +153,259 @@ static void cheat_gather_enabled () } } -void -Snes9xCheats::row_deleted (int src_row) +void Snes9xCheats::row_deleted(int src_row) { if (dst_row >= 0) { if (src_row >= dst_row) src_row--; - cheat_move (src_row, dst_row); + cheat_move(src_row, dst_row); dst_row = -1; } } -void -Snes9xCheats::row_inserted (int new_row) +void Snes9xCheats::row_inserted(int new_row) { dst_row = new_row; } -int -Snes9xCheats::get_selected_index () +int Snes9xCheats::get_selected_index() { - GtkTreeSelection *selection; - GList *rows; - gint *indices; - int index; - GtkTreeModel *model = GTK_TREE_MODEL (store); + auto selection = get_object("cheat_treeview")->get_selection(); + auto rows = selection->get_selected_rows(); + if (rows.empty()) + return -1; + auto indices = gtk_tree_path_get_indices(rows[0].gobj()); + return indices[0]; +} - selection = - gtk_tree_view_get_selection ( - GTK_TREE_VIEW (get_widget ("cheat_treeview"))); - - rows = gtk_tree_selection_get_selected_rows (selection, - &model); - - if (rows) - { - indices = gtk_tree_path_get_indices ((GtkTreePath *) (rows->data)); - - index = indices[0]; - - for (GList *i = rows; i; i = i->next) - gtk_tree_path_free ((GtkTreePath *)(i->data)); - - g_list_free (rows); - } - else - index = -1; +int Snes9xCheats::get_index_from_path(Gtk::TreeModel::Path path) +{ + gint *indices = gtk_tree_path_get_indices(path.gobj()); + int index = indices[0]; return index; } -int -Snes9xCheats::get_index_from_path (const gchar *path) +int Snes9xCheats::get_index_from_path(const Glib::ustring &path) { - GtkTreePath *tree_path = gtk_tree_path_new_from_string (path); - gint *indices = gtk_tree_path_get_indices (tree_path); - int index = indices[0]; - gtk_tree_path_free (tree_path); - - return index; + return get_index_from_path(Gtk::TreeModel::Path(path)); } -void -Snes9xCheats::refresh_tree_view () +void Snes9xCheats::refresh_tree_view() { - GtkTreeIter iter; - unsigned int list_size; + enable_dnd(false); - enable_dnd (false); - list_size = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL); + auto list_size = store->children().size(); - if (Cheat.g.size () == 0) + if (Cheat.g.size() == 0) return; for (unsigned int i = 0; i < Cheat.g.size() - list_size; i++) - gtk_list_store_append (store, &iter); - - gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter); + store->append(); + auto iter = store->children().begin(); for (unsigned int i = 0; i < Cheat.g.size (); i++) { - char *str = S9xCheatGroupToText (i); - - if (i > 0) - gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter); - - gtk_list_store_set (store, &iter, - COLUMN_DESCRIPTION, - !strcmp (Cheat.g [i].name, "") ? _("No description") - : Cheat.g [i].name, - COLUMN_CHEAT, str, - COLUMN_ENABLED, Cheat.g [i].enabled, - -1); + char *str = S9xCheatGroupToText(i); + Glib::ustring description = Cheat.g[i].name[0] == '\0' ? "" :Cheat.g[i].name; + iter->set_value(COLUMN_ENABLED, Cheat.g[i].enabled); + iter->set_value(COLUMN_DESCRIPTION, description); + iter->set_value(COLUMN_CHEAT, Glib::ustring(str)); + iter++; delete[] str; } - enable_dnd (true); + enable_dnd(true); } -void -Snes9xCheats::add_code () +void Snes9xCheats::add_code() { - const char *description; - const gchar *code = get_entry_text ("code_entry"); + std::string code = get_entry_text("code_entry"); + std::string description = get_entry_text("description_entry"); - description = get_entry_text ("description_entry"); - if (description[0] == '\0') + if (description.empty()) description = _("No description"); - if (S9xAddCheatGroup (description, code) < 0) + if (S9xAddCheatGroup(description.c_str(), code.c_str()) < 0) { - display_errorbox (_("Couldn't find any cheat codes in input.")); + display_errorbox(_("Couldn't find any cheat codes in input.")); return; } - code = (const gchar *) S9xCheatGroupToText (Cheat.g.size () - 1); - set_entry_text ("code_entry", code); - delete[] code; + auto parsed_code = S9xCheatGroupToText(Cheat.g.size() - 1); + set_entry_text("code_entry", parsed_code); + delete[] parsed_code; - gtk_widget_grab_focus (get_widget ("code_entry")); + get_object("code_entry")->grab_focus(); - refresh_tree_view (); + refresh_tree_view(); - while (gtk_events_pending ()) - gtk_main_iteration (); + while (Gtk::Main::events_pending()) + Gtk::Main::iteration(false); - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (get_widget ("cheat_treeview"))); - GtkTreePath *path = gtk_tree_path_new_from_indices (Cheat.g.size () - 1, -1); - gtk_tree_selection_select_path (selection, path); - gtk_tree_path_free (path); + auto selection = get_object("cheat_treeview")->get_selection(); + Gtk::TreePath path; + path.push_back(Cheat.g.size() - 1); + selection->select(path); - GtkScrolledWindow *scroll = GTK_SCROLLED_WINDOW (get_widget ("cheat_scrolledwindow")); - GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (scroll); - gtk_adjustment_set_value (adj, gtk_adjustment_get_upper (adj)); + auto adj = get_object("cheat_scrolledwindow")->get_vadjustment(); + adj->set_value(adj->get_upper()); } -void -Snes9xCheats::remove_code () +void Snes9xCheats::remove_code() { - int index = get_selected_index (); - GtkTreeIter iter; + int index = get_selected_index(); if (index < 0) return; - enable_dnd (false); - gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter, NULL, index); - gtk_list_store_remove (store, &iter); - enable_dnd (true); + enable_dnd(false); - S9xDeleteCheatGroup (index); + Gtk::TreePath path; + path.push_back(index); + + auto iter = store->get_iter(path); + store->erase(iter); + + enable_dnd(true); + + S9xDeleteCheatGroup(index); } -void -Snes9xCheats::delete_all_cheats () +void Snes9xCheats::delete_all_cheats() { - enable_dnd (false); - S9xDeleteCheats (); - gtk_list_store_clear (store); - enable_dnd (true); + enable_dnd(false); + S9xDeleteCheats(); + store->clear(); + enable_dnd(true); } -void -Snes9xCheats::search_database () +void Snes9xCheats::search_database() { std::string filename; int result; int reason = 0; - filename = S9xGetDirectory (CHEAT_DIR); + filename = S9xGetDirectory(CHEAT_DIR); filename += "/cheats.bml"; - if (!(result = S9xImportCheatsFromDatabase (filename.c_str ()))) + if (!(result = S9xImportCheatsFromDatabase(filename.c_str()))) { - refresh_tree_view (); + refresh_tree_view(); return; } if (result < reason) reason = result; - filename = get_config_dir () + "/cheats.bml"; - if (!(result = S9xImportCheatsFromDatabase (filename.c_str ()))) + filename = get_config_dir() + "/cheats.bml"; + if (!(result = S9xImportCheatsFromDatabase(filename.c_str()))) { - refresh_tree_view (); + refresh_tree_view(); return; } if (result < reason) reason = result; - filename = std::string (DATADIR) + "/cheats.bml"; - if (!(result = S9xImportCheatsFromDatabase (filename.c_str ()))) + filename = std::string(DATADIR) + "/cheats.bml"; + if (!(result = S9xImportCheatsFromDatabase(filename.c_str()))) { - refresh_tree_view (); + refresh_tree_view(); return; } if (result < reason) reason = result; - filename = S9xGetDirectory (ROM_DIR); + filename = S9xGetDirectory(ROM_DIR); filename += "/cheats.bml"; - if (!(result = S9xImportCheatsFromDatabase (filename.c_str ()))) + if (!(result = S9xImportCheatsFromDatabase(filename.c_str()))) { - refresh_tree_view (); + refresh_tree_view(); return; } if (result < reason) reason = result; - GtkMessageDialog *dialog; - GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT; - dialog = GTK_MESSAGE_DIALOG (gtk_message_dialog_new (get_window (), - flags, - GTK_MESSAGE_INFO, - GTK_BUTTONS_CLOSE, - reason == -1 ? _("Couldn't Find Cheats Database") : - _("No Matching Game Found"))); - gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG (dialog), - reason == -1 ? - _("The database file cheats.bml was not found. It is normally installed with " - "Snes9x, but you may also place a custom copy in your configuration or cheats directory.") : - _("No matching game was found in the databases. If you are using a non-official " - "translation or modified copy, you may be able to find and manually enter the codes.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (GTK_WIDGET (dialog)); + auto dialog = Gtk::MessageDialog(*window.get(), reason == -1 ? _("Couldn't Find Cheats Database") : _("No Matching Game Found"), true); + dialog.set_secondary_text(reason == -1 ? _("The database file cheats.bml was not found. It is normally installed with " + "Snes9x, but you may also place a custom copy in your configuration or cheats directory.") + : _("No matching game was found in the databases. If you are using a non-official " + "translation or modified copy, you may be able to find and manually enter the codes.")); + dialog.run(); + dialog.hide(); } -void -Snes9xCheats::sort_cheats () +void Snes9xCheats::sort_cheats() { - cheat_gather_enabled (); - refresh_tree_view (); + cheat_gather_enabled(); + refresh_tree_view(); } -void -Snes9xCheats::row_activated (GtkTreePath *path) +void Snes9xCheats::row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column) { - gint *indices = gtk_tree_path_get_indices (path); + int index = get_index_from_path(path); char *cheat_text; - cheat_text = S9xCheatGroupToText (indices[0]); - set_entry_text ("code_entry", cheat_text); + cheat_text = S9xCheatGroupToText(index); + set_entry_text("code_entry", cheat_text); delete[] cheat_text; - set_entry_text ("description_entry", Cheat.g[indices[0]].name); + set_entry_text("description_entry", Cheat.g[index].name); } -void -Snes9xCheats::toggle_code (const gchar *path, int enabled) +void Snes9xCheats::toggle_code(const Glib::ustring &path) { - GtkTreeIter iter; - int index = get_index_from_path (path); - - GtkTreePath *treepath = gtk_tree_path_new_from_string (path); - gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, treepath); - gtk_list_store_set (store, &iter, COLUMN_ENABLED, enabled, -1); + int index = get_index_from_path(path); + auto iter = store->get_iter(path); + bool enabled; + iter->get_value(COLUMN_ENABLED, enabled); + enabled = !enabled; + iter->set_value(COLUMN_ENABLED, enabled); if (enabled) - S9xEnableCheatGroup (index); + S9xEnableCheatGroup(index); else - S9xDisableCheatGroup (index); + S9xDisableCheatGroup(index); } -void -Snes9xCheats::update_code () +void Snes9xCheats::update_code() { - int index = get_selected_index (); + int index = get_selected_index(); if (index < 0) return; - const char *description; - char *code = (char *) get_entry_text ("code_entry"); - - description = get_entry_text ("description_entry"); - if (description[0] == '\0') + std::string code = get_entry_text("code_entry"); + std::string description = get_entry_text("description_entry"); + if (description.empty()) description = _("No description"); - code = S9xCheatValidate (code); - if (!code) + auto parsed_code = S9xCheatValidate(code.c_str()); + if (!parsed_code) { - display_errorbox (_("Couldn't find any cheat codes in input.")); + display_errorbox(_("Couldn't find any cheat codes in input.")); return; } - S9xModifyCheatGroup (index, description, code); - set_entry_text ("code_entry", code); - delete[] code; + S9xModifyCheatGroup(index, description.c_str(), parsed_code); + set_entry_text("code_entry", parsed_code); + delete[] parsed_code; - gtk_widget_grab_focus (get_widget ("code_entry")); + get_object("code_entry")->grab_focus(); - refresh_tree_view (); + refresh_tree_view(); } -void -Snes9xCheats::disable_all () +void Snes9xCheats::disable_all() { for (unsigned int i = 0; i < Cheat.g.size(); i++) { if (Cheat.g[i].enabled) - S9xDisableCheatGroup (i); + S9xDisableCheatGroup(i); } - refresh_tree_view (); + refresh_tree_view(); } - diff --git a/gtk/src/gtk_cheat.h b/gtk/src/gtk_cheat.h index e85d9273..161fd39f 100644 --- a/gtk/src/gtk_cheat.h +++ b/gtk/src/gtk_cheat.h @@ -9,41 +9,43 @@ #include "gtk_builder_window.h" -enum -{ - TYPE_GAME_GENIE = 0, +void open_snes9x_cheats_dialog(); + +enum { + TYPE_GAME_GENIE = 0, TYPE_ACTION_REPLAY = 1, - TYPE_GOLDFINGER = 2 + TYPE_GOLDFINGER = 2 }; class Snes9xCheats : public GtkBuilderWindow { - public: - Snes9xCheats (); - ~Snes9xCheats (); - void show (); - void add_code (); - void remove_code (); - void search_database (); - void delete_all_cheats (); - void toggle_code (const gchar *path, int enabled); - void row_activated (GtkTreePath *path); - void row_deleted (int src_row); - void row_inserted (int row); - void enable_dnd (bool); - void sort_cheats (); - void update_code (); - void disable_all (); + public: + Snes9xCheats(); + ~Snes9xCheats(); + void show(); + void add_code(); + void remove_code(); + void search_database(); + void delete_all_cheats(); + void toggle_code(const Glib::ustring &path); + void row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column); + void row_deleted(int src_row); + void row_inserted(int row); + void enable_dnd(bool); + void sort_cheats(); + void update_code(); + void disable_all(); - private: - void refresh_tree_view (); - int get_selected_index (); - int get_index_from_path (const gchar *path); + private: + void refresh_tree_view(); + int get_selected_index(); + int get_index_from_path(const Glib::ustring &path); + int get_index_from_path(Gtk::TreeModel::Path path); - unsigned long insert_id; - unsigned long delete_id; - int dst_row; - GtkListStore *store; + sigc::connection insert_id; + sigc::connection delete_id; + int dst_row; + Glib::RefPtr store; }; #endif /* __GTK_CHEAT_H */ diff --git a/gtk/src/gtk_compat.h b/gtk/src/gtk_compat.h new file mode 100644 index 00000000..f48fecf6 --- /dev/null +++ b/gtk/src/gtk_compat.h @@ -0,0 +1,29 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +#ifndef __GTK_COMPAT_H +#define __GTK_COMPAT_H + +#include + +#include +#include +#include +#include + +#ifndef USE_WAYLAND +#undef GDK_WINDOWING_WAYLAND +#endif + +#ifdef GDK_WINDOWING_WAYLAND +#include +#endif + +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#endif diff --git a/gtk/src/gtk_config.cpp b/gtk/src/gtk_config.cpp index 0995f779..c259ea52 100644 --- a/gtk/src/gtk_config.cpp +++ b/gtk/src/gtk_config.cpp @@ -14,31 +14,35 @@ #include "gtk_sound.h" #include "gtk_display.h" #include "conffile.h" +#include "cheats.h" +#include "apu/apu.h" +#include "netplay.h" +#include "controls.h" -static bool directory_exists (std::string str) +static bool directory_exists(std::string str) { DIR *dir; - dir = opendir (str.c_str ()); + dir = opendir(str.c_str()); if (dir) { - closedir (dir); + closedir(dir); return true; } return false; } -std::string get_config_dir () +std::string get_config_dir() { // Find config directory - char *env_home = getenv ("HOME"); - char *env_xdg_config_home = getenv ("XDG_CONFIG_HOME"); + char *env_home = getenv("HOME"); + char *env_xdg_config_home = getenv("XDG_CONFIG_HOME"); if (!env_home && !env_xdg_config_home) { - return std::string (".snes9x"); + return std::string{".snes9x"}; } std::string config; @@ -51,30 +55,29 @@ std::string get_config_dir () (legacy += env_home) += "/.snes9x"; } else - config = std::string (env_xdg_config_home) + "/snes9x"; + config = std::string(env_xdg_config_home) + "/snes9x"; - if (directory_exists (legacy) && !directory_exists(config)) + if (directory_exists(legacy) && !directory_exists(config)) return legacy; return config; } -std::string get_config_file_name () +std::string get_config_file_name() { - return get_config_dir () + "/snes9x.conf"; + return get_config_dir() + "/snes9x.conf"; } -void S9xParsePortConfig (ConfigFile &conf, int pass) +void S9xParsePortConfig(ConfigFile &conf, int pass) { } -Snes9xConfig::Snes9xConfig () +Snes9xConfig::Snes9xConfig() { - joystick = NULL; joystick_threshold = 40; } -int Snes9xConfig::load_defaults () +int Snes9xConfig::load_defaults() { full_screen_on_open = false; change_display_resolution = false; @@ -103,12 +106,12 @@ int Snes9xConfig::load_defaults () default_esc_behavior = 1; prevent_screensaver = false; sound_driver = 0; - sound_buffer_size = 32; - sound_playback_rate = 5; + sound_buffer_size = 48; + sound_playback_rate = 7; sound_input_rate = 31950; auto_input_rate = true; - last_directory.clear (); - last_shader_directory.clear (); + last_directory.clear(); + last_shader_directory.clear(); window_width = -1; window_height = -1; preferences_width = -1; @@ -117,11 +120,11 @@ int Snes9xConfig::load_defaults () shader_parameters_height = -1; enable_icons = true; current_display_tab = 0; - sram_directory.clear (); - export_directory.clear (); - savestate_directory.clear (); - cheat_directory.clear (); - patch_directory.clear (); + sram_directory.clear(); + export_directory.clear(); + savestate_directory.clear(); + cheat_directory.clear(); + patch_directory.clear(); screensaver_needs_reset = false; ntsc_setup = snes_ntsc_composite; ntsc_scanline_intensity = 1; @@ -134,12 +137,12 @@ int Snes9xConfig::load_defaults () netplay_send_rom = false; netplay_default_port = 6096; netplay_max_frame_loss = 10; - netplay_last_rom.clear (); - netplay_last_host.clear (); + netplay_last_rom.clear(); + netplay_last_host.clear(); netplay_last_port = 6096; modal_dialogs = true; current_save_slot = 0; - S9xCheatsEnable (); + S9xCheatsEnable(); rewind_granularity = 5; rewind_buffer_size = 0; @@ -149,9 +152,9 @@ int Snes9xConfig::load_defaults () sync_to_vblank = true; use_pbos = true; pbo_format = 0; - npot_textures = false; + npot_textures = true; use_shaders = false; - shader_filename.clear (); + shader_filename.clear(); use_glfinish = false; use_sync_control = false; #endif @@ -194,447 +197,440 @@ int Snes9xConfig::load_defaults () Settings.TwoClockCycles = 12; #endif - memset (pad, 0, sizeof (JoypadBinding) * NUM_JOYPADS); - memset (shortcut, 0, sizeof (Binding) * NUM_EMU_LINKS); + for (auto &joypad : pad) + { + joypad.data.fill(Binding()); + } + + shortcut.fill(Binding()); return 0; } -void Snes9xConfig::joystick_register_centers () +void Snes9xConfig::joystick_register_centers() { - for (int i = 0; joystick[i] != NULL; i++) - joystick[i]->register_centers (); + for (auto &j : joystick) + j.register_centers(); } -void Snes9xConfig::flush_joysticks () +void Snes9xConfig::flush_joysticks() { - int i; - - for (i = 0; joystick[i] != NULL; i++) - joystick[i]->flush (); + for (auto &j : joystick) + j.flush(); } -void Snes9xConfig::set_joystick_mode (int mode) +void Snes9xConfig::set_joystick_mode(int mode) { - int i; - for (i = 0; joystick[i] != NULL; i++) - joystick[i]->mode = mode; + for (auto &j : joystick) + j.mode = mode; } -static inline void outbool (ConfigFile &cf, const char *key, bool value, const char *comment = "") +int Snes9xConfig::save_config_file() { - cf.SetBool (key, value, "true", "false", comment); -} - -int Snes9xConfig::save_config_file () -{ - char key[PATH_MAX]; - char buffer[PATH_MAX]; ConfigFile cf; + std::string section; -#undef z -#define z "Display::" - outbool (cf, z"FullscreenOnOpen", full_screen_on_open,"Set the screen resolution after opening a ROM"); - outbool (cf, z"ChangeDisplayResolution", change_display_resolution, "Set the resolution in fullscreen mode"); - cf.SetInt (z"VideoMode", xrr_index, "Platform-specific video mode number"); - outbool (cf, z"ScaleToFit", scale_to_fit, "Scale the image to fit the window size"); - outbool (cf, z"MaintainAspectRatio", maintain_aspect_ratio, "Resize the screen to the proportions set by aspect ratio option"); - cf.SetInt (z"AspectRatio", aspect_ratio, "0: uncorrected, 1: uncorrected integer scale, 2: 4:3, 3: 4/3 integer scale, 4: NTSC/PAL, 5: NTSC/PAL integer scale"); - cf.SetInt (z"SoftwareScaleFilter", scale_method, "Build-specific number of filter used for software scaling"); - cf.SetInt (z"ScanlineFilterIntensity", scanline_filter_intensity, "0: 0%, 1: 12.5%, 2: 25%, 3: 50%, 4: 100%"); - outbool (cf, z"ShowOverscanArea", overscan); - cf.SetInt (z"HiresEffect", hires_effect, "0: Downscale to low-res, 1: Leave as-is, 2: Upscale low-res screens"); - cf.SetInt (z"ForceInvertedByteOrder", force_inverted_byte_order); - outbool (cf, z"Multithreading", multithreading, "Apply filters using multiple threads"); - cf.SetInt (z"NumberOfThreads", num_threads); - cf.SetInt (z"HardwareAcceleration", hw_accel, "0: None, 1: OpenGL, 2: XVideo"); - outbool (cf, z"BilinearFilter", Settings.BilinearFilter, "Smoothes scaled image"); - cf.SetInt (z"SplashBackground", splash_image, "0: Black, 1: Color bars, 2: Pattern, 3: Blue, 4: Default"); + auto outbool = [&](std::string name, bool b, std::string comment = "") { + cf.SetBool((section + "::" + name).c_str(), b, "true", "false", comment.c_str()); + }; -#undef z -#define z "NTSC::" - cf.SetString (z"Hue", std::to_string (ntsc_setup.hue)); - cf.SetString (z"Saturation", std::to_string (ntsc_setup.saturation)); - cf.SetString (z"Contrast", std::to_string (ntsc_setup.contrast)); - cf.SetString (z"Brightness", std::to_string (ntsc_setup.brightness)); - cf.SetString (z"Sharpness", std::to_string (ntsc_setup.sharpness)); - cf.SetString (z"Artifacts", std::to_string (ntsc_setup.artifacts)); - cf.SetString (z"Gamma", std::to_string (ntsc_setup.gamma)); - cf.SetString (z"Bleed", std::to_string (ntsc_setup.bleed)); - cf.SetString (z"Fringing", std::to_string (ntsc_setup.fringing)); - cf.SetString (z"Resolution", std::to_string (ntsc_setup.resolution)); - outbool (cf, z"MergeFields", ntsc_setup.merge_fields); - cf.SetInt (z"ScanlineIntensity", ntsc_scanline_intensity); + auto outstring = [&](std::string name, std::string str, std::string comment = "") { + cf.SetString((section + "::" + name).c_str(), str, comment.c_str()); + }; + + auto outint = [&](std::string name, int i, std::string comment = "") { + cf.SetInt((section + "::" + name).c_str(), i, comment.c_str()); + }; + + section = "Display"; + outbool("FullscreenOnOpen", full_screen_on_open, "Set the screen resolution after opening a ROM"); + outbool("ChangeDisplayResolution", change_display_resolution, "Set the resolution in fullscreen mode"); + outbool("ScaleToFit", scale_to_fit, "Scale the image to fit the window size"); + outbool("ShowOverscanArea", overscan); + outbool("MaintainAspectRatio", maintain_aspect_ratio, "Resize the screen to the proportions set by aspect ratio option"); + outbool("Multithreading", multithreading, "Apply filters using multiple threads"); + outbool("BilinearFilter", Settings.BilinearFilter, "Smoothes scaled image"); + outbool("ForceInvertedByteOrder", force_inverted_byte_order); + outint("VideoMode", xrr_index, "Platform-specific video mode number"); + outint("AspectRatio", aspect_ratio, "0: uncorrected, 1: uncorrected integer scale, 2: 4:3, 3: 4/3 integer scale, 4: NTSC/PAL, 5: NTSC/PAL integer scale"); + outint("SoftwareScaleFilter", scale_method, "Build-specific number of filter used for software scaling"); + outint("ScanlineFilterIntensity", scanline_filter_intensity, "0: 0%, 1: 12.5%, 2: 25%, 3: 50%, 4: 100%"); + outint("HiresEffect", hires_effect, "0: Downscale to low-res, 1: Leave as-is, 2: Upscale low-res screens"); + outint("NumberOfThreads", num_threads); + outint("HardwareAcceleration", hw_accel, "0: None, 1: OpenGL, 2: XVideo"); + outint("SplashBackground", splash_image, "0: Black, 1: Color bars, 2: Pattern, 3: Blue, 4: Default"); + + section = "NTSC"; + outstring("Hue", std::to_string(ntsc_setup.hue)); + outstring("Saturation", std::to_string(ntsc_setup.saturation)); + outstring("Contrast", std::to_string(ntsc_setup.contrast)); + outstring("Brightness", std::to_string(ntsc_setup.brightness)); + outstring("Sharpness", std::to_string(ntsc_setup.sharpness)); + outstring("Artifacts", std::to_string(ntsc_setup.artifacts)); + outstring("Gamma", std::to_string(ntsc_setup.gamma)); + outstring("Bleed", std::to_string(ntsc_setup.bleed)); + outstring("Fringing", std::to_string(ntsc_setup.fringing)); + outstring("Resolution", std::to_string(ntsc_setup.resolution)); + outbool("MergeFields", ntsc_setup.merge_fields); + outint("ScanlineIntensity", ntsc_scanline_intensity); #ifdef USE_OPENGL -#undef z -#define z "OpenGL::" - outbool (cf, z"VSync", sync_to_vblank); - outbool (cf, z"glFinish", use_glfinish); - outbool (cf, z"SyncControl", use_sync_control); - outbool (cf, z"UsePixelBufferObjects", use_pbos); - cf.SetInt (z"PixelBufferObjectBitDepth", pbo_format); - outbool (cf, z"UseNonPowerOfTwoTextures", npot_textures); - outbool (cf, z"EnableCustomShaders", use_shaders); - cf.SetString (z"ShaderFile", shader_filename); + section = "OpenGL"; + outbool("VSync", sync_to_vblank); + outbool("glFinish", use_glfinish); + outbool("SyncControl", use_sync_control); + outbool("UseNonPowerOfTwoTextures", npot_textures); + outbool("EnableCustomShaders", use_shaders); + outbool("UsePixelBufferObjects", use_pbos); + outint("PixelBufferObjectBitDepth", pbo_format); + outstring("ShaderFile", shader_filename); #endif -#undef z -#define z "Sound::" - outbool (cf, z"MuteSound", mute_sound); - outbool (cf, z"MuteSoundDuringTurbo", mute_sound_turbo); - cf.SetInt (z"BufferSize", sound_buffer_size, "Buffer size in milliseconds"); - cf.SetInt (z"Driver", sound_driver); - cf.SetInt (z"InputRate", sound_input_rate); - outbool (cf, z"DynamicRateControl", Settings.DynamicRateControl); - cf.SetInt (z"DynamicRateControlLimit", Settings.DynamicRateLimit); - outbool (cf, z"AutomaticInputRate", auto_input_rate, "Guess input rate by asking the monitor what its refresh rate is"); - cf.SetInt (z"PlaybackRate", gui_config->sound_playback_rate, "1: 8000Hz, 2: 11025Hz, 3: 16000Hz, 4: 22050Hz, 5: 32000Hz, 6: 44100Hz, 7: 48000Hz"); + section = "Sound"; + outbool("MuteSound", mute_sound); + outbool("MuteSoundDuringTurbo", mute_sound_turbo); + outint("BufferSize", sound_buffer_size, "Buffer size in milliseconds"); + outint("Driver", sound_driver); + outint("InputRate", sound_input_rate); + outbool("DynamicRateControl", Settings.DynamicRateControl); + outint("DynamicRateControlLimit", Settings.DynamicRateLimit); + outbool("AutomaticInputRate", auto_input_rate, "Guess input rate by asking the monitor what its refresh rate is"); + outint("PlaybackRate", gui_config->sound_playback_rate, "1: 8000Hz, 2: 11025Hz, 3: 16000Hz, 4: 22050Hz, 5: 32000Hz, 6: 44100Hz, 7: 48000Hz"); -#undef z -#define z "Files::" + section = "Files"; + outstring("LastDirectory", last_directory); + outstring("LastShaderDirectory", last_shader_directory); + outstring("SRAMDirectory", sram_directory); + outstring("SaveStateDirectory", savestate_directory); + outstring("CheatDirectory", cheat_directory); + outstring("PatchDirectory", patch_directory); + outstring("ExportDirectory", export_directory); - cf.SetString (z"LastDirectory", last_directory); - cf.SetString (z"LastShaderDirectory", last_shader_directory); - cf.SetString (z"SRAMDirectory", sram_directory); - cf.SetString (z"SaveStateDirectory", savestate_directory); - cf.SetString (z"CheatDirectory", cheat_directory); - cf.SetString (z"PatchDirectory", patch_directory); - cf.SetString (z"ExportDirectory", export_directory); - -#undef z -#define z "Window State::" - cf.SetInt (z"MainWidth", window_width); - cf.SetInt (z"MainHeight", window_height); - cf.SetInt (z"PreferencesWidth", preferences_width); - cf.SetInt (z"PreferencesHeight", preferences_height); - cf.SetInt (z"ShaderParametersWidth", shader_parameters_width); - cf.SetInt (z"ShaderParametersHeight", shader_parameters_height); - cf.SetInt (z"CurrentDisplayTab", current_display_tab); - outbool (cf, z"UIVisible", ui_visible); - outbool (cf, z"EnableIcons", enable_icons); + section = "Window State"; + outint("MainWidth", window_width); + outint("MainHeight", window_height); + outint("PreferencesWidth", preferences_width); + outint("PreferencesHeight", preferences_height); + outint("ShaderParametersWidth", shader_parameters_width); + outint("ShaderParametersHeight", shader_parameters_height); + outint("CurrentDisplayTab", current_display_tab); + outbool("UIVisible", ui_visible); + outbool("EnableIcons", enable_icons); if (default_esc_behavior != ESC_TOGGLE_MENUBAR) - outbool (cf, z"Fullscreen", 0); + outbool("Fullscreen", 0); else - outbool (cf, z"Fullscreen", fullscreen); + outbool("Fullscreen", fullscreen); -#undef z -#define z "Netplay::" - outbool (cf, z"ActAsServer", netplay_is_server); - outbool (cf, z"UseResetToSync", netplay_sync_reset); - outbool (cf, z"SendROM", netplay_send_rom); - cf.SetInt (z"DefaultPort", netplay_default_port); - cf.SetInt (z"MaxFrameLoss", netplay_max_frame_loss); - cf.SetInt (z"LastUsedPort", netplay_last_port); - cf.SetString (z"LastUsedROM", netplay_last_rom); - cf.SetString (z"LastUsedHost", netplay_last_host); + section = "Netplay"; + outbool("ActAsServer", netplay_is_server); + outbool("UseResetToSync", netplay_sync_reset); + outbool("SendROM", netplay_send_rom); + outint("DefaultPort", netplay_default_port); + outint("MaxFrameLoss", netplay_max_frame_loss); + outint("LastUsedPort", netplay_last_port); + outstring("LastUsedROM", netplay_last_rom); + outstring("LastUsedHost", netplay_last_host); -#undef z -#define z "Behavior::" - outbool (cf, z"PauseEmulationWhenFocusLost", pause_emulation_on_switch); - cf.SetInt (z"DefaultESCKeyBehavior", default_esc_behavior); - outbool (cf, z"PreventScreensaver", prevent_screensaver); - outbool (cf, z"UseModalDialogs", modal_dialogs); - cf.SetInt (z"RewindBufferSize", rewind_buffer_size, "Amount of memory (in MB) to use for rewinding"); - cf.SetInt (z"RewindGranularity", rewind_granularity, "Only save rewind snapshots every N frames"); - cf.SetInt (z"CurrentSaveSlot", current_save_slot); + section = "Behavior"; + outbool("PauseEmulationWhenFocusLost", pause_emulation_on_switch); + outint("DefaultESCKeyBehavior", default_esc_behavior); + outbool("PreventScreensaver", prevent_screensaver); + outbool("UseModalDialogs", modal_dialogs); + outint("RewindBufferSize", rewind_buffer_size, "Amount of memory (in MB) to use for rewinding"); + outint("RewindGranularity", rewind_granularity, "Only save rewind snapshots every N frames"); + outint("CurrentSaveSlot", current_save_slot); -#undef z -#define z "Emulation::" - outbool (cf, z"EmulateTransparency", Settings.Transparency); - outbool (cf, z"DisplayTime", Settings.DisplayTime); - outbool (cf, z"DisplayFrameRate", Settings.DisplayFrameRate); - outbool (cf, z"DisplayPressedKeys", Settings.DisplayPressedKeys); - cf.SetInt (z"SpeedControlMethod", Settings.SkipFrames, "0: Time the frames to 50 or 60Hz, 1: Same, but skip frames if too slow, 2: Synchronize to the sound buffer, 3: Unlimited, except potentially by vsync"); - cf.SetInt (z"SaveSRAMEveryNSeconds", Settings.AutoSaveDelay); - outbool (cf, z"BlockInvalidVRAMAccess", Settings.BlockInvalidVRAMAccessMaster); - outbool (cf, z"AllowDPadContradictions", Settings.UpAndDown, "Allow the D-Pad to press both up + down at the same time, or left + right"); + section = "Emulation"; + outbool("EmulateTransparency", Settings.Transparency); + outbool("DisplayTime", Settings.DisplayTime); + outbool("DisplayFrameRate", Settings.DisplayFrameRate); + outbool("DisplayPressedKeys", Settings.DisplayPressedKeys); + outint("SpeedControlMethod", Settings.SkipFrames, "0: Time the frames to 50 or 60Hz, 1: Same, but skip frames if too slow, 2: Synchronize to the sound buffer, 3: Unlimited, except potentially by vsync"); + outint("SaveSRAMEveryNSeconds", Settings.AutoSaveDelay); + outbool("BlockInvalidVRAMAccess", Settings.BlockInvalidVRAMAccessMaster); + outbool("AllowDPadContradictions", Settings.UpAndDown, "Allow the D-Pad to press both up + down at the same time, or left + right"); -#undef z -#define z "Hacks::" - cf.SetInt (z"SuperFXClockMultiplier", Settings.SuperFXClockMultiplier); - cf.SetInt (z"SoundInterpolationMethod", Settings.InterpolationMethod, "0: None, 1: Linear, 2: Gaussian (what the hardware uses), 3: Cubic, 4: Sinc"); - outbool (cf, z"RemoveSpriteLimit", Settings.MaxSpriteTilesPerLine == 34 ? 0 : 1); - outbool (cf, z"OverclockCPU", Settings.OneClockCycle == 6 ? 0 : 1); - outbool (cf, z"EchoBufferHack", Settings.SeparateEchoBuffer, "Prevents echo buffer from overwriting APU RAM"); + section = "Hacks"; + outint("SuperFXClockMultiplier", Settings.SuperFXClockMultiplier); + outint("SoundInterpolationMethod", Settings.InterpolationMethod, "0: None, 1: Linear, 2: Gaussian (what the hardware uses), 3: Cubic, 4: Sinc"); + outbool("RemoveSpriteLimit", Settings.MaxSpriteTilesPerLine == 34 ? 0 : 1); + outbool("OverclockCPU", Settings.OneClockCycle == 6 ? 0 : 1); + outbool("EchoBufferHack", Settings.SeparateEchoBuffer, "Prevents echo buffer from overwriting APU RAM"); -#undef z -#define z "Input::" + section = "Input"; controllers controller = CTL_NONE; int8 id[4]; for (int i = 0; i < 2; i++) { - const char *output_string; - snprintf (buffer, PATH_MAX, z"ControllerPort%d", i); - S9xGetController (i, &controller, &id[0], &id[1], &id[2], &id[3]); + std::string name; + std::string value; + + name = "ControllerPort" + std::to_string(i); + S9xGetController(i, &controller, &id[0], &id[1], &id[2], &id[3]); switch (controller) { case CTL_JOYPAD: - output_string = "joypad"; + value = "joypad"; break; case CTL_MOUSE: - output_string = "mouse"; + value = "mouse"; break; case CTL_SUPERSCOPE: - output_string = "superscope"; + value = "superscope"; break; case CTL_MP5: - output_string = "multitap"; + value = "multitap"; break; case CTL_JUSTIFIER: - output_string = "justifier"; + value = "justifier"; break; default: - output_string = "none"; + value = "none"; } - cf.SetString (buffer, output_string); + outstring(name, value); } - cf.SetInt (z"JoystickThreshold", joystick_threshold); - -#undef z + outint("JoystickThreshold", joystick_threshold); for (int i = 0; i < NUM_JOYPADS; i++) { - Binding *joypad = (Binding *) &pad[i]; + auto &joypad = pad[i]; for (int j = 0; j < NUM_JOYPAD_LINKS; j++) { - snprintf (key, PATH_MAX, "Joypad %d::%s", i, b_links[j].snes9x_name); - joypad[j].to_string (buffer, false); - cf.SetString (key, std::string (buffer)); + section = "Joypad " + std::to_string(i); + outstring(b_links[j].snes9x_name, joypad.data[j].as_string()); } } + section = "Shortcuts"; for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++) { - snprintf (key, PATH_MAX, "Shortcuts::%s", b_links[i].snes9x_name); - shortcut[i - NUM_JOYPAD_LINKS].to_string (buffer, false); - cf.SetString (key, std::string (buffer)); + outstring(b_links[i].snes9x_name, shortcut[i - NUM_JOYPAD_LINKS].as_string()); } - cf.SetNiceAlignment (true); - cf.SetShowComments (true); - cf.SaveTo (get_config_file_name ().c_str ()); + cf.SetNiceAlignment(true); + cf.SetShowComments(true); + cf.SaveTo(get_config_file_name().c_str()); return 0; } -int Snes9xConfig::load_config_file () +int Snes9xConfig::load_config_file() { struct stat file_info; - std::string path; - ConfigFile cf; - char key[PATH_MAX]; + ConfigFile cf; - load_defaults (); + load_defaults(); - path = get_config_dir (); + std::string path = get_config_dir(); - if (stat (path.c_str (), &file_info)) + if (stat(path.c_str(), &file_info)) { - if (mkdir (path.c_str (), 0755)) + if (mkdir(path.c_str(), 0755)) { - fprintf (stderr, - _("Couldn't create config directory: %s\n"), - path.c_str ()); + fprintf(stderr, + _("Couldn't create config directory: %s\n"), + path.c_str()); return -1; } } else { if (!(file_info.st_mode & 0700)) - chmod (path.c_str (), file_info.st_mode | 0700); + chmod(path.c_str(), file_info.st_mode | 0700); } - path = get_config_file_name (); + path = get_config_file_name(); - if (stat (path.c_str (), &file_info)) + if (stat(path.c_str(), &file_info)) { - save_config_file (); + save_config_file(); } - if (!cf.LoadFile (path.c_str ())) + if (!cf.LoadFile(path.c_str())) return -1; std::string none; -#define inbool(key, var) { if (cf.Exists (key)) var = cf.GetBool (key); } -#define inint(key, var) { if (cf.Exists(key)) var = cf.GetInt (key); } -#define infloat(key, var) { if (cf.Exists(key)) var = atof (cf.GetString (key, none).c_str()); } -#define instr(key, var) var = cf.GetString (key, none); + std::string section; -#undef z -#define z "Display::" - inbool (z"FullscreenOnOpen", full_screen_on_open); - inbool (z"ChangeDisplayResolution", change_display_resolution); - inint (z"VideoMode", xrr_index); - inbool (z"ScaleToFit", scale_to_fit); - inbool (z"MaintainAspectRatio", maintain_aspect_ratio); - inint (z"AspectRatio", aspect_ratio); - inint (z"SoftwareScaleFilter", scale_method); - inint (z"ScanlineFilterIntensity", scanline_filter_intensity); - inbool (z"ShowOverscanArea", overscan); - inint (z"HiresEffect", hires_effect); - inint (z"ForceInvertedByteOrder", force_inverted_byte_order); - inbool (z"Multithreading", multithreading); - inint (z"NumberOfThreads", num_threads); - inint (z"HardwareAcceleration", hw_accel); - inbool (z"BilinearFilter", Settings.BilinearFilter); - inint (z"SplashBackground", splash_image); + auto inbool = [&](std::string name, auto &b) { + if (cf.Exists((section + "::" + name).c_str())) + b = cf.GetBool((section + "::" + name).c_str()); + }; -#undef z -#define z "NTSC::" - infloat (z"Hue", ntsc_setup.hue); - infloat (z"Saturation", ntsc_setup.saturation); - infloat (z"Contrast", ntsc_setup.contrast); - infloat (z"Brightness", ntsc_setup.brightness); - infloat (z"Sharpness", ntsc_setup.sharpness); - infloat (z"Artifacts", ntsc_setup.artifacts); - infloat (z"Gamma", ntsc_setup.gamma); - infloat (z"Bleed", ntsc_setup.bleed); - infloat (z"Fringing", ntsc_setup.fringing); - infloat (z"Resolution", ntsc_setup.resolution); - inbool (z"MergeFields", ntsc_setup.merge_fields); - inint (z"ScanlineIntensity", ntsc_scanline_intensity); + auto inint = [&](std::string name, auto &i) { + if (cf.Exists((section + "::" + name).c_str())) + i = cf.GetInt((section + "::" + name).c_str()); + }; + + auto indouble = [&](std::string name, double &d) { + if (cf.Exists((section + "::" + name).c_str())) + d = atof(cf.GetString((section + "::" + name).c_str())); + }; + + auto instr = [&](std::string name, std::string &str) { + str = cf.GetString((section + "::" + name).c_str(), none); + }; + + section = "Display"; + inbool("FullscreenOnOpen", full_screen_on_open); + inbool("ChangeDisplayResolution", change_display_resolution); + inint("VideoMode", xrr_index); + inbool("ScaleToFit", scale_to_fit); + inbool("MaintainAspectRatio", maintain_aspect_ratio); + inint("AspectRatio", aspect_ratio); + inint("SoftwareScaleFilter", scale_method); + inint("ScanlineFilterIntensity", scanline_filter_intensity); + inbool("ShowOverscanArea", overscan); + inint("HiresEffect", hires_effect); + inbool("ForceInvertedByteOrder", force_inverted_byte_order); + inbool("Multithreading", multithreading); + inint("NumberOfThreads", num_threads); + inint("HardwareAcceleration", hw_accel); + inbool("BilinearFilter", Settings.BilinearFilter); + inint("SplashBackground", splash_image); + + section = "NTSC"; + indouble("Hue", ntsc_setup.hue); + indouble("Saturation", ntsc_setup.saturation); + indouble("Contrast", ntsc_setup.contrast); + indouble("Brightness", ntsc_setup.brightness); + indouble("Sharpness", ntsc_setup.sharpness); + indouble("Artifacts", ntsc_setup.artifacts); + indouble("Gamma", ntsc_setup.gamma); + indouble("Bleed", ntsc_setup.bleed); + indouble("Fringing", ntsc_setup.fringing); + indouble("Resolution", ntsc_setup.resolution); + inbool("MergeFields", ntsc_setup.merge_fields); + inint("ScanlineIntensity", ntsc_scanline_intensity); #ifdef USE_OPENGL -#undef z -#define z "OpenGL::" - inbool (z"VSync", sync_to_vblank); - inbool (z"glFinish", use_glfinish); - inbool (z"SyncControl", use_sync_control); - inbool (z"UsePixelBufferObjects", use_pbos); - inint (z"PixelBufferObjectBitDepth", pbo_format); - inbool (z"UseNonPowerOfTwoTextures", npot_textures); - inbool (z"EnableCustomShaders", use_shaders); - instr (z"ShaderFile", shader_filename); + section = "OpenGL"; + inbool("VSync", sync_to_vblank); + inbool("glFinish", use_glfinish); + inbool("SyncControl", use_sync_control); + inbool("UsePixelBufferObjects", use_pbos); + inint("PixelBufferObjectBitDepth", pbo_format); + inbool("UseNonPowerOfTwoTextures", npot_textures); + inbool("EnableCustomShaders", use_shaders); + instr("ShaderFile", shader_filename); #endif -#undef z -#define z "Sound::" - inbool (z"MuteSound", mute_sound); - inbool (z"MuteSoundDuringTurbo", mute_sound_turbo); - inint (z"BufferSize", sound_buffer_size); - inint (z"Driver", sound_driver); - inint (z"InputRate", sound_input_rate); - inbool (z"DynamicRateControl", Settings.DynamicRateControl); - inint (z"DynamicRateControlLimit", Settings.DynamicRateLimit); - inbool (z"AutomaticInputRate", auto_input_rate); - inint (z"PlaybackRate", gui_config->sound_playback_rate); + section = "Sound"; + inbool("MuteSound", mute_sound); + inbool("MuteSoundDuringTurbo", mute_sound_turbo); + inint("BufferSize", sound_buffer_size); + inint("Driver", sound_driver); + inint("InputRate", sound_input_rate); + inbool("DynamicRateControl", Settings.DynamicRateControl); + inint("DynamicRateControlLimit", Settings.DynamicRateLimit); + inbool("AutomaticInputRate", auto_input_rate); + inint("PlaybackRate", gui_config->sound_playback_rate); -#undef z -#define z "Files::" - instr (z"LastDirectory", last_directory); - instr (z"LastShaderDirectory", last_shader_directory); - instr (z"SRAMDirectory", sram_directory); - instr (z"SaveStateDirectory", savestate_directory); - instr (z"CheatDirectory", cheat_directory); - instr (z"PatchDirectory", patch_directory); - instr (z"ExportDirectory", export_directory); + section = "Files"; + instr("LastDirectory", last_directory); + instr("LastShaderDirectory", last_shader_directory); + instr("SRAMDirectory", sram_directory); + instr("SaveStateDirectory", savestate_directory); + instr("CheatDirectory", cheat_directory); + instr("PatchDirectory", patch_directory); + instr("ExportDirectory", export_directory); -#undef z -#define z "Window State::" + section = "Window State"; + inint("MainWidth", window_width); + inint("MainHeight", window_height); + inint("PreferencesWidth", preferences_width); + inint("PreferencesHeight", preferences_height); + inint("ShaderParametersWidth", shader_parameters_width); + inint("ShaderParametersHeight", shader_parameters_height); + inint("CurrentDisplayTab", current_display_tab); + inbool("UIVisible", ui_visible); + inbool("Fullscreen", fullscreen); + inbool("EnableIcons", enable_icons); - inint (z"MainWidth", window_width); - inint (z"MainHeight", window_height); - inint (z"PreferencesWidth", preferences_width); - inint (z"PreferencesHeight", preferences_height); - inint (z"ShaderParametersWidth", shader_parameters_width); - inint (z"ShaderParametersHeight", shader_parameters_height); - inint (z"CurrentDisplayTab", current_display_tab); - inbool (z"UIVisible", ui_visible); - inbool (z"Fullscreen", fullscreen); - inbool (z"EnableIcons", enable_icons); + section = "Netplay"; + inbool("ActAsServer", netplay_is_server); + inbool("UseResetToSync", netplay_sync_reset); + inbool("SendROM", netplay_send_rom); + inint("DefaultPort", netplay_default_port); + inint("MaxFrameLoss", netplay_max_frame_loss); + inint("LastUsedPort", netplay_last_port); + instr("LastUsedROM", netplay_last_rom); + instr("LastUsedHost", netplay_last_host); -#undef z -#define z "Netplay::" - inbool (z"ActAsServer", netplay_is_server); - inbool (z"UseResetToSync", netplay_sync_reset); - inbool (z"SendROM", netplay_send_rom); - inint (z"DefaultPort", netplay_default_port); - inint (z"MaxFrameLoss", netplay_max_frame_loss); - inint (z"LastUsedPort", netplay_last_port); - instr (z"LastUsedROM", netplay_last_rom); - instr (z"LastUsedHost", netplay_last_host); + section = "Behavior"; + inbool("PauseEmulationWhenFocusLost", pause_emulation_on_switch); + inint("DefaultESCKeyBehavior", default_esc_behavior); + inbool("PreventScreensaver", prevent_screensaver); + inbool("UseModalDialogs", modal_dialogs); + inint("RewindBufferSize", rewind_buffer_size); + inint("RewindGranularity", rewind_granularity); + inint("CurrentSaveSlot", current_save_slot); -#undef z -#define z "Behavior::" - inbool (z"PauseEmulationWhenFocusLost", pause_emulation_on_switch); - inint (z"DefaultESCKeyBehavior", default_esc_behavior); - inbool (z"PreventScreensaver", prevent_screensaver); - inbool (z"UseModalDialogs", modal_dialogs); - inint (z"RewindBufferSize", rewind_buffer_size); - inint (z"RewindGranularity", rewind_granularity); - inint (z"CurrentSaveSlot", current_save_slot); + section = "Emulation"; + inbool("EmulateTransparency", Settings.Transparency); + inbool("DisplayTime", Settings.DisplayTime); + inbool("DisplayFrameRate", Settings.DisplayFrameRate); + inbool("DisplayPressedKeys", Settings.DisplayPressedKeys); + inint("SpeedControlMethod", Settings.SkipFrames); + inint("SaveSRAMEveryNSeconds", Settings.AutoSaveDelay); + inbool("BlockInvalidVRAMAccess", Settings.BlockInvalidVRAMAccessMaster); + inbool("AllowDPadContradictions", Settings.UpAndDown); -#undef z -#define z "Emulation::" - inbool (z"EmulateTransparency", Settings.Transparency); - inbool (z"DisplayTime", Settings.DisplayTime); - inbool (z"DisplayFrameRate", Settings.DisplayFrameRate); - inbool (z"DisplayPressedKeys", Settings.DisplayPressedKeys); - inint (z"SpeedControlMethod", Settings.SkipFrames); - inint (z"SaveSRAMEveryNSeconds", Settings.AutoSaveDelay); - inbool (z"BlockInvalidVRAMAccess", Settings.BlockInvalidVRAMAccessMaster); - inbool (z"AllowDPadContradictions", Settings.UpAndDown); - -#undef z -#define z "Hacks::" - inint (z"SuperFXClockMultiplier", Settings.SuperFXClockMultiplier); - inint (z"SoundInterpolationMethod", Settings.InterpolationMethod); + section = "Hacks"; + inint("SuperFXClockMultiplier", Settings.SuperFXClockMultiplier); + inint("SoundInterpolationMethod", Settings.InterpolationMethod); bool RemoveSpriteLimit = false; - inbool (z"RemoveSpriteLimit", RemoveSpriteLimit); + inbool("RemoveSpriteLimit", RemoveSpriteLimit); bool OverclockCPU = false; - inbool (z"OverclockCPU", OverclockCPU); - inbool (z"EchoBufferHack", Settings.SeparateEchoBuffer); + inbool("OverclockCPU", OverclockCPU); + inbool("EchoBufferHack", Settings.SeparateEchoBuffer); -#undef z -#define z "Input::" + section = "Input"; for (int i = 0; i < 2; i++) { - snprintf (key, PATH_MAX, z"ControllerPort%d", i); - std::string tmp = cf.GetString (key, ""); + std::string name = "ControllerPort" + std::to_string(i); + std::string value; + instr(name, value); - if (tmp.find ("joypad") != std::string::npos) - S9xSetController (i, CTL_JOYPAD, i, 0, 0, 0); - else if (tmp.find ("multitap") != std::string::npos) - S9xSetController (i, CTL_MP5, i, i + 1, i + 2, i + 3); - else if (tmp.find ("superscope") != std::string::npos) - S9xSetController (i, CTL_SUPERSCOPE, 0, 0, 0, 0); - else if (tmp.find ("mouse") != std::string::npos) - S9xSetController (i, CTL_MOUSE, i, 0, 0, 0); - else if (tmp.find ("none") != std::string::npos) - S9xSetController (i, CTL_NONE, 0, 0, 0, 0); + if (value.find("joypad") != std::string::npos) + S9xSetController(i, CTL_JOYPAD, i, 0, 0, 0); + else if (value.find("multitap") != std::string::npos) + S9xSetController(i, CTL_MP5, i, i + 1, i + 2, i + 3); + else if (value.find("superscope") != std::string::npos) + S9xSetController(i, CTL_SUPERSCOPE, 0, 0, 0, 0); + else if (value.find("mouse") != std::string::npos) + S9xSetController(i, CTL_MOUSE, i, 0, 0, 0); + else if (value.find("none") != std::string::npos) + S9xSetController(i, CTL_NONE, 0, 0, 0, 0); } - inint (z"JoystickThreshold", joystick_threshold); - -#undef z + inint("JoystickThreshold", joystick_threshold); std::string buffer; - for (int i = 0; i < NUM_JOYPADS; i++) { - Binding *joypad = (Binding *) &pad[i]; + auto &joypad = pad[i]; + section = "Joypad " + std::to_string(i); for (int j = 0; j < NUM_JOYPAD_LINKS; j++) { - snprintf (key, PATH_MAX, "Joypad %d::%s", i, b_links[j].snes9x_name); - instr (key, buffer); - joypad[j] = Binding (buffer.c_str ()); + instr(b_links[j].snes9x_name, buffer); + joypad.data[j] = Binding(buffer.c_str()); } } + section = "Shortcuts"; for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++) { - snprintf (key, PATH_MAX, "Shortcuts::%s", b_links[i].snes9x_name); - instr (key, buffer); - shortcut[i - NUM_JOYPAD_LINKS] = Binding (buffer.c_str ()); + instr(b_links[i].snes9x_name, buffer); + shortcut[i - NUM_JOYPAD_LINKS] = Binding(buffer.c_str()); } /* Validation */ @@ -658,13 +654,13 @@ int Snes9xConfig::load_config_file () } #ifndef ALLOW_CPU_OVERCLOCK - Settings.OneClockCycle = 6; - Settings.OneSlowClockCycle = 8; - Settings.TwoClockCycles = 12; - Settings.MaxSpriteTilesPerLine = 34; - Settings.SeparateEchoBuffer = false; - Settings.InterpolationMethod = 2; - Settings.BlockInvalidVRAMAccessMaster = true; + Settings.OneClockCycle = 6; + Settings.OneSlowClockCycle = 8; + Settings.TwoClockCycles = 12; + Settings.MaxSpriteTilesPerLine = 34; + Settings.SeparateEchoBuffer = false; + Settings.InterpolationMethod = 2; + Settings.BlockInvalidVRAMAccessMaster = true; #endif if (default_esc_behavior != ESC_TOGGLE_MENUBAR) @@ -696,11 +692,11 @@ int Snes9xConfig::load_config_file () else Settings.SoundSync = false; - hires_effect = CLAMP (hires_effect, 0, 2); - Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000); - Settings.SuperFXClockMultiplier = CLAMP (Settings.SuperFXClockMultiplier, 50, 400); - ntsc_scanline_intensity = MIN (ntsc_scanline_intensity, 4); - scanline_filter_intensity = MIN (scanline_filter_intensity, 3); + hires_effect = CLAMP(hires_effect, 0, 2); + Settings.DynamicRateLimit = CLAMP(Settings.DynamicRateLimit, 1, 1000); + Settings.SuperFXClockMultiplier = CLAMP(Settings.SuperFXClockMultiplier, 50, 400); + ntsc_scanline_intensity = MIN(ntsc_scanline_intensity, 4); + scanline_filter_intensity = MIN(scanline_filter_intensity, 3); return 0; } @@ -714,14 +710,14 @@ void Snes9xConfig::rebind_keys() for (int joypad_i = 0; joypad_i < NUM_JOYPADS; joypad_i++) { - Binding *bin = (Binding *)&pad[joypad_i]; + auto &bin = pad[joypad_i].data; for (int button_i = 0; button_i < NUM_JOYPAD_LINKS; button_i++) { int dupe; for (dupe = button_i + 1; dupe < NUM_JOYPAD_LINKS; dupe++) { - if (bin[button_i].matches(bin[dupe]) && bin[button_i].hex() != 0) + if (bin[button_i] == bin[dupe] && bin[button_i].hex() != 0) break; } if (dupe < NUM_JOYPAD_LINKS || bin[button_i].hex() == 0) @@ -733,7 +729,7 @@ void Snes9xConfig::rebind_keys() bool ismulti = false; for (dupe = button_i - 1; dupe > 0; dupe--) { - if (bin[button_i].matches(bin[dupe])) + if (bin[button_i] == bin[dupe]) { ismulti = true; string += ",Joypad" + std::to_string((joypad_i % 5) + 1) + " "; diff --git a/gtk/src/gtk_config.h b/gtk/src/gtk_config.h index c816e4a9..ce856b43 100644 --- a/gtk/src/gtk_config.h +++ b/gtk/src/gtk_config.h @@ -7,12 +7,13 @@ #ifndef __GTK_CONFIG_H #define __GTK_CONFIG_H +#include "gtk_control.h" +#include "filter/snes_ntsc.h" + #include #include #include - -#include "gtk_control.h" -#include "filter/snes_ntsc.h" +#include enum { HWA_NONE = 0, @@ -44,20 +45,22 @@ enum { SPLASH_IMAGE_SMTPE = 1, SPLASH_IMAGE_PATTERN = 2, SPLASH_IMAGE_BLUE = 3, - SPLASH_IMAGE_COMBO = 4 + SPLASH_IMAGE_COMBO = 4, + SPLASH_IMAGE_STARFIELD = 5, + SPLASH_IMAGE_SNOW = 6 }; class Snes9xConfig { public: - Snes9xConfig (); - int load_config_file (); - int save_config_file (); - int load_defaults (); - void rebind_keys (); - void flush_joysticks (); - void set_joystick_mode (int mode); - void joystick_register_centers (); + Snes9xConfig(); + int load_config_file(); + int save_config_file(); + int load_defaults(); + void rebind_keys(); + void flush_joysticks(); + void set_joystick_mode(int mode); + void joystick_register_centers(); /* Screen options */ bool full_screen_on_open; @@ -108,8 +111,8 @@ class Snes9xConfig std::string last_shader_directory; /* Controls */ - JoypadBinding pad[NUM_JOYPADS]; - Binding shortcut[NUM_EMU_LINKS]; + std::array pad; + std::array shortcut; /* Netplay */ bool netplay_is_server; @@ -164,11 +167,11 @@ class Snes9xConfig bool use_sync_control; #endif - JoyDevice **joystick; + std::vector joystick; int joystick_threshold; }; -std::string get_config_dir (); -std::string get_config_file_name (); +std::string get_config_dir(); +std::string get_config_file_name(); #endif /* __GTK_CONFIG_H */ diff --git a/gtk/src/gtk_control.cpp b/gtk/src/gtk_control.cpp index c4442bc8..8af3ee70 100644 --- a/gtk/src/gtk_control.cpp +++ b/gtk/src/gtk_control.cpp @@ -6,12 +6,17 @@ #include -#include "gtk_s9xcore.h" +#include "SDL_joystick.h" #include "gtk_s9x.h" #include "gtk_config.h" #include "gtk_control.h" #include "gtk_file.h" +#include "snes9x.h" +#include "controls.h" +#include "display.h" +#include "gfx.h" + const BindingLink b_links[] = { /* Joypad-specific bindings. "Joypad# " will be prepended */ @@ -122,17 +127,17 @@ const int b_breaks[] = static int joystick_lock = 0; -bool S9xPollButton (uint32 id, bool *pressed) +bool S9xPollButton(uint32 id, bool *pressed) { return true; } -bool S9xPollAxis (uint32 id, int16 *value) +bool S9xPollAxis(uint32 id, int16 *value) { return true; } -bool S9xPollPointer (uint32 id, int16 *x, int16 *y) +bool S9xPollPointer(uint32 id, int16 *x, int16 *y) { *x = top_level->snes_mouse_x; *y = top_level->snes_mouse_y; @@ -140,14 +145,14 @@ bool S9xPollPointer (uint32 id, int16 *x, int16 *y) return true; } -bool S9xIsMousePluggedIn () +bool S9xIsMousePluggedIn() { enum controllers ctl; int8 id1, id2, id3, id4; for (int i = 0; i <= 1; i++) { - S9xGetController (i, &ctl, &id1, &id2, &id3, &id4); + S9xGetController(i, &ctl, &id1, &id2, &id3, &id4); if (ctl == CTL_MOUSE || ctl == CTL_SUPERSCOPE) return true; } @@ -155,7 +160,7 @@ bool S9xIsMousePluggedIn () return false; } -bool S9xGrabJoysticks () +bool S9xGrabJoysticks() { if (joystick_lock) return false; @@ -165,12 +170,12 @@ bool S9xGrabJoysticks () return true; } -void S9xReleaseJoysticks () +void S9xReleaseJoysticks() { joystick_lock--; } -static void swap_controllers_1_2 () +static void swap_controllers_1_2() { JoypadBinding interrim; @@ -178,10 +183,10 @@ static void swap_controllers_1_2 () gui_config->pad[0] = gui_config->pad[1]; gui_config->pad[1] = interrim; - gui_config->rebind_keys (); + gui_config->rebind_keys(); } -static void change_slot (int difference) +static void change_slot(int difference) { static char buf[256]; @@ -192,12 +197,12 @@ static void change_slot (int difference) if (!gui_config->rom_loaded) return; - snprintf (buf, 256, "State Slot: %d", gui_config->current_save_slot); - S9xSetInfoString (buf); + snprintf(buf, 256, "State Slot: %d", gui_config->current_save_slot); + S9xSetInfoString(buf); GFX.InfoStringTimeout = 60; } -void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) +void S9xHandlePortCommand(s9xcommand_t cmd, int16 data1, int16 data2) { static bool quit_binding_down = false; @@ -215,109 +220,93 @@ void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) { quit_binding_down = false; } - if (cmd.port[0] == PORT_COMMAND_FULLSCREEN) { - top_level->toggle_fullscreen_mode (); + top_level->toggle_fullscreen_mode(); } - else if (cmd.port[0] == PORT_COMMAND_SAVE_SPC) { - top_level->save_spc_dialog (); + top_level->save_spc_dialog(); } - else if (cmd.port[0] == PORT_OPEN_ROM) { - top_level->open_rom_dialog (); + top_level->open_rom_dialog(); } - else if (cmd.port[0] == PORT_PAUSE) { if (!(top_level->user_pause)) - top_level->pause_from_user (); + top_level->pause_from_user(); else - top_level->unpause_from_user (); + top_level->unpause_from_user(); } - else if (cmd.port[0] == PORT_REWIND) { Settings.Rewinding = false; } - else if (cmd.port[0] == PORT_SEEK_TO_FRAME) { - top_level->movie_seek_dialog (); + top_level->movie_seek_dialog(); } - else if (cmd.port[0] == PORT_SWAP_CONTROLLERS) { - swap_controllers_1_2 (); + swap_controllers_1_2(); } - else if (cmd.port[0] == PORT_QUIT) { if (quit_binding_down) - S9xExit (); + S9xExit(); } - else if (cmd.port[0] >= PORT_QUICKLOAD0 && cmd.port[0] <= PORT_QUICKLOAD9) { - S9xQuickLoadSlot (cmd.port[0] - PORT_QUICKLOAD0); + S9xQuickLoadSlot(cmd.port[0] - PORT_QUICKLOAD0); } - else if (cmd.port[0] == PORT_SAVESLOT) { - S9xQuickSaveSlot (gui_config->current_save_slot); + S9xQuickSaveSlot(gui_config->current_save_slot); } - else if (cmd.port[0] == PORT_LOADSLOT) { - S9xQuickLoadSlot (gui_config->current_save_slot); + S9xQuickLoadSlot(gui_config->current_save_slot); } - else if (cmd.port[0] == PORT_INCREMENTSAVESLOT) { - change_slot (1); - S9xQuickSaveSlot (gui_config->current_save_slot); + change_slot(1); + S9xQuickSaveSlot(gui_config->current_save_slot); } - else if (cmd.port[0] == PORT_DECREMENTLOADSLOT) { - change_slot (-1); - S9xQuickLoadSlot (gui_config->current_save_slot); + change_slot(-1); + S9xQuickLoadSlot(gui_config->current_save_slot); } - else if (cmd.port[0] == PORT_INCREMENTSLOT) { - change_slot (1); + change_slot(1); } - else if (cmd.port[0] == PORT_DECREMENTSLOT) { - change_slot (-1); + change_slot(-1); } - else if (cmd.port[0] == PORT_GRABMOUSE) { - top_level->toggle_grab_mouse (); + top_level->toggle_grab_mouse(); } } } -Binding S9xGetBindingByName (const char *name) +Binding S9xGetBindingByName(const char *name) { for (int i = 0; i < NUM_EMU_LINKS; i++) { - if (!strcasecmp (b_links[i + NUM_JOYPAD_LINKS].snes9x_name, name)) + if (!strcasecmp(b_links[i + NUM_JOYPAD_LINKS].snes9x_name, name)) { return gui_config->shortcut[i]; } } - return Binding (); + return Binding(); } -s9xcommand_t S9xGetPortCommandT (const char *name) +s9xcommand_t S9xGetPortCommandT(const char *name) { s9xcommand_t cmd; @@ -329,248 +318,214 @@ s9xcommand_t S9xGetPortCommandT (const char *name) cmd.port[2] = 0; cmd.port[3] = 0; - if (!strcasecmp (name, "GTK_fullscreen")) + if (!strcasecmp(name, "GTK_fullscreen")) { cmd.port[0] = PORT_COMMAND_FULLSCREEN; } - - else if (!strcasecmp (name, "GTK_save_spc")) + else if (!strcasecmp(name, "GTK_save_spc")) { cmd.port[0] = PORT_COMMAND_SAVE_SPC; } - - else if (!strcasecmp (name, "GTK_open_rom")) + else if (!strcasecmp(name, "GTK_open_rom")) { cmd.port[0] = PORT_OPEN_ROM; } - - else if (!strcasecmp (name, "GTK_pause")) + else if (!strcasecmp(name, "GTK_pause")) { cmd.port[0] = PORT_PAUSE; } - - else if (!strcasecmp (name, "GTK_seek_to_frame")) + else if (!strcasecmp(name, "GTK_seek_to_frame")) { cmd.port[0] = PORT_SEEK_TO_FRAME; } - - else if (!strcasecmp (name, "GTK_quit")) + else if (!strcasecmp(name, "GTK_quit")) { cmd.port[0] = PORT_QUIT; } - - else if (!strcasecmp (name, "GTK_swap_controllers")) + else if (!strcasecmp(name, "GTK_swap_controllers")) { cmd.port[0] = PORT_SWAP_CONTROLLERS; } - - else if (!strcasecmp (name, "GTK_rewind")) + else if (!strcasecmp(name, "GTK_rewind")) { cmd.port[0] = PORT_REWIND; } - - else if (strstr (name, "QuickLoad000")) + else if (strstr(name, "QuickLoad000")) { cmd.port[0] = PORT_QUICKLOAD0; } - - else if (strstr (name, "QuickLoad001")) + else if (strstr(name, "QuickLoad001")) { cmd.port[0] = PORT_QUICKLOAD1; } - - else if (strstr (name, "QuickLoad002")) + else if (strstr(name, "QuickLoad002")) { cmd.port[0] = PORT_QUICKLOAD2; } - - else if (strstr (name, "QuickLoad003")) + else if (strstr(name, "QuickLoad003")) { cmd.port[0] = PORT_QUICKLOAD3; } - - else if (strstr (name, "QuickLoad004")) + else if (strstr(name, "QuickLoad004")) { cmd.port[0] = PORT_QUICKLOAD4; } - - else if (strstr (name, "QuickLoad005")) + else if (strstr(name, "QuickLoad005")) { cmd.port[0] = PORT_QUICKLOAD5; } - - else if (strstr (name, "QuickLoad006")) + else if (strstr(name, "QuickLoad006")) { cmd.port[0] = PORT_QUICKLOAD6; } - - else if (strstr (name, "QuickLoad007")) + else if (strstr(name, "QuickLoad007")) { cmd.port[0] = PORT_QUICKLOAD7; } - - else if (strstr (name, "QuickLoad008")) + else if (strstr(name, "QuickLoad008")) { cmd.port[0] = PORT_QUICKLOAD8; } - - else if (strstr (name, "QuickLoad009")) + else if (strstr(name, "QuickLoad009")) { cmd.port[0] = PORT_QUICKLOAD9; } - - else if (strstr (name, "GTK_state_save_current")) + else if (strstr(name, "GTK_state_save_current")) { cmd.port[0] = PORT_SAVESLOT; } - - else if (strstr (name, "GTK_state_load_current")) + else if (strstr(name, "GTK_state_load_current")) { cmd.port[0] = PORT_LOADSLOT; } - - else if (strstr (name, "GTK_state_increment_save")) + else if (strstr(name, "GTK_state_increment_save")) { cmd.port[0] = PORT_INCREMENTSAVESLOT; } - - else if (strstr (name, "GTK_state_decrement_load")) + else if (strstr(name, "GTK_state_decrement_load")) { cmd.port[0] = PORT_DECREMENTLOADSLOT; } - - else if (strstr (name, "GTK_state_increment")) + else if (strstr(name, "GTK_state_increment")) { cmd.port[0] = PORT_INCREMENTSLOT; } - - else if (strstr (name, "GTK_state_decrement")) + else if (strstr(name, "GTK_state_decrement")) { cmd.port[0] = PORT_DECREMENTSLOT; } - - else if (strstr (name, "GTK_grab_mouse")) + else if (strstr(name, "GTK_grab_mouse")) { cmd.port[0] = PORT_GRABMOUSE; } - - else { - cmd = S9xGetCommandT (name); + cmd = S9xGetCommandT(name); } return cmd; } -void S9xProcessEvents (bool8 block) +void S9xProcessEvents(bool8 block) { JoyEvent event; Binding binding; - if (S9xGrabJoysticks ()) + if (S9xGrabJoysticks()) { - for (int i = 0; gui_config->joystick[i]; i++) + for (size_t i = 0; i < gui_config->joystick.size(); i++) { - while (gui_config->joystick[i]->get_event (&event)) + while (gui_config->joystick[i].get_event(&event)) { - binding = Binding (i, event.parameter, 0); - S9xReportButton (binding.hex (), event.state == JOY_PRESSED ? 1 : 0); + binding = Binding(i, event.parameter, 0); + S9xReportButton(binding.hex(), event.state == JOY_PRESSED ? 1 : 0); gui_config->screensaver_needs_reset = true; } } - S9xReleaseJoysticks (); + S9xReleaseJoysticks(); } } -static void poll_joystick_events () +static void poll_joystick_events() { SDL_Event event; - while (SDL_PollEvent (&event)) + while (SDL_PollEvent(&event)) { if (event.type == SDL_JOYAXISMOTION) { - gui_config->joystick[event.jaxis.which]->handle_event (&event); + gui_config->joystick[event.jaxis.which].handle_event(&event); } - else if (event.type == SDL_JOYHATMOTION) { - gui_config->joystick[event.jhat.which]->handle_event (&event); + gui_config->joystick[event.jhat.which].handle_event(&event); } - else if (event.type == SDL_JOYBUTTONUP || event.type == SDL_JOYBUTTONDOWN) { - gui_config->joystick[event.jbutton.which]->handle_event (&event); + gui_config->joystick[event.jbutton.which].handle_event(&event); } } } -void S9xInitInputDevices () +void S9xInitInputDevices() { - SDL_Init (SDL_INIT_JOYSTICK); + SDL_Init(SDL_INIT_JOYSTICK); + size_t num_joysticks = SDL_NumJoysticks(); + gui_config->joystick.resize(num_joysticks); - for (int i = 0; ; i++) + for (size_t i = 0; i < num_joysticks; i++) { - gui_config->joystick = (JoyDevice **) - realloc (gui_config->joystick, - sizeof (JoyDevice *) * (i + 1)); - - gui_config->joystick[i] = new JoyDevice (i); - - if (!gui_config->joystick[i]->enabled) - { - delete gui_config->joystick[i]; - gui_config->joystick[i] = NULL; - break; - } - else - { - gui_config->joystick[i]->joynum = i; - } + gui_config->joystick[i].set_sdl_joystick_num(i); } //First plug in both, they'll change later as needed - S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0); + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); } -void S9xDeinitInputDevices () +void S9xDeinitInputDevices() { - for (int i = 0; gui_config->joystick[i] != NULL; i++) - { - delete gui_config->joystick[i]; - } - - free (gui_config->joystick); - - SDL_Quit (); + gui_config->joystick.clear(); + SDL_Quit(); } -JoyDevice::JoyDevice (unsigned int device_num) +JoyDevice::JoyDevice() { enabled = false; - axis = NULL; filedes = NULL; mode = JOY_MODE_INDIVIDUAL; +} - if ((int) device_num >= SDL_NumJoysticks ()) - return; +JoyDevice::~JoyDevice() +{ + if (enabled) + { + SDL_JoystickClose(filedes); + } +} - filedes = SDL_JoystickOpen (device_num); +bool JoyDevice::set_sdl_joystick_num(unsigned int device_num) +{ + if ((int)device_num >= SDL_NumJoysticks()) + { + enabled = false; + return false; + } + + filedes = SDL_JoystickOpen(device_num); if (!filedes) - return; + return false; enabled = true; - num_axes = SDL_JoystickNumAxes (filedes); - num_hats = SDL_JoystickNumHats (filedes); - axis = new int[num_axes]; - hat = new int[num_hats]; - calibration = new Calibration[num_axes]; + int num_axes = SDL_JoystickNumAxes(filedes); + int num_hats = SDL_JoystickNumHats(filedes); + axis.resize(num_axes); + hat.resize(num_hats); + calibration.resize(num_axes); for (int i = 0; i < num_axes; i++) { @@ -579,41 +534,31 @@ JoyDevice::JoyDevice (unsigned int device_num) calibration[i].center = 0; } - printf ("Joystick %d, %s:\n %d axes, %d buttons, %d hats\n", - device_num + 1, - SDL_JoystickName (filedes), - SDL_JoystickNumButtons (filedes), - num_axes, - num_hats); + printf("Joystick %d, %s:\n %d axes, %d buttons, %d hats\n", + device_num + 1, + SDL_JoystickName(filedes), + SDL_JoystickNumButtons(filedes), + num_axes, + num_hats); - memset (axis, 0, sizeof (int) * num_axes); + for (auto &i : axis) + i = 0; + + return true; } -JoyDevice::~JoyDevice () -{ - if (enabled) - { - SDL_JoystickClose (filedes); - delete[] axis; - delete[] hat; - delete[] calibration; - } - - enabled = false; -} - -void JoyDevice::add_event (unsigned int parameter, unsigned int state) +void JoyDevice::add_event(unsigned int parameter, unsigned int state) { JoyEvent event = { parameter, state }; - queue.push (event); + queue.push(event); } -void JoyDevice::register_centers () +void JoyDevice::register_centers() { - for (int i = 0; i < num_axes; i++) + for (size_t i = 0; i < axis.size(); i++) { - calibration[i].center = SDL_JoystickGetAxis (filedes, i); + calibration[i].center = SDL_JoystickGetAxis(filedes, i); /* Snap centers to specific target points */ if (calibration[i].center < -24576) @@ -629,7 +574,7 @@ void JoyDevice::register_centers () } } -void JoyDevice::handle_event (SDL_Event *event) +void JoyDevice::handle_event(SDL_Event *event) { if (event->type == SDL_JOYAXISMOTION) { @@ -644,20 +589,20 @@ void JoyDevice::handle_event (SDL_Event *event) { for (int i = 0; i < NUM_JOYPADS; i++) { - Binding *pad = (Binding *) &(gui_config->pad[i]); + Binding *pad = (Binding *)&(gui_config->pad[i]); for (int j = 0; j < NUM_JOYPAD_LINKS; j++) { - if (pad[j].get_axis () == event->jaxis.axis && - pad[j].get_device () == (unsigned int) (joynum + 1)) + if (pad[j].get_axis() == event->jaxis.axis && + pad[j].get_device() == (unsigned int)(joynum + 1)) { - t = pad[j].get_threshold (); + t = pad[j].get_threshold(); - if (pad[j].is_positive ()) + if (pad[j].is_positive()) { ax_max = (cal_max - cal_cen) * t / 100 + cal_cen; } - else if (pad[j].is_negative ()) + else if (pad[j].is_negative()) { ax_min = (cal_min - cal_cen) * t / 100 + cal_cen; } @@ -667,16 +612,16 @@ void JoyDevice::handle_event (SDL_Event *event) for (int i = 0; i < NUM_EMU_LINKS; i++) { - if (gui_config->shortcut[i].get_axis () == event->jaxis.axis && - gui_config->shortcut[i].get_device () == - (unsigned int) (joynum + 1)) + if (gui_config->shortcut[i].get_axis() == event->jaxis.axis && + gui_config->shortcut[i].get_device() == + (unsigned int)(joynum + 1)) { - t = gui_config->shortcut[i].get_threshold (); - if (gui_config->shortcut[i].is_positive ()) + t = gui_config->shortcut[i].get_threshold(); + if (gui_config->shortcut[i].is_positive()) { ax_max = (cal_max - cal_cen) * t / 100 + cal_cen; } - else if (gui_config->shortcut[i].is_negative ()) + else if (gui_config->shortcut[i].is_negative()) { ax_min = (cal_min - cal_cen) * t / 100 + cal_cen; } @@ -698,38 +643,37 @@ void JoyDevice::handle_event (SDL_Event *event) ax_max = cal_cen + 1; if (event->jaxis.value <= ax_min && - axis[event->jaxis.axis] > ax_min) + axis[event->jaxis.axis] > ax_min) { - add_event (JOY_AXIS (event->jaxis.axis, AXIS_NEG), 1); + add_event(JOY_AXIS(event->jaxis.axis, AXIS_NEG), 1); } if (event->jaxis.value > ax_min && - axis[event->jaxis.axis] <= ax_min) + axis[event->jaxis.axis] <= ax_min) { - add_event (JOY_AXIS (event->jaxis.axis, AXIS_NEG), 0); + add_event(JOY_AXIS(event->jaxis.axis, AXIS_NEG), 0); } if (event->jaxis.value >= ax_max && - axis[event->jaxis.axis] < ax_max) + axis[event->jaxis.axis] < ax_max) { - add_event (JOY_AXIS (event->jaxis.axis, AXIS_POS), 1); + add_event(JOY_AXIS(event->jaxis.axis, AXIS_POS), 1); } if (event->jaxis.value < ax_max && - axis[event->jaxis.axis] >= ax_max) + axis[event->jaxis.axis] >= ax_max) { - add_event (JOY_AXIS (event->jaxis.axis, AXIS_POS), 0); + add_event(JOY_AXIS(event->jaxis.axis, AXIS_POS), 0); } axis[event->jaxis.axis] = event->jaxis.value; - } else if (event->type == SDL_JOYBUTTONUP || - event->type == SDL_JOYBUTTONDOWN) + event->type == SDL_JOYBUTTONDOWN) { - add_event (event->jbutton.button, - event->jbutton.state == SDL_PRESSED ? 1 : 0); + add_event(event->jbutton.button, + event->jbutton.state == SDL_PRESSED ? 1 : 0); } else if (event->type == SDL_JOYHATMOTION) @@ -737,83 +681,83 @@ void JoyDevice::handle_event (SDL_Event *event) if ((event->jhat.value & SDL_HAT_UP) && !(hat[event->jhat.hat] & SDL_HAT_UP)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2), AXIS_POS), 1); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2), AXIS_POS), 1); } if (!(event->jhat.value & SDL_HAT_UP) && (hat[event->jhat.hat] & SDL_HAT_UP)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2), AXIS_POS), 0); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2), AXIS_POS), 0); } if ((event->jhat.value & SDL_HAT_DOWN) && !(hat[event->jhat.hat] & SDL_HAT_DOWN)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2), AXIS_NEG), 1); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2), AXIS_NEG), 1); } if (!(event->jhat.value & SDL_HAT_DOWN) && (hat[event->jhat.hat] & SDL_HAT_DOWN)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2), AXIS_NEG), 0); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2), AXIS_NEG), 0); } if ((event->jhat.value & SDL_HAT_LEFT) && !(hat[event->jhat.hat] & SDL_HAT_LEFT)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2) + 1, AXIS_NEG), 1); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2) + 1, AXIS_NEG), 1); } if (!(event->jhat.value & SDL_HAT_LEFT) && (hat[event->jhat.hat] & SDL_HAT_LEFT)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2) + 1, AXIS_NEG), 0); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2) + 1, AXIS_NEG), 0); } if ((event->jhat.value & SDL_HAT_RIGHT) && !(hat[event->jhat.hat] & SDL_HAT_RIGHT)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2) + 1, AXIS_POS), 1); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2) + 1, AXIS_POS), 1); } if (!(event->jhat.value & SDL_HAT_RIGHT) && (hat[event->jhat.hat] & SDL_HAT_RIGHT)) { - add_event (JOY_AXIS (num_axes + (event->jhat.hat * 2) + 1, AXIS_POS), 0); + add_event(JOY_AXIS(axis.size() + (event->jhat.hat * 2) + 1, AXIS_POS), 0); } hat[event->jhat.hat] = event->jhat.value; } } -int JoyDevice::get_event (JoyEvent *event) +int JoyDevice::get_event(JoyEvent *event) { - poll_events (); + poll_events(); - if (queue.empty ()) + if (queue.empty()) return 0; - event->parameter = queue.front ().parameter; - event->state = queue.front ().state; + event->parameter = queue.front().parameter; + event->state = queue.front().state; - queue.pop (); + queue.pop(); return 1; } -void JoyDevice::poll_events () +void JoyDevice::poll_events() { - poll_joystick_events (); + poll_joystick_events(); } -void JoyDevice::flush () +void JoyDevice::flush() { SDL_Event event; - while (SDL_PollEvent (&event)) + while (SDL_PollEvent(&event)) { } - while (!queue.empty ()) - queue.pop (); + while (!queue.empty()) + queue.pop(); } diff --git a/gtk/src/gtk_control.h b/gtk/src/gtk_control.h index 95ef733b..ba7c306b 100644 --- a/gtk/src/gtk_control.h +++ b/gtk/src/gtk_control.h @@ -8,6 +8,7 @@ #define __GTK_CONTROL_H #include +#include #include "gtk_binding.h" #include "SDL.h" @@ -17,21 +18,18 @@ const int NUM_JOYPADS = 10; -enum -{ +enum { JOY_MODE_GLOBAL = 0, JOY_MODE_INDIVIDUAL = 1, JOY_MODE_CALIBRATE = 2 }; -enum -{ +enum { JOY_RELEASED = 0, JOY_PRESSED = 1 }; -enum -{ +enum { PORT_COMMAND_FULLSCREEN = 1, PORT_COMMAND_SAVE_SPC = 2, PORT_OPEN_ROM = 3, @@ -69,15 +67,15 @@ typedef struct BindingLink extern const BindingLink b_links[]; extern const int b_breaks[]; const int NUM_JOYPAD_LINKS = 24; -const int NUM_EMU_LINKS = 62; +const int NUM_EMU_LINKS = 62; typedef struct JoypadBinding { - Binding data[NUM_JOYPAD_LINKS]; /* Avoid packing issues */ + std::array data; } JoypadBinding; -bool S9xGrabJoysticks (); -void S9xReleaseJoysticks (); +bool S9xGrabJoysticks(); +void S9xReleaseJoysticks(); typedef struct JoyEvent { @@ -96,31 +94,30 @@ typedef struct Calibration class JoyDevice { public: - JoyDevice (unsigned int device_num); - ~JoyDevice (); - int get_event (JoyEvent *event); - void flush (); - void handle_event (SDL_Event *event); - void register_centers (); + JoyDevice(); + ~JoyDevice(); + int get_event(JoyEvent *event); + void flush(); + void handle_event(SDL_Event *event); + void register_centers(); + bool set_sdl_joystick_num(unsigned int device_num); - SDL_Joystick *filedes; - Calibration *calibration; + SDL_Joystick *filedes; std::queue queue; - int mode; - int joynum; - int num_axes; - int num_hats; - int *axis; - int *hat; - bool enabled; + int mode; + int joynum; + std::vector calibration; + std::vector axis; + std::vector hat; + bool enabled; private: - void poll_events (); - void add_event (unsigned int parameter, unsigned int state); + void poll_events(); + void add_event(unsigned int parameter, unsigned int state); }; -void S9xDeinitInputDevices (); -Binding S9xGetBindingByName (const char *name); -bool S9xIsMousePluggedIn (); +void S9xDeinitInputDevices(); +Binding S9xGetBindingByName(const char *name); +bool S9xIsMousePluggedIn(); #endif /* __GTK_CONTROL_H*/ diff --git a/gtk/src/gtk_display.cpp b/gtk/src/gtk_display.cpp index 5d1b9dcc..b25cf0d5 100644 --- a/gtk/src/gtk_display.cpp +++ b/gtk/src/gtk_display.cpp @@ -4,7 +4,7 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include #include "gtk_s9x.h" @@ -12,6 +12,13 @@ #include "gtk_display_driver.h" #include "gtk_display_driver_gtk.h" +#include "snes9x.h" +#include "memmap.h" +#include "cpuexec.h" +#include "ppu.h" +#include "gfx.h" +#include "netplay.h" + #if defined(USE_XV) && defined(GDK_WINDOWING_X11) #include "gtk_display_driver_xv.h" #endif @@ -20,48 +27,46 @@ #include "gtk_display_driver_opengl.h" #endif -static S9xDisplayDriver *driver; -static snes_ntsc_t snes_ntsc; -static int burst_phase = 0; -static thread_job_t job[8]; -static GThreadPool *pool; -static uint8 *y_table, *u_table, *v_table; -static int endianess = ENDIAN_NORMAL; +static S9xDisplayDriver *driver; +static snes_ntsc_t snes_ntsc; +static int burst_phase = 0; +static thread_job_t job[8]; +static GThreadPool *pool; +static uint8 *y_table, *u_table, *v_table; +static int endianess = ENDIAN_NORMAL; +static std::vector scaled_image; /* Scanline constants for the NTSC filter */ -static const unsigned int scanline_offsets[] = -{ - 0, /* 0% */ - 3, /* 12.5% */ - 2, /* 25% */ - 1, /* 50% */ - 0, /* 100% */ +static const unsigned int scanline_offsets[] = { + 0, /* 0% */ + 3, /* 12.5% */ + 2, /* 25% */ + 1, /* 50% */ + 0, /* 100% */ }; -static const unsigned short scanline_masks[] = -{ - 0x0000, /* 0% */ - 0x18E3, /* 12.5% */ - 0x39E7, /* 25% */ - 0x7BEF, /* 50% */ - 0xffff, /* 100% */ +static const unsigned short scanline_masks[] = { + 0x0000, /* 0% */ + 0x18E3, /* 12.5% */ + 0x39E7, /* 25% */ + 0x7BEF, /* 50% */ + 0xffff, /* 100% */ }; /* Scanline constants for standard scanline filter */ -static const uint8 scanline_shifts[] = -{ - 3, - 2, - 1, - 0 +static const uint8 scanline_shifts[] = { + 3, + 2, + 1, + 0 }; -void S9xSetEndianess (int type) +void S9xSetEndianess(int type) { endianess = type; } -double S9xGetAspect () +double S9xGetAspect() { double native_aspect = 256.0 / (gui_config->overscan ? 239.0 : 224.0); double aspect; @@ -85,14 +90,14 @@ double S9xGetAspect () return aspect; } -S9xRect S9xApplyAspect (int src_width, - int src_height, - int dst_width, - int dst_height) +S9xRect S9xApplyAspect(int src_width, + int src_height, + int dst_width, + int dst_height) { double screen_aspect = (double)dst_width / (double)dst_height; - double snes_aspect = S9xGetAspect (); - bool integer = gui_config->aspect_ratio & 1; + double snes_aspect = S9xGetAspect(); + bool integer = gui_config->aspect_ratio & 1; double granularity = 1.0 / (double)MAX(dst_width, dst_height); int x, y, w, h; @@ -111,15 +116,16 @@ S9xRect S9xApplyAspect (int src_width, h = src_height; x = (dst_width - w) / 2; y = (dst_height - h) / 2; - } } else if (gui_config->maintain_aspect_ratio && integer) { - for (h = src_height * 2; h <= dst_height && (int)(h * (snes_aspect) + 0.5) <= dst_width; h += src_height) {} + for (h = src_height * 2; h <= dst_height && (int)(h * (snes_aspect) + 0.5) <= dst_width; h += src_height) + { + } h -= src_height; w = h * snes_aspect + 0.5; - x = (dst_width - w) / 2; + x = (dst_width - w) / 2; y = (dst_height - h) / 2; if (w > dst_width || h > dst_height) @@ -131,8 +137,8 @@ S9xRect S9xApplyAspect (int src_width, } } else if (gui_config->maintain_aspect_ratio && - !(screen_aspect <= snes_aspect * (1.0 + granularity) && - screen_aspect >= snes_aspect * (1.0 - granularity))) + !(screen_aspect <= snes_aspect * (1.0 + granularity) && + screen_aspect >= snes_aspect * (1.0 - granularity))) { if (screen_aspect > snes_aspect) { @@ -147,7 +153,6 @@ S9xRect S9xApplyAspect (int src_width, h = dst_width / snes_aspect + 0.5; x = 0; y = (dst_height - h) / 2; - } } @@ -162,7 +167,7 @@ S9xRect S9xApplyAspect (int src_width, return { x, y, w, h }; } -void S9xRegisterYUVTables (uint8 *y, uint8 *u, uint8 *v) +void S9xRegisterYUVTables(uint8 *y, uint8 *u, uint8 *v) { y_table = y; u_table = u; @@ -170,26 +175,26 @@ void S9xRegisterYUVTables (uint8 *y, uint8 *u, uint8 *v) } /* YUY2 in LSB first format */ -static void internal_convert_16_yuv (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height) +static void internal_convert_16_yuv(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height) { - int x, y; + int x, y; uint16 *src; - uint8 *dst; + uint8 *dst; uint16 p0, p1; if (endianess == ENDIAN_SWAPPED) { for (y = 0; y < height; y++) { - src = (uint16 *) (((uint8 *) src_buffer) + src_pitch * y); - dst = (uint8 *) (((uint8 *) dst_buffer) + dst_pitch * y); + src = (uint16 *)(((uint8 *)src_buffer) + src_pitch * y); + dst = (uint8 *)(((uint8 *)dst_buffer) + dst_pitch * y); - for (x = 0; x < width >> 1; x++) + for (x = 0; x < width / 2; x++) { p0 = *src++; p1 = *src++; @@ -205,10 +210,10 @@ static void internal_convert_16_yuv (void *src_buffer, { for (y = 0; y < height; y++) { - src = (uint16 *) (((uint8 *) src_buffer) + src_pitch * y); - dst = (uint8 *) (((uint8 *) dst_buffer) + dst_pitch * y); + src = (uint16 *)(((uint8 *)src_buffer) + src_pitch * y); + dst = (uint8 *)(((uint8 *)dst_buffer) + dst_pitch * y); - for (x = 0; x < width >> 1; x++) + for (x = 0; x < width / 2; x++) { p0 = *src++; p1 = *src++; @@ -222,16 +227,16 @@ static void internal_convert_16_yuv (void *src_buffer, } } -static void internal_convert_mask (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height, - unsigned int inv_rshift, - unsigned int inv_gshift, - unsigned int inv_bshift, - unsigned int bpp) +static void internal_convert_mask(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height, + unsigned int inv_rshift, + unsigned int inv_gshift, + unsigned int inv_bshift, + unsigned int bpp) { #ifdef __BIG_ENDIAN__ if (endianess == ENDIAN_SWAPPED) @@ -245,16 +250,14 @@ static void internal_convert_mask (void *src_buffer, case 16: for (int y = 0; y < height; y++) { - uint16 *data = (uint16 *) ((uint8 *) dst_buffer + y * dst_pitch); - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *data = (uint16 *)((uint8 *)dst_buffer + y * dst_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint32 pixel = *snes++; - *data++ = ((pixel & 0xf800) << 0) >> inv_rshift - | ((pixel & 0x07e0) << 5) >> inv_gshift - | ((pixel & 0x001f) << 11) >> inv_bshift; + *data++ = ((pixel & 0xf800) << 0) >> inv_rshift | ((pixel & 0x07e0) << 5) >> inv_gshift | ((pixel & 0x001f) << 11) >> inv_bshift; } } break; @@ -268,8 +271,8 @@ static void internal_convert_mask (void *src_buffer, { for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { @@ -284,9 +287,9 @@ static void internal_convert_mask (void *src_buffer, { for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { @@ -302,16 +305,14 @@ static void internal_convert_mask (void *src_buffer, case 32: for (int y = 0; y < height; y++) { - uint32 *data = (uint32 *) ((uint8 *) dst_buffer + y * dst_pitch); - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint32 *data = (uint32 *)((uint8 *)dst_buffer + y * dst_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint32 pixel = *snes++; - *data++ = ((uint32) (pixel & 0xf800) << 16) >> inv_rshift - | ((uint32) (pixel & 0x07e0) << 21) >> inv_gshift - | ((uint32) (pixel & 0x001f) << 27) >> inv_bshift; + *data++ = ((uint32)(pixel & 0xf800) << 16) >> inv_rshift | ((uint32)(pixel & 0x07e0) << 21) >> inv_gshift | ((uint32)(pixel & 0x001f) << 27) >> inv_bshift; } } break; @@ -326,20 +327,17 @@ static void internal_convert_mask (void *src_buffer, case 16: for (int y = 0; y < height; y++) { - uint16 *data = (uint16 *) ((uint8 *) dst_buffer + y * dst_pitch); - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *data = (uint16 *)((uint8 *)dst_buffer + y * dst_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint32 pixel = *snes++; uint16 value; - value = ((pixel & 0xf800) << 0) >> inv_rshift - | ((pixel & 0x07e0) << 5) >> inv_gshift - | ((pixel & 0x001f) << 11) >> inv_bshift; + value = ((pixel & 0xf800) << 0) >> inv_rshift | ((pixel & 0x07e0) << 5) >> inv_gshift | ((pixel & 0x001f) << 11) >> inv_bshift; - *data++ = ((value & 0xff) << 8) - | ((value & 0xff00) >> 8); + *data++ = ((value & 0xff) << 8) | ((value & 0xff00) >> 8); } } break; @@ -353,8 +351,8 @@ static void internal_convert_mask (void *src_buffer, { for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { @@ -369,8 +367,8 @@ static void internal_convert_mask (void *src_buffer, { for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { @@ -386,22 +384,17 @@ static void internal_convert_mask (void *src_buffer, case 32: for (int y = 0; y < height; y++) { - uint32 *data = (uint32 *) ((uint8 *) dst_buffer + y * dst_pitch); - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint32 *data = (uint32 *)((uint8 *)dst_buffer + y * dst_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint32 pixel = *snes++; uint32 value; - value = ((uint32) (pixel & 0xf800) << 16) >> inv_rshift - | ((uint32) (pixel & 0x07e0) << 21) >> inv_gshift - | ((uint32) (pixel & 0x001f) << 27) >> inv_bshift; + value = ((uint32)(pixel & 0xf800) << 16) >> inv_rshift | ((uint32)(pixel & 0x07e0) << 21) >> inv_gshift | ((uint32)(pixel & 0x001f) << 27) >> inv_bshift; - *data++ = ((value & 0x000000ff) << 24) - | ((value & 0x0000ff00) << 8) - | ((value & 0x00ff0000) >> 8) - | ((value & 0xff000000) >> 24); + *data++ = ((value & 0x000000ff) << 24) | ((value & 0x0000ff00) << 8) | ((value & 0x00ff0000) >> 8) | ((value & 0xff000000) >> 24); } } break; @@ -409,13 +402,13 @@ static void internal_convert_mask (void *src_buffer, } } -static void internal_convert (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height, - int bpp) +static void internal_convert(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height, + int bpp) { if (endianess == ENDIAN_SWAPPED) { @@ -423,16 +416,16 @@ static void internal_convert (void *src_buffer, { for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint16 pixel = *snes++; *data++ = ((pixel & 0xf800) >> 8) | ((pixel >> 13) & 0x07); /* Red */ - *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ - *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ + *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ + *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ } } } @@ -442,17 +435,17 @@ static void internal_convert (void *src_buffer, /* Format in fourcc is xxxxxxxx rrrrrrrr gggggggg bbbbbbbb */ for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint16 pixel = *snes++; - *data++ = 0xff; /* Null */ + *data++ = 0xff; /* Null */ *data++ = ((pixel & 0xf800) >> 8) | ((pixel >> 13) & 0x07); /* Red */ - *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ - *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ + *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ + *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ } } } @@ -466,16 +459,16 @@ static void internal_convert (void *src_buffer, /* Format in fourcc is xxxxxxxx rrrrrrrr gggggggg bbbbbbbb */ for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint16 pixel = *snes++; - *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ - *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ + *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ + *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ *data++ = ((pixel & 0xf800) >> 8) | ((pixel >> 13) & 0x07); /* Red */ } } @@ -486,30 +479,30 @@ static void internal_convert (void *src_buffer, /* Format in fourcc is xxxxxxxx rrrrrrrr gggggggg bbbbbbbb */ for (int y = 0; y < height; y++) { - uint8 *data = (uint8 *) dst_buffer + y * dst_pitch; + uint8 *data = (uint8 *)dst_buffer + y * dst_pitch; - uint16 *snes = (uint16 *) (((uint8 *) src_buffer) + y * src_pitch); + uint16 *snes = (uint16 *)(((uint8 *)src_buffer) + y * src_pitch); for (int x = 0; x < width; x++) { uint16 pixel = *snes++; - *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ - *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ + *data++ = ((pixel & 0x001f) << 3) | ((pixel >> 2) & 0x07); /* Blue */ + *data++ = ((pixel & 0x07e0) >> 3) | ((pixel >> 9) & 0x03); /* Green */ *data++ = ((pixel & 0xf800) >> 8) | ((pixel >> 13) & 0x07); /* Red */ - *data++ = 0xff; /* Null */ + *data++ = 0xff; /* Null */ } } } } } -static void S9xForceHires (void *buffer, - int pitch, - int &width, - int &height) +static void S9xForceHires(void *buffer, + int pitch, + int &width, + int &height) { - int double_width = 0, + int double_width = 0, double_height = 0; if (width <= 256) @@ -522,8 +515,8 @@ static void S9xForceHires (void *buffer, { for (int y = (height * 2) - 1; y >= 0; y--) { - uint16 *src_line = (uint16 *) ((uint8 *) buffer + (y >> 1) * pitch); - uint16 *dst_line = (uint16 *) ((uint8 *) buffer + y * pitch); + uint16 *src_line = (uint16 *)((uint8 *)buffer + (y >> 1) * pitch); + uint16 *dst_line = (uint16 *)((uint8 *)buffer + y * pitch); for (int x = (width * 2) - 1; x >= 0; x--) { @@ -531,13 +524,14 @@ static void S9xForceHires (void *buffer, } } - width *= 2; height *= 2; + width *= 2; + height *= 2; } else if (double_width && !double_height) { - for (int y = (height) - 1; y >= 0; y--) + for (int y = (height)-1; y >= 0; y--) { - uint16 *line = (uint16 *) ((uint8 *) buffer + y * pitch); + uint16 *line = (uint16 *)((uint8 *)buffer + y * pitch); for (int x = (width * 2) - 1; x >= 0; x--) { @@ -551,10 +545,10 @@ static void S9xForceHires (void *buffer, { for (int y = (height * 2) - 1; y >= 0; y--) { - uint16 *src_line = (uint16 *) ((uint8 *) buffer + (y >> 1) * pitch); - uint16 *dst_line = (uint16 *) ((uint8 *) buffer + y * pitch); + uint16 *src_line = (uint16 *)((uint8 *)buffer + (y >> 1) * pitch); + uint16 *dst_line = (uint16 *)((uint8 *)buffer + y * pitch); - memcpy (dst_line, src_line, width * 2); + memcpy(dst_line, src_line, width * 2); } height *= 2; @@ -566,10 +560,10 @@ static inline uint16 average_565(uint16 colora, uint16 colorb) return (((colora) & (colorb)) + ((((colora) ^ (colorb)) & 0xF7DE) >> 1)); } -static void S9xMergeHires (void *buffer, - int pitch, - int &width, - int &height) +static void S9xMergeHires(void *buffer, + int pitch, + int &width, + int &height) { if (width < 512) { @@ -578,12 +572,12 @@ static void S9xMergeHires (void *buffer, for (int y = 0; y < height; y++) { - uint16 *input = (uint16 *) ((uint8 *) buffer + y * pitch); + uint16 *input = (uint16 *)((uint8 *)buffer + y * pitch); uint16 *output = input; for (int x = 0; x < (width >> 1); x++) { - *output++ = average_565 (input[0], input[1]); + *output++ = average_565(input[0], input[1]); input += 2; } } @@ -591,19 +585,19 @@ static void S9xMergeHires (void *buffer, width >>= 1; } -void filter_2x (void *src, - int src_pitch, - void *dst, - int dst_pitch, - int width, - int height) +void filter_2x(void *src, + int src_pitch, + void *dst, + int dst_pitch, + int width, + int height) { int x, y; for (y = 0; y < height; y++) { - uint16 *in = (uint16 *) ((uint8 *) src + y * src_pitch); - uint16 *out = (uint16 *) ((uint8 *) dst + (y * 2) * dst_pitch); + uint16 *in = (uint16 *)((uint8 *)src + y * src_pitch); + uint16 *out = (uint16 *)((uint8 *)dst + (y * 2) * dst_pitch); for (x = 0; x < width; x++) { @@ -613,25 +607,25 @@ void filter_2x (void *src, *out++ = pixel; } - memcpy ((uint8 *) dst + (y * 2 + 1) * dst_pitch, - (uint8 *) dst + (y * 2) * dst_pitch, - width * 2 * 2); + memcpy((uint8 *)dst + (y * 2 + 1) * dst_pitch, + (uint8 *)dst + (y * 2) * dst_pitch, + width * 2 * 2); } } -void filter_3x (void *src, - int src_pitch, - void *dst, - int dst_pitch, - int width, - int height) +void filter_3x(void *src, + int src_pitch, + void *dst, + int dst_pitch, + int width, + int height) { int x, y, z; for (y = 0; y < height; y++) { - uint16 *in = (uint16 *) ((uint8 *) src + y * src_pitch); - uint16 *out = (uint16 *) ((uint8 *) dst + (y * 3) * dst_pitch); + uint16 *in = (uint16 *)((uint8 *)src + y * src_pitch); + uint16 *out = (uint16 *)((uint8 *)dst + (y * 3) * dst_pitch); for (x = 0; x < width; x++) { @@ -644,26 +638,26 @@ void filter_3x (void *src, for (z = 1; z <= 2; z++) { - memcpy ((uint8 *) dst + ((y * 3) + z) * dst_pitch, - (uint8 *) dst + ((y * 3)) * dst_pitch, - width * 2 * 3); + memcpy((uint8 *)dst + ((y * 3) + z) * dst_pitch, + (uint8 *)dst + ((y * 3)) * dst_pitch, + width * 2 * 3); } } } -void filter_4x (void *src, - int src_pitch, - void *dst, - int dst_pitch, - int width, - int height) +void filter_4x(void *src, + int src_pitch, + void *dst, + int dst_pitch, + int width, + int height) { int x, y, z; for (y = 0; y < height; y++) { - uint16 *in = (uint16 *) ((uint8 *) src + y * src_pitch); - uint16 *out = (uint16 *) ((uint8 *) dst + (y * 4) * dst_pitch); + uint16 *in = (uint16 *)((uint8 *)src + y * src_pitch); + uint16 *out = (uint16 *)((uint8 *)dst + (y * 4) * dst_pitch); for (x = 0; x < width; x++) { @@ -677,19 +671,19 @@ void filter_4x (void *src, for (z = 1; z <= 3; z++) { - memcpy ((uint8 *) dst + ((y * 4) + z) * dst_pitch, - (uint8 *) dst + (y * 4) * dst_pitch, - width * 2 * 4); + memcpy((uint8 *)dst + ((y * 4) + z) * dst_pitch, + (uint8 *)dst + (y * 4) * dst_pitch, + width * 2 * 4); } } } -void filter_scanlines (void *src_buffer, - int src_pitch, - void *dst_buffer, - int dst_pitch, - int width, - int height) +void filter_scanlines(void *src_buffer, + int src_pitch, + void *dst_buffer, + int dst_pitch, + int width, + int height) { int x, y; uint16 *src, *dst_a, *dst_b; @@ -697,9 +691,9 @@ void filter_scanlines (void *src_buffer, uint8 shift = scanline_shifts[gui_config->scanline_filter_intensity]; uint16 mask = scanline_masks[gui_config->scanline_filter_intensity + 1]; - src = (uint16 *) src_buffer; - dst_a = (uint16 *) dst_buffer; - dst_b = ((uint16 *) dst_buffer) + (dst_pitch >> 1); + src = (uint16 *)src_buffer; + dst_a = (uint16 *)dst_buffer; + dst_b = ((uint16 *)dst_buffer) + (dst_pitch >> 1); for (y = 0; y < height; y++) { @@ -715,7 +709,7 @@ void filter_scanlines (void *src_buffer, } } -void get_filter_scale (int &width, int &height) +void get_filter_scale(int &width, int &height) { switch (gui_config->scale_method) { @@ -736,23 +730,13 @@ void get_filter_scale (int &width, int &height) #ifdef USE_HQ2X case FILTER_HQ4X: - if (((width * 4) <= S9xDisplayDriver::scaled_max_width) && - ((height * 4) <= S9xDisplayDriver::scaled_max_height)) - { - width *= 4; - height *= 4; - break; - } - // Fall through + width *= 4; + height *= 4; + break; case FILTER_HQ3X: - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - width *= 3; - height *= 3; - break; - } - // Fall through + width *= 3; + height *= 3; + break; case FILTER_HQ2X: width *= 2; height *= 2; @@ -761,23 +745,13 @@ void get_filter_scale (int &width, int &height) #ifdef USE_XBRZ case FILTER_4XBRZ: - if (((width * 4) <= S9xDisplayDriver::scaled_max_width) && - ((height * 4) <= S9xDisplayDriver::scaled_max_height)) - { - width *= 4; - height *= 4; - break; - } - // Fall through + width *= 4; + height *= 4; + break; case FILTER_3XBRZ: - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - width *= 3; - height *= 3; - break; - } - // Fall through + width *= 3; + height *= 3; + break; case FILTER_2XBRZ: width *= 2; height *= 2; @@ -785,23 +759,13 @@ void get_filter_scale (int &width, int &height) #endif /* USE_XBRZ */ case FILTER_SIMPLE4X: - if (((width * 4) <= S9xDisplayDriver::scaled_max_width) && - ((height * 4) <= S9xDisplayDriver::scaled_max_height)) - { - width *= 4; - height *= 4; - break; - } - // Fall through + width *= 4; + height *= 4; + break; case FILTER_SIMPLE3X: - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - width *= 3; - height *= 3; - break; - } - // Fall through + width *= 3; + height *= 3; + break; case FILTER_SIMPLE2X: width *= 2; height *= 2; @@ -814,9 +778,9 @@ void get_filter_scale (int &width, int &height) case FILTER_NTSC: if (width > 256) - width = SNES_NTSC_OUT_WIDTH (width / 2); + width = SNES_NTSC_OUT_WIDTH(width / 2); else - width = SNES_NTSC_OUT_WIDTH (width); + width = SNES_NTSC_OUT_WIDTH(width); height *= 2; break; @@ -831,145 +795,17 @@ void get_filter_scale (int &width, int &height) } } -static void internal_filter (uint8 *src_buffer, - int src_pitch, - uint8 *dst_buffer, - int dst_pitch, - int &width, - int &height) +static void internal_filter(uint8 *src_buffer, + int src_pitch, + uint8 *dst_buffer, + int dst_pitch, + int &width, + int &height) { switch (gui_config->scale_method) { case FILTER_SUPEREAGLE: - SuperEagle (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - - case FILTER_2XSAI: - _2xSaI (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - - case FILTER_SUPER2XSAI: - Super2xSaI (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - -#ifdef USE_HQ2X - case FILTER_HQ4X: - if (((width * 4) <= S9xDisplayDriver::scaled_max_width) && - ((height * 4) <= S9xDisplayDriver::scaled_max_height)) - { - HQ4X_16 (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_HQ3X: - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - HQ3X_16 (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_HQ2X: - HQ2X_16 (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; -#endif /* USE_HQ2X */ - -#ifdef USE_XBRZ - case FILTER_4XBRZ: - if (width * 4 <= S9xDisplayDriver::scaled_max_width && - height * 4 <= S9xDisplayDriver::scaled_max_height) - { - filter_4xBRZ (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_3XBRZ: - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - filter_3xBRZ (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_2XBRZ: - filter_2xBRZ (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; -#endif /* USE_XBRZ */ - - case FILTER_SIMPLE4X: - if (((width * 4) <= S9xDisplayDriver::scaled_max_width) && - ((height * 4) <= S9xDisplayDriver::scaled_max_height)) - { - filter_4x (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_SIMPLE3X: - - if (width * 3 <= S9xDisplayDriver::scaled_max_width && - height * 3 <= S9xDisplayDriver::scaled_max_height) - { - filter_3x (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - break; - } - // Fall through - case FILTER_SIMPLE2X: - filter_2x (src_buffer, + SuperEagle(src_buffer, src_pitch, dst_buffer, dst_pitch, @@ -977,107 +813,204 @@ static void internal_filter (uint8 *src_buffer, height); break; + case FILTER_2XSAI: + _2xSaI(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + + case FILTER_SUPER2XSAI: + Super2xSaI(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + +#ifdef USE_HQ2X + case FILTER_HQ4X: + HQ4X_16(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_HQ3X: + HQ3X_16(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_HQ2X: + HQ2X_16(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; +#endif /* USE_HQ2X */ + +#ifdef USE_XBRZ + case FILTER_4XBRZ: + filter_4xBRZ(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_3XBRZ: + filter_3xBRZ(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_2XBRZ: + filter_2xBRZ(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; +#endif /* USE_XBRZ */ + + case FILTER_SIMPLE4X: + filter_4x(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_SIMPLE3X: + + filter_3x(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_SIMPLE2X: + filter_2x(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); + break; + case FILTER_EPX: - EPX_16_unsafe (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); + EPX_16_unsafe(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); break; case FILTER_EPX_SMOOTH: - EPX_16_smooth_unsafe (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); + EPX_16_smooth_unsafe(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); break; case FILTER_NTSC: if (width > 256) - snes_ntsc_blit_hires_scanlines (&snes_ntsc, - (SNES_NTSC_IN_T *) src_buffer, - src_pitch >> 1, - burst_phase, - width, - height, - (void *) dst_buffer, - dst_pitch); + snes_ntsc_blit_hires_scanlines(&snes_ntsc, + (SNES_NTSC_IN_T *)src_buffer, + src_pitch >> 1, + burst_phase, + width, + height, + (void *)dst_buffer, + dst_pitch); else - snes_ntsc_blit_scanlines (&snes_ntsc, - (SNES_NTSC_IN_T *) src_buffer, - src_pitch >> 1, - burst_phase, - width, - height, - (void *) dst_buffer, - dst_pitch); + snes_ntsc_blit_scanlines(&snes_ntsc, + (SNES_NTSC_IN_T *)src_buffer, + src_pitch >> 1, + burst_phase, + width, + height, + (void *)dst_buffer, + dst_pitch); break; case FILTER_SCANLINES: - filter_scanlines (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); + filter_scanlines(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); break; - } - get_filter_scale (width, height); + get_filter_scale(width, height); } -static void thread_worker (gpointer data, - gpointer user_data) +static void thread_worker(gpointer data, + gpointer user_data) { - thread_job_t *job = ((thread_job_t *) data); + thread_job_t *job = ((thread_job_t *)data); switch (job->operation_type) { case JOB_FILTER: - internal_filter (job->src_buffer, - job->src_pitch, - job->dst_buffer, - job->dst_pitch, - job->width, - job->height); + internal_filter(job->src_buffer, + job->src_pitch, + job->dst_buffer, + job->dst_pitch, + job->width, + job->height); break; case JOB_CONVERT: - internal_convert (job->src_buffer, - job->dst_buffer, - job->src_pitch, - job->dst_pitch, - job->width, - job->height, - job->bpp); + internal_convert(job->src_buffer, + job->dst_buffer, + job->src_pitch, + job->dst_pitch, + job->width, + job->height, + job->bpp); break; case JOB_CONVERT_YUV: - internal_convert_16_yuv (job->src_buffer, - job->dst_buffer, - job->src_pitch, - job->dst_pitch, - job->width, - job->height); + internal_convert_16_yuv(job->src_buffer, + job->dst_buffer, + job->src_pitch, + job->dst_pitch, + job->width, + job->height); break; case JOB_CONVERT_MASK: - internal_convert_mask (job->src_buffer, - job->dst_buffer, - job->src_pitch, - job->dst_pitch, - job->width, - job->height, - job->inv_rmask, - job->inv_bmask, - job->inv_gmask, - job->bpp); + internal_convert_mask(job->src_buffer, + job->dst_buffer, + job->src_pitch, + job->dst_pitch, + job->width, + job->height, + job->inv_rmask, + job->inv_bmask, + job->inv_gmask, + job->bpp); break; } @@ -1085,19 +1018,19 @@ static void thread_worker (gpointer data, } static void -create_thread_pool () +create_thread_pool() { if (pool == NULL) { - pool = g_thread_pool_new (thread_worker, - NULL, - gui_config->num_threads - 1, - true, - NULL); + pool = g_thread_pool_new(thread_worker, + NULL, + gui_config->num_threads - 1, + true, + NULL); } } -static void wait_for_jobs_to_complete () +static void wait_for_jobs_to_complete() { while (1) { @@ -1108,29 +1041,29 @@ static void wait_for_jobs_to_complete () if (complete) break; - sched_yield (); + sched_yield(); } } static void -internal_threaded_convert (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height, - int bpp) +internal_threaded_convert(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height, + int bpp) { - create_thread_pool (); + create_thread_pool(); for (int i = 0; i < gui_config->num_threads; i++) { job[i].operation_type = (bpp == -1 ? JOB_CONVERT_YUV : JOB_CONVERT); job[i].src_buffer = - ((uint8 *) src_buffer) + (src_pitch * i * (height / gui_config->num_threads)); + ((uint8 *)src_buffer) + (src_pitch * i * (height / gui_config->num_threads)); job[i].src_pitch = src_pitch; job[i].dst_buffer = - ((uint8 *) dst_buffer) + (dst_pitch * i * (height / gui_config->num_threads)); + ((uint8 *)dst_buffer) + (dst_pitch * i * (height / gui_config->num_threads)); job[i].dst_pitch = dst_pitch; job[i].width = width; job[i].height = height / gui_config->num_threads; @@ -1140,33 +1073,33 @@ internal_threaded_convert (void *src_buffer, if (i == gui_config->num_threads - 1) job[i].height = height - ((gui_config->num_threads - 1) * (height / gui_config->num_threads)); - g_thread_pool_push (pool, (gpointer) &(job[i]), NULL); + g_thread_pool_push(pool, (gpointer) & (job[i]), NULL); } - wait_for_jobs_to_complete (); + wait_for_jobs_to_complete(); } -static void internal_threaded_convert_mask (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height, - int inv_rmask, - int inv_gmask, - int inv_bmask, - int bpp) +static void internal_threaded_convert_mask(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height, + int inv_rmask, + int inv_gmask, + int inv_bmask, + int bpp) { - create_thread_pool (); + create_thread_pool(); for (int i = 0; i < gui_config->num_threads; i++) { job[i].operation_type = (bpp == -1 ? JOB_CONVERT_YUV : JOB_CONVERT); job[i].src_buffer = - ((uint8 *) src_buffer) + (src_pitch * i * (height / gui_config->num_threads)); + ((uint8 *)src_buffer) + (src_pitch * i * (height / gui_config->num_threads)); job[i].src_pitch = src_pitch; job[i].dst_buffer = - ((uint8 *) dst_buffer) + (dst_pitch * i * (height / gui_config->num_threads)); + ((uint8 *)dst_buffer) + (dst_pitch * i * (height / gui_config->num_threads)); job[i].dst_pitch = dst_pitch; job[i].width = width; job[i].height = height / gui_config->num_threads; @@ -1179,25 +1112,25 @@ static void internal_threaded_convert_mask (void *src_buffer, if (i == gui_config->num_threads - 1) job[i].height = height - ((gui_config->num_threads - 1) * (height / gui_config->num_threads)); - g_thread_pool_push (pool, (gpointer) &(job[i]), NULL); + g_thread_pool_push(pool, (gpointer) & (job[i]), NULL); } - wait_for_jobs_to_complete (); + wait_for_jobs_to_complete(); } -static void internal_threaded_filter (uint8 *src_buffer, - int src_pitch, - uint8 *dst_buffer, - int dst_pitch, - int &width, - int &height) +static void internal_threaded_filter(uint8 *src_buffer, + int src_pitch, + uint8 *dst_buffer, + int dst_pitch, + int &width, + int &height) { int dst_width = width, dst_height = height; /* If the threadpool doesn't exist, create it */ - create_thread_pool (); + create_thread_pool(); - get_filter_scale (dst_width, dst_height); + get_filter_scale(dst_width, dst_height); int yscale = dst_height / height; int coverage = 0; @@ -1216,187 +1149,187 @@ static void internal_threaded_filter (uint8 *src_buffer, job[i].height = height - coverage; coverage += job[i].height; - g_thread_pool_push (pool, (gpointer) &(job[i]), NULL); + g_thread_pool_push(pool, (gpointer) & (job[i]), NULL); } - wait_for_jobs_to_complete (); + wait_for_jobs_to_complete(); - get_filter_scale (width, height); + get_filter_scale(width, height); } -void S9xFilter (uint8 *src_buffer, - int src_pitch, - uint8 *dst_buffer, - int dst_pitch, - int &width, - int &height) +void S9xFilter(uint8 *src_buffer, + int src_pitch, + uint8 *dst_buffer, + int dst_pitch, + int &width, + int &height) { burst_phase = (burst_phase + 1) % 3; if (gui_config->multithreading) - internal_threaded_filter (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - else - internal_filter (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); -} - -void S9xConvertYUV (void *src_buffer, - void *dst_buffer, - int src_pitch, - int dst_pitch, - int width, - int height) -{ - if (gui_config->multithreading) - internal_threaded_convert (src_buffer, - dst_buffer, - src_pitch, - dst_pitch, - width, - height, - -1); - else - internal_convert_16_yuv (src_buffer, - dst_buffer, + internal_threaded_filter(src_buffer, src_pitch, + dst_buffer, dst_pitch, width, height); + else + internal_filter(src_buffer, + src_pitch, + dst_buffer, + dst_pitch, + width, + height); } -void S9xConvert (void *src, - void *dst, - int src_pitch, - int dst_pitch, - int width, - int height, - int bpp) +void S9xConvertYUV(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height) { if (gui_config->multithreading) - internal_threaded_convert (src, - dst, - src_pitch, - dst_pitch, - width, - height, - bpp); + internal_threaded_convert(src_buffer, + dst_buffer, + src_pitch, + dst_pitch, + width, + height, + -1); else - internal_convert (src, - dst, - src_pitch, - dst_pitch, - width, - height, - bpp); + internal_convert_16_yuv(src_buffer, + dst_buffer, + src_pitch, + dst_pitch, + width, + height); } -void S9xConvertMask (void *src, - void *dst, - int src_pitch, - int dst_pitch, - int width, - int height, - int rshift, - int gshift, - int bshift, - int bpp) +void S9xConvert(void *src, + void *dst, + int src_pitch, + int dst_pitch, + int width, + int height, + int bpp) { if (gui_config->multithreading) - internal_threaded_convert_mask (src, - dst, - src_pitch, - dst_pitch, - width, - height, - rshift, - gshift, - bshift, - bpp); + internal_threaded_convert(src, + dst, + src_pitch, + dst_pitch, + width, + height, + bpp); else - internal_convert_mask (src, - dst, - src_pitch, - dst_pitch, - width, - height, - rshift, - gshift, - bshift, - bpp); + internal_convert(src, + dst, + src_pitch, + dst_pitch, + width, + height, + bpp); } -void S9xDisplayRefresh (int width, int height) +void S9xConvertMask(void *src, + void *dst, + int src_pitch, + int dst_pitch, + int width, + int height, + int rshift, + int gshift, + int bshift, + int bpp) { - driver->refresh (width, height); + if (gui_config->multithreading) + internal_threaded_convert_mask(src, + dst, + src_pitch, + dst_pitch, + width, + height, + rshift, + gshift, + bshift, + bpp); + else + internal_convert_mask(src, + dst, + src_pitch, + dst_pitch, + width, + height, + rshift, + gshift, + bshift, + bpp); } -static void ntsc_filter_init () +void S9xDisplayRefresh(int width, int height) { - snes_ntsc_scanline_offset = scanline_offsets [gui_config->ntsc_scanline_intensity]; - snes_ntsc_scanline_mask = scanline_masks [gui_config->ntsc_scanline_intensity]; - - snes_ntsc_init (&snes_ntsc, &gui_config->ntsc_setup); + driver->refresh(width, height); } -void S9xDisplayReconfigure () +static void ntsc_filter_init() { - ntsc_filter_init (); + snes_ntsc_scanline_offset = scanline_offsets[gui_config->ntsc_scanline_intensity]; + snes_ntsc_scanline_mask = scanline_masks[gui_config->ntsc_scanline_intensity]; + + snes_ntsc_init(&snes_ntsc, &gui_config->ntsc_setup); +} + +void S9xDisplayReconfigure() +{ + ntsc_filter_init(); if (pool) { - g_thread_pool_set_max_threads (pool, gui_config->num_threads - 1, NULL); + g_thread_pool_set_max_threads(pool, gui_config->num_threads - 1, NULL); } } -void S9xQueryDrivers () +void S9xQueryDrivers() { - GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window())); + GdkDisplay *gdk_display = top_level->window->get_display()->gobj(); gui_config->allow_xv = false; #if defined(USE_XV) && defined(GDK_WINDOWING_X11) - if (GDK_IS_X11_DISPLAY (display)) - gui_config->allow_xv = S9xXVDisplayDriver::query_availability (); + if (GDK_IS_X11_DISPLAY(gdk_display)) + gui_config->allow_xv = S9xXVDisplayDriver::query_availability(); #endif #ifdef USE_OPENGL - gui_config->allow_opengl = S9xOpenGLDisplayDriver::query_availability (); + gui_config->allow_opengl = S9xOpenGLDisplayDriver::query_availability(); #else gui_config->allow_opengl = false; #endif gui_config->allow_xrandr = false; #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_DISPLAY (display)) + if (GDK_IS_X11_DISPLAY(gdk_display)) { - Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window()))); - Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (top_level->get_window()))); + Display *dpy = gdk_x11_display_get_xdisplay(gdk_display); + Window xid = gdk_x11_window_get_xid(top_level->window->get_window()->gobj()); gui_config->allow_xrandr = true; - gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid); - gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy, - gui_config->xrr_screen_resources, - gui_config->xrr_screen_resources->crtcs[0]); + gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent(dpy, xid); + gui_config->xrr_crtc_info = XRRGetCrtcInfo(dpy, + gui_config->xrr_screen_resources, + gui_config->xrr_screen_resources->crtcs[0]); } #endif } -bool8 S9xDeinitUpdate (int width, int height) +bool8 S9xDeinitUpdate(int width, int height) { int yoffset = 0; if (top_level->last_height > height) { - memset (GFX.Screen + (GFX.Pitch >> 1) * height, - 0, - GFX.Pitch * (top_level->last_height - height)); + memset(GFX.Screen + (GFX.Pitch >> 1) * height, + 0, + GFX.Pitch * (top_level->last_height - height)); } top_level->last_height = height; @@ -1429,154 +1362,147 @@ bool8 S9xDeinitUpdate (int width, int height) } } - if (!Settings.Paused && !NetPlay.Paused - ) + uint16_t *screen_view = GFX.Screen + yoffset * 512; + + if (!Settings.Paused && !NetPlay.Paused) { if (gui_config->hires_effect == HIRES_SCALE) { - S9xForceHires (GFX.Screen, - S9xDisplayDriver::image_width * - S9xDisplayDriver::image_bpp, - width, - height); + S9xForceHires(screen_view, 512 * 2, width, height); top_level->last_width = width; } else if (gui_config->hires_effect == HIRES_MERGE) { - S9xMergeHires (GFX.Screen, - S9xDisplayDriver::image_width * - S9xDisplayDriver::image_bpp, - width, - height); + S9xMergeHires(screen_view, 512 * 2, width, height); top_level->last_width = width; } - - GFX.Screen = driver->get_next_buffer (); } - driver->update (width, height, yoffset); + if (gui_config->scale_method > 0) + { + int scaled_width = width; + int scaled_height = height; + + get_filter_scale(scaled_width, scaled_height); + + if ((int)scaled_image.size() < (scaled_width * scaled_height * 2)) + { + scaled_image.resize(scaled_width * scaled_height * 2); + } + + S9xFilter((uint8_t *)screen_view, 512 * 2, &scaled_image[0], scaled_width * 2, width, height); + driver->update((uint16_t *)&scaled_image[0], width, height, scaled_width); + + return true; + } + + driver->update(screen_view, width, height, 512); return true; } -static void S9xInitDriver () +static void S9xInitDriver() { + // Only OpenGL is supported on Wayland #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) + if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) { gui_config->hw_accel = HWA_OPENGL; } #endif + switch (gui_config->hw_accel) { #ifdef USE_OPENGL - case HWA_OPENGL: - - driver = new S9xOpenGLDisplayDriver (top_level, - gui_config); - - break; + case HWA_OPENGL: + driver = new S9xOpenGLDisplayDriver(top_level, gui_config); + break; #endif + #if defined(USE_XV) && defined(GDK_WINDOWING_X11) - case HWA_XV: - - driver = new S9xXVDisplayDriver (top_level, gui_config); - - break; + case HWA_XV: + driver = new S9xXVDisplayDriver(top_level, gui_config); + break; #endif - default: - driver = new S9xGTKDisplayDriver (top_level, gui_config); + default: + driver = new S9xGTKDisplayDriver(top_level, gui_config); } - if (driver->init ()) + if (driver->init()) { if (gui_config->hw_accel > 0) { delete driver; - gui_config->hw_accel = HWA_NONE; - S9xInitDriver (); + S9xInitDriver(); } else { - fprintf (stderr, "Error: Couldn't initialize any display output.\n"); - exit (1); + fprintf(stderr, "Error: Couldn't initialize any display output.\n"); + exit(1); } } pool = NULL; } -S9xDisplayDriver *S9xDisplayGetDriver () +S9xDisplayDriver *S9xDisplayGetDriver() { return driver; } -void S9xDisplayClearBuffers () +void S9xDeinitDisplay() { - driver->clear_buffers (); -} - -void S9xDeinitDisplay () -{ - driver->deinit (); + if (driver) + driver->deinit(); delete driver; - driver = NULL; - GFX.Screen = NULL; - if (pool) - g_thread_pool_free (pool, false, true); + g_thread_pool_free(pool, false, true); } -void S9xReinitDisplay () +void S9xReinitDisplay() { - uint8_t *buffer = NULL; - int width, height; + uint16_t *buffer = NULL; + int width, height; - buffer = new uint8_t[S9xDisplayDriver::image_size]; - memmove (buffer, - driver->get_current_buffer (), - S9xDisplayDriver::image_size); + buffer = new uint16_t[512 * 512]; + memmove(buffer, GFX.Screen, 512 * 478 * 2); width = top_level->last_width; height = top_level->last_height; - S9xDeinitDisplay (); - S9xInitDriver (); - S9xDisplayReconfigure (); + S9xDeinitDisplay(); + S9xInitDriver(); + S9xDisplayReconfigure(); top_level->last_width = width; top_level->last_height = height; - driver->push_buffer ((uint16_t *)buffer); + memmove(GFX.Screen, buffer, 512 * 478 * 2); delete[] buffer; } -bool8 S9xContinueUpdate (int width, int height) +bool8 S9xContinueUpdate(int width, int height) { - S9xDeinitUpdate (width, height); + S9xDeinitUpdate(width, height); return true; } -bool8 S9xInitUpdate () +bool8 S9xInitUpdate() { return true; } -void S9xSetPalette () +void S9xTextMode() { } -void S9xTextMode () -{ -} - -void S9xGraphicsMode () +void S9xGraphicsMode() { } @@ -1584,14 +1510,14 @@ void S9xGraphicsMode () static const int font_width = 8; static const int font_height = 10; -static inline int CharWidth (uint8 c) +static inline int CharWidth(uint8 c) { return font_width - var8x10font_kern[c - 32][0] - var8x10font_kern[c - 32][1]; } -static int StringWidth (const char *str) +static int StringWidth(const char *str) { - int length = strlen (str); + int length = strlen(str); int pixcount = 0; if (length > 0) @@ -1599,7 +1525,7 @@ static int StringWidth (const char *str) for (int i = 0; i < length; i++) { - pixcount += (CharWidth (str[i]) - 1); + pixcount += (CharWidth(str[i]) - 1); } return pixcount; @@ -1626,9 +1552,9 @@ static void GTKDisplayChar(int x, int y, uint8 c, bool monospace = false, int ov *s = Settings.DisplayColor; else if (var8x10font[line][offset + w] == '.') *s = 0x0000; -// else if (!monospace && w >= overlap) -// *s = (*s & 0xf7de) >> 1; -// *s = (*s & 0xe79c) >> 2; + // else if (!monospace && w >= overlap) + // *s = (*s & 0xf7de) >> 1; + // *s = (*s & 0xe79c) >> 2; if (scale > 1) { @@ -1652,14 +1578,14 @@ static void S9xGTKDisplayString(const char *string, int linesFromBottom, linesFromBottom -= 3; if (pixelsFromLeft > 128) - pixelsFromLeft = SNES_WIDTH - StringWidth (string); + pixelsFromLeft = SNES_WIDTH - StringWidth(string); monospace = false; } int dst_x = pixelsFromLeft; - int dst_y = IPPU.RenderedScreenHeight - (font_height) * linesFromBottom; - int len = strlen(string); + int dst_y = IPPU.RenderedScreenHeight - (font_height)*linesFromBottom; + int len = strlen(string); if (IPPU.RenderedScreenHeight % 224 && !gui_config->overscan) dst_y -= 8; @@ -1668,7 +1594,7 @@ static void S9xGTKDisplayString(const char *string, int linesFromBottom, int overlap = 0; - for (int i = 0 ; i < len ; i++) + for (int i = 0; i < len; i++) { int cindex = string[i] - 32; int char_width = font_width - (monospace ? 1 : (var8x10font_kern[cindex][0] + var8x10font_kern[cindex][1])); @@ -1686,33 +1612,38 @@ static void S9xGTKDisplayString(const char *string, int linesFromBottom, break; } - if ((uint8) string[i] < 32) + if ((uint8)string[i] < 32) continue; GTKDisplayChar(dst_x, dst_y, string[i], monospace, overlap); - dst_x += char_width - 1; + dst_x += char_width - 1; overlap = 1; } } -void S9xInitDisplay (int argc, char **argv) +void S9xInitDisplay(int argc, char **argv) { + static uint16_t screen_buffer[512 * 1024]; + Settings.SupportHiRes = true; - S9xBlit2xSaIFilterInit (); + GFX.Screen = (uint16_t *)&screen_buffer[512 * 256]; + GFX.Pitch = 512 * 2; + + S9xBlit2xSaIFilterInit(); #ifdef USE_HQ2X - S9xBlitHQ2xFilterInit (); + S9xBlitHQ2xFilterInit(); #endif /* USE_HQ2SX */ - S9xQueryDrivers (); - S9xInitDriver (); - S9xGraphicsInit (); - S9xDisplayReconfigure (); + S9xQueryDrivers(); + S9xInitDriver(); + S9xGraphicsInit(); + S9xDisplayReconfigure(); S9xCustomDisplayString = S9xGTKDisplayString; } -bool S9xDisplayDriverIsReady () +bool S9xDisplayDriverIsReady() { if (!driver) return false; - return driver->is_ready (); + return driver->is_ready(); } diff --git a/gtk/src/gtk_display.h b/gtk/src/gtk_display.h index 6cff0638..6607b526 100644 --- a/gtk/src/gtk_display.h +++ b/gtk/src/gtk_display.h @@ -20,8 +20,7 @@ #include "filter_epx_unsafe.h" #include "filter/snes_ntsc.h" -enum -{ +enum { FILTER_NONE = 0, FILTER_SUPEREAGLE = 1, FILTER_2XSAI = 2, @@ -42,21 +41,18 @@ enum NUM_FILTERS = 17 }; -enum -{ +enum { NTSC_COMPOSITE = 0, NTSC_SVIDEO = 1, NTSC_RGB = 2 }; -enum -{ +enum { ENDIAN_NORMAL = 0, ENDIAN_SWAPPED = 1 }; -enum -{ +enum { JOB_FILTER = 0, JOB_CONVERT = 1, JOB_SCALE_AND_CONVERT = 2, @@ -81,53 +77,53 @@ typedef struct thread_job_t volatile bool complete; } thread_job_t; -struct S9xRect { +struct S9xRect +{ int x; int y; int w; int h; }; -void S9xRegisterYUVTables (uint8 *y, uint8 *u, uint8 *v); -void S9xSetEndianess (int type); -double S9xGetAspect (); -S9xRect S9xApplyAspect (int, int, int, int); -void S9xConvertYUV (void *src_buffer, - void *dst_buffer, +void S9xRegisterYUVTables(uint8 *y, uint8 *u, uint8 *v); +void S9xSetEndianess(int type); +double S9xGetAspect(); +S9xRect S9xApplyAspect(int, int, int, int); +void S9xConvertYUV(void *src_buffer, + void *dst_buffer, + int src_pitch, + int dst_pitch, + int width, + int height); +void S9xConvert(void *src, + void *dst, + int src_pitch, + int dst_pitch, + int width, + int height, + int bpp); +void S9xConvertMask(void *src, + void *dst, int src_pitch, int dst_pitch, int width, - int height); -void S9xConvert (void *src, - void *dst, - int src_pitch, - int dst_pitch, - int width, - int height, - int bpp); -void S9xConvertMask (void *src, - void *dst, - int src_pitch, - int dst_pitch, - int width, - int height, - int rshift, - int gshift, - int bshift, - int bpp); -void S9xFilter (uint8 *src_buffer, - int src_pitch, - uint8 *dst_buffer, - int dst_pitch, - int& width, - int& height); -void get_filter_scale (int& width, int& height); -void S9xDisplayRefresh (int width, int height); -void S9xDisplayClearBuffers (); -void S9xReinitDisplay (); -void S9xDisplayReconfigure (); -void S9xQueryDrivers (); -S9xDisplayDriver *S9xDisplayGetDriver (); -bool S9xDisplayDriverIsReady (); + int height, + int rshift, + int gshift, + int bshift, + int bpp); +void S9xFilter(uint8 *src_buffer, + int src_pitch, + uint8 *dst_buffer, + int dst_pitch, + int &width, + int &height); +void get_filter_scale(int &width, int &height); +void S9xDisplayRefresh(int width, int height); +void S9xReinitDisplay(); +void S9xDisplayReconfigure(); +void S9xQueryDrivers(); +S9xDisplayDriver *S9xDisplayGetDriver(); +bool S9xDisplayDriverIsReady(); #endif /* __GTK_DISPLAY_H */ diff --git a/gtk/src/gtk_display_driver.h b/gtk/src/gtk_display_driver.h index c3120688..e84172a3 100644 --- a/gtk/src/gtk_display_driver.h +++ b/gtk/src/gtk_display_driver.h @@ -11,46 +11,22 @@ class S9xDisplayDriver { - public: - virtual ~S9xDisplayDriver() {} - virtual void refresh (int width, int height) = 0; - virtual int init () = 0; - virtual void deinit () = 0; - virtual void clear_buffers () = 0; - virtual void update (int width, int height, int yoffset) = 0; - virtual uint16 *get_next_buffer () = 0; - virtual uint16 *get_current_buffer () = 0; - virtual void push_buffer (uint16 *src) = 0; - virtual void *get_parameters () = 0; - virtual void save (const char *filename) = 0; - virtual bool is_ready () = 0; + public: + virtual ~S9xDisplayDriver() + { + } + virtual void refresh(int width, int height) = 0; + virtual int init() = 0; + virtual void deinit() = 0; + virtual void update(uint16_t *buffer, int width, int height, int stride_in_pixels) = 0; + virtual void *get_parameters() = 0; + virtual void save(const char *filename) = 0; + virtual bool is_ready() = 0; - /* Namespaced sizing constants */ - static const int image_width = 1024; - static const int image_height = 478; - static const int image_bpp = 2; - static const int scaled_max_width = 1024; - static const int scaled_max_height = 956; - - static const int image_size = image_width * image_height * image_bpp; - static const int image_padded_size = (image_width + 8) * - (image_height + 8 + 30) * - image_bpp; - static const int image_padded_offset = (image_width + 8) * (4 + 30) + 4; - static const int scaled_size = scaled_max_width * - scaled_max_height * - image_bpp; - static const int scaled_padded_size = (scaled_max_width + 8) * - (scaled_max_height + 8) * - image_bpp; - static const int scaled_padded_offset = (scaled_max_width + 8) * 4 + 4; - - protected: - Snes9xWindow *window; - Snes9xConfig *config; - GtkWidget *drawing_area; - uint8_t *padded_buffer[4]; - uint8_t *buffer[4]; + protected: + Snes9xWindow *window; + Snes9xConfig *config; + Gtk::DrawingArea *drawing_area; }; #endif /* __GTK_DISPLAY_DRIVER_H*/ diff --git a/gtk/src/gtk_display_driver_gtk.cpp b/gtk/src/gtk_display_driver_gtk.cpp index ebd99cdb..e7206b17 100644 --- a/gtk/src/gtk_display_driver_gtk.cpp +++ b/gtk/src/gtk_display_driver_gtk.cpp @@ -4,161 +4,102 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include #include "gtk_display.h" #include "gtk_display_driver_gtk.h" +#include "snes9x.h" - -S9xGTKDisplayDriver::S9xGTKDisplayDriver (Snes9xWindow *window, - Snes9xConfig *config) +S9xGTKDisplayDriver::S9xGTKDisplayDriver(Snes9xWindow *window, + Snes9xConfig *config) { this->window = window; this->config = config; - this->drawing_area = GTK_WIDGET (window->drawing_area); + this->drawing_area = window->drawing_area; } -void -S9xGTKDisplayDriver::update (int width, int height, int yoffset) +void S9xGTKDisplayDriver::update(uint16_t *buffer, int width, int height, int stride_in_pixels) { - int final_pitch; - uint8 *final_buffer; - GtkAllocation allocation; - if (width <= 0) return; - - gtk_widget_get_allocation (drawing_area, &allocation); - - if (config->scale_method > 0) - { - uint8 *src_buffer = (uint8 *) padded_buffer[0]; - uint8 *dst_buffer = (uint8 *) padded_buffer[1]; - int src_pitch = image_width * image_bpp; - int dst_pitch = scaled_max_width * image_bpp; - - src_buffer += (src_pitch * yoffset); - - S9xFilter (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - - final_buffer = (uint8 *) padded_buffer[1]; - final_pitch = dst_pitch; - } - else - { - final_buffer = (uint8 *) padded_buffer[0]; - final_pitch = image_width * image_bpp; - final_buffer += (final_pitch * yoffset); - } - - S9xRect dst = S9xApplyAspect(width, height, allocation.width, allocation.height); - output (final_buffer, final_pitch, dst.x, dst.y, width, height, dst.w, dst.h); + S9xRect dst = S9xApplyAspect(width, height, drawing_area->get_width(), drawing_area->get_height()); + output(buffer, stride_in_pixels * 2, dst.x, dst.y, width, height, dst.w, dst.h); } -void -S9xGTKDisplayDriver::output (void *src, - int src_pitch, - int x, - int y, - int width, - int height, - int dst_width, - int dst_height) +void S9xGTKDisplayDriver::output(void *src, + int src_pitch, + int x, + int y, + int width, + int height, + int dst_width, + int dst_height) { if (last_known_width != dst_width || last_known_height != dst_height) { - clear (); + clear(); last_known_width = dst_width; last_known_height = dst_height; } - cairo_t *cr = window->get_cairo (); - + cairo_t *cr = window->get_cairo(); cairo_surface_t *surface; - surface = cairo_image_surface_create_for_data ((unsigned char *) src, CAIRO_FORMAT_RGB16_565, width, height, src_pitch); + surface = cairo_image_surface_create_for_data((unsigned char *)src, CAIRO_FORMAT_RGB16_565, width, height, src_pitch); - cairo_set_source_surface (cr, surface, 0, 0); + cairo_set_source_surface(cr, surface, 0, 0); if (width != dst_width || height != dst_height) { cairo_matrix_t matrix; - cairo_pattern_t *pattern = cairo_get_source (cr);; + cairo_pattern_t *pattern = cairo_get_source(cr); + ; - cairo_matrix_init_identity (&matrix); - cairo_matrix_scale (&matrix, - (double) width / (double) dst_width, - (double) height / (double) dst_height); - cairo_matrix_translate (&matrix, -x, -y); - cairo_pattern_set_matrix (pattern, &matrix); - cairo_pattern_set_filter (pattern, - Settings.BilinearFilter - ? CAIRO_FILTER_BILINEAR - : CAIRO_FILTER_NEAREST); + cairo_matrix_init_identity(&matrix); + cairo_matrix_scale(&matrix, + (double)width / (double)dst_width, + (double)height / (double)dst_height); + cairo_matrix_translate(&matrix, -x, -y); + cairo_pattern_set_matrix(pattern, &matrix); + cairo_pattern_set_filter(pattern, + Settings.BilinearFilter + ? CAIRO_FILTER_BILINEAR + : CAIRO_FILTER_NEAREST); } - cairo_rectangle (cr, x, y, dst_width, dst_height); - cairo_fill (cr); + cairo_rectangle(cr, x, y, dst_width, dst_height); + cairo_fill(cr); - cairo_surface_finish (surface); - cairo_surface_destroy (surface); + cairo_surface_finish(surface); + cairo_surface_destroy(surface); - window->release_cairo (); - window->set_mouseable_area (x, y, width, height); + window->release_cairo(); + window->set_mouseable_area(x, y, width, height); } -int -S9xGTKDisplayDriver::init () +int S9xGTKDisplayDriver::init() { - buffer[0] = new uint8_t[image_padded_size]; - buffer[1] = new uint8_t[scaled_padded_size]; - - padded_buffer[0] = &buffer[0][image_padded_offset]; - padded_buffer[1] = &buffer[1][scaled_padded_offset]; - - memset (buffer[0], 0, image_padded_size); - memset (buffer[1], 0, scaled_padded_size); - - GFX.Screen = (uint16 *) padded_buffer[0]; - GFX.Pitch = image_width * image_bpp; - return 0; } -void -S9xGTKDisplayDriver::deinit () +void S9xGTKDisplayDriver::deinit() { - padded_buffer[0] = NULL; - padded_buffer[1] = NULL; - - delete[] buffer[0]; - delete[] buffer[1]; } -void -S9xGTKDisplayDriver::clear () +void S9xGTKDisplayDriver::clear() { - int width, height; - GtkAllocation allocation; + int width = drawing_area->get_width(); + int height = drawing_area->get_height(); - gtk_widget_get_allocation (drawing_area, &allocation); - width = allocation.width; - height = allocation.height; + cairo_t *cr = window->get_cairo(); - cairo_t *cr = window->get_cairo (); - - cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); + cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); if (window->last_width <= 0 || window->last_height <= 0) { - cairo_paint (cr); - window->release_cairo (); + cairo_paint(cr); + window->release_cairo(); return; } @@ -171,53 +112,27 @@ S9xGTKDisplayDriver::clear () if (dst.x > 0) { - cairo_rectangle (cr, 0, dst.y, dst.x, dst.h); + cairo_rectangle(cr, 0, dst.y, dst.x, dst.h); } if (dst.x + dst.w < width) { - cairo_rectangle (cr, dst.x + dst.w, dst.y, width - (dst.x + dst.w), dst.h); + cairo_rectangle(cr, dst.x + dst.w, dst.y, width - (dst.x + dst.w), dst.h); } if (dst.y > 0) { - cairo_rectangle (cr, 0, 0, width, dst.y); + cairo_rectangle(cr, 0, 0, width, dst.y); } if (dst.y + dst.h < height) { - cairo_rectangle (cr, 0, dst.y + dst.h, width, height - (dst.y + dst.h)); + cairo_rectangle(cr, 0, dst.y + dst.h, width, height - (dst.y + dst.h)); } - cairo_fill (cr); + cairo_fill(cr); - window->release_cairo (); + window->release_cairo(); } -void -S9xGTKDisplayDriver::refresh (int width, int height) +void S9xGTKDisplayDriver::refresh(int width, int height) { - clear (); -} - -uint16 * -S9xGTKDisplayDriver::get_next_buffer () -{ - return (uint16 *) padded_buffer[0]; -} - -uint16 * -S9xGTKDisplayDriver::get_current_buffer () -{ - return (uint16 *) padded_buffer[0]; -} - -void -S9xGTKDisplayDriver::push_buffer (uint16 *src) -{ - memmove (GFX.Screen, src, image_size); -} - -void -S9xGTKDisplayDriver::clear_buffers () -{ - memset (buffer[0], 0, image_padded_size); - memset (buffer[1], 0, scaled_padded_size); -} + clear(); +} \ No newline at end of file diff --git a/gtk/src/gtk_display_driver_gtk.h b/gtk/src/gtk_display_driver_gtk.h index bf32f57b..9142cc66 100644 --- a/gtk/src/gtk_display_driver_gtk.h +++ b/gtk/src/gtk_display_driver_gtk.h @@ -12,33 +12,37 @@ class S9xGTKDisplayDriver : public S9xDisplayDriver { - public: - S9xGTKDisplayDriver (Snes9xWindow *window, Snes9xConfig *config); - void refresh (int width, int height); - int init (); - void deinit (); - void clear_buffers (); - void update (int width, int height, int yoffset); - uint16 *get_next_buffer (); - uint16 *get_current_buffer (); - void push_buffer (uint16 *src); - void *get_parameters () { return NULL; } - void save (const char *filename) { } - bool is_ready () { return true; } + public: + S9xGTKDisplayDriver(Snes9xWindow *window, Snes9xConfig *config); + void refresh(int width, int height); + int init(); + void deinit(); + void update(uint16_t *buffer, int width, int height, int stride_in_pixels); + void *get_parameters() + { + return NULL; + } + void save(const char *filename) + { + } + bool is_ready() + { + return true; + } - private: - void clear (); - void output (void *src, - int src_pitch, - int x, - int y, - int width, - int height, - int dst_width, - int dst_height); + private: + void clear(); + void output(void *src, + int src_pitch, + int x, + int y, + int width, + int height, + int dst_width, + int dst_height); - int last_known_width; - int last_known_height; + int last_known_width; + int last_known_height; }; #endif /* __GTK_DISPLAY_DRIVER_GTK_H */ diff --git a/gtk/src/gtk_display_driver_opengl.cpp b/gtk/src/gtk_display_driver_opengl.cpp index a82c36ff..ec48e159 100644 --- a/gtk/src/gtk_display_driver_opengl.cpp +++ b/gtk/src/gtk_display_driver_opengl.cpp @@ -4,7 +4,7 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include #include #include @@ -65,14 +65,14 @@ static const GLchar *stock_fragment_shader_140 = "}\n"; -static GLfloat coords[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, - 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; +static GLfloat coords[] = { -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, + 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, }; -static void S9xViewportCallback (int src_width, int src_height, - int viewport_x, int viewport_y, - int viewport_width, int viewport_height, - int *out_x, int *out_y, - int *out_width, int *out_height) +static void S9xViewportCallback(int src_width, int src_height, + int viewport_x, int viewport_y, + int viewport_width, int viewport_height, + int *out_x, int *out_y, + int *out_width, int *out_height) { S9xRect dst = S9xApplyAspect(src_width, src_height, viewport_width, viewport_height); *out_x = dst.x + viewport_x; @@ -81,202 +81,126 @@ static void S9xViewportCallback (int src_width, int src_height, *out_height = dst.h; } -S9xOpenGLDisplayDriver::S9xOpenGLDisplayDriver (Snes9xWindow *window, - Snes9xConfig *config) +S9xOpenGLDisplayDriver::S9xOpenGLDisplayDriver(Snes9xWindow *window, Snes9xConfig *config) { this->window = window; this->config = config; - this->drawing_area = GTK_WIDGET (window->drawing_area); + this->drawing_area = window->drawing_area; } -void S9xOpenGLDisplayDriver::update (int width, int height, int yoffset) +void S9xOpenGLDisplayDriver::update(uint16_t *buffer, int width, int height, int stride_in_pixels) { - uint8 *final_buffer = NULL; - int final_pitch; - void *pbo_map = NULL; + Gtk::Allocation allocation = drawing_area->get_allocation(); - GtkAllocation allocation; - gtk_widget_get_allocation (drawing_area, &allocation); - - if (output_window_width != allocation.width || - output_window_height != allocation.height) + if (output_window_width != allocation.get_width() || + output_window_height != allocation.get_height()) { - resize (); + resize(); } -#if GTK_CHECK_VERSION(3,10,0) - int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); + int scale_factor = drawing_area->get_scale_factor(); - allocation.width *= gdk_scale_factor; - allocation.height *= gdk_scale_factor; -#endif + allocation.set_width(allocation.get_width() * scale_factor); + allocation.set_height(allocation.get_height() * scale_factor); if (!legacy) - glActiveTexture (GL_TEXTURE0); - glBindTexture (GL_TEXTURE_2D, texmap); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, texmap); GLint filter = Settings.BilinearFilter ? GL_LINEAR : GL_NEAREST; - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); GLint clamp = (using_glsl_shaders || !npot) ? GL_CLAMP_TO_BORDER : GL_CLAMP_TO_EDGE; - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp); - glClear (GL_COLOR_BUFFER_BIT); + glClear(GL_COLOR_BUFFER_BIT); - if (config->scale_method > 0) - { - uint8 *src_buffer = (uint8 *) padded_buffer[0]; - int src_pitch = image_width * image_bpp; - uint8 *dst_buffer; - int dst_pitch; + S9xRect content = S9xApplyAspect(width, height, allocation.get_width(), allocation.get_height()); + glViewport(content.x, allocation.get_height() - content.y - content.h, content.w, content.h); + window->set_mouseable_area(content.x, content.y, content.w, content.h); - src_buffer += (src_pitch * yoffset); - - dst_buffer = (uint8 *) padded_buffer[1]; - dst_pitch = scaled_max_width * image_bpp; - final_buffer = (uint8 *) padded_buffer[1]; - final_pitch = scaled_max_width * image_bpp; - - S9xFilter (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - } - else - { - final_buffer = (uint8 *) padded_buffer[0]; - final_pitch = image_width * image_bpp; - final_buffer += (final_pitch * yoffset); - } - - S9xRect r = S9xApplyAspect(width, height, allocation.width, allocation.height); - glViewport (r.x, allocation.height - r.y - r.h, r.w, r.h); - window->set_mouseable_area (r.x, r.y, r.w, r.h); - - update_texture_size (width, height); + update_texture_size(width, height); if (using_pbos) { + void *pbo_memory = NULL; + GLbitfield bits = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | GL_MAP_UNSYNCHRONIZED_BIT; + if (config->pbo_format == 16) { - - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, pbo); - glBufferData (GL_PIXEL_UNPACK_BUFFER, - width * height * 2, - NULL, - GL_STREAM_DRAW); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); + glBufferData(GL_PIXEL_UNPACK_BUFFER, width * height * 2, NULL, GL_STREAM_DRAW); if (version >= 30) - pbo_map = glMapBufferRange ( - GL_PIXEL_UNPACK_BUFFER, 0, width * height * 2, - GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + pbo_memory = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, width * height * 2, bits); else - pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); + pbo_memory = glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); for (int y = 0; y < height; y++) { - memcpy ((uint8 *) pbo_map + (width * y * 2), - final_buffer + (y * final_pitch), - width * image_bpp); + uint16 *dst = (uint16_t *)pbo_memory + (width * y); + uint16 *src = &buffer[y * stride_in_pixels]; + memcpy(dst, src, width * 2); } + glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); - glUnmapBuffer (GL_PIXEL_UNPACK_BUFFER); + glPixelStorei(GL_UNPACK_ROW_LENGTH, width); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGB, + GL_UNSIGNED_SHORT_5_6_5, BUFFER_OFFSET(0)); - glPixelStorei (GL_UNPACK_ROW_LENGTH, width); - glTexSubImage2D (GL_TEXTURE_2D, - 0, - 0, - 0, - width, - height, - GL_RGB, - GL_UNSIGNED_SHORT_5_6_5, - BUFFER_OFFSET (0)); - - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, 0); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); } else /* 32-bit color */ { - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, pbo); - glBufferData (GL_PIXEL_UNPACK_BUFFER, - width * height * 4, - NULL, - GL_STREAM_DRAW); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); + glBufferData(GL_PIXEL_UNPACK_BUFFER, width * height * 4, NULL, GL_STREAM_DRAW); if (version >= 30) - pbo_map = glMapBufferRange ( - GL_PIXEL_UNPACK_BUFFER, 0, width * height * 4, - GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + pbo_memory = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, width * height * 4, bits); else - pbo_map = glMapBuffer (GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); + pbo_memory = glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); /* Pixel swizzling in software */ - S9xSetEndianess (ENDIAN_NORMAL); - S9xConvert (final_buffer, - pbo_map, - final_pitch, - width * 4, - width, - height, - 32); + S9xSetEndianess(ENDIAN_NORMAL); + S9xConvert(buffer, pbo_memory, stride_in_pixels * 2, width * 4, width, height, 32); - glUnmapBuffer (GL_PIXEL_UNPACK_BUFFER); + glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER); - glPixelStorei (GL_UNPACK_ROW_LENGTH, width); - glTexSubImage2D (GL_TEXTURE_2D, - 0, - 0, - 0, - width, - height, - GL_BGRA, - GL_UNSIGNED_BYTE, - BUFFER_OFFSET (0)); + glPixelStorei(GL_UNPACK_ROW_LENGTH, width); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, BUFFER_OFFSET(0)); - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, 0); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); } } else { - glPixelStorei (GL_UNPACK_ROW_LENGTH, final_pitch / image_bpp); - glTexSubImage2D (GL_TEXTURE_2D, - 0, - 0, - 0, - width, - height, - GL_RGB, - GL_UNSIGNED_SHORT_5_6_5, - final_buffer); + glPixelStorei(GL_UNPACK_ROW_LENGTH, stride_in_pixels * 2); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, buffer); } if (using_glsl_shaders) { - glsl_shader->render (texmap, width, height, r.x, allocation.height - r.y - r.h, r.w, r.h, S9xViewportCallback); - swap_buffers (); + glsl_shader->render(texmap, width, height, content.x, allocation.get_height() - content.y - content.h, content.w, content.h, S9xViewportCallback); + swap_buffers(); return; } - glDrawArrays (GL_TRIANGLE_STRIP, 0, 4); + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - swap_buffers (); + swap_buffers(); } -void *S9xOpenGLDisplayDriver::get_parameters () +void *S9xOpenGLDisplayDriver::get_parameters() { if (using_glsl_shaders && glsl_shader) { - return (void *) &glsl_shader->param; + return (void *)&glsl_shader->param; } return NULL; } -void S9xOpenGLDisplayDriver::save (const char *filename) +void S9xOpenGLDisplayDriver::save(const char *filename) { if (using_glsl_shaders && glsl_shader) { @@ -284,82 +208,65 @@ void S9xOpenGLDisplayDriver::save (const char *filename) } } -void S9xOpenGLDisplayDriver::clear_buffers () -{ - memset (buffer[0], 0, image_padded_size); - memset (buffer[1], 0, scaled_padded_size); - - glPixelStorei (GL_UNPACK_ROW_LENGTH, scaled_max_width); - glTexSubImage2D (GL_TEXTURE_2D, - 0, - 0, - 0, - MIN(scaled_max_width, texture_width), - MIN(scaled_max_height, texture_height), - GL_RGB, - GL_UNSIGNED_SHORT_5_6_5, - buffer[1]); -} - -void S9xOpenGLDisplayDriver::update_texture_size (int width, int height) +void S9xOpenGLDisplayDriver::update_texture_size(int width, int height) { if (width != texture_width || height != texture_height) { if (npot) { - glBindTexture (GL_TEXTURE_2D, texmap); + glBindTexture(GL_TEXTURE_2D, texmap); if (using_pbos && config->pbo_format == 32) { - glTexImage2D (GL_TEXTURE_2D, - 0, - GL_RGBA, - width, - height, - 0, - GL_BGRA, - GL_UNSIGNED_BYTE, - NULL); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGBA, + width, + height, + 0, + GL_BGRA, + GL_UNSIGNED_BYTE, + NULL); } else { - glTexImage2D (GL_TEXTURE_2D, - 0, - GL_RGB565, - width, - height, - 0, - GL_RGB, - GL_UNSIGNED_SHORT_5_6_5, - NULL); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB565, + width, + height, + 0, + GL_RGB, + GL_UNSIGNED_SHORT_5_6_5, + NULL); } - coords[9] = 1.0f; + coords[9] = 1.0f; coords[10] = 1.0f; coords[11] = 1.0f; coords[14] = 1.0f; } else { - coords[9] = height / 1024.0f; - coords[10] = width / 1024.0f; + coords[9] = height / 1024.0f; + coords[10] = width / 1024.0f; coords[11] = height / 1024.0f; - coords[14] = width / 1024.0f; + coords[14] = width / 1024.0f; } - texture_width = width; + texture_width = width; texture_height = height; if (!legacy) { - glBindBuffer (GL_ARRAY_BUFFER, coord_buffer); - glBufferData (GL_ARRAY_BUFFER, sizeof (GLfloat) * 16, coords, GL_STATIC_DRAW); - glBindBuffer (GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, coord_buffer); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 16, coords, GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); } else { - glVertexPointer (2, GL_FLOAT, 0, coords); - glTexCoordPointer (2, GL_FLOAT, 0, &coords[8]); + glVertexPointer(2, GL_FLOAT, 0, coords); + glTexCoordPointer(2, GL_FLOAT, 0, &coords[8]); } } } @@ -417,7 +324,7 @@ bool S9xOpenGLDisplayDriver::opengl_defaults() if (config->use_shaders) { - if (legacy || !load_shaders (config->shader_filename.c_str ())) + if (legacy || !load_shaders(config->shader_filename.c_str())) { config->use_shaders = false; } @@ -433,169 +340,171 @@ bool S9xOpenGLDisplayDriver::opengl_defaults() if (legacy) { - glEnableClientState (GL_VERTEX_ARRAY); - glEnableClientState (GL_TEXTURE_COORD_ARRAY); - glEnable (GL_TEXTURE_2D); - glMatrixMode (GL_PROJECTION); - glLoadIdentity (); - glMatrixMode (GL_MODELVIEW); - glLoadIdentity (); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnable(GL_TEXTURE_2D); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); - glVertexPointer (2, GL_FLOAT, 0, coords); - glTexCoordPointer (2, GL_FLOAT, 0, &coords[8]); + glVertexPointer(2, GL_FLOAT, 0, coords); + glTexCoordPointer(2, GL_FLOAT, 0, &coords[8]); } else { - stock_program = glCreateProgram (); + stock_program = glCreateProgram(); - GLuint vertex_shader = glCreateShader (GL_VERTEX_SHADER); - GLuint fragment_shader = glCreateShader (GL_FRAGMENT_SHADER); + GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER); + GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); if (version < 30) { - glShaderSource (vertex_shader, 1, &stock_vertex_shader_110, NULL); - glShaderSource (fragment_shader, 1, &stock_fragment_shader_110, NULL); + glShaderSource(vertex_shader, 1, &stock_vertex_shader_110, NULL); + glShaderSource(fragment_shader, 1, &stock_fragment_shader_110, NULL); } else { - glShaderSource (vertex_shader, 1, &stock_vertex_shader_140, NULL); - glShaderSource (fragment_shader, 1, &stock_fragment_shader_140, NULL); + glShaderSource(vertex_shader, 1, &stock_vertex_shader_140, NULL); + glShaderSource(fragment_shader, 1, &stock_fragment_shader_140, NULL); } - glCompileShader (vertex_shader); - glAttachShader (stock_program, vertex_shader); - glCompileShader (fragment_shader); - glAttachShader (stock_program, fragment_shader); + glCompileShader(vertex_shader); + glAttachShader(stock_program, vertex_shader); + glCompileShader(fragment_shader); + glAttachShader(stock_program, fragment_shader); - glBindAttribLocation (stock_program, 0, "in_position"); - glBindAttribLocation (stock_program, 1, "in_texcoord"); + glBindAttribLocation(stock_program, 0, "in_position"); + glBindAttribLocation(stock_program, 1, "in_texcoord"); - glLinkProgram (stock_program); - glUseProgram (stock_program); + glLinkProgram(stock_program); + glUseProgram(stock_program); - glDeleteShader (vertex_shader); - glDeleteShader (fragment_shader); + glDeleteShader(vertex_shader); + glDeleteShader(fragment_shader); - GLint texture_uniform = glGetUniformLocation (stock_program, "texmap"); - glUniform1i (texture_uniform, 0); + GLint texture_uniform = glGetUniformLocation(stock_program, "texmap"); + glUniform1i(texture_uniform, 0); if (core) { GLuint vao; - glGenVertexArrays (1, &vao); - glBindVertexArray (vao); + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); } - glGenBuffers (1, &coord_buffer); - glBindBuffer (GL_ARRAY_BUFFER, coord_buffer); - glBufferData (GL_ARRAY_BUFFER, sizeof (GLfloat) * 16, coords, GL_STATIC_DRAW); + glGenBuffers(1, &coord_buffer); + glBindBuffer(GL_ARRAY_BUFFER, coord_buffer); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 16, coords, GL_STATIC_DRAW); - glEnableVertexAttribArray (0); - glVertexAttribPointer (0, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET (0)); - glEnableVertexAttribArray (1); - glVertexAttribPointer (1, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET (32)); + glEnableVertexAttribArray(0); + glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0)); + glEnableVertexAttribArray(1); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(32)); - glBindBuffer (GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); } if (config->use_pbos) { - glGenBuffers (1, &pbo); - glGenTextures (1, &texmap); + glGenBuffers(1, &pbo); + glGenTextures(1, &texmap); - glBindTexture (GL_TEXTURE_2D, texmap); - glTexImage2D (GL_TEXTURE_2D, - 0, - config->pbo_format == 16 ? GL_RGB565 : GL_RGBA, - texture_width, - texture_height, - 0, - config->pbo_format == 16 ? GL_RGB : GL_BGRA, - config->pbo_format == 16 ? GL_UNSIGNED_SHORT_5_6_5 : GL_UNSIGNED_BYTE, - NULL); + glBindTexture(GL_TEXTURE_2D, texmap); + glTexImage2D(GL_TEXTURE_2D, + 0, + config->pbo_format == 16 ? GL_RGB565 : GL_RGBA, + texture_width, + texture_height, + 0, + config->pbo_format == 16 ? GL_RGB : GL_BGRA, + config->pbo_format == 16 ? GL_UNSIGNED_SHORT_5_6_5 : GL_UNSIGNED_BYTE, + NULL); - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, pbo); - glBufferData (GL_PIXEL_UNPACK_BUFFER, - texture_width * texture_height * 3, - NULL, - GL_STREAM_DRAW); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); + glBufferData(GL_PIXEL_UNPACK_BUFFER, + texture_width * texture_height * 3, + NULL, + GL_STREAM_DRAW); - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, 0); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); } else { - glGenTextures (1, &texmap); + glGenTextures(1, &texmap); - glBindTexture (GL_TEXTURE_2D, texmap); - glTexImage2D (GL_TEXTURE_2D, - 0, - GL_RGB565, - texture_width, - texture_height, - 0, - GL_RGB, - GL_UNSIGNED_SHORT_5_6_5, - NULL); + glBindTexture(GL_TEXTURE_2D, texmap); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB565, + texture_width, + texture_height, + 0, + GL_RGB, + GL_UNSIGNED_SHORT_5_6_5, + NULL); } - glClearColor (0.0, 0.0, 0.0, 0.0); + glClearColor(0.0, 0.0, 0.0, 0.0); return true; } -void S9xOpenGLDisplayDriver::refresh (int width, int height) +void S9xOpenGLDisplayDriver::refresh(int width, int height) { - resize (); + resize(); } -void S9xOpenGLDisplayDriver::resize () +void S9xOpenGLDisplayDriver::resize() { - context->resize (); - context->swap_interval (config->sync_to_vblank); + context->resize(); + context->swap_interval(config->sync_to_vblank); output_window_width = context->width; output_window_height = context->height; } bool S9xOpenGLDisplayDriver::create_context() { - gdk_window = gtk_widget_get_window (drawing_area); + gdk_window = drawing_area->get_window()->gobj(); + GdkDisplay *gdk_display = drawing_area->get_display()->gobj(); #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_WINDOW (gdk_window)) + if (GDK_IS_WAYLAND_WINDOW(gdk_window)) { + if (!wl.attach(GTK_WIDGET(drawing_area->gobj()))) + return false; context = &wl; } #endif #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (gdk_window)) + if (GDK_IS_X11_WINDOW(gdk_window)) { + if (!glx.attach(gdk_x11_display_get_xdisplay(gdk_display), gdk_x11_window_get_xid(gdk_window))) + return false; context = &glx; } #endif - if (!context->attach (drawing_area)) - return false; - - if (!context->create_context ()) + if (!context->create_context()) return false; output_window_width = context->width; output_window_height = context->height; - context->make_current (); + context->make_current(); legacy = false; - version = epoxy_gl_version (); + version = epoxy_gl_version(); if (version < 20) { - printf ("OpenGL version is only %d.%d. Recommended version is 2.0.\n", - version / 10, - version % 10); + printf("OpenGL version is only %d.%d. Recommended version is 2.0.\n", + version / 10, + version % 10); legacy = true; } int profile_mask = 0; - glGetIntegerv (GL_CONTEXT_PROFILE_MASK, &profile_mask); + glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &profile_mask); if (profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) core = true; else @@ -604,113 +513,79 @@ bool S9xOpenGLDisplayDriver::create_context() return true; } -int S9xOpenGLDisplayDriver::init () +int S9xOpenGLDisplayDriver::init() { initialized = false; - if (!create_context ()) + if (!create_context()) { return -1; } - if (!opengl_defaults ()) + if (!opengl_defaults()) { return -1; } - buffer[0] = new uint8_t[image_padded_size]; - buffer[1] = new uint8_t[scaled_padded_size]; - - clear_buffers (); - - padded_buffer[0] = &buffer[0][image_padded_offset]; - padded_buffer[1] = &buffer[1][scaled_padded_offset]; - - GFX.Screen = (uint16 *) padded_buffer[0]; - GFX.Pitch = image_width * image_bpp; - - context->swap_interval (config->sync_to_vblank); + context->swap_interval(config->sync_to_vblank); initialized = true; return 0; } -uint16 *S9xOpenGLDisplayDriver::get_next_buffer () +void S9xOpenGLDisplayDriver::swap_buffers() { - return (uint16 *) padded_buffer[0]; -} - -void S9xOpenGLDisplayDriver::push_buffer (uint16 *src) -{ - memmove (padded_buffer[0], src, image_size); -} - -uint16 *S9xOpenGLDisplayDriver::get_current_buffer () -{ - return (uint16 *) padded_buffer[0]; -} - -void S9xOpenGLDisplayDriver::swap_buffers () -{ - context->swap_buffers (); + context->swap_buffers(); if (config->use_glfinish && !config->use_sync_control) { - usleep (0); - glFinish (); + usleep(0); + glFinish(); } } -void S9xOpenGLDisplayDriver::deinit () +void S9xOpenGLDisplayDriver::deinit() { if (!initialized) return; if (using_glsl_shaders) { - window->enable_widget ("shader_parameters_item", false); - gtk_shader_parameters_dialog_close (); + window->enable_widget("shader_parameters_item", false); + gtk_shader_parameters_dialog_close(); glsl_shader->destroy(); delete glsl_shader; } - GFX.Screen = NULL; - - padded_buffer[0] = NULL; - padded_buffer[1] = NULL; - - delete[] buffer[0]; - delete[] buffer[1]; - if (using_pbos) { - glBindBuffer (GL_PIXEL_UNPACK_BUFFER, 0); - glDeleteBuffers (1, &pbo); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); + glDeleteBuffers(1, &pbo); } - glDeleteTextures (1, &texmap); + glDeleteTextures(1, &texmap); } -int S9xOpenGLDisplayDriver::query_availability () +int S9xOpenGLDisplayDriver::query_availability() { - GdkDisplay *gdk_display = gdk_display_get_default (); + GdkDisplay *gdk_display = gdk_display_get_default(); #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (gdk_display)) + if (GDK_IS_WAYLAND_DISPLAY(gdk_display)) { return 1; } #endif #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_DISPLAY (gdk_display)) + if (GDK_IS_X11_DISPLAY(gdk_display)) { - Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display); + Display *dpy = GDK_DISPLAY_XDISPLAY(gdk_display); - if (glXQueryExtension (dpy, NULL, NULL) == True) + if (glXQueryExtension(dpy, NULL, NULL) == True) { - return 1; + return 1; } } #endif @@ -721,7 +596,7 @@ int S9xOpenGLDisplayDriver::query_availability () return 0; } -bool S9xOpenGLDisplayDriver::is_ready () +bool S9xOpenGLDisplayDriver::is_ready() { if (context->ready()) { diff --git a/gtk/src/gtk_display_driver_opengl.h b/gtk/src/gtk_display_driver_opengl.h index 67928e4c..9a80d58f 100644 --- a/gtk/src/gtk_display_driver_opengl.h +++ b/gtk/src/gtk_display_driver_opengl.h @@ -14,7 +14,7 @@ #include "gtk_opengl_context.h" -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #ifdef GDK_WINDOWING_X11 #include "gtk_glx_context.h" #endif @@ -24,61 +24,57 @@ #include "shaders/glsl.h" -#define BUFFER_OFFSET(i) ((char *) (i)) +#define BUFFER_OFFSET(i) ((char *)(i)) class S9xOpenGLDisplayDriver : public S9xDisplayDriver { - public: - S9xOpenGLDisplayDriver (Snes9xWindow *window, Snes9xConfig *config); - void refresh (int width, int height); - int init (); - void deinit (); - void clear_buffers (); - void update (int width, int height, int yoffset); - uint16 *get_next_buffer (); - uint16 *get_current_buffer (); - void push_buffer (uint16 *src); - void *get_parameters (); - void save (const char *filename); - static int query_availability (); - bool is_ready (); + public: + S9xOpenGLDisplayDriver(Snes9xWindow *window, Snes9xConfig *config); + void refresh(int width, int height); + int init(); + void deinit(); + void update(uint16_t *buffer, int width, int height, int stride_in_pixels); + void *get_parameters(); + void save(const char *filename); + static int query_availability(); + bool is_ready(); - private: - bool opengl_defaults (); - void swap_buffers (); - bool load_shaders (const char *); - void update_texture_size (int width, int height); - bool create_context (); - void resize (); + private: + bool opengl_defaults(); + void swap_buffers(); + bool load_shaders(const char *); + void update_texture_size(int width, int height); + bool create_context(); + void resize(); - GLuint stock_program; - GLuint coord_buffer; - GLint texture_width; - GLint texture_height; - GLuint texmap; - GLuint pbo; + GLuint stock_program; + GLuint coord_buffer; + GLint texture_width; + GLint texture_height; + GLuint texmap; + GLuint pbo; - bool legacy; - bool core; - int version; - bool npot; - bool using_pbos; - bool initialized; + bool legacy; + bool core; + int version; + bool npot; + bool using_pbos; + bool initialized; - bool using_glsl_shaders; - GLSLShader *glsl_shader; + bool using_glsl_shaders; + GLSLShader *glsl_shader; - GdkWindow *gdk_window; - int output_window_width; - int output_window_height; + GdkWindow *gdk_window; + int output_window_width; + int output_window_height; - OpenGLContext *context; + OpenGLContext *context; #ifdef GDK_WINDOWING_X11 - GTKGLXContext glx; + GTKGLXContext glx; #endif #ifdef GDK_WINDOWING_WAYLAND - WaylandEGLContext wl; + WaylandEGLContext wl; #endif }; diff --git a/gtk/src/gtk_display_driver_xv.cpp b/gtk/src/gtk_display_driver_xv.cpp index ca9da835..674811e8 100644 --- a/gtk/src/gtk_display_driver_xv.cpp +++ b/gtk/src/gtk_display_driver_xv.cpp @@ -4,7 +4,7 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include #include #include @@ -14,43 +14,43 @@ #include "gtk_display.h" #include "gtk_display_driver_xv.h" -static int -get_inv_shift (uint32 mask, int bpp) +static int get_inv_shift(uint32 mask, int bpp) { int i; /* Find mask */ - for (i = 0; (i < bpp) && !(mask & (1 << i)); i++) {}; + for (i = 0; (i < bpp) && !(mask & (1 << i)); i++) + { + }; /* Find start of mask */ - for (; (i < bpp) && (mask & (1 << i)); i++) {}; + for (; (i < bpp) && (mask & (1 << i)); i++) + { + }; return (bpp - i); } -S9xXVDisplayDriver::S9xXVDisplayDriver (Snes9xWindow *window, - Snes9xConfig *config) +S9xXVDisplayDriver::S9xXVDisplayDriver(Snes9xWindow *window, Snes9xConfig *config) { this->window = window; this->config = config; - this->drawing_area = GTK_WIDGET (window->drawing_area); - display = - gdk_x11_display_get_xdisplay (gtk_widget_get_display (drawing_area)); - last_known_width = last_known_height = -1; + this->drawing_area = window->drawing_area; + display = gdk_x11_display_get_xdisplay(drawing_area->get_display()->gobj()); + last_known_width = -1; + last_known_height = -1; } -void -S9xXVDisplayDriver::resize_window (int width, int height) +void S9xXVDisplayDriver::resize_window(int width, int height) { - gdk_window_destroy (gdk_window); - create_window (width, height); + gdk_window_destroy(gdk_window); + create_window(width, height); } -void -S9xXVDisplayDriver::create_window (int width, int height) +void S9xXVDisplayDriver::create_window(int width, int height) { GdkWindowAttr window_attr; - memset (&window_attr, 0, sizeof (GdkWindowAttr)); + memset(&window_attr, 0, sizeof(GdkWindowAttr)); window_attr.event_mask = GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK; window_attr.width = width; window_attr.height = height; @@ -58,95 +58,64 @@ S9xXVDisplayDriver::create_window (int width, int height) window_attr.y = 0; window_attr.wclass = GDK_INPUT_OUTPUT; window_attr.window_type = GDK_WINDOW_CHILD; - window_attr.visual = gdk_x11_screen_lookup_visual (gtk_widget_get_screen (drawing_area), vi->visualid); + window_attr.visual = gdk_x11_screen_lookup_visual(drawing_area->get_screen()->gobj(), vi->visualid); - gdk_window = gdk_window_new (gtk_widget_get_window (drawing_area), - &window_attr, - GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL); - gdk_window_set_user_data (gdk_window, (gpointer) drawing_area); + gdk_window = gdk_window_new(drawing_area->get_window()->gobj(), + &window_attr, + GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL); - gdk_window_show (gdk_window); - xwindow = gdk_x11_window_get_xid (gdk_window); + gdk_window_set_user_data(gdk_window, (gpointer)drawing_area->gobj()); + + gdk_window_show(gdk_window); + xwindow = gdk_x11_window_get_xid(gdk_window); output_window_width = width; output_window_height = height; } -void -S9xXVDisplayDriver::update (int width, int height, int yoffset) +void S9xXVDisplayDriver::update(uint16_t *buffer, int width, int height, int stride_in_pixels) { - int current_width, current_height, final_pitch; - uint8 *final_buffer; - GtkAllocation allocation; + int current_width, current_height; - gtk_widget_get_allocation (drawing_area, &allocation); + auto allocation = drawing_area->get_allocation(); - if (output_window_width != allocation.width || - output_window_height != allocation.height) + if (output_window_width != allocation.get_width() || + output_window_height != allocation.get_height()) { - resize_window (allocation.width, allocation.height); + resize_window(allocation.get_width(), allocation.get_height()); } -#if GTK_CHECK_VERSION(3,10,0) - int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); + int scale_factor = drawing_area->get_scale_factor(); - allocation.width *= gdk_scale_factor; - allocation.height *= gdk_scale_factor; + allocation.set_width(allocation.get_width() * scale_factor); + allocation.set_height(allocation.get_height() * scale_factor); -#endif + current_width = allocation.get_width(); + current_height = allocation.get_height(); - current_width = allocation.width; - current_height = allocation.height; - - if (config->scale_method > 0) - { - uint8 *src_buffer = (uint8 *) padded_buffer[0]; - uint8 *dst_buffer = (uint8 *) padded_buffer[1]; - int src_pitch = image_width * image_bpp; - int dst_pitch = scaled_max_width * image_bpp; - - src_buffer += (src_pitch * yoffset); - - S9xFilter (src_buffer, - src_pitch, - dst_buffer, - dst_pitch, - width, - height); - - final_buffer = (uint8 *) padded_buffer[1]; - final_pitch = dst_pitch; - } - else - { - final_buffer = (uint8 *) padded_buffer[0]; - final_pitch = image_width * image_bpp; - final_buffer += (final_pitch * yoffset); - } - - update_image_size (width, height); + update_image_size(width, height); if (format == FOURCC_YUY2) { - S9xConvertYUV (final_buffer, - (uint8 *) xv_image->data, - final_pitch, - 2 * xv_image->width, - width + (width < xv_image->width ? (width % 2) + 4 : 0), - height + (height < xv_image->height ? 4 : 0)); + S9xConvertYUV(buffer, + (uint8 *)xv_image->data, + stride_in_pixels * 2, + 2 * xv_image->width, + width + (width < xv_image->width ? (width % 2) + 4 : 0), + height + (height < xv_image->height ? 4 : 0)); } else { - S9xConvertMask (final_buffer, - (uint8 *) xv_image->data, - final_pitch, - bytes_per_pixel * xv_image->width, - width + (width < xv_image->width ? (width % 2) + 4 : 0), - height + (height < xv_image->height ? 4 : 0), - rshift, - gshift, - bshift, - bpp); + S9xConvertMask(buffer, + (uint8 *)xv_image->data, + stride_in_pixels * 2, + bytes_per_pixel * xv_image->width, + width + (width < xv_image->width ? (width % 2) + 4 : 0), + height + (height < xv_image->height ? 4 : 0), + rshift, + gshift, + bshift, + bpp); } S9xRect dst = S9xApplyAspect(width, height, current_width, current_height); @@ -155,60 +124,59 @@ S9xXVDisplayDriver::update (int width, int height, int yoffset) { last_known_width = dst.w; last_known_height = dst.h; - clear (); + clear(); } - XvShmPutImage (display, - xv_portid, - xwindow, - XDefaultGC (display, XDefaultScreen (display)), - xv_image, - 0, - 0, - width, - height, - dst.x, - dst.y, - dst.w, - dst.h, - False); + XvShmPutImage(display, + xv_portid, + xwindow, + XDefaultGC(display, XDefaultScreen(display)), + xv_image, + 0, + 0, + width, + height, + dst.x, + dst.y, + dst.w, + dst.h, + False); - top_level->set_mouseable_area (dst.x, dst.y, dst.w, dst.h); + top_level->set_mouseable_area(dst.x, dst.y, dst.w, dst.h); - XSync (display, False); + XSync(display, False); } -void -S9xXVDisplayDriver::update_image_size (int width, int height) +void S9xXVDisplayDriver::update_image_size(int width, int height) { - if (desired_width != width || desired_height != height) + if (xv_image_width != width || xv_image_height != height) { - XShmDetach (display, &shm); - XSync (display, 0); + XShmDetach(display, &shm); + XSync(display, 0); - shmctl (shm.shmid, IPC_RMID, 0); - shmdt (shm.shmaddr); + shmctl(shm.shmid, IPC_RMID, 0); + shmdt(shm.shmaddr); - xv_image = XvShmCreateImage (display, - xv_portid, - format, - 0, - width, - height, - &shm); + xv_image = XvShmCreateImage(display, + xv_portid, + format, + 0, + width, + height, + &shm); - shm.shmid = shmget (IPC_PRIVATE, xv_image->data_size, IPC_CREAT | 0777); + shm.shmid = shmget(IPC_PRIVATE, xv_image->data_size, IPC_CREAT | 0777); for (int tries = 0; tries <= 10; tries++) { - shm.shmaddr = (char *) shmat (shm.shmid, 0, 0); + shm.shmaddr = (char *)shmat(shm.shmid, 0, 0); - if (shm.shmaddr == (void *) -1 && tries >= 10) + if (shm.shmaddr == (void *)-1 && tries >= 10) { /* Can't recover, send exit. */ - fprintf (stderr, "Couldn't reallocate shared memory.\n"); - S9xExit (); + fprintf(stderr, "Couldn't reallocate shared memory.\n"); + exit(1); } - else if (shm.shmaddr != (void *) -1) + else if (shm.shmaddr != (void *)-1) { break; } @@ -218,50 +186,48 @@ S9xXVDisplayDriver::update_image_size (int width, int height) xv_image->data = shm.shmaddr; - XShmAttach (display, &shm); + XShmAttach(display, &shm); - desired_width = width; - desired_height = height; + xv_image_width = width; + xv_image_height = height; } } -int -S9xXVDisplayDriver::init () +int S9xXVDisplayDriver::init() { - int depth = 0, num_formats, num_attrs, highest_formats = 0; + int depth = 0, num_formats, num_attrs, highest_formats = 0; XvImageFormatValues *formats = NULL; - XvAdaptorInfo *adaptors; - XvAttribute *port_attr; - VisualID visualid = None; - unsigned int num_adaptors = 0; - GdkScreen *screen; - GdkWindow *root; + XvAdaptorInfo *adaptors; + XvAttribute *port_attr; + VisualID visualid = None; + unsigned int num_adaptors = 0; + GdkScreen *screen; + GdkWindow *root; /* Setup XV */ - gtk_widget_realize (drawing_area); + gtk_widget_realize(GTK_WIDGET(drawing_area->gobj())); - display = gdk_x11_display_get_xdisplay (gtk_widget_get_display (drawing_area)); - screen = gtk_widget_get_screen (drawing_area); - root = gdk_screen_get_root_window (screen); + display = gdk_x11_display_get_xdisplay(drawing_area->get_display()->gobj()); + screen = drawing_area->get_screen()->gobj(); + root = gdk_screen_get_root_window(screen); xv_portid = -1; - if ((XvQueryAdaptors (display, - gdk_x11_window_get_xid (root), - &num_adaptors, - &adaptors)) != Success) + if ((XvQueryAdaptors(display, + gdk_x11_window_get_xid(root), + &num_adaptors, + &adaptors)) != Success) { - fprintf (stderr, "No Xv compatible adaptors.\n"); + fprintf(stderr, "No Xv compatible adaptors.\n"); } - - for (int i = 0; i < (int) num_adaptors; i++) + for (int i = 0; i < (int)num_adaptors; i++) { if (adaptors[i].type & XvInputMask && adaptors[i].type & XvImageMask) { - formats = XvListImageFormats (display, - adaptors[i].base_id, - &num_formats); + formats = XvListImageFormats(display, + adaptors[i].base_id, + &num_formats); if (num_formats > highest_formats) { @@ -270,30 +236,30 @@ S9xXVDisplayDriver::init () visualid = adaptors[i].formats->visual_id; } - free (formats); + free(formats); } } - XvFreeAdaptorInfo (adaptors); + XvFreeAdaptorInfo(adaptors); if (xv_portid < 0) { - fprintf (stderr, "Could not open Xv output port.\n"); + fprintf(stderr, "Could not open Xv output port.\n"); return -1; } /* Set XV_AUTOPAINT_COLORKEY _only_ if available */ - port_attr = XvQueryPortAttributes (display, xv_portid, &num_attrs); + port_attr = XvQueryPortAttributes(display, xv_portid, &num_attrs); for (int i = 0; i < num_attrs; i++) { - if (!strcmp (port_attr[i].name, "XV_AUTOPAINT_COLORKEY")) + if (!strcmp(port_attr[i].name, "XV_AUTOPAINT_COLORKEY")) { Atom colorkey; - colorkey = XInternAtom (display, "XV_AUTOPAINT_COLORKEY", True); + colorkey = XInternAtom(display, "XV_AUTOPAINT_COLORKEY", True); if (colorkey != None) - XvSetPortAttribute (display, xv_portid, colorkey, 1); + XvSetPortAttribute(display, xv_portid, colorkey, 1); } } @@ -301,9 +267,9 @@ S9xXVDisplayDriver::init () format = -1; bpp = 100; - formats = XvListImageFormats (display, - xv_portid, - &num_formats); + formats = XvListImageFormats(display, + xv_portid, + &num_formats); for (int i = 0; i < num_formats; i++) { @@ -316,12 +282,12 @@ S9xXVDisplayDriver::init () bytes_per_pixel = (bpp == 15) ? 2 : bpp >> 3; depth = formats[i].depth; - this->rshift = get_inv_shift (formats[i].red_mask, bpp); - this->gshift = get_inv_shift (formats[i].green_mask, bpp); - this->bshift = get_inv_shift (formats[i].blue_mask, bpp); + this->rshift = get_inv_shift(formats[i].red_mask, bpp); + this->gshift = get_inv_shift(formats[i].green_mask, bpp); + this->bshift = get_inv_shift(formats[i].blue_mask, bpp); /* Check for red-blue inversion on SiliconMotion drivers */ - if (formats[i].red_mask == 0x001f && + if (formats[i].red_mask == 0x001f && formats[i].blue_mask == 0x7c00) { int copy = this->rshift; @@ -331,9 +297,9 @@ S9xXVDisplayDriver::init () /* on big-endian Xv still seems to like LSB order */ if (config->force_inverted_byte_order) - S9xSetEndianess (ENDIAN_SWAPPED); + S9xSetEndianess(ENDIAN_SWAPPED); else - S9xSetEndianess (ENDIAN_NORMAL); + S9xSetEndianess(ENDIAN_NORMAL); } } } @@ -350,16 +316,16 @@ S9xXVDisplayDriver::init () if (formats[i].byte_order == LSBFirst) { if (config->force_inverted_byte_order) - S9xSetEndianess (ENDIAN_SWAPPED); + S9xSetEndianess(ENDIAN_SWAPPED); else - S9xSetEndianess (ENDIAN_NORMAL); + S9xSetEndianess(ENDIAN_NORMAL); } else { if (config->force_inverted_byte_order) - S9xSetEndianess (ENDIAN_NORMAL); + S9xSetEndianess(ENDIAN_NORMAL); else - S9xSetEndianess (ENDIAN_SWAPPED); + S9xSetEndianess(ENDIAN_SWAPPED); } break; @@ -367,11 +333,11 @@ S9xXVDisplayDriver::init () } } - free (formats); + free(formats); if (format == -1) { - fprintf (stderr, "No compatible formats found for Xv.\n"); + fprintf(stderr, "No compatible formats found for Xv.\n"); return -1; } @@ -384,19 +350,19 @@ S9xXVDisplayDriver::init () int y, u, v; r = ((color & 0xf800) >> 8) | ((color >> 13) & 0x7); - g = ((color & 0x07e0) >> 3) | ((color >> 9 ) & 0x3); - b = ((color & 0x001F) << 3) | ((color >> 3 ) & 0x7); + g = ((color & 0x07e0) >> 3) | ((color >> 9) & 0x3); + b = ((color & 0x001F) << 3) | ((color >> 3) & 0x7); - y = (int) ((0.257 * ((double) r)) + (0.504 * ((double) g)) + (0.098 * ((double) b)) + 16.0); - u = (int) ((-0.148 * ((double) r)) + (-0.291 * ((double) g)) + (0.439 * ((double) b)) + 128.0); - v = (int) ((0.439 * ((double) r)) + (-0.368 * ((double) g)) + (-0.071 * ((double) b)) + 128.0); + y = (int)((0.257 * ((double)r)) + (0.504 * ((double)g)) + (0.098 * ((double)b)) + 16.0); + u = (int)((-0.148 * ((double)r)) + (-0.291 * ((double)g)) + (0.439 * ((double)b)) + 128.0); + v = (int)((0.439 * ((double)r)) + (-0.368 * ((double)g)) + (-0.071 * ((double)b)) + 128.0); - y_table[color] = CLAMP (y, 0, 255); - u_table[color] = CLAMP (u, 0, 255); - v_table[color] = CLAMP (v, 0, 255); + y_table[color] = CLAMP(y, 0, 255); + u_table[color] = CLAMP(u, 0, 255); + v_table[color] = CLAMP(v, 0, 255); } - S9xRegisterYUVTables (y_table, u_table, v_table); + S9xRegisterYUVTables(y_table, u_table, v_table); } /* Create a sub-window */ @@ -406,42 +372,42 @@ S9xXVDisplayDriver::init () vi_template.visualid = visualid; vi_template.depth = depth; vi_template.visual = NULL; - vi = XGetVisualInfo (display, VisualIDMask | VisualDepthMask, &vi_template, &vi_num_items); + vi = XGetVisualInfo(display, VisualIDMask | VisualDepthMask, &vi_template, &vi_num_items); if (!vi) { vi_template.depth = 0; - vi = XGetVisualInfo (display, VisualIDMask, &vi_template, &vi_num_items); + vi = XGetVisualInfo(display, VisualIDMask, &vi_template, &vi_num_items); if (!vi) { - fprintf (stderr, "Couldn't map visual.\n"); + fprintf(stderr, "Couldn't map visual.\n"); return -1; } } - xcolormap = XCreateColormap (display, - gdk_x11_window_get_xid (gtk_widget_get_window (drawing_area)), + xcolormap = XCreateColormap(display, + gdk_x11_window_get_xid(drawing_area->get_window()->gobj()), vi->visual, AllocNone); - create_window (1, 1); - gdk_window_hide (gdk_window); + create_window(1, 1); + gdk_window_hide(gdk_window); /* Allocate a shared memory image. */ - xv_image = XvShmCreateImage (display, - xv_portid, - format, - 0, - scaled_max_width, - scaled_max_width, - &shm); + xv_image = XvShmCreateImage(display, + xv_portid, + format, + 0, + 512, + 512, + &shm); - shm.shmid = shmget (IPC_PRIVATE, xv_image->data_size, IPC_CREAT | 0777); - shm.shmaddr = (char *) shmat (shm.shmid, 0, 0); - if (shm.shmaddr == (void *) -1) + shm.shmid = shmget(IPC_PRIVATE, xv_image->data_size, IPC_CREAT | 0777); + shm.shmaddr = (char *)shmat(shm.shmid, 0, 0); + if (shm.shmaddr == (void *)-1) { - fprintf (stderr, "Could not attach shared memory segment.\n"); + fprintf(stderr, "Could not attach shared memory segment.\n"); return -1; } @@ -449,71 +415,38 @@ S9xXVDisplayDriver::init () xv_image->data = shm.shmaddr; - XShmAttach (display, &shm); + XShmAttach(display, &shm); - desired_width = scaled_max_width; - desired_height = scaled_max_width; - - buffer[0] = new uint8_t[image_padded_size]; - buffer[1] = new uint8_t[scaled_padded_size]; - - padded_buffer[0] = &buffer[0][image_padded_offset]; - padded_buffer[1] = &buffer[1][scaled_padded_offset]; - - memset (buffer[0], 0, image_padded_size); - memset (buffer[1], 0, scaled_padded_size); - - clear_buffers (); - - /* Give Snes9x core a pointer to draw on */ - GFX.Screen = (uint16 *) padded_buffer[0]; - GFX.Pitch = image_width * image_bpp; + xv_image_width = 512; + xv_image_height = 512; return 0; } -void -S9xXVDisplayDriver::deinit () +void S9xXVDisplayDriver::deinit() { - gdk_window_destroy (gdk_window); + gdk_window_destroy(gdk_window); - XShmDetach (display, &shm); - XSync (display, 0); + XShmDetach(display, &shm); + XSync(display, 0); - XFreeColormap (display, xcolormap); - XFree (vi); + XFreeColormap(display, xcolormap); + XFree(vi); - delete[] buffer[0]; - delete[] buffer[1]; - - shmctl (shm.shmid, IPC_RMID, 0); - shmdt (shm.shmaddr); - - padded_buffer[0] = NULL; - padded_buffer[1] = NULL; + shmctl(shm.shmid, IPC_RMID, 0); + shmdt(shm.shmaddr); } -void -S9xXVDisplayDriver::clear () +void S9xXVDisplayDriver::clear() { - int width, height; - GtkAllocation allocation; - GC xgc = XDefaultGC (display, XDefaultScreen (display)); + GC xgc = XDefaultGC(display, XDefaultScreen(display)); - gtk_widget_get_allocation (drawing_area, &allocation); -#if GTK_CHECK_VERSION(3,10,0) - int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); - - allocation.width *= gdk_scale_factor; - allocation.height *= gdk_scale_factor; - -#endif - width = allocation.width; - height = allocation.height; + int width = drawing_area->get_width() * drawing_area->get_scale_factor(); + int height = drawing_area->get_height() * drawing_area->get_scale_factor(); if (window->last_width <= 0 || window->last_height <= 0) { - XDrawRectangle (display, xwindow, xgc, 0, 0, width, height); + XDrawRectangle(display, xwindow, xgc, 0, 0, width, height); return; } @@ -521,107 +454,58 @@ S9xXVDisplayDriver::clear () S9xRect dst; dst.w = window->last_width; dst.h = window->last_height; - get_filter_scale (dst.w, dst.h); - dst = S9xApplyAspect (dst.w, dst.h, width, height); + get_filter_scale(dst.w, dst.h); + dst = S9xApplyAspect(dst.w, dst.h, width, height); if (dst.x > 0) { - XFillRectangle (display, xwindow, xgc, 0, dst.y, dst.x, dst.h); + XFillRectangle(display, xwindow, xgc, 0, dst.y, dst.x, dst.h); } if (dst.x + dst.w < width) { - XFillRectangle (display, xwindow, xgc, dst.x + dst.w, dst.y, width - (dst.x + dst.w), dst.h); + XFillRectangle(display, xwindow, xgc, dst.x + dst.w, dst.y, width - (dst.x + dst.w), dst.h); } if (dst.y > 0) { - XFillRectangle (display, xwindow, xgc, 0, 0, width, dst.y); + XFillRectangle(display, xwindow, xgc, 0, 0, width, dst.y); } if (dst.y + dst.h < height) { - XFillRectangle (display, xwindow, xgc, 0, dst.y + dst.h, width, height - (dst.y + dst.h)); + XFillRectangle(display, xwindow, xgc, 0, dst.y + dst.h, width, height - (dst.y + dst.h)); } - XSync (display, False); + XSync(display, False); } -void -S9xXVDisplayDriver::refresh (int width, int height) +void S9xXVDisplayDriver::refresh(int width, int height) { - clear (); + clear(); } -uint16 * -S9xXVDisplayDriver::get_next_buffer () -{ - return (uint16 *) padded_buffer[0]; -} - -uint16 * -S9xXVDisplayDriver::get_current_buffer () -{ - return get_next_buffer (); -} - -void -S9xXVDisplayDriver::push_buffer (uint16 *src) -{ - memmove (GFX.Screen, src, image_size * image_bpp); -} - -void -S9xXVDisplayDriver::clear_buffers () -{ - uint32 black; - uint8 *color; - - memset (buffer[0], 0, image_padded_size); - memset (buffer[1], 0, scaled_padded_size); - - /* Construct value byte-order independently */ - if (format == FOURCC_YUY2) - { - color = (uint8 *) &black; - *color++ = y_table[0]; - *color++ = u_table[0]; - *color++ = y_table[0]; - *color++ = v_table[0]; - - for (int i = 0; i < xv_image->data_size >> 2; i++) - { - *(((uint32 *) xv_image->data) + i) = black; - } - } - else - { - memset (xv_image->data, 0, xv_image->data_size); - } -} - -int -S9xXVDisplayDriver::query_availability () +int S9xXVDisplayDriver::query_availability() { unsigned int p_version, - p_release, - p_request_base, - p_event_base, - p_error_base; - Display *display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); + p_release, + p_request_base, + p_event_base, + p_error_base; + Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); if (!display) return 0; /* Test if XV and SHM are feasible */ - if (!XShmQueryExtension (display)) + if (!XShmQueryExtension(display)) { return 0; } - if (XvQueryExtension (display, - &p_version, - &p_release, - &p_request_base, - &p_event_base, - &p_error_base) != Success) + if (XvQueryExtension(display, + &p_version, + &p_release, + &p_request_base, + &p_event_base, + &p_error_base) != Success) { return 0; } diff --git a/gtk/src/gtk_display_driver_xv.h b/gtk/src/gtk_display_driver_xv.h index 5660ee82..5dd84241 100644 --- a/gtk/src/gtk_display_driver_xv.h +++ b/gtk/src/gtk_display_driver_xv.h @@ -7,63 +7,67 @@ #ifndef __GTK_DISPLAY_DRIVER_XV_H #define __GTK_DISPLAY_DRIVER_XV_H +#include "gtk_s9x.h" +#include "gtk_display_driver.h" + #include #include #include #include -#include "gtk_s9x.h" -#include "gtk_display_driver.h" - const uint32 FOURCC_YUY2 = 0x32595559; class S9xXVDisplayDriver : public S9xDisplayDriver { - public: - S9xXVDisplayDriver (Snes9xWindow *window, Snes9xConfig *config); - void refresh (int width, int height); - int init (); - void deinit (); - void clear_buffers (); - void update (int width, int height, int yoffset); - uint16 *get_next_buffer (); - uint16 *get_current_buffer (); - void push_buffer (uint16 *src); - void *get_parameters () { return NULL; } - void save (const char *filename) { } - static int query_availability (); - bool is_ready () { return true; } + public: + S9xXVDisplayDriver(Snes9xWindow *window, Snes9xConfig *config); + void refresh(int width, int height); + int init(); + void deinit(); + void update(uint16_t *buffer, int width, int height, int stride_in_pixels); + void *get_parameters() + { + return NULL; + } + void save(const char *filename) + { + } + static int query_availability(); + bool is_ready() + { + return true; + } - private: - void clear (); - void update_image_size (int width, int height); - void resize_window (int width, int height); - void create_window (int width, int height); + private: + void clear(); + void update_image_size(int width, int height); + void resize_window(int width, int height); + void create_window(int width, int height); - Display *display; - Window xwindow; - Colormap xcolormap; - XVisualInfo *vi; - GdkWindow *gdk_window; + Display *display; + Window xwindow; + Colormap xcolormap; + XVisualInfo *vi; + GdkWindow *gdk_window; - XvImage *xv_image; - int xv_portid; - XShmSegmentInfo shm; + XvImage *xv_image; + int xv_portid; + XShmSegmentInfo shm; - int output_window_width; - int output_window_height; - int last_known_width; - int last_known_height; - int desired_width; - int desired_height; - int format; - int bpp; - int bytes_per_pixel; - int rshift, gshift, bshift; + int output_window_width; + int output_window_height; + int last_known_width; + int last_known_height; + int xv_image_width; + int xv_image_height; + int format; + int bpp; + int bytes_per_pixel; + int rshift, gshift, bshift; - uint8 y_table[65536]; - uint8 u_table[65536]; - uint8 v_table[65536]; + uint8 y_table[65536]; + uint8 u_table[65536]; + uint8 v_table[65536]; }; #endif /* __GTK_DISPLAY_DRIVER_XV_H */ diff --git a/gtk/src/gtk_file.cpp b/gtk/src/gtk_file.cpp index d458acfd..d5ea8e76 100644 --- a/gtk/src/gtk_file.cpp +++ b/gtk/src/gtk_file.cpp @@ -7,165 +7,71 @@ #include #include -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include "gtk_s9x.h" +#include "display.h" +#include "memmap.h" +#include "snapshot.h" +#include "cheats.h" static char buf[PATH_MAX]; -const char * -S9xChooseMovieFilename (bool8 read_only) +const char *S9xGetFilenameInc(const char *e, enum s9x_getdirtype dirtype) { - static char path[PATH_MAX]; - - if (!gui_config->rom_loaded) - return ""; - - const char *str = top_level->open_movie_dialog (read_only); - strcpy (path, str); - - return path; -} - -const char * -S9xChooseFilename (bool8 read_only) -{ - return ""; -} - -/* _splitpath/_makepath: Modified from unix.cpp. See file for credits. */ -#ifndef SLASH_CHAR -#define SLASH_CHAR '/' -#endif - -void -_splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) -{ - char *slash = strrchr ((char *) path, SLASH_CHAR); - char *dot = strrchr ((char *) path, '.'); - - *drive = '\0'; - - if (dot && slash && dot < slash) - { - dot = 0; - } - - if (!slash) - { - *dir = '\0'; - strcpy (fname, path); - - if (dot) - { - fname[dot - path] = '\0'; - strcpy (ext, dot + 1); - } - else - { - *ext = '\0'; - } - } - else - { - strcpy (dir, path); - dir[slash - path] = '\0'; - strcpy (fname, slash + 1); - - if (dot) - { - fname[(dot - slash) - 1] = '\0'; - strcpy (ext, dot + 1); - } - else - { - *ext = '\0'; - } - } -} - -void -_makepath (char *path, - const char *drive, - const char *dir, - const char *fname, - const char *ext) -{ - if (dir && *dir) - { - strcpy (path, dir); - strcat (path, "/"); - } - else - *path = '\0'; - - strcat (path, fname); - - if (ext && *ext) - { - strcat (path, "."); - strcat (path, ext); - } -} - -const char * -S9xGetFilenameInc (const char *e, enum s9x_getdirtype dirtype) -{ - static char filename[PATH_MAX + 1]; - char dir[_MAX_DIR + 1]; - char drive[_MAX_DRIVE + 1]; - char fname[_MAX_FNAME + 1]; - char ext[_MAX_EXT + 1]; + static char filename[PATH_MAX + 1]; + char dir[_MAX_DIR + 1]; + char drive[_MAX_DRIVE + 1]; + char fname[_MAX_FNAME + 1]; + char ext[_MAX_EXT + 1]; unsigned int i = 0; - struct stat buf; - const char *d; + struct stat buf; + const char *d; - _splitpath (Memory.ROMFilename, drive, dir, fname, ext); - d = S9xGetDirectory (dirtype); + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + d = S9xGetDirectory(dirtype); do { - snprintf (filename, PATH_MAX, "%s" SLASH_STR "%s%03d%s", d, fname, i, e); + snprintf(filename, PATH_MAX, "%s" SLASH_STR "%s%03d%s", d, fname, i, e); i++; - } - while (stat (filename, &buf) == 0 && i != 0); /* Overflow? ...riiight :-) */ + } while (stat(filename, &buf) == 0 && i != 0); /* Overflow? ...riiight :-) */ return (filename); } -const char * -S9xGetDirectory (enum s9x_getdirtype dirtype) +const char *S9xGetDirectory(enum s9x_getdirtype dirtype) { static char path[PATH_MAX + 1]; switch (dirtype) { - case HOME_DIR: - sstrncpy (path, get_config_dir ().c_str (), PATH_MAX + 1); - break; + case HOME_DIR: + snprintf(path, PATH_MAX + 1, "%s", get_config_dir().c_str()); + break; - case SNAPSHOT_DIR: - sstrncpy (path, gui_config->savestate_directory.c_str (), PATH_MAX + 1); - break; + case SNAPSHOT_DIR: + snprintf(path, PATH_MAX + 1, "%s", gui_config->savestate_directory.c_str()); + break; - case PATCH_DIR: - sstrncpy (path, gui_config->patch_directory.c_str (), PATH_MAX + 1); - break; + case PATCH_DIR: + snprintf(path, PATH_MAX + 1, "%s", gui_config->patch_directory.c_str()); + break; - case CHEAT_DIR: - sstrncpy (path, gui_config->cheat_directory.c_str (), PATH_MAX + 1); - break; + case CHEAT_DIR: + snprintf(path, PATH_MAX + 1, "%s", gui_config->cheat_directory.c_str()); + break; - case SRAM_DIR: - sstrncpy (path, gui_config->sram_directory.c_str (), PATH_MAX + 1); - break; + case SRAM_DIR: + snprintf(path, PATH_MAX + 1, "%s", gui_config->sram_directory.c_str()); + break; - case SCREENSHOT_DIR: - case SPC_DIR: - sstrncpy (path, gui_config->export_directory.c_str (), PATH_MAX + 1); - break; + case SCREENSHOT_DIR: + case SPC_DIR: + snprintf(path, PATH_MAX + 1, "%s", gui_config->export_directory.c_str()); + break; - default: - path[0] = '\0'; + default: + path[0] = '\0'; } /* Check if directory exists, make it and/or set correct permissions */ @@ -187,15 +93,15 @@ S9xGetDirectory (enum s9x_getdirtype dirtype) { char *loc; - strcpy (path, Memory.ROMFilename); + strcpy(path, Memory.ROMFilename); - loc = strrchr (path, SLASH_CHAR); + loc = strrchr(path, SLASH_CHAR); if (loc == NULL) { - if (getcwd (path, PATH_MAX + 1) == NULL) + if (getcwd(path, PATH_MAX + 1) == NULL) { - strcpy (path, getenv ("HOME")); + strcpy(path, getenv("HOME")); } } else @@ -207,279 +113,197 @@ S9xGetDirectory (enum s9x_getdirtype dirtype) return path; } -const char * -S9xGetFilename (const char *ex, enum s9x_getdirtype dirtype) +const char *S9xGetFilename(const char *ex, enum s9x_getdirtype dirtype) { static char filename[PATH_MAX + 1]; - char dir[_MAX_DIR + 1]; - char drive[_MAX_DRIVE + 1]; - char fname[_MAX_FNAME + 1]; - char ext[_MAX_EXT + 1]; + char dir[_MAX_DIR + 1]; + char drive[_MAX_DRIVE + 1]; + char fname[_MAX_FNAME + 1]; + char ext[_MAX_EXT + 1]; - _splitpath (Memory.ROMFilename, drive, dir, fname, ext); + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf (filename, sizeof (filename), "%s" SLASH_STR "%s%s", - S9xGetDirectory (dirtype), fname, ex); + snprintf(filename, sizeof(filename), "%s" SLASH_STR "%s%s", + S9xGetDirectory(dirtype), fname, ex); return (filename); } -const char * -S9xBasename (const char *f) +const char *S9xBasename(const char *f) { const char *p; - if ((p = strrchr (f, '/')) != NULL || (p = strrchr (f, '\\')) != NULL) + if ((p = strrchr(f, '/')) != NULL || (p = strrchr(f, '\\')) != NULL) return (p + 1); return f; } -const char * -S9xBasenameNoExt (const char *f) +const char *S9xBasenameNoExt(const char *f) { static char filename[PATH_MAX]; const char *base, *ext; - if (!(base = strrchr (f, SLASH_CHAR))) + if (!(base = strrchr(f, SLASH_CHAR))) base = f; else base += 1; - ext = strrchr (f, '.'); + ext = strrchr(f, '.'); if (!ext) - sstrncpy (filename, base, PATH_MAX); + snprintf(filename, PATH_MAX, "%s", base); else { int len = ext - base; - strncpy (filename, base, len); + strncpy(filename, base, len); filename[len] = '\0'; } return filename; } -static int -file_exists (const char *name) +static int file_exists(const char *name) { FILE *f = NULL; - f = fopen (name, "r"); + f = fopen(name, "r"); if (!f) return 0; else { - fclose (f); + fclose(f); return 1; } } -bool8 -S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) +bool8 S9xOpenSnapshotFile(const char *fname, bool8 read_only, STREAM *file) { - char filename [PATH_MAX + 1]; - char drive [_MAX_DRIVE + 1]; - char dir [_MAX_DIR + 1]; - char ext [_MAX_EXT + 1]; + char filename[PATH_MAX + 1]; + char drive[_MAX_DRIVE + 1]; + char dir[_MAX_DIR + 1]; + char ext[_MAX_EXT + 1]; - _splitpath (fname, drive, dir, filename, ext); + _splitpath(fname, drive, dir, filename, ext); if (*drive || *dir == '/' || (*dir == '.' && (*(dir + 1) == '/'))) { - sstrncpy (filename, fname, PATH_MAX + 1); + snprintf(filename, PATH_MAX + 1, "%s", fname); - if (!file_exists (filename)) + if (!file_exists(filename)) { if (!*ext) - strcat (filename, ".s9x"); + strcat(filename, ".s9x"); } } else { - strcpy (filename, S9xGetDirectory (SNAPSHOT_DIR)); - strcat (filename, SLASH_STR); - strcat (filename, fname); + strcpy(filename, S9xGetDirectory(SNAPSHOT_DIR)); + strcat(filename, SLASH_STR); + strcat(filename, fname); - if (!file_exists (filename)) + if (!file_exists(filename)) { if (!*ext) - strcat (filename, ".s9x"); + strcat(filename, ".s9x"); } } #ifdef ZLIB if (read_only) { - if ((*file = OPEN_STREAM (filename, "rb"))) + if ((*file = OPEN_STREAM(filename, "rb"))) return (true); else - fprintf (stderr, - "Failed to open file stream for reading. (%s)\n", - zError (errno)); + fprintf(stderr, + "Failed to open file stream for reading. (%s)\n", + zError(errno)); } else { - if ((*file = OPEN_STREAM (filename, "wb"))) + if ((*file = OPEN_STREAM(filename, "wb"))) { return (true); } else { - fprintf (stderr, - "Couldn't open stream with zlib. (%s)\n", - zError (errno)); + fprintf(stderr, + "Couldn't open stream with zlib. (%s)\n", + zError(errno)); } } - fprintf (stderr, "zlib: Couldn't open snapshot file:\n%s\n", filename); + fprintf(stderr, "zlib: Couldn't open snapshot file:\n%s\n", filename); #else - char command [PATH_MAX]; + char command[PATH_MAX]; if (read_only) { - sprintf (command, "gzip -d <\"%s\"", filename); - if (*file = popen (command, "r")) + sprintf(command, "gzip -d <\"%s\"", filename); + if (*file = popen(command, "r")) return (true); } else { - sprintf (command, "gzip --best >\"%s\"", filename); - if (*file = popen (command, "wb")) + sprintf(command, "gzip --best >\"%s\"", filename); + if (*file = popen(command, "wb")) return (true); } - fprintf (stderr, "gzip: Couldn't open snapshot file:\n%s\n", filename); + fprintf(stderr, "gzip: Couldn't open snapshot file:\n%s\n", filename); #endif return (false); } -void S9xCloseSnapshotFile (STREAM file) +void S9xCloseSnapshotFile(STREAM file) { #ifdef ZLIB - CLOSE_STREAM (file); + CLOSE_STREAM(file); #else - pclose (file); + pclose(file); #endif } -void -S9xAutoSaveSRAM () +void S9xAutoSaveSRAM() { - Memory.SaveSRAM (S9xGetFilename (".srm", SRAM_DIR)); - S9xSaveCheatFile (S9xGetFilename (".cht", CHEAT_DIR)); + Memory.SaveSRAM(S9xGetFilename(".srm", SRAM_DIR)); + S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); } -void -S9xLoadState (const char *filename) +void S9xLoadState(const char *filename) { - S9xFreezeGame (S9xGetFilename (".undo", SNAPSHOT_DIR)); + S9xFreezeGame(S9xGetFilename(".undo", SNAPSHOT_DIR)); - if (S9xUnfreezeGame (filename)) + if (S9xUnfreezeGame(filename)) { - sprintf (buf, "%s loaded", filename); - S9xSetInfoString (buf); + sprintf(buf, "%s loaded", filename); + S9xSetInfoString(buf); } else { - fprintf (stderr, "Failed to load state file: %s\n", filename); + fprintf(stderr, "Failed to load state file: %s\n", filename); } } -void -S9xSaveState (const char *filename) +void S9xSaveState(const char *filename) { - if (S9xFreezeGame (filename)) + if (S9xFreezeGame(filename)) { - sprintf (buf, "%s saved", filename); - S9xSetInfoString (buf); + sprintf(buf, "%s saved", filename); + S9xSetInfoString(buf); } else { - fprintf (stderr, "Couldn't save state file: %s\n", filename); + fprintf(stderr, "Couldn't save state file: %s\n", filename); } } -char * -S9xOpenROMDialog () -{ - GtkWidget *dialog; - GtkFileFilter *filter; - char *filename = NULL; - gint result; - const char *extensions[] = - { - "*.smc", "*.SMC", "*.fig", "*.FIG", "*.sfc", "*.SFC", - "*.jma", "*.JMA", "*.zip", "*.ZIP", "*.gd3", "*.GD3", - "*.swc", "*.SWC", "*.gz" , "*.GZ", "*.bs", "*.BS", - NULL - }; - - top_level->pause_from_focus_change (); - - dialog = gtk_file_chooser_dialog_new (_("Open SNES ROM Image"), - top_level->get_window (), - GTK_FILE_CHOOSER_ACTION_OPEN, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("SNES ROM Images")); - for (int i = 0; extensions[i]; i++) - { - gtk_file_filter_add_pattern (filter, extensions[i]); - } - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*.*"); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - if (!gui_config->last_directory.empty ()) - { - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - gui_config->last_directory.c_str ()); - } - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) - { - char *directory; - - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - directory = - gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); - if (directory) - { - gui_config->last_directory = directory; - g_free (directory); - } - } - - else - { - filename = NULL; - } - - gtk_widget_destroy (dialog); - - top_level->unpause_from_focus_change (); - - return filename; -} - /* QuickSave/Load from S9x base controls.cpp */ -void -S9xQuickSaveSlot (int slot) +void S9xQuickSaveSlot(int slot) { char def[PATH_MAX]; char filename[PATH_MAX]; @@ -490,21 +314,21 @@ S9xQuickSaveSlot (int slot) if (!gui_config->rom_loaded) return; - _splitpath (Memory.ROMFilename, drive, dir, def, ext); + _splitpath(Memory.ROMFilename, drive, dir, def, ext); - snprintf (filename, PATH_MAX, "%s%s%s.%03d", - S9xGetDirectory (SNAPSHOT_DIR), SLASH_STR, def, + snprintf(filename, PATH_MAX, "%s%s%s.%03d", + S9xGetDirectory(SNAPSHOT_DIR), SLASH_STR, def, slot); - if (S9xFreezeGame (filename)) + if (S9xFreezeGame(filename)) { - snprintf (buf, PATH_MAX, "%s.%03d saved", def, slot); + snprintf(buf, PATH_MAX, "%s.%03d saved", def, slot); - S9xSetInfoString (buf); + S9xSetInfoString(buf); } } -void S9xQuickLoadSlot (int slot) +void S9xQuickLoadSlot(int slot) { char def[PATH_MAX]; char filename[PATH_MAX]; @@ -515,44 +339,43 @@ void S9xQuickLoadSlot (int slot) if (!gui_config->rom_loaded) return; - _splitpath (Memory.ROMFilename, drive, dir, def, ext); + _splitpath(Memory.ROMFilename, drive, dir, def, ext); - snprintf (filename, PATH_MAX, "%s%s%s.%03d", - S9xGetDirectory (SNAPSHOT_DIR), SLASH_STR, def, + snprintf(filename, PATH_MAX, "%s%s%s.%03d", + S9xGetDirectory(SNAPSHOT_DIR), SLASH_STR, def, slot); - if (file_exists (filename)) - S9xFreezeGame (S9xGetFilename (".undo", SNAPSHOT_DIR)); + if (file_exists(filename)) + S9xFreezeGame(S9xGetFilename(".undo", SNAPSHOT_DIR)); - if (S9xUnfreezeGame (filename)) + if (S9xUnfreezeGame(filename)) { - snprintf (buf, PATH_MAX, "%s.%03d loaded", def, slot); - S9xSetInfoString (buf); + snprintf(buf, PATH_MAX, "%s.%03d loaded", def, slot); + S9xSetInfoString(buf); return; } static const char *digits = "t123456789"; - _splitpath (Memory.ROMFilename, drive, dir, def, ext); + _splitpath(Memory.ROMFilename, drive, dir, def, ext); - snprintf (filename, PATH_MAX, "%s%s%s.zs%c", - S9xGetDirectory (SNAPSHOT_DIR), SLASH_STR, - def, digits[slot]); + snprintf(filename, PATH_MAX, "%s%s%s.zs%c", + S9xGetDirectory(SNAPSHOT_DIR), SLASH_STR, + def, digits[slot]); - if (file_exists (filename)) - S9xFreezeGame (S9xGetFilename (".undo", SNAPSHOT_DIR)); + if (file_exists(filename)) + S9xFreezeGame(S9xGetFilename(".undo", SNAPSHOT_DIR)); - if (S9xUnfreezeGame (filename)) + if (S9xUnfreezeGame(filename)) { - snprintf (buf, PATH_MAX, - "Loaded ZSNES freeze file %s.zs%c", - def, digits [slot]); - S9xSetInfoString (buf); + snprintf(buf, PATH_MAX, + "Loaded ZSNES freeze file %s.zs%c", + def, digits[slot]); + S9xSetInfoString(buf); return; } - S9xMessage (S9X_ERROR, - S9X_FREEZE_FILE_NOT_FOUND, - "Freeze file not found"); + S9xMessage(S9X_ERROR, + S9X_FREEZE_FILE_NOT_FOUND, + "Freeze file not found"); } - diff --git a/gtk/src/gtk_file.h b/gtk/src/gtk_file.h index b4f42709..4ee91408 100644 --- a/gtk/src/gtk_file.h +++ b/gtk/src/gtk_file.h @@ -7,13 +7,12 @@ #ifndef __GTK_FILE_H #define __GTK_FILE_H -char *S9xOpenROMDialog (); -const char *S9xBasenameNoExt (const char *); +const char *S9xBasenameNoExt(const char *); -void S9xLoadState (const char *filename); -void S9xSaveState (const char *filename); +void S9xLoadState(const char *filename); +void S9xSaveState(const char *filename); -void S9xQuickSaveSlot (int slot); -void S9xQuickLoadSlot (int slot); +void S9xQuickSaveSlot(int slot); +void S9xQuickLoadSlot(int slot); #endif /* __GTK_FILE_H */ diff --git a/gtk/src/gtk_glx_context.cpp b/gtk/src/gtk_glx_context.cpp index 868bc8a0..8eb2104c 100644 --- a/gtk/src/gtk_glx_context.cpp +++ b/gtk/src/gtk_glx_context.cpp @@ -6,99 +6,67 @@ #include #include +#include #include "gtk_s9x.h" #include "gtk_glx_context.h" -#include "gtk_2_3_compat.h" -GTKGLXContext::GTKGLXContext () +GTKGLXContext::GTKGLXContext() { - gdk_display = NULL; - parent_gdk_window = NULL; - gdk_window = NULL; - display = NULL; - vi = NULL; - context = NULL; + display = NULL; + context = NULL; - version_major = -1; - version_minor = -1; + version_major = -1; + version_minor = -1; use_oml_sync_control = false; ust = msc = sbc = 0; } -GTKGLXContext::~GTKGLXContext () +GTKGLXContext::~GTKGLXContext() { if (context) - glXDestroyContext (display, context); - - if (gdk_window) - gdk_window_destroy (gdk_window); - - if (vi) - XFree (vi); + glXDestroyContext(display, context); } -bool GTKGLXContext::attach (GtkWidget *widget) +bool GTKGLXContext::attach(Display *dpy, Window xid) { - GdkScreen *gdk_screen; - GdkWindow *window; GLXFBConfig *fbconfigs; - int num_fbconfigs; + int num_fbconfigs; int attribs[] = { GLX_DOUBLEBUFFER, True, GLX_X_RENDERABLE, True, - GLX_RED_SIZE, 8, - GLX_GREEN_SIZE, 8, - GLX_BLUE_SIZE, 8, + GLX_RED_SIZE, 8, + GLX_GREEN_SIZE, 8, + GLX_BLUE_SIZE, 8, None }; - window = gtk_widget_get_window (widget); - this->widget = widget; + this->xid = xid; + display = dpy; - if (!GDK_IS_X11_WINDOW (window)) - return false; + XWindowAttributes wa{}; + XGetWindowAttributes(display, xid, &wa); + screen = XScreenNumberOfScreen(wa.screen); - parent_gdk_window = window; - gdk_display = gdk_window_get_display (window); - gdk_screen = gdk_window_get_screen (window); - screen = gdk_x11_screen_get_screen_number (gdk_screen); - display = GDK_DISPLAY_XDISPLAY (gdk_display); - - glXQueryVersion (display, &version_major, &version_minor); + glXQueryVersion(display, &version_major, &version_minor); if (version_major < 2 && version_minor < 3) return false; - fbconfigs = glXChooseFBConfig (display, screen, attribs, &num_fbconfigs); + fbconfigs = glXChooseFBConfig(display, screen, attribs, &num_fbconfigs); + if (!fbconfigs || num_fbconfigs < 1) { - printf ("Couldn't match a GLX framebuffer config.\n"); + printf("Couldn't match a GLX framebuffer config.\n"); return false; } + fbconfig = fbconfigs[0]; - XFree(fbconfigs); - - vi = glXGetVisualFromFBConfig (display, fbconfig); - - gdk_window_get_geometry (parent_gdk_window, &x, &y, &width, &height); - memset (&window_attr, 0, sizeof (GdkWindowAttr)); - window_attr.event_mask = GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK; - window_attr.width = width; - window_attr.height = height; - window_attr.wclass = GDK_INPUT_OUTPUT; - window_attr.window_type = GDK_WINDOW_CHILD; - window_attr.visual = gdk_x11_screen_lookup_visual (gdk_screen, vi->visualid); - - gdk_window = gdk_window_new (window, &window_attr, GDK_WA_VISUAL); - gdk_window_set_user_data (gdk_window, (gpointer) widget); - gdk_window_show (gdk_window); - xid = gdk_x11_window_get_xid (gdk_window); return true; } -bool GTKGLXContext::create_context () +bool GTKGLXContext::create_context() { int context_attribs[] = { GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, @@ -107,18 +75,21 @@ bool GTKGLXContext::create_context () None }; - const char *extensions = glXQueryExtensionsString (display, screen); + const char *extensions = glXQueryExtensionsString(display, screen); - gdk_x11_display_error_trap_push(gdk_display); - if (strstr (extensions, "GLX_ARB_create_context")) - context = glXCreateContextAttribsARB (display, fbconfig, NULL, True, context_attribs); + XSetErrorHandler([](Display *dpy, XErrorEvent *event) -> int { + printf("XError: type: %d code: %d\n", event->type, event->error_code); + return X_OK; + }); + if (strstr(extensions, "GLX_ARB_create_context")) + context = glXCreateContextAttribsARB(display, fbconfig, NULL, True, context_attribs); if (!context) - context = glXCreateNewContext (display, fbconfig, GLX_RGBA_TYPE, NULL, True); - gdk_x11_display_error_trap_pop_ignored(gdk_display); + context = glXCreateNewContext(display, fbconfig, GLX_RGBA_TYPE, NULL, True); + XSetErrorHandler(nullptr); if (!context) { - printf ("Couldn't create GLX context.\n"); + printf("Couldn't create GLX context.\n"); return false; } @@ -128,31 +99,27 @@ bool GTKGLXContext::create_context () return true; } -void GTKGLXContext::resize () +void GTKGLXContext::resize() { - gdk_window_get_geometry (parent_gdk_window, &x, &y, &width, &height); + while (!ready()) + usleep(100); - if (window_attr.width == width && window_attr.height == height) - return; + unsigned int width; + unsigned int height; + glXQueryDrawable(display, xid, GLX_WIDTH, &width); + glXQueryDrawable(display, xid, GLX_HEIGHT, &height); - window_attr.width = width; - window_attr.height = height; - - gdk_window_destroy (gdk_window); - gdk_window = gdk_window_new (parent_gdk_window, &window_attr, GDK_WA_VISUAL); - gdk_window_set_user_data (gdk_window, (gpointer) widget); - gdk_window_show (gdk_window); - xid = gdk_x11_window_get_xid (gdk_window); - - make_current (); + this->width = width; + this->height = height; + make_current(); } -void GTKGLXContext::swap_buffers () +void GTKGLXContext::swap_buffers() { if (use_oml_sync_control) glXGetSyncValuesOML(display, xid, &ust, &msc, &sbc); - glXSwapBuffers (display, xid); + glXSwapBuffers(display, xid); } bool GTKGLXContext::ready() @@ -170,21 +137,19 @@ bool GTKGLXContext::ready() return true; } -void GTKGLXContext::make_current () +void GTKGLXContext::make_current() { - glXMakeCurrent (display, xid, context); + glXMakeCurrent(display, xid, context); } -void GTKGLXContext::swap_interval (int frames) +void GTKGLXContext::swap_interval(int frames) { - if (epoxy_has_glx_extension (display, screen, "GLX_EXT_swap_control")) - glXSwapIntervalEXT (display, xid, frames); - else if (epoxy_has_glx_extension (display, screen, "GLX_SGI_swap_control")) - glXSwapIntervalSGI (frames); + if (epoxy_has_glx_extension(display, screen, "GLX_EXT_swap_control")) + glXSwapIntervalEXT(display, xid, frames); + else if (epoxy_has_glx_extension(display, screen, "GLX_SGI_swap_control")) + glXSwapIntervalSGI(frames); #ifdef GLX_MESA_swap_control - else if (epoxy_has_glx_extension (display, screen, "GLX_MESA_swap_control")) - glXSwapIntervalMESA (frames); + else if (epoxy_has_glx_extension(display, screen, "GLX_MESA_swap_control")) + glXSwapIntervalMESA(frames); #endif } - - diff --git a/gtk/src/gtk_glx_context.h b/gtk/src/gtk_glx_context.h index 8ee7c91a..59c954f1 100644 --- a/gtk/src/gtk_glx_context.h +++ b/gtk/src/gtk_glx_context.h @@ -7,36 +7,27 @@ #ifndef __GTK_GLX_CONTEXT_H #define __GTK_GLX_CONTEXT_H -#include "gtk_2_3_compat.h" -#include - #include "gtk_opengl_context.h" +#include + class GTKGLXContext : public OpenGLContext { public: - GTKGLXContext (); - ~GTKGLXContext (); - bool attach (GtkWidget *widget); - bool create_context (); - void resize (); - void swap_buffers (); - void swap_interval (int frames); - void make_current (); + GTKGLXContext(); + ~GTKGLXContext(); + bool attach(Display *dpy, Window xid); + bool create_context(); + void resize(); + void swap_buffers(); + void swap_interval(int frames); + void make_current(); bool ready(); - GtkWidget *widget; - - GdkDisplay *gdk_display; - GdkWindow *parent_gdk_window; - GdkWindow *gdk_window; - GdkWindowAttr window_attr; - GLXContext context; GLXFBConfig fbconfig; Display *display; int screen; - XVisualInfo *vi; Window xid; int version_major; diff --git a/gtk/src/gtk_netplay.cpp b/gtk/src/gtk_netplay.cpp index 50e792fc..14ff839b 100644 --- a/gtk/src/gtk_netplay.cpp +++ b/gtk/src/gtk_netplay.cpp @@ -10,133 +10,132 @@ #include "gtk_netplay_dialog.h" #include "gtk_netplay.h" #include "gtk_sound.h" +#include "snes9x.h" +#include "memmap.h" +#include "netplay.h" +#include "cpuexec.h" +#include "display.h" +#include "ppu.h" -uint16 MovieGetJoypad (int i); -void MovieSetJoypad (int i, uint16 buttons); +uint16 MovieGetJoypad(int i); +void MovieSetJoypad(int i, uint16 buttons); static uint32 local_joypads[8], joypads[8]; static GThread *npthread; extern SNPServer NPServer; -static void -S9xNetplayPreconnect () +static void S9xNetplayPreconnect() { - S9xNetplayDisconnect (); + S9xNetplayDisconnect(); if (gui_config->rom_loaded) { - S9xAutoSaveSRAM (); + S9xAutoSaveSRAM(); } NetPlay.MaxBehindFrameCount = gui_config->netplay_max_frame_loss; NetPlay.Waiting4EmulationThread = false; } -static void -S9xNetplayConnect () +static void S9xNetplayConnect() { GtkWidget *msg; - S9xNetplayPreconnect (); + S9xNetplayPreconnect(); uint32 flags = CPU.Flags; - if (!gui_config->netplay_last_rom.empty () && - !top_level->try_open_rom (gui_config->netplay_last_rom.c_str ())) + if (!gui_config->netplay_last_rom.empty() && + !top_level->try_open_rom(gui_config->netplay_last_rom)) { return; } - if (!S9xNPConnectToServer (gui_config->netplay_last_host.c_str (), - gui_config->netplay_last_port, - Memory.ROMName)) + if (!S9xNPConnectToServer(gui_config->netplay_last_host.c_str(), + gui_config->netplay_last_port, + Memory.ROMName)) { - msg = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "Couldn't connect to server: %s:%d", - gui_config->netplay_last_host.c_str (), - gui_config->netplay_last_port); - gtk_window_set_title (GTK_WINDOW (msg), _("Connection Error")); + msg = gtk_message_dialog_new(NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + "Couldn't connect to server: %s:%d", + gui_config->netplay_last_host.c_str(), + gui_config->netplay_last_port); + gtk_window_set_title(GTK_WINDOW(msg), _("Connection Error")); - gtk_dialog_run (GTK_DIALOG (msg)); - gtk_widget_destroy (msg); + gtk_dialog_run(GTK_DIALOG(msg)); + gtk_widget_destroy(msg); } gui_config->netplay_activated = true; /* If no rom is specified, assume we'll get it from the server */ - if (gui_config->netplay_last_rom.empty ()) + if (gui_config->netplay_last_rom.empty()) { Settings.StopEmulation = false; - S9xROMLoaded (); + S9xROMLoaded(); } - S9xReset (); + S9xReset(); CPU.Flags = flags; - top_level->configure_widgets (); + top_level->configure_widgets(); } -void -S9xNetplaySyncClients () +void S9xNetplaySyncClients() { if (Settings.NetPlay && Settings.NetPlayServer) - S9xNPServerQueueSyncAll (); + S9xNPServerQueueSyncAll(); } -void -S9xNetplayStopServer () +void S9xNetplayStopServer() { - S9xNPStopServer (); + S9xNPStopServer(); - g_thread_join (npthread); + g_thread_join(npthread); Settings.NetPlayServer = false; gui_config->netplay_server_up = false; } -void -S9xNetplayDisconnect () +void S9xNetplayDisconnect() { if (Settings.NetPlay) { if (NetPlay.Connected) - S9xNPDisconnect (); + S9xNPDisconnect(); } if (gui_config->netplay_server_up) { - S9xNetplayStopServer (); + S9xNetplayStopServer(); } gui_config->netplay_activated = false; NetPlay.Paused = false; - top_level->configure_widgets (); + top_level->configure_widgets(); } -static gpointer -S9xNetplayServerThread (gpointer) +static gpointer S9xNetplayServerThread(gpointer) { - S9xNPStartServer (gui_config->netplay_default_port); + S9xNPStartServer(gui_config->netplay_default_port); return NULL; } -void -S9xNetplayStartServer () +void S9xNetplayStartServer() { uint32 flags; - S9xNetplayPreconnect (); + S9xNetplayPreconnect(); flags = CPU.Flags; - if (gui_config->netplay_last_rom.empty () || - !top_level->try_open_rom (gui_config->netplay_last_rom.c_str ())) + if (gui_config->netplay_last_rom.empty() || + !top_level->try_open_rom(gui_config->netplay_last_rom)) { return; } @@ -145,105 +144,103 @@ S9xNetplayStartServer () NPServer.SyncByReset = gui_config->netplay_sync_reset; NPServer.SendROMImageOnConnect = gui_config->netplay_send_rom; - npthread = g_thread_new (NULL, S9xNetplayServerThread, NULL); + npthread = g_thread_new(NULL, S9xNetplayServerThread, NULL); /* Sleep to let the server create itself */ - usleep (10000); + usleep(10000); - S9xNPConnectToServer ("127.0.0.1", - gui_config->netplay_default_port, - Memory.ROMName); + S9xNPConnectToServer("127.0.0.1", + gui_config->netplay_default_port, + Memory.ROMName); - S9xReset (); + S9xReset(); - S9xROMLoaded (); + S9xROMLoaded(); gui_config->netplay_activated = true; gui_config->netplay_server_up = true; CPU.Flags = flags; - top_level->configure_widgets (); + top_level->configure_widgets(); } -void -S9xNetplayDialogOpen () +void S9xNetplayDialogOpen() { Snes9xNetplayDialog *np_dialog; - top_level->pause_from_focus_change (); + top_level->pause_from_focus_change(); - np_dialog = new Snes9xNetplayDialog (gui_config); + np_dialog = new Snes9xNetplayDialog(gui_config); - gtk_window_set_transient_for (np_dialog->get_window (), - top_level->get_window ()); + gtk_window_set_transient_for(np_dialog->get_window(), + top_level->get_window()); - if (np_dialog->show ()) + if (np_dialog->show()) { if (!gui_config->netplay_is_server) { - S9xNetplayConnect (); + S9xNetplayConnect(); } else { - S9xNetplayStartServer (); + S9xNetplayStartServer(); } - S9xSoundStart (); + S9xSoundStart(); } delete np_dialog; - top_level->unpause_from_focus_change (); + top_level->unpause_from_focus_change(); } -int -S9xNetplaySyncSpeed () +int S9xNetplaySyncSpeed() { if (!Settings.NetPlay || !NetPlay.Connected) return 0; // Send 1st joypad's position update to server - S9xNPSendJoypadUpdate (local_joypads[0]); + S9xNPSendJoypadUpdate(local_joypads[0]); // set input from network for (int i = 0; i < NP_MAX_CLIENTS; i++) - joypads[i] = S9xNPGetJoypad (i); + joypads[i] = S9xNPGetJoypad(i); - if (!S9xNPCheckForHeartBeat ()) + if (!S9xNPCheckForHeartBeat()) { // No heartbeats already arrived, have to wait for one. - NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay (100); + NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay(100); IPPU.RenderThisFrame = true; IPPU.SkippedFrames = 0; } else { - int difference = (int) (NetPlay.MySequenceNum) - - (int) (NetPlay.ServerSequenceNum); + int difference = (int)(NetPlay.MySequenceNum) - + (int)(NetPlay.ServerSequenceNum); if (difference < 0) difference += 256; if (NetPlay.Waiting4EmulationThread) { - if ((unsigned int) difference <= (NetPlay.MaxBehindFrameCount / 2)) + if ((unsigned int)difference <= (NetPlay.MaxBehindFrameCount / 2)) { NetPlay.Waiting4EmulationThread = false; - S9xNPSendPause (false); + S9xNPSendPause(false); } } else { - if ((unsigned int) difference >= (NetPlay.MaxBehindFrameCount)) + if ((unsigned int)difference >= (NetPlay.MaxBehindFrameCount)) { NetPlay.Waiting4EmulationThread = true; - S9xNPSendPause (true); + S9xNPSendPause(true); } } - NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay (200); + NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay(200); if (IPPU.SkippedFrames < NetPlay.MaxFrameSkip) { @@ -260,27 +257,26 @@ S9xNetplaySyncSpeed () if (!NetPlay.PendingWait4Sync) { NetPlay.FrameCount++; - S9xNPStepJoypadHistory (); + S9xNPStepJoypadHistory(); } return 1; } -int -S9xNetplayPush () +int S9xNetplayPush() { if (gui_config->netplay_activated && (!Settings.NetPlay || !NetPlay.Connected)) - S9xNetplayDisconnect (); + S9xNetplayDisconnect(); if (!Settings.NetPlay) return 0; - if (NetPlay.PendingWait4Sync && !S9xNPWaitForHeartBeatDelay (100)) + if (NetPlay.PendingWait4Sync && !S9xNPWaitForHeartBeatDelay(100)) { - S9xProcessEvents (false); + S9xProcessEvents(false); - S9xSoundStop (); + S9xSoundStop(); NetPlay.Paused = true; return 1; @@ -288,36 +284,31 @@ S9xNetplayPush () NetPlay.Paused = false; - S9xSoundStart (); + S9xSoundStart(); /* Save the joypad input */ for (int i = 0; i < 8; i++) { - local_joypads[i] = MovieGetJoypad (i); + local_joypads[i] = MovieGetJoypad(i); - MovieSetJoypad (i, joypads[i]); + MovieSetJoypad(i, joypads[i]); } if (NetPlay.PendingWait4Sync) { NetPlay.PendingWait4Sync = false; NetPlay.FrameCount++; - S9xNPStepJoypadHistory (); + S9xNPStepJoypadHistory(); } return 0; } -void -S9xNetplayPop () +void S9xNetplayPop() { if (!Settings.NetPlay) return; for (int i = 0; i < 8; i++) - MovieSetJoypad (i, local_joypads[i]); + MovieSetJoypad(i, local_joypads[i]); } - - - - diff --git a/gtk/src/gtk_netplay.h b/gtk/src/gtk_netplay.h index 46426da5..65a9a0d2 100644 --- a/gtk/src/gtk_netplay.h +++ b/gtk/src/gtk_netplay.h @@ -7,11 +7,11 @@ #ifndef __GTK_NETPLAY_H #define __GTK_NETPLAY_H -void S9xNetplayDialogOpen (); -int S9xNetplayPush (); -void S9xNetplayPop (); -int S9xNetplaySyncSpeed (); -void S9xNetplaySyncClients (); -void S9xNetplayDisconnect (); +void S9xNetplayDialogOpen(); +int S9xNetplayPush(); +void S9xNetplayPop(); +int S9xNetplaySyncSpeed(); +void S9xNetplaySyncClients(); +void S9xNetplayDisconnect(); #endif /* __GTK_NETPLAY_H */ diff --git a/gtk/src/gtk_netplay_dialog.cpp b/gtk/src/gtk_netplay_dialog.cpp index 87778650..3aa8c145 100644 --- a/gtk/src/gtk_netplay_dialog.cpp +++ b/gtk/src/gtk_netplay_dialog.cpp @@ -6,133 +6,91 @@ #include "gtk_netplay_dialog.h" #include "gtk_s9x.h" -#include "gtk_file.h" -static void -event_browse_clicked (GtkButton *button, gpointer data) +Snes9xNetplayDialog::Snes9xNetplayDialog(Snes9xConfig *config) + : GtkBuilderWindow("netplay_dialog") { - char *filename; - Snes9xNetplayDialog *np_dialog = (Snes9xNetplayDialog *) data; + get_object("host_radio")->signal_toggled().connect([&] { + update_state(); + }); - filename = S9xOpenROMDialog (); + get_object("clear_netplay")->signal_clicked().connect([&] { + get_object("rom_image")->set_text(""); + }); - if (filename) - { - gtk_entry_set_text (GTK_ENTRY (np_dialog->get_widget ("rom_image")), - filename); - - g_free (filename); - } -} - -static void -event_clear_clicked (GtkButton *button, gpointer data) -{ - Snes9xNetplayDialog *np_dialog = (Snes9xNetplayDialog *) data; - - gtk_entry_set_text (GTK_ENTRY (np_dialog->get_widget ("rom_image")), ""); -} - -static void -event_server_toggled (GtkToggleButton *toggle, gpointer data) -{ - Snes9xNetplayDialog *np_dialog = (Snes9xNetplayDialog *) data; - - np_dialog->update_state (); -} - -Snes9xNetplayDialog::Snes9xNetplayDialog (Snes9xConfig *config) : - GtkBuilderWindow ("netplay_dialog") -{ - GtkBuilderWindowCallbacks callbacks[] = - { - { "server_toggled", G_CALLBACK (event_server_toggled) }, - { "browse_clicked", G_CALLBACK (event_browse_clicked) }, - { "clear_clicked", G_CALLBACK (event_clear_clicked) }, - { NULL, NULL } - }; - - signal_connect (callbacks); + get_object("browse_button")->signal_clicked().connect([&] { + auto filename = top_level->open_rom_dialog(false); + if (!filename.empty()) + get_object("rom_image")->set_text(filename); + }); this->config = config; } -void -Snes9xNetplayDialog::update_state () +Snes9xNetplayDialog::~Snes9xNetplayDialog() { - if (get_check ("host_radio")) +} + +void Snes9xNetplayDialog::update_state() +{ + if (get_check("host_radio")) { - enable_widget ("connect_box", false); - enable_widget ("default_port_box", true); - enable_widget ("sync_reset", true); - enable_widget ("send_image", true); + enable_widget("connect_box", false); + enable_widget("default_port_box", true); + enable_widget("sync_reset", true); + enable_widget("send_image", true); } else { - enable_widget ("connect_box", true); - enable_widget ("default_port_box", false); - enable_widget ("sync_reset", false); - enable_widget ("send_image", false); + enable_widget("connect_box", true); + enable_widget("default_port_box", false); + enable_widget("sync_reset", false); + enable_widget("send_image", false); } } -void -Snes9xNetplayDialog::settings_to_dialog () +void Snes9xNetplayDialog::settings_to_dialog() { - set_entry_text ("rom_image", config->netplay_last_rom.c_str ()); - set_entry_text ("ip_entry", config->netplay_last_host.c_str ()); - set_check ("sync_reset", config->netplay_sync_reset); - set_check ("send_image", config->netplay_send_rom); - set_spin ("port", config->netplay_last_port); - set_spin ("default_port", config->netplay_default_port); - set_spin ("frames_behind", config->netplay_max_frame_loss); - set_check ("connect_radio", !config->netplay_is_server); - set_check ("host_radio", config->netplay_is_server); + set_entry_text("rom_image", config->netplay_last_rom.c_str()); + set_entry_text("ip_entry", config->netplay_last_host.c_str()); + set_check("sync_reset", config->netplay_sync_reset); + set_check("send_image", config->netplay_send_rom); + set_spin("port", config->netplay_last_port); + set_spin("default_port", config->netplay_default_port); + set_spin("frames_behind", config->netplay_max_frame_loss); + set_check("connect_radio", !config->netplay_is_server); + set_check("host_radio", config->netplay_is_server); - update_state (); + update_state(); } -void -Snes9xNetplayDialog::settings_from_dialog () +void Snes9xNetplayDialog::settings_from_dialog() { - config->netplay_last_rom = get_entry_text ("rom_image"); - config->netplay_last_host = get_entry_text ("ip_entry"); - config->netplay_sync_reset = get_check ("sync_reset"); - config->netplay_send_rom = get_check ("send_image"); - config->netplay_last_port = get_spin ("port"); - config->netplay_default_port = get_spin ("default_port"); - config->netplay_max_frame_loss = get_spin ("frames_behind"); - config->netplay_is_server = get_check ("host_radio"); + config->netplay_last_rom = get_entry_text("rom_image"); + config->netplay_last_host = get_entry_text("ip_entry"); + config->netplay_sync_reset = get_check("sync_reset"); + config->netplay_send_rom = get_check("send_image"); + config->netplay_last_port = get_spin("port"); + config->netplay_default_port = get_spin("default_port"); + config->netplay_max_frame_loss = get_spin("frames_behind"); + config->netplay_is_server = get_check("host_radio"); - config->save_config_file (); + config->save_config_file(); } bool Snes9xNetplayDialog::show() { - int result; + settings_to_dialog(); - settings_to_dialog (); + auto result = Glib::RefPtr::cast_static(window)->run(); + window->hide(); - result = gtk_dialog_run (GTK_DIALOG (window)); - - gtk_widget_hide (window); - - if (result == GTK_RESPONSE_OK) + if (result == Gtk::RESPONSE_OK) { - settings_from_dialog (); - + settings_from_dialog(); return true; } - else - { - return false; - } - -} - -Snes9xNetplayDialog::~Snes9xNetplayDialog () -{ - gtk_widget_destroy (window); + return false; } diff --git a/gtk/src/gtk_netplay_dialog.h b/gtk/src/gtk_netplay_dialog.h index bca8e7a1..0f8e326f 100644 --- a/gtk/src/gtk_netplay_dialog.h +++ b/gtk/src/gtk_netplay_dialog.h @@ -12,17 +12,16 @@ class Snes9xNetplayDialog : public GtkBuilderWindow { - public: - Snes9xNetplayDialog (Snes9xConfig *config); - ~Snes9xNetplayDialog (); - bool show (); - void update_state (); + public: + Snes9xNetplayDialog(Snes9xConfig *config); + ~Snes9xNetplayDialog(); + bool show(); + void update_state(); - private: - Snes9xConfig *config; - void settings_to_dialog (); - void settings_from_dialog (); + private: + Snes9xConfig *config; + void settings_to_dialog(); + void settings_from_dialog(); }; - #endif /* __GTK_NETPLAY_DIALOG_H */ diff --git a/gtk/src/gtk_opengl_context.h b/gtk/src/gtk_opengl_context.h index 8146860b..62b1c10e 100644 --- a/gtk/src/gtk_opengl_context.h +++ b/gtk/src/gtk_opengl_context.h @@ -7,19 +7,19 @@ #ifndef __GTK_OPENGL_CONTEXT_H #define __GTK_OPENGL_CONTEXT_H -#include "gtk_2_3_compat.h" - class OpenGLContext { public: - virtual ~OpenGLContext () {}; - virtual bool attach (GtkWidget *widget) = 0; - virtual bool create_context () = 0; - virtual void resize () = 0; - virtual void swap_buffers () = 0; - virtual void swap_interval (int frames) = 0; - virtual void make_current () = 0; - virtual bool ready() { return true; }; + virtual ~OpenGLContext(){}; + virtual bool create_context() = 0; + virtual void resize() = 0; + virtual void swap_buffers() = 0; + virtual void swap_interval(int frames) = 0; + virtual void make_current() = 0; + virtual bool ready() + { + return true; + }; int x; int y; diff --git a/gtk/src/gtk_preferences.cpp b/gtk/src/gtk_preferences.cpp index 30565c74..e8989610 100644 --- a/gtk/src/gtk_preferences.cpp +++ b/gtk/src/gtk_preferences.cpp @@ -6,397 +6,68 @@ #include #include -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include "gtk_preferences.h" #include "gtk_config.h" -#include "gtk_s9xcore.h" #include "gtk_control.h" #include "gtk_sound.h" #include "gtk_display.h" #include "gtk_binding.h" +#include "snes9x.h" +#include "gfx.h" +#include "display.h" + #define SAME_AS_GAME _("Same location as current game") -gboolean -snes9x_preferences_open (GtkWidget *widget, - gpointer data) +static Snes9xPreferences *preferences = nullptr; + +void snes9x_preferences_open(Snes9xWindow *window) { - Snes9xWindow *window = ((Snes9xWindow *) data); - Snes9xConfig *config = window->config; + if (!preferences) + preferences = new Snes9xPreferences(window->config); + + auto &config = preferences->config; window->pause_from_focus_change (); - Snes9xPreferences preferences (config); - gtk_window_set_transient_for (preferences.get_window (), - window->get_window ()); + preferences->window->set_transient_for(*window->window.get()); - config->set_joystick_mode (JOY_MODE_GLOBAL); + config->set_joystick_mode(JOY_MODE_GLOBAL); + preferences->show(); + window->unpause_from_focus_change(); - preferences.show (); - window->unpause_from_focus_change (); + config->set_joystick_mode(JOY_MODE_INDIVIDUAL); - config->set_joystick_mode (JOY_MODE_INDIVIDUAL); - - config->rebind_keys (); - window->update_accels (); - - return true; + config->rebind_keys(); + window->update_accelerators(); } -static void -event_sram_folder_browse (GtkButton *widget, gpointer data) +gboolean poll_joystick(gpointer data) { - ((Snes9xPreferences *) data)->browse_folder_dialog (); -} + Snes9xPreferences *window = (Snes9xPreferences *)data; + JoyEvent event; + Binding binding; + int focus; -static void -event_calibrate (GtkButton *widget, gpointer data) -{ - ((Snes9xPreferences *) data)->calibration_dialog (); -} - -static void -event_control_toggle (GtkToggleButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - static bool toggle_lock = false; - const gchar *name; - bool state; - - if (toggle_lock) + for (size_t i = 0; i < window->config->joystick.size(); i++) { - return; - } - - window->last_toggled = widget; - name = gtk_buildable_get_name (GTK_BUILDABLE (widget)); - state = gtk_toggle_button_get_active (widget); - - toggle_lock = true; - - for (int i = 0; b_links[i].button_name; i++) - { - if (strcasecmp (name, b_links[i].button_name)) - { - gtk_toggle_button_set_active ( - GTK_TOGGLE_BUTTON (window->get_widget (b_links[i].button_name)), - false); - } - } - - gtk_toggle_button_set_active (widget, state); - - toggle_lock = false; -} - -static gboolean -event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data) -{ - Binding key_binding; - int focus; - GtkNotebook *notebook; - GtkToggleButton *toggle; - Snes9xPreferences *window = (Snes9xPreferences *) user_data; - - if ((focus = window->get_focused_binding ()) < 0) - { - return false; /* Don't keep key for ourselves */ - } - - /* Allow modifier keys to be used if page is set to the joypad bindings. */ - notebook = GTK_NOTEBOOK (window->get_widget ("preferences_notebook")); - toggle = GTK_TOGGLE_BUTTON (window->get_widget ("use_modifiers")); - - if (gtk_notebook_get_current_page (notebook) != 4 || - !gtk_toggle_button_get_active (toggle)) - { - /* Don't allow modifiers that we track to be bound */ - if (event->keyval == GDK_Control_L || - event->keyval == GDK_Control_R || - event->keyval == GDK_Shift_L || - event->keyval == GDK_Shift_R || - event->keyval == GDK_Alt_L || - event->keyval == GDK_Alt_R) - { - return false; - } - } - - key_binding = Binding (event); - - /* Allows ESC key to clear the key binding */ - if (event->keyval == GDK_Escape) - { - if (event->state & GDK_SHIFT_MASK) - { - key_binding.clear (); - } - else - { - window->focus_next (); - return true; - } - } - - window->store_binding (b_links[focus].button_name, key_binding); - - return true; -} - -static void -event_ntsc_composite_preset (GtkButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - window->config->ntsc_setup = snes_ntsc_composite; - window->load_ntsc_settings (); -} - -static void -event_ntsc_svideo_preset (GtkButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - window->config->ntsc_setup = snes_ntsc_svideo; - window->load_ntsc_settings (); -} - -static void -event_ntsc_rgb_preset (GtkButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - window->config->ntsc_setup = snes_ntsc_rgb; - window->load_ntsc_settings (); -} - -static void -event_ntsc_monochrome_preset (GtkButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - window->config->ntsc_setup = snes_ntsc_monochrome; - window->load_ntsc_settings (); -} - - -static void -event_swap_with (GtkButton *widget, gpointer data) -{ - ((Snes9xPreferences *) data)->swap_with (); -} - -static void -event_reset_current_joypad (GtkButton *widget, gpointer data) -{ - ((Snes9xPreferences *) data)->reset_current_joypad (); -} - -static void -event_shader_select (GtkButton *widget, gpointer data) -{ -#ifdef USE_OPENGL - Snes9xPreferences *window = (Snes9xPreferences *) data; - GtkWidget *dialog; - gint result; - GtkEntry *entry; - - entry = GTK_ENTRY (window->get_widget ("fragment_shader")); - - dialog = gtk_file_chooser_dialog_new ("Select Shader File", - window->get_window (), - GTK_FILE_CHOOSER_ACTION_OPEN, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); - - if (!gui_config->last_shader_directory.empty ()) - { - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - gui_config->last_shader_directory.c_str ()); - } - else - { - if (strlen (gtk_entry_get_text (entry))) - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), - gtk_entry_get_text (entry)); - } - - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) - { - char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - char *folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); - - if (folder) - gui_config->last_shader_directory = folder; - if (filename) - gtk_entry_set_text (entry, filename); - - g_free (filename); - g_free (folder); - } - - gtk_widget_destroy (dialog); -#endif -} - -static void -event_game_data_clear (GtkEntry *entry, - GtkEntryIconPosition icon_pos, - GdkEvent *event, - gpointer user_data) -{ - gtk_entry_set_text (entry, SAME_AS_GAME); -} - -static void event_binding_icon_clear(GtkEntry *entry, - GtkEntryIconPosition icon_pos, - GdkEvent *event, - gpointer user_data) -{ - auto window = (Snes9xPreferences *)user_data; - window->clear_binding(gtk_buildable_get_name(GTK_BUILDABLE(entry))); -} - -static void -event_game_data_browse (GtkButton *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - GtkWidget *dialog; - char *filename = NULL; - gint result; - GtkEntry *entry; - char entry_name[256]; - - strcpy (entry_name, gtk_buildable_get_name (GTK_BUILDABLE (widget))); - - sprintf (strstr (entry_name, "_browse"), "_directory"); - entry = GTK_ENTRY (window->get_widget (entry_name)); - - dialog = gtk_file_chooser_dialog_new ("Select directory", - window->get_window (), - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); - - if (!gui_config->last_directory.empty ()) - { - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - gui_config->last_directory.c_str ()); - } - - if (strcmp (gtk_entry_get_text (entry), SAME_AS_GAME)) - gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (dialog), - gtk_entry_get_text (entry)); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) - { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - if (filename != NULL) - { - gtk_entry_set_text (entry, filename); - g_free (filename); - } - } - - gtk_widget_destroy (dialog); -} - -static void -event_hw_accel_changed (GtkComboBox *widget, gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - GtkComboBox *combo = - GTK_COMBO_BOX (window->get_widget ("hw_accel")); - int value = gtk_combo_box_get_active (combo); - - value = window->hw_accel_value (value); - - switch (value) - { - case HWA_NONE: - gtk_widget_show (window->get_widget ("bilinear_filter")); - gtk_widget_hide (window->get_widget ("opengl_frame")); - gtk_widget_hide (window->get_widget ("xv_frame")); - break; - case HWA_OPENGL: - gtk_widget_show (window->get_widget ("bilinear_filter")); - gtk_widget_show (window->get_widget ("opengl_frame")); - gtk_widget_hide (window->get_widget ("xv_frame")); - break; - case HWA_XV: - gtk_widget_hide (window->get_widget ("bilinear_filter")); - gtk_widget_show (window->get_widget ("xv_frame")); - gtk_widget_hide (window->get_widget ("opengl_frame")); - break; - } -} - -static void -event_scale_method_changed (GtkComboBox *widget, gpointer user_data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) user_data; - GtkComboBox *combo = - GTK_COMBO_BOX (window->get_widget ("scale_method_combo")); - - if (gtk_combo_box_get_active (combo) == FILTER_NTSC) - { - gtk_widget_show (window->get_widget ("ntsc_alignment")); - } - else - { - gtk_widget_hide (window->get_widget ("ntsc_alignment")); - } - - if (gtk_combo_box_get_active (combo) == FILTER_SCANLINES) - { - gtk_widget_show (window->get_widget ("scanline_alignment")); - } - else - { - gtk_widget_hide (window->get_widget ("scanline_alignment")); - } -} - -static void -event_control_combo_changed (GtkComboBox *widget, gpointer user_data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) user_data; - - window->bindings_to_dialog (gtk_combo_box_get_active (widget)); -} - -static gboolean -poll_joystick (gpointer data) -{ - Snes9xPreferences *window = (Snes9xPreferences *) data; - JoyEvent event; - Binding binding; - int i, focus; - - for (i = 0; window->config->joystick[i]; i++) - { - while (window->config->joystick[i]->get_event (&event)) + while (window->config->joystick[i].get_event(&event)) { if (event.state == JOY_PRESSED) { - if ((focus = window->get_focused_binding ()) >= 0) + if ((focus = window->get_focused_binding()) >= 0) { - binding = Binding (i, - event.parameter, - window->config->joystick_threshold); + binding = Binding(i, + event.parameter, + window->config->joystick_threshold); - window->store_binding (b_links[focus].button_name, - binding); + window->store_binding(b_links[focus].button_name, + binding); - window->config->flush_joysticks (); + window->config->flush_joysticks(); return true; } - } } } @@ -404,275 +75,392 @@ poll_joystick (gpointer data) return true; } -void -Snes9xPreferences::calibration_dialog () +Snes9xPreferences::Snes9xPreferences(Snes9xConfig *config) + : GtkBuilderWindow("preferences_window") { - GtkWidget *dialog; + this->config = config; - config->joystick_register_centers (); - dialog = gtk_message_dialog_new (NULL, - (GtkDialogFlags) 0, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - _("Current joystick centers have been saved.")); - gtk_window_set_title (GTK_WINDOW (dialog), _("Calibration Complete")); + gtk_widget_realize(GTK_WIDGET(window->gobj())); + connect_signals(); - gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_destroy (dialog); -} - -static void -event_input_rate_changed (GtkRange *range, gpointer data) -{ - char text[256]; - GtkLabel *label = GTK_LABEL (data); - double value = gtk_range_get_value (range) / 32040.0 * 60.09881389744051; - - snprintf (text, 256, "%.4f hz", value); - - gtk_label_set_text (label, text); -} - -void -event_auto_input_rate_toggled (GtkToggleButton *togglebutton, gpointer data) -{ - Snes9xPreferences *preferences = (Snes9xPreferences *) data; - - if (gtk_toggle_button_get_active (togglebutton)) + for (int i = 0; b_links[i].button_name; i++) { - preferences->set_slider("sound_input_rate", top_level->get_auto_input_rate ()); - gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), false); + const BindingLink &link = b_links[i]; + auto entry = get_object(link.button_name); + entry->set_icon_from_icon_name("edit-clear", Gtk::ENTRY_ICON_SECONDARY); + entry->set_icon_activatable(true, Gtk::ENTRY_ICON_SECONDARY); + entry->signal_icon_release().connect([i, this](Gtk::EntryIconPosition pos, const GdkEventButton *) { + clear_binding(b_links[i].button_name); + }); + } + + #ifdef GDK_WINDOWING_X11 + if (config->allow_xrandr) + { + char size_string[256]; + + for (int i = 0; i < config->xrr_screen_resources->nmode; i++) + { + XRRModeInfo *m = &config->xrr_screen_resources->modes[i]; + unsigned long dotClock = m->dotClock; + if (m->modeFlags & RR_ClockDivideBy2) + dotClock /= 2; + if (m->modeFlags & RR_DoubleScan) + dotClock /= 2; + if (m->modeFlags & RR_DoubleClock) + dotClock *= 2; + + snprintf(size_string, + 256, + "%dx%d @ %.3fHz", + m->width, + m->height, + (double)dotClock / m->hTotal / m->vTotal); + + combo_box_append("resolution_combo", size_string); + } + + if (config->xrr_index > config->xrr_screen_resources->nmode) + config->xrr_index = 0; } else +#endif { - gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), true); + show_widget("resolution_box", false); + } + +#ifdef USE_HQ2X + combo_box_append("scale_method_combo", _("HQ2x")); + combo_box_append("scale_method_combo", _("HQ3x")); + combo_box_append("scale_method_combo", _("HQ4x")); +#endif + +#ifdef USE_XBRZ + combo_box_append("scale_method_combo", _("2xBRZ")); + combo_box_append("scale_method_combo", _("3xBRZ")); + combo_box_append("scale_method_combo", _("4xBRZ")); +#endif + + combo_box_append("hw_accel", _("None - Use software scaler")); + + if (config->allow_opengl) + combo_box_append("hw_accel", + _("OpenGL - Use 3D graphics hardware")); + + if (config->allow_xv) + combo_box_append("hw_accel", + _("XVideo - Use hardware video blitter")); + +#ifdef USE_PORTAUDIO + combo_box_append("sound_driver", _("PortAudio")); +#endif +#ifdef USE_OSS + combo_box_append("sound_driver", _("Open Sound System")); +#endif + combo_box_append("sound_driver", _("SDL")); +#ifdef USE_ALSA + combo_box_append("sound_driver", _("ALSA")); +#endif +#ifdef USE_PULSEAUDIO + combo_box_append("sound_driver", _("PulseAudio")); +#endif +} + +Snes9xPreferences::~Snes9xPreferences () +{ +} + +void Snes9xPreferences::connect_signals() +{ + window->signal_key_press_event().connect(sigc::mem_fun(*this, &Snes9xPreferences::key_pressed), false); + + get_object("control_combo")->signal_changed().connect([&] { + bindings_to_dialog(get_object("control_combo")->get_active_row_number()); + }); + get_object("scale_method_combo")->signal_changed().connect([&] { + int id = get_combo("scale_method_combo"); + show_widget("ntsc_alignment", id == FILTER_NTSC); + show_widget("scanline_alignment", id == FILTER_SCANLINES); + }); + + get_object("hw_accel")->signal_changed().connect([&] { + int id = get_combo("hw_accel"); + show_widget("bilinear_filter", id != HWA_XV); + show_widget("opengl_frame", id == HWA_OPENGL); + show_widget("xv_frame", id == HWA_XV); + }); + + get_object("reset_current_joypad")->signal_pressed().connect(sigc::mem_fun(*this, &Snes9xPreferences::reset_current_joypad)); + get_object("swap_with")->signal_pressed().connect(sigc::mem_fun(*this, &Snes9xPreferences::swap_with)); + get_object("ntsc_composite_preset")->signal_pressed().connect([&] { + config->ntsc_setup = snes_ntsc_composite; + load_ntsc_settings(); + }); + get_object("ntsc_svideo_preset")->signal_pressed().connect([&] { + config->ntsc_setup = snes_ntsc_svideo; + load_ntsc_settings(); + }); + get_object("ntsc_rgb_preset")->signal_pressed().connect([&] { + config->ntsc_setup = snes_ntsc_rgb; + load_ntsc_settings(); + }); + + get_object("ntsc_monochrome_preset")->signal_pressed().connect([&] { + config->ntsc_setup = snes_ntsc_monochrome; + load_ntsc_settings(); + }); + + get_object("fragment_shader_button")->signal_pressed().connect(sigc::mem_fun(*this, &Snes9xPreferences::shader_select)); + get_object("calibrate_button")->signal_pressed().connect(sigc::mem_fun(*this, &Snes9xPreferences::calibration_dialog)); + get_object("sound_input_rate")->signal_value_changed().connect(sigc::mem_fun(*this, &Snes9xPreferences::input_rate_changed)); + get_object("about_button")->signal_clicked().connect(sigc::mem_fun(*this, &Snes9xPreferences::about_dialog)); + get_object("auto_input_rate")->signal_toggled().connect([&] { + auto toggle_button = get_object("auto_input_rate"); + enable_widget("sound_input_rate", toggle_button->get_active()); + if (toggle_button->get_active()) + set_slider("sound_input_rate", top_level->get_auto_input_rate()); + }); + + std::array browse_buttons = { "sram", "savestate", "cheat", "patch", "export" }; + for (auto &name : browse_buttons) + { + get_object((name + "_browse").c_str())->signal_clicked().connect([&, name] { + game_data_browse(name); + }); + + auto entry = get_object((name + "_directory").c_str()); + entry->set_icon_activatable(true, Gtk::ENTRY_ICON_SECONDARY); + entry->signal_icon_release().connect([&, name](Gtk::EntryIconPosition pos, const GdkEventButton *) { + get_object((name + "_directory").c_str())->set_text(SAME_AS_GAME); + }); } } -static void -event_about_clicked (GtkButton *widget, gpointer data) +void Snes9xPreferences::about_dialog() { std::string version_string; - GtkBuilderWindow *about_dialog = new GtkBuilderWindow ("about_dialog"); - Snes9xPreferences *preferences = (Snes9xPreferences *) data; + GtkBuilderWindow about_dialog("about_dialog"); ((version_string += _("Snes9x version: ")) += VERSION) += ", "; ((version_string += _("GTK+ port version: ")) += SNES9X_GTK_VERSION) += "\n"; (version_string += SNES9X_GTK_AUTHORS) += "\n"; (version_string += _("English localization by Brandon Wright")) += "\n"; - GtkLabel *version_string_label = GTK_LABEL (about_dialog->get_widget ("version_string_label")); - gtk_label_set_label (version_string_label, version_string.c_str ()); - gtk_label_set_justify (version_string_label, GTK_JUSTIFY_LEFT); + auto label = get_object("version_string_label"); + label->set_label(version_string); + label->set_justify(Gtk::JUSTIFY_LEFT); + about_dialog.show_widget("preferences_splash", false); - gtk_widget_hide (about_dialog->get_widget ("preferences_splash")); + auto provider = Gtk::CssProvider::create(); + provider->load_from_data("textview {" + " font-family: \"monospace\";" + " font-size: 8pt;" + "}"); + get_object("about_text_view")->reset_style(); + get_object("about_text_view")->get_style_context()->add_provider(provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); -#if GTK_MAJOR_VERSION >= 3 - GtkCssProvider *provider; - GtkStyleContext *context; - - provider = gtk_css_provider_new (); - gtk_css_provider_load_from_data (provider, - "textview {" - " font-family: \"monospace\";" - " font-size: 8pt;" - "}", - -1, - NULL); - context = gtk_widget_get_style_context (about_dialog->get_widget ("about_text_view")); - gtk_style_context_add_provider (context, - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); -#else - PangoFontDescription *monospace; - - monospace = pango_font_description_from_string ("Monospace 7"); - gtk_widget_modify_font (about_dialog->get_widget ("about_text_view"), - monospace); - pango_font_description_free (monospace); -#endif - - - gtk_window_set_transient_for (about_dialog->get_window (), - preferences->get_window ()); - - gtk_dialog_run (GTK_DIALOG (about_dialog->get_window ())); - - delete about_dialog; + about_dialog.window->set_transient_for(*window.get()); + about_dialog.window->set_modal(); + Glib::RefPtr::cast_static(about_dialog.window)->run(); + about_dialog.window->hide(); } -Snes9xPreferences::Snes9xPreferences (Snes9xConfig *config) : - GtkBuilderWindow ("preferences_window") +void Snes9xPreferences::game_data_browse(std::string folder) { - GtkBuilderWindowCallbacks callbacks[] = + auto entry = get_object((folder + "_directory").c_str()); + auto dialog = Gtk::FileChooserDialog(*window.get(), _("Select directory"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_ACCEPT); + + + if (!config->last_directory.empty()) + dialog.set_current_folder(config->last_directory); + + if (entry->get_text().compare(SAME_AS_GAME) != 0) + dialog.set_filename(entry->get_text()); + + auto result = dialog.run(); + dialog.hide(); + + if (result == Gtk::RESPONSE_ACCEPT) + entry->set_text(dialog.get_filename()); +} + +void Snes9xPreferences::input_rate_changed() +{ + double value = get_object("sound_input_rate")->get_value(); + value = value / 32040.0 * 60.09881389744051; + char text[256]; + snprintf(text, 256, "%.4f Hz", value); + get_object("relative_video_rate")->set_label(text); +} + +bool Snes9xPreferences::key_pressed(GdkEventKey *event) +{ + int focus = get_focused_binding(); + + if (focus < 0) + return false; // Pass event on to Gtk + + // Disallow modifier keys if page isn't set to the joypad bindings. + if (get_object("preferences_notebook")->get_current_page() != 4 || + !get_object("use_modifiers")->get_active()) { - { "control_toggle", G_CALLBACK (event_control_toggle) }, - { "on_key_press", G_CALLBACK (event_key_press) }, - { "control_combo_changed", G_CALLBACK (event_control_combo_changed) }, - { "sram_folder_browse", G_CALLBACK (event_sram_folder_browse) }, - { "scale_method_changed", G_CALLBACK (event_scale_method_changed) }, - { "hw_accel_changed", G_CALLBACK (event_hw_accel_changed) }, - { "reset_current_joypad", G_CALLBACK (event_reset_current_joypad) }, - { "swap_with", G_CALLBACK (event_swap_with) }, - { "ntsc_composite_preset", G_CALLBACK (event_ntsc_composite_preset) }, - { "ntsc_svideo_preset", G_CALLBACK (event_ntsc_svideo_preset) }, - { "ntsc_rgb_preset", G_CALLBACK (event_ntsc_rgb_preset) }, - { "ntsc_monochrome_preset", G_CALLBACK (event_ntsc_monochrome_preset) }, - { "shader_select", G_CALLBACK (event_shader_select) }, - { "game_data_browse", G_CALLBACK (event_game_data_browse) }, - { "game_data_clear", G_CALLBACK (event_game_data_clear) }, - { "about_clicked", G_CALLBACK (event_about_clicked) }, - { "auto_input_rate_toggled", G_CALLBACK (event_auto_input_rate_toggled) }, - { "calibrate", G_CALLBACK (event_calibrate) }, - { NULL, NULL } - }; - - last_toggled = NULL; - this->config = config; - - mode_indices = NULL; - - gtk_widget_realize (window); - - signal_connect (callbacks); - - g_signal_connect_data (get_widget ("sound_input_rate"), - "value-changed", - G_CALLBACK (event_input_rate_changed), - get_widget ("relative_video_rate"), - NULL, - (GConnectFlags) 0); - - for (int i = 0; ; i++) - { - const BindingLink &link = b_links[i]; - if (!link.button_name) - break; - - GtkWidget *entry = get_widget(link.button_name); - gtk_entry_set_icon_from_icon_name(GTK_ENTRY(entry), - GTK_ENTRY_ICON_SECONDARY, - "edit-clear"); - gtk_entry_set_icon_activatable(GTK_ENTRY(entry), - GTK_ENTRY_ICON_SECONDARY, - true); - g_signal_connect_data((gpointer)entry, - "icon-release", - G_CALLBACK(event_binding_icon_clear), - (gpointer)this, - NULL, - (GConnectFlags)0); + // Don't allow modifiers that we track to be bound + if (event->keyval == GDK_Control_L || + event->keyval == GDK_Control_R || + event->keyval == GDK_Shift_L || + event->keyval == GDK_Shift_R || + event->keyval == GDK_Alt_L || + event->keyval == GDK_Alt_R) + { + return false; + } } + + Binding key_binding = Binding(event); + + // Allows ESC key to clear the key binding + if (event->keyval == GDK_Escape) + { + if (event->state & GDK_SHIFT_MASK) + { + key_binding.clear(); + } + else + { + focus_next(); + return true; + } + } + + store_binding(b_links[focus].button_name, key_binding); + + return true; } -Snes9xPreferences::~Snes9xPreferences () +void Snes9xPreferences::shader_select() { - delete[] mode_indices; +#ifdef USE_OPENGL + auto entry = get_object("fragment_shader"); + + auto dialog = Gtk::FileChooserDialog(*window.get(), _("Select Shader File")); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_ACCEPT); + if (!config->last_shader_directory.empty()) + dialog.set_current_folder(config->last_shader_directory); + else + dialog.set_filename(entry->get_text()); + + auto result = dialog.run(); + dialog.hide(); + + if (result == Gtk::RESPONSE_ACCEPT) + { + auto folder = dialog.get_current_folder(); + auto filename = dialog.get_filename(); + + if (!folder.empty()) + config->last_shader_directory = folder; + if (!filename.empty()) + entry->set_text(filename); + } +#endif } -void -Snes9xPreferences::load_ntsc_settings () +void Snes9xPreferences::load_ntsc_settings() { - set_slider ("ntsc_artifacts", config->ntsc_setup.artifacts); - set_slider ("ntsc_bleed", config->ntsc_setup.bleed); - set_slider ("ntsc_brightness", config->ntsc_setup.brightness); - set_slider ("ntsc_contrast", config->ntsc_setup.contrast); - set_slider ("ntsc_fringing", config->ntsc_setup.fringing); - set_slider ("ntsc_gamma", config->ntsc_setup.gamma); - set_slider ("ntsc_hue", config->ntsc_setup.hue); - set_check ("ntsc_merge_fields", config->ntsc_setup.merge_fields); - set_slider ("ntsc_resolution", config->ntsc_setup.resolution); - set_slider ("ntsc_saturation", config->ntsc_setup.saturation); - set_slider ("ntsc_sharpness", config->ntsc_setup.sharpness); + set_slider("ntsc_artifacts", config->ntsc_setup.artifacts); + set_slider("ntsc_bleed", config->ntsc_setup.bleed); + set_slider("ntsc_brightness", config->ntsc_setup.brightness); + set_slider("ntsc_contrast", config->ntsc_setup.contrast); + set_slider("ntsc_fringing", config->ntsc_setup.fringing); + set_slider("ntsc_gamma", config->ntsc_setup.gamma); + set_slider("ntsc_hue", config->ntsc_setup.hue); + set_check("ntsc_merge_fields", config->ntsc_setup.merge_fields); + set_slider("ntsc_resolution", config->ntsc_setup.resolution); + set_slider("ntsc_saturation", config->ntsc_setup.saturation); + set_slider("ntsc_sharpness", config->ntsc_setup.sharpness); } -void -Snes9xPreferences::store_ntsc_settings () +void Snes9xPreferences::store_ntsc_settings() { - config->ntsc_setup.artifacts = get_slider ("ntsc_artifacts"); - config->ntsc_setup.bleed = get_slider ("ntsc_bleed"); - config->ntsc_setup.brightness = get_slider ("ntsc_brightness"); - config->ntsc_setup.contrast = get_slider ("ntsc_contrast"); - config->ntsc_setup.fringing = get_slider ("ntsc_fringing"); - config->ntsc_setup.gamma = get_slider ("ntsc_gamma"); - config->ntsc_setup.hue = get_slider ("ntsc_hue"); - config->ntsc_setup.merge_fields = get_check ("ntsc_merge_fields"); - config->ntsc_setup.resolution = get_slider ("ntsc_resolution"); - config->ntsc_setup.saturation = get_slider ("ntsc_saturation"); - config->ntsc_setup.sharpness = get_slider ("ntsc_sharpness"); + config->ntsc_setup.artifacts = get_slider("ntsc_artifacts"); + config->ntsc_setup.bleed = get_slider("ntsc_bleed"); + config->ntsc_setup.brightness = get_slider("ntsc_brightness"); + config->ntsc_setup.contrast = get_slider("ntsc_contrast"); + config->ntsc_setup.fringing = get_slider("ntsc_fringing"); + config->ntsc_setup.gamma = get_slider("ntsc_gamma"); + config->ntsc_setup.hue = get_slider("ntsc_hue"); + config->ntsc_setup.merge_fields = get_check("ntsc_merge_fields"); + config->ntsc_setup.resolution = get_slider("ntsc_resolution"); + config->ntsc_setup.saturation = get_slider("ntsc_saturation"); + config->ntsc_setup.sharpness = get_slider("ntsc_sharpness"); } -void -Snes9xPreferences::move_settings_to_dialog () +void Snes9xPreferences::move_settings_to_dialog() { - set_check ("full_screen_on_open", config->full_screen_on_open); - set_check ("show_time", Settings.DisplayTime); - set_check ("show_frame_rate", Settings.DisplayFrameRate); - set_check ("show_pressed_keys", Settings.DisplayPressedKeys); - set_check ("change_display_resolution", config->change_display_resolution); - set_check ("scale_to_fit", config->scale_to_fit); - set_check ("overscan", config->overscan); - set_check ("multithreading", config->multithreading); - set_combo ("hires_effect", config->hires_effect); - set_check ("maintain_aspect_ratio", config->maintain_aspect_ratio); - set_combo ("aspect_ratio", config->aspect_ratio); - if (config->sram_directory.empty ()) - set_entry_text ("sram_directory", SAME_AS_GAME); + set_check("full_screen_on_open", config->full_screen_on_open); + set_check("show_time", Settings.DisplayTime); + set_check("show_frame_rate", Settings.DisplayFrameRate); + set_check("show_pressed_keys", Settings.DisplayPressedKeys); + set_check("change_display_resolution", config->change_display_resolution); + set_check("scale_to_fit", config->scale_to_fit); + set_check("overscan", config->overscan); + set_check("multithreading", config->multithreading); + set_combo("hires_effect", config->hires_effect); + set_check("maintain_aspect_ratio", config->maintain_aspect_ratio); + set_combo("aspect_ratio", config->aspect_ratio); + if (config->sram_directory.empty()) + set_entry_text("sram_directory", SAME_AS_GAME); else - set_entry_text ("sram_directory", config->sram_directory.c_str ()); - if (config->savestate_directory.empty ()) - set_entry_text ("savestate_directory", SAME_AS_GAME); + set_entry_text("sram_directory", config->sram_directory.c_str()); + if (config->savestate_directory.empty()) + set_entry_text("savestate_directory", SAME_AS_GAME); else - set_entry_text ("savestate_directory", config->savestate_directory.c_str ()); - if (config->patch_directory.empty ()) - set_entry_text ("patch_directory", SAME_AS_GAME); + set_entry_text("savestate_directory", config->savestate_directory.c_str()); + if (config->patch_directory.empty()) + set_entry_text("patch_directory", SAME_AS_GAME); else - set_entry_text ("patch_directory", config->patch_directory.c_str ()); - if (config->cheat_directory.empty ()) - set_entry_text ("cheat_directory", SAME_AS_GAME); + set_entry_text("patch_directory", config->patch_directory.c_str()); + if (config->cheat_directory.empty()) + set_entry_text("cheat_directory", SAME_AS_GAME); else - set_entry_text ("cheat_directory", config->cheat_directory.c_str ()); - if (config->export_directory.empty ()) - set_entry_text ("export_directory", SAME_AS_GAME); + set_entry_text("cheat_directory", config->cheat_directory.c_str()); + if (config->export_directory.empty()) + set_entry_text("export_directory", SAME_AS_GAME); else - set_entry_text ("export_directory", config->export_directory.c_str ()); + set_entry_text("export_directory", config->export_directory.c_str()); - set_combo ("resolution_combo", config->xrr_index); - set_combo ("scale_method_combo", config->scale_method); - set_entry_value ("save_sram_after_sec", Settings.AutoSaveDelay); - set_check ("allow_invalid_vram_access", !Settings.BlockInvalidVRAMAccessMaster); - set_check ("upanddown", Settings.UpAndDown); - set_combo ("default_esc_behavior", config->default_esc_behavior); - set_check ("prevent_screensaver", config->prevent_screensaver); - set_check ("force_inverted_byte_order", config->force_inverted_byte_order); - set_combo ("playback_combo", 7 - config->sound_playback_rate); - set_combo ("hw_accel", combo_value (config->hw_accel)); - set_check ("pause_emulation_on_switch", config->pause_emulation_on_switch); - set_spin ("num_threads", config->num_threads); - set_check ("mute_sound_check", config->mute_sound); - set_check ("mute_sound_turbo_check", config->mute_sound_turbo); - set_slider ("sound_input_rate", config->sound_input_rate); - if (top_level->get_auto_input_rate () == 0) + set_combo("resolution_combo", config->xrr_index); + set_combo("scale_method_combo", config->scale_method); + set_entry_value("save_sram_after_sec", Settings.AutoSaveDelay); + set_check("allow_invalid_vram_access", !Settings.BlockInvalidVRAMAccessMaster); + set_check("upanddown", Settings.UpAndDown); + set_combo("default_esc_behavior", config->default_esc_behavior); + set_check("prevent_screensaver", config->prevent_screensaver); + set_check("force_inverted_byte_order", config->force_inverted_byte_order); + set_combo("playback_combo", 7 - config->sound_playback_rate); + set_combo("hw_accel", combo_value (config->hw_accel)); + set_check("pause_emulation_on_switch", config->pause_emulation_on_switch); + set_spin ("num_threads", config->num_threads); + set_check("mute_sound_check", config->mute_sound); + set_check("mute_sound_turbo_check", config->mute_sound_turbo); + set_slider("sound_input_rate", config->sound_input_rate); + if (top_level->get_auto_input_rate() == 0) { config->auto_input_rate = 0; - gtk_widget_set_sensitive (get_widget ("auto_input_rate"), false); + enable_widget("auto_input_rate", false); } set_check ("auto_input_rate", config->auto_input_rate); - gtk_widget_set_sensitive (get_widget("sound_input_rate"), - config->auto_input_rate ? false : true); + enable_widget("sound_input_rate", config->auto_input_rate ? false : true); set_spin ("sound_buffer_size", config->sound_buffer_size); - set_check ("dynamic_rate_control", Settings.DynamicRateControl); set_spin ("dynamic_rate_limit", Settings.DynamicRateLimit / 1000.0); set_spin ("rewind_buffer_size", config->rewind_buffer_size); set_spin ("rewind_granularity", config->rewind_granularity); set_spin ("superfx_multiplier", Settings.SuperFXClockMultiplier); set_combo ("splash_background", config->splash_image); - -#if GTK_MAJOR_VERSION < 3 - gtk_widget_hide (get_widget ("force_enable_icons")); -#endif set_check ("force_enable_icons", config->enable_icons); int num_sound_drivers = 0; @@ -695,25 +483,10 @@ Snes9xPreferences::move_settings_to_dialog () set_combo ("sound_driver", config->sound_driver); - if (config->scale_method == FILTER_NTSC) - { - gtk_widget_show (get_widget ("ntsc_alignment")); - } - else - { - gtk_widget_hide (get_widget ("ntsc_alignment")); - } + show_widget("ntsc_alignment", config->scale_method == FILTER_NTSC); + show_widget("scanline_alignment", config->scale_method == FILTER_SCANLINES); - if (config->scale_method == FILTER_SCANLINES) - { - gtk_widget_show (get_widget ("scanline_alignment")); - } - else - { - gtk_widget_hide (get_widget ("scanline_alignment")); - } - - load_ntsc_settings (); + load_ntsc_settings(); set_combo ("ntsc_scanline_intensity", config->ntsc_scanline_intensity); set_combo ("scanline_filter_intensity", config->scanline_filter_intensity); @@ -733,137 +506,132 @@ Snes9xPreferences::move_settings_to_dialog () set_spin ("joystick_threshold", config->joystick_threshold); /* Control bindings */ - memcpy (pad, config->pad, (sizeof (JoypadBinding)) * NUM_JOYPADS); - memcpy (shortcut, config->shortcut, (sizeof (Binding)) * NUM_EMU_LINKS); - bindings_to_dialog (0); + pad = config->pad; + shortcut = config->shortcut; + bindings_to_dialog(0); - set_combo ("joypad_to_swap_with", 0); + set_combo("joypad_to_swap_with", 0); #ifdef ALLOW_CPU_OVERCLOCK - gtk_widget_show (get_widget ("cpu_overclock")); - gtk_widget_show (get_widget ("remove_sprite_limit")); - gtk_widget_show (get_widget ("allow_invalid_vram_access")); - gtk_widget_show (get_widget ("echo_buffer_hack")); - gtk_widget_show (get_widget ("soundfilterhbox")); + show_widget("cpu_overclock", true); + show_widget("remove_sprite_limit", true); + show_widget("allow_invalid_vram_access", true); + show_widget("echo_buffer_hack", true); + show_widget("soundfilterhbox", true); - set_check ("cpu_overclock", Settings.OneClockCycle != 6); - set_check ("remove_sprite_limit", Settings.MaxSpriteTilesPerLine != 34); - set_check ("echo_buffer_hack", Settings.SeparateEchoBuffer); - set_combo ("sound_filter", Settings.InterpolationMethod); + set_check("cpu_overclock", Settings.OneClockCycle != 6); + set_check("remove_sprite_limit", Settings.MaxSpriteTilesPerLine != 34); + set_check("echo_buffer_hack", Settings.SeparateEchoBuffer); + set_combo("sound_filter", Settings.InterpolationMethod); #endif } -void -Snes9xPreferences::get_settings_from_dialog () +void Snes9xPreferences::get_settings_from_dialog() { bool sound_needs_restart = false; bool gfx_needs_restart = false; bool sound_sync = false; - Settings.SkipFrames = get_combo ("frameskip_combo"); + Settings.SkipFrames = get_combo("frameskip_combo"); if (Settings.SkipFrames == THROTTLE_SOUND_SYNC) sound_sync = true; - if ((config->sound_driver != get_combo ("sound_driver")) || - (config->mute_sound != get_check ("mute_sound_check")) || - (config->sound_buffer_size != (int) get_spin ("sound_buffer_size")) || - (config->sound_playback_rate != (7 - (get_combo ("playback_combo")))) || - (config->sound_input_rate != get_slider ("sound_input_rate")) || - (config->auto_input_rate != get_check ("auto_input_rate")) || + if ((config->sound_driver != get_combo("sound_driver")) || + (config->mute_sound != get_check("mute_sound_check")) || + (config->sound_buffer_size != (int) get_spin("sound_buffer_size")) || + (config->sound_playback_rate != (7 - (get_combo("playback_combo")))) || + (config->sound_input_rate != get_slider("sound_input_rate")) || + (config->auto_input_rate != get_check("auto_input_rate")) || (Settings.SoundSync != sound_sync) || - (Settings.DynamicRateControl != get_check ("dynamic_rate_control"))) + (Settings.DynamicRateControl != get_check("dynamic_rate_control"))) { sound_needs_restart = true; } - if ((config->change_display_resolution != get_check ("change_display_resolution") || + if ((config->change_display_resolution != get_check("change_display_resolution") || (config->change_display_resolution && - (config->xrr_index != get_combo ("resolution_combo")))) && + (config->xrr_index != get_combo("resolution_combo")))) && config->fullscreen) { top_level->leave_fullscreen_mode (); - config->xrr_index = get_combo ("resolution_combo"); - config->change_display_resolution = get_check ("change_display_resolution"); + config->xrr_index = get_combo("resolution_combo"); + config->change_display_resolution = get_check("change_display_resolution"); top_level->enter_fullscreen_mode (); } else { - config->xrr_index = get_combo ("resolution_combo"); + config->xrr_index = get_combo("resolution_combo"); } - config->change_display_resolution = get_check ("change_display_resolution"); + config->change_display_resolution = get_check("change_display_resolution"); - if (config->splash_image != get_combo ("splash_background")) + if (config->splash_image != get_combo("splash_background")) { - config->splash_image = get_combo ("splash_background"); + config->splash_image = get_combo("splash_background"); if (!config->rom_loaded) { top_level->last_width = top_level->last_height = -1; - top_level->expose(); + top_level->refresh(); } } - config->splash_image = get_combo ("splash_background"); + config->splash_image = get_combo("splash_background"); - if (config->multithreading != get_check ("multithreading")) + if (config->multithreading != get_check("multithreading")) gfx_needs_restart = true; - if (config->hw_accel != hw_accel_value (get_combo ("hw_accel"))) + if (config->hw_accel != hw_accel_value (get_combo("hw_accel"))) gfx_needs_restart = true; - if (config->force_inverted_byte_order != get_check ("force_inverted_byte_order")) + if (config->force_inverted_byte_order != get_check("force_inverted_byte_order")) gfx_needs_restart = true; - config->enable_icons = get_check ("force_enable_icons"); -#if GTK_MAJOR_VERSION >= 3 - auto settings = gtk_settings_get_default(); - g_object_set(settings, - "gtk-menu-images", gui_config->enable_icons, - "gtk_button_images", gui_config->enable_icons, - NULL); -#endif + config->enable_icons = get_check("force_enable_icons"); + auto settings = Gtk::Settings::get_default(); + settings->set_property("gtk-menu-images", gui_config->enable_icons); + settings->set_property("gtk-button-images", gui_config->enable_icons); - config->full_screen_on_open = get_check ("full_screen_on_open"); - Settings.DisplayTime = get_check ("show_time"); - Settings.DisplayFrameRate = get_check ("show_frame_rate"); - Settings.DisplayPressedKeys = get_check ("show_pressed_keys"); - config->scale_to_fit = get_check ("scale_to_fit"); - config->overscan = get_check ("overscan"); - config->maintain_aspect_ratio = get_check ("maintain_aspect_ratio"); - config->aspect_ratio = get_combo ("aspect_ratio"); - config->scale_method = get_combo ("scale_method_combo"); - config->hires_effect = get_combo ("hires_effect"); - config->force_inverted_byte_order = get_check ("force_inverted_byte_order"); - Settings.AutoSaveDelay = get_entry_value ("save_sram_after_sec"); - config->multithreading = get_check ("multithreading"); - config->pause_emulation_on_switch = get_check ("pause_emulation_on_switch"); - Settings.BlockInvalidVRAMAccessMaster = !get_check ("allow_invalid_vram_access"); - Settings.UpAndDown = get_check ("upanddown"); - Settings.SuperFXClockMultiplier = get_spin ("superfx_multiplier"); - config->sound_driver = get_combo ("sound_driver"); - config->sound_playback_rate = 7 - (get_combo ("playback_combo")); - config->sound_buffer_size = get_spin ("sound_buffer_size"); - config->sound_input_rate = get_slider ("sound_input_rate"); - config->auto_input_rate = get_check ("auto_input_rate"); + config->full_screen_on_open = get_check("full_screen_on_open"); + Settings.DisplayTime = get_check("show_time"); + Settings.DisplayFrameRate = get_check("show_frame_rate"); + Settings.DisplayPressedKeys = get_check("show_pressed_keys"); + config->scale_to_fit = get_check("scale_to_fit"); + config->overscan = get_check("overscan"); + config->maintain_aspect_ratio = get_check("maintain_aspect_ratio"); + config->aspect_ratio = get_combo("aspect_ratio"); + config->scale_method = get_combo("scale_method_combo"); + config->hires_effect = get_combo("hires_effect"); + config->force_inverted_byte_order = get_check("force_inverted_byte_order"); + Settings.AutoSaveDelay = get_entry_value("save_sram_after_sec"); + config->multithreading = get_check("multithreading"); + config->pause_emulation_on_switch = get_check("pause_emulation_on_switch"); + Settings.BlockInvalidVRAMAccessMaster = !get_check("allow_invalid_vram_access"); + Settings.UpAndDown = get_check("upanddown"); + Settings.SuperFXClockMultiplier = get_spin("superfx_multiplier"); + config->sound_driver = get_combo("sound_driver"); + config->sound_playback_rate = 7 - (get_combo("playback_combo")); + config->sound_buffer_size = get_spin("sound_buffer_size"); + config->sound_input_rate = get_slider("sound_input_rate"); + config->auto_input_rate = get_check("auto_input_rate"); Settings.SoundSync = sound_sync; - config->mute_sound = get_check ("mute_sound_check"); - config->mute_sound_turbo = get_check ("mute_sound_turbo_check"); - Settings.DynamicRateControl = get_check ("dynamic_rate_control"); - Settings.DynamicRateLimit = (uint32) (get_spin ("dynamic_rate_limit") * 1000); - - store_ntsc_settings (); - config->ntsc_scanline_intensity = get_combo ("ntsc_scanline_intensity"); - config->scanline_filter_intensity = get_combo ("scanline_filter_intensity"); - config->hw_accel = hw_accel_value (get_combo ("hw_accel")); - Settings.BilinearFilter = get_check ("bilinear_filter"); - config->num_threads = get_spin ("num_threads"); - config->default_esc_behavior = get_combo ("default_esc_behavior"); - config->prevent_screensaver = get_check ("prevent_screensaver"); - config->rewind_buffer_size = get_spin ("rewind_buffer_size"); - config->rewind_granularity = get_spin ("rewind_granularity"); + config->mute_sound = get_check("mute_sound_check"); + config->mute_sound_turbo = get_check("mute_sound_turbo_check"); + Settings.DynamicRateControl = get_check("dynamic_rate_control"); + Settings.DynamicRateLimit = (uint32) (get_spin("dynamic_rate_limit") * 1000); + store_ntsc_settings(); + config->ntsc_scanline_intensity = get_combo("ntsc_scanline_intensity"); + config->scanline_filter_intensity = get_combo("scanline_filter_intensity"); + config->hw_accel = hw_accel_value(get_combo("hw_accel")); + Settings.BilinearFilter = get_check("bilinear_filter"); + config->num_threads = get_spin("num_threads"); + config->default_esc_behavior = get_combo("default_esc_behavior"); + config->prevent_screensaver = get_check("prevent_screensaver"); + config->rewind_buffer_size = get_spin("rewind_buffer_size"); + config->rewind_granularity = get_spin("rewind_granularity"); + config->joystick_threshold = get_spin("joystick_threshold"); #ifdef ALLOW_CPU_OVERCLOCK - if (get_check ("cpu_overclock")) + if (get_check("cpu_overclock")) { Settings.OneClockCycle = 4; Settings.OneSlowClockCycle = 5; @@ -876,7 +644,7 @@ Snes9xPreferences::get_settings_from_dialog () Settings.TwoClockCycles = 12; } - if (get_check ("remove_sprite_limit")) + if (get_check("remove_sprite_limit")) { Settings.MaxSpriteTilesPerLine = 128; } @@ -885,113 +653,106 @@ Snes9xPreferences::get_settings_from_dialog () Settings.MaxSpriteTilesPerLine = 34; } - Settings.SeparateEchoBuffer = get_check ("echo_buffer_hack"); - Settings.InterpolationMethod = get_combo ("sound_filter"); + Settings.SeparateEchoBuffer = get_check("echo_buffer_hack"); + Settings.InterpolationMethod = get_combo("sound_filter"); #endif - config->joystick_threshold = get_spin ("joystick_threshold"); - #ifdef USE_OPENGL - int pbo_format = get_combo ("pixel_format") == 1 ? 32 : 16; + int pbo_format = get_combo("pixel_format") == 1 ? 32 : 16; - if (config->sync_to_vblank != get_check ("sync_to_vblank") || - config->use_sync_control != get_check ("use_sync_control") || - config->npot_textures != get_check ("npot_textures") || - config->use_pbos != get_check ("use_pbos") || - config->pbo_format != pbo_format || - config->use_shaders != get_check ("use_shaders") || + if (config->sync_to_vblank != get_check("sync_to_vblank") || + config->use_sync_control != get_check("use_sync_control") || + config->npot_textures != get_check("npot_textures") || + config->use_pbos != get_check("use_pbos") || + config->pbo_format != pbo_format || + config->use_shaders != get_check("use_shaders") || (config->shader_filename.compare(get_entry_text("fragment_shader")))) { gfx_needs_restart = true; } - config->sync_to_vblank = get_check ("sync_to_vblank"); - config->use_pbos = get_check ("use_pbos"); - config->npot_textures = get_check ("npot_textures"); - config->use_shaders = get_check ("use_shaders"); - config->use_glfinish = get_check ("use_glfinish"); - config->use_sync_control = get_check ("use_sync_control"); - - config->shader_filename = get_entry_text ("fragment_shader"); - - config->pbo_format = pbo_format; + config->sync_to_vblank = get_check("sync_to_vblank"); + config->use_pbos = get_check("use_pbos"); + config->npot_textures = get_check("npot_textures"); + config->use_shaders = get_check("use_shaders"); + config->use_glfinish = get_check("use_glfinish"); + config->use_sync_control = get_check("use_sync_control"); + config->shader_filename = get_entry_text ("fragment_shader"); + config->pbo_format = pbo_format; #endif - std::string new_sram_directory = get_entry_text ("sram_directory"); - config->savestate_directory = get_entry_text ("savestate_directory"); - config->patch_directory = get_entry_text ("patch_directory"); - config->cheat_directory = get_entry_text ("cheat_directory"); - config->export_directory = get_entry_text ("export_directory"); + std::string new_sram_directory = get_entry_text("sram_directory"); + config->savestate_directory = get_entry_text("savestate_directory"); + config->patch_directory = get_entry_text("patch_directory"); + config->cheat_directory = get_entry_text("cheat_directory"); + config->export_directory = get_entry_text("export_directory"); - for (auto &i: { &new_sram_directory, - &config->savestate_directory, - &config->patch_directory, - &config->cheat_directory, - &config->export_directory }) + for (auto &i : { &new_sram_directory, + &config->savestate_directory, + &config->patch_directory, + &config->cheat_directory, + &config->export_directory }) { - if (!i->compare (SAME_AS_GAME)) - i->clear (); + if (!i->compare(SAME_AS_GAME)) + i->clear(); } - if (new_sram_directory.compare (config->sram_directory) && config->rom_loaded) + if (new_sram_directory.compare(config->sram_directory) && config->rom_loaded) { - GtkWidget *msg; - int responseid; + auto msg = Gtk::MessageDialog( + *window.get(), + _("Changing the SRAM directory with a game loaded will replace the .srm file in the selected directory with the SRAM from the running game. If this is not what you want, click 'cancel'."), + false, + Gtk::MESSAGE_WARNING, + Gtk::BUTTONS_OK_CANCEL, + true); + msg.set_title(_("Warning: Possible File Overwrite")); - msg = gtk_message_dialog_new (GTK_WINDOW (this->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_WARNING, - GTK_BUTTONS_OK_CANCEL, - _("Changing the SRAM directory with a game loaded will replace the .srm file in the selected directory with the SRAM from the running game. If this is not what you want, click 'cancel'.")); - gtk_window_set_title (GTK_WINDOW (msg), _("Warning: Possible File Overwrite")); + auto result = msg.run(); + msg.hide(); - responseid = gtk_dialog_run (GTK_DIALOG (msg)); - - if (responseid == GTK_RESPONSE_OK) + if (result == Gtk::RESPONSE_OK) { config->sram_directory = new_sram_directory; } else { if (config->sram_directory.empty ()) - set_entry_text ("sram_directory", SAME_AS_GAME); + set_entry_text("sram_directory", SAME_AS_GAME); else - set_entry_text ("sram_directory", config->sram_directory.c_str ()); + set_entry_text("sram_directory", config->sram_directory.c_str ()); } - - gtk_widget_destroy (msg); } else { config->sram_directory = new_sram_directory; } - memcpy (config->pad, pad, (sizeof (JoypadBinding)) * NUM_JOYPADS); - memcpy (config->shortcut, shortcut, (sizeof (Binding)) * NUM_EMU_LINKS); + config->pad = pad; + config->shortcut = shortcut; if (sound_needs_restart) { - S9xPortSoundReinit (); + S9xPortSoundReinit(); } if (gfx_needs_restart) { - S9xReinitDisplay (); + S9xReinitDisplay(); } - S9xDisplayReconfigure (); - S9xDisplayRefresh (top_level->last_width, top_level->last_height); + S9xDisplayReconfigure(); + S9xDisplayRefresh(top_level->last_width, top_level->last_height); - S9xDeinitUpdate (top_level->last_width, top_level->last_height); + S9xDeinitUpdate(top_level->last_width, top_level->last_height); - top_level->configure_widgets (); + top_level->configure_widgets(); if (config->default_esc_behavior != ESC_TOGGLE_MENUBAR) - top_level->leave_fullscreen_mode (); + top_level->leave_fullscreen_mode(); } -int -Snes9xPreferences::hw_accel_value (int combo_value) +int Snes9xPreferences::hw_accel_value(int combo_value) { if (config->allow_opengl && config->allow_xv) return combo_value; @@ -1003,8 +764,7 @@ Snes9xPreferences::hw_accel_value (int combo_value) return combo_value ? 1 : 0; } -int -Snes9xPreferences::combo_value (int hw_accel) +int Snes9xPreferences::combo_value(int hw_accel) { if (config->allow_opengl && config->allow_xv) return hw_accel; @@ -1016,173 +776,50 @@ Snes9xPreferences::combo_value (int hw_accel) return hw_accel == HWA_OPENGL ? 1 : 0; } - -void -Snes9xPreferences::browse_folder_dialog () +void Snes9xPreferences::show() { - GtkWidget *dialog; - char *filename; - gint result; + bool close_dialog; + guint source_id = -1; - dialog = gtk_file_chooser_dialog_new (_("Select Folder"), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); + move_settings_to_dialog(); - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - S9xGetDirectory (HOME_DIR)); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) - { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - - gtk_entry_set_text (GTK_ENTRY (get_widget ("custom_folder_entry")), - filename); - - g_free (filename); - } - - else - { - } - - gtk_widget_destroy (dialog); -} - -void -Snes9xPreferences::show () -{ - gint result; - GtkWidget *combo; - bool close_dialog; - guint source_id = -1; - -#ifdef GDK_WINDOWING_X11 - if (config->allow_xrandr) - { - char size_string[256]; - - combo = get_widget ("resolution_combo"); - - for (int i = 0; i < config->xrr_screen_resources->nmode; i++) - { - XRRModeInfo *m = &config->xrr_screen_resources->modes[i]; - unsigned long dotClock = m->dotClock; - if (m->modeFlags & RR_ClockDivideBy2) - dotClock /= 2; - if (m->modeFlags & RR_DoubleScan) - dotClock /= 2; - if (m->modeFlags & RR_DoubleClock) - dotClock *= 2; - - snprintf (size_string, - 256, - "%dx%d @ %.3fHz", - m->width, - m->height, - (double) dotClock / m->hTotal / m->vTotal); - - combo_box_append (GTK_COMBO_BOX (combo), size_string); - } - - if (config->xrr_index > config->xrr_screen_resources->nmode) - config->xrr_index = 0; - } - else -#endif - { - gtk_widget_hide (get_widget ("resolution_box")); - } - -#ifdef USE_HQ2X - combo = get_widget ("scale_method_combo"); - combo_box_append (GTK_COMBO_BOX (combo), _("HQ2x")); - combo_box_append (GTK_COMBO_BOX (combo), _("HQ3x")); - combo_box_append (GTK_COMBO_BOX (combo), _("HQ4x")); -#endif - -#ifdef USE_XBRZ - combo = get_widget ("scale_method_combo"); - combo_box_append (GTK_COMBO_BOX (combo), _("2xBRZ")); - combo_box_append (GTK_COMBO_BOX (combo), _("3xBRZ")); - combo_box_append (GTK_COMBO_BOX (combo), _("4xBRZ")); -#endif - - combo = get_widget ("hw_accel"); - combo_box_append (GTK_COMBO_BOX (combo), - _("None - Use software scaler")); - - if (config->allow_opengl) - combo_box_append (GTK_COMBO_BOX (combo), - _("OpenGL - Use 3D graphics hardware")); - - if (config->allow_xv) - combo_box_append (GTK_COMBO_BOX (combo), - _("XVideo - Use hardware video blitter")); - - combo = get_widget ("sound_driver"); - -#ifdef USE_PORTAUDIO - combo_box_append (GTK_COMBO_BOX (combo), - _("PortAudio")); -#endif -#ifdef USE_OSS - combo_box_append (GTK_COMBO_BOX (combo), - _("Open Sound System")); -#endif - combo_box_append (GTK_COMBO_BOX (combo), - _("SDL")); -#ifdef USE_ALSA - combo_box_append (GTK_COMBO_BOX (combo), - _("ALSA")); -#endif -#ifdef USE_PULSEAUDIO - combo_box_append (GTK_COMBO_BOX (combo), - _("PulseAudio")); -#endif - - move_settings_to_dialog (); - - S9xGrabJoysticks (); - source_id = g_timeout_add (100, poll_joystick, (gpointer) this); + S9xGrabJoysticks(); + source_id = g_timeout_add(100, poll_joystick, (gpointer)this); if (config->preferences_width > 0 && config->preferences_height > 0) resize (config->preferences_width, config->preferences_height); - gtk_notebook_set_current_page(GTK_NOTEBOOK(get_widget("display_notebook")), config->current_display_tab); + get_object("display_notebook")->set_current_page(config->current_display_tab); + + auto dialog = Glib::RefPtr::cast_static(window); for (close_dialog = false; !close_dialog; ) { - gtk_widget_show (window); - result = gtk_dialog_run (GTK_DIALOG (window)); + dialog->show(); + auto result = dialog->run(); - config->preferences_width = get_width (); - config->preferences_height = get_height (); - config->current_display_tab = gtk_notebook_get_current_page(GTK_NOTEBOOK(get_widget("display_notebook"))); + config->preferences_width = get_width(); + config->preferences_height = get_height(); + config->current_display_tab = get_object("display_notebook")->get_current_page(); switch (result) { case GTK_RESPONSE_OK: - get_settings_from_dialog (); - config->save_config_file (); + get_settings_from_dialog(); + config->save_config_file(); close_dialog = true; - gtk_widget_hide (window); + dialog->hide(); break; case GTK_RESPONSE_APPLY: - get_settings_from_dialog (); - config->save_config_file (); + get_settings_from_dialog(); + config->save_config_file(); break; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_DELETE_EVENT: - gtk_widget_hide (window); + dialog->hide(); close_dialog = true; break; @@ -1191,65 +828,59 @@ Snes9xPreferences::show () } } - g_source_remove (source_id); - S9xReleaseJoysticks (); - - gtk_widget_destroy (window); + g_source_remove(source_id); + S9xReleaseJoysticks(); } -void -Snes9xPreferences::focus_next () +void Snes9xPreferences::focus_next() { - int next = get_focused_binding () + 1; + int next = get_focused_binding() + 1; - for (int i = 0; b_breaks [i] != -1; i++) + for (int i = 0; b_breaks[i] != -1; i++) { if (b_breaks[i] == next) next = -1; } if (next > 0) - gtk_widget_grab_focus (get_widget (b_links [next].button_name)); + get_object(b_links[next].button_name)->grab_focus(); else - gtk_widget_grab_focus (get_widget ("cancel_button")); + get_object("cancel_button")->grab_focus(); } -void -Snes9xPreferences::swap_with () +void Snes9xPreferences::swap_with() { - JoypadBinding mediator; - int source_joypad = get_combo ("control_combo"); - int dest_joypad = get_combo ("joypad_to_swap_with"); + JoypadBinding tmp; + int source_joypad = get_combo("control_combo"); + int dest_joypad = get_combo("joypad_to_swap_with"); - mediator = pad[source_joypad]; + tmp = pad[source_joypad]; pad[source_joypad] = pad[dest_joypad]; - pad[dest_joypad] = mediator; + pad[dest_joypad] = tmp; - bindings_to_dialog (source_joypad); + bindings_to_dialog(source_joypad); } -void -Snes9xPreferences::reset_current_joypad () +void Snes9xPreferences::reset_current_joypad() { - int joypad = get_combo ("control_combo"); + int joypad = get_combo("control_combo"); for (unsigned int i = 0; i < NUM_JOYPAD_LINKS; i++) { pad[joypad].data[i].clear(); } - bindings_to_dialog (joypad); + bindings_to_dialog(joypad); } -void -Snes9xPreferences::store_binding (const char *string, Binding binding) +void Snes9xPreferences::store_binding(const char *string, Binding binding) { - int current_joypad = get_combo ("control_combo"); - Binding *pad_bindings = (Binding *) (&pad[current_joypad]); + int current_joypad = get_combo("control_combo"); + Binding *pad_bindings = (Binding *)(&pad[current_joypad]); for (int i = 0; i < NUM_JOYPAD_LINKS; i++) { - if (!strcmp (b_links[i].button_name, string)) + if (!strcmp(b_links[i].button_name, string)) { pad_bindings[i] = binding; } @@ -1260,30 +891,29 @@ Snes9xPreferences::store_binding (const char *string, Binding binding) for (int i = NUM_JOYPAD_LINKS; b_links[i].button_name; i++) { - if (!strcmp (b_links[i].button_name, string)) + if (!strcmp(b_links[i].button_name, string)) { shortcut[i - NUM_JOYPAD_LINKS] = binding; } else { - if (shortcut[i - NUM_JOYPAD_LINKS].matches (binding)) + if (shortcut[i - NUM_JOYPAD_LINKS] == binding) { - shortcut[i - NUM_JOYPAD_LINKS].clear (); + shortcut[i - NUM_JOYPAD_LINKS].clear(); } } } - focus_next (); + focus_next(); - bindings_to_dialog (get_combo ("control_combo")); + bindings_to_dialog(get_combo("control_combo")); } -int -Snes9xPreferences::get_focused_binding () +int Snes9xPreferences::get_focused_binding() { for (int i = 0; b_links[i].button_name; i++) { - if (has_focus (b_links[i].button_name)) + if (has_focus(b_links[i].button_name)) return i; } @@ -1324,23 +954,31 @@ void Snes9xPreferences::clear_binding(const char *name) } } -void -Snes9xPreferences::bindings_to_dialog (int joypad) +void Snes9xPreferences::bindings_to_dialog(int joypad) { - char name[256]; - Binding *bindings = (Binding *) &pad[joypad].data; + char name[256]; + Binding *bindings = (Binding *)&pad[joypad].data; - set_combo ("control_combo", joypad); + set_combo("control_combo", joypad); for (int i = 0; i < NUM_JOYPAD_LINKS; i++) { - bindings[i].to_string (name); - set_entry_text (b_links[i].button_name, name); + bindings[i].to_string(name); + set_entry_text(b_links[i].button_name, name); } for (int i = NUM_JOYPAD_LINKS; b_links[i].button_name; i++) { - shortcut[i - NUM_JOYPAD_LINKS].to_string (name); - set_entry_text (b_links[i].button_name, name); + shortcut[i - NUM_JOYPAD_LINKS].to_string(name); + set_entry_text(b_links[i].button_name, name); } } + +void Snes9xPreferences::calibration_dialog() +{ + config->joystick_register_centers(); + auto dialog = Gtk::MessageDialog(_("Current joystick centers have been saved.")); + dialog.set_title(_("Calibration Complete")); + dialog.run(); + dialog.hide(); +} diff --git a/gtk/src/gtk_preferences.h b/gtk/src/gtk_preferences.h index 71e619b4..fea41256 100644 --- a/gtk/src/gtk_preferences.h +++ b/gtk/src/gtk_preferences.h @@ -7,45 +7,48 @@ #ifndef __GTK_PREFERENCES_H #define __GTK_PREFERENCES_H -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include "gtk_s9x.h" #include "gtk_builder_window.h" -gboolean snes9x_preferences_open (GtkWidget *widget, - gpointer data); +void snes9x_preferences_create(Snes9xConfig *config); +void snes9x_preferences_open(Snes9xWindow *window); class Snes9xPreferences : public GtkBuilderWindow { - public: - Snes9xPreferences (Snes9xConfig *config); - ~Snes9xPreferences (); - void show (); - void bindings_to_dialog (int joypad); - int get_focused_binding (); - void store_binding (const char *string, Binding binding); - void browse_folder_dialog (); - int hw_accel_value (int combo_value); - int combo_value (int hw_accel); - void focus_next (); - void swap_with (); - void clear_binding (const char *name); - void reset_current_joypad (); - void load_ntsc_settings (); - void store_ntsc_settings (); - void calibration_dialog (); + public: + Snes9xPreferences(Snes9xConfig *config); + ~Snes9xPreferences(); + void show(); + void bindings_to_dialog(int joypad); + int get_focused_binding(); + void store_binding(const char *string, Binding binding); + int hw_accel_value(int combo_value); + int combo_value(int hw_accel); + void focus_next(); + void swap_with(); + void clear_binding(const char *name); + void reset_current_joypad(); + void load_ntsc_settings(); + void store_ntsc_settings(); + void calibration_dialog(); + void connect_signals(); + void input_rate_changed(); + bool key_pressed(GdkEventKey *event); + void scale_method_changed(); + void shader_select(); + void game_data_browse(std::string folder); + void about_dialog(); - Snes9xConfig *config; - GtkToggleButton *last_toggled; - bool awaiting_key; - bool polling_joystick; - JoypadBinding pad[NUM_JOYPADS]; - Binding shortcut[NUM_EMU_LINKS]; + Snes9xConfig *config; + bool awaiting_key; + bool polling_joystick; + std::array pad; + std::array shortcut; - private: - void get_settings_from_dialog (); - void move_settings_to_dialog (); - - unsigned int *mode_indices; + private: + void get_settings_from_dialog(); + void move_settings_to_dialog(); }; #endif /* __GTK_PREFERENCES_H */ diff --git a/gtk/src/gtk_s9x.cpp b/gtk/src/gtk_s9x.cpp index fcd52656..2513b1a1 100644 --- a/gtk/src/gtk_s9x.cpp +++ b/gtk/src/gtk_s9x.cpp @@ -6,93 +6,96 @@ #include #include -#include "gtk_2_3_compat.h" +#include "giomm/application.h" +#include "glibmm/main.h" +#include "gtk_compat.h" +#include "gtk_config.h" #include "gtk_s9x.h" #include "gtk_control.h" #include "gtk_sound.h" #include "gtk_display.h" #include "gtk_netplay.h" #include "statemanager.h" +#include "background_particles.h" +#include "snes9x.h" +#include "display.h" +#include "apu/apu.h" +#include "netplay.h" +#include "movie.h" +#include "controls.h" +#include "snapshot.h" +#include "gfx.h" +#include "memmap.h" +#include "ppu.h" - -void S9xPostRomInit (); -static void S9xThrottle (); -static void S9xCheckPointerTimer (); -static gboolean S9xIdleFunc (gpointer data); -static gboolean S9xPauseFunc (gpointer data); -static gboolean S9xScreenSaverCheckFunc (gpointer data); +static void S9xThrottle(int); +static void S9xCheckPointerTimer(); +static bool S9xIdleFunc(); +static bool S9xPauseFunc(); +static bool S9xScreenSaverCheckFunc(); Snes9xWindow *top_level; Snes9xConfig *gui_config; StateManager state_manager; -gint64 frame_clock = -1; -gint64 pointer_timestamp = -1; +gint64 frame_clock = -1; +gint64 pointer_timestamp = -1; -void S9xTerm (int signal) +Background::Particles particles(Background::Particles::Snow); + +static void S9xTerm(int signal) { - S9xExit (); + S9xExit(); } -int main (int argc, char *argv[]) +int main(int argc, char *argv[]) { struct sigaction sig_callback; + auto app = Gtk::Application::create("com.snes9x.gtk", Gio::APPLICATION_NON_UNIQUE); - gtk_init (&argc, &argv); + setlocale(LC_ALL, ""); + bindtextdomain(GETTEXT_PACKAGE, SNES9XLOCALEDIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); - g_set_prgname ("snes9x-gtk"); - g_set_application_name ("Snes9x"); + memset(&Settings, 0, sizeof(Settings)); - setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, SNES9XLOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); + // Original config fills out values this port doesn't. + S9xLoadConfigFiles(argv, argc); - memset (&Settings, 0, sizeof (Settings)); + gui_config = new Snes9xConfig(); - /* Allow original config file for backend settings */ - S9xLoadConfigFiles (argv, argc); + S9xInitInputDevices(); - /* Perform our config here */ - gui_config = new Snes9xConfig (); + gui_config->load_config_file(); - S9xInitInputDevices (); + char *rom_filename = S9xParseArgs(argv, argc); - gui_config->load_config_file (); + auto settings = Gtk::Settings::get_default(); + settings->set_property("gtk-menu-images", gui_config->enable_icons); + settings->set_property("gtk-button-images", gui_config->enable_icons); - char *rom_filename = S9xParseArgs (argv, argc); + S9xReportControllers(); -#if GTK_MAJOR_VERSION >= 3 - auto settings = gtk_settings_get_default(); - g_object_set(settings, - "gtk-menu-images", gui_config->enable_icons, - "gtk_button_images", gui_config->enable_icons, - NULL); -#endif + if (!Memory.Init() || !S9xInitAPU()) + exit(3); - S9xReportControllers (); + top_level = new Snes9xWindow(gui_config); - if (!Memory.Init () || !S9xInitAPU ()) - exit (3); - - top_level = new Snes9xWindow (gui_config); - - /* If we're going to fullscreen, do it before showing window to avoid flicker. */ + // Setting fullscreen before showing the window avoids some flicker. if ((gui_config->full_screen_on_open && rom_filename) || (gui_config->fullscreen)) - gtk_window_fullscreen (top_level->get_window ()); + top_level->window->fullscreen(); - top_level->show (); + top_level->show(); - S9xInitDisplay (argc, argv); + S9xInitDisplay(argc, argv); - Memory.PostRomInitFunc = S9xPostRomInit; - - S9xPortSoundInit (); + S9xPortSoundInit(); for (int port = 0; port < 2; port++) { enum controllers type; int8 id; - S9xGetController (port, &type, &id, &id, &id, &id); + S9xGetController(port, &type, &id, &id, &id, &id); std::string device_type; switch (type) @@ -113,96 +116,97 @@ int main (int argc, char *argv[]) device_type = "nothingpluggedin"; } - device_type += std::to_string (port + 1); - top_level->set_menu_item_selected (device_type.c_str ()); + device_type += std::to_string(port + 1); + top_level->set_menu_item_selected(device_type.c_str()); } - gui_config->rebind_keys (); - top_level->update_accels (); + gui_config->rebind_keys(); + top_level->update_accelerators(); Settings.Paused = true; - g_timeout_add (100, S9xPauseFunc, NULL); - g_timeout_add (10000, S9xScreenSaverCheckFunc, NULL); - S9xNoROMLoaded (); + Glib::signal_timeout().connect(sigc::ptr_fun(S9xPauseFunc), 100); + Glib::signal_timeout().connect(sigc::ptr_fun(S9xScreenSaverCheckFunc), 10000); + + S9xNoROMLoaded(); if (rom_filename) { - if (S9xOpenROM (rom_filename) && gui_config->full_screen_on_open) - gtk_window_unfullscreen (top_level->get_window()); + if (S9xOpenROM(rom_filename) && gui_config->full_screen_on_open) + top_level->window->unfullscreen(); } - memset (&sig_callback, 0, sizeof (struct sigaction)); + memset(&sig_callback, 0, sizeof(struct sigaction)); sig_callback.sa_handler = S9xTerm; - sigaction (15 /* SIGTERM */, &sig_callback, NULL); - sigaction (3 /* SIGQUIT */, &sig_callback, NULL); - sigaction (2 /* SIGINT */, &sig_callback, NULL); + sigaction(15, &sig_callback, NULL); // SIGTERM + sigaction(3, &sig_callback, NULL); // SIGQUIT + sigaction(2, &sig_callback, NULL); // SIGINT + // Perform the complete fullscreen process, including mode sets, which + // didn't happen in the earlier Gtk call. if (gui_config->fullscreen) - { - top_level->enter_fullscreen_mode (); - } + top_level->enter_fullscreen_mode(); - gui_config->flush_joysticks (); + gui_config->flush_joysticks(); if (rom_filename && *Settings.InitialSnapshotFilename) S9xUnfreezeGame(Settings.InitialSnapshotFilename); - gtk_main (); + app->run(*top_level->window.get()); return 0; } -int S9xOpenROM (const char *rom_filename) +int S9xOpenROM(const char *rom_filename) { uint32 flags; - bool loaded; + bool loaded; if (gui_config->rom_loaded) { - S9xAutoSaveSRAM (); + S9xAutoSaveSRAM(); } - S9xNetplayDisconnect (); + S9xNetplayDisconnect(); flags = CPU.Flags; loaded = false; if (Settings.Multi) - loaded = Memory.LoadMultiCart (Settings.CartAName, Settings.CartBName); + loaded = Memory.LoadMultiCart(Settings.CartAName, Settings.CartBName); else if (rom_filename) - loaded = Memory.LoadROM (rom_filename); + loaded = Memory.LoadROM(rom_filename); Settings.StopEmulation = !loaded; if (!loaded && rom_filename) { - char dir [_MAX_DIR + 1]; - char drive [_MAX_DRIVE + 1]; - char name [_MAX_FNAME + 1]; - char ext [_MAX_EXT + 1]; - char fname [_MAX_PATH + 1]; + char dir[_MAX_DIR + 1]; + char drive[_MAX_DRIVE + 1]; + char name[_MAX_FNAME + 1]; + char ext[_MAX_EXT + 1]; + char fname[_MAX_PATH + 1]; - _splitpath (rom_filename, drive, dir, name, ext); - _makepath (fname, drive, dir, name, ext); + _splitpath(rom_filename, drive, dir, name, ext); + _makepath(fname, drive, dir, name, ext); - strcpy (fname, S9xGetDirectory (ROM_DIR)); - strcat (fname, SLASH_STR); - strcat (fname, name); + strcpy(fname, S9xGetDirectory(ROM_DIR)); + strcat(fname, SLASH_STR); + strcat(fname, name); - if (ext [0]) + if (ext[0]) { - strcat (fname, "."); - strcat (fname, ext); + strcat(fname, "."); + strcat(fname, ext); } - _splitpath (fname, drive, dir, name, ext); - _makepath (fname, drive, dir, name, ext); + _splitpath(fname, drive, dir, name, ext); + _makepath(fname, drive, dir, name, ext); - if ((Settings.StopEmulation = !Memory.LoadROM (fname))) + if ((Settings.StopEmulation = !Memory.LoadROM(fname))) { - fprintf (stderr, _("Error opening: %s\n"), rom_filename); + fprintf(stderr, _("Error opening: %s\n"), rom_filename); loaded = false; } @@ -212,123 +216,134 @@ int S9xOpenROM (const char *rom_filename) if (loaded) { - Memory.LoadSRAM (S9xGetFilename (".srm", SRAM_DIR)); + Memory.LoadSRAM(S9xGetFilename(".srm", SRAM_DIR)); } else { CPU.Flags = flags; Settings.Paused = true; - S9xNoROMLoaded (); - top_level->refresh (); + S9xNoROMLoaded(); + top_level->refresh(); return 1; } CPU.Flags = flags; - if (state_manager.init (gui_config->rewind_buffer_size * 1024 * 1024)) + if (state_manager.init(gui_config->rewind_buffer_size * 1024 * 1024)) { - printf ("Using rewind buffer of %uMB\n", gui_config->rewind_buffer_size); + printf("Using rewind buffer of %uMB\n", gui_config->rewind_buffer_size); } - S9xROMLoaded (); + S9xROMLoaded(); return 0; } -void S9xROMLoaded () +void S9xROMLoaded() { gui_config->rom_loaded = true; - top_level->configure_widgets (); + top_level->configure_widgets(); if (gui_config->full_screen_on_open) { Settings.Paused = false; - top_level->enter_fullscreen_mode (); + top_level->enter_fullscreen_mode(); } - S9xSoundStart (); + S9xSoundStart(); } -void S9xNoROMLoaded () +void S9xNoROMLoaded() { - S9xSoundStop (); + S9xSoundStop(); gui_config->rom_loaded = false; - S9xDisplayRefresh (-1, -1); - top_level->configure_widgets (); + S9xDisplayRefresh(-1, -1); + top_level->configure_widgets(); } -static gboolean S9xPauseFunc (gpointer data) +static bool S9xPauseFunc() { - S9xProcessEvents (true); + S9xProcessEvents(true); - if (!gui_config->rom_loaded) - return true; - - if (!S9xNetplayPush ()) + if (!S9xNetplayPush()) { - S9xNetplayPop (); + S9xNetplayPop(); } if (!Settings.Paused) /* Coming out of pause */ { /* Clear joystick queues */ - gui_config->flush_joysticks (); + gui_config->flush_joysticks(); - S9xSetSoundMute (false); - S9xSoundStart (); + S9xSoundStart(); if (Settings.NetPlay && NetPlay.Connected) { - S9xNPSendPause (false); + S9xNPSendPause(false); } /* Resume high-performance callback */ - g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, - S9xIdleFunc, - NULL, - NULL); + Glib::signal_idle().connect(sigc::ptr_fun(S9xIdleFunc)); + return false; } - return true; + if (!gui_config->rom_loaded) + { + if (gui_config->splash_image >= SPLASH_IMAGE_STARFIELD) + { + if (gui_config->splash_image == SPLASH_IMAGE_STARFIELD) + particles.setmode(Background::Particles::Stars); + else + particles.setmode(Background::Particles::Snow); + + S9xThrottle(THROTTLE_TIMER); + particles.advance(); + particles.copyto(GFX.Screen, GFX.Pitch); + S9xDeinitUpdate(256, 224); + } + } + + Glib::signal_timeout().connect(sigc::ptr_fun(S9xPauseFunc), 8); + + return false; } -gboolean S9xIdleFunc (gpointer data) +static bool S9xIdleFunc() { - if (Settings.Paused) + if (Settings.Paused && gui_config->rom_loaded) { - S9xSetSoundMute (gui_config->mute_sound); - S9xSoundStop (); + S9xSoundStop(); - gui_config->flush_joysticks (); + gui_config->flush_joysticks(); if (Settings.NetPlay && NetPlay.Connected) { - S9xNPSendPause (true); + S9xNPSendPause(true); } /* Move to a timer-based function to use less CPU */ - g_timeout_add (100, S9xPauseFunc, NULL); + Glib::signal_timeout().connect(sigc::ptr_fun(S9xPauseFunc), 8); return false; } - S9xCheckPointerTimer (); + S9xCheckPointerTimer(); - S9xProcessEvents (true); + S9xProcessEvents(true); - if (!S9xDisplayDriverIsReady ()) + if (!S9xDisplayDriverIsReady()) { usleep(100); return true; } - S9xThrottle (); + S9xThrottle(Settings.SkipFrames); - if (!S9xNetplayPush ()) + if (!S9xNetplayPush()) { - if(Settings.Rewinding) + if (Settings.Rewinding) { uint16 joypads[8]; for (int i = 0; i < 8; i++) @@ -337,115 +352,104 @@ gboolean S9xIdleFunc (gpointer data) Settings.Rewinding = state_manager.pop(); for (int i = 0; i < 8; i++) - MovieSetJoypad (i, joypads[i]); + MovieSetJoypad(i, joypads[i]); } - else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0) + else if (IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0) state_manager.push(); - static int muted_from_turbo = false; - static int mute_saved_state = false; + if ((Settings.TurboMode || Settings.Rewinding) && gui_config->mute_sound_turbo) + Settings.Mute |= 0x80; + else + Settings.Mute &= ~0x80; - if (Settings.TurboMode && !muted_from_turbo && gui_config->mute_sound_turbo) - { - muted_from_turbo = true; - mute_saved_state = Settings.Mute; - S9xSetSoundMute (true); - } + S9xMainLoop(); - if (!Settings.TurboMode && muted_from_turbo) - { - muted_from_turbo = false; - Settings.Mute = mute_saved_state; - } - - S9xMainLoop (); - - S9xNetplayPop (); + S9xNetplayPop(); } return true; } -gboolean S9xScreenSaverCheckFunc (gpointer data) +static bool S9xScreenSaverCheckFunc() { if (!Settings.Paused && (gui_config->screensaver_needs_reset || gui_config->prevent_screensaver)) - top_level->reset_screensaver (); + top_level->reset_screensaver(); return true; } /* Snes9x core hooks */ -void S9xMessage (int type, int number, const char *message) +void S9xMessage(int type, int number, const char *message) { switch (number) { - case S9X_MOVIE_INFO: - S9xSetInfoString (message); + case S9X_MOVIE_INFO: + S9xSetInfoString(message); break; - default: + default: break; } } /* Varies from ParseArgs because this one is for the OS port to handle */ -void S9xParseArg (char **argv, int &i, int argc) +void S9xParseArg(char **argv, int &i, int argc) { - if (!strcasecmp (argv[i], "-filter")) + if (!strcasecmp(argv[i], "-filter")) { if ((++i) < argc) { - if (!strcasecmp (argv[i], "none")) + if (!strcasecmp(argv[i], "none")) { gui_config->scale_method = FILTER_NONE; } - else if (!strcasecmp (argv[i], "supereagle")) + else if (!strcasecmp(argv[i], "supereagle")) { gui_config->scale_method = FILTER_SUPEREAGLE; } - else if (!strcasecmp (argv[i], "2xsai")) + else if (!strcasecmp(argv[i], "2xsai")) { gui_config->scale_method = FILTER_2XSAI; } - else if (!strcasecmp (argv[i], "super2xsai")) + else if (!strcasecmp(argv[i], "super2xsai")) { gui_config->scale_method = FILTER_SUPER2XSAI; } #ifdef USE_HQ2X - else if (!strcasecmp (argv[i], "hq2x")) + else if (!strcasecmp(argv[i], "hq2x")) { gui_config->scale_method = FILTER_HQ2X; } - else if (!strcasecmp (argv[i], "hq3x")) + else if (!strcasecmp(argv[i], "hq3x")) { gui_config->scale_method = FILTER_HQ3X; } - else if (!strcasecmp (argv[i], "hq4x")) + else if (!strcasecmp(argv[i], "hq4x")) { gui_config->scale_method = FILTER_HQ4X; } #endif /* USE_HQ2X */ #ifdef USE_XBRZ - else if (!strcasecmp (argv[i], "2xbrz")) + else if (!strcasecmp(argv[i], "2xbrz")) { gui_config->scale_method = FILTER_2XBRZ; } - else if (!strcasecmp (argv[i], "3xbrz")) + else if (!strcasecmp(argv[i], "3xbrz")) { gui_config->scale_method = FILTER_3XBRZ; } - else if (!strcasecmp (argv[i], "4xbrz")) + else if (!strcasecmp(argv[i], "4xbrz")) { gui_config->scale_method = FILTER_4XBRZ; } #endif /* USE_XBRZ */ - else if (!strcasecmp (argv[i], "epx")) + else if (!strcasecmp(argv[i], "epx")) { gui_config->scale_method = FILTER_EPX; } - else if (!strcasecmp (argv[i], "ntsc")) + else if (!strcasecmp(argv[i], "ntsc")) { gui_config->scale_method = FILTER_NTSC; } @@ -455,20 +459,20 @@ void S9xParseArg (char **argv, int &i, int argc) } } } - else if (!strcasecmp (argv[i], "-mutesound")) + else if (!strcasecmp(argv[i], "-mutesound")) { gui_config->mute_sound = true; } } -static void S9xThrottle () +static void S9xThrottle(int method) { gint64 now; - if (S9xNetplaySyncSpeed ()) + if (S9xNetplaySyncSpeed()) return; - now = g_get_monotonic_time (); + now = g_get_monotonic_time(); if (Settings.HighSpeedSeek > 0) { @@ -483,8 +487,7 @@ static void S9xThrottle () if (Settings.TurboMode) { IPPU.FrameSkip++; - if ((IPPU.FrameSkip >= Settings.TurboSkipFrames) - && !Settings.HighSpeedSeek) + if ((IPPU.FrameSkip >= Settings.TurboSkipFrames) && !Settings.HighSpeedSeek) { IPPU.FrameSkip = 0; IPPU.SkippedFrames = 0; @@ -508,15 +511,15 @@ static void S9xThrottle () frame_clock = now; } - if (Settings.SkipFrames == THROTTLE_SOUND_SYNC || - Settings.SkipFrames == THROTTLE_NONE) + if (method == THROTTLE_SOUND_SYNC || + method == THROTTLE_NONE) { frame_clock = now; IPPU.SkippedFrames = 0; } else // THROTTLE_TIMER or THROTTLE_TIMER_FRAMESKIP { - if (Settings.SkipFrames == THROTTLE_TIMER_FRAMESKIP) + if (method == THROTTLE_TIMER_FRAMESKIP) { if (now - frame_clock > Settings.FrameTime) { @@ -537,8 +540,8 @@ static void S9xThrottle () while (now - frame_clock < Settings.FrameTime) { - usleep (100); - now = g_get_monotonic_time (); + usleep(100); + now = g_get_monotonic_time(); } frame_clock += Settings.FrameTime; @@ -547,129 +550,47 @@ static void S9xThrottle () } } -void S9xSyncSpeed () +void S9xSyncSpeed() { } -static void S9xCheckPointerTimer () +static void S9xCheckPointerTimer() { if (!gui_config->pointer_is_visible) return; - if (g_get_monotonic_time () - gui_config->pointer_timestamp > 1000000) + if (g_get_monotonic_time() - gui_config->pointer_timestamp > 1000000) { - top_level->hide_mouse_cursor (); + top_level->hide_mouse_cursor(); gui_config->pointer_is_visible = false; } } /* Final exit point, issues exit (0) */ -void S9xExit () +void S9xExit() { - gui_config->save_config_file (); + gui_config->save_config_file(); - top_level->leave_fullscreen_mode (); + top_level->leave_fullscreen_mode(); - S9xPortSoundDeinit (); + S9xPortSoundDeinit(); Settings.StopEmulation = true; if (gui_config->rom_loaded) { - S9xAutoSaveSRAM (); + S9xAutoSaveSRAM(); } - S9xDeinitAPU (); + S9xDeinitAPU(); - S9xDeinitInputDevices (); - S9xDeinitDisplay (); - - gtk_main_quit (); + S9xDeinitInputDevices(); + S9xDeinitDisplay(); delete top_level; delete gui_config; - exit (0); -} - -void -S9xPostRomInit () -{ - if (!strncmp ((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) - { - switch (Memory.NSRTHeader[29]) - { - case 0: //Everything goes - break; - - case 0x10: //Mouse in Port 0 - S9xSetController (0, CTL_MOUSE, 0, 0, 0, 0); - top_level->set_menu_item_selected ("mouse1"); - break; - - case 0x01: //Mouse in Port 1 - S9xSetController (1, CTL_MOUSE, 1, 0, 0, 0); - top_level->set_menu_item_selected ("mouse2"); - break; - - case 0x03: //Super Scope in Port 1 - S9xSetController (1, CTL_SUPERSCOPE, 0, 0, 0, 0); - top_level->set_menu_item_selected ("superscope1"); - break; - - case 0x06: //Multitap in Port 1 - S9xSetController (1, CTL_MP5, 1, 2, 3, 4); - top_level->set_menu_item_selected ("multitap1"); - break; - - case 0x66: //Multitap in Ports 0 and 1 - S9xSetController (0, CTL_MP5, 0, 1, 2, 3); - S9xSetController (1, CTL_MP5, 4, 5, 6, 7); - top_level->set_menu_item_selected ("multitap1"); - top_level->set_menu_item_selected ("multitap2"); - break; - - case 0x08: //Multitap in Port 1, Mouse in new Port 1 - S9xSetController (1, CTL_MOUSE, 1, 0, 0, 0); - //There should be a toggle here for putting in Multitap instead - top_level->set_menu_item_selected ("mouse2"); - break; - - case 0x04: //Pad or Super Scope in Port 1 - S9xSetController (1, CTL_SUPERSCOPE, 0, 0, 0, 0); - top_level->set_menu_item_selected ("superscope2"); - //There should be a toggle here for putting in a pad instead - break; - - case 0x05: //Justifier - Must ask user... - S9xSetController (1, CTL_JUSTIFIER, 1, 0, 0, 0); - //There should be a toggle here for how many justifiers - break; - - case 0x20: //Pad or Mouse in Port 0 - S9xSetController (0, CTL_MOUSE, 0, 0, 0, 0); - //There should be a toggle here for putting in a pad instead - break; - - case 0x22: //Pad or Mouse in Port 0 & 1 - S9xSetController (0, CTL_MOUSE, 0, 0, 0, 0); - S9xSetController (1, CTL_MOUSE, 1, 0, 0, 0); - //There should be a toggles here for putting in pads instead - break; - - case 0x24: //Pad or Mouse in Port 0, Pad or Super Scope in Port 1 - //There should be a toggles here for what to put in, I'm leaving it at gamepad for now - break; - - case 0x27: //Pad or Mouse in Port 0, Pad or Mouse or Super Scope in Port 1 - //There should be a toggles here for what to put in, I'm leaving it at gamepad for now - break; - - //Not Supported yet - case 0x99: break; //Lasabirdie - case 0x0A: break; //Barcode Battler - } - } + exit(0); } const char *S9xStringInput(const char *message) @@ -677,12 +598,12 @@ const char *S9xStringInput(const char *message) return NULL; } -void S9xExtraUsage () +void S9xExtraUsage() { - printf ("GTK port options:\n" - "-filter [option] Use a filter to scale the image.\n" - " [option] is one of: none supereagle 2xsai\n" - " super2xsai hq2x hq3x hq4x 2xbrz 3xbrz 4xbrz epx ntsc\n" - "\n" - "-mutesound Disables sound output.\n"); + printf("GTK port options:\n" + "-filter [option] Use a filter to scale the image.\n" + " [option] is one of: none supereagle 2xsai\n" + " super2xsai hq2x hq3x hq4x 2xbrz 3xbrz 4xbrz epx ntsc\n" + "\n" + "-mutesound Disables sound output.\n"); } diff --git a/gtk/src/gtk_s9x.h b/gtk/src/gtk_s9x.h index 1b3036e5..65121d8d 100644 --- a/gtk/src/gtk_s9x.h +++ b/gtk/src/gtk_s9x.h @@ -8,19 +8,18 @@ #define __GTK_S9X_H #include "gtk_config.h" -#include "gtk_s9xcore.h" #include "gtk_s9xwindow.h" #include -#define SNES9X_GTK_AUTHORS "(c) 2007 - 2019 Brandon Wright (bearoso@gmail.com)" +#define SNES9X_GTK_AUTHORS "(c) 2007 - 2020 Brandon Wright (bearoso@gmail.com)" #define SNES9X_GTK_VERSION "87" extern Snes9xWindow *top_level; extern Snes9xConfig *gui_config; -int S9xOpenROM (const char *filename); -void S9xNoROMLoaded (); -void S9xROMLoaded (); +int S9xOpenROM(const char *filename); +void S9xNoROMLoaded(); +void S9xROMLoaded(); #endif /* __GTK_S9X_H */ diff --git a/gtk/src/gtk_s9xwindow.cpp b/gtk/src/gtk_s9xwindow.cpp index 0a79ca12..3564aae1 100644 --- a/gtk/src/gtk_s9xwindow.cpp +++ b/gtk/src/gtk_s9xwindow.cpp @@ -4,13 +4,11 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" -#include "gtk_config.h" +#include "gtk_compat.h" + #ifdef GDK_WINDOWING_X11 #include #endif -#include -#include #ifdef USE_XV #include @@ -31,246 +29,259 @@ #include "gtk_control.h" #include "gtk_cheat.h" #include "gtk_netplay.h" +#include "gtk_s9xwindow.h" -static gboolean -event_main_window_delete (GtkWidget *widget, - GdkEvent *event, - gpointer data) +#include "snes9x.h" +#include "controls.h" +#include "movie.h" +#include "display.h" +#include "apu/apu.h" +#include "memmap.h" +#include "cpuexec.h" +#include "snapshot.h" +#include "netplay.h" + +static Glib::RefPtr get_save_states_file_filter() { - S9xExit (); - - return true; + const char *exts[] = { "*.sst", "*.000", "*.001", "*.002", "*.003", "*.004", + "*.005", "*.006", "*.007", "*.008", "*.009", nullptr }; + auto filter = Gtk::FileFilter::create(); + filter->set_name(_("Save States")); + for (int i = 0; exts[i]; i++) + filter->add_pattern(exts[i]); + return filter; } -static gboolean -event_main_window_state_event (GtkWidget *widget, - GdkEventWindowState *event, - gpointer data) +static Glib::RefPtr get_all_files_filter() { - Snes9xWindow *window = (Snes9xWindow *) data; - window->fullscreen_state = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; - window->maximized_state = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; - - return false; + auto filter = Gtk::FileFilter::create(); + filter->set_name(_("All Files")); + filter->add_pattern("*.*"); + filter->add_pattern("*"); + return filter; } -static gboolean -event_continue_item_activate (GtkWidget *widget, gpointer data) +Snes9xWindow::Snes9xWindow(Snes9xConfig *config) + : GtkBuilderWindow("main_window") { - Snes9xWindow *window = (Snes9xWindow *) data; + user_pause = 0; + sys_pause = 0; + last_width = -1; + last_height = -1; + this->config = config; + recent_menu = nullptr; + fullscreen_state = 0; + maximized_state = 0; + focused = true; + paused_from_focus_loss = false; + cr = nullptr; + cairo_owned = false; + mouse_grabbed = false; - window->unpause_from_user (); + if (Gtk::IconTheme::get_default()->has_icon("snes9x")) + { + window->set_default_icon_name("snes9x"); + } + else + { + extern int mini_icon_size; + extern unsigned char mini_icon[]; + auto loader = Gdk::PixbufLoader::create(); + loader->write(mini_icon, mini_icon_size); + loader->close(); + auto pixbuf = loader->get_pixbuf(); + if (pixbuf) + window->set_default_icon(pixbuf); + } - return true; -} + drawing_area = get_object("drawingarea").get(); -static gboolean -event_open_cheats (GtkWidget *widget, gpointer data) -{ - Snes9xCheats *cheats; - cheats = new Snes9xCheats (); + gtk_widget_realize(GTK_WIDGET(window->gobj())); + gtk_widget_realize(GTK_WIDGET(drawing_area->gobj())); - cheats->show (); - delete cheats; - - return true; -} - -static gboolean -event_open_multicart (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->open_multicart_dialog (); - - return true; -} - -static gboolean -event_rom_info (GtkWidget *widget, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - - window->show_rom_info (); - - return true; -} - -static gboolean -event_toggle_interface (GtkWidget *widget, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - - window->toggle_ui (); - - return true; -} - -static gboolean -event_sync_clients (GtkWidget *widget, gpointer data) -{ - S9xNetplaySyncClients (); - - return true; -} - -static gboolean -event_pause_item_activate (GtkWidget *widget, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - - window->pause_from_user (); - - return true; -} - -static gboolean -event_open_netplay (GtkWidget *widget, gpointer data) -{ - S9xNetplayDialogOpen (); - - return true; -} - -#if GTK_MAJOR_VERSION >= 3 -static gboolean -event_drawingarea_draw (GtkWidget *widget, - cairo_t *cr, - gpointer data) -{ - - Snes9xWindow *window = (Snes9xWindow *) data; - window->cr = cr; - window->cairo_owned = false; - window->expose (); - window->cr = NULL; - - return true; -} +#ifndef USE_OPENGL + get_object("shader_parameters_separator")->hide(); + get_object("shader_parameters_item")->hide(); #else - -static gboolean -event_drawingarea_expose (GtkWidget *widget, - GdkEventExpose *event, - gpointer data) -{ - ((Snes9xWindow *) data)->expose (); - - return true; -} + enable_widget("shader_parameters_item", false); #endif -static gboolean -event_key (GtkWidget *widget, GdkEventKey *event, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - static unsigned int keyval = 0; - static GdkEventType type = GDK_NOTHING; - Binding b; - s9xcommand_t cmd; + connect_signals(); - /* Ignore multiple identical keypresses to discard repeating keys */ - if (event->keyval == keyval && event->type == type) + if (config->window_width < 100 || config->window_height < 100) { - return true; + config->window_width = 256; + config->window_height = 224; } - /* Provide escape key to get out of fullscreen */ - if (event->keyval == GDK_Escape) - { - if (event->type == GDK_KEY_RELEASE) - { - if (window->config->default_esc_behavior == ESC_EXIT_FULLSCREEN) - window->leave_fullscreen_mode (); - else if (window->config->default_esc_behavior == ESC_EXIT_SNES9X) - S9xExit (); - else - window->toggle_ui (); - } + window->get_window()->set_cursor(); - return true; - } - - keyval = event->keyval; - type = event->type; - - b = Binding (event); - - /* If no mapping for modifier version exists, try non-modifier */ - cmd = S9xGetMapping (b.hex ()); - if (cmd.type == S9xNoMapping) - { - b = Binding (event->keyval, false, false, false); - cmd = S9xGetMapping (b.hex ()); - } - - if (cmd.type != S9xNoMapping) - { - S9xReportButton (b.hex (), (event->type == GDK_KEY_PRESS)); - return true; - } - - return false; /* Pass the key to GTK */ + resize(config->window_width, config->window_height); } -gboolean -event_motion_notify (GtkWidget *widget, - GdkEventMotion *event, - gpointer user_data) +void Snes9xWindow::connect_signals() { - Snes9xWindow *window = (Snes9xWindow *) user_data; - - if (!window->config->rom_loaded || - window->last_width <= 0 || - window->last_height <= 0) - { + drawing_area->signal_draw().connect(sigc::mem_fun(*this, &Snes9xWindow::draw)); + window->signal_delete_event().connect([](GdkEventAny *event) -> bool { + S9xExit(); return false; - } - - if (window->mouse_grabbed) - { - if (event->x_root == window->gdk_mouse_x && - event->y_root == window->gdk_mouse_y) - return false; - - window->snes_mouse_x += (event->x_root - window->gdk_mouse_x); - window->snes_mouse_y += (event->y_root - window->gdk_mouse_y); - window->center_mouse (); + }); + get_object("exit_item")->signal_activate().connect([] { + S9xExit(); + }); + window->signal_window_state_event().connect([&](GdkEventWindowState *state) -> bool { + fullscreen_state = state->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; + maximized_state = state->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; return false; - } + }); -#if GTK_CHECK_VERSION(3,10,0) - int scale_factor = gdk_window_get_scale_factor (gtk_widget_get_window (GTK_WIDGET (window->get_window ()))); -#else - int scale_factor = 1; + window->signal_focus_in_event().connect([&](GdkEventFocus *event) -> bool { + focus_notify(true); + return false; + }); + + window->signal_focus_out_event().connect([&](GdkEventFocus *event) -> bool { + focus_notify(false); + return false; + }); + + last_key_pressed_keyval = 0; + last_key_pressed_type = GDK_NOTHING; + window->signal_key_press_event().connect(sigc::mem_fun(*this, &Snes9xWindow::event_key), false); + window->signal_key_release_event().connect(sigc::mem_fun(*this, &Snes9xWindow::event_key), false); + + drawing_area->signal_button_press_event().connect(sigc::mem_fun(*this, &Snes9xWindow::button_press)); + drawing_area->signal_button_release_event().connect(sigc::mem_fun(*this, &Snes9xWindow::button_release)); + drawing_area->signal_motion_notify_event().connect(sigc::mem_fun(*this, &Snes9xWindow::motion_notify)); + + get_object("continue_item")->signal_activate().connect([&] { + unpause_from_user(); + }); + + get_object("pause_item")->signal_activate().connect([&] { + pause_from_user(); + }); + + get_object("fullscreen_item")->signal_activate().connect([&] { + toggle_fullscreen_mode(); + }); + + get_object("open_rom_item")->signal_activate().connect([&] { + open_rom_dialog(); + }); + + get_object("reset_item")->signal_activate().connect([&] { + S9xSoftReset(); + }); + + get_object("hard_reset_item")->signal_activate().connect([&] { + S9xReset(); + }); + +#ifdef USE_OPENGL + get_object("shader_parameters_item")->signal_activate().connect([&] { + gtk_shader_parameters_dialog(get_window()); + }); #endif - window->snes_mouse_x = (uint16) - ((int) (event->x * scale_factor) - window->mouse_region_x) * 256 / - (window->mouse_region_width <= 0 ? 1 : window->mouse_region_width); - - window->snes_mouse_y = (uint16) - ((int) (event->y * scale_factor) - window->mouse_region_y) * (gui_config->overscan ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) / - (window->mouse_region_height <= 0 ? 1 : window->mouse_region_height); - - if (!window->config->pointer_is_visible) + const std::vector port_items = { "joypad1", "mouse1", "superscope1", "joypad2", "mouse2", "multitap2", "superscope2", "nothingpluggedin2" }; + for (auto &name : port_items) { - if (!S9xIsMousePluggedIn ()) - window->show_mouse_cursor (); + get_object(name)->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &Snes9xWindow::port_activate), name)); } - window->config->pointer_timestamp = g_get_monotonic_time (); + for (int i = 0; i <= 9; i++) + { + std::string name = "load_state_" + std::to_string(i); + get_object(name.c_str())->signal_activate().connect([i] { + S9xQuickLoadSlot(i); + }); + name = "save_state_" + std::to_string(i); + get_object(name.c_str())->signal_activate().connect([i] { + S9xQuickSaveSlot(i); + }); + } - return false; + get_object("from_file1")->signal_activate().connect([&] { + load_state_dialog(); + }); + + get_object("to_file1")->signal_activate().connect([&] { + save_state_dialog(); + }); + + get_object("load_state_undo")->signal_activate().connect([&] { + S9xUnfreezeGame(S9xGetFilename(".undo", SNAPSHOT_DIR)); + }); + + get_object("save_spc_item")->signal_activate().connect([&] { + save_spc_dialog(); + }); + + get_object("open_movie_item")->signal_activate().connect([&] { + if (S9xMovieActive()) + S9xMovieStop(false); + + S9xMovieOpen(open_movie_dialog(true).c_str(), false); + }); + + get_object("stop_recording_item")->signal_activate().connect([&] { + if (S9xMovieActive()) + S9xMovieStop(false); + }); + + get_object("jump_to_frame_item")->signal_activate().connect([&] { + movie_seek_dialog(); + }); + + get_object("record_movie_item")->signal_activate().connect([&] { + if (S9xMovieActive()) + S9xMovieStop(false); + + S9xMovieCreate(open_movie_dialog(false).c_str(), 0xFF, MOVIE_OPT_FROM_RESET, nullptr, 0); + }); + + get_object("cheats_item")->signal_activate().connect([&] { + open_snes9x_cheats_dialog(); + }); + + get_object("preferences_item")->signal_activate().connect([&] { + snes9x_preferences_open(this); + }); + + get_object("open_netplay_item")->signal_activate().connect([&] { + S9xNetplayDialogOpen(); + }); + + get_object("rom_info_item")->signal_activate().connect([&] { + show_rom_info(); + }); + + get_object("sync_clients_item")->signal_activate().connect([&] { + S9xNetplaySyncClients(); + }); + + get_object("hide_ui")->signal_activate().connect([&] { + toggle_ui(); + }); + + for (int i = 1; i <= 5; i++) + { + std::string name = "exact_pixels_" + std::to_string(i) + "x_item"; + get_object(name.c_str())->signal_activate().connect([i, this] { + resize_to_multiple(i); + }); + } + + get_object("open_multicart_item")->signal_activate().connect([&] { + open_multicart_dialog(); + }); } -gboolean -event_button_press (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data) +bool Snes9xWindow::button_press(GdkEventButton *event) { - auto window = (Snes9xWindow *)user_data; - if (S9xIsMousePluggedIn()) { switch (event->button) @@ -288,402 +299,157 @@ event_button_press (GtkWidget *widget, } else if (event->button == 3) { -#if GTK_MAJOR_VERSION >= 3 - gtk_menu_popup_at_pointer(GTK_MENU(window->get_widget("view_menu_menu")), NULL); -#else - gtk_menu_popup(GTK_MENU(window->get_widget("view_menu_menu")), NULL, - NULL, NULL, NULL, 3, event->time); -#endif + get_object("view_menu_menu")->popup_at_pointer(nullptr); } + return false; } -gboolean -event_button_release (GtkWidget *widget, - GdkEventButton *event, - gpointer user_data) +bool Snes9xWindow::button_release(GdkEventButton *event) { switch (event->button) { case 1: - S9xReportButton (BINDING_MOUSE_BUTTON0, 0); + S9xReportButton(BINDING_MOUSE_BUTTON0, 0); break; case 2: - S9xReportButton (BINDING_MOUSE_BUTTON1, 0); + S9xReportButton(BINDING_MOUSE_BUTTON1, 0); break; case 3: - S9xReportButton (BINDING_MOUSE_BUTTON2, 0); + S9xReportButton(BINDING_MOUSE_BUTTON2, 0); break; } return false; } -static void -event_fullscreen (GtkWidget *widget, gpointer data) +bool Snes9xWindow::motion_notify(GdkEventMotion *event) { - Snes9xWindow *window = (Snes9xWindow *) data; + if (!config->rom_loaded || last_width <= 0 || last_height <= 0) + return false; - if (!window->config->fullscreen) - window->enter_fullscreen_mode (); - else - window->leave_fullscreen_mode (); -} + if (mouse_grabbed) + { + if (event->x_root == gdk_mouse_x && event->y_root == gdk_mouse_y) + return false; + snes_mouse_x += (event->x_root - gdk_mouse_x); + snes_mouse_y += (event->y_root - gdk_mouse_y); + center_mouse(); -static void -event_exact_pixels_1x (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->resize_to_multiple (1); -} + return false; + } -static void -event_exact_pixels_2x (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->resize_to_multiple (2); -} + int scale_factor = window->get_scale_factor(); -static void -event_exact_pixels_3x (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->resize_to_multiple (3); -} + snes_mouse_x = (uint16)((int)(event->x * scale_factor) - mouse_region_x) * 256 / + (mouse_region_width <= 0 ? 1 : mouse_region_width); -static void -event_exact_pixels_4x (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->resize_to_multiple (4); -} + snes_mouse_y = (uint16)((int)(event->y * scale_factor) - mouse_region_y) * (gui_config->overscan ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) / + (mouse_region_height <= 0 ? 1 : mouse_region_height); -static void -event_exact_pixels_5x (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->resize_to_multiple (5); -} + if (!config->pointer_is_visible) + { + if (!S9xIsMousePluggedIn()) + show_mouse_cursor(); + } -static void -event_record_movie (GtkWidget *widget, gpointer data) -{ - if (S9xMovieActive ()) - S9xMovieStop (false); - - S9xMovieCreate (S9xChooseMovieFilename (false), - 0xFF, - MOVIE_OPT_FROM_RESET, - NULL, - 0); -} - -static void -event_open_movie (GtkWidget *widget, gpointer data) -{ - if (S9xMovieActive ()) - S9xMovieStop (false); - - S9xMovieOpen (S9xChooseMovieFilename (true), false); -} - -static void -event_shader_parameters (GtkWidget *widget, gpointer data) -{ -#ifdef USE_OPENGL - Snes9xWindow *window = (Snes9xWindow *) data; - - gtk_shader_parameters_dialog (window->get_window ()); -#endif -} - -static void -event_stop_recording (GtkWidget *widget, gpointer data) -{ - if (S9xMovieActive ()) - S9xMovieStop (false); -} - -static void -event_jump_to_frame (GtkWidget *widget, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - - window->movie_seek_dialog (); -} - -static void -event_reset (GtkWidget *widget, gpointer data) -{ - S9xSoftReset (); -} - -static void -event_hard_reset (GtkWidget *widget, gpointer data) -{ - S9xReset (); -} - -static void -event_save_state (GtkWidget *widget, gpointer data) -{ - int slot; - char *name = (char *) gtk_buildable_get_name (GTK_BUILDABLE (widget)); - - slot = atoi (&(name[11])); - - S9xQuickSaveSlot (slot); -} - -static void -event_save_state_file (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->save_state_dialog (); -} - -static void -event_load_state (GtkWidget *widget, gpointer data) -{ - int slot; - char *name = (char *) gtk_buildable_get_name (GTK_BUILDABLE (widget)); - - slot = atoi (&(name[11])); - - S9xQuickLoadSlot (slot); -} - -static void -event_load_state_undo (GtkWidget *widget, gpointer data) -{ - S9xUnfreezeGame (S9xGetFilename (".undo", SNAPSHOT_DIR)); -} - - -static void -event_load_state_file (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->load_state_dialog (); -} - -static void -event_open_rom (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->open_rom_dialog (); -} - -static void -event_recent_open (GtkRecentChooser *chooser, gpointer data) -{ - Snes9xWindow *window = (Snes9xWindow *) data; - gchar *uri = gtk_recent_chooser_get_current_uri (chooser); - gchar *filename = g_filename_from_uri (uri, NULL, NULL); - - window->try_open_rom (filename); - - g_free (filename); - g_free (uri); -} - -static void -event_save_spc (GtkWidget *widget, gpointer data) -{ - ((Snes9xWindow *) data)->save_spc_dialog (); -} - -static gboolean -event_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data) -{ - ((Snes9xWindow *) data)->focus_notify (true); + config->pointer_timestamp = g_get_monotonic_time(); return false; } -static gboolean -event_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data) +void Snes9xWindow::port_activate(const char *name) { - ((Snes9xWindow *) data)->focus_notify (false); - - return false; -} - -static void -event_port (GtkWidget *widget, gpointer data) -{ - const gchar *name = gtk_buildable_get_name (GTK_BUILDABLE (widget)); - - if (!(gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))) + auto item = get_object(name); + if (!item->get_active()) return; - if (!strcasecmp (name, "joypad1")) + if (!strcasecmp(name, "joypad1")) { - S9xSetController (0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); } - - else if (!strcasecmp (name, "joypad2")) + else if (!strcasecmp(name, "joypad2")) { - S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); } - - else if (!strcasecmp (name, "mouse1")) + else if (!strcasecmp(name, "mouse1")) { - S9xSetController (0, CTL_MOUSE, 0, 0, 0, 0); + S9xSetController(0, CTL_MOUSE, 0, 0, 0, 0); } - - else if (!strcasecmp (name, "mouse2")) + else if (!strcasecmp(name, "mouse2")) { - S9xSetController (1, CTL_MOUSE, 0, 0, 0, 0); + S9xSetController(1, CTL_MOUSE, 0, 0, 0, 0); } - - else if (!strcasecmp (name, "superscope1")) + else if (!strcasecmp(name, "superscope1")) { - S9xSetController (0, CTL_SUPERSCOPE, 0, 0, 0, 0); + S9xSetController(0, CTL_SUPERSCOPE, 0, 0, 0, 0); } - - else if (!strcasecmp (name, "superscope2")) + else if (!strcasecmp(name, "superscope2")) { - S9xSetController (1, CTL_SUPERSCOPE, 0, 0, 0, 0); + S9xSetController(1, CTL_SUPERSCOPE, 0, 0, 0, 0); } - - else if (!strcasecmp (name, "multitap1")) + else if (!strcasecmp(name, "multitap1")) { - S9xSetController (0, CTL_MP5, 0, 1, 2, 3); + S9xSetController(0, CTL_MP5, 0, 1, 2, 3); } - - else if (!strcasecmp (name, "multitap2")) + else if (!strcasecmp(name, "multitap2")) { - S9xSetController (1, CTL_MP5, 1, 2, 3, 4); + S9xSetController(1, CTL_MP5, 1, 2, 3, 4); } - - else if (!strcasecmp (name, "nothingpluggedin2")) + else if (!strcasecmp(name, "nothingpluggedin2")) { - S9xSetController (1, CTL_NONE, 0, 0, 0, 0); + S9xSetController(1, CTL_NONE, 0, 0, 0, 0); } } -Snes9xWindow::Snes9xWindow (Snes9xConfig *config) : - GtkBuilderWindow ("main_window") +bool Snes9xWindow::event_key(GdkEventKey *event) { - GtkBuilderWindowCallbacks callbacks[] = + Binding b; + s9xcommand_t cmd; + + // Ignore multiple identical keypresses to discard repeating keys + if (event->keyval == last_key_pressed_keyval && event->type == last_key_pressed_type) { - { "main_window_delete_event", G_CALLBACK (event_main_window_delete) }, - { "main_window_state_event", G_CALLBACK (event_main_window_state_event) }, - { "on_continue_item_activate", G_CALLBACK (event_continue_item_activate) }, - { "on_pause_item_activate", G_CALLBACK (event_pause_item_activate) }, - { "main_window_key_press_event", G_CALLBACK (event_key) }, - { "main_window_key_release_event", G_CALLBACK (event_key) }, - { "on_fullscreen_item_activate", G_CALLBACK (event_fullscreen) }, - { "on_open_rom_activate", G_CALLBACK (event_open_rom) }, - { "on_reset_item_activate", G_CALLBACK (event_reset) }, - { "on_shader_parameters_item_activate", G_CALLBACK (event_shader_parameters) }, - { "hard_reset", G_CALLBACK (event_hard_reset) }, - { "on_port_activate", G_CALLBACK (event_port) }, - { "load_save_state", G_CALLBACK (event_load_state) }, - { "load_state_file", G_CALLBACK (event_load_state_file) }, - { "load_state_undo", G_CALLBACK (event_load_state_undo) }, - { "save_save_state", G_CALLBACK (event_save_state) }, - { "save_state_file", G_CALLBACK (event_save_state_file) }, - { "drawingarea_button_press", G_CALLBACK (event_button_press) }, - { "drawingarea_button_release", G_CALLBACK (event_button_release) }, - { "drawingarea_motion_notify", G_CALLBACK (event_motion_notify) }, - { "save_spc", G_CALLBACK (event_save_spc) }, - { "open_movie", G_CALLBACK (event_open_movie) }, - { "stop_recording", G_CALLBACK (event_stop_recording) }, - { "jump_to_frame", G_CALLBACK (event_jump_to_frame) }, - { "record_movie", G_CALLBACK (event_record_movie) }, - { "open_cheats", G_CALLBACK (event_open_cheats) }, - { "on_preferences_item_activate", G_CALLBACK (snes9x_preferences_open) }, - { "focus_in_event", G_CALLBACK (event_focus_in) }, - { "focus_out_event", G_CALLBACK (event_focus_out) }, - { "open_netplay", G_CALLBACK (event_open_netplay) }, - { "rom_info", G_CALLBACK (event_rom_info) }, - { "sync_clients", G_CALLBACK (event_sync_clients) }, - { "toggle_interface", G_CALLBACK (event_toggle_interface) }, - { "exact_1x", G_CALLBACK (event_exact_pixels_1x) }, - { "exact_2x", G_CALLBACK (event_exact_pixels_2x) }, - { "exact_3x", G_CALLBACK (event_exact_pixels_3x) }, - { "exact_4x", G_CALLBACK (event_exact_pixels_4x) }, - { "exact_5x", G_CALLBACK (event_exact_pixels_5x) }, - { "open_multicart", G_CALLBACK (event_open_multicart) }, - - { NULL, NULL } - }; - - user_pause = 0; - sys_pause = 0; - last_width = -1; - last_height = -1; - this->config = config; - empty_cursor = NULL; - default_cursor = NULL; - recent_menu = NULL; - fullscreen_state = 0; - maximized_state = 0; - focused = true; - paused_from_focus_loss = false; - cr = NULL; - cairo_owned = false; - mouse_grabbed = false; - - if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), "snes9x")) - { - gtk_window_set_default_icon_name ("snes9x"); + return true; } - else + + // Provide escape key to get out of fullscreen + if (event->keyval == GDK_Escape) { - GdkPixbufLoader *loader = gdk_pixbuf_loader_new (); - if (gdk_pixbuf_loader_write (loader, (const guchar *)app_icon, sizeof (app_icon), NULL) && - gdk_pixbuf_loader_close (loader, NULL) && - (icon = gdk_pixbuf_loader_get_pixbuf (loader))) + if (event->type == GDK_KEY_RELEASE) { - gtk_window_set_default_icon (icon); + if (config->default_esc_behavior == ESC_EXIT_FULLSCREEN) + leave_fullscreen_mode(); + else if (config->default_esc_behavior == ESC_EXIT_SNES9X) + S9xExit(); + else + toggle_ui(); } - g_object_unref(loader); + + return true; } - drawing_area = GTK_DRAWING_AREA (get_widget ("drawingarea")); -#if GTK_MAJOR_VERSION < 3 - gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), false); - gtk_widget_set_app_paintable (GTK_WIDGET (drawing_area), true); + last_key_pressed_keyval = event->keyval; + last_key_pressed_type = event->type; -#endif + b = Binding(event); - gtk_widget_realize (window); - gtk_widget_realize (GTK_WIDGET (drawing_area)); -#if GTK_MAJOR_VERSION < 3 - gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, false); - gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, false); -#endif - -#ifndef USE_OPENGL - gtk_widget_hide (get_widget ("shader_parameters_separator")); - gtk_widget_hide (get_widget ("shader_parameters_item")); -#else - enable_widget ("shader_parameters_item", false); -#endif - -#if GTK_MAJOR_VERSION >= 3 - g_signal_connect_data (drawing_area, - "draw", - G_CALLBACK (event_drawingarea_draw), - this, - NULL, - (GConnectFlags) 0); -#else - g_signal_connect_data (drawing_area, - "expose-event", - G_CALLBACK (event_drawingarea_expose), - this, - NULL, - (GConnectFlags) 0); -#endif - signal_connect (callbacks); - - if (config->window_width < 100 || config->window_height < 100) + // If no mapping for modifier version exists, try non-modifier + cmd = S9xGetMapping(b.hex()); + if (cmd.type == S9xNoMapping) { - config->window_width = 256; - config->window_height = 224; + b = Binding(event->keyval, false, false, false); + cmd = S9xGetMapping(b.hex()); } - default_cursor = gdk_cursor_new_for_display (gdk_display_get_default (),GDK_LEFT_PTR); - gdk_window_set_cursor (gtk_widget_get_window (window), default_cursor); + if (cmd.type != S9xNoMapping) + { + S9xReportButton(b.hex(), (event->type == GDK_KEY_PRESS)); + return true; + } - resize (config->window_width, config->window_height); + return false; // Pass the key to GTK } extern int gtk_splash_smtpe_size; @@ -697,14 +463,14 @@ void Snes9xWindow::setup_splash() { uint16 *screen_ptr = GFX.Screen; - /* Load splash image (RGB24) into Snes9x buffer (RGB15) */ + // Load splash image (RGB24) into Snes9x buffer (RGB15) last_width = 256; last_height = 224; if (config->splash_image == SPLASH_IMAGE_PATTERN || config->splash_image == SPLASH_IMAGE_SMTPE || config->splash_image == SPLASH_IMAGE_COMBO) { - unsigned char *pattern = NULL; + unsigned char *pattern = nullptr; int pattern_size = 0; if (config->splash_image == SPLASH_IMAGE_PATTERN) { @@ -718,9 +484,9 @@ void Snes9xWindow::setup_splash() pattern_size = gtk_splash_combo_size; } - auto pixbuf_loader = gdk_pixbuf_loader_new_with_type("png", NULL); - gdk_pixbuf_loader_write(pixbuf_loader, pattern, pattern_size, NULL); - gdk_pixbuf_loader_close(pixbuf_loader, NULL); + auto pixbuf_loader = gdk_pixbuf_loader_new_with_type("png", nullptr); + gdk_pixbuf_loader_write(pixbuf_loader, pattern, pattern_size, nullptr); + gdk_pixbuf_loader_close(pixbuf_loader, nullptr); auto pixbuf = gdk_pixbuf_loader_get_pixbuf(pixbuf_loader); const unsigned char *splash_ptr = gdk_pixbuf_get_pixels(pixbuf); const int channels = gdk_pixbuf_get_n_channels(pixbuf); @@ -765,9 +531,11 @@ void Snes9xWindow::setup_splash() } } -void -Snes9xWindow::expose () +bool Snes9xWindow::draw(const Cairo::RefPtr &cr) { + this->cr = cr->cobj(); + cairo_owned = false; + if (!(config->fullscreen) && !(maximized_state)) { config->window_width = get_width(); @@ -779,717 +547,511 @@ Snes9xWindow::expose () setup_splash(); } - S9xDisplayRefresh (last_width, last_height); + S9xDisplayRefresh(last_width, last_height); if (!(config->fullscreen)) { - config->window_width = get_width (); - config->window_height = get_height (); + config->window_width = get_width(); + config->window_height = get_height(); } - if (is_paused () || NetPlay.Paused) + if ((is_paused() || NetPlay.Paused) && (gui_config->splash_image < SPLASH_IMAGE_STARFIELD || gui_config->rom_loaded)) { - S9xDeinitUpdate (last_width, last_height); + S9xDeinitUpdate(last_width, last_height); } + + this->cr = nullptr; + + return true; } -void -Snes9xWindow::focus_notify (bool state) +void Snes9xWindow::focus_notify(bool state) { focused = state; if (!state && config->pause_emulation_on_switch) { sys_pause++; - propagate_pause_state (); + propagate_pause_state(); paused_from_focus_loss = true; } if (state && paused_from_focus_loss) { - unpause_from_focus_change (); + unpause_from_focus_change(); paused_from_focus_loss = false; } } -void -Snes9xWindow::open_multicart_dialog () +void Snes9xWindow::open_multicart_dialog() { int result; - GtkBuilderWindow *dialog = new GtkBuilderWindow ("multicart_dialog"); - GtkFileChooser *slota, *slotb; - GtkWidget *multicart_dialog = GTK_WIDGET (dialog->get_window ()); + GtkBuilderWindow dialog_builder("multicart_dialog"); + auto dialog = Glib::RefPtr::cast_static(dialog_builder.window); - gtk_window_set_transient_for (dialog->get_window (), get_window ()); + dialog->set_transient_for(*window.get()); - pause_from_focus_change (); + pause_from_focus_change(); - slota = GTK_FILE_CHOOSER (dialog->get_widget ("multicart_slota")); - slotb = GTK_FILE_CHOOSER (dialog->get_widget ("multicart_slotb")); + auto slota = get_object("multicart_slota"); + auto slotb = get_object("multicart_slotb"); - gtk_file_chooser_set_current_folder (slota, config->last_directory.c_str ()); - gtk_file_chooser_set_current_folder (slotb, config->last_directory.c_str ()); + slota->set_current_folder(config->last_directory); + slotb->set_current_folder(config->last_directory); - result = gtk_dialog_run (GTK_DIALOG (multicart_dialog)); - - gtk_widget_hide (multicart_dialog); + result = dialog->run(); + dialog->hide(); if (result == GTK_RESPONSE_OK) { - const gchar *filename; - - filename = gtk_file_chooser_get_filename (slota); - if (filename) - strncpy (Settings.CartAName, filename, PATH_MAX); + auto filename = slota->get_filename(); + if (!filename.empty()) + strncpy(Settings.CartAName, filename.c_str(), PATH_MAX); else Settings.CartAName[0] = '\0'; - filename = gtk_file_chooser_get_filename (slotb); - if (filename) - strncpy (Settings.CartBName, filename, PATH_MAX); + filename = slotb->get_filename(); + if (!filename.empty()) + strncpy(Settings.CartBName, filename.c_str(), PATH_MAX); else Settings.CartBName[0] = '\0'; Settings.Multi = true; - if (S9xOpenROM (NULL)) + if (S9xOpenROM(nullptr)) { - GtkWidget *msg; - - msg = gtk_message_dialog_new (GTK_WINDOW (this->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Couldn't load files.")); - gtk_window_set_title (GTK_WINDOW (msg), _("Error")); - gtk_dialog_run (GTK_DIALOG (msg)); - gtk_widget_destroy (msg); + auto msg = Gtk::MessageDialog(*window.get(), + _("Couldn't load files."), + false, + Gtk::MESSAGE_ERROR, + Gtk::BUTTONS_CLOSE, + true); + msg.run(); } } - delete dialog; - - unpause_from_focus_change (); + unpause_from_focus_change(); } -const char * -Snes9xWindow::open_movie_dialog (bool readonly) +std::string Snes9xWindow::open_movie_dialog(bool readonly) { - GtkWidget *dialog; - GtkFileFilter *filter; - char *filename; - gint result; - const char *extensions[] = - { - "*.smv", "*.SMV", - NULL - }; + this->pause_from_focus_change(); - this->pause_from_focus_change (); + std::string title; + Gtk::FileChooserAction action; if (readonly) { - dialog = gtk_file_chooser_dialog_new (_("Open SNES Movie"), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_OPEN, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); + title = _("Open SNES Movie"); + action = Gtk::FILE_CHOOSER_ACTION_OPEN; } else { - char def[PATH_MAX]; - char default_name[PATH_MAX]; - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - char ext[_MAX_EXT]; + title = _("New SNES Movie"); + action = Gtk::FILE_CHOOSER_ACTION_SAVE; + } - _splitpath (Memory.ROMFilename, drive, dir, def, ext); + Gtk::FileChooserDialog dialog(*window.get(), title, action); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + if (readonly) + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_ACCEPT); + else + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_ACCEPT); - snprintf (default_name, PATH_MAX, "%s.smv", def); - - dialog = gtk_file_chooser_dialog_new (_("New SNES Movie"), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_SAVE, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); - - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), - default_name); + if (!readonly) + { + const char *default_name = S9xGetFilename(".smv", s9x_getdirtype::ROM_DIR); + dialog.set_current_name(default_name); } - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("SNES Movies")); + auto filter = Gtk::FileFilter::create(); + filter->set_name(_("SNES Movies")); + filter->add_pattern("*.smv"); + filter->add_pattern("*.SMV"); + dialog.add_filter(filter); + dialog.add_filter(get_all_files_filter()); + + dialog.set_current_folder(S9xGetDirectory(SRAM_DIR)); + auto result = dialog.run(); + dialog.hide(); + this->unpause_from_focus_change(); + + if (result == Gtk::RESPONSE_ACCEPT) + return dialog.get_filename(); + + return std::string{}; +} + +std::string Snes9xWindow::open_rom_dialog(bool run) +{ + const char *extensions[] = { + "*.smc", "*.SMC", "*.fig", "*.FIG", "*.sfc", "*.SFC", + "*.jma", "*.JMA", "*.zip", "*.ZIP", "*.gd3", "*.GD3", + "*.swc", "*.SWC", "*.gz", "*.GZ", "*.bs", "*.BS", + NULL + }; + + pause_from_focus_change(); + + auto dialog = Gtk::FileChooserDialog(*top_level->window.get(), + _("Open SNES ROM Image")); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_ACCEPT); + + auto filter = Gtk::FileFilter::create(); + filter->set_name(_("SNES ROM Images")); for (int i = 0; extensions[i]; i++) + filter->add_pattern(extensions[i]); + dialog.add_filter(filter); + dialog.add_filter(get_all_files_filter()); + + if (!gui_config->last_directory.empty()) + dialog.set_current_folder(config->last_directory); + + auto result = dialog.run(); + dialog.hide(); + + std::string filename; + + if (result == Gtk::RESPONSE_ACCEPT) { - gtk_file_filter_add_pattern (filter, extensions[i]); - } - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + std::string directory = dialog.get_current_folder(); - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*.*"); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + if (!directory.empty()) + gui_config->last_directory = directory; - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - S9xGetDirectory (SRAM_DIR)); + filename = dialog.get_filename(); - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) - { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - } - else - { - filename = strdup (""); + if (!filename.empty()) + { + if (run) + { + Settings.Multi = false; + try_open_rom(filename); + } + } } - gtk_widget_destroy (dialog); - - this->unpause_from_focus_change (); - + unpause_from_focus_change(); return filename; } -void -Snes9xWindow::open_rom_dialog () +bool Snes9xWindow::try_open_rom(std::string filename) { - char *filename; - - pause_from_focus_change (); - - filename = S9xOpenROMDialog (); - - if (filename) - { - Settings.Multi = false; - try_open_rom (filename); - - g_free (filename); - } - - unpause_from_focus_change (); -} - -bool Snes9xWindow::try_open_rom(const char *filename) -{ - pause_from_focus_change (); + pause_from_focus_change(); Settings.Multi = false; - if (S9xOpenROM (filename)) + if (S9xOpenROM(filename.c_str())) { - GtkWidget *msg; - - msg = gtk_message_dialog_new (GTK_WINDOW (this->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Couldn't load file '%s'"), - filename); - gtk_window_set_title (GTK_WINDOW (msg), _("Error")); - gtk_dialog_run (GTK_DIALOG (msg)); - gtk_widget_destroy (msg); - - unpause_from_focus_change (); - + std::string message = _("Couldn't load file: ") + filename; + Gtk::MessageDialog msg(*window.get(), message, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); + msg.run(); + unpause_from_focus_change(); return false; } - else - { - const char *groups[] = { "cartridge", NULL }; - GtkRecentData recent_data = - { - NULL, - (gchar *) "SNES ROM", - (gchar *) "application/x-snes-rom", - (gchar *) "Snes9x", - NULL, - (gchar **) groups, - false - }; - gchar *u_filename; + Gtk::RecentManager::Data data; + data.description = "SNES ROM"; + data.mime_type = "application/x-snes-rom"; + data.app_name = "Snes9x"; + data.groups = { "cartridge" }; + data.is_private = false; + data.app_exec = Glib::get_prgname() + " %f"; + auto uri = Glib::filename_to_uri(filename); + Gtk::RecentManager::get_default()->add_item(uri, data); - u_filename = g_filename_to_uri (filename, NULL, NULL); - - recent_data.app_exec = g_strjoin (" ", - g_get_prgname (), - "%f", - NULL); - - gtk_recent_manager_add_full (gtk_recent_manager_get_default (), - u_filename, - &recent_data); - - g_free (recent_data.app_exec); - g_free (u_filename); - - this->unpause_from_user (); - - } - - this->unpause_from_focus_change (); + unpause_from_user(); + unpause_from_focus_change(); return true; } -void -Snes9xWindow::load_state_dialog () +void Snes9xWindow::load_state_dialog() { - GtkWidget *dialog; - GtkFileFilter *filter; - char *filename; - gint result; + this->pause_from_focus_change(); - this->pause_from_focus_change (); + Gtk::FileChooserDialog dialog(*window.get(), _("Load Saved State")); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-open"), Gtk::RESPONSE_ACCEPT); - dialog = gtk_file_chooser_dialog_new (_("Load Saved State"), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_OPEN, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-open", GTK_RESPONSE_ACCEPT, - NULL); + dialog.add_filter(get_save_states_file_filter()); + dialog.add_filter(get_all_files_filter()); + dialog.set_current_folder(S9xGetDirectory(SNAPSHOT_DIR)); - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - S9xGetDirectory (SNAPSHOT_DIR)); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("Save States")); - gtk_file_filter_add_pattern (filter, "*.sst"); - gtk_file_filter_add_pattern (filter, "*.zst"); - gtk_file_filter_add_pattern (filter, "*.ZST"); - gtk_file_filter_add_pattern (filter, "*.000"); - gtk_file_filter_add_pattern (filter, "*.001"); - gtk_file_filter_add_pattern (filter, "*.002"); - gtk_file_filter_add_pattern (filter, "*.003"); - gtk_file_filter_add_pattern (filter, "*.004"); - gtk_file_filter_add_pattern (filter, "*.005"); - gtk_file_filter_add_pattern (filter, "*.006"); - gtk_file_filter_add_pattern (filter, "*.007"); - gtk_file_filter_add_pattern (filter, "*.008"); - gtk_file_filter_add_pattern (filter, "*.009"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*.*"); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) + auto result = dialog.run(); + dialog.hide(); + if (result == Gtk::RESPONSE_ACCEPT) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - - S9xLoadState (filename); - - g_free (filename); + S9xLoadState(dialog.get_filename().c_str()); } - else - { - } - - gtk_widget_destroy (dialog); - - this->unpause_from_focus_change (); + unpause_from_focus_change(); } -void -Snes9xWindow::movie_seek_dialog () +void Snes9xWindow::movie_seek_dialog() { - char str[1024]; - gint result; + char str[1024]; - if (!S9xMovieActive ()) + if (!S9xMovieActive()) return; - GtkBuilderWindow *seek_dialog = new GtkBuilderWindow ("frame_advance_dialog"); - GtkWindow *seek_window = seek_dialog->get_window (); + pause_from_focus_change(); - pause_from_focus_change (); + GtkBuilderWindow seek_dialog("frame_advance_dialog"); - snprintf (str, 1024, _("The current frame in the movie is %d."), S9xMovieGetFrameCounter ()); - gtk_label_set_label (GTK_LABEL (seek_dialog->get_widget ("current_frame_label")), str); + snprintf(str, 1024, _("The current frame in the movie is %d."), S9xMovieGetFrameCounter()); + seek_dialog.get_object("current_frame_label")->set_label(str); - snprintf (str, 1024, "%d", S9xMovieGetFrameCounter ()); - seek_dialog->set_entry_text ("frame_entry", str); + snprintf(str, 1024, "%d", S9xMovieGetFrameCounter()); + seek_dialog.set_entry_text("frame_entry", str); - gtk_window_set_transient_for (seek_window, get_window ()); + auto dialog = Glib::RefPtr::cast_static(seek_dialog.window); - result = gtk_dialog_run (GTK_DIALOG (seek_window)); + dialog->set_transient_for(*window.get()); + auto result = dialog->run(); - int entry_value = seek_dialog->get_entry_value ("frame_entry"); + int entry_value = seek_dialog.get_entry_value("frame_entry"); switch (result) { - case GTK_RESPONSE_OK: + case Gtk::RESPONSE_OK: + if (entry_value > 0 && + entry_value > (int)S9xMovieGetFrameCounter()) + { + Settings.HighSpeedSeek = + entry_value - S9xMovieGetFrameCounter(); + } - if (entry_value > 0 && - entry_value > (int) S9xMovieGetFrameCounter ()) - { - Settings.HighSpeedSeek = - entry_value - S9xMovieGetFrameCounter (); - } - - break; + break; } - delete seek_dialog; - - unpause_from_focus_change (); + unpause_from_focus_change(); } -void -Snes9xWindow::save_state_dialog () +void Snes9xWindow::save_state_dialog() { - GtkWidget *dialog; - GtkFileFilter *filter; - char *filename; - gint result; - char def[PATH_MAX]; - char default_name[PATH_MAX]; - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - char ext[_MAX_EXT]; + pause_from_focus_change(); - this->pause_from_focus_change (); + auto dialog = Gtk::FileChooserDialog(*window.get(), _("Save State"), Gtk::FILE_CHOOSER_ACTION_SAVE); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_ACCEPT); + dialog.set_current_folder(S9xGetDirectory(SNAPSHOT_DIR)); + dialog.set_current_name(S9xGetFilename(".sst", SNAPSHOT_DIR)); + dialog.add_filter(get_save_states_file_filter()); + dialog.add_filter(get_all_files_filter()); - _splitpath (Memory.ROMFilename, drive, dir, def, ext); - - snprintf (default_name, PATH_MAX, "%s.sst", def); - - dialog = gtk_file_chooser_dialog_new (_("Save State"), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_SAVE, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-save", GTK_RESPONSE_ACCEPT, - NULL); - - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - S9xGetDirectory (SNAPSHOT_DIR)); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), - default_name); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("Save States")); - gtk_file_filter_add_pattern (filter, "*.sst"); - gtk_file_filter_add_pattern (filter, "*.zst"); - gtk_file_filter_add_pattern (filter, "*.ZST"); - gtk_file_filter_add_pattern (filter, "*.000"); - gtk_file_filter_add_pattern (filter, "*.001"); - gtk_file_filter_add_pattern (filter, "*.002"); - gtk_file_filter_add_pattern (filter, "*.003"); - gtk_file_filter_add_pattern (filter, "*.004"); - gtk_file_filter_add_pattern (filter, "*.005"); - gtk_file_filter_add_pattern (filter, "*.006"); - gtk_file_filter_add_pattern (filter, "*.007"); - gtk_file_filter_add_pattern (filter, "*.008"); - gtk_file_filter_add_pattern (filter, "*.009"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*.*"); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_hide (dialog); + auto result = dialog.run(); + dialog.hide(); if (result == GTK_RESPONSE_ACCEPT) - { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + S9xSaveState(dialog.get_filename().c_str()); - S9xSaveState (filename); - - g_free (filename); - } - - else - { - } - - gtk_widget_destroy (dialog); - - this->unpause_from_focus_change (); + unpause_from_focus_change(); } -void -Snes9xWindow::save_spc_dialog () +void Snes9xWindow::save_spc_dialog() { - GtkWidget *dialog; - GtkFileFilter *filter; - char *filename; - gint result; - char def[PATH_MAX]; - char default_name[PATH_MAX]; - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - char ext[_MAX_EXT]; + pause_from_focus_change(); - this->pause_from_focus_change (); + auto dialog = Gtk::FileChooserDialog(*window.get(), _("Save SPC file..."), Gtk::FILE_CHOOSER_ACTION_SAVE); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_ACCEPT); + dialog.set_current_folder(S9xGetDirectory(SNAPSHOT_DIR)); + dialog.set_current_name(S9xGetFilename(".spc", SNAPSHOT_DIR)); + auto filter = Gtk::FileFilter::create(); + filter->add_pattern("*.spc"); + filter->add_pattern("*.SPC"); + dialog.add_filter(filter); + dialog.add_filter(get_all_files_filter()); - _splitpath (Memory.ROMFilename, drive, dir, def, ext); + auto result = dialog.run(); + dialog.hide(); - snprintf (default_name, PATH_MAX, "%s.spc", def); - - dialog = gtk_file_chooser_dialog_new (_("Save SPC file..."), - GTK_WINDOW (this->window), - GTK_FILE_CHOOSER_ACTION_SAVE, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-save", GTK_RESPONSE_ACCEPT, - NULL); - - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), - S9xGetDirectory (SNAPSHOT_DIR)); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), - default_name); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("SPC Files")); - gtk_file_filter_add_pattern (filter, "*.spc"); - gtk_file_filter_add_pattern (filter, "*.SPC"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("All Files")); - gtk_file_filter_add_pattern (filter, "*.*"); - gtk_file_filter_add_pattern (filter, "*"); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - - result = gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_hide (dialog); - - if (result == GTK_RESPONSE_ACCEPT) + if (result == Gtk::RESPONSE_ACCEPT) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - - if (S9xSPCDump (filename)) + if (S9xSPCDump(dialog.get_filename().c_str())) { /* Success ? */ } else { - GtkWidget *msg; - - msg = gtk_message_dialog_new (GTK_WINDOW (this->window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Couldn't save SPC file '%s'"), - filename); - gtk_window_set_title (GTK_WINDOW (msg), _("Error")); - gtk_dialog_run (GTK_DIALOG (msg)); - gtk_widget_destroy (msg); + std::string message = _("Couldn't save SPC file:"); + message += " " + dialog.get_filename(); + Gtk::MessageDialog(*window.get(), message, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true).run(); } - - g_free (filename); } - else + unpause_from_focus_change(); +} + +void Snes9xWindow::set_menu_item_selected(const char *name) +{ + get_object(name)->set_active(true); +} + +void Snes9xWindow::show_rom_info() +{ +const char *markup = _(R"(Information for %s + +Name: %s +Speed: %02X/%s +Map: %s +Type: %02x +Contents: %s +ROM Size: %s +Calculated Size: %d +SRAM Size: %s +Header Checksum: %04X +Checksum Complement: %04X +Actual Checksum: %04X +Video: %s +CRC32: %08X +Revision: %s +%s%s)"); + char output[2048]; + + snprintf(output, 2048, markup, + Memory.ROMFilename, + Memory.ROMName, + Memory.ROMSpeed, + ((Memory.ROMSpeed & 0x10) != 0) ? "FastROM" : "SlowROM", + (Memory.HiROM) ? "HiROM" : "LoROM", + Memory.ROMType, + Memory.KartContents(), + Memory.Size(), + Memory.CalculatedSize / 0x20000, + Memory.StaticRAMSize(), + Memory.ROMChecksum, + Memory.ROMComplementChecksum, + Memory.CalculatedChecksum, + (Memory.ROMRegion > 12 || Memory.ROMRegion < 2) ? "NTSC 60Hz" : "PAL 50Hz", + Memory.ROMCRC32, + Memory.Revision(), + (Settings.IsPatched) ? _("\n\nThis ROM has been auto-patched with ") : (Memory.ROMChecksum != Memory.CalculatedChecksum) ? _("\n\nThis ROM has been modified or damaged") : "", + Settings.IsPatched == 1 ? "IPS" : Settings.IsPatched == 2 ? "BPS" : Settings.IsPatched == 3 ? "UPS" : ""); + + std::string str_output(output); + + for (size_t i = 0; i < str_output.length(); i++) { + if (str_output[i] == '&') + str_output.insert(i + 1, "amp;"); } - gtk_widget_destroy (dialog); + pause_from_focus_change(); - this->unpause_from_focus_change (); + auto dialog = Gtk::MessageDialog(*window.get(), str_output, true, Gtk::MESSAGE_OTHER, Gtk::BUTTONS_CLOSE, true); + dialog.set_title(_("File Information")); + dialog.run(); + + unpause_from_focus_change(); } -void -Snes9xWindow::set_menu_item_selected (const char *name) +void Snes9xWindow::configure_widgets() { - GtkCheckMenuItem *item; + enable_widget("continue_item", config->rom_loaded); + enable_widget("pause_item", config->rom_loaded); + enable_widget("reset_item", config->rom_loaded); + enable_widget("load_state_item", config->rom_loaded); + enable_widget("save_state_item", config->rom_loaded); + enable_widget("save_spc_item", config->rom_loaded); + enable_widget("hard_reset_item", config->rom_loaded); + enable_widget("record_movie_item", config->rom_loaded); + enable_widget("stop_recording_item", config->rom_loaded); + enable_widget("open_movie_item", config->rom_loaded); + enable_widget("jump_to_frame_item", config->rom_loaded); + enable_widget("cheats_item", config->rom_loaded); + enable_widget("rom_info_item", config->rom_loaded); - item = GTK_CHECK_MENU_ITEM (get_widget (name)); - - gtk_check_menu_item_set_active (item, 1); -} - -void -Snes9xWindow::show_rom_info () -{ - GtkWidget *msg; - - pause_from_focus_change (); - - msg = gtk_message_dialog_new_with_markup (GTK_WINDOW (window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_OTHER, - GTK_BUTTONS_CLOSE, - _("Information for %s\n\n" - "Name: %s\n" - "Speed: %02X/%s\n" - "Map: %s\n" - "Type: %02x\n" - "Contents: %s\n" - "ROM Size: %s\n" - "Calculated Size: %d\n" - "SRAM Size: %s\n" - "Header Checksum: %04X\n" - "Checksum Compliment: %04X\n" - "Actual Checksum: %04X\n" - "Video: %s\n" - "CRC32: %08X\n" - "Revision: %s" - "%s%s"), - Memory.ROMFilename, - Memory.ROMName, - Memory.ROMSpeed, - ((Memory.ROMSpeed & 0x10) != 0) ? - "FastROM" : "SlowROM", - (Memory.HiROM) ? - "HiROM" : "LoROM", - Memory.ROMType, - Memory.KartContents (), - Memory.Size (), - Memory.CalculatedSize / 0x20000, - Memory.StaticRAMSize (), - Memory.ROMChecksum, - Memory.ROMComplementChecksum, - Memory.CalculatedChecksum, - (Memory.ROMRegion > 12 || - Memory.ROMRegion < 2) ? - "NTSC 60Hz" : "PAL 50Hz", - Memory.ROMCRC32, - Memory.Revision (), - (Settings.IsPatched) ? _("\n\nThis ROM has been auto-patched with ") : - (Memory.ROMChecksum != - Memory.CalculatedChecksum) ? - _("\n\nThis ROM has been modified or damaged") - : "", - Settings.IsPatched == 1 ? "IPS" : - Settings.IsPatched == 2 ? "BPS" : - Settings.IsPatched == 3 ? "UPS" : - ""); - gtk_window_set_title (GTK_WINDOW (msg), _("File Information")); - - gtk_dialog_run (GTK_DIALOG (msg)); - - unpause_from_focus_change (); - - gtk_widget_destroy (msg); -} - -void -Snes9xWindow::configure_widgets () -{ - enable_widget ("continue_item", config->rom_loaded); - enable_widget ("pause_item", config->rom_loaded); - enable_widget ("reset_item", config->rom_loaded); - enable_widget ("load_state_item", config->rom_loaded); - enable_widget ("save_state_item", config->rom_loaded); - enable_widget ("save_spc_item", config->rom_loaded); - enable_widget ("hard_reset_item", config->rom_loaded); - enable_widget ("record_movie_item", config->rom_loaded); - enable_widget ("stop_recording_item", config->rom_loaded); - enable_widget ("open_movie_item", config->rom_loaded); - enable_widget ("jump_to_frame_item", config->rom_loaded); - enable_widget ("cheats_item", config->rom_loaded); - enable_widget ("rom_info_item", config->rom_loaded); - - enable_widget ("sync_clients_item", - config->rom_loaded && - Settings.NetPlay && - Settings.NetPlayServer); + enable_widget("sync_clients_item", + config->rom_loaded && + Settings.NetPlay && + Settings.NetPlayServer); if (config->default_esc_behavior != ESC_TOGGLE_MENUBAR) { - enable_widget ("fullscreen_item", config->rom_loaded); + enable_widget("fullscreen_item", config->rom_loaded); config->ui_visible = true; - if (!config->fullscreen) - { - gtk_widget_show (get_widget ("menubar")); - } - else - { - gtk_widget_hide (get_widget ("menubar")); - } - - gtk_widget_hide (get_widget ("hide_ui")); - gtk_widget_hide (get_widget ("hide_ui_separator")); + show_widget("menubar", !config->fullscreen); + show_widget("hide_ui", false); + show_widget("hide_ui_separator", false); } else { - enable_widget ("fullscreen_item", true); + enable_widget("fullscreen_item", true); - gtk_widget_show (get_widget ("hide_ui")); - gtk_widget_show (get_widget ("hide_ui_separator")); - - if (config->ui_visible) - { - gtk_widget_show (get_widget ("menubar")); - } - else - { - gtk_widget_hide (get_widget ("menubar")); - } + show_widget("hide_ui", true); + show_widget("hide_ui_separator", true); + show_widget("menubar", config->ui_visible); } - propagate_pause_state (); + propagate_pause_state(); if (config->rom_loaded && !Settings.Paused) - hide_mouse_cursor (); + hide_mouse_cursor(); else - show_mouse_cursor (); + show_mouse_cursor(); + + if (config->rom_loaded) + { + std::string title = S9xBasenameNoExt(Memory.ROMFilename); + title += " - Snes9x"; + window->set_title(title); + } + else + { + window->set_title("Snes9x"); + } } -void -Snes9xWindow::set_mouseable_area (int x, int y, int width, int height) +void Snes9xWindow::set_mouseable_area(int x, int y, int width, int height) { - mouse_region_x = x; - mouse_region_y = y; - mouse_region_width = width; + mouse_region_x = x; + mouse_region_y = y; + mouse_region_width = width; mouse_region_height = height; } -void -Snes9xWindow::reset_screensaver () +void Snes9xWindow::reset_screensaver() { if (!focused) return; + GdkWindow *gdk_window = window->get_window()->gobj(); + GdkDisplay *gdk_display = window->get_display()->gobj(); + #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))) + if (GDK_IS_X11_WINDOW(gdk_window)) { - XResetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); + XResetScreenSaver(GDK_DISPLAY_XDISPLAY(gdk_display)); } #endif #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))) + if (GDK_IS_WAYLAND_WINDOW(gdk_window)) { - // TODO screensaver for wayland + // TODO screensaver for wayland } #endif config->screensaver_needs_reset = false; } -void -Snes9xWindow::toggle_fullscreen_mode () +void Snes9xWindow::toggle_fullscreen_mode() { if (config->fullscreen) - leave_fullscreen_mode (); + leave_fullscreen_mode(); else - enter_fullscreen_mode (); + enter_fullscreen_mode(); } -static double XRRGetExactRefreshRate (Display *dpy, Window window) +static double XRRGetExactRefreshRate(Display *dpy, Window window) { - XRRScreenResources *resources = NULL; - XRRCrtcInfo *crtc_info = NULL; + XRRScreenResources *resources = nullptr; + XRRCrtcInfo *crtc_info = nullptr; int event_base; int error_base; int version_major; @@ -1497,8 +1059,8 @@ static double XRRGetExactRefreshRate (Display *dpy, Window window) double refresh_rate = 0.0; int i; - if (!XRRQueryExtension (dpy, &event_base, &error_base) || - !XRRQueryVersion (dpy, &version_major, &version_minor)) + if (!XRRQueryExtension(dpy, &event_base, &error_base) || + !XRRQueryVersion(dpy, &version_major, &version_minor)) { return refresh_rate; } @@ -1506,8 +1068,8 @@ static double XRRGetExactRefreshRate (Display *dpy, Window window) if (version_minor < 3) return refresh_rate; - resources = XRRGetScreenResourcesCurrent (dpy, window); - crtc_info = XRRGetCrtcInfo (dpy, resources, resources->crtcs[0]); + resources = XRRGetScreenResourcesCurrent(dpy, window); + crtc_info = XRRGetCrtcInfo(dpy, resources, resources->crtcs[0]); for (i = 0; i < resources->nmode; i++) { @@ -1515,58 +1077,59 @@ static double XRRGetExactRefreshRate (Display *dpy, Window window) { XRRModeInfo *m = &resources->modes[i]; - refresh_rate = (double) m->dotClock / m->hTotal / m->vTotal; - refresh_rate /= m->modeFlags & RR_DoubleScan ? 2 : 1; + refresh_rate = (double)m->dotClock / m->hTotal / m->vTotal; + refresh_rate /= m->modeFlags & RR_DoubleScan ? 2 : 1; refresh_rate /= m->modeFlags & RR_ClockDivideBy2 ? 2 : 1; - refresh_rate *= m->modeFlags & RR_DoubleClock ? 2 : 1; + refresh_rate *= m->modeFlags & RR_DoubleClock ? 2 : 1; break; } } - XRRFreeCrtcInfo (crtc_info); - XRRFreeScreenResources (resources); + XRRFreeCrtcInfo(crtc_info); + XRRFreeScreenResources(resources); return refresh_rate; } double -Snes9xWindow::get_refresh_rate () +Snes9xWindow::get_refresh_rate() { double refresh_rate = 0.0; - GdkDisplay *display = gtk_widget_get_display (window); - GdkWindow *gdk_window = gtk_widget_get_window (window); +#if defined GDK_WINDOWING_X11 || defined GDK_WINDOWING_WAYLAND + GdkDisplay *gdk_display = window->get_display()->gobj(); + GdkWindow *gdk_window = window->get_window()->gobj(); +#endif #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_DISPLAY (display)) + if (GDK_IS_X11_DISPLAY(gdk_display)) { - Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (window)); - Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (window)); - refresh_rate = XRRGetExactRefreshRate (dpy, xid); + Window xid = gdk_x11_window_get_xid(gdk_window); + Display *dpy = gdk_x11_display_get_xdisplay(gdk_display); + refresh_rate = XRRGetExactRefreshRate(dpy, xid); } #endif #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (display)) + if (GDK_IS_WAYLAND_DISPLAY(gdk_display)) { - GdkMonitor *monitor = gdk_display_get_monitor_at_window(display, gdk_window); - refresh_rate = (double) gdk_monitor_get_refresh_rate(monitor) / 1000.0; + GdkMonitor *monitor = gdk_display_get_monitor_at_window(gdk_display, gdk_window); + refresh_rate = (double)gdk_monitor_get_refresh_rate(monitor) / 1000.0; } #endif if (refresh_rate < 10.0) { - printf ("Warning: Couldn't read refresh rate.\n"); + printf("Warning: Couldn't read refresh rate.\n"); refresh_rate = 60.0; } return refresh_rate; } -int -Snes9xWindow::get_auto_input_rate () +int Snes9xWindow::get_auto_input_rate() { - double refresh_rate = get_refresh_rate (); + double refresh_rate = get_refresh_rate(); if (refresh_rate == 0.0) return 0; @@ -1588,69 +1151,73 @@ Snes9xWindow::get_auto_input_rate () } #ifdef GDK_WINDOWING_X11 -static void set_bypass_compositor (Display *dpy, Window window, unsigned char bypass) +static void set_bypass_compositor(Display *dpy, Window window, unsigned char bypass) { uint32 value = bypass; - Atom net_wm_bypass_compositor = XInternAtom (dpy, "_NET_WM_BYPASS_COMPOSITOR", False); - XChangeProperty (dpy, window, net_wm_bypass_compositor, XA_CARDINAL, 32, PropModeReplace, (const unsigned char *) &value, 1); + Atom net_wm_bypass_compositor = XInternAtom(dpy, "_NET_WM_BYPASS_COMPOSITOR", False); + XChangeProperty(dpy, window, net_wm_bypass_compositor, XA_CARDINAL, 32, PropModeReplace, (const unsigned char *)&value, 1); } #endif -void -Snes9xWindow::enter_fullscreen_mode () +void Snes9xWindow::enter_fullscreen_mode() { int rom_loaded = config->rom_loaded; if (config->fullscreen) return; + GdkDisplay *gdk_display = window->get_display()->gobj(); + GdkWindow *gdk_window = window->get_window()->gobj(); + config->rom_loaded = 0; nfs_width = config->window_width; nfs_height = config->window_height; + int nfs_x; + int nfs_y; + window->get_position(nfs_x, nfs_y); - gtk_window_get_position (GTK_WINDOW (window), &nfs_x, &nfs_y); - - if (config->change_display_resolution) +#ifdef GDK_WINDOWING_X11 + if (config->change_display_resolution && GDK_IS_X11_WINDOW(gdk_window)) { - GdkDisplay *gdk_display = gtk_widget_get_display (window); - Display *dpy = gdk_x11_display_get_xdisplay (gdk_display); + Display *dpy = gdk_x11_display_get_xdisplay(gdk_display); - gdk_display_sync (gdk_display); - if (XRRSetCrtcConfig (dpy, - config->xrr_screen_resources, - config->xrr_screen_resources->crtcs[0], - CurrentTime, - config->xrr_crtc_info->x, - config->xrr_crtc_info->y, - config->xrr_screen_resources->modes[config->xrr_index].id, - config->xrr_crtc_info->rotation, - &config->xrr_crtc_info->outputs[0], - 1) != 0) + gdk_display_sync(gdk_display); + if (XRRSetCrtcConfig(dpy, + config->xrr_screen_resources, + config->xrr_screen_resources->crtcs[0], + CurrentTime, + config->xrr_crtc_info->x, + config->xrr_crtc_info->y, + config->xrr_screen_resources->modes[config->xrr_index].id, + config->xrr_crtc_info->rotation, + &config->xrr_crtc_info->outputs[0], + 1) != 0) { config->change_display_resolution = 0; } if (gui_config->auto_input_rate) { - Settings.SoundInputRate = top_level->get_auto_input_rate (); - S9xUpdateDynamicRate (1, 2); + Settings.SoundInputRate = top_level->get_auto_input_rate(); + S9xUpdateDynamicRate(1, 2); } } +#endif /* Make sure everything is done synchronously */ - gdk_display_sync (gdk_display_get_default ()); - gtk_window_fullscreen (GTK_WINDOW (window)); + gdk_display_sync(gdk_display); + window->fullscreen(); + gdk_display_sync(gdk_display); + window->present(); - gdk_display_sync (gdk_display_get_default ()); - gtk_window_present (GTK_WINDOW (window)); #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window))) && + if (GDK_IS_X11_WINDOW(window->get_window()->gobj()) && config->default_esc_behavior != ESC_TOGGLE_MENUBAR) { - set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), - gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (window))), - 1); + set_bypass_compositor(gdk_x11_display_get_xdisplay(gdk_display), + gdk_x11_window_get_xid(gdk_window), + 1); } #endif config->fullscreen = 1; @@ -1660,201 +1227,151 @@ Snes9xWindow::enter_fullscreen_mode () if (!Settings.Paused && config->rom_loaded) config->ui_visible = false; - configure_widgets (); + configure_widgets(); } -void -Snes9xWindow::leave_fullscreen_mode () +void Snes9xWindow::leave_fullscreen_mode() { int rom_loaded = config->rom_loaded; if (!config->fullscreen) return; + GdkDisplay *gdk_display = window->get_display()->gobj(); + GdkWindow *gdk_window = window->get_window()->gobj(); + config->rom_loaded = 0; - if (config->change_display_resolution) +#ifdef GDK_WINDOWING_X11 + if (config->change_display_resolution && GDK_IS_X11_WINDOW(gdk_window)) { - GdkDisplay *gdk_display = gtk_widget_get_display (window); - Display *dpy = gdk_x11_display_get_xdisplay (gdk_display); + Display *dpy = gdk_x11_display_get_xdisplay(gdk_display); if (config->xrr_index > config->xrr_screen_resources->nmode) config->xrr_index = 0; - gdk_display_sync (gdk_display); - XRRSetCrtcConfig (dpy, - config->xrr_screen_resources, - config->xrr_screen_resources->crtcs[0], - CurrentTime, - config->xrr_crtc_info->x, - config->xrr_crtc_info->y, - config->xrr_crtc_info->mode, - config->xrr_crtc_info->rotation, - &config->xrr_crtc_info->outputs[0], - 1); + gdk_display_sync(gdk_display); + XRRSetCrtcConfig(dpy, + config->xrr_screen_resources, + config->xrr_screen_resources->crtcs[0], + CurrentTime, + config->xrr_crtc_info->x, + config->xrr_crtc_info->y, + config->xrr_crtc_info->mode, + config->xrr_crtc_info->rotation, + &config->xrr_crtc_info->outputs[0], + 1); if (gui_config->auto_input_rate) { - Settings.SoundInputRate = top_level->get_auto_input_rate (); - S9xUpdateDynamicRate (1, 2); + Settings.SoundInputRate = top_level->get_auto_input_rate(); + S9xUpdateDynamicRate(1, 2); } } - - gtk_window_unfullscreen (GTK_WINDOW (window)); - -#ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))) - { - set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), - gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (window))), - 0); - } #endif - resize (nfs_width, nfs_height); - gtk_window_move (GTK_WINDOW (window), nfs_x, nfs_y); + window->unfullscreen(); + +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_WINDOW(gdk_window)) + { + set_bypass_compositor(gdk_x11_display_get_xdisplay(gdk_display), + gdk_x11_window_get_xid(gdk_window), + 0); + } +#endif + + resize(nfs_width, nfs_height); + window->move(nfs_x, nfs_y); config->rom_loaded = rom_loaded; - config->fullscreen = 0; - - configure_widgets (); + configure_widgets(); } -void -Snes9xWindow::resize_viewport (int width, int height) +void Snes9xWindow::resize_viewport(int width, int height) { - GtkWidget *item; - GtkAllocation allocation; - int y_padding = 0; + auto menubar = get_object("menubar"); + if (menubar->get_visible()) + height += menubar->get_height(); - item = get_widget ("menubar"); - gtk_widget_get_allocation (item, &allocation); - y_padding += gtk_widget_get_visible (item) ? allocation.height : 0; - - resize (width, height + y_padding); + resize(width, height); } -void -Snes9xWindow::hide_mouse_cursor () +void Snes9xWindow::hide_mouse_cursor() { - if (!empty_cursor) - { - empty_cursor = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_BLANK_CURSOR); - } - - gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)), - empty_cursor); + auto blank = Gdk::Cursor::create(Gdk::BLANK_CURSOR); + drawing_area->get_window()->set_cursor(blank); config->pointer_is_visible = false; } -void -Snes9xWindow::show_mouse_cursor () +void Snes9xWindow::show_mouse_cursor() { - gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)), - NULL); + auto left_ptr = Gdk::Cursor::create(Gdk::LEFT_PTR); + drawing_area->get_window()->set_cursor(left_ptr); config->pointer_is_visible = true; } -void -Snes9xWindow::center_mouse () +void Snes9xWindow::center_mouse() { - GdkWindow *gdk_window = gtk_widget_get_window (window); - GdkDisplay *gdk_display = gdk_window_get_display (gdk_window); - GdkScreen *gdk_screen = gdk_window_get_screen (gdk_window); - int x, y, w, h; + int x; + int y; - gdk_window_get_origin (gdk_window, &x, &y); - w = gdk_window_get_width (gdk_window); - h = gdk_window_get_height (gdk_window); + window->get_window()->get_origin(x, y); + int w = window->get_width(); + int h = window->get_height(); gdk_mouse_x = x + w / 2; gdk_mouse_y = y + h / 2; -#if GTK_MAJOR_VERSION < 3 - gdk_display_warp_pointer (gdk_display, gdk_screen, gdk_mouse_x, - gdk_mouse_y); -#else - GdkSeat *seat = gdk_display_get_default_seat (gdk_display); - GdkDevice *pointer = gdk_seat_get_pointer (seat); - - gdk_device_warp (pointer, gdk_screen, gdk_mouse_x, gdk_mouse_y); -#endif + window->get_display()->get_default_seat()->get_pointer()->warp(window->get_screen(), gdk_mouse_x, gdk_mouse_y); } -void -Snes9xWindow::toggle_grab_mouse () +void Snes9xWindow::toggle_grab_mouse() { - GdkWindow *gdk_window = gtk_widget_get_window (window); - GdkDisplay *gdk_display = gdk_window_get_display (gdk_window); - - if ((!mouse_grabbed && !S9xIsMousePluggedIn ()) || !config->rom_loaded) + if ((!mouse_grabbed && !S9xIsMousePluggedIn()) || !config->rom_loaded) return; -#if GTK_MAJOR_VERSION < 3 + auto seat = window->get_display()->get_default_seat(); if (!mouse_grabbed) - { - gdk_pointer_grab (gdk_window, true, (GdkEventMask) 1020, gdk_window, empty_cursor, GDK_CURRENT_TIME); - center_mouse (); - } + seat->grab(window->get_window(), Gdk::SEAT_CAPABILITY_ALL_POINTING, true, Gdk::Cursor::create(Gdk::BLANK_CURSOR)); else - { - gdk_pointer_ungrab (GDK_CURRENT_TIME); - if (config->pointer_is_visible) - show_mouse_cursor (); - } -#else - GdkSeat *seat = gdk_display_get_default_seat (gdk_display); + seat->ungrab(); - if (!mouse_grabbed) - gdk_seat_grab (seat, gdk_window, GDK_SEAT_CAPABILITY_ALL_POINTING, true, - empty_cursor, NULL, NULL, NULL); - else - gdk_seat_ungrab (seat); -#endif - - S9xReportPointer (BINDING_MOUSE_POINTER, 0, 0); - snes_mouse_x = 0.0; snes_mouse_y = 0.0; + S9xReportPointer(BINDING_MOUSE_POINTER, 0, 0); + snes_mouse_x = 0.0; + snes_mouse_y = 0.0; mouse_grabbed = !mouse_grabbed; if (mouse_grabbed) - center_mouse (); + center_mouse(); } -void -Snes9xWindow::show () +void Snes9xWindow::show() { - gtk_widget_show (window); + window->show(); + configure_widgets(); if (!recent_menu) { - /* Add recent menu after showing window to avoid "No items" bug */ - recent_menu = gtk_recent_chooser_menu_new_for_manager ( - gtk_recent_manager_get_default ()); + auto manager = Gtk::RecentManager::get_default(); + recent_menu = new Gtk::RecentChooserMenu(manager); - GtkRecentFilter *filter = gtk_recent_filter_new (); - GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (recent_menu); + auto filter = Gtk::RecentFilter::create(); + filter->add_group("cartridge"); + recent_menu->add_filter(filter); + recent_menu->set_local_only(); + recent_menu->set_show_icons(false); + recent_menu->set_sort_type(Gtk::RECENT_SORT_MRU); + get_object("open_recent_item")->set_submenu(*recent_menu); + recent_menu->signal_item_activated().connect([&] { + try_open_rom(Glib::filename_from_uri(recent_menu->get_current_uri()).c_str()); + }); - gtk_recent_filter_add_group (filter, "cartridge"); - gtk_recent_chooser_set_local_only (chooser, true); - gtk_recent_chooser_set_show_icons (chooser, false); - gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU); - gtk_recent_chooser_add_filter (chooser, filter); - - gtk_menu_item_set_submenu ( - GTK_MENU_ITEM (get_widget ("open_recent_item")), - recent_menu); - - g_signal_connect (G_OBJECT (recent_menu), - "item-activated", - G_CALLBACK (event_recent_open), - (gpointer) this); - - gtk_widget_show (recent_menu); + recent_menu->show(); } } -void -Snes9xWindow::propagate_pause_state () +void Snes9xWindow::propagate_pause_state() { int oldpause = Settings.Paused; @@ -1862,63 +1379,53 @@ Snes9xWindow::propagate_pause_state () if (Settings.Paused != oldpause) { - if (!is_paused ()) + if (!is_paused()) { - S9xSoundStart (); + S9xSoundStart(); if (config->rom_loaded) - enable_widget ("pause_item", true); - - S9xDisplayClearBuffers (); + enable_widget("pause_item", true); } else { - S9xSoundStop (); - enable_widget ("pause_item", false); - + S9xSoundStop(); + enable_widget("pause_item", false); } - configure_widgets (); + configure_widgets(); } } -void -Snes9xWindow::toggle_ui () +void Snes9xWindow::toggle_ui() { config->ui_visible = !config->ui_visible; - - configure_widgets (); + configure_widgets(); } /* gui_[un]pause Handles when system needs to pause the emulator */ -void -Snes9xWindow::pause_from_focus_change () +void Snes9xWindow::pause_from_focus_change() { sys_pause += config->modal_dialogs; - - propagate_pause_state (); + propagate_pause_state(); } -void -Snes9xWindow::unpause_from_focus_change () +void Snes9xWindow::unpause_from_focus_change() { if (--sys_pause < 0) sys_pause = 0; - propagate_pause_state (); + propagate_pause_state(); } /* client_[un]pause Handles when user manually chooses to pause */ -void -Snes9xWindow::pause_from_user () +void Snes9xWindow::pause_from_user() { user_pause = true; - propagate_pause_state (); + propagate_pause_state(); } -void -Snes9xWindow::unpause_from_user () +void Snes9xWindow::unpause_from_user() { user_pause = false; - propagate_pause_state (); + propagate_pause_state(); } bool Snes9xWindow::is_paused() @@ -1929,149 +1436,112 @@ bool Snes9xWindow::is_paused() return false; } -void -Snes9xWindow::set_menu_item_accel_to_binding (const char *name, - const char *binding) +void Snes9xWindow::set_accelerator_to_binding(const char *name, const char *binding) { Binding bin; - char str[255]; - GtkAccelGroup *accel_group = NULL; - if (!strcmp (binding, "Escape Key")) + if (!strcmp(binding, "Escape Key")) { - bin = Binding (GDK_Escape, false, false, false); + bin = Binding(GDK_Escape, false, false, false); } else { - bin = S9xGetBindingByName (binding); + bin = S9xGetBindingByName(binding); } - snprintf (str, 255, "/%s", name); - if (!(bin.is_key ())) - { - gtk_accel_map_change_entry (str, - 0, - (GdkModifierType) 0, - true); + if (!(bin.is_key())) return; - } - GSList *accel_group_list = gtk_accel_groups_from_object (G_OBJECT (window)); + AcceleratorEntry entry{}; + entry.name = name; + entry.key = bin.get_key(); + entry.modifiers = bin.get_gdk_modifiers(); - if (accel_group_list) - { - accel_group = GTK_ACCEL_GROUP (accel_group_list->data); - } - else - { - accel_group = gtk_accel_group_new (); - gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); - } - - gtk_widget_set_accel_path (get_widget (name), str, accel_group); - - if (!gtk_accel_map_lookup_entry (str, NULL)) - { - gtk_accel_map_add_entry (str, - bin.get_key (), - bin.get_gdk_modifiers ()); - - } - else - { - gtk_accel_map_change_entry (str, - bin.get_key (), - bin.get_gdk_modifiers (), - true); - } + get_object(name)->add_accelerator("activate", accel_group, entry.key, entry.modifiers, Gtk::ACCEL_VISIBLE); + accelerators.push_back(entry); } -void -Snes9xWindow::update_accels () +void Snes9xWindow::update_accelerators() { - set_menu_item_accel_to_binding ("fullscreen_item", "GTK_fullscreen"); - set_menu_item_accel_to_binding ("reset_item", "SoftReset"); - set_menu_item_accel_to_binding ("save_state_0", "QuickSave000"); - set_menu_item_accel_to_binding ("save_state_1", "QuickSave001"); - set_menu_item_accel_to_binding ("save_state_2", "QuickSave002"); - set_menu_item_accel_to_binding ("save_state_3", "QuickSave003"); - set_menu_item_accel_to_binding ("save_state_4", "QuickSave004"); - set_menu_item_accel_to_binding ("save_state_5", "QuickSave005"); - set_menu_item_accel_to_binding ("save_state_6", "QuickSave006"); - set_menu_item_accel_to_binding ("save_state_7", "QuickSave007"); - set_menu_item_accel_to_binding ("save_state_8", "QuickSave008"); - set_menu_item_accel_to_binding ("save_state_9", "QuickSave009"); - set_menu_item_accel_to_binding ("load_state_0", "QuickLoad000"); - set_menu_item_accel_to_binding ("load_state_1", "QuickLoad001"); - set_menu_item_accel_to_binding ("load_state_2", "QuickLoad002"); - set_menu_item_accel_to_binding ("load_state_3", "QuickLoad003"); - set_menu_item_accel_to_binding ("load_state_4", "QuickLoad004"); - set_menu_item_accel_to_binding ("load_state_5", "QuickLoad005"); - set_menu_item_accel_to_binding ("load_state_6", "QuickLoad006"); - set_menu_item_accel_to_binding ("load_state_7", "QuickLoad007"); - set_menu_item_accel_to_binding ("load_state_8", "QuickLoad008"); - set_menu_item_accel_to_binding ("load_state_9", "QuickLoad009"); - set_menu_item_accel_to_binding ("pause_item", "GTK_pause"); - set_menu_item_accel_to_binding ("save_spc_item", "GTK_save_spc"); - set_menu_item_accel_to_binding ("open_rom_item", "GTK_open_rom"); - set_menu_item_accel_to_binding ("record_movie_item", "BeginRecordingMovie"); - set_menu_item_accel_to_binding ("open_movie_item", "LoadMovie"); - set_menu_item_accel_to_binding ("stop_recording_item", "EndRecordingMovie"); - set_menu_item_accel_to_binding ("jump_to_frame_item", "GTK_seek_to_frame"); - set_menu_item_accel_to_binding ("reset_item", "SoftReset"); - set_menu_item_accel_to_binding ("hard_reset_item", "Reset"); - set_menu_item_accel_to_binding ("exit_item", "GTK_quit"); + if (!accel_group) + { + accel_group = Gtk::AccelGroup::create(); + window->add_accel_group(accel_group); + } - /* Special UI assignment */ - set_menu_item_accel_to_binding ("hide_ui", "Escape Key"); + for (auto &entry : accelerators) + { + get_object(entry.name.c_str())->remove_accelerator(accel_group, entry.key, entry.modifiers); + } + accelerators.clear(); + + set_accelerator_to_binding("fullscreen_item", "GTK_fullscreen"); + set_accelerator_to_binding("reset_item", "SoftReset"); + set_accelerator_to_binding("save_state_0", "QuickSave000"); + set_accelerator_to_binding("save_state_1", "QuickSave001"); + set_accelerator_to_binding("save_state_2", "QuickSave002"); + set_accelerator_to_binding("save_state_3", "QuickSave003"); + set_accelerator_to_binding("save_state_4", "QuickSave004"); + set_accelerator_to_binding("save_state_5", "QuickSave005"); + set_accelerator_to_binding("save_state_6", "QuickSave006"); + set_accelerator_to_binding("save_state_7", "QuickSave007"); + set_accelerator_to_binding("save_state_8", "QuickSave008"); + set_accelerator_to_binding("save_state_9", "QuickSave009"); + set_accelerator_to_binding("load_state_0", "QuickLoad000"); + set_accelerator_to_binding("load_state_1", "QuickLoad001"); + set_accelerator_to_binding("load_state_2", "QuickLoad002"); + set_accelerator_to_binding("load_state_3", "QuickLoad003"); + set_accelerator_to_binding("load_state_4", "QuickLoad004"); + set_accelerator_to_binding("load_state_5", "QuickLoad005"); + set_accelerator_to_binding("load_state_6", "QuickLoad006"); + set_accelerator_to_binding("load_state_7", "QuickLoad007"); + set_accelerator_to_binding("load_state_8", "QuickLoad008"); + set_accelerator_to_binding("load_state_9", "QuickLoad009"); + set_accelerator_to_binding("pause_item", "GTK_pause"); + set_accelerator_to_binding("save_spc_item", "GTK_save_spc"); + set_accelerator_to_binding("open_rom_item", "GTK_open_rom"); + set_accelerator_to_binding("record_movie_item", "BeginRecordingMovie"); + set_accelerator_to_binding("open_movie_item", "LoadMovie"); + set_accelerator_to_binding("stop_recording_item", "EndRecordingMovie"); + set_accelerator_to_binding("jump_to_frame_item", "GTK_seek_to_frame"); + set_accelerator_to_binding("reset_item", "SoftReset"); + set_accelerator_to_binding("hard_reset_item", "Reset"); + set_accelerator_to_binding("exit_item", "GTK_quit"); + + // Special UI assignment + set_accelerator_to_binding("hide_ui", "Escape Key"); } -void -Snes9xWindow::resize_to_multiple (int factor) +void Snes9xWindow::resize_to_multiple(int factor) { int h = (config->overscan ? 239 : 224) * factor; - int w = h * S9xGetAspect () + 0.5; + int w = h * S9xGetAspect() + 0.5; - resize_viewport (w, h); + resize_viewport(w, h); } -cairo_t * -Snes9xWindow::get_cairo () +cairo_t *Snes9xWindow::get_cairo() { if (cr) return cr; - GtkWidget *drawing_area = GTK_WIDGET (this->drawing_area); + auto allocation = drawing_area->get_allocation(); -#if GTK_MAJOR_VERSION < 3 - cr = gdk_cairo_create (gtk_widget_get_window (drawing_area)); -#else - GtkAllocation allocation; - gtk_widget_get_allocation (drawing_area, &allocation); - - cairo_rectangle_int_t rect = { 0, 0, allocation.width, allocation.height }; - cairo_region = cairo_region_create_rectangle (&rect); - gdk_drawing_context = gdk_window_begin_draw_frame (gtk_widget_get_window (drawing_area), - cairo_region); - cr = gdk_drawing_context_get_cairo_context (gdk_drawing_context); -#endif + Cairo::RectangleInt rect = { 0, 0, allocation.get_width(), allocation.get_height() }; + gdk_drawing_context = drawing_area->get_window()->begin_draw_frame(Cairo::Region::create(rect)); + cr = gdk_drawing_context->get_cairo_context()->cobj(); cairo_owned = true; return cr; } -void -Snes9xWindow::release_cairo () +void Snes9xWindow::release_cairo() { if (cairo_owned) { -#if GTK_MAJOR_VERSION < 3 - cairo_destroy (cr); -#else - gdk_window_end_draw_frame (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_drawing_context); - cairo_region_destroy (cairo_region); -#endif + drawing_area->get_window()->end_draw_frame(gdk_drawing_context); + gdk_drawing_context.clear(); cairo_owned = false; - cr = NULL; + cr = nullptr; } } diff --git a/gtk/src/gtk_s9xwindow.h b/gtk/src/gtk_s9xwindow.h index 29143a6b..6e656318 100644 --- a/gtk/src/gtk_s9xwindow.h +++ b/gtk/src/gtk_s9xwindow.h @@ -7,7 +7,7 @@ #ifndef __GTK_S9XWINDOW_H #define __GTK_S9XWINDOW_H -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include "port.h" #include "gtk_builder_window.h" @@ -15,90 +15,105 @@ class Snes9xWindow : public GtkBuilderWindow { - public: - Snes9xWindow (Snes9xConfig *config); + public: + Snes9xWindow(Snes9xConfig *config); - /* Pause related functions */ - void pause_from_focus_change (); - void unpause_from_focus_change (); - void focus_notify (bool state); - void pause_from_user (); - void unpause_from_user (); - bool is_paused (); - void propagate_pause_state (); + struct AcceleratorEntry + { + std::string name; + unsigned int key; + Gdk::ModifierType modifiers; + }; - /* Fullscreen functions */ - void enter_fullscreen_mode (); - void leave_fullscreen_mode (); - void toggle_fullscreen_mode (); - void finish_fullscreen (); + /* Pause related functions */ + void pause_from_focus_change(); + void unpause_from_focus_change(); + void focus_notify(bool state); + void pause_from_user(); + void unpause_from_user(); + bool is_paused(); + void propagate_pause_state(); - /* Cursor modifying functions */ - void show_mouse_cursor (); - void hide_mouse_cursor (); - void toggle_grab_mouse (); - void center_mouse (); + /* Fullscreen functions */ + void enter_fullscreen_mode(); + void leave_fullscreen_mode(); + void toggle_fullscreen_mode(); + void finish_fullscreen(); - /* Rom-related functions */ - void open_rom_dialog (); - void save_state_dialog (); - void load_state_dialog (); - void configure_widgets (); - void save_spc_dialog (); - bool try_open_rom (const char *filename); - const char *open_movie_dialog (bool readonly); - void movie_seek_dialog (); - void open_multicart_dialog (); - void show_rom_info (); + /* Cursor modifying functions */ + void show_mouse_cursor(); + void hide_mouse_cursor(); + void toggle_grab_mouse(); + void center_mouse(); - /* GTK-base-related functions */ - void show (); - void set_menu_item_selected (const char *name); - void set_mouseable_area (int x, int y, int width, int height); - void set_menu_item_accel_to_binding (const char *name, - const char *binding); - void reset_screensaver (); - void update_accels (); - void toggle_ui (); - void resize_to_multiple (int factor); - void resize_viewport (int width, int height); - void expose (); - void setup_splash(); - double get_refresh_rate (); - int get_auto_input_rate (); + /* Rom-related functions */ + std::string open_rom_dialog(bool run = true); + void save_state_dialog(); + void load_state_dialog(); + void configure_widgets(); + void save_spc_dialog(); + bool try_open_rom(std::string filename); + std::string open_movie_dialog(bool readonly); + void movie_seek_dialog(); + void open_multicart_dialog(); + void show_rom_info(); - cairo_t *get_cairo (); - void release_cairo (); + /* GTK-base-related functions */ + void show(); + void set_menu_item_selected(const char *name); + void set_mouseable_area(int x, int y, int width, int height); + void set_accelerator_to_binding(const char *name, + const char *binding); + void reset_screensaver(); + void update_accelerators(); + void toggle_ui(); + void resize_to_multiple(int factor); + void resize_viewport(int width, int height); + bool draw(const Cairo::RefPtr &cr); + void setup_splash(); + double get_refresh_rate(); + int get_auto_input_rate(); + void connect_signals(); + bool event_key(GdkEventKey *event); + void port_activate(const char *name); + bool button_press(GdkEventButton *event); + bool button_release(GdkEventButton *event); + bool motion_notify(GdkEventMotion *event); - Snes9xConfig *config; - int user_pause, sys_pause; - int last_width, last_height; - int mouse_region_x, mouse_region_y; - int mouse_region_width, mouse_region_height; - int nfs_width, nfs_height, nfs_x, nfs_y; - int fullscreen_state; - int maximized_state; - bool focused; - bool paused_from_focus_loss; - double snes_mouse_x, snes_mouse_y; - double gdk_mouse_x, gdk_mouse_y; - bool mouse_grabbed; - GdkPixbuf *icon, *splash; - GdkCursor *default_cursor, *empty_cursor; - GtkDrawingArea *drawing_area; - GtkWidget *recent_menu; - cairo_t *cr; - bool cairo_owned; -#if GTK_MAJOR_VERSION >= 3 - GdkDrawingContext *gdk_drawing_context; - cairo_region_t *cairo_region; -#endif + cairo_t *get_cairo(); + void release_cairo(); + + Snes9xConfig *config; + int user_pause, sys_pause; + int last_width, last_height; + int mouse_region_x, mouse_region_y; + int mouse_region_width, mouse_region_height; + int nfs_width, nfs_height, nfs_x, nfs_y; + int fullscreen_state; + int maximized_state; + bool focused; + bool paused_from_focus_loss; + double snes_mouse_x, snes_mouse_y; + double gdk_mouse_x, gdk_mouse_y; + bool mouse_grabbed; + GdkPixbuf *icon, *splash; + Gtk::DrawingArea *drawing_area; + Gtk::RecentChooserMenu *recent_menu; + cairo_t *cr; + bool cairo_owned; + Glib::RefPtr gdk_drawing_context; + Glib::RefPtr accel_group; + std::vector accelerators; + + unsigned int last_key_pressed_keyval; + GdkEventType last_key_pressed_type; }; -typedef struct gtk_splash_t { - unsigned int width; - unsigned int height; - unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ +typedef struct gtk_splash_t +{ + unsigned int width; + unsigned int height; + unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ unsigned char pixel_data[256 * 224 * 3 + 1]; } gtk_splash_t; diff --git a/gtk/src/gtk_shader_parameters.cpp b/gtk/src/gtk_shader_parameters.cpp index 3c2cf7dd..377167a9 100644 --- a/gtk/src/gtk_shader_parameters.cpp +++ b/gtk/src/gtk_shader_parameters.cpp @@ -4,7 +4,7 @@ For further information, consult the LICENSE file in the root directory. \*****************************************************************************/ -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" #include #include @@ -13,59 +13,27 @@ #include "gtk_shader_parameters.h" #include "shaders/glsl.h" -static GtkWidget *dialog = NULL; -static std::vector *params = NULL; +#include "gfx.h" + +static Gtk::Dialog *dialog = nullptr; +static std::vector *params = nullptr; static std::vector saved_params; static inline double snap_to_interval(double value, double interval) { + if (interval == 0.0) + return value; return round(value / interval) * interval; } -static void value_changed(GtkRange *range, gpointer user_data) +static void dialog_response(int response_id) { - GLSLParam *p = (GLSLParam *)user_data; - GtkAdjustment *adj = gtk_range_get_adjustment(range); - double interval = gtk_adjustment_get_step_increment(adj); - double value = gtk_range_get_value(range); - - value = snap_to_interval(value, interval); - - gtk_range_set_value(range, value); - - if (p->val != value) - { - p->val = value; - if (Settings.Paused) - S9xDeinitUpdate(top_level->last_width, top_level->last_height); - } -} - -static void toggled(GtkToggleButton *togglebutton, gpointer user_data) -{ - GLSLParam *p = (GLSLParam *)user_data; - double value = (double)gtk_toggle_button_get_active(togglebutton); - - if (p->val != value) - { - p->val = value; - if (Settings.Paused) - S9xDeinitUpdate(top_level->last_width, top_level->last_height); - } -} - -static void dialog_response(GtkDialog *pdialog, gint response_id, gpointer user_data) -{ - std::vector *params = (std::vector *)user_data; - - int width, height; - gtk_window_get_size(GTK_WINDOW(pdialog), &width, &height); - gui_config->shader_parameters_width = width; - gui_config->shader_parameters_height = height; + gui_config->shader_parameters_width = dialog->get_width(); + gui_config->shader_parameters_height = dialog->get_height(); switch (response_id) { - case GTK_RESPONSE_OK: + case Gtk::RESPONSE_OK: { char path[PATH_MAX]; std::string config_file = get_config_dir(); @@ -78,17 +46,17 @@ static void dialog_response(GtkDialog *pdialog, gint response_id, gpointer user_ gui_config->shader_filename = path; if (dialog) - gtk_widget_destroy(GTK_WIDGET(dialog)); - dialog = NULL; + delete dialog; + dialog = nullptr; break; } - case GTK_RESPONSE_CANCEL: - case GTK_RESPONSE_DELETE_EVENT: - case GTK_RESPONSE_NONE: + case Gtk::RESPONSE_CANCEL: + case Gtk::RESPONSE_DELETE_EVENT: + case Gtk::RESPONSE_NONE: if (dialog) - gtk_widget_destroy(GTK_WIDGET(dialog)); - dialog = NULL; + delete dialog; + dialog = nullptr; *params = saved_params; if (Settings.Paused) S9xDeinitUpdate(top_level->last_width, top_level->last_height); @@ -96,17 +64,14 @@ static void dialog_response(GtkDialog *pdialog, gint response_id, gpointer user_ case 15: // Save As { - auto dialog = gtk_file_chooser_dialog_new(_("Export Shader Preset to:"), - top_level->get_window(), - GTK_FILE_CHOOSER_ACTION_SAVE, - "gtk-cancel", GTK_RESPONSE_CANCEL, - "gtk-save", GTK_RESPONSE_ACCEPT, - NULL); + Gtk::FileChooserDialog dialog(_("Export Shader Preset to:"), Gtk::FILE_CHOOSER_ACTION_SAVE); + dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_ACCEPT); + dialog.set_current_folder(gui_config->last_shader_directory); + + std::string name; + std::string extension; - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), - gui_config->last_shader_directory.c_str()); - const char *name; - const char *extension; if (gui_config->shader_filename.find(".slang") != std::string::npos) { name = "new.slangp"; @@ -117,26 +82,23 @@ static void dialog_response(GtkDialog *pdialog, gint response_id, gpointer user_ name = "new.glslp"; extension = "*.glslp"; } - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), name); - gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), true); - auto filter = gtk_file_filter_new(); - gtk_file_filter_set_name(filter, _("Shader Preset")); - gtk_file_filter_add_pattern(filter, extension); - gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); + dialog.set_current_name(name); + dialog.set_do_overwrite_confirmation(); - auto result = gtk_dialog_run(GTK_DIALOG(dialog)); + auto filter = Gtk::FileFilter::create(); + filter->set_name(_("Shader Preset")); + filter->add_pattern(extension); + dialog.add_filter(filter); + + auto result = dialog.run(); if (result == GTK_RESPONSE_ACCEPT) - { - auto filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - S9xDisplayGetDriver()->save(filename); - g_free(filename); - } + S9xDisplayGetDriver()->save(dialog.get_filename().c_str()); - gtk_widget_destroy(dialog); break; } + default: break; } @@ -147,8 +109,8 @@ void gtk_shader_parameters_dialog_close() if (dialog) { *params = saved_params; - gtk_widget_destroy(GTK_WIDGET(dialog)); - dialog = NULL; + delete dialog; + dialog = nullptr; } } @@ -156,7 +118,7 @@ bool gtk_shader_parameters_dialog(GtkWindow *parent) { if (dialog) { - gtk_window_present(GTK_WINDOW(dialog)); + dialog->present(); return false; } @@ -166,145 +128,85 @@ bool gtk_shader_parameters_dialog(GtkWindow *parent) if (!params || params->size() == 0) return false; - dialog = gtk_dialog_new_with_buttons(_("GLSL Shader Parameters"), - parent, - GTK_DIALOG_DESTROY_WITH_PARENT, - "gtk-cancel", - GTK_RESPONSE_CANCEL, - "gtk-save-as", - 15, - "gtk-save", - GTK_RESPONSE_OK, - NULL); + dialog = new Gtk::Dialog(_("Shader Parameters"), Gtk::DIALOG_DESTROY_WITH_PARENT); + dialog->add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); + dialog->add_button(Gtk::StockID("gtk-save-as"), 15); + dialog->add_button(Gtk::StockID("gtk-save"), GTK_RESPONSE_OK); + dialog->signal_response().connect(sigc::ptr_fun(dialog_response)); - g_signal_connect_data(G_OBJECT(dialog), "response", G_CALLBACK(dialog_response), (gpointer)params, NULL, (GConnectFlags)0); - - GtkWidget *scrolled_window; - gtk_widget_set_size_request(dialog, 640, 480); + dialog->set_size_request(640, 480); if (gui_config->shader_parameters_width > 0 && gui_config->shader_parameters_height > 0) - { - gtk_window_resize(GTK_WINDOW(dialog), - gui_config->shader_parameters_width, - gui_config->shader_parameters_height); - } + dialog->resize(gui_config->shader_parameters_width, gui_config->shader_parameters_height); - scrolled_window = gtk_scrolled_window_new(NULL, NULL); - gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), - scrolled_window); + auto scrolled_window = new Gtk::ScrolledWindow; + scrolled_window->set_hexpand(); + scrolled_window->set_vexpand(); + scrolled_window->set_margin_start(5); + scrolled_window->set_margin_end(5); + scrolled_window->set_margin_top(5); + dialog->get_content_area()->add(*scrolled_window); - GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); - -#if GTK_MAJOR_VERSION >= 3 - - gtk_widget_set_hexpand(scrolled_window, true); - gtk_widget_set_vexpand(scrolled_window, true); - gtk_widget_set_margin_start(scrolled_window, 5); - gtk_widget_set_margin_end(scrolled_window, 5); - gtk_widget_set_margin_top(scrolled_window, 5); - gtk_widget_set_margin_bottom(scrolled_window, 5); - - GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - GtkWidget *grid = gtk_grid_new(); - gtk_widget_set_margin_end(grid, 5); - gtk_grid_set_row_homogeneous(GTK_GRID(grid), true); - gtk_grid_set_row_spacing(GTK_GRID(grid), 2); - gtk_grid_set_column_spacing(GTK_GRID(grid), 12); - gtk_container_add(GTK_CONTAINER(vbox), grid); - gtk_container_add(GTK_CONTAINER(scrolled_window), vbox); + auto grid = new Gtk::Grid; + grid->set_margin_end(5); + grid->set_row_homogeneous(); + grid->set_row_spacing(2); + grid->set_column_spacing(12); + auto vbox = new Gtk::VBox; + vbox->pack_start(*grid, Gtk::PACK_SHRINK); + scrolled_window->add(*vbox); + auto sizegroup = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL); for (unsigned int i = 0; i < params->size(); i++) { - GLSLParam *p = &(*params)[i]; - GtkWidget *label = gtk_label_new(p->name); - gtk_label_set_xalign(GTK_LABEL(label), 0.0f); - gtk_widget_show(label); + GLSLParam &p = (*params)[i]; + auto label = new Gtk::Label(p.name); + label->set_xalign(0.0f); + label->show(); + grid->attach(*label, 0, i, 1, 1); - gtk_grid_attach(GTK_GRID(grid), label, 0, i, 1, 1); - - if (p->min == 0.0 && p->max == 1.0 && p->step == 1.0) + if (p.min == 0.0 && p.max == 1.0 && p.step == 1.0) { - GtkWidget *check = gtk_check_button_new(); - gtk_grid_attach(GTK_GRID(grid), check, 1, i, 1, 1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), (int)p->val); - g_signal_connect_data(G_OBJECT(check), "toggled", G_CALLBACK(toggled), (gpointer)p, NULL, (GConnectFlags)0); + auto check = new Gtk::CheckButton; + grid->attach(*check, 1, i, 1, 1); + check->set_active(p.val); + check->signal_toggled().connect([check, ¶m = p.val] { + double new_value = check->get_active(); + if (param != new_value) + { + param = new_value; + if (Settings.Paused) + S9xDeinitUpdate(top_level->last_width, top_level->last_height); + } + }); } else { - GtkWidget *spin = gtk_spin_button_new_with_range(p->min, p->max, p->step); - gtk_entry_set_width_chars(GTK_ENTRY(spin), 5); - gtk_grid_attach(GTK_GRID(grid), spin, 1, i, 1, 1); - gtk_size_group_add_widget(sizegroup, spin); - int digits = gtk_spin_button_get_digits(GTK_SPIN_BUTTON(spin)); - if (digits == 2) - gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 3); + auto spin = new Gtk::SpinButton(0.0, p.digits); + spin->set_range(p.min, p.max); + spin->get_adjustment()->set_step_increment(p.step); + spin->set_width_chars(6); + grid->attach(*spin, 1, i, 1, 1); + sizegroup->add_widget(*spin); - GtkAdjustment *adjustment = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin)); - - GtkWidget *scale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment); - gtk_widget_set_hexpand(scale, true); - gtk_grid_attach(GTK_GRID(grid), scale, 2, i, 1, 1); - gtk_scale_set_draw_value(GTK_SCALE(scale), false); - gtk_range_set_value(GTK_RANGE(scale), p->val); - g_signal_connect_data(G_OBJECT(scale), - "value-changed", - G_CALLBACK(value_changed), - (gpointer)p, - NULL, - (GConnectFlags)0); + auto scale = new Gtk::Scale(spin->get_adjustment()); + scale->set_hexpand(); + grid->attach(*scale, 2, i, 1, 1); + scale->set_draw_value(false); + scale->set_value(p.val); + scale->signal_value_changed().connect([spin, ¶m = p.val] { + double new_value = snap_to_interval(spin->get_value(), spin->get_adjustment()->get_step_increment()); + spin->set_value(new_value); + if (param != new_value) + { + param = new_value; + if (Settings.Paused) + S9xDeinitUpdate(top_level->last_width, top_level->last_height); + } + }); } } -#else - GtkWidget *vbox = gtk_vbox_new(false, 5); - GtkWidget *table = gtk_table_new(params->size(), 3, false); - gtk_table_set_row_spacings(GTK_TABLE(table), 5); - gtk_table_set_col_spacings(GTK_TABLE(table), 12); - gtk_container_add(GTK_CONTAINER(vbox), table); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), vbox); - gtk_container_set_border_width(GTK_CONTAINER(scrolled_window), 5); - for (unsigned int i = 0; i < params->size(); i++) - { - GLSLParam *p = &(*params)[i]; - GtkWidget *label = gtk_label_new(p->name); - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); - gtk_widget_show(label); - - gtk_table_attach(GTK_TABLE(table), label, 0, 1, i, i + 1, GTK_FILL, GTK_FILL, 0, 0); - - if (p->min == 0.0 && p->max == 1.0 && p->step == 1.0) - { - GtkWidget *check = gtk_check_button_new(); - gtk_table_attach(GTK_TABLE(table), check, 1, 2, i, i + 1, GTK_FILL, GTK_FILL, 0, 0); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), (int)p->val); - g_signal_connect_data(G_OBJECT(check), "toggled", G_CALLBACK(toggled), (gpointer)p, NULL, (GConnectFlags)0); - } - else - { - GtkWidget *spin = gtk_spin_button_new_with_range(p->min, p->max, p->step); - gtk_table_attach(GTK_TABLE(table), spin, 1, 2, i, i + 1, GTK_FILL, GTK_FILL, 0, 0); - gtk_size_group_add_widget(sizegroup, spin); - int digits = gtk_spin_button_get_digits(GTK_SPIN_BUTTON(spin)); - if (digits == 2) - gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 3); - - GtkAdjustment *adjustment = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin)); - - GtkWidget *scale = gtk_hscale_new(adjustment); - gtk_table_attach(GTK_TABLE(table), scale, 2, 3, i, i + 1, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0); - gtk_scale_set_draw_value(GTK_SCALE(scale), false); - gtk_range_set_value(GTK_RANGE(scale), p->val); - g_signal_connect_data(G_OBJECT(scale), - "value-changed", - G_CALLBACK(value_changed), - (gpointer)p, - NULL, - (GConnectFlags)0); - } - } -#endif - - gtk_widget_show_all(dialog); + dialog->show_all(); return true; } diff --git a/gtk/src/gtk_shader_parameters.h b/gtk/src/gtk_shader_parameters.h index d3984804..0919cc7b 100644 --- a/gtk/src/gtk_shader_parameters.h +++ b/gtk/src/gtk_shader_parameters.h @@ -7,9 +7,9 @@ #ifndef __GTK_SHADER_PARAMETERS_H #define __GTK_SHADER_PARAMETERS_H -#include "gtk_2_3_compat.h" +#include "gtk_compat.h" -bool gtk_shader_parameters_dialog (GtkWindow *parent); -void gtk_shader_parameters_dialog_close (); +bool gtk_shader_parameters_dialog(GtkWindow *parent); +void gtk_shader_parameters_dialog_close(); #endif // __GTK_SHADER_PARAMETERS_H diff --git a/gtk/src/gtk_sound.cpp b/gtk/src/gtk_sound.cpp index 28d46a9e..110d4102 100644 --- a/gtk/src/gtk_sound.cpp +++ b/gtk/src/gtk_sound.cpp @@ -10,6 +10,8 @@ #include "gtk_s9x.h" #include "gtk_sound.h" #include "gtk_sound_driver.h" +#include "snes9x.h" +#include "apu/apu.h" #ifdef USE_PORTAUDIO #include "gtk_sound_driver_portaudio.h" @@ -30,10 +32,9 @@ static int playback_rates[8] = 0, 8000, 11025, 16000, 22050, 32000, 44100, 48000 }; -S9xSoundDriver *driver; +static S9xSoundDriver *driver; -int -S9xSoundBase2log (int num) +int S9xSoundBase2log(int num) { int power; @@ -48,14 +49,12 @@ S9xSoundBase2log (int num) return power; } -int -S9xSoundPowerof2 (int num) +int S9xSoundPowerof2(int num) { return (1 << num); } -void -S9xPortSoundInit () +void S9xPortSoundInit() { int pao_driver = 0; int sdl_driver = 0; @@ -103,34 +102,34 @@ S9xPortSoundInit () #ifdef USE_PORTAUDIO if (gui_config->sound_driver == pao_driver) - driver = new S9xPortAudioSoundDriver (); + driver = new S9xPortAudioSoundDriver(); #endif #ifdef USE_OSS if (gui_config->sound_driver == oss_driver) - driver = new S9xOSSSoundDriver (); + driver = new S9xOSSSoundDriver(); #endif if (gui_config->sound_driver == sdl_driver) - driver = new S9xSDLSoundDriver (); + driver = new S9xSDLSoundDriver(); #ifdef USE_ALSA if (gui_config->sound_driver == alsa_driver) - driver = new S9xAlsaSoundDriver (); + driver = new S9xAlsaSoundDriver(); #endif #ifdef USE_PULSEAUDIO if (gui_config->sound_driver == pulse_driver) - driver = new S9xPulseSoundDriver (); + driver = new S9xPulseSoundDriver(); #endif if (driver != NULL) { - driver->init (); + driver->init(); if (gui_config->auto_input_rate) { - Settings.SoundInputRate = top_level->get_auto_input_rate (); + Settings.SoundInputRate = top_level->get_auto_input_rate(); if (Settings.SoundInputRate == 0.0) { Settings.SoundInputRate = 31950; @@ -139,68 +138,65 @@ S9xPortSoundInit () } else { - Settings.SoundInputRate = CLAMP (gui_config->sound_input_rate, 31700, 32300); + Settings.SoundInputRate = CLAMP(gui_config->sound_input_rate, 31700, 32300); } Settings.SoundPlaybackRate = playback_rates[gui_config->sound_playback_rate]; S9xInitSound(0); - S9xSetSoundMute (false); + S9xSetSoundMute(false); } else { - S9xSetSoundMute (gui_config->mute_sound); + S9xSetSoundMute(gui_config->mute_sound); } } -void -S9xPortSoundReinit () +void S9xPortSoundReinit() { - S9xPortSoundDeinit (); + S9xPortSoundDeinit(); /* Ensure the sound device is released before trying to reopen it. */ - sync (); + sync(); - S9xPortSoundInit (); + S9xPortSoundInit(); } -void -S9xPortSoundDeinit () +void S9xPortSoundDeinit() { - S9xSoundStop (); + S9xSoundStop(); - driver->terminate (); + if (driver) + driver->terminate(); delete driver; } -void -S9xSoundStart () +void S9xSoundStart() { - driver->start (); + if (driver) + driver->start(); } -void -S9xSoundStop () +void S9xSoundStop() { - driver->stop (); + if (driver) + driver->stop(); } -bool8 -S9xOpenSoundDevice () +bool8 S9xOpenSoundDevice() { if (gui_config->mute_sound) return false; - gui_config->sound_buffer_size = CLAMP (gui_config->sound_buffer_size, 2, 256); + gui_config->sound_buffer_size = CLAMP(gui_config->sound_buffer_size, 2, 256); - return driver->open_device (); + return driver->open_device(); } /* This really shouldn't be in the port layer */ -void -S9xToggleSoundChannel (int c) +void S9xToggleSoundChannel(int c) { static int sound_switch = 255; @@ -209,5 +205,5 @@ S9xToggleSoundChannel (int c) else sound_switch ^= 1 << c; - S9xSetSoundControl (sound_switch); + S9xSetSoundControl(sound_switch); } diff --git a/gtk/src/gtk_sound_driver_alsa.cpp b/gtk/src/gtk_sound_driver_alsa.cpp index 7fa50967..24e05430 100644 --- a/gtk/src/gtk_sound_driver_alsa.cpp +++ b/gtk/src/gtk_sound_driver_alsa.cpp @@ -6,6 +6,8 @@ #include "gtk_sound_driver_alsa.h" #include "gtk_s9x.h" +#include "snes9x.h" +#include "apu/apu.h" #include #include diff --git a/gtk/src/gtk_sound_driver_oss.cpp b/gtk/src/gtk_sound_driver_oss.cpp index 3eb09533..7f5412a5 100644 --- a/gtk/src/gtk_sound_driver_oss.cpp +++ b/gtk/src/gtk_sound_driver_oss.cpp @@ -6,6 +6,8 @@ #include "gtk_sound_driver_oss.h" #include "gtk_s9x.h" +#include "snes9x.h" +#include "apu/apu.h" #include #include diff --git a/gtk/src/gtk_sound_driver_portaudio.cpp b/gtk/src/gtk_sound_driver_portaudio.cpp index 07e9b94c..cf3699b3 100644 --- a/gtk/src/gtk_sound_driver_portaudio.cpp +++ b/gtk/src/gtk_sound_driver_portaudio.cpp @@ -6,6 +6,8 @@ #include "gtk_sound_driver_portaudio.h" #include "gtk_s9x.h" +#include "apu/apu.h" +#include "snes9x.h" static void port_audio_samples_available_callback(void *data) { diff --git a/gtk/src/gtk_sound_driver_pulse.cpp b/gtk/src/gtk_sound_driver_pulse.cpp index 925f6b0e..e73b56ef 100644 --- a/gtk/src/gtk_sound_driver_pulse.cpp +++ b/gtk/src/gtk_sound_driver_pulse.cpp @@ -6,6 +6,8 @@ #include "gtk_sound_driver_pulse.h" #include "gtk_s9x.h" +#include "snes9x.h" +#include "apu/apu.h" #include #include diff --git a/gtk/src/gtk_sound_driver_sdl.cpp b/gtk/src/gtk_sound_driver_sdl.cpp index c120fa36..cf2e23d0 100644 --- a/gtk/src/gtk_sound_driver_sdl.cpp +++ b/gtk/src/gtk_sound_driver_sdl.cpp @@ -6,6 +6,8 @@ #include "gtk_sound_driver_sdl.h" #include "gtk_s9x.h" +#include "apu/apu.h" +#include "snes9x.h" static void sdl_audio_callback(void *userdata, Uint8 *stream, int len) { diff --git a/gtk/src/gtk_wayland_egl_context.h b/gtk/src/gtk_wayland_egl_context.h index 29d5fb1b..c2ae37d5 100644 --- a/gtk/src/gtk_wayland_egl_context.h +++ b/gtk/src/gtk_wayland_egl_context.h @@ -7,11 +7,11 @@ #ifndef __GTK_WAYLAND_EGL_CONTEXT_H #define __GTK_WAYLAND_EGL_CONTEXT_H -#include -#include -#include - #include "gtk_opengl_context.h" +#include "gtk_compat.h" + +#include +#include class WaylandEGLContext : public OpenGLContext { diff --git a/gtk/src/mini_icon.png b/gtk/src/mini_icon.png deleted file mode 100644 index a8e85ac0..00000000 Binary files a/gtk/src/mini_icon.png and /dev/null differ diff --git a/gtk/src/snes9x.ui b/gtk/src/snes9x.ui index 447a943e..e1bb91d5 100644 --- a/gtk/src/snes9x.ui +++ b/gtk/src/snes9x.ui @@ -285,7 +285,7 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + gtk-close True True @@ -351,7 +351,7 @@ 5 5 - + gtk-add True True @@ -369,7 +369,7 @@ - + gtk-remove True True @@ -551,7 +551,7 @@ - button7 + cheats_close @@ -823,6 +823,12 @@ Color bars and patterns + + Starfield + + + Snow + @@ -2268,7 +2274,7 @@ - + True True True @@ -2695,7 +2701,7 @@ - + gtk-about True True @@ -4197,11 +4203,11 @@ - Mute sound when using turbo + Mute sound when using turbo or rewind True True False - Disables output of sound when using turbo + Disables output of sound when using turbo or rewind True True @@ -5440,7 +5446,7 @@ - + _Reset True True @@ -5496,7 +5502,7 @@ - + _Swap True True @@ -9314,7 +9320,7 @@ cancel_button ok_button button1 - button8 + about_button diff --git a/gtk/src/sourcify.c b/gtk/src/sourcify.c index f1eabb2a..50ee8754 100644 --- a/gtk/src/sourcify.c +++ b/gtk/src/sourcify.c @@ -7,9 +7,7 @@ #include #include -int -main (int argc, - char *argv[]) +int main(int argc, char *argv[]) { FILE *infile, *outfile; unsigned char inchar; @@ -18,49 +16,46 @@ main (int argc, if (argc != 4) { - fprintf (stderr, "Usage: %s infile outfile identifier\n", argv[0]); + fprintf(stderr, "Usage: %s infile outfile identifier\n", argv[0]); return 1; } - stat (argv[1], &file_info); + stat(argv[1], &file_info); - infile = fopen (argv[1], "r"); + infile = fopen(argv[1], "r"); if (!infile) { - fprintf (stderr, "Input file doesn't exist.\n"); + fprintf(stderr, "Input file doesn't exist.\n"); return 2; } - outfile = fopen (argv[2], "w+"); + outfile = fopen(argv[2], "w+"); - fprintf (outfile, - "int %s_size = %d;\n\n", - argv[3], - (int) file_info.st_size); - fprintf (outfile, "unsigned char %s [] = \n{\n ", argv[3]); + fprintf(outfile, "int %s_size = %d;\n\n", argv[3], (int)file_info.st_size); + fprintf(outfile, "unsigned char %s [] = \n{\n ", argv[3]); counter = 0; - while (fread (&inchar, 1, 1, infile)) + while (fread(&inchar, 1, 1, infile)) { if (counter >= 32) { counter = 0; - fprintf (outfile, "\n "); + fprintf(outfile, "\n "); } - fprintf (outfile, "%d,", inchar); + fprintf(outfile, "%d,", inchar); counter++; } /* Erase extra "," */ - fseek (outfile, -1, SEEK_CUR); + fseek(outfile, -1, SEEK_CUR); - fprintf (outfile, "\n};\n"); + fprintf(outfile, "\n};\n"); - fclose (infile); - fclose (outfile); + fclose(infile); + fclose(outfile); return 0; } diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 511f748f..af800249 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -61,4 +61,5 @@ SOURCES_CXX := $(CORE_DIR)/apu/apu.cpp \ $(CORE_DIR)/sha256.cpp \ $(CORE_DIR)/bml.cpp \ $(CORE_DIR)/movie.cpp \ + $(CORE_DIR)/compat.cpp \ $(CORE_DIR)/libretro/libretro.cpp diff --git a/libretro/libretro-win32.vcxproj b/libretro/libretro-win32.vcxproj index 6710b87e..5c9142db 100644 --- a/libretro/libretro-win32.vcxproj +++ b/libretro/libretro-win32.vcxproj @@ -97,7 +97,7 @@ Disabled - ../;../apu/bapu;%(AdditionalIncludeDirectories) + ../;../apu/bapu;../libretro;libretro-common/include;%(AdditionalIncludeDirectories) __WIN32__;__LIBRETRO__;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -120,7 +120,7 @@ Disabled - ../;../apu/bapu;%(AdditionalIncludeDirectories) + ../;../apu/bapu;../libretro;libretro-common/include;%(AdditionalIncludeDirectories) __WIN32__;__LIBRETRO__;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -143,7 +143,7 @@ AnySuitable true Speed - ../;../apu/bapu;%(AdditionalIncludeDirectories) + ../;../apu/bapu;../libretro;libretro-common/include;%(AdditionalIncludeDirectories) __WIN32__;__LIBRETRO__;%(PreprocessorDefinitions) MultiThreaded true @@ -170,7 +170,7 @@ true Speed true - ../;../apu/bapu;%(AdditionalIncludeDirectories) + ../;../apu/bapu;../libretro;libretro-common/include;%(AdditionalIncludeDirectories) __WIN32__;__LIBRETRO__;%(PreprocessorDefinitions) MultiThreaded true diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 1e359d30..b374f593 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -609,10 +609,10 @@ static void update_variables(void) var.key = "snes9x_echo_buffer_hack"; var.value = NULL; - + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var)) Settings.SeparateEchoBuffer = !strcmp(var.value, "disabled") ? false : true; - else + else Settings.SeparateEchoBuffer = false; var.key = "snes9x_blargg"; @@ -1135,7 +1135,7 @@ bool retro_load_game(const struct retro_game_info *game) if (rom_loaded) { /* If we're in RGB565 format, switch frontend to that */ - if (RED_SHIFT_BITS == 11) + if (RED_SHIFT_BITS == 11) { enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565; if (!environ_cb || !environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) @@ -1152,7 +1152,7 @@ bool retro_load_game(const struct retro_game_info *game) for(int lcv = 0; lcv < 0x20000; lcv++) Memory.RAM[lcv] = rand() % 256; } - + // restore disabled sound channels if (disabled_channels) { @@ -1393,7 +1393,7 @@ void retro_init(void) S9xUnmapAllControls(); map_buttons(); check_system_specs(); - + if (environ_cb(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL)) libretro_supports_bitmasks = true; } @@ -1728,7 +1728,7 @@ static void report_buttons() for (int i = BTN_FIRST; i <= BTN_LAST; i++) S9xReportButton(MAKE_BUTTON(port * offset + j + 1, i), joy_bits & (1 << i)); - } + } break; case RETRO_DEVICE_MOUSE: @@ -1894,7 +1894,7 @@ void retro_deinit() free(screen_buffer); free(ntsc_screen_buffer); - libretro_supports_bitmasks = false; + libretro_supports_bitmasks = false; } @@ -2007,7 +2007,7 @@ bool retro_unserialize(const void* data, size_t size) { S9xSetSoundControl(disabled_channels^0xFF); } - + return true; } @@ -2165,7 +2165,6 @@ const char* S9xGetDirectory(s9x_getdirtype type) return ""; } void S9xInitInputDevices() {} -const char* S9xChooseFilename(unsigned char) { return ""; } void S9xHandlePortCommand(s9xcommand_t, short, short) {} bool S9xPollButton(uint32, bool*) { return false; } void S9xToggleSoundChannel(int) {} @@ -2175,12 +2174,10 @@ bool8 S9xInitUpdate() { return TRUE; } void S9xExtraUsage() {} bool8 S9xOpenSoundDevice() { return TRUE; } bool S9xPollAxis(uint32, short*) { return FALSE; } -void S9xSetPalette() {} void S9xParseArg(char**, int&, int) {} void S9xExit() {} bool S9xPollPointer(uint32, short*, short*) { return false; } -const char *S9xChooseMovieFilename(unsigned char) { return NULL; } void S9xMessage(int type, int, const char* s) { if (!log_cb) return; @@ -2233,66 +2230,3 @@ void S9xAutoSaveSRAM() { return; } - -#ifndef __WIN32__ -// S9x weirdness. -void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) -{ - *drive = 0; - - const char *slash = strrchr(path, SLASH_CHAR), - *dot = strrchr(path, '.'); - - if (dot && slash && dot < slash) - dot = NULL; - - if (!slash) - { - *dir = 0; - - strcpy(fname, path); - - if (dot) - { - fname[dot - path] = 0; - strcpy(ext, dot + 1); - } - else - *ext = 0; - } - else - { - strcpy(dir, path); - dir[slash - path] = 0; - - strcpy(fname, slash + 1); - - if (dot) - { - fname[dot - slash - 1] = 0; - strcpy(ext, dot + 1); - } - else - *ext = 0; - } -} - -void _makepath (char *path, const char *, const char *dir, const char *fname, const char *ext) -{ - if (dir && *dir) - { - strcpy(path, dir); - strcat(path, SLASH_STR); - } - else - *path = 0; - - strcat(path, fname); - - if (ext && *ext) - { - strcat(path, "."); - strcat(path, ext); - } -} -#endif // __WIN32__ diff --git a/macosx/.gitignore b/macosx/.gitignore new file mode 100644 index 00000000..4e6f89d5 --- /dev/null +++ b/macosx/.gitignore @@ -0,0 +1,3 @@ +Build +.DS_Store +xcuserdata diff --git a/macosx/English.lproj/Snes9x Help/pgs/14.html b/macosx/English.lproj/Snes9x Help/pgs/14.html deleted file mode 100644 index a1c3d064..00000000 --- a/macosx/English.lproj/Snes9x Help/pgs/14.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - References - - -

References

-

Preferences Dialog

-

Graphics Tab

-
-
Full Screen Mode
-
Toggles full screen/windowed mode. Press esc key to hide full screen window and pause the game.
-
Switch Monitor Resolution
-
Toggles between scaling full screen graphics to the current screen resolution or changing the screen resolution to fit Snes9x's needs.
-
Show Frame Rate
-
Toggles display of the frame rate on/off.
-
Transparency Effects
-
Toggles transparency effects on/off. Transparency effect is used in almost all games so this option is just for hack.
-
Video Mode
-
Choose the image scaling filter which is applied to the raw SNES image.
-
Multitask
-
When this option is on, the rendering process is separated from the emulation thread (except blocky and smooth modes).
-
Keep Overscanned Height
-
Keeps the screen height always 239/478, for some games that change screen height frequently.
-
Sync to Vertical Blank
-
Synchronizes the render timing to the monitor's vertical refresh rate.
-
Stretch Image in Full Screen Mode
-
Stretches the image to fill the screen in full screen mode.
-
Aspect Ratio
-
The aspect ratio of above option: the left is proportional and the right is full width of the monitor.
-
Use Core Image
-
Applies additional Core Image effect after the image filter is applied.
-
Filter...
-
Choose the Core Image filter.
-
Use 32 Bit Color
-
Uses 16,777,216 colors.
-
Use Screen Curvature
-
Adds a warp effect like a CRT-based television.
-
Warp
-
The degree of curvature.
-
-

Sound Tab

-
-
Synchronize
-
Tries and ensures all available samples are buffered so there are no overruns.
-
16 Bit Playback
-
Enables 16-bit playback instead of 8-bit.
-
Stereo
-
Enables stereo sound instead of mono.
-
Reverse Stereo
-
Swaps the left and right stereo channels.
-
Effect...
-
Opens 'Sound Effect' dialog.
-
Playback Rate
-
The real SNES is 32040 Hz. Any values other than 32040 Hz will cause resampling.
-
Output Interval
-
Make sure this value is smaller than the mix buffer length.
-
Mix Buffer Length
-
Too short length will cause crackling noise.
-
Allow Lag
-
Safer from crackling noise, but time-lag becomes more noticeable.
-
Volume
-
Volume of the whole Snes9x sounds.
-
Input Rate
-
Adjusts the sound rate through resampling. For every Input Rate samples generated by the SNES, Playback Rate samples will be produced.
-
-

File Tab

-
-
Save Data in
-
Choose the folder where Snes9x will look for files.
-
Auto Save SRAM
-
Updates SRAM file when SRAM contents are modified. This may cause frequent disk access.
-
-

Accuracy Tab

-
-
HDMA Timing Hack
-
Changes HDMA timing and will 'fix' some games' glitches, but breaks many other games. The default value is 100.
-
Skip CPU Emulation Until the Next Event Comes
-
Skips internal CPU emulation for speed-ups until the next event comes.
-
Allow Invalid VRAM Access
-
Allows to write to VRAM outside blank periods.
-
Apply Specific Game Hacks
-
Applies special hacks for games that can't be emulated correctly.
-
Frame Skip
-
Adjust this value if your Mac is slow.
-
Speed in Turbo Mode
-
The speed when turbo mode is on. Modify in-game with Fn+T, Fn+Y.
-
-

Others Tab

-
-
Toggle Turbo Button
-
Sets 'Turbo' button as a toggle switch.
-
Show Onscreen Information
-
Shows messages from Snes9x on the game screen. When off, messages are put in the standard console.
-
Open Choose ROM Image Dialog at Startup
-
Choose whether open dialog should be shown when Snes9x is launched.
-
Show Dates and Times in Freeze State Selection Screen
-
Shows time stamps on thumbnails in freeze/defrost screen.
-
Save Window Size and Position
-
Saves the sizes and positions of the game window and dialogs so they come back to the same place.
-
Use IPS / UPS Patch
-
When this option is on, Snes9x automatically loads the .ips or .ups file and patch the ROM image.
-
Boot Up BS Games from BS-X
-
When this option is on, BS-X ROM is loaded first, then you launch BS games from the menu in BS-X.
-
When in Background
-
Choose the behavior of Snes9x when it is in back of other applications.
-
Music Box
-
Choose the behavior of Music Box: 'Sound Emulation Only' to only emulate the music system, and 'Whole Emulation' to also emulate the CPU. Music that depends on the CPU running will not sound right without 'Whole Emulation.'
-
-

- <Prev  Top  Next> -

- - diff --git a/macosx/English.lproj/musicbox.xib b/macosx/English.lproj/musicbox.xib deleted file mode 100644 index f955ffcb..00000000 --- a/macosx/English.lproj/musicbox.xib +++ /dev/null @@ -1,2171 +0,0 @@ - - - - 1040 - 10J869 - 851 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 851 - - - YES - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - MusicBoxController - - - FirstResponder - - - NSApplication - - - 7 - 2 - {{100, 100}, {352, 242}} - 1685586944 - Music Box - NSWindow - - {352, 242} - {352, 61} - - - 256 - - YES - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{30, 37}, {262, 142}} - - - YES - - 130560 - 33554432 - - NSImage - musicbox_indicator - - 0 - 2 - 0 - NO - - YES - - - - 268 - {{302, 158}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - LucidaGrande - 13 - 1044 - - - 918831359 - 34 - - NSImage - musicbox_pause - - - - 400 - 75 - - - - - 268 - {{302, 134}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - - -2033958657 - 34 - - NSImage - musicbox_rewind - - - - 400 - 75 - - - - - 268 - {{302, 110}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - - -2033958657 - 34 - - NSImage - musicbox_effect - - - - 400 - 75 - - - - - 268 - {{36, 43}, {250, 130}} - - - MusicBoxIndicatorView - - - - 268 - {{41, 19}, {12, 14}} - - - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{111, 19}, {12, 14}} - - - 5 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{55, 19}, {12, 14}} - - - 1 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{69, 19}, {12, 14}} - - - 2 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{83, 19}, {12, 14}} - - - 3 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{97, 19}, {12, 14}} - - - 4 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{139, 19}, {12, 14}} - - - 7 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{125, 19}, {12, 14}} - - - 6 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{171, 19}, {12, 14}} - - - 8 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{241, 19}, {12, 14}} - - - 13 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{185, 19}, {12, 14}} - - - 9 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{199, 19}, {12, 14}} - - - 10 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{213, 19}, {12, 14}} - - - 11 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{227, 19}, {12, 14}} - - - 12 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{269, 19}, {12, 14}} - - - 15 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{255, 19}, {12, 14}} - - - 14 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{307, 198}, {29, 26}} - - - YES - - -2080244224 - 134217728 - - - - 918831359 - 38 - - - 400 - 75 - - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{153, 18}, {16, 16}} - - - YES - - 130560 - 33554432 - - NSImage - musicbox_ledoff - - 0 - 0 - 0 - NO - - YES - - - - 268 - {{17, 203}, {58, 17}} - - - YES - - 67239488 - 272635904 - Playing : - - - YES - 1 - - 6 - System - controlColor - - 3 - MC42NjY2NjY2ODY1AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{77, 203}, {218, 17}} - - - YES - - 67239488 - 272635904 - Game Title - - - YES - 1 - - - - - - {352, 242} - - - - {{0, 0}, {1440, 878}} - {352, 83} - {352, 264} - - - - - - YES - - - disclosure - - - - 93 - - - - rewind - - - - 95 - - - - gametitle - - - - 113 - - - - indicator - - - - 114 - - - - led - - - - 115 - - - - window - - - - 116 - - - - handlePauseButton: - - - - 123 - - - - handleRewindButton: - - - - 124 - - - - handleEffectButton: - - - - 125 - - - - handleDisclosureButton: - - - - 126 - - - - handleChannelButton: - - - - 127 - - - - handleChannelButton: - - - - 129 - - - - handleChannelButton: - - - - 130 - - - - handleChannelButton: - - - - 131 - - - - handleChannelButton: - - - - 132 - - - - handleChannelButton: - - - - 133 - - - - handleChannelButton: - - - - 134 - - - - handleChannelButton: - - - - 135 - - - - handleChannelButton: - - - - 136 - - - - handleChannelButton: - - - - 137 - - - - handleChannelButton: - - - - 138 - - - - handleChannelButton: - - - - 139 - - - - handleChannelButton: - - - - 140 - - - - handleChannelButton: - - - - 141 - - - - handleChannelButton: - - - - 142 - - - - handleChannelButton: - - - - 143 - - - - delegate - - - - 146 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 2 - - - YES - - - - - - 3 - - - YES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - YES - - - - - 14 - - - YES - - - - - - 15 - - - - - 26 - - - YES - - - - - - 27 - - - - - 28 - - - YES - - - - - - 29 - - - - - 30 - - - YES - - - - - - 31 - - - - - 32 - - - YES - - - - - - 33 - - - - - 34 - - - YES - - - - - - 35 - - - - - 36 - - - YES - - - - - - 37 - - - - - 38 - - - YES - - - - - - 39 - - - - - 40 - - - YES - - - - - - 41 - - - YES - - - - - - 42 - - - YES - - - - - - 43 - - - YES - - - - - - 44 - - - YES - - - - - - 45 - - - YES - - - - - - 46 - - - YES - - - - - - 47 - - - YES - - - - - - 48 - - - - - 49 - - - - - 50 - - - - - 51 - - - - - 52 - - - - - 53 - - - - - 54 - - - - - 55 - - - - - 62 - - - YES - - - - - - 63 - - - - - 64 - - - YES - - - - - - 65 - - - - - 66 - - - YES - - - - - - 67 - - - - - 68 - - - YES - - - - - - 69 - - - - - 70 - - - YES - - - - - - 71 - - - - - 72 - - - YES - - - - - - 73 - - - - - 6 - - - YES - - - - - - 7 - - - - - 120 - - - YES - - - - - - 121 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 1.IBViewBoundsToFrameTransform - 1.WindowOrigin - 1.editorWindowContentRectSynchronizationRect - 120.IBPluginDependency - 120.IBViewBoundsToFrameTransform - 120.IBViewIntegration.shadowColor - 121.IBPluginDependency - 14.IBPluginDependency - 14.IBViewBoundsToFrameTransform - 15.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 2.IBWindowTemplateEditedContentRect - 2.NSWindowTemplate.visibleAtLaunch - 2.windowTemplate.hasMaxSize - 2.windowTemplate.hasMinSize - 2.windowTemplate.maxSize - 2.windowTemplate.minSize - 26.IBPluginDependency - 26.IBViewBoundsToFrameTransform - 27.IBPluginDependency - 28.IBPluginDependency - 28.IBViewBoundsToFrameTransform - 29.IBPluginDependency - 3.IBPluginDependency - 30.IBPluginDependency - 30.IBViewBoundsToFrameTransform - 31.IBPluginDependency - 32.IBPluginDependency - 32.IBViewBoundsToFrameTransform - 33.IBPluginDependency - 34.IBPluginDependency - 34.IBViewBoundsToFrameTransform - 35.IBPluginDependency - 36.IBPluginDependency - 36.IBViewBoundsToFrameTransform - 37.IBPluginDependency - 38.IBPluginDependency - 38.IBViewBoundsToFrameTransform - 39.IBPluginDependency - 40.IBPluginDependency - 40.IBViewBoundsToFrameTransform - 41.IBPluginDependency - 41.IBViewBoundsToFrameTransform - 42.IBPluginDependency - 42.IBViewBoundsToFrameTransform - 43.IBPluginDependency - 43.IBViewBoundsToFrameTransform - 44.IBPluginDependency - 44.IBViewBoundsToFrameTransform - 45.IBPluginDependency - 45.IBViewBoundsToFrameTransform - 46.IBPluginDependency - 46.IBViewBoundsToFrameTransform - 47.IBPluginDependency - 47.IBViewBoundsToFrameTransform - 48.IBPluginDependency - 49.IBPluginDependency - 50.IBPluginDependency - 51.IBPluginDependency - 52.IBPluginDependency - 53.IBPluginDependency - 54.IBPluginDependency - 55.IBPluginDependency - 6.IBPluginDependency - 6.IBViewBoundsToFrameTransform - 62.IBPluginDependency - 62.IBViewBoundsToFrameTransform - 63.IBPluginDependency - 64.IBPluginDependency - 64.IBViewBoundsToFrameTransform - 65.IBPluginDependency - 66.IBPluginDependency - 66.IBViewBoundsToFrameTransform - 67.IBPluginDependency - 68.IBPluginDependency - 68.IBViewBoundsToFrameTransform - 69.IBPluginDependency - 7.IBPluginDependency - 70.IBPluginDependency - 70.IBViewBoundsToFrameTransform - 71.IBPluginDependency - 72.IBPluginDependency - 72.IBViewBoundsToFrameTransform - 73.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{0, 573}, {480, 272}} - com.apple.InterfaceBuilder.CocoaPlugin - - AUIQAABCMAAAA - - {628, 654} - {{357, 416}, {480, 272}} - com.apple.InterfaceBuilder.CocoaPlugin - - AUOaAAAAAAAAA - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCCAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - {{8, 606}, {352, 242}} - com.apple.InterfaceBuilder.CocoaPlugin - {{8, 606}, {352, 242}} - - - - {352, 242} - {352, 61} - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC0AAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCQAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCeAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCmAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCtAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDBAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC7AAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDJQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDawAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDMwAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDQQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTwAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDXQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDg4AAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDeQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwy0AAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAw1QAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - AUMZAABBkAAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABBiAAAw1oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwx4AAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwwAAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCmgAAw1oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 150 - - - - YES - - MusicBoxController - NSObject - - YES - - YES - handleChannelButton: - handleDisclosureButton: - handleEffectButton: - handlePauseButton: - handleRewindButton: - - - YES - id - id - id - id - id - - - - YES - - YES - handleChannelButton: - handleDisclosureButton: - handleEffectButton: - handlePauseButton: - handleRewindButton: - - - YES - - handleChannelButton: - id - - - handleDisclosureButton: - id - - - handleEffectButton: - id - - - handlePauseButton: - id - - - handleRewindButton: - id - - - - - YES - - YES - disclosure - gametitle - indicator - led - rewind - window - - - YES - id - id - id - id - id - id - - - - YES - - YES - disclosure - gametitle - indicator - led - rewind - window - - - YES - - disclosure - id - - - gametitle - id - - - indicator - id - - - led - id - - - rewind - id - - - window - id - - - - - IBProjectSource - mac-musicbox.h - - - - MusicBoxController - NSObject - - IBUserSource - - - - - MusicBoxIndicatorView - NSView - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSImageCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSImageCell.h - - - - NSImageView - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSImageView.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - ../cocoatest.xcodeproj - 3 - - YES - - YES - musicbox_effect - musicbox_indicator - musicbox_ledoff - musicbox_pause - musicbox_rewind - - - YES - {16, 16} - {262, 142} - {16, 16} - {16, 16} - {16, 16} - - - - diff --git a/macosx/HID_Utilities_External.h b/macosx/HID_Utilities_External.h index d890bfcc..fe4b0f03 100644 --- a/macosx/HID_Utilities_External.h +++ b/macosx/HID_Utilities_External.h @@ -51,7 +51,7 @@ /*****************************************************/ #if !TARGET_RT_MAC_CFM #include -#endif TARGET_RT_MAC_CFM +#endif // TARGET_RT_MAC_CFM //#include #if 0 // NOTE: These are now in @@ -109,7 +109,7 @@ typedef enum IOHIDReportType { // Notes: This is a MachO function pointer. If you're using CFM you have to call MachOFunctionPointerForCFMFunctionPointer. typedef void( *IOHIDCallbackFunction ) ( void* target, unsigned long result, void* refcon, void* sender ); typedef void* IOHIDEventStruct; -#endif TARGET_RT_MAC_CFM +#endif // TARGET_RT_MAC_CFM // Device and Element Interfaces diff --git a/macosx/Info.plist b/macosx/Info.plist index 966f925a..5c345422 100644 --- a/macosx/Info.plist +++ b/macosx/Info.plist @@ -160,7 +160,7 @@ CFBundleExecutable - Snes9x + Snes9x (i386) CFBundleGetInfoString Snes9x 1.60, Copyright 1996-2019 Snes9x developers. CFBundleHelpBookFolder @@ -170,7 +170,7 @@ CFBundleIconFile APPL.icns CFBundleIdentifier - com.snes9x.macos.snes9x + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/macosx/Info_i386.plist b/macosx/Info_i386.plist deleted file mode 100644 index 2229ece9..00000000 --- a/macosx/Info_i386.plist +++ /dev/null @@ -1,189 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - jma - - CFBundleTypeName - JMA archive - CFBundleTypeOSTypes - - JMAf - - CFBundleTypeRole - Viewer - LSTypeIsPackage - - - - CFBundleTypeExtensions - - sfc - smc - swc - fig - gd3 - - CFBundleTypeIconFile - CART.icns - CFBundleTypeName - Snes9x ROM Image - CFBundleTypeOSTypes - - CART - - CFBundleTypeRole - Viewer - LSTypeIsPackage - - - - CFBundleTypeExtensions - - srm - - CFBundleTypeIconFile - SRAM.icns - CFBundleTypeName - Snes9x SRAM Data - CFBundleTypeOSTypes - - SRAM - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - frz - - CFBundleTypeIconFile - SAVE.icns - CFBundleTypeName - Snes9x Freeze Data - CFBundleTypeOSTypes - - SAVE - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - smv - - CFBundleTypeName - Snes9x Movie Data - CFBundleTypeOSTypes - - SMOV - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - spc - - CFBundleTypeName - Snes9x SPC Data - CFBundleTypeOSTypes - - SSPC - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - cht - - CFBundleTypeName - Snes9x Cheat Data - CFBundleTypeOSTypes - - SCHT - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - rtc - - CFBundleTypeName - Snes9x RTC Data - CFBundleTypeOSTypes - - SRTC - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - * - - CFBundleTypeOSTypes - - **** - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleExecutable - Snes9x (i386) - CFBundleGetInfoString - Snes9x 1.60, Copyright 1996-2019 Snes9x developers. - CFBundleHelpBookFolder - Snes9x Help - CFBundleHelpBookName - Snes9x Help - CFBundleIconFile - APPL.icns - CFBundleIdentifier - com.snes9x.macos.snes9x - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Snes9x - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.60 - CFBundleSignature - ~9X~ - CFBundleVersion - 1.60 - CSResourcesFileMapped - - - diff --git a/macosx/ReClassicfication/EndianStuff.h b/macosx/ReClassicfication/EndianStuff.h new file mode 100755 index 00000000..1e6d3d4d --- /dev/null +++ b/macosx/ReClassicfication/EndianStuff.h @@ -0,0 +1,28 @@ +/* + * EndianStuff.h + * stackimport + * + * Created by Mr. Z. on 10/06/06. + * Copyright 2006 Mr Z. All rights reserved. + * + */ + +#pragma once + +#include + + +#if RECLASSIFICATION_BUILD_BIG_ENDIAN +#define BIG_ENDIAN_16(value) (value) +#define BIG_ENDIAN_32(value) (value) +#else +#define BIG_ENDIAN_16(value) \ + (((((uint16_t)(value))<<8) & 0xFF00) | \ + ((((uint16_t)(value))>>8) & 0x00FF)) + +#define BIG_ENDIAN_32(value) \ + (((((uint32_t)(value))<<24) & 0xFF000000) | \ + ((((uint32_t)(value))<< 8) & 0x00FF0000) | \ + ((((uint32_t)(value))>> 8) & 0x0000FF00) | \ + ((((uint32_t)(value))>>24) & 0x000000FF)) +#endif diff --git a/macosx/ReClassicfication/FakeHandles.c b/macosx/ReClassicfication/FakeHandles.c new file mode 100755 index 00000000..e2315cc4 --- /dev/null +++ b/macosx/ReClassicfication/FakeHandles.c @@ -0,0 +1,269 @@ +/* =========================================================================== + + PROJECT: FakeHandles + + FILE: FakeHandles.c + + PURPOSE: Simulate Handles on machines which only have ANSI-C to easily + port some of the more simple Macintosh code fragments to other + platforms. + + (C) Copyright 1998 by Uli Kusterer, all rights reserved. + + ======================================================================== */ + +#pragma mark [Headers] + + +// ----------------------------------------------------------------------------- +// Headers: +// ----------------------------------------------------------------------------- + +#include "FakeHandles.h" + + +// ----------------------------------------------------------------------------- +// Globals: +// ----------------------------------------------------------------------------- + +/* The last entry in the master pointer array is mis-used to hold a pointer + to another master pointer array. Thus, we have a linked list of master + pointer arrays in RAM, and we don't run out of master pointers as easily. */ +MasterPointer gMasterPointers[MASTERPOINTER_CHUNK_SIZE]; +long gFakeHandleError = noErr; + + +/* ----------------------------------------------------------------------------- + FakeInitHandles: + Call this to initialize the fake memory Manager at the start of your + program. Only call this once or you'll lose all your Handles and will have + stale memory lying around. Pass the global gMasterPointers in + masterPtrArray. + + REVISIONS: + 98-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeInitHandles( MasterPointer* masterPtrArray ) +{ + long x; + + for( x = 0; x < MASTERPOINTER_CHUNK_SIZE; x++ ) + { + masterPtrArray[x].actualPointer = NULL; + masterPtrArray[x].used = false; + masterPtrArray[x].memoryFlags = 0; + masterPtrArray[x].size = 0; + } + + gFakeHandleError = noErr; +} + + +/* ----------------------------------------------------------------------------- + FakeMoreMasters: + Call this if you need more master pointers Called internally by + FakeNewHandle() when it runs out of master pointers. + + REVISIONS: + 98-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeMoreMasters() +{ + long x; + MasterPointer* vMPtrBlock; + MasterPointer* vCurrBlock; + + // Make a new master pointer block: + vMPtrBlock = malloc( MASTERPOINTER_CHUNK_SIZE *sizeof(MasterPointer) ); + if( vMPtrBlock == NULL ) + { + gFakeHandleError = memFulErr; + return; + } + + // Clear it: + for( x = 0; x < MASTERPOINTER_CHUNK_SIZE; x++ ) + { + vMPtrBlock[x].actualPointer = NULL; + vMPtrBlock[x].used = false; + vMPtrBlock[x].memoryFlags = 0; + vMPtrBlock[x].size = 0; + } + + // Find last master pointer in last master pointer block: + vCurrBlock = gMasterPointers; + while( vCurrBlock[MASTERPOINTER_CHUNK_SIZE -1].used == true ) + vCurrBlock = (MasterPointer*) vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer; + + // Make this last master pointer point to our new block: + vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer = (char*) vMPtrBlock; + vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used = true; + vMPtrBlock[MASTERPOINTER_CHUNK_SIZE-1].size = MASTERPOINTER_CHUNK_SIZE *sizeof(MasterPointer); + + gFakeHandleError = noErr; +} + + +Handle FakeNewEmptyHandle() +{ + Handle theHandle = NULL; + long x; + MasterPointer* vCurrBlock = gMasterPointers; + bool notFound = true; + + gFakeHandleError = noErr; + + while( notFound ) + { + for( x = 0; x < (MASTERPOINTER_CHUNK_SIZE-1); x++ ) + { + if( !(vCurrBlock[x].used) ) + { + vCurrBlock[x].used = true; + vCurrBlock[x].memoryFlags = 0; + vCurrBlock[x].size = 0; + + theHandle = (Handle) &(vCurrBlock[x]); + notFound = false; + break; + } + } + + if( !vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used ) // Last is unused? We need a new master pointer block! + { + FakeMoreMasters(); + if( !vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used ) // No new block added?! + notFound = false; // Terminate, it's very likely an error occurred. + } + vCurrBlock = (MasterPointer*) vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer; // Go next master pointer block. + } + + return theHandle; +} + + +/* ----------------------------------------------------------------------------- + NewHandle: + Create a new Handle. This creates a new entry in the Master Ptr array and + allocates memory of the specified size for it. Then it returns a Ptr to + this entry. + + Returns NULL if not successful. If MemError() is noErr upon a NULL return + value, we are out of master pointers. + + REVISIONS: + 2001-02-16 UK Added support for error codes. + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +Handle FakeNewHandle( long theSize ) +{ + MasterPointer * theHandle = (MasterPointer*) FakeNewEmptyHandle(); + + theHandle->actualPointer = malloc( theSize ); + if( theHandle->actualPointer == NULL ) + { + FakeDisposeHandle( (Handle) theHandle ); + gFakeHandleError = memFulErr; + } + else + theHandle->size = theSize; + + return (Handle)theHandle; +} + + +/* ----------------------------------------------------------------------------- + DisposeHandle: + Dispose an existing Handle. Only call this once or you might kill valid + memory or worse. + + This frees the memory we use and marks the entry for the specified Handle + as unused. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeDisposeHandle( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + if( theEntry->actualPointer ) + free( theEntry->actualPointer ); + theEntry->used = false; + theEntry->actualPointer = NULL; + theEntry->memoryFlags = 0; + theEntry->size = 0; +} + + +void FakeEmptyHandle( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + if( theEntry->actualPointer ) + free( theEntry->actualPointer ); + theEntry->actualPointer = NULL; +} + + +/* ----------------------------------------------------------------------------- + GetHandleSize: + Return the size of an existing Handle. This simply examines the "size" + field of the Handle's entry. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +long FakeGetHandleSize( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + gFakeHandleError = noErr; + + return( theEntry->size ); +} + + +/* ----------------------------------------------------------------------------- + SetHandleSize: + Change the size of an existing Handle. This reallocates the Handle (keeping + its data) and updates the size field of the Handle's entry accordingly. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeSetHandleSize( Handle theHand, long theSize ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + char* thePtr; + + thePtr = theEntry->actualPointer; + thePtr = realloc( thePtr, theSize ); + + if( thePtr ) + { + theEntry->actualPointer = thePtr; + theEntry->size = theSize; + gFakeHandleError = noErr; + } + else + gFakeHandleError = memFulErr; +} + + + + + + + + + + + + diff --git a/macosx/ReClassicfication/FakeHandles.h b/macosx/ReClassicfication/FakeHandles.h new file mode 100755 index 00000000..35c0014f --- /dev/null +++ b/macosx/ReClassicfication/FakeHandles.h @@ -0,0 +1,114 @@ +/* =========================================================================== + + PROJECT: FakeHandles + + FILE: FakeHandles.h + + PURPOSE: Simulate Handles on machines which only have ANSI-C to easily + port some of the more simple Macintosh code fragments to other + platforms. + + (C) Copyright 1998 by Uli Kusterer, all rights reserved. + + DIRECTIONS: + A Handle is a memory block that remembers its size automatically. + To the user, a Handle is simply a pointer to a pointer to the actual + data. Dereference it twice to get at the actual data. Before you + pass a once-dereferenced Handle to any other functions, you need to + call HLock() on it to avoid that it moves. Call HUnlock() when you + are finished with that. + To create a Handle, use NewHandle(). To free a Handle, call + DisposeHandle(). To resize use SetHandleSize() (the Handle itself + will not change, but the pointer to the actual data may change), + GetHandleSize() returns the actual size of the Handle. + Before making any of these calls, you *must have* called + InitHandles(). + + ======================================================================== */ + +#ifndef FAKEHANDLES_H +#define FAKEHANDLES_H + +#pragma mark [Headers] + + +// ----------------------------------------------------------------------------- +// Headers: +// ----------------------------------------------------------------------------- + +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Constants: +// ----------------------------------------------------------------------------- + +#ifndef NULL + #define NULL 0L +#endif + +#define MASTERPOINTER_CHUNK_SIZE 1024 // Size of blocks of master pointers we allocate in one go. + + +// Error codes MemError() may return after Handle calls: +enum +{ +#ifndef __MACTYPES__ + noErr = 0, // No error, success. +#endif /* __MACTYPES__ */ + memFulErr = -108 // Out of memory error. +}; + + +// ----------------------------------------------------------------------------- +// Data Types: +// ----------------------------------------------------------------------------- + +// Data types special to Mac: + +typedef char** Handle; +#ifndef __MACTYPES__ +typedef unsigned char Boolean; +#endif /* __MACTYPES__ */ + + +// Private data structure used internally to keep track of Handles: +typedef struct MasterPointer +{ + char* actualPointer; // The actual Pointer we're pointing to. + Boolean used; // Is this master Ptr being used? + long memoryFlags; // Some flags for this Handle. + long size; // The size of this Handle. +} MasterPointer; + +// ----------------------------------------------------------------------------- +// Globals: +// ----------------------------------------------------------------------------- + +extern MasterPointer gMasterPointers[MASTERPOINTER_CHUNK_SIZE]; +extern long gFakeHandleError; + + +// ----------------------------------------------------------------------------- +// Prototypes: +// ----------------------------------------------------------------------------- + +extern void FakeInitHandles( MasterPointer* masterPtrArray ); +extern Handle FakeNewHandle( long theSize ); +extern void FakeDisposeHandle( Handle theHand ); +extern long FakeGetHandleSize( Handle theHand ); +extern void FakeSetHandleSize( Handle theHand, long theSize ); +extern void FakeMoreMasters( void ); +extern Handle FakeNewEmptyHandle(); +extern void FakeEmptyHandle( Handle theHand ); + + + + + + + + +#endif /*FAKEHANDLES_H*/ diff --git a/macosx/ReClassicfication/FakeResources.c b/macosx/ReClassicfication/FakeResources.c new file mode 100755 index 00000000..1442bba2 --- /dev/null +++ b/macosx/ReClassicfication/FakeResources.c @@ -0,0 +1,1115 @@ +// +// FakeResources.c +// ReClassicfication +// +// Created by Uli Kusterer on 20.02.13. +// Copyright (c) 2013 Uli Kusterer. All rights reserved. +// + +#include +#include // for memmove(). +#include +#include "FakeResources.h" +#include "EndianStuff.h" + + +// Turn this on if you want to read actual Mac resource forks on a Mac or Darwin +// but using the ANSI file APIs (uses Apple's "/..namedfork/rsrc" trick). +#define READ_REAL_RESOURCE_FORKS 1 + + +/* + resource data offset 4 bytes + resource map offset 4 bytes + resource data length 4 bytes + resource map length 4 bytes + Reserved for system use 112 bytes + Application data 128 bytes + resource data ... + resource map ... + + + Resource data is 4-byte-long-counted, followed by actual data. + + + Resource map: + + copy of resource header in RAM 16 bytes + next resource map in RAM 4 bytes + file reference number in RAM 2 bytes + Resource file attributes 2 bytes + type list offset (resource map-relative) 2 bytes + name list offset (resource map-relative) 2 bytes +*/ + +struct FakeResourceMap +{ + struct FakeResourceMap* nextResourceMap; + bool dirty; // per-file tracking of whether FakeUpdateResFile() needs to write + FILE* fileDescriptor; + int16_t fileRefNum; + uint16_t resFileAttributes; + uint16_t numTypes; + struct FakeTypeListEntry* typeList; +}; + +/* + Type list: + + number of types (-1) 2 bytes + resource type 4 bytes + number of resources (-1) 2 bytes + offset to reference list (type list relative) 2 bytes +*/ + +struct FakeTypeListEntry +{ + uint32_t resourceType; + uint16_t numberOfResourcesOfType; // -1 + struct FakeReferenceListEntry* resourceList; +}; + +/* + Reference list: + + resource ID 2 bytes + resource name offset (relative to resource name list) 2 bytes + resource attributes 1 byte + resource data offset (resource data relative) 3 bytes + handle to resource in RAM 4 bytes +*/ + +struct FakeReferenceListEntry +{ + int16_t resourceID; + uint8_t resourceAttributes; + Handle resourceHandle; + char resourceName[257]; // 257 = 1 Pascal length byte, 255 characters for actual string, 1 byte for C terminator \0. +}; + +/* + Resource names are stored as byte-counted strings. (I.e. packed P-Strings) + Look-up by name is case-insensitive but case-preserving and diacritic-sensitive. +*/ + + +struct FakeResourceMap * gResourceMap = NULL; // Linked list. +struct FakeResourceMap * gCurrResourceMap = NULL; // Start search of map here. +int16_t gFileRefNumSeed = 0; +int16_t gFakeResError = noErr; +struct FakeTypeCountEntry* gLoadedTypes = NULL; +int16_t gNumLoadedTypes = 0; + + +struct FakeTypeCountEntry +{ + uint32_t type; + int16_t retainCount; +}; + + +size_t FakeFWriteUInt32BE( uint32_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_32(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +size_t FakeFWriteInt16BE( int16_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_16(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +size_t FakeFWriteUInt16BE( uint16_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_16(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +void FakeFSeek( FILE* inFile, long inOffset, int inMode ) +{ + int theResult = fseek( inFile, inOffset, inMode ); +} + + +int16_t FakeResError() +{ + return gFakeResError; +} + + +// To be able to iterate types across files without duplicates, we build a list +// of all types in open files and keep track of how many files contain each type +// by "retaining" each type and "releasing" it when a file closes. +void FakeRetainType( uint32_t resType ) +{ + if( gLoadedTypes == NULL ) + { + gLoadedTypes = malloc( sizeof(struct FakeTypeCountEntry) ); + gLoadedTypes[0].type = resType; + gLoadedTypes[0].retainCount = 1; + } + + for( int x = 0; x < gNumLoadedTypes; x++ ) + { + if( gLoadedTypes[x].type == resType ) + { + gLoadedTypes[x].retainCount++; + return; + } + } + + gNumLoadedTypes++; + gLoadedTypes = realloc( gLoadedTypes, gNumLoadedTypes * sizeof(struct FakeTypeCountEntry) ); + gLoadedTypes[gNumLoadedTypes -1].type = resType; + gLoadedTypes[gNumLoadedTypes -1].retainCount = 1; +} + + +// The converse of FakeRetainType (see for more info): +void FakeReleaseType( uint32_t resType ) +{ + for( int x = 0; x < gNumLoadedTypes; x++ ) + { + if( gLoadedTypes[x].type == resType ) + { + gLoadedTypes[x].retainCount--; + if( gLoadedTypes[x].retainCount == 0 ) + { + gNumLoadedTypes--; + if( gNumLoadedTypes > 0 ) + gLoadedTypes[x] = gLoadedTypes[gNumLoadedTypes]; + } + break; + } + } +} + + +struct FakeResourceMap* FakeFindResourceMap( int16_t inFileRefNum, struct FakeResourceMap*** outPrevMapPtr ) +{ + struct FakeResourceMap* currMap = gResourceMap; + if( outPrevMapPtr ) + *outPrevMapPtr = &gResourceMap; + + while( currMap != NULL && currMap->fileRefNum != inFileRefNum ) + { + if( outPrevMapPtr ) + *outPrevMapPtr = &currMap->nextResourceMap; + currMap = currMap->nextResourceMap; + } + return currMap; +} + + +struct FakeResourceMap* FakeResFileOpen( const char* inPath, const char* inMode ) +{ + FILE * theFile = fopen( inPath, inMode ); + if( !theFile ) + { + gFakeResError = fnfErr; + return NULL; + } + + uint32_t resourceDataOffset = 0; + uint32_t resourceMapOffset = 0; + uint32_t lengthOfResourceData = 0; + uint32_t lengthOfResourceMap = 0; + + struct FakeResourceMap * newMap = calloc( 1, sizeof(struct FakeResourceMap) ); + newMap->fileDescriptor = theFile; + newMap->fileRefNum = gFileRefNumSeed++; + + if( fread( &resourceDataOffset, 1, sizeof(resourceDataOffset), theFile ) != sizeof(resourceDataOffset) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + resourceDataOffset = BIG_ENDIAN_32(resourceDataOffset); + + if( fread( &resourceMapOffset, 1, sizeof(resourceMapOffset), theFile ) != sizeof(resourceMapOffset) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + resourceMapOffset = BIG_ENDIAN_32(resourceMapOffset); + + if( fread( &lengthOfResourceData, 1, sizeof(lengthOfResourceData), theFile ) != sizeof(lengthOfResourceData) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + lengthOfResourceData = BIG_ENDIAN_32(lengthOfResourceData); + + if( fread( &lengthOfResourceMap, 1, sizeof(lengthOfResourceMap), theFile ) != sizeof(lengthOfResourceMap) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + lengthOfResourceMap = BIG_ENDIAN_32(lengthOfResourceMap); + + FakeFSeek( theFile, 112, SEEK_CUR ); // Skip system data. + FakeFSeek( theFile, 128, SEEK_CUR ); // Skip application data. + + FakeFSeek( theFile, resourceMapOffset, SEEK_SET ); + FakeFSeek( theFile, 16, SEEK_CUR ); // Skip resource file header copy. + FakeFSeek( theFile, 4, SEEK_CUR ); // Skip next resource map placeholder. + FakeFSeek( theFile, 2, SEEK_CUR ); // Skip file ref num placeholder. + fread( &newMap->resFileAttributes, 1, sizeof(uint16_t), theFile ); // Read file attributes. + newMap->resFileAttributes = BIG_ENDIAN_16(newMap->resFileAttributes); + + uint16_t typeListOffset = 0; + uint16_t nameListOffset = 0; + + fread( &typeListOffset, 1, sizeof(typeListOffset), theFile ); + typeListOffset = BIG_ENDIAN_16(typeListOffset); + fread( &nameListOffset, 1, sizeof(nameListOffset), theFile ); + nameListOffset = BIG_ENDIAN_16(nameListOffset); + + long typeListSeekPos = resourceMapOffset +(long)typeListOffset; + FakeFSeek( theFile, typeListSeekPos, SEEK_SET ); + + uint16_t numTypes = 0; + fread( &numTypes, 1, sizeof(numTypes), theFile ); + numTypes = BIG_ENDIAN_16(numTypes) +1; + + newMap->typeList = calloc( ((int)numTypes), sizeof(struct FakeTypeListEntry) ); + newMap->numTypes = numTypes; + for( int x = 0; x < ((int)numTypes); x++ ) + { + uint32_t currType = 0; + fread( &currType, 1, sizeof(uint32_t), theFile ); // Read type code (4CC). + char typeStr[5] = {0}; + memmove( typeStr, &currType, 4 ); + currType = BIG_ENDIAN_32( currType ); + newMap->typeList[x].resourceType = currType; + + FakeRetainType( currType ); + + uint16_t numResources = 0; + fread( &numResources, 1, sizeof(numResources), theFile ); + numResources = BIG_ENDIAN_16(numResources); + + uint16_t refListOffset = 0; + fread( &refListOffset, 1, sizeof(refListOffset), theFile ); + refListOffset = BIG_ENDIAN_16(refListOffset); + + long oldOffset = ftell(theFile); + + long refListSeekPos = typeListSeekPos +(long)refListOffset; + FakeFSeek( theFile, refListSeekPos, SEEK_SET ); + + newMap->typeList[x].resourceList = calloc( ((int)numResources) +1, sizeof(struct FakeReferenceListEntry) ); + newMap->typeList[x].numberOfResourcesOfType = ((int)numResources) +1; + for( int y = 0; y < ((int)numResources) +1; y++ ) + { + fread( &newMap->typeList[x].resourceList[y].resourceID, 1, sizeof(uint16_t), theFile ); + newMap->typeList[x].resourceList[y].resourceID = BIG_ENDIAN_16(newMap->typeList[x].resourceList[y].resourceID); + + uint16_t nameOffset = 0; + fread( &nameOffset, 1, sizeof(nameOffset), theFile ); + nameOffset = BIG_ENDIAN_16(nameOffset); + + unsigned char attributesAndDataOffset[4]; + uint32_t dataOffset = 0; + fread( &attributesAndDataOffset, 1, sizeof(attributesAndDataOffset), theFile ); + newMap->typeList[x].resourceList[y].resourceAttributes = attributesAndDataOffset[0]; + memmove( ((char*)&dataOffset) +1, attributesAndDataOffset +1, 3 ); + dataOffset = BIG_ENDIAN_32(dataOffset); + FakeFSeek( theFile, 4, SEEK_CUR ); // Skip resource Handle placeholder. + + long innerOldOffset = ftell(theFile); + long dataSeekPos = resourceDataOffset +(long)dataOffset; + FakeFSeek( theFile, dataSeekPos, SEEK_SET ); + uint32_t dataLength = 0; + fread( &dataLength, 1, sizeof(dataLength), theFile ); + dataLength = BIG_ENDIAN_32(dataLength); + newMap->typeList[x].resourceList[y].resourceHandle = FakeNewHandle(dataLength); + fread( (*newMap->typeList[x].resourceList[y].resourceHandle), 1, dataLength, theFile ); + + if( -1 != (long)nameOffset ) + { + long nameSeekPos = resourceMapOffset +(long)nameListOffset +(long)nameOffset; + FakeFSeek( theFile, nameSeekPos, SEEK_SET ); + uint8_t nameLength = 0; + fread( &nameLength, 1, sizeof(nameLength), theFile ); + newMap->typeList[x].resourceList[y].resourceName[0] = nameLength; + if( nameLength > 0 ) + fread( newMap->typeList[x].resourceList[y].resourceName +1, 1, nameLength, theFile ); + } + + FakeFSeek( theFile, innerOldOffset, SEEK_SET ); + } + + FakeFSeek( theFile, oldOffset, SEEK_SET ); + } + + newMap->nextResourceMap = gResourceMap; + gResourceMap = newMap; + gFakeResError = noErr; + + gCurrResourceMap = gResourceMap; + + return newMap; +} + + +int16_t FakeOpenResFile( const unsigned char* inPath ) +{ +#if READ_REAL_RESOURCE_FORKS + const char* resForkSuffix = "/..namedfork/rsrc"; +#endif // READ_REAL_RESOURCE_FORKS + char thePath[256 +17] = {0}; + memmove(thePath,inPath +1,inPath[0]); +#if READ_REAL_RESOURCE_FORKS + memmove(thePath +inPath[0],resForkSuffix,17); +#endif // READ_REAL_RESOURCE_FORKS + struct FakeResourceMap* theMap = FakeResFileOpen( thePath, "r+" ); + if( !theMap ) + theMap = FakeResFileOpen( thePath, "r" ); + if( theMap ) + return theMap->fileRefNum; + else + return gFakeResError; +} + + +static bool FakeFindResourceHandleInMap( Handle theResource, struct FakeTypeListEntry** outTypeEntry, struct FakeReferenceListEntry** outRefEntry, struct FakeResourceMap* inMap ) +{ + if( (theResource != NULL) && (inMap != NULL) ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + for( int y = 0; y < inMap->typeList[x].numberOfResourcesOfType; y++ ) + { + if( inMap->typeList[x].resourceList[y].resourceHandle == theResource ) + { + if (outTypeEntry) + { + *outTypeEntry = &inMap->typeList[x]; + } + + if (outRefEntry) + { + *outRefEntry = &inMap->typeList[x].resourceList[y]; + } + + return true; + } + } + } + } + + if (outTypeEntry) + { + *outTypeEntry = NULL; + } + + if (outRefEntry) + { + *outRefEntry = NULL; + } + + return false; +} + + +static bool FakeFindResourceHandle( Handle theResource, struct FakeResourceMap** outMap, struct FakeTypeListEntry** outTypeEntry, struct FakeReferenceListEntry** outRefEntry ) +{ + struct FakeResourceMap* currMap = gResourceMap; + while( currMap != NULL ) + { + if( FakeFindResourceHandleInMap(theResource, outTypeEntry, outRefEntry, currMap) ) + { + if( outMap ) + { + *outMap = currMap; + } + return true; + } + + currMap = currMap->nextResourceMap; + } + + if ( outMap ) + { + *outMap = NULL; + } + + if (outTypeEntry) + { + *outTypeEntry = NULL; + } + + if (outRefEntry) + { + *outRefEntry = NULL; + } + + return false; +} + + +static struct FakeTypeListEntry* FakeFindTypeListEntry(struct FakeResourceMap* inMap, uint32_t theType) +{ + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + if( inMap->typeList[x].resourceType == theType ) + { + return &inMap->typeList[x]; + } + } + } + + return NULL; +} + +int16_t FakeHomeResFile( Handle theResource ) +{ + struct FakeResourceMap* currMap = NULL; + + if( FakeFindResourceHandle( theResource, &currMap, NULL, NULL) ) + { + gFakeResError = noErr; + return currMap->fileRefNum; + } + + gFakeResError = resNotFound; + return -1; +} + + +void FakeUpdateResFile( int16_t inFileRefNum ) +{ + const long kResourceHeaderLength = 16; + const long kResourceHeaderMapOffsetPos = 4; + const long kResourceHeaderMapLengthPos = 4 + 4 + 4; + const long kResourceHeaderReservedLength = 112; + const long kResourceHeaderAppReservedLength = 128; + const long kReservedHeaderLength = kResourceHeaderReservedLength + kResourceHeaderAppReservedLength; + const long kResourceDataSizeLength = 4; + const long kResourceMapNextHandleLength = 4; + const long kResourceMapFileRefLength = 2; + const long kResourceMapTypeListOffsetLength = 2; + const long kResourceMapNameListOffsetLength = 2; + const long kResourceMapNumTypesLength = 2; + const long kResourceRefLength = 2 + 2 + 1 + 3 + 4; + const long kResourceTypeLength = 4 + 2 + 2; + + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, NULL ); + long headerLength = kResourceHeaderLength + kReservedHeaderLength; + uint32_t resMapOffset = 0; + long refListSize = 0; + + if (!currMap->dirty) + return; + + // Write header: + FakeFSeek( currMap->fileDescriptor, 0, SEEK_SET ); + uint32_t resDataOffset = (uint32_t)headerLength; + FakeFWriteUInt32BE( resDataOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder offset to resource map + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder resource data length + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder resource map length + + // reserved + for( int x = 0; x < (kResourceHeaderReservedLength / sizeof(uint32_t)); x++ ) + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + for( int x = 0; x < (kResourceHeaderAppReservedLength / sizeof(uint32_t)); x++ ) + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + + resMapOffset = (uint32_t)headerLength; + + // Write out data for each resource and calculate space needed: + for( int x = 0; x < currMap->numTypes; x++ ) + { + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + uint32_t theSize = (uint32_t)FakeGetHandleSize( currMap->typeList[x].resourceList[y].resourceHandle ); + FakeFWriteUInt32BE( theSize, currMap->fileDescriptor ); + resMapOffset += sizeof(theSize); + fwrite( *currMap->typeList[x].resourceList[y].resourceHandle, 1, theSize, currMap->fileDescriptor ); + resMapOffset += theSize; + } + + refListSize += currMap->typeList[x].numberOfResourcesOfType * kResourceRefLength; + } + + // Write out what we know into the header now: + FakeFSeek( currMap->fileDescriptor, kResourceHeaderMapOffsetPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapOffset, currMap->fileDescriptor ); + uint32_t resDataLength = resMapOffset -(uint32_t)headerLength; + FakeFWriteUInt32BE( resDataLength, currMap->fileDescriptor ); + + // Start writing resource map after data: + uint32_t resMapLength = 0; + FakeFSeek( currMap->fileDescriptor, resMapOffset, SEEK_SET ); + + // Copy what we know from the resource header + FakeFWriteUInt32BE( resDataOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( resMapOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( resDataLength, currMap->fileDescriptor ); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // Placeholder + + // Fake a next handle + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + + resMapLength += kResourceHeaderLength + kResourceMapNextHandleLength + kResourceMapFileRefLength; // reserved: copy of resource header, next resource handle, file ref + FakeFWriteInt16BE( inFileRefNum, currMap->fileDescriptor ); + FakeFWriteUInt16BE( currMap->resFileAttributes, currMap->fileDescriptor ); + resMapLength += sizeof(uint16_t); + + uint16_t typeListOffset = ftell(currMap->fileDescriptor) + +kResourceMapTypeListOffsetLength +kResourceMapNameListOffsetLength -resMapOffset; + FakeFWriteUInt16BE( typeListOffset, currMap->fileDescriptor ); // Res map relative, points to the type count + long refListStartPosition = typeListOffset + kResourceMapNumTypesLength + currMap->numTypes * kResourceTypeLength; // Calc where we'll start to put resource lists (right after types). + + uint16_t nameListOffset = refListStartPosition +refListSize; // Calc where we'll start to put name lists (right after resource lists). + FakeFWriteUInt16BE( nameListOffset, currMap->fileDescriptor ); // Res map relative. + + // Now write type list and ref lists: + uint32_t nameListStartOffset = 0; + FakeFWriteUInt16BE( currMap->numTypes -1, currMap->fileDescriptor ); + uint32_t resDataCurrOffset = 0; // Keep track of where we wrote the associated data for each resource, relative to the start of resource data + + refListStartPosition = kResourceMapNumTypesLength + currMap->numTypes * kResourceTypeLength; // relative to beginning of resource type list + + for( int x = 0; x < currMap->numTypes; x++ ) + { + // Write entry for this type: + uint32_t currType = currMap->typeList[x].resourceType; + FakeFWriteUInt32BE( currType, currMap->fileDescriptor ); + + uint16_t numResources = currMap->typeList[x].numberOfResourcesOfType -1; + FakeFWriteUInt16BE( numResources, currMap->fileDescriptor ); + + uint16_t refListOffset = refListStartPosition; + FakeFWriteUInt16BE( refListOffset, currMap->fileDescriptor ); + + // Jump to ref list location and write ref list out: + long oldOffsetAfterPrevType = ftell(currMap->fileDescriptor); + + FakeFSeek( currMap->fileDescriptor, resMapOffset + typeListOffset + refListStartPosition, SEEK_SET ); + + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + FakeFWriteInt16BE( currMap->typeList[x].resourceList[y].resourceID, currMap->fileDescriptor ); + + // Write name to name table: + if( currMap->typeList[x].resourceList[y].resourceName[0] == 0 ) + FakeFWriteInt16BE( -1, currMap->fileDescriptor ); // Don't have a name, mark as -1. + else + { + FakeFWriteUInt16BE( nameListStartOffset, currMap->fileDescriptor ); // Associate name in name table with this. + + long oldOffsetAfterNameOffset = ftell( currMap->fileDescriptor ); + FakeFSeek( currMap->fileDescriptor, resMapOffset +nameListOffset +nameListStartOffset, SEEK_SET ); + fwrite( currMap->typeList[x].resourceList[y].resourceName, currMap->typeList[x].resourceList[y].resourceName[0] +1, sizeof(uint8_t), currMap->fileDescriptor ); + + long currMapLen = (ftell(currMap->fileDescriptor) -resMapOffset); + if( currMapLen > resMapLength ) + resMapLength = (uint32_t)currMapLen; + + FakeFSeek( currMap->fileDescriptor, oldOffsetAfterNameOffset, SEEK_SET ); + nameListStartOffset += currMap->typeList[x].resourceList[y].resourceName[0] +1; // Make sure we write next name *after* this one. + } + + fwrite( &currMap->typeList[x].resourceList[y].resourceAttributes, 1, sizeof(uint8_t), currMap->fileDescriptor ); + uint32_t resDataCurrOffsetBE = BIG_ENDIAN_32(resDataCurrOffset); + fwrite( ((uint8_t*)&resDataCurrOffsetBE) +1, 1, 3, currMap->fileDescriptor ); + resDataCurrOffset += kResourceDataSizeLength + FakeGetHandleSize(currMap->typeList[x].resourceList[y].resourceHandle); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // Handle placeholder. + + long currMapLen = (ftell(currMap->fileDescriptor) -resMapOffset); + if( currMapLen > resMapLength ) + resMapLength = (uint32_t)currMapLen; + } + + refListStartPosition += currMap->typeList[x].numberOfResourcesOfType * kResourceRefLength; + + // Jump back to after our type entry so we can write the next one: + FakeFSeek( currMap->fileDescriptor, oldOffsetAfterPrevType, SEEK_SET ); + } + + // Write res map length: + FakeFSeek( currMap->fileDescriptor, kResourceHeaderMapLengthPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapLength, currMap->fileDescriptor ); + FakeFSeek( currMap->fileDescriptor, resMapOffset + kResourceHeaderMapLengthPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapLength, currMap->fileDescriptor ); + + ftruncate(fileno(currMap->fileDescriptor), resMapOffset + resMapLength); + + currMap->dirty = false; +} + + +void FakeRedirectResFileToPath( int16_t inFileRefNum, const char* cPath ) +{ + struct FakeResourceMap** prevMapPtr = NULL; + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, &prevMapPtr ); + if( currMap ) + { + fclose( currMap->fileDescriptor ); + currMap->fileDescriptor = fopen( cPath, "w" ); + currMap->dirty = true; + } +} + + +void FakeCloseResFile( int16_t inFileRefNum ) +{ + struct FakeResourceMap** prevMapPtr = NULL; + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, &prevMapPtr ); + if( currMap ) + { + FakeUpdateResFile(inFileRefNum); + + *prevMapPtr = currMap->nextResourceMap; // Remove this from the linked list. + if( gCurrResourceMap == currMap ) + gCurrResourceMap = currMap->nextResourceMap; + + for( int x = 0; x < currMap->numTypes; x++ ) + { + FakeReleaseType( currMap->typeList[x].resourceType ); + + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + FakeDisposeHandle( currMap->typeList[x].resourceList[y].resourceHandle ); + } + free( currMap->typeList[x].resourceList ); + } + free( currMap->typeList ); + + fclose( currMap->fileDescriptor ); + free( currMap ); + } +} + + +Handle FakeGet1ResourceFromMap( uint32_t resType, int16_t resID, struct FakeResourceMap* inMap ) +{ + gFakeResError = noErr; + + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + uint32_t currType = inMap->typeList[x].resourceType; + if( currType == resType ) + { + for( int y = 0; y < inMap->typeList[x].numberOfResourcesOfType; y++ ) + { + if( inMap->typeList[x].resourceList[y].resourceID == resID ) + { + return inMap->typeList[x].resourceList[y].resourceHandle; + } + } + break; + } + } + } + + gFakeResError = resNotFound; + + return NULL; +} + + +Handle FakeGet1Resource( uint32_t resType, int16_t resID ) +{ + return FakeGet1ResourceFromMap( resType, resID, gCurrResourceMap ); +} + + +Handle FakeGetResource( uint32_t resType, int16_t resID ) +{ + struct FakeResourceMap * currMap = gCurrResourceMap; + Handle theRes = NULL; + + while( theRes == NULL && currMap != NULL ) + { + theRes = FakeGet1ResourceFromMap( resType, resID, currMap ); + if( theRes != NULL ) + { + gFakeResError = noErr; + return theRes; + } + + currMap = currMap->nextResourceMap; + } + + gFakeResError = resNotFound; + + return NULL; +} + + +int16_t FakeCount1ResourcesInMap( uint32_t resType, struct FakeResourceMap* inMap ) +{ + gFakeResError = noErr; + + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + uint32_t currType = inMap->typeList[x].resourceType; + if( currType == resType ) + return inMap->typeList[x].numberOfResourcesOfType; + } + } + + return 0; +} + + +int16_t FakeCount1TypesInMap( struct FakeResourceMap* inMap ) +{ + if( inMap == NULL ) + return 0; + + return inMap->numTypes; +} + + +int16_t FakeCount1Types() +{ + return FakeCount1TypesInMap( gCurrResourceMap ); +} + + +int16_t FakeCount1Resources( uint32_t resType ) +{ + return FakeCount1ResourcesInMap( resType, gCurrResourceMap ); +} + + +int16_t FakeCountResources( uint32_t resType ) +{ + int16_t numRes = 0; + struct FakeResourceMap* theMap = gCurrResourceMap; + + while( theMap ) + { + numRes += FakeCount1ResourcesInMap( resType, theMap ); + + theMap = theMap->nextResourceMap; + } + + return numRes; +} + + +int16_t FakeCountTypes() +{ + return gNumLoadedTypes; +} + + +int16_t FakeCurResFile() +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + + if( !currMap ) + return 0; + + return currMap->fileRefNum; +} + +void FakeUseResFile( int16_t resRefNum ) +{ + struct FakeResourceMap* currMap = FakeFindResourceMap( resRefNum, NULL ); + if( !currMap ) + currMap = gResourceMap; + + gCurrResourceMap = currMap; +} + + +void FakeGet1IndType( uint32_t * resType, int16_t index ) +{ + if( resType == NULL ) + return; + + *resType = 0; + + struct FakeResourceMap* currMap = gCurrResourceMap; + if( (index <= 0) || (index > FakeCount1Types()) || !currMap ) + { + gFakeResError = resNotFound; + return; + } + + *resType = currMap->typeList[index-1].resourceType; + + gFakeResError = noErr; +} + +Handle FakeGet1IndResource( uint32_t resType, int16_t index ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + + if( !currMap || (index <= 0) || (index > FakeCount1Resources(resType))) + { + gFakeResError = resNotFound; + } + + for( int x = 0; x < currMap->numTypes; x++ ) + { + uint32_t currType = currMap->typeList[x].resourceType; + if( currType == resType ) + { + gFakeResError = noErr; + return currMap->typeList[x].resourceList[index-1].resourceHandle; + } + } + + gFakeResError = resNotFound; + + return NULL; +} + +void FakeGetResInfo( Handle theResource, int16_t * theID, uint32_t * theType, FakeStr255 * name ) +{ + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* refEntry = NULL; + + + if( FakeFindResourceHandle(theResource, NULL, &typeEntry, &refEntry) ) + { + gFakeResError = noErr; + if( theID ) + { + *theID = refEntry->resourceID; + } + + if( theType ) + { + *theType = typeEntry->resourceType; + } + + if( name ) + { + memcpy(name, refEntry->resourceName, sizeof(FakeStr255)); + } + return; + } + + gFakeResError = resNotFound; +} + + +void FakeSetResInfo( Handle theResource, int16_t theID, FakeStr255 name ) +{ + struct FakeReferenceListEntry* refEntry = NULL; + + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &refEntry) ) + { + gFakeResError = resNotFound; + return; + } + + if( (refEntry->resourceAttributes & resProtected) != 0 ) + { + gFakeResError = resAttrErr; + return; + } + + refEntry->resourceID = theID; + memcpy(refEntry->resourceName, name, sizeof(FakeStr255)); + + gFakeResError = noErr; +} + + +void FakeAddResource( Handle theData, uint32_t theType, int16_t theID, FakeStr255 name ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* resourceEntry = NULL; + + // AddResource() only ensures that the handle is not a resource, but doesn't check whether the type/ID are already in use + if( !theData || FakeFindResourceHandleInMap( theData, &typeEntry, &resourceEntry, currMap ) ) + { + gFakeResError = addResFailed; + return; + } + + typeEntry = FakeFindTypeListEntry( currMap, theType ); + if( !typeEntry ) + { + currMap->numTypes++; + currMap->typeList = realloc(currMap->typeList, currMap->numTypes * sizeof(struct FakeTypeListEntry)); + + typeEntry = currMap->typeList + (currMap->numTypes - 1); + typeEntry->resourceType = theType; + typeEntry->numberOfResourcesOfType = 0; + typeEntry->resourceList = NULL; + + FakeRetainType(theType); + } + + typeEntry->numberOfResourcesOfType++; + + if( typeEntry->resourceList ) + { + typeEntry->resourceList = realloc( typeEntry->resourceList, typeEntry->numberOfResourcesOfType * sizeof(struct FakeReferenceListEntry) ); + } + else + { + typeEntry->resourceList = calloc(typeEntry->numberOfResourcesOfType, sizeof(struct FakeReferenceListEntry)); + } + + resourceEntry = typeEntry->resourceList + ( typeEntry->numberOfResourcesOfType - 1 ); + resourceEntry->resourceAttributes = 0; + resourceEntry->resourceID = theID; + memcpy(resourceEntry->resourceName, name, sizeof(FakeStr255)); + resourceEntry->resourceHandle = theData; + + currMap->dirty = true; + + gFakeResError = noErr; +} + +void FakeChangedResource( Handle theResource ) +{ + struct FakeResourceMap* theMap = NULL; + struct FakeReferenceListEntry* theEntry = NULL; + if( !FakeFindResourceHandle( theResource, &theMap, NULL, &theEntry ) ) + { + gFakeResError = resNotFound; + return; + } + + if( (theEntry->resourceAttributes & resProtected) == 0 ) + { + theMap->dirty = true; + gFakeResError = noErr; + } + else + { + gFakeResError = resAttrErr; + } +} + +// NOTE: you must call DisposeHandle(theResource) manually to release the memory. Normally, +// the Resource Manager will dispose the handle on update or file close, but this implementation +// does not track removed resource handles for later disposal. +void FakeRemoveResource( Handle theResource ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* resEntry = NULL; + if( !currMap || !FakeFindResourceHandleInMap( theResource, &typeEntry, &resEntry, currMap ) || ((resEntry->resourceAttributes & resProtected) != 0) ) + { + gFakeResError = rmvResFailed; + return; + } + + struct FakeReferenceListEntry* nextResEntry = resEntry + 1; + int resourcesListSize = typeEntry->numberOfResourcesOfType * sizeof(struct FakeReferenceListEntry); + long nextResEntryOffset = (void*)nextResEntry - (void*)typeEntry->resourceList; + + typeEntry->numberOfResourcesOfType--; + + if( typeEntry->numberOfResourcesOfType > 0 ) + { + memcpy( resEntry, nextResEntry, resourcesListSize - nextResEntryOffset ); + typeEntry->resourceList = realloc( typeEntry->resourceList, resourcesListSize - sizeof(struct FakeReferenceListEntry) ); + } + else + { + // got rid of the last resource reference, release the memory + free(typeEntry->resourceList); + typeEntry->resourceList = NULL; + + // now remove the type entry + struct FakeTypeListEntry* nextTypeEntry = typeEntry + 1; + int typeListSize = currMap->numTypes * sizeof(struct FakeTypeListEntry); + long nextTypeEntryOffset = (void*)nextTypeEntry - (void*)currMap->typeList; + + currMap->numTypes--; + FakeReleaseType(typeEntry->resourceType); + + if( currMap->numTypes > 0 ) + { + memcpy( typeEntry, nextTypeEntry, typeListSize - nextTypeEntryOffset ); + currMap->typeList = realloc( currMap->typeList, typeListSize - sizeof(struct FakeTypeListEntry) ); + } + else + { + // got rid of the last type entry + free(currMap->typeList); + currMap->typeList = NULL; + } + } + + + currMap->dirty = true; + gFakeResError = noErr; +} + + +// NOTE: effectively a no-op since we don't have a way to write a resource without writing the whole map +void FakeWriteResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + +// NOTE: effectively a no-op since we don't have a way to load an individual resource from disk right now. +// All resources are already loaded at file open time. +void FakeLoadResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + +// NOTE: effectively a no-op since we don't have a way to reload a released resource from disk right now +void FakeReleaseResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + + +void FakeSetResLoad(bool load) +{ + // NOTE: a no-op since resources are always loaded at file open time +} + + + diff --git a/macosx/ReClassicfication/FakeResources.h b/macosx/ReClassicfication/FakeResources.h new file mode 100755 index 00000000..0792d503 --- /dev/null +++ b/macosx/ReClassicfication/FakeResources.h @@ -0,0 +1,84 @@ +// +// FakeResources.h +// ReClassicfication +// +// Created by Uli Kusterer on 21.02.13. +// Copyright (c) 2013 Uli Kusterer. All rights reserved. +// + +#ifndef ReClassicfication_FakeResources_h +#define ReClassicfication_FakeResources_h + + +#include "FakeHandles.h" + + +// Possible return values of FakeResError(): +#ifndef __MACERRORS__ +enum +{ + resNotFound = -192, + resFNotFound = -193, + addResFailed = -194, + rmvResFailed = -196, + resAttrErr = -198, + eofErr = -39, + fnfErr = -43 +}; +#endif /* __MACERRORS__ */ + + +#ifndef __RESOURCES__ +// Resource attribute bit flags: +enum +{ + resReserved = (1 << 0), // Apparently not yet used. + resChanged = (1 << 1), + resPreload = (1 << 2), + resProtected = (1 << 3), + resLocked = (1 << 4), + resPurgeable = (1 << 5), + resSysHeap = (1 << 6), + resReserved2 = (1 << 7) // Apparently not yet used. +}; +#endif + +typedef unsigned char FakeStr255[256]; + + +int16_t FakeOpenResFile( const unsigned char* inPath ); +void FakeCloseResFile( int16_t resRefNum ); +Handle FakeGet1Resource( uint32_t resType, int16_t resID ); +Handle FakeGetResource( uint32_t resType, int16_t resID ); +int16_t FakeCurResFile(); +void FakeUseResFile( int16_t resRefNum ); +void FakeUpdateResFile( int16_t inFileRefNum ); +int16_t FakeHomeResFile( Handle theResource ); +int16_t FakeCount1Types(); +int16_t FakeCount1Resources( uint32_t resType ); +int16_t FakeCountTypes(); +int16_t FakeCountResources( uint32_t resType ); + +void FakeGet1IndType( uint32_t * resType, int16_t index ); +Handle FakeGet1IndResource( uint32_t resType, int16_t index ); +void FakeGetResInfo( Handle theResource, int16_t * theID, uint32_t * theType, FakeStr255 * name ); +void FakeSetResInfo( Handle theResource, int16_t theID, FakeStr255 name ); +void FakeAddResource( Handle theData, uint32_t theType, int16_t theID, FakeStr255 name ); +void FakeChangedResource( Handle theResource ); +void FakeRemoveResource( Handle theResource ); +void FakeWriteResource( Handle theResource ); +void FakeLoadResource( Handle theResource ); +void FakeReleaseResource( Handle theResource ); +void FakeSetResLoad(bool load); + +int16_t FakeResError(); + + +// Private calls for internal use/tests: +void FakeRedirectResFileToPath( int16_t inFileRefNum, const char* cPath ); +struct FakeResourceMap* FakeResFileOpen( const char* inPath, const char* inMode ); +struct FakeResourceMap* FakeFindResourceMap( int16_t inFileRefNum, struct FakeResourceMap*** outPrevMapPtr ); +int16_t FakeCount1ResourcesInMap( uint32_t resType, struct FakeResourceMap* inMap ); +int16_t FakeCount1TypesInMap( struct FakeResourceMap* inMap ); + +#endif diff --git a/macosx/Snes9x/AppDelegate.h b/macosx/Snes9x/AppDelegate.h new file mode 100644 index 00000000..02784c2a --- /dev/null +++ b/macosx/Snes9x/AppDelegate.h @@ -0,0 +1,56 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import +#import +#import "S9xPreferences/S9xPreferencesWindowController.h" + +extern NSWindowFrameAutosaveName const kMainWindowIdentifier; + +@interface AppDelegate : NSObject + +@property (nonatomic, readonly, assign) BOOL isRunningEmulation; +@property (nonatomic, strong) S9xEngine *s9xEngine; +@property (nonatomic, strong) NSMutableDictionary *keys; +@property (nonatomic, strong) NSWindow *gameWindow; +@property (nonatomic, strong) S9xPreferencesWindowController *preferencesWindowController; +@property (nonatomic, readonly, assign) S9xDeviceSetting deviceSetting; + +- (void)setButtonCode:(S9xButtonCode)buttonCode forKeyCode:(int16)keyCode player:(int8)player; +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player; + +- (NSArray *)listJoypads; +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode; +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value; + +- (NSString *)prefsKeyForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (BOOL)getValuesFromString:(NSString *)str vendorID:(uint32 *)vendorID productID:(uint32 *)productID index:(uint32 *)index; + +- (NSString *)prefValueForCookie:(uint32)cookie value:(int32)value; +- (BOOL)getValuesFromString:(NSString *)str cookie:(uint32 *)cookie value:(int32 *)value; + +- (void)setVideoMode:(int)videoMode; +- (void)setMacFrameSkip:(int)_macFrameSkip; +- (void)setShowFPS:(BOOL)showFPS; + +@end + diff --git a/macosx/Snes9x/AppDelegate.m b/macosx/Snes9x/AppDelegate.m new file mode 100644 index 00000000..869784a9 --- /dev/null +++ b/macosx/Snes9x/AppDelegate.m @@ -0,0 +1,564 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import +#import "AppDelegate.h" + +NSWindowFrameAutosaveName const kMainWindowIdentifier = @"s9xMainWindow"; + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + self.s9xEngine = [S9xEngine new]; + self.s9xEngine.inputDelegate = self; + [self setupDefaults]; + [self importRecentItems]; + + NSWindow *gameWindow = [[NSWindow alloc] initWithContentRect:s9xView.frame styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO]; + + gameWindow.contentView.wantsLayer = YES; + gameWindow.contentView.layer.backgroundColor = NSColor.blackColor.CGColor; + + gameWindow.title = @"Snes9x"; + gameWindow.restorationClass = [self class]; + gameWindow.frameAutosaveName = kMainWindowIdentifier; + gameWindow.releasedWhenClosed = NO; + gameWindow.backgroundColor = NSColor.clearColor; + + if ( ![gameWindow setFrameUsingName:kMainWindowIdentifier] ) + { + [gameWindow center]; + } + + self.gameWindow = gameWindow; + + [NSNotificationCenter.defaultCenter addObserverForName:NSWindowWillCloseNotification object:gameWindow queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *notification) + { + [self.s9xEngine quit]; + }]; +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + [self.s9xEngine quit]; +} + +- (void)setupDefaults +{ + NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults; + + NSDictionary *defaultSettings = @{ + kKeyboardPrefs : @{ + @(kUp).stringValue : @(kVK_UpArrow), + @(kDown).stringValue : @(kVK_DownArrow), + @(kLeft).stringValue : @(kVK_LeftArrow), + @(kRight).stringValue : @(kVK_RightArrow), + @(kY).stringValue : @(kVK_ANSI_X), + @(kB).stringValue : @(kVK_ANSI_C), + @(kX).stringValue : @(kVK_ANSI_D), + @(kA).stringValue : @(kVK_ANSI_V), + @(kL).stringValue : @(kVK_ANSI_A), + @(kR).stringValue : @(kVK_ANSI_S), + @(kStart).stringValue : @(kVK_Space), + @(kSelect).stringValue : @(kVK_Return), + + @(kNumButtons + kUp).stringValue : @(kVK_ANSI_Keypad8), + @(kNumButtons + kDown).stringValue : @(kVK_ANSI_Keypad2), + @(kNumButtons + kLeft).stringValue : @(kVK_ANSI_Keypad4), + @(kNumButtons + kRight).stringValue : @(kVK_ANSI_Keypad6), + @(kNumButtons + kY).stringValue : @(kVK_PageDown), + @(kNumButtons + kB).stringValue : @(kVK_PageUp), + @(kNumButtons + kX).stringValue : @(kVK_End), + @(kNumButtons + kA).stringValue : @(kVK_Home), + @(kNumButtons + kL).stringValue : @(kVK_ANSI_Keypad0), + @(kNumButtons + kR).stringValue : @(kVK_ANSI_KeypadDecimal), + @(kNumButtons + kStart).stringValue : @(kVK_ANSI_KeypadEnter), + @(kNumButtons + kSelect).stringValue : @(kVK_ANSI_KeypadPlus), + + @(kKeyFastForward).stringValue : @(kVK_ANSI_Backslash), + @(kKeyFreeze).stringValue : @(kVK_ANSI_1), + @(kKeyDefrost).stringValue : @(kVK_ANSI_0), + @(kKeyScreenshot).stringValue : @(kVK_ANSI_Grave), + @(kKeySPC).stringValue : @(kVK_ANSI_R), + @(kKeyScopeTurbo).stringValue : @(kVK_ANSI_B), + @(kKeyScopePause).stringValue : @(kVK_ANSI_N), + @(kKeyScopeCursor).stringValue : @(kVK_ANSI_M), + @(kKeyOffScreen).stringValue : @(kVK_Tab), + @(kKeyFunction).stringValue : @(kVK_ANSI_Slash), + @(kKeyAlt).stringValue : @(kVK_ANSI_Period), + @(kKeyFFDown).stringValue : @(kVK_ANSI_Q), + @(kKeyFFUp).stringValue : @(kVK_ANSI_W), + @(kKeyEsc).stringValue : @(kVK_Escape), + @(kKeyTC).stringValue : @(kVK_ANSI_Comma) + }, + kShowFPSPref: @(NO), + kVideoModePref:@(VIDEOMODE_BLOCKY), + kMacFrameSkipPref:@(macFrameSkip) + }; + + [defaults registerDefaults:defaultSettings]; + [defaults setBool:NO forKey:@"NSWindowAssertWhenDisplayCycleLimitReached"]; + [defaults synchronize]; + + self.keys = [[defaults objectForKey:kKeyboardPrefs] mutableCopy]; + + for (NSString *control in [self.keys copy]) + { + NSInteger key = control.integerValue; + NSInteger player = key / kNumButtons; + S9xButtonCode buttonCode = (S9xButtonCode)(key - (kNumButtons * player)); + [self setButtonCode:buttonCode forKeyCode:self.keys[control].integerValue player:player]; + } + + NSDictionary *joypadPlayerPrefs = [defaults objectForKey:kJoypadPlayerPrefs]; + + for ( S9xJoypad *joypad in [self listJoypads]) + { + NSMutableDictionary *joypadPrefs = [[defaults objectForKey:kJoypadInputPrefs] mutableCopy]; + + if (joypadPrefs == nil) + { + joypadPrefs = [NSMutableDictionary new]; + [defaults synchronize]; + } + + NSString *key = [self prefsKeyForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + + for ( NSString *playerString in joypadPlayerPrefs ) + { + if ( [key isEqualToString:joypadPlayerPrefs[playerString]] ) + { + [self setPlayer:playerString.intValue forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + } + } + + NSMutableDictionary *devicePrefs = [joypadPrefs[key] mutableCopy]; + if (devicePrefs == nil) + { + devicePrefs = [NSMutableDictionary new]; + for (S9xJoypadInput *input in [self.s9xEngine getInputsForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]) + { + devicePrefs[@(input.buttonCode).stringValue] = [self prefValueForCookie:input.cookie value:input.value]; + } + + joypadPrefs[key] = devicePrefs; + [defaults setObject:joypadPrefs forKey:kJoypadInputPrefs]; + [defaults synchronize]; + } + else + { + [self.s9xEngine clearJoypadForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + for (NSString *buttonCodeString in devicePrefs) + { + S9xButtonCode buttonCode = (S9xButtonCode)buttonCodeString.intValue; + NSString *str = devicePrefs[buttonCodeString]; + uint32 cookie = 0; + int32 value = -1; + + if ([self getValuesFromString:str cookie:&cookie value:&value]) + { + [self setButton:buttonCode forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index cookie:cookie value:value]; + } + } + } + } + + self.deviceSetting = Gamepads; + + [self importKeySettings]; + [self importGraphicsSettings]; + [defaults synchronize]; +} + +- (void)setButtonCode:(S9xButtonCode)buttonCode forKeyCode:(int16)keyCode player:(int8)player +{ + if (keyCode < 0) + { + return; + } + + self.keys[@(buttonCode + (kNumButtons * player)).stringValue] = @(keyCode); + + S9xButtonCode oldButton = kNumButtons; + int8 oldPlayer = -1; + if ([self.s9xEngine setButton:buttonCode forKey:keyCode player:player oldButton:&oldButton oldPlayer:&oldPlayer oldKey:NULL]) + { + if (oldButton >= 0 && oldButton < kNumButtons && oldPlayer >= 0 && oldPlayer < MAC_MAX_PLAYERS && (oldPlayer != player || oldButton != buttonCode)) + { + [self.keys removeObjectForKey:@(oldButton + (kNumButtons * oldPlayer)).stringValue]; + } + + [NSUserDefaults.standardUserDefaults setObject:[self.keys copy] forKey:kKeyboardPrefs]; + } +} + +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player +{ + [self.s9xEngine clearButton:button forPlayer:player]; + NSMutableDictionary *keyDict = [[NSUserDefaults.standardUserDefaults objectForKey:kKeyboardPrefs] mutableCopy]; + [keyDict removeObjectForKey:@(button).stringValue]; + [NSUserDefaults.standardUserDefaults setObject:[keyDict copy] forKey:kKeyboardPrefs]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (NSArray *)listJoypads +{ + return [self.s9xEngine listJoypads]; +} + +- (NSString *)prefsKeyForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + return [NSString stringWithFormat:@"%@:%@:%@", @(vendorID).stringValue, @(productID).stringValue, @(index).stringValue]; +} + +- (BOOL)getValuesFromString:(NSString *)str vendorID:(uint32 *)vendorID productID:(uint32 *)productID index:(uint32 *)index +{ + if (vendorID == NULL || productID == NULL || index == NULL) + { + return NO; + + } + + NSArray *components = [str componentsSeparatedByString:@":"]; + + if (components.count != 3) + { + return NO; + } + + *vendorID = components[0].intValue; + *productID = components[1].intValue; + *index = components[2].intValue; + + return YES; +} + +- (NSString *)prefValueForCookie:(uint32)cookie value:(int32)value +{ + return [NSString stringWithFormat:@"%@:%@", @(cookie).stringValue, @(value).stringValue]; +} + +- (BOOL)getValuesFromString:(NSString *)str cookie:(uint32 *)cookie value:(int32 *)value +{ + if (cookie == NULL || value == NULL) + { + return NO; + } + + NSArray *components = [str componentsSeparatedByString:@":"]; + + if (components.count != 2) + { + return NO; + } + + *cookie = components.firstObject.intValue; + *value = components.lastObject.intValue; + + return YES; +} + +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + int8 oldPlayer = -1; + [self.s9xEngine setPlayer:player forVendorID:vendorID productID:productID index:index oldPlayer:&oldPlayer]; + + NSMutableDictionary *playersDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadPlayerPrefs] mutableCopy]; + if (playersDict == nil) + { + playersDict = [NSMutableDictionary new]; + } + + if (oldPlayer >= 0 && player != oldPlayer) + { + [playersDict removeObjectForKey:@(oldPlayer).stringValue]; + } + + playersDict[@(player).stringValue] = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + + [NSUserDefaults.standardUserDefaults setObject:[playersDict copy] forKey:kJoypadPlayerPrefs]; +} + +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value +{ + S9xButtonCode oldButton = (S9xButtonCode)-1; + BOOL result = [self.s9xEngine setButton:button forVendorID:vendorID productID:productID index:index cookie:cookie value:value oldButton:&oldButton]; + + NSMutableDictionary *prefsDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] mutableCopy]; + NSString *key = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + NSMutableDictionary *joypadDict = [prefsDict[key] mutableCopy]; + + if (result && button != oldButton) + { + [joypadDict removeObjectForKey:@(oldButton).stringValue]; + } + + joypadDict[@(button).stringValue] = [self prefValueForCookie:cookie value:value]; + + prefsDict[key] = [joypadDict copy]; + + [NSUserDefaults.standardUserDefaults setObject:[prefsDict copy] forKey:kJoypadInputPrefs]; + + return result; +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode +{ + [self.s9xEngine clearJoypadForVendorID:vendorID productID:productID index:index buttonCode:buttonCode]; + NSString *key = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + NSMutableDictionary *joypadsDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] mutableCopy]; + NSMutableDictionary *deviceDict = [joypadsDict[key] mutableCopy]; + [deviceDict removeObjectForKey:@(buttonCode).stringValue]; + joypadsDict[key] = deviceDict; + [NSUserDefaults.standardUserDefaults setObject:[joypadsDict copy] forKey:kJoypadInputPrefs]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value +{ + return [self.s9xEngine labelForVendorID:vendorID productID:productID cookie:cookie value:value]; +} + +- (void)importRecentItems +{ + const NSInteger maxRecents = 20; + + for (NSInteger i = maxRecents - 1; i >= 0; --i) + { + NSString *key = [NSString stringWithFormat:@"RecentItem_%02tu", i]; + NSString *recentItem = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (recentItem != nil) + { + [NSDocumentController.sharedDocumentController noteNewRecentDocumentURL:[NSURL fileURLWithPath:recentItem]]; + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + } + + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +- (void)importKeySettings +{ + NSData *data = [self objectForPrefOSCode:'keyb']; + + NSUInteger length = data.length; + char *bytes = (char*)data.bytes; + for ( NSUInteger i = 0; i < length; ++i ) + { + // The enum values for controls changed between the Carbon and Cocoa versions. + // The first 24 enum values are the same, but we have to adjust after that. + if ( i < 24 ) + { + [self setButtonCode:(S9xButtonCode)(i - (i / 12)) forKeyCode:bytes[i] player:i / 12]; + } + else + { + [self setButtonCode:(S9xButtonCode)(i - 24 + kKeyFastForward) forKeyCode:bytes[i] player:0]; + } + } +} + +- (void)importGraphicsSettings +{ + NSData *data = [self objectForPrefOSCode:'dfps']; + + if (data != nil) + { + [NSUserDefaults.standardUserDefaults setBool:(data.length > 0 && ((char *)data.bytes)[0]) forKey:kShowFPSPref]; + } + + [self setShowFPS:[NSUserDefaults.standardUserDefaults boolForKey:kShowFPSPref]]; + + data = [self objectForPrefOSCode:'Vmod']; + + if ( data != nil) + { + [NSUserDefaults.standardUserDefaults setInteger:((data.length >= 0 && ((char *)data.bytes)[0]) ? VIDEOMODE_SMOOTH : VIDEOMODE_BLOCKY) forKey:kVideoModePref]; + } + + [self setVideoMode:(int)[NSUserDefaults.standardUserDefaults integerForKey:kVideoModePref]]; +} + +- (id)objectForPrefOSCode:(uint32_t)osCode +{ + NSString *key = [@"Preferences_" stringByAppendingString:[[NSString alloc] initWithBytes:(char *)&osCode length:sizeof(uint32_t) encoding:NSASCIIStringEncoding]]; + + id obj = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (obj == nil) + { + osCode =CFSwapInt32(osCode); + key = [@"Preferences_" stringByAppendingString:[[NSString alloc] initWithBytes:(char *)&osCode length:sizeof(uint32_t) encoding:NSASCIIStringEncoding]]; + + obj = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (obj != nil) + { + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + } + else + { + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + + return obj; +} + +- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename +{ + return [self openURL:[NSURL fileURLWithPath:filename]]; +} + +- (IBAction)openDocument:(id)sender +{ + NSOpenPanel* panel = [NSOpenPanel new]; + NSModalResponse response = [panel runModal]; + + if ( response == NSModalResponseOK ) + { + [self openURL:panel.URL]; + } +} + +- (BOOL)openURL:(NSURL *)url +{ + if ([self.s9xEngine loadROM:url]) + { + [self.s9xEngine recreateS9xView]; + + NSWindow *gameWindow = self.gameWindow; + [gameWindow.contentView addSubview:s9xView]; + [s9xView.topAnchor constraintEqualToAnchor:gameWindow.contentView.topAnchor].active = YES; + [s9xView.bottomAnchor constraintEqualToAnchor:gameWindow.contentView.bottomAnchor].active = YES; + [s9xView.centerXAnchor constraintEqualToAnchor:gameWindow.contentView.centerXAnchor].active = YES; + [s9xView.leftAnchor constraintGreaterThanOrEqualToAnchor:gameWindow.contentView.leftAnchor].active = YES; + [s9xView.rightAnchor constraintLessThanOrEqualToAnchor:gameWindow.contentView.rightAnchor].active = YES; + + + [gameWindow makeKeyAndOrderFront:self]; + [NSDocumentController.sharedDocumentController noteNewRecentDocumentURL:url]; + return YES; + } + + return NO; +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + SEL action = menuItem.action; + if (action == @selector(resume:) || action == @selector(softwareReset:) || action == @selector(hardwareReset:)) { + return [self.s9xEngine isRunning] && [self.s9xEngine isPaused]; + } + else if (action == @selector(updateDeviceSetting:)) { + menuItem.state = (self.deviceSetting == (S9xDeviceSetting)menuItem.tag) ? NSOnState : NSOffState; + } + + return !self.isRunningEmulation; +} + +@dynamic isRunningEmulation; +- (BOOL)isRunningEmulation +{ + return [self.s9xEngine isRunning] && ![self.s9xEngine isPaused]; +} + +- (IBAction)terminate:(id)sender +{ + [self.s9xEngine stop]; + [NSApp terminate:sender]; +} + +- (IBAction)openPreferencesWindow:(id)sender +{ + if ( self.preferencesWindowController == nil ) + { + self.preferencesWindowController = [[S9xPreferencesWindowController alloc] initWithWindowNibName:@"S9xPreferencesWindowController"]; + } + + [self.preferencesWindowController showWindow:nil]; + [self.preferencesWindowController.window makeKeyAndOrderFront:nil]; + [self.preferencesWindowController.window makeKeyWindow]; +} + +- (void)setVideoMode:(int)videoMode +{ + [self.s9xEngine setVideoMode:videoMode]; + [NSUserDefaults.standardUserDefaults setObject:@(videoMode) forKey:kVideoModePref]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (void)setMacFrameSkip:(int)_macFrameSkip +{ + [self.s9xEngine setMacFrameSkip:_macFrameSkip]; + [NSUserDefaults.standardUserDefaults setObject:@(_macFrameSkip) forKey:kMacFrameSkipPref]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (void)setShowFPS:(BOOL)showFPS +{ + [self.s9xEngine setShowFPS:showFPS]; + [NSUserDefaults.standardUserDefaults setObject:@(showFPS) forKey:kShowFPSPref]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (IBAction)resume:(id)sender +{ + [self.s9xEngine resume]; +} + +- (IBAction)softwareReset:(id)sender +{ + [self.s9xEngine softwareReset]; +} + +- (IBAction)hardwareReset:(id)sender +{ + [self.s9xEngine hardwareReset]; +} + +- (IBAction)updateDeviceSetting:(id)sender +{ + self.deviceSetting = (S9xDeviceSetting)[sender tag]; +} + +- (void)setDeviceSetting:(S9xDeviceSetting)deviceSetting +{ + _deviceSetting = deviceSetting; + [self.s9xEngine setDeviceSetting:deviceSetting]; +} + +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad +{ + if (NSApp.keyWindow != nil && NSApp.keyWindow == self.preferencesWindowController.window) + { + return [((S9xPreferencesWindowController *) self.preferencesWindowController.contentViewController) handleInput:input fromJoypad:joypad]; + } + + return NO; +} + +- (void)deviceSettingChanged:(S9xDeviceSetting)deviceSetting +{ + _deviceSetting = deviceSetting; +} + + +@end diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png new file mode 100644 index 00000000..9dcc3988 Binary files /dev/null and b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png differ diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png new file mode 100644 index 00000000..ec01a517 Binary files /dev/null and b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png differ diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..5fc768c2 --- /dev/null +++ b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,60 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "APPL-32.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "APPL.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/macosx/Snes9x/Assets.xcassets/Contents.json b/macosx/Snes9x/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/macosx/Snes9x/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/macosx/Snes9x/Base.lproj/MainMenu.xib b/macosx/Snes9x/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..25ecce20 --- /dev/null +++ b/macosx/Snes9x/Base.lproj/MainMenu.xib @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/Info_ppc.plist b/macosx/Snes9x/Info.plist similarity index 90% rename from macosx/Info_ppc.plist rename to macosx/Snes9x/Info.plist index 3bba90e4..d57cf226 100644 --- a/macosx/Info_ppc.plist +++ b/macosx/Snes9x/Info.plist @@ -3,7 +3,31 @@ CFBundleDevelopmentRegion - English + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSMainNibFile + MainMenu + CFBundleHelpBookFolder + Snes9x Help + CFBundleHelpBookName + Snes9x Help + NSPrincipalClass + S9xApplication CFBundleDocumentTypes @@ -159,31 +183,5 @@ - CFBundleExecutable - Snes9x (ppc) - CFBundleGetInfoString - Snes9x 1.60, Copyright 1996-2019 Snes9x developers. - CFBundleHelpBookFolder - Snes9x Help - CFBundleHelpBookName - Snes9x Help - CFBundleIconFile - APPL.icns - CFBundleIdentifier - com.snes9x.macos.snes9x - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Snes9x - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.60 - CFBundleSignature - ~9X~ - CFBundleVersion - 1.60 - CSResourcesFileMapped - diff --git a/macosx/mac-prefs.h b/macosx/Snes9x/S9xApplication.h old mode 100755 new mode 100644 similarity index 83% rename from macosx/mac-prefs.h rename to macosx/Snes9x/S9xApplication.h index 25f3f15e..54d737e9 --- a/macosx/mac-prefs.h +++ b/macosx/Snes9x/S9xApplication.h @@ -15,15 +15,15 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import -#ifndef _mac_prefs_h_ -#define _mac_prefs_h_ +NS_ASSUME_NONNULL_BEGIN -void LoadPrefs (void); -void SavePrefs (void); -void ConfigurePreferences (void); -void ConfigureExtraOptions (void); +@interface S9xApplication : NSApplication -#endif +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xApplication.m b/macosx/Snes9x/S9xApplication.m new file mode 100644 index 00000000..98201a30 --- /dev/null +++ b/macosx/Snes9x/S9xApplication.m @@ -0,0 +1,38 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import "S9xApplication.h" +#import "AppDelegate.h" + +@implementation S9xApplication + +- (void)sendEvent:(NSEvent *)event +{ + if (event.modifierFlags * NSEventModifierFlagCommand && event.type == NSEventTypeKeyUp && ((AppDelegate *)self.delegate).isRunningEmulation) + { + [self.keyWindow sendEvent:event]; + } + else + { + [super sendEvent:event]; + } +} + +@end diff --git a/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.h b/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.h new file mode 100644 index 00000000..cd868031 --- /dev/null +++ b/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.h @@ -0,0 +1,35 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +@class S9xJoypadInput; + +NS_ASSUME_NONNULL_BEGIN + +@interface S9xButtonConfigTextField : NSSearchField + +@property (nonatomic, assign) CGKeyCode keyCode; +@property (nonatomic, strong, nullable) S9xJoypadInput *joypadInput; +@property (nonatomic, assign) BOOL disableKeyboardInput; + +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.m b/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.m new file mode 100644 index 00000000..9dbd76e2 --- /dev/null +++ b/macosx/Snes9x/S9xPreferences/S9xButtonConfigTextField.m @@ -0,0 +1,358 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include +#include +#import "S9xButtonConfigTextField.h" + +@implementation S9xButtonConfigTextField + +- (void)awakeFromNib +{ + self.delegate = self; + self.placeholderString = @""; + [[self cell] setSearchButtonCell:nil]; + + NSButtonCell *cancelButton = [[self cell] cancelButtonCell]; + cancelButton.target = self; + cancelButton.action = @selector(clearSearch:); +} + +- (void)setKeyCode:(CGKeyCode)keyCode +{ + if (keyCode == (CGKeyCode)-1) + { + _keyCode = keyCode; + self.stringValue = @""; + return; + } + + NSString *stringValue = nil; + + switch (keyCode) + { + case kVK_Shift: + stringValue = NSLocalizedString(@"Shift", @""); + break; + + case kVK_Command: + stringValue = NSLocalizedString(@"Command", @""); + break; + + case kVK_Control: + stringValue = NSLocalizedString(@"Control", @""); + break; + + case kVK_Option: + stringValue = NSLocalizedString(@"Option", @""); + break; + + case kVK_F1: + stringValue = NSLocalizedString(@"F1", @""); + break; + + case kVK_F2: + stringValue = NSLocalizedString(@"F2", @""); + break; + + case kVK_F3: + stringValue = NSLocalizedString(@"F3", @""); + break; + + case kVK_F4: + stringValue = NSLocalizedString(@"F4", @""); + break; + + case kVK_F5: + stringValue = NSLocalizedString(@"F5", @""); + break; + + case kVK_F6: + stringValue = NSLocalizedString(@"F6", @""); + break; + + case kVK_F7: + stringValue = NSLocalizedString(@"F7", @""); + break; + + case kVK_F8: + stringValue = NSLocalizedString(@"F8", @""); + break; + + case kVK_F9: + stringValue = NSLocalizedString(@"F9", @""); + break; + + case kVK_F10: + stringValue = NSLocalizedString(@"F10", @""); + break; + + case kVK_F11: + stringValue = NSLocalizedString(@"F11", @""); + break; + + case kVK_F12: + stringValue = NSLocalizedString(@"F12", @""); + break; + + case kVK_F13: + stringValue = NSLocalizedString(@"F13", @""); + break; + + case kVK_F14: + stringValue = NSLocalizedString(@"F14", @""); + break; + + case kVK_F15: + stringValue = NSLocalizedString(@"F15", @""); + break; + + case kVK_F16: + stringValue = NSLocalizedString(@"F16", @""); + break; + + case kVK_F17: + stringValue = NSLocalizedString(@"F17", @""); + break; + + case kVK_F18: + stringValue = NSLocalizedString(@"F18", @""); + break; + + case kVK_F19: + stringValue = NSLocalizedString(@"F19", @""); + break; + + case kVK_F20: + stringValue = NSLocalizedString(@"F20", @""); + break; + + case kVK_Delete: + stringValue = NSLocalizedString(@"Delete", @""); + break; + + case kVK_ForwardDelete: + stringValue = NSLocalizedString(@"⌦", @""); + break; + + case kVK_Home: + stringValue = NSLocalizedString(@"Home", @""); + break; + + case kVK_End: + stringValue = NSLocalizedString(@"End", @""); + break; + + case kVK_PageUp: + stringValue = NSLocalizedString(@"Page Up", @""); + break; + + case kVK_PageDown: + stringValue = NSLocalizedString(@"Page Down", @""); + break; + + case kVK_Tab: + stringValue = NSLocalizedString(@"Tab", @""); + break; + + case kVK_Space: + stringValue = NSLocalizedString(@"Space", @""); + break; + + case kVK_ANSI_KeypadClear: + stringValue = NSLocalizedString(@"Clear", @""); + break; + + case kVK_LeftArrow: + stringValue = NSLocalizedString(@"←", @""); + break; + + case kVK_RightArrow: + stringValue = NSLocalizedString(@"→", @""); + break; + + case kVK_UpArrow: + stringValue = NSLocalizedString(@"↑", @""); + break; + + case kVK_DownArrow: + stringValue = NSLocalizedString(@"↓", @""); + break; + + case kVK_Return: + stringValue = NSLocalizedString(@"Return", @""); + break; + + case kVK_ANSI_KeypadEnter: + stringValue = NSLocalizedString(@"Enter", @""); + break; + + case kVK_Escape: + stringValue = NSLocalizedString(@"Escape", @""); + break; + + default: + { + TISInputSourceRef keyboard = TISCopyCurrentKeyboardInputSource(); + CFDataRef layoutData = (CFDataRef)TISGetInputSourceProperty(keyboard, kTISPropertyUnicodeKeyLayoutData); + + if ( layoutData != NULL ) + { + const UCKeyboardLayout *layout = (const UCKeyboardLayout*)CFDataGetBytePtr(layoutData); + UniCharCount maxStringLength = 0xFF; + UniCharCount actualStringLength = 0; + UniChar unicodeString[maxStringLength]; + uint32_t deadKeyState = 0; + + OSErr status = UCKeyTranslate(layout, keyCode, kUCKeyActionDisplay, kUCKeyTranslateNoDeadKeysBit, LMGetKbdType(), 0, &deadKeyState, maxStringLength, &actualStringLength, unicodeString); + + if (status == noErr && actualStringLength > 0) + { + stringValue = [NSString stringWithCharacters:unicodeString length:actualStringLength]; + + switch (keyCode) + { + case kVK_ANSI_Keypad0: + case kVK_ANSI_Keypad1: + case kVK_ANSI_Keypad2: + case kVK_ANSI_Keypad3: + case kVK_ANSI_Keypad4: + case kVK_ANSI_Keypad5: + case kVK_ANSI_Keypad6: + case kVK_ANSI_Keypad7: + case kVK_ANSI_Keypad8: + case kVK_ANSI_Keypad9: + case kVK_ANSI_KeypadPlus: + case kVK_ANSI_KeypadMinus: + case kVK_ANSI_KeypadDivide: + case kVK_ANSI_KeypadMultiply: + case kVK_ANSI_KeypadEquals: + case kVK_ANSI_KeypadDecimal: + stringValue = [[stringValue stringByAppendingString:@" "] stringByAppendingString:NSLocalizedString(@"(Keypad)", @"")]; + break; + } + } + } + } + } + + if ( stringValue != nil ) + { + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.controlCharacterSet] componentsJoinedByString:@""]; + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet] componentsJoinedByString:@""]; + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.illegalCharacterSet] componentsJoinedByString:@""]; + + if ( stringValue.length > 0 ) + { + self.stringValue = stringValue.capitalizedString; + [self.window makeFirstResponder:self.window.contentView]; + } + } + + _keyCode = keyCode; +} + +- (void)controlTextDidChange:(NSNotification *)obj +{ + self.stringValue = @""; +} + +- (void)keyUp:(NSEvent *)event +{ + if (!self.disableKeyboardInput ) + { + [self setKeyCode:event.keyCode]; + } +} + +- (void)flagsChanged:(NSEvent *)event +{ + if (self.disableKeyboardInput) + { + return; + } + + NSEventModifierFlags flags = event.modifierFlags; + + if ( flags & NSEventModifierFlagShift ) + { + [self setKeyCode:kVK_Shift]; + } + else if ( flags & NSEventModifierFlagOption ) + { + [self setKeyCode:kVK_Option]; + } + else if ( flags & NSEventModifierFlagCommand ) + { + [self setKeyCode:kVK_Command]; + } + else if ( flags & NSEventModifierFlagControl ) + { + [self setKeyCode:kVK_Control]; + } +} + +- (void)mouseDown:(NSEvent *)event +{ + [super mouseDown:event]; + [self.currentEditor selectAll:self]; +} + +- (void)clearSearch:(id)sender +{ + self.stringValue = @""; + + if (self.disableKeyboardInput) + { + self.joypadInput = nil; + } + else + { + self.keyCode = -1; + } +} + +- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector +{ + if (self.disableKeyboardInput) + { + return NO; + } + + if (commandSelector == @selector(insertTab:)) + { + [self setKeyCode:kVK_Tab]; + return YES; + } + else if (commandSelector == @selector(cancelOperation:)) + { + [self setKeyCode:kVK_Escape]; + return YES; + } + + return NO; +} + +- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor +{ + return !self.disableKeyboardInput; +} + +@end diff --git a/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.h b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.h new file mode 100644 index 00000000..feb31366 --- /dev/null +++ b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.h @@ -0,0 +1,44 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ +#import +#import "S9xButtonConfigTextField.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString * const kKeyboardPrefs; +extern NSString * const kJoypadInputPrefs; +extern NSString * const kJoypadPlayerPrefs; +extern NSString * const kShowFPSPref; +extern NSString * const kVideoModePref; +extern NSString * const kMacFrameSkipPref; + +@interface S9xPreferencesWindowController : NSWindowController +@property (nonatomic, weak) IBOutlet NSTabView *tabView; +@property (nonatomic, weak) IBOutlet NSPopUpButton *videoModePopup; +@property (nonatomic, weak) IBOutlet NSButton *showFPSCheckbox; +@property (nonatomic, weak) IBOutlet NSPopUpButton *devicePopUp; +@property (nonatomic, weak) IBOutlet NSPopUpButton *playerPopUp; +@property (nonatomic, weak) IBOutlet NSTextField *macFrameSkipTextField; +@property (nonatomic, weak) IBOutlet NSStepper *macFrameSkipStepper; +@property (nonatomic, weak) IBOutlet NSButton *macFrameSkipAutomaticButton; +@property (nonatomic, strong) NSArray *configTextFields; +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.m b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.m new file mode 100644 index 00000000..cc4724af --- /dev/null +++ b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.m @@ -0,0 +1,379 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import +#import "AppDelegate.h" +#import "S9xPreferencesWindowController.h" +#import "S9xButtonConfigTextField.h" + +NSString * const kKeyboardPrefs = @"KeyboardConfig"; +NSString * const kJoypadInputPrefs = @"JoypadInputs"; +NSString * const kJoypadPlayerPrefs = @"JoypadPlayers"; +NSString * const kShowFPSPref = @"ShowFPS"; +NSString * const kVideoModePref = @"VideoMode"; +NSString * const kMacFrameSkipPref = @"FrameSkip"; + +@implementation S9xPreferencesWindowController +@synthesize tabView, videoModePopup, showFPSCheckbox, devicePopUp, playerPopUp, macFrameSkipTextField, macFrameSkipStepper, macFrameSkipAutomaticButton, configTextFields; + +- (void)windowDidLoad +{ + [self refresh]; +} + +- (void)awakeFromNib +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + NSUInteger joypadIndex = 0; + for (S9xJoypad *joypad in [appDelegate listJoypads]) + { + NSMenuItem *item = [NSMenuItem new]; + item.title = joypad.name; + item.tag = joypadIndex++; + item.representedObject = joypad; + [self.devicePopUp.menu addItem:item]; + } + + // collect all S9xButtonConfigTextFields within subviews + NSMutableArray *configTextFields = [[NSMutableArray alloc] init]; + for (NSTabViewItem *tabViewItem in self.tabView.tabViewItems) { + [configTextFields addObjectsFromArray:[self getS9xButtonConfigTextFields:tabViewItem.view]]; + } + self.configTextFields = configTextFields; + + for (S9xButtonConfigTextField *configTextField in self.configTextFields) + { + [configTextField addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [configTextField addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + } + + // select Keyboard as default + [self selectDeviceForPlayer:0]; +} + +- (void)refresh +{ + NSUInteger index = MIN([NSUserDefaults.standardUserDefaults integerForKey:kVideoModePref], 1); + [self.videoModePopup selectItemAtIndex:index]; + + NSInteger macFrameSkipDefault = [NSUserDefaults.standardUserDefaults integerForKey:kMacFrameSkipPref]; + // if macFrameSkip is equal to -1, set automatic checkbox + // to be checked, disable the ability to change frame skip values + // from stepper/text field, else leave automatic checkbox + // unchecked and set textfield to value + if (macFrameSkipDefault == -1) { + [self.macFrameSkipTextField setEnabled: false]; + [self.macFrameSkipStepper setEnabled: false]; + [self.macFrameSkipTextField setIntValue: 0]; // show something at least + [self.macFrameSkipAutomaticButton setIntValue: 1]; + } else { + [self.macFrameSkipTextField setIntValue: (int)macFrameSkipDefault]; + [self.macFrameSkipAutomaticButton setIntValue: 0]; + } + + self.showFPSCheckbox.state = [NSUserDefaults.standardUserDefaults boolForKey:kShowFPSPref]; + + if (self.devicePopUp.selectedItem.tag < 0) + { + NSMutableDictionary *controlsDict = [NSMutableDictionary new]; + + NSDictionary *keyboardDict = [NSUserDefaults.standardUserDefaults objectForKey:kKeyboardPrefs]; + NSInteger playerNum = self.playerPopUp.selectedItem.tag; + + for (NSUInteger i = 0; i < kNumButtons; ++i) + { + controlsDict[@(i)] = keyboardDict[@(i + (playerNum * kNumButtons)).stringValue]; + } + + for (S9xButtonConfigTextField *configTextField in self.configTextFields) + { + [configTextField removeObserver:self forKeyPath:@"keyCode"]; + [configTextField removeObserver:self forKeyPath:@"joypadInput"]; + + NSNumber *keyCode = controlsDict[@(configTextField.tag)]; + + configTextField.joypadInput = nil; + + if ( keyCode != nil ) + { + configTextField.keyCode = keyCode.intValue; + } + else + { + configTextField.keyCode = -1; + } + + [configTextField addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [configTextField addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + + configTextField.disableKeyboardInput = NO; + } + } + else + { + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + S9xJoypad *joypad = self.devicePopUp.selectedItem.representedObject; + NSString *joypadKey = [appDelegate prefsKeyForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + NSDictionary *joypadDIct = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] objectForKey:joypadKey]; + + for (S9xButtonConfigTextField *configTextField in self.configTextFields) + { + [configTextField removeObserver:self forKeyPath:@"keyCode"]; + [configTextField removeObserver:self forKeyPath:@"joypadInput"]; + + uint32 cookie = 0; + int32 value = 0; + S9xButtonCode buttonCode = (S9xButtonCode)configTextField.tag; + NSString *inputString = joypadDIct[@(buttonCode).stringValue]; + + configTextField.keyCode = -1; + + if ([appDelegate getValuesFromString:inputString cookie:&cookie value:&value]) + { + S9xJoypadInput *input = [S9xJoypadInput new]; + input.cookie = cookie; + input.value = value; + input.buttonCode = buttonCode; + configTextField.joypadInput = input; + configTextField.stringValue = [appDelegate labelForVendorID:joypad.vendorID productID:joypad.productID cookie:cookie value:value]; + } + else + { + configTextField.joypadInput = nil; + configTextField.stringValue = @""; + } + + [configTextField addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [configTextField addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + + configTextField.disableKeyboardInput = YES; + } + } +} + +- (NSArray *)getS9xButtonConfigTextFields:(NSView*)view { + NSMutableArray *S9xButtonConfigTextFields = [[NSMutableArray alloc] init]; + + if ([view isKindOfClass:[S9xButtonConfigTextField class]]) { + [S9xButtonConfigTextFields addObject:view]; + } else if (view.subviews) { + for (NSView *subview in view.subviews) { + [S9xButtonConfigTextFields addObjectsFromArray:[self getS9xButtonConfigTextFields:subview]]; + } + } + return [NSArray arrayWithArray:S9xButtonConfigTextFields]; +} + +- (void)selectDeviceForPlayer:(int8_t)player +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + NSString* joypadKey = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadPlayerPrefs] objectForKey:@(player).stringValue]; + + [self.devicePopUp selectItemAtIndex:0]; + + if (joypadKey != nil) + { + uint32 vendorID = 0; + uint32 productID = 0; + uint32 index = 0; + + if ( [appDelegate getValuesFromString:joypadKey vendorID:&vendorID productID:&productID index:&index]) + { + S9xJoypad *joypad = [S9xJoypad new]; + joypad.vendorID = vendorID; + joypad.productID = productID; + joypad.index = index; + + for (NSMenuItem *item in self.devicePopUp.menu.itemArray) + { + if ([joypad isEqual:item.representedObject]) + { + [self.devicePopUp selectItem:item]; + break; + } + } + } + } +} + +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad +{ + id firstResponder = self.window.firstResponder; + + if ([firstResponder respondsToSelector:@selector(isFieldEditor)] && [firstResponder isFieldEditor]) + { + firstResponder = [firstResponder delegate]; + } + + if ([firstResponder respondsToSelector:@selector(setJoypadInput:)]) + { + S9xJoypad *currentJoypad = self.devicePopUp.selectedItem.representedObject; + + if ([joypad isEqual:currentJoypad]) + { + [firstResponder setJoypadInput:input]; + return YES; + } + } + + return NO; +} + +- (void)deviceSettingChanged:(S9xDeviceSetting)deviceSetting {} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:@"keyCode"]) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)object; + S9xButtonCode buttonCode = (S9xButtonCode)field.tag; + uint16_t keyCode = field.keyCode; + int8_t player = self.playerPopUp.selectedItem.tag; + + if (keyCode != (CGKeyCode)-1) + { + [((AppDelegate *) NSApp.delegate) setButtonCode:buttonCode forKeyCode:keyCode player:player]; + } + else + { + [((AppDelegate *) NSApp.delegate) clearButton:buttonCode forPlayer:player]; + } + + [NSUserDefaults.standardUserDefaults synchronize]; + + [self refresh]; + } + else if ( [keyPath isEqualToString:@"joypadInput"]) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)object; + S9xButtonCode buttonCode = (S9xButtonCode)field.tag; + S9xJoypad *joypad = self.devicePopUp.selectedItem.representedObject; + + if ([joypad isKindOfClass:[S9xJoypad class]]) + { + S9xJoypadInput *input = field.joypadInput; + + if (input != nil) + { + [((AppDelegate *)NSApp.delegate) setButton:buttonCode forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index cookie:input.cookie value:input.value]; + } + else + { + [((AppDelegate *)NSApp.delegate) clearJoypadForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index buttonCode:buttonCode]; + } + } + + [NSUserDefaults.standardUserDefaults synchronize]; + [self refresh]; + } +} + +- (void)setShowFPS:(BOOL)value +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + [appDelegate setShowFPS:value]; +} + +- (void)setVideoMode:(int)value +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + [appDelegate setVideoMode:value]; +} + +- (void)setMacFrameSkip:(int)value +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + [appDelegate setMacFrameSkip:value]; +} + +- (IBAction)onToolbarItemPress:(NSToolbarItem *)sender +{ + [self.tabView selectTabViewItemAtIndex:sender.tag]; +} + +- (IBAction)onCheckShowFPS:(NSButton *)sender +{ + [self setShowFPS:sender.state == NSOnState]; +} + +- (IBAction)onSelectVideoMode:(NSPopUpButton *)sender +{ + [self setVideoMode:(int)sender.selectedTag]; +} + +- (IBAction)bumpMacFrameSkip:(NSStepper *)sender +{ + int bumpValue = sender.intValue; // 1 or -1 + int nextValue = self.macFrameSkipTextField.intValue + bumpValue; + + // constrain value + if (nextValue < 0) { + nextValue = 0; + } + if (nextValue > 200) { + nextValue = 200; + } + + [self.macFrameSkipTextField setIntValue: nextValue]; + [sender setIntValue:0]; // reset stepper value + [self setMacFrameSkip:self.macFrameSkipTextField.intValue]; // execute setter +} + +- (IBAction)onChangeMacFrameSkipTextField:(NSTextField *)sender +{ + [self setMacFrameSkip:sender.intValue]; +} + +- (IBAction)onCheckMacFrameSkipAutomaticButton:(NSButton *)sender +{ + if (sender.intValue == 1) { + // when automatic is checked, disable macFrameSkipTextField and + // macFrameSkipStepper, then set macFrameSkip to -1 (automatic) + [self.macFrameSkipTextField setEnabled:false]; + [self.macFrameSkipStepper setEnabled:false]; + [self setMacFrameSkip:-1]; + } else { + // when automatic is unchecked, enable macFrameSkipTextField and + // macFrameSkipStepper, then set macFrameSkip to value of text field + [self.macFrameSkipTextField setEnabled:true]; + [self.macFrameSkipStepper setEnabled:true]; + [self setMacFrameSkip:self.macFrameSkipTextField.intValue]; + } +} + +- (IBAction)onChangePlayerDropdown:(NSPopUpButton *)sender +{ + [self selectDeviceForPlayer:sender.selectedTag]; + [self refresh]; +} + +- (IBAction)onChangeDeviceDropdown:(NSPopUpButton *)sender +{ + if (sender.selectedTag >= 0) + { + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + S9xJoypad *joypad = sender.selectedItem.representedObject; + [appDelegate setPlayer:self.playerPopUp.selectedTag forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + [NSUserDefaults.standardUserDefaults synchronize]; + } + [self refresh]; +} + +@end diff --git a/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.xib b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.xib new file mode 100644 index 00000000..eef93933 --- /dev/null +++ b/macosx/Snes9x/S9xPreferences/S9xPreferencesWindowController.xib @@ -0,0 +1,1593 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/mac-coreimage.h b/macosx/Snes9x/S9xPrefsConstants.m similarity index 68% rename from macosx/mac-coreimage.h rename to macosx/Snes9x/S9xPrefsConstants.m index 030849dd..770e8123 100644 --- a/macosx/mac-coreimage.h +++ b/macosx/Snes9x/S9xPrefsConstants.m @@ -15,19 +15,14 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import "S9xPrefsConstants.h" -#ifndef _mac_coreimage_h_ -#define _mac_coreimage_h_ - -void InitCoreImage (void); -void DeinitCoreImage (void); -void InitCoreImageFilter (void); -void DeinitCoreImageFilter (void); -void ConfigureCoreImageFilter (void); -void InitCoreImageContext (CGLContextObj, CGLPixelFormatObj); -void DeinitCoreImageContext (void); -void DrawWithCoreImageFilter (CGRect, CGImageRef); - -#endif +NSString * const kKeyboardPrefs = @"KeyboardConfig"; +NSString * const kJoypadInputPrefs = @"JoypadInputs"; +NSString * const kJoypadPlayerPrefs = @"JoypadPlayers"; +NSString * const kShowFPSPref = @"ShowFPS"; +NSString * const kVideoModePref = @"VideoMode"; +NSString * const kDeviceSettingPref = @"DeviceSetting"; diff --git a/macosx/Snes9x/Snes9x.entitlements b/macosx/Snes9x/Snes9x.entitlements new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/macosx/Snes9x/Snes9x.entitlements @@ -0,0 +1,5 @@ + + + + + diff --git a/macosx/Snes9x/Snes9xDebug.entitlements b/macosx/Snes9x/Snes9xDebug.entitlements new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/macosx/Snes9x/Snes9xDebug.entitlements @@ -0,0 +1,5 @@ + + + + + diff --git a/macosx/mac-appleevent.h b/macosx/Snes9x/main.m old mode 100755 new mode 100644 similarity index 84% rename from macosx/mac-appleevent.h rename to macosx/Snes9x/main.m index ea82660c..cc7f4966 --- a/macosx/mac-appleevent.h +++ b/macosx/Snes9x/main.m @@ -15,13 +15,11 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import -#ifndef _mac_appleevent_h_ -#define _mac_appleevent_h_ - -void InitAppleEvents (void); -void DeinitAppleEvents (void); - -#endif +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/macosx/docs/FAQ.rtf b/macosx/docs/FAQ.rtf index b8154b44..8b468822 100644 --- a/macosx/docs/FAQ.rtf +++ b/macosx/docs/FAQ.rtf @@ -1,68 +1,61 @@ -{\rtf1\ansi\ansicpg932\cocoartf1038\cocoasubrtf350 -{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 +\cocoascreenfonts1{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset0 LucidaGrande-Bold;} {\colortbl;\red255\green255\blue255;\red153\green102\blue51;\red0\green0\blue255;} -\paperw11900\paperh16840\margl1440\margr1440\vieww11500\viewh12340\viewkind0 -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +{\*\expandedcolortbl;;\csgenericrgb\c60000\c40000\c20000;\csgenericrgb\c0\c0\c100000;} +\paperw11905\paperh16837\margl1440\margr1440\vieww11500\viewh12340\viewkind0 +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \f0\fs24 \cf0 \ -\b\fs28 FAQ for Mac port -\b0\fs24 \ +\f1\b\fs28 FAQ for Mac port +\f0\b0\fs24 \ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Differences and similarities among the Mac port and other ports -\b0\fs24 \cf0 \ -\ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf3 Key mapping\cf0 \ - The default settings of key mapping are different. For example, the A-button is the command key on Mac, while it's the D key in Windows.\ +\f1\b\fs26 \cf2 Differences and similarities among the Mac port and other ports +\f0\b0\fs24 \cf0 \ \ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 User interface\cf0 \ All of the menus and dialogs are different.\ \ -\cf3 AVI or QuickTime export\cf0 \ - Mac port supports QuickTime export instead of AVI export in Windows port.\ -\ -\cf3 Sound effect and Core Image filter\cf0 \ - These features are for Mac only because they use Mac OS X's own technologies.\ -\ -\cf3 Netplay\cf0 \ - Snes9x's netplay is incompatible between ports.\ -\ -\cf3 Command-line options\cf0 \ - Mac port doesn't support command-line options.\ -\ \cf3 Preferences file\cf0 \ Mac port doesn't support 'snes9x.conf' file.\ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Emulator Specific Questions -\b0\fs24 \cf0 \ +\f1\b\fs26 \cf2 Emulator Specific Questions +\f0\b0\fs24 \cf0 \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Everything is fine when I play the game, but the next time I play, my save data is not there. Why?\cf0 \ Saving files into a locked volume and folders where you don't have permission to write will fail. Make sure where you are saving files in 'Preferences' dialog. The most common case for Mac beginners is launching Snes9x directly from the disk image with choosing 'Snes9x folder' for saving destination.\ \ +\cf3 Where did Cheats/Movie Recording/Netplay/most of the preferences go?\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf0 Snes9x is currently being ported from Carbon to Cocoa in order to work with macOS Catalina. Because this process is time-consuming, features are being added back over time. If there\'92s a specific feature you\'92d like to see return before others, please upvote an issue, or create one if none exists, at {\field{\*\fldinst{HYPERLINK "https://github.com/snes9xgit/snes9x/issues"}}{\fldrslt https://github.com/snes9xgit/snes9x/issues}}.\ +\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf3 Why did my keyboard controls change when I upgraded?\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf0 The Cocoa port of Snes9x \ +\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Why can't I press many buttons at once? Especially in Chrono Trigger.\cf0 \ Some keyboards can only output two pressed keys at a time, except for modifier keys (shift, command, option and control). Set modifier keys to some of the necessary buttons.\ \ -\cf3 How can I enter the Game Genie / PAR code in 'Cheat Entry' dialog?\cf0 \ - Simply enter the code directly into the address column. Snes9x automatically translates it to the general format.\ -\ \cf3 I recently purchased a gamepad controller. Will it work on Snes9x?\ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf0 If your gamepad is conformable to USB Device Class Definition for Human Interface Devices, it may work. Note that most gamepads don't officially support Mac OS X even if they work without problems.\cf3 \ \ I connected my gamepad but it doesn't work.\cf0 \ Gamepads cannot be used until you configure its settings in 'Configure Controllers' dialog.\ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 I think my options in Snes9x got screwed up, how do I reset them?\cf0 \ - Quit Snes9x and trash the preferences file 'com.snes9x.macos.snes9x.plist' in ~/Library/Preferences.\ + Quit Snes9x and trash the preferences files 'com.snes9x.macos.snes9x.plist' in ~/Library/Preferences and in /Library/Preferences. You may need to reboot afterwords. Alternately, you can use the command \'91defaults delete com.snes9x.macos.snes9x\'92 in Terminal.app to avoid restarting.\ \ \cf3 I had a bad checksummed game that didn't work so I adjusted the header, but it still doesn't work :( Why?\cf0 \ It should be noted that while it is possible to plop a ROM into Snestool, or several other programs, and adjust the header size to be the same as a proper 'good checksum' ROM, this merely mimics the appearance of a good ROM. Any problems still found within its evil will remain. One could compare it to covering up a circumorbital haematoma with a paper bag.\ @@ -74,12 +67,12 @@ I connected my gamepad but it doesn't work.\cf0 \ Chances are it will be coming out when enough changes have been made to suitably make a release. You can generally guesstimate the release date by paying attention to the Developers forum at snes9x.com. But don't ask them when the next release will be.\ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Miscellaneous Questions -\b0\fs24 \cf0 \ +\f1\b\fs26 \cf2 Miscellaneous Questions +\f0\b0\fs24 \cf0 \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Is it legal?\cf0 \ This has been asked time and again, and the answer is yes. Developing, downloading, or using the emulator, Snes9x, is completely legal. Downloading games, called ROMS, however is not. If you own the original cartridge of a game, you are still not entitled to download the ROM image of that game. You may create a single backup image of your own cartridge via proper hardware, but it must be YOUR cartridge and is only usable in place of the original... so only one may be active at any time. Many sites claim that you may legally download ROMs for up to 24 hours before they must be deleted. This is also wrong; you can't legally download these for "trial" purposes. You can't download ROMs for educational purposes either. If you wish to use Super Nintendo Entertainment System games for educational purposes, contact your closest Nintendo Outlet and discuss educational programming with them. Finally, a small number of ROMs are labeled "(PD)". This means public domain, and these games are not under copyright. As such they are legal to download at your hearts content. These include programs created by internet users such as yourself for use in Super Nintendo emulators. As of this time there are no commercial videogames in the public domain.\ \ diff --git a/macosx/English.lproj/InfoPlist.strings b/macosx/en.lproj/InfoPlist.strings similarity index 100% rename from macosx/English.lproj/InfoPlist.strings rename to macosx/en.lproj/InfoPlist.strings diff --git a/macosx/English.lproj/Localizable.strings b/macosx/en.lproj/Localizable.strings similarity index 100% rename from macosx/English.lproj/Localizable.strings rename to macosx/en.lproj/Localizable.strings diff --git a/macosx/English.lproj/Snes9x Help/Snes9x Help.helpindex b/macosx/en.lproj/Snes9x Help/Snes9x Help.helpindex similarity index 100% rename from macosx/English.lproj/Snes9x Help/Snes9x Help.helpindex rename to macosx/en.lproj/Snes9x Help/Snes9x Help.helpindex diff --git a/macosx/English.lproj/Snes9x Help/gfx/s9xic128.png b/macosx/en.lproj/Snes9x Help/gfx/s9xic128.png similarity index 100% rename from macosx/English.lproj/Snes9x Help/gfx/s9xic128.png rename to macosx/en.lproj/Snes9x Help/gfx/s9xic128.png diff --git a/macosx/English.lproj/Snes9x Help/gfx/s9xic16.png b/macosx/en.lproj/Snes9x Help/gfx/s9xic16.png similarity index 100% rename from macosx/English.lproj/Snes9x Help/gfx/s9xic16.png rename to macosx/en.lproj/Snes9x Help/gfx/s9xic16.png diff --git a/macosx/English.lproj/Snes9x Help/index.html b/macosx/en.lproj/Snes9x Help/index.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/index.html rename to macosx/en.lproj/Snes9x Help/index.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/01.html b/macosx/en.lproj/Snes9x Help/pgs/01.html similarity index 94% rename from macosx/English.lproj/Snes9x Help/pgs/01.html rename to macosx/en.lproj/Snes9x Help/pgs/01.html index c0eb0bed..98e5bb98 100644 --- a/macosx/English.lproj/Snes9x Help/pgs/01.html +++ b/macosx/en.lproj/Snes9x Help/pgs/01.html @@ -30,11 +30,10 @@

As with all things there are disadvantages though :

    -
  • if you have an ancient computer, you aren't likely to get a playable experience.
  • some games are still unemulated (though this a very tiny minority.)
  • the emulator can be difficult for new users to configure.
-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/02.html b/macosx/en.lproj/Snes9x Help/pgs/02.html similarity index 85% rename from macosx/English.lproj/Snes9x Help/pgs/02.html rename to macosx/en.lproj/Snes9x Help/pgs/02.html index 24cbcc6c..17ed67c0 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/02.html +++ b/macosx/en.lproj/Snes9x Help/pgs/02.html @@ -13,7 +13,7 @@

Getting Started

- Copy the Snes9x application from the disk image (.dmg) to your hard disk and double-click it. + Copy the Snes9x application to your hard Applications Folder and double-click it.

Loading Games

@@ -64,7 +64,7 @@

SNES Joypad Emulation

- The default key mapping for joypad 1 is as follows: + The Mac port now uses the same default key mapping as the Windows port. The default key mapping for joypad 1 is as follows:

  • @@ -86,35 +86,35 @@ - + - + - + - + - + - + - + - + @@ -122,9 +122,9 @@

    Pausing and Resuming the Game

    - To pause the game, press pause key (esc key by default), choose 'Pause' in 'Emulation' menu, or click the game screen in case you aren't playing the game that uses a mouse. Double-click the game window or choose 'Resume' in 'Emulation' menu to resume the game. + To pause the game, press pause key (esc key by default) or choose 'Pause' in 'Emulation' menu. Choose 'Resume' in 'Emulation' menu to resume the game.

    -

    +

    <Prev  Top  Next>

    diff --git a/macosx/English.lproj/Snes9x Help/pgs/03.html b/macosx/en.lproj/Snes9x Help/pgs/03.html similarity index 65% rename from macosx/English.lproj/Snes9x Help/pgs/03.html rename to macosx/en.lproj/Snes9x Help/pgs/03.html index ed476e06..d6e01375 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/03.html +++ b/macosx/en.lproj/Snes9x Help/pgs/03.html @@ -11,20 +11,14 @@

    Requirements

    System Requirements

    - Mac OS X 10.3.9 or later
    - QuickTime 7.0 or later
    - PowerPC G3 300MHz or later
    - G-Force/ATI Rage 128 or later -

    -

    - Certain games use added hardware which will require a faster Mac. The specs listed above is the minimum to use Snes9x in any playable form. It is recommended that you get a semi-modern Mac with a 800MHz PowerPC processor if you want good results. A 1GHz PowerPC or Intel Mac is recommended for those that want a near perfect experience. + Mac OS X 10.12 or later

    Software

    You will need access to SNES ROM images otherwise you will have nothing to run! Some home-brewed ROM images can be downloaded from http://www.zophar.com/.
    Please note, it is illegal in most countries to have commercial ROM images without also owning the actual SNES ROM cartridges, and even then you may be liable under various EULAs.

    -

    +

    <Prev  Top  Next>

    diff --git a/macosx/English.lproj/Snes9x Help/pgs/04.html b/macosx/en.lproj/Snes9x Help/pgs/04.html similarity index 80% rename from macosx/English.lproj/Snes9x Help/pgs/04.html rename to macosx/en.lproj/Snes9x Help/pgs/04.html index 55056a6f..e09c78a7 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/04.html +++ b/macosx/en.lproj/Snes9x Help/pgs/04.html @@ -50,20 +50,8 @@

    Automatic Fire

    - The 'Automatic Fire...' dialog in the 'Config' menu provides five configuration options for simulating autofire controllers: + Pressing Snes9x's Alt key in conjunction with that controller button in-game will toggle that button's 'Enable Automatic Fire' setting. Other autofire settings will return in future versions. If you use these settings, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

    -
    -
    Enable Automatic Fire
    -
    If this option is enabled for a given controller button, holding down that button will produce a rapid-fire effect (barring the use of the 'Automatic Fire is Active Only While TC is Pressed' option - see below).
    -
    Allow Alt to Toggle Enable/Disable Automatic Fire
    -
    If this option is enabled for a given controller button, pressing Snes9x's Alt key in conjunction with that controller button in-game will toggle that button's 'Enable Automatic Fire' setting.
    -
    Automatic Fire is Active Only While TC is Pressed
    -
    If this option is enabled for a given controller button, you must hold down Snes9x's TC key in conjunction with that controller button in-game to produce a rapid-fire effect, provided that 'Enable Automatic Fire' is toggled on for that controller button. If TC is not depressed, that controller button will function as normal. Note that when 'Enable Automatic Fire' is toggled off for a controller button, its 'Automatic Fire is Active Only While TC is Pressed' setting has no effect.
    -
    Button Input is Inverted
    -
    If this option is enabled for a given controller button, Snes9x behaves as though you are pushing that controller button if and only if you are not pushing it. This option is most often used in conjunction with 'Enable Automatic Fire', producing a rapidly-firing controller button without any player intervention.
    -
    Automatic Fire Speed
    -
    This option controls the rate at which autofire controller buttons cycle their fire.
    -

    Snes9x's Alt and TC buttons can be mapped to both keyboard keys and joypad buttons, in the 'Configure Keyboard...' and 'Configure Controllers...' dialogs respectively.

    @@ -197,7 +185,7 @@
    Right direction
    commandV A button
    optionC B button
    controlD X button
    shiftX Y button
    ZA L button
    XS R button
    tabreturn Select button
    returnspace Start button
-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/05.html b/macosx/en.lproj/Snes9x Help/pgs/05.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/05.html rename to macosx/en.lproj/Snes9x Help/pgs/05.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/06.html b/macosx/en.lproj/Snes9x Help/pgs/06.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/06.html rename to macosx/en.lproj/Snes9x Help/pgs/06.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/07.html b/macosx/en.lproj/Snes9x Help/pgs/07.html similarity index 93% rename from macosx/English.lproj/Snes9x Help/pgs/07.html rename to macosx/en.lproj/Snes9x Help/pgs/07.html index 71656fad..7f9880d0 100644 --- a/macosx/English.lproj/Snes9x Help/pgs/07.html +++ b/macosx/en.lproj/Snes9x Help/pgs/07.html @@ -9,6 +9,7 @@

Cheat Support

+

Cheat support will return in a future version. If you want to see it return faster, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

Cheat codes allow you to cheat at games. They might give you more lives, infinite health, enable special powers normally only activated when a special item is found, and etc. Two major formats are well-known: Game Genie and Pro-Action Reply (PAR). Many existing Game Genie and PAR codes can be found via Internet.

@@ -52,7 +53,7 @@

Now you'll find that the number of lives is 5 and the value doesn't decrease even you crash into an enemy. Snes9x keeps the value constant, so even if you do lose a life and life counter goes down by one, less than 20ms later, Snes9x resets the counter back to the value you chose!

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/08.html b/macosx/en.lproj/Snes9x Help/pgs/08.html similarity index 89% rename from macosx/English.lproj/Snes9x Help/pgs/08.html rename to macosx/en.lproj/Snes9x Help/pgs/08.html index b9d43a95..2485e1a2 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/08.html +++ b/macosx/en.lproj/Snes9x Help/pgs/08.html @@ -9,6 +9,7 @@

Movie Support

+

Movie support will return in a future version. If you want to see it return faster, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

Movie support allows you to record your actions while playing a game. This can be used for your own personal playback or to show other people that you can do something without them having to be around when you did it.

@@ -33,7 +34,7 @@ Choose 'Export to QuickTime Movie...' in 'Option' menu and choose the location where the QuickTime movie file will be saved. Press 'Compression...' button and set the compression settings by the general QuickTime dialog. 'Double Size' check box makes the movie size from 256x224/239 to 512x448/478. 'Overscan' check box is for games that use 239 or 478 lines. 'Frame Skip' menu decides frame rate of the movie, for example when the value is 1, NTSC games which have 60 fps are exported as 30 fps movie.
To make a QuickTime movie from .smv, choose 'Play Movie...' in 'Option' menu and turn on 'Export to QuickTime movie at a Time' check box.

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/09.html b/macosx/en.lproj/Snes9x Help/pgs/09.html similarity index 92% rename from macosx/English.lproj/Snes9x Help/pgs/09.html rename to macosx/en.lproj/Snes9x Help/pgs/09.html index 04c2e2ef..86f778e0 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/09.html +++ b/macosx/en.lproj/Snes9x Help/pgs/09.html @@ -12,6 +12,7 @@

Netplay Support

+

Netplay does not currently work, and may not return in a future version. If you want to see it return, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know that players are using it.

Netplay support allows up to five players to sit in front of different computers and simultaneously play the same game, or just watch someone else play a game. All the computers have to be connected to a network that allows TCP/IP traffic to flow between them; this includes a local Ethernet-style network, a direct-cable connection, or, if you're lucky and have short ping times, the Internet.

@@ -97,7 +98,7 @@ -

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/10.html b/macosx/en.lproj/Snes9x Help/pgs/10.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/10.html rename to macosx/en.lproj/Snes9x Help/pgs/10.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/11.html b/macosx/en.lproj/Snes9x Help/pgs/11.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/11.html rename to macosx/en.lproj/Snes9x Help/pgs/11.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/12.html b/macosx/en.lproj/Snes9x Help/pgs/12.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/12.html rename to macosx/en.lproj/Snes9x Help/pgs/12.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/13.html b/macosx/en.lproj/Snes9x Help/pgs/13.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/13.html rename to macosx/en.lproj/Snes9x Help/pgs/13.html diff --git a/macosx/en.lproj/Snes9x Help/pgs/14.html b/macosx/en.lproj/Snes9x Help/pgs/14.html new file mode 100644 index 00000000..6434c093 --- /dev/null +++ b/macosx/en.lproj/Snes9x Help/pgs/14.html @@ -0,0 +1,23 @@ + + + + + + + + References + + +

Preferences

+

Many preferences have not yet been ported to the Cocoa version of Snes9x. If there is a preference you want to see added, please upvote an existing issue if it exists, or create a new one of no issue exists, at https://github.com/snes9xgit/snes9x/issues.

+
+
Video Mode
+
Choose the image scaling filter which is applied to the raw SNES image.
+
Show Frame Rate
+
Toggles display of the frame rate on/off.
+
+

+ <Prev  Top  Next> +

+ + diff --git a/macosx/English.lproj/Snes9x Help/pgs/15.html b/macosx/en.lproj/Snes9x Help/pgs/15.html similarity index 97% rename from macosx/English.lproj/Snes9x Help/pgs/15.html rename to macosx/en.lproj/Snes9x Help/pgs/15.html index 5eb0de91..47621cae 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/15.html +++ b/macosx/en.lproj/Snes9x Help/pgs/15.html @@ -60,9 +60,9 @@

Edited for Mac port by: zones (kasumitokoduck@yahoo.com)
- Updated most recently by: 2011/3/31 zones + Updated most recently by: 2019/11/03 Michael Donald Buckley

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/sty/style.css b/macosx/en.lproj/Snes9x Help/sty/style.css similarity index 100% rename from macosx/English.lproj/Snes9x Help/sty/style.css rename to macosx/en.lproj/Snes9x Help/sty/style.css diff --git a/macosx/English.lproj/Snes9x Help/sty/top.css b/macosx/en.lproj/Snes9x Help/sty/top.css similarity index 100% rename from macosx/English.lproj/Snes9x Help/sty/top.css rename to macosx/en.lproj/Snes9x Help/sty/top.css diff --git a/macosx/English.lproj/Snes9x.xib b/macosx/en.lproj/Snes9x.xib similarity index 100% rename from macosx/English.lproj/Snes9x.xib rename to macosx/en.lproj/Snes9x.xib diff --git a/macosx/en.lproj/musicbox.xib b/macosx/en.lproj/musicbox.xib new file mode 100644 index 00000000..d82377c4 --- /dev/null +++ b/macosx/en.lproj/musicbox.xib @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/logo_defrost.png b/macosx/logo_defrost.png index 208704dd..7bb36dfd 100644 Binary files a/macosx/logo_defrost.png and b/macosx/logo_defrost.png differ diff --git a/macosx/logo_freeze.png b/macosx/logo_freeze.png index 8d6eaa0b..7e341123 100644 Binary files a/macosx/logo_freeze.png and b/macosx/logo_freeze.png differ diff --git a/macosx/mac-appleevent.cpp b/macosx/mac-appleevent.cpp deleted file mode 100755 index 2b2366bd..00000000 --- a/macosx/mac-appleevent.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-os.h" -#include "mac-snes9x.h" -#include "mac-appleevent.h" - -static AEEventHandlerUPP oappUPP, rappUPP, pdocUPP, quitUPP, odocUPP; - -static pascal OSErr AEoapp (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AErapp (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEpdoc (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEquit (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEodoc (const AppleEvent *, AppleEvent *, long); - - -static pascal OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - if (startopendlog) - { - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - - return (noErr); -} - -static pascal OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - if (!cartOpen) - { - if (startopendlog) - { - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - } - else - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - - return (noErr); -} - -static pascal OSErr AEpdoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - return (errAEEventNotHandled); -} - -static pascal OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - SNES9X_Quit(); - QuitApplicationEventLoop(); - - return (noErr); -} - -static pascal OSErr AEodoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - OSErr err; - FSRef ref; - AEDescList docList; - AEKeyword keywd; - DescType rtype; - Size acsize; - long count; - - if (running) - return (noErr); - - err = AEGetParamDesc(theEvent, keyDirectObject, typeAEList, &docList); - if (err) - return (noErr); - - err = AECountItems(&docList, &count); - if (err || (count != 1)) - { - err = AEDisposeDesc(&docList); - return (noErr); - } - - err = AEGetNthPtr(&docList, 1, typeFSRef, &keywd, &rtype, &ref, sizeof(FSRef), &acsize); - if (err == noErr) - { - if (SNES9X_OpenCart(&ref)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - - err = AEDisposeDesc(&docList); - - return (noErr); -} - -void InitAppleEvents (void) -{ - OSErr err; - - oappUPP = NewAEEventHandlerUPP(AEoapp); - err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, oappUPP, 0L, false); - - odocUPP = NewAEEventHandlerUPP(AEodoc); - err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, odocUPP, 0L, false); - - pdocUPP = NewAEEventHandlerUPP(AEpdoc); - err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, pdocUPP, 0L, false); - - quitUPP = NewAEEventHandlerUPP(AEquit); - err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, quitUPP, 0L, false); - - rappUPP = NewAEEventHandlerUPP(AErapp); - err = AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, rappUPP, 0L, false); -} - -void DeinitAppleEvents (void) -{ - DisposeAEEventHandlerUPP(oappUPP); - DisposeAEEventHandlerUPP(odocUPP); - DisposeAEEventHandlerUPP(pdocUPP); - DisposeAEEventHandlerUPP(quitUPP); - DisposeAEEventHandlerUPP(rappUPP); -} diff --git a/macosx/mac-audio.h b/macosx/mac-audio.h index 53050a85..513c5dbf 100644 --- a/macosx/mac-audio.h +++ b/macosx/mac-audio.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -28,6 +29,5 @@ void DeinitMacSound (void); void MacStartSound (void); void MacStopSound (void); void ConfigureSoundEffects (void); -void PlayAlertSound (void); #endif diff --git a/macosx/mac-audio.mm b/macosx/mac-audio.mm index 3fe2b425..deb685af 100644 --- a/macosx/mac-audio.mm +++ b/macosx/mac-audio.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -43,11 +44,6 @@ int cureffect = kAUReverb; static AUGraph agraph; static AUNode outNode, cnvNode, revNode, eqlNode; static AudioUnit outAU, cnvAU, revAU, eqlAU; -static AudioUnitCarbonView carbonView = NULL; -static EventHandlerUPP carbonViewEventUPP = NULL; -static EventHandlerRef carbonViewEventRef = NULL; -static WindowRef effectWRef; -static HISize effectWSize; static pthread_mutex_t mutex; static UInt32 outStoredFrames, cnvStoredFrames, revStoredFrames, eqlStoredFrames, devStoredFrames; static int16_t *audioBuffer; @@ -63,12 +59,8 @@ static void SetAudioUnitSoundFormat (void); static void SetAudioUnitVolume (void); static void StoreBufferFrameSize (void); static void ChangeBufferFrameSize (void); -static void ReplaceAudioUnitCarbonView (void); -static void ResizeSoundEffectsDialog (HIViewRef); static void MacSamplesAvailableCallBack (void *); static OSStatus MacAURenderCallBack (void *, AudioUnitRenderActionFlags *, const AudioTimeStamp *, UInt32, UInt32, AudioBufferList *); -static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef, EventRef, void *); void InitMacSound (void) @@ -77,11 +69,7 @@ void InitMacSound (void) err = NewAUGraph(&agraph); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT AudioComponentDescription outdesc, cnvdesc, revdesc, eqldesc; -#else - ComponentDescription outdesc, cnvdesc, revdesc, eqldesc; -#endif outdesc.componentType = kAudioUnitType_Output; outdesc.componentSubType = kAudioUnitSubType_DefaultOutput; @@ -107,31 +95,18 @@ void InitMacSound (void) eqldesc.componentFlags = 0; eqldesc.componentFlagsMask = 0; -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT err = AUGraphAddNode(agraph, &outdesc, &outNode); err = AUGraphAddNode(agraph, &cnvdesc, &cnvNode); err = AUGraphAddNode(agraph, &revdesc, &revNode); err = AUGraphAddNode(agraph, &eqldesc, &eqlNode); -#else - err = AUGraphNewNode(agraph, &outdesc, 0, NULL, &outNode); - err = AUGraphNewNode(agraph, &cnvdesc, 0, NULL, &cnvNode); - err = AUGraphNewNode(agraph, &revdesc, 0, NULL, &revNode); - err = AUGraphNewNode(agraph, &eqldesc, 0, NULL, &eqlNode); -#endif err = AUGraphOpen(agraph); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT err = AUGraphNodeInfo(agraph, outNode, NULL, &outAU); err = AUGraphNodeInfo(agraph, cnvNode, NULL, &cnvAU); err = AUGraphNodeInfo(agraph, revNode, NULL, &revAU); err = AUGraphNodeInfo(agraph, eqlNode, NULL, &eqlAU); -#else - err = AUGraphGetNodeInfo(agraph, outNode, NULL, NULL, NULL, &outAU); - err = AUGraphGetNodeInfo(agraph, cnvNode, NULL, NULL, NULL, &cnvAU); - err = AUGraphGetNodeInfo(agraph, revNode, NULL, NULL, NULL, &revAU); - err = AUGraphGetNodeInfo(agraph, eqlNode, NULL, NULL, NULL, &eqlAU); -#endif + SetAudioUnitSoundFormat(); SetAudioUnitVolume(); @@ -291,12 +266,7 @@ static void ConnectAudioUnits (void) callback.inputProc = MacAURenderCallBack; callback.inputProcRefCon = NULL; - if (systemVersion >= 0x1050) - err = AUGraphSetNodeInputCallback(agraph, aueffect ? cnvNode : outNode, 0, &callback); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - err = AudioUnitSetProperty(aueffect ? cnvAU : outAU, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)); -#endif + err = AUGraphSetNodeInputCallback(agraph, aueffect ? cnvNode : outNode, 0, &callback); if ((aueffect & kAUReverb) && (aueffect & kAUGraphEQ)) { @@ -510,445 +480,157 @@ bool8 S9xOpenSoundDevice (void) return (true); } -void PlayAlertSound (void) -{ - if (systemVersion >= 0x1050) - AudioServicesPlayAlertSound(kUserPreferredAlert); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - SysBeep(10); -#endif -} - -static void ReplaceAudioUnitCarbonView (void) -{ - OSStatus err; - AudioUnit editau; - Component cmp; - ComponentDescription desc; - HIViewRef pane, contentview, ctl; - HIViewID cid; - Float32Point location, size; - Rect rct; - UInt32 psize; - - if (carbonView) - { - err = RemoveEventHandler(carbonViewEventRef); - DisposeEventHandlerUPP(carbonViewEventUPP); - carbonViewEventRef = NULL; - carbonViewEventUPP = NULL; - - CloseComponent(carbonView); - carbonView = NULL; - } - - switch (cureffect) - { - case kAUGraphEQ: - editau = eqlAU; - break; - - case kAUReverb: - default: - editau = revAU; - break; - } - - desc.componentType = kAudioUnitCarbonViewComponentType; - desc.componentSubType = kAUCarbonViewSubType_Generic; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - err = AudioUnitGetPropertyInfo(editau, kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, &psize, NULL); - if (err == noErr) - { - ComponentDescription *editors; - int nEditors; - - nEditors = psize / sizeof(ComponentDescription); - - editors = new ComponentDescription[nEditors]; - - err = AudioUnitGetProperty(editau, kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, editors, &psize); - if (err == noErr) - desc = editors[0]; - - delete [] editors; - } - - HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); - - cmp = FindNextComponent(NULL, &desc); - if (cmp) - { - err = OpenAComponent(cmp, &carbonView); - if (err == noErr) - { - EventTypeSpec event[] = { { kEventClassControl, kEventControlBoundsChanged } }; - - GetWindowBounds(effectWRef, kWindowContentRgn, &rct); - location.x = 20; - location.y = 96; - size.x = rct.right - rct.left; - size.y = rct.bottom - rct.top; - - err = AudioUnitCarbonViewCreate(carbonView, editau, effectWRef, contentview, &location, &size, &pane); - - carbonViewEventUPP = NewEventHandlerUPP(SoundEffectsCarbonViewEventHandler); - err = InstallControlEventHandler(pane, carbonViewEventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &carbonViewEventRef); - - ResizeSoundEffectsDialog(pane); - } - else - carbonView = NULL; - } - else - carbonView = NULL; - - cid.id = 0; - cid.signature = 'Enab'; - HIViewFindByID(contentview, cid, &ctl); - SetControl32BitValue(ctl, (aueffect & cureffect) ? 1 : 0); -} - -static void ResizeSoundEffectsDialog (HIViewRef view) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - HIRect bounds; - Rect rv; - int w, h; - - root = HIViewGetRoot(effectWRef); - - cid.id = 0; - cid.signature = 'Enab'; - HIViewFindByID(root, cid, &ctl); - - err = HIViewSetVisible(ctl, false); - err = HIViewSetVisible(view, false); - - HIViewGetBounds(view, &bounds); - w = ((int) bounds.size.width + 30 > (int) effectWSize.width) ? ((int) bounds.size.width + 30) : (int) effectWSize.width; - h = (int) bounds.size.height + 122; -#ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - h += 16; -#endif - GetWindowBounds(effectWRef, kWindowStructureRgn, &rv); - rv.right = rv.left + w; - rv.bottom = rv.top + h; - err = TransitionWindow(effectWRef, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &rv); - - err = HIViewSetVisible(ctl, true); - err = HIViewSetVisible(view, true); - -#ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - { - HIRect frame; - Rect rct; - - GetWindowBounds(effectWRef, kWindowContentRgn, &rv); - - cid.signature = 'SfUI'; - HIViewFindByID(root, cid, &ctl); - HIViewGetFrame(ctl, &frame); - frame.size.width = (float) (rv.right - rv.left); - HIViewSetFrame(ctl, &frame); - - cid.signature = 'LINE'; - HIViewFindByID(root, cid, &ctl); - HIViewGetFrame(ctl, &frame); - frame.size.width = (float) (rv.right - rv.left - 24); - HIViewSetFrame(ctl, &frame); - - rct.top = 0; - rct.left = 0; - rct.bottom = rv.bottom - rv.top; - rct.right = rv.right - rv.left; - err = InvalWindowRect(effectWRef, &rct); - } -#endif -} - void ConfigureSoundEffects (void) { - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef uiparts; - - err = CreateWindowFromNib(nibRef, CFSTR("SoundEffect"), &uiparts); - if (err == noErr) - { - EventHandlerUPP eventUPP; - EventHandlerRef eventHandler; - EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, userpane, contentview; - HIViewID cid; - CFStringRef str; - Rect rct; - WindowAttributes metal = 0; - - cid.id = 0; - cid.signature = 'SfUI'; - HIViewFindByID(HIViewGetRoot(uiparts), cid, &userpane); - GetWindowBounds(uiparts, kWindowContentRgn, &rct); - - if (systemVersion >= 0x1040) // AUs support compositing - { - HIRect frame; - - str = CFCopyLocalizedString(CFSTR("CreateMetalDlg"), "NO"); - if (str) - { - if (CFStringCompare(str, CFSTR("YES"), 0) == kCFCompareEqualTo) - metal = kWindowMetalAttribute; - - CFRelease(str); - } - - frame = CGRectMake(0.0f, 0.0f, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute | kWindowCompositingAttribute | metal, &rct, &effectWRef); - err = HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); - err = HIViewAddSubview(contentview, userpane); - err = HIViewSetFrame(userpane, &frame); - } - #ifdef MAC_PANTHER_SUPPORT - else - { - err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute, &rct, &effectWRef); - err = CreateRootControl(effectWRef, &contentview); - err = EmbedControl(userpane, contentview); - MoveControl(userpane, 0, 0); - } - #endif - - CFRelease(uiparts); - - if (!metal) - err = SetThemeWindowBackground(effectWRef, kThemeBrushDialogBackgroundActive, false); - - str = CFCopyLocalizedString(CFSTR("SoundEffectDlg"), "SoundEffect"); - if (str) - { - err = SetWindowTitleWithCFString(effectWRef, str); - CFRelease(str); - } - - if (systemVersion >= 0x1040) // AUs support compositing - { - HILayoutInfo layoutinfo; - HIViewRef separator; - - cid.signature = 'LINE'; - err = HIViewFindByID(userpane, cid, &separator); - - layoutinfo.version = kHILayoutInfoVersionZero; - err = HIViewGetLayoutInfo(userpane, &layoutinfo); - - layoutinfo.binding.top.toView = contentview; - layoutinfo.binding.top.kind = kHILayoutBindNone; - layoutinfo.binding.bottom.toView = contentview; - layoutinfo.binding.bottom.kind = kHILayoutBindNone; - layoutinfo.binding.left.toView = contentview; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = contentview; - layoutinfo.binding.right.kind = kHILayoutBindRight; - err = HIViewSetLayoutInfo(userpane, &layoutinfo); - - layoutinfo.version = kHILayoutInfoVersionZero; - err = HIViewGetLayoutInfo(separator, &layoutinfo); - - layoutinfo.binding.top.toView = userpane; - layoutinfo.binding.top.kind = kHILayoutBindNone; - layoutinfo.binding.bottom.toView = userpane; - layoutinfo.binding.bottom.kind = kHILayoutBindNone; - layoutinfo.binding.left.toView = userpane; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = userpane; - layoutinfo.binding.right.kind = kHILayoutBindRight; - err = HIViewSetLayoutInfo(separator, &layoutinfo); - } - - eventUPP = NewEventHandlerUPP(SoundEffectsEventHandler); - err = InstallWindowEventHandler(effectWRef, eventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &eventHandler); - - GetWindowBounds(effectWRef, kWindowContentRgn, &rct); - effectWSize.width = (float) (rct.right - rct.left); - effectWSize.height = (float) (rct.bottom - rct.top ); - - carbonView = NULL; - ReplaceAudioUnitCarbonView(); - - cid.signature = 'Epop'; - HIViewFindByID(userpane, cid, &ctl); - switch (cureffect) - { - case kAUReverb: - SetControl32BitValue(ctl, 1); - break; - - case kAUGraphEQ: - SetControl32BitValue(ctl, 2); - break; - } - - MoveWindowPosition(effectWRef, kWindowSoundEffect, false); - ShowWindow(effectWRef); - err = RunAppModalLoopForWindow(effectWRef); - HideWindow(effectWRef); - SaveWindowPosition(effectWRef, kWindowSoundEffect); - - if (carbonView) - { - err = RemoveEventHandler(carbonViewEventRef); - DisposeEventHandlerUPP(carbonViewEventUPP); - carbonViewEventRef = NULL; - carbonViewEventUPP = NULL; - - CloseComponent(carbonView); - carbonView = NULL; - } - - err = RemoveEventHandler(eventHandler); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(effectWRef); - } - - DisposeNibReference(nibRef); - } -} - -static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl; - HIRect bounds; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlBoundsChanged: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &bounds); - if (err == noErr) - { - if ((bounds.size.width > 0) && (bounds.size.height > 0)) - ResizeSoundEffectsDialog(ctl); - } - } - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case 'Enab': - { - Boolean r = false; - - mboxPause = true; - - err = AUGraphIsRunning(agraph, &r); - if (err == noErr && r) - err = AUGraphStop(agraph); - - DisconnectAudioUnits(); - err = AUGraphUninitialize(agraph); - - aueffect ^= cureffect; - - SetAudioUnitSoundFormat(); - ChangeBufferFrameSize(); - - err = AUGraphInitialize(agraph); - ConnectAudioUnits(); - - if (r) - err = AUGraphStart(agraph); - - mboxPause = false; - - result = noErr; - break; - } - - case 'Revb': - cureffect = kAUReverb; - ReplaceAudioUnitCarbonView(); - break; - - case 'GrEQ': - cureffect = kAUGraphEQ; - ReplaceAudioUnitCarbonView(); - break; - } - } - - break; - } - - break; - } - - return (result); +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef uiparts; +// +// err = CreateWindowFromNib(nibRef, CFSTR("SoundEffect"), &uiparts); +// if (err == noErr) +// { +// EventHandlerUPP eventUPP; +// EventHandlerRef eventHandler; +// EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, +// { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// HIViewRef ctl, userpane, contentview; +// HIViewID cid; +// CFStringRef str; +// Rect rct; +// WindowAttributes metal = 0; +// +// cid.id = 0; +// cid.signature = 'SfUI'; +// HIViewFindByID(HIViewGetRoot(uiparts), cid, &userpane); +// GetWindowBounds(uiparts, kWindowContentRgn, &rct); +// +// if (systemVersion >= 0x1040) // AUs support compositing +// { +// HIRect frame; +// +// str = CFCopyLocalizedString(CFSTR("CreateMetalDlg"), "NO"); +// if (str) +// { +// if (CFStringCompare(str, CFSTR("YES"), 0) == kCFCompareEqualTo) +// metal = kWindowMetalAttribute; +// +// CFRelease(str); +// } +// +// frame = CGRectMake(0.0f, 0.0f, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); +// err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute | kWindowCompositingAttribute | metal, &rct, &effectWRef); +// err = HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); +// err = HIViewAddSubview(contentview, userpane); +// err = HIViewSetFrame(userpane, &frame); +// } +// #ifdef MAC_PANTHER_SUPPORT +// else +// { +// err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute, &rct, &effectWRef); +// err = CreateRootControl(effectWRef, &contentview); +// err = EmbedControl(userpane, contentview); +// MoveControl(userpane, 0, 0); +// } +// #endif +// +// CFRelease(uiparts); +// +// if (!metal) +// err = SetThemeWindowBackground(effectWRef, kThemeBrushDialogBackgroundActive, false); +// +// str = CFCopyLocalizedString(CFSTR("SoundEffectDlg"), "SoundEffect"); +// if (str) +// { +// err = SetWindowTitleWithCFString(effectWRef, str); +// CFRelease(str); +// } +// +// if (systemVersion >= 0x1040) // AUs support compositing +// { +// HILayoutInfo layoutinfo; +// HIViewRef separator; +// +// cid.signature = 'LINE'; +// err = HIViewFindByID(userpane, cid, &separator); +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// err = HIViewGetLayoutInfo(userpane, &layoutinfo); +// +// layoutinfo.binding.top.toView = contentview; +// layoutinfo.binding.top.kind = kHILayoutBindNone; +// layoutinfo.binding.bottom.toView = contentview; +// layoutinfo.binding.bottom.kind = kHILayoutBindNone; +// layoutinfo.binding.left.toView = contentview; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = contentview; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// err = HIViewSetLayoutInfo(userpane, &layoutinfo); +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// err = HIViewGetLayoutInfo(separator, &layoutinfo); +// +// layoutinfo.binding.top.toView = userpane; +// layoutinfo.binding.top.kind = kHILayoutBindNone; +// layoutinfo.binding.bottom.toView = userpane; +// layoutinfo.binding.bottom.kind = kHILayoutBindNone; +// layoutinfo.binding.left.toView = userpane; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = userpane; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// err = HIViewSetLayoutInfo(separator, &layoutinfo); +// } +// +// eventUPP = NewEventHandlerUPP(SoundEffectsEventHandler); +// err = InstallWindowEventHandler(effectWRef, eventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &eventHandler); +// +// GetWindowBounds(effectWRef, kWindowContentRgn, &rct); +// effectWSize.width = (float) (rct.right - rct.left); +// effectWSize.height = (float) (rct.bottom - rct.top ); +// +// carbonView = NULL; +// ReplaceAudioUnitCarbonView(); +// +// cid.signature = 'Epop'; +// HIViewFindByID(userpane, cid, &ctl); +// switch (cureffect) +// { +// case kAUReverb: +// SetControl32BitValue(ctl, 1); +// break; +// +// case kAUGraphEQ: +// SetControl32BitValue(ctl, 2); +// break; +// } +// +// MoveWindowPosition(effectWRef, kWindowSoundEffect, false); +// ShowWindow(effectWRef); +// err = RunAppModalLoopForWindow(effectWRef); +// HideWindow(effectWRef); +// SaveWindowPosition(effectWRef, kWindowSoundEffect); +// +// if (carbonView) +// { +// err = RemoveEventHandler(carbonViewEventRef); +// DisposeEventHandlerUPP(carbonViewEventUPP); +// carbonViewEventRef = NULL; +// carbonViewEventUPP = NULL; +// +// CloseComponent(carbonView); +// carbonView = NULL; +// } +// +// err = RemoveEventHandler(eventHandler); +// DisposeEventHandlerUPP(eventUPP); +// +// CFRelease(effectWRef); +// } +// +// DisposeNibReference(nibRef); +// } } diff --git a/macosx/mac-cart.h b/macosx/mac-cart.h index 37b271f7..d908ffc3 100755 --- a/macosx/mac-cart.h +++ b/macosx/mac-cart.h @@ -15,21 +15,21 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_cart_h_ #define _mac_cart_h_ -bool8 NavOpenROMImage (FSRef *); -bool8 NavBeginOpenROMImageSheet (WindowRef, CFStringRef); -bool8 NavEndOpenROMImageSheet (FSRef *); -bool8 NavBeginChooseFolderSheet (WindowRef); -bool8 NavEndChooseFolderSheet (FSRef *); -bool8 NavFreezeTo (char *); -bool8 NavDefrostFrom (char *); -bool8 NavRecordMovieTo (char *); -bool8 NavPlayMovieFrom (char *); -bool8 NavQTMovieRecordTo (char *); +#import + +NSURL *NavOpenROMImage (); +NSURL *NavChooseFolderSheet (NSWindow *); +NSURL *NavFreezeTo (); +NSURL *NavDefrostFrom (); +NSURL *NavRecordMovieTo (); +NSURL *NavPlayMovieFrom (); +NSURL *NavQTMovieRecordTo (); #endif diff --git a/macosx/mac-cart.mm b/macosx/mac-cart.mm index d23d34a4..38adfea0 100755 --- a/macosx/mac-cart.mm +++ b/macosx/mac-cart.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -31,7 +32,6 @@ #import "mac-prefix.h" #import "mac-dialog.h" #import "mac-os.h" -#import "mac-quicktime.h" #import "mac-screenshot.h" #import "mac-snes9x.h" #import "mac-stringtools.h" @@ -39,9 +39,7 @@ typedef struct { - NavDialogRef nref; - WindowRef parent; - FSRef ref; + NSURL *ref; Boolean reply; char name[PATH_MAX + 1]; #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT @@ -54,34 +52,11 @@ typedef struct extern wchar_t macRecordWChar[MOVIE_MAX_METADATA]; -static NavEventUPP gSheetEventUPP; -static NavObjectFilterUPP gSheetFilterUPP; -static NavState gSheetNav; -static NSAutoreleasePool *gPool; -static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH; - -static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal Boolean NavOpenCartFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -static pascal Boolean NavDefrostFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -static pascal Boolean NavPlayMovieFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void GlobalPointToWindowLocalPoint (Point *, WindowRef); -static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -#endif -#ifdef MAC_TIGER_PANTHER_SUPPORT -static pascal Boolean NavDefrostFromPreview (NavCBRecPtr, NavCallBackUserData); -static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData); -#endif - +static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH; @interface NavController : NSObject - (id) init; -- (void) dealloc; - (IBAction) handleCompressButton: (id) sender; @end @@ -94,2183 +69,772 @@ static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData) return (self); } -- (void) dealloc -{ - [super dealloc]; -} - - (IBAction) handleCompressButton: (id) sender { - MacQTVideoConfig(); + //MacQTVideoConfig(); } @end -@interface NSView (HICocoaViewDummy) -- (void) setNeedsDisplayOnHICocoaViewDummy; -@end -@implementation NSView (HICocoaViewDummy) -+ (void) initialize +NSURL *NavOpenROMImage () { - /* Add a dummy instance method to make compatible with 10.10 or later */ - if (self == [NSView self]) { - SEL sel = @selector(setNeedsDisplayOnHICocoaView); - if (![NSView instancesRespondToSelector:sel]) { - Method m = class_getInstanceMethod([NSView class], @selector(setNeedsDisplayOnHICocoaViewDummy)); - IMP imp = method_getImplementation(m); - class_addMethod([NSView class], sel, imp, "v@"); - } - } -} -- (void) setNeedsDisplayOnHICocoaViewDummy{} -@end + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + openPanel.title = NSLocalizedString(@"OpenROMMes", @"Open"); + openPanel.allowsMultipleSelection = NO; + NSView *view; + NSTextField *txtM, *txtI, *txtV, *txtH; + NSPopUpButton *popM, *popI, *popV, *popH; + NSArray *aryM, *aryI, *aryV, *aryH; -bool8 NavOpenROMImage (FSRef *ref) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; + view = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; + aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; + aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; + aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; + aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); + CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); + CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); + CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); + CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); + CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); + CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); + CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); + CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - err = CreateWindowFromNib(nav.customNib, CFSTR("OpenROM"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } + [txtM setAlignment: NSTextAlignmentRight]; + [txtI setAlignment: NSTextAlignmentRight]; + [txtV setAlignment: NSTextAlignmentRight]; + [txtH setAlignment: NSTextAlignmentRight]; - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; + [popM selectItemAtIndex: romDetect ]; + [popI selectItemAtIndex: interleaveDetect]; + [popV selectItemAtIndex: videoDetect ]; + [popH selectItemAtIndex: headerDetect ]; - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif + NSModalResponse response = [openPanel runModal]; - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 3; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = CFCopyLocalizedString(CFSTR("OpenROMMes"), "Open"); - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; + if ( response == NSModalResponseOK ) + { + romDetect = [popM indexOfSelectedItem]; + interleaveDetect = [popI indexOfSelectedItem]; + videoDetect = [popV indexOfSelectedItem]; + headerDetect = [popH indexOfSelectedItem]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavOpenCartEventHandler : NavGenericOpenEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - filterUPP = NewNavObjectFilterUPP(NavOpenCartFilter); + return openPanel.URL; + } - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSTextField *txtM, *txtI, *txtV, *txtH; - NSPopUpButton *popM, *popI, *popV, *popH; - NSArray *aryM, *aryI, *aryV, *aryH; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)] autorelease]; - - aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; - aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; - aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; - aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - - CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); - CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); - CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); - CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); - CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); - CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); - CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); - CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - - [txtM setAlignment: NSRightTextAlignment]; - [txtI setAlignment: NSRightTextAlignment]; - [txtV setAlignment: NSRightTextAlignment]; - [txtH setAlignment: NSRightTextAlignment]; - - [popM selectItemAtIndex: romDetect ]; - [popI selectItemAtIndex: interleaveDetect]; - [popV selectItemAtIndex: videoDetect ]; - [popH selectItemAtIndex: headerDetect ]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - romDetect = [popM indexOfSelectedItem]; - interleaveDetect = [popI indexOfSelectedItem]; - videoDetect = [popV indexOfSelectedItem]; - headerDetect = [popH indexOfSelectedItem]; - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(dialogOptions.windowTitle); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - *ref = nav.ref; - return (true); - } - else - return (false); - } + return nil; } -bool8 NavBeginOpenROMImageSheet (WindowRef parent, CFStringRef mes) +NSURL *NavOpenROMImageSheet (NSWindow *parent, NSString *mes) { - OSStatus err; - NavDialogCreationOptions dialogOptions; + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + openPanel.title = NSLocalizedString(@"OpenROMMes", @"Open"); + openPanel.allowsMultipleSelection = NO; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; + NSView *view; + NSTextField *txtM, *txtI, *txtV, *txtH; + NSPopUpButton *popM, *popI, *popV, *popH; + NSArray *aryM, *aryI, *aryV, *aryH; - err = CreateNibReference(kMacS9XCFString, &(gSheetNav.customNib)); - if (err) - return (false); + view = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)]; - err = CreateWindowFromNib(gSheetNav.customNib, CFSTR("OpenROM"), &(gSheetNav.customWindow)); - if (err) - { - DisposeNibReference(gSheetNav.customNib); - return (false); - } + aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; + aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; + aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; + aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - GetWindowBounds(gSheetNav.customWindow, kWindowContentRgn, &rct); - gSheetNav.customWidth = rct.right - rct.left; - gSheetNav.customHeight = rct.bottom - rct.top; + CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); + CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); + CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); + CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); + CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); + CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); + CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); + CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - HIViewFindByID(HIViewGetRoot(gSheetNav.customWindow), cid, &(gSheetNav.customPane)); - } -#endif + [txtM setAlignment: NSTextAlignmentRight]; + [txtI setAlignment: NSTextAlignmentRight]; + [txtV setAlignment: NSTextAlignmentRight]; + [txtH setAlignment: NSTextAlignmentRight]; - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 3; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = CFCopyLocalizedString(CFSTR("OpenROMMes"), "Open"); - dialogOptions.message = mes; - dialogOptions.modality = kWindowModalityWindowModal; - dialogOptions.parentWindow = parent; - gSheetNav.parent = parent; + [popM selectItemAtIndex: romDetect ]; + [popI selectItemAtIndex: interleaveDetect]; + [popV selectItemAtIndex: videoDetect ]; + [popH selectItemAtIndex: headerDetect ]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - gSheetEventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavOpenCartEventHandler : NavGenericOpenEventHandler); -#else - gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - gSheetFilterUPP = NewNavObjectFilterUPP(NavOpenCartFilter); + NSModalResponse response = [openPanel runModal]; - err = NavCreateChooseFileDialog(&dialogOptions, NULL, gSheetEventUPP, NULL, gSheetFilterUPP, &gSheetNav, &(gSheetNav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSView *view; - NSTextField *txtM, *txtI, *txtV, *txtH; - NSArray *aryM, *aryI, *aryV, *aryH; + if ( response == NSModalResponseOK ) + { + romDetect = [popM indexOfSelectedItem]; + interleaveDetect = [popI indexOfSelectedItem]; + videoDetect = [popV indexOfSelectedItem]; + headerDetect = [popH indexOfSelectedItem]; - gPool = [[NSAutoreleasePool alloc] init]; + return openPanel.URL; + } - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)] autorelease]; - - aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; - aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; - aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; - aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - - CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); - CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); - CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); - CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); - CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &gPopM); - CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &gPopI); - CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &gPopV); - CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &gPopH); - - [txtM setAlignment: NSRightTextAlignment]; - [txtI setAlignment: NSRightTextAlignment]; - [txtV setAlignment: NSRightTextAlignment]; - [txtH setAlignment: NSRightTextAlignment]; - - [gPopM selectItemAtIndex: romDetect ]; - [gPopI selectItemAtIndex: interleaveDetect]; - [gPopV selectItemAtIndex: videoDetect ]; - [gPopH selectItemAtIndex: headerDetect ]; - - [(NSOpenPanel *) gSheetNav.nref setAccessoryView: view]; - - err = NavDialogRun(gSheetNav.nref); - if (err) - { - [gPool release]; - NavDialogDispose(gSheetNav.nref); - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - return (false); - } - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(gSheetNav.nref); - if (err) - { - NavDialogDispose(gSheetNav.nref); - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - return (false); - } - } - #endif - } - else - { - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - } - #endif - return (false); - } - - CFRelease(dialogOptions.windowTitle); - return (true); + return nil; } -bool8 NavEndOpenROMImageSheet (FSRef *ref) +NSURL *NavFreezeTo () { - if (systemVersion >= 0x1060) - { - romDetect = [gPopM indexOfSelectedItem]; - interleaveDetect = [gPopI indexOfSelectedItem]; - videoDetect = [gPopV indexOfSelectedItem]; - headerDetect = [gPopH indexOfSelectedItem]; - - [gPool release]; - } - - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - } -#endif - - if (gSheetNav.reply) - { - *ref = gSheetNav.ref; - return (true); - } - else - return (false); +// OSStatus err; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("FreezeToPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("FreezeToMes"), "Freeze"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".frz", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 4; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +// +// err = NavCreatePutFileDialog(&dialogOptions, 'SAVE', '~9X~', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavFreezeTo (char *path) +NSURL *NavDefrostFrom () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("FreezeToPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("FreezeToMes"), "Freeze"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".frz", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 4; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); - - err = NavCreatePutFileDialog(&dialogOptions, 'SAVE', '~9X~', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavObjectFilterUPP filterUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// NavPreviewUPP previewUPP; +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("DefrostFromPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("DefrostFromMes"), "Defrost"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 5; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +// eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +// filterUPP = NewNavObjectFilterUPP(NavDefrostFromFilter); +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// previewUPP = NewNavPreviewUPP(NavDefrostFromPreview); +//#endif +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); +//#else +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); +//#endif +// if (err == noErr) +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// DisposeNavPreviewUPP(previewUPP); +//#endif +// DisposeNavObjectFilterUPP(filterUPP); +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavDefrostFrom (char *path) +NSURL *NavRecordMovieTo () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; -#ifdef MAC_TIGER_PANTHER_SUPPORT - NavPreviewUPP previewUPP; -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("DefrostFromPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("DefrostFromMes"), "Defrost"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 5; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); - filterUPP = NewNavObjectFilterUPP(NavDefrostFromFilter); -#ifdef MAC_TIGER_PANTHER_SUPPORT - previewUPP = NewNavPreviewUPP(NavDefrostFromPreview); -#endif - -#ifdef MAC_TIGER_PANTHER_SUPPORT - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); -#else - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); -#endif - if (err == noErr) - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - -#ifdef MAC_TIGER_PANTHER_SUPPORT - DisposeNavPreviewUPP(previewUPP); -#endif - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - - if (err) - return (false); - else - { - if (nav.reply) - { - err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("RecordSMV"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("RecordToPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("RecordToMes"), "Record"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".smv", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 6; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavRecordMovieToEventHandler : NavGenericSaveEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +//#endif +// +// err = NavCreatePutFileDialog(&dialogOptions, 'SMOV', '~9X~', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSTextField *text; +// NSButton *cb1p, *cb2p, *cb3p, *cb4p, *cb5p, *cbre; +// NSString *comment; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 54)] autorelease]; +// +// CocoaAddStatTextToView(view, @"RecordSMV6", 5, 33, 104, 14, NULL); +// CocoaAddStatTextToView(view, @"RecordSMV7", 5, 8, 63, 14, NULL); +// CocoaAddEditTextToView(view, @"", 74, 6, 351, 19, &text); +// CocoaAddCheckBoxToView(view, @"RecordSMV1", 112, 31, 29, 18, &cb1p); +// CocoaAddCheckBoxToView(view, @"RecordSMV2", 150, 31, 29, 18, &cb2p); +// CocoaAddCheckBoxToView(view, @"RecordSMV3", 188, 31, 29, 18, &cb3p); +// CocoaAddCheckBoxToView(view, @"RecordSMV4", 226, 31, 29, 18, &cb4p); +// CocoaAddCheckBoxToView(view, @"RecordSMV5", 264, 31, 29, 18, &cb5p); +// CocoaAddCheckBoxToView(view, @"RecordSMV8", 356, 31, 51, 18, &cbre); +// +// [cb1p setState: (macRecordFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cb2p setState: (macRecordFlag & (1 << 1) ? NSOnState : NSOffState)]; +// [cb3p setState: (macRecordFlag & (1 << 2) ? NSOnState : NSOffState)]; +// [cb4p setState: (macRecordFlag & (1 << 3) ? NSOnState : NSOffState)]; +// [cb5p setState: (macRecordFlag & (1 << 4) ? NSOnState : NSOffState)]; +// [cbre setState: (macRecordFlag & (1 << 5) ? NSOnState : NSOffState)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macRecordFlag = 0; +// macRecordFlag |= ((([cb1p state] == NSOnState) ? 1 : 0) << 0); +// macRecordFlag |= ((([cb2p state] == NSOnState) ? 1 : 0) << 1); +// macRecordFlag |= ((([cb3p state] == NSOnState) ? 1 : 0) << 2); +// macRecordFlag |= ((([cb4p state] == NSOnState) ? 1 : 0) << 3); +// macRecordFlag |= ((([cb5p state] == NSOnState) ? 1 : 0) << 4); +// macRecordFlag |= ((([cbre state] == NSOnState) ? 1 : 0) << 5); +// +// comment = [text stringValue]; +// if (comment) +// { +// NSUInteger cflen; +// unichar unistr[MOVIE_MAX_METADATA]; +// +// cflen = [comment length]; +// if (cflen > MOVIE_MAX_METADATA - 1) +// cflen = MOVIE_MAX_METADATA - 1; +// +// [comment getCharacters: unistr range: NSMakeRange(0, cflen)]; +// +// for (unsigned i = 0; i < cflen; i++) +// macRecordWChar[i] = (wchar_t) unistr[i]; +// macRecordWChar[cflen] = 0; +// } +// else +// macRecordWChar[0] = 0; +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavRecordMovieTo (char *path) +NSURL *NavPlayMovieFrom () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("RecordSMV"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("RecordToPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("RecordToMes"), "Record"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".smv", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 6; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavRecordMovieToEventHandler : NavGenericSaveEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); -#endif - - err = NavCreatePutFileDialog(&dialogOptions, 'SMOV', '~9X~', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSTextField *text; - NSButton *cb1p, *cb2p, *cb3p, *cb4p, *cb5p, *cbre; - NSString *comment; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 54)] autorelease]; - - CocoaAddStatTextToView(view, @"RecordSMV6", 5, 33, 104, 14, NULL); - CocoaAddStatTextToView(view, @"RecordSMV7", 5, 8, 63, 14, NULL); - CocoaAddEditTextToView(view, @"", 74, 6, 351, 19, &text); - CocoaAddCheckBoxToView(view, @"RecordSMV1", 112, 31, 29, 18, &cb1p); - CocoaAddCheckBoxToView(view, @"RecordSMV2", 150, 31, 29, 18, &cb2p); - CocoaAddCheckBoxToView(view, @"RecordSMV3", 188, 31, 29, 18, &cb3p); - CocoaAddCheckBoxToView(view, @"RecordSMV4", 226, 31, 29, 18, &cb4p); - CocoaAddCheckBoxToView(view, @"RecordSMV5", 264, 31, 29, 18, &cb5p); - CocoaAddCheckBoxToView(view, @"RecordSMV8", 356, 31, 51, 18, &cbre); - - [cb1p setState: (macRecordFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cb2p setState: (macRecordFlag & (1 << 1) ? NSOnState : NSOffState)]; - [cb3p setState: (macRecordFlag & (1 << 2) ? NSOnState : NSOffState)]; - [cb4p setState: (macRecordFlag & (1 << 3) ? NSOnState : NSOffState)]; - [cb5p setState: (macRecordFlag & (1 << 4) ? NSOnState : NSOffState)]; - [cbre setState: (macRecordFlag & (1 << 5) ? NSOnState : NSOffState)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macRecordFlag = 0; - macRecordFlag |= ((([cb1p state] == NSOnState) ? 1 : 0) << 0); - macRecordFlag |= ((([cb2p state] == NSOnState) ? 1 : 0) << 1); - macRecordFlag |= ((([cb3p state] == NSOnState) ? 1 : 0) << 2); - macRecordFlag |= ((([cb4p state] == NSOnState) ? 1 : 0) << 3); - macRecordFlag |= ((([cb5p state] == NSOnState) ? 1 : 0) << 4); - macRecordFlag |= ((([cbre state] == NSOnState) ? 1 : 0) << 5); - - comment = [text stringValue]; - if (comment) - { - NSUInteger cflen; - unichar unistr[MOVIE_MAX_METADATA]; - - cflen = [comment length]; - if (cflen > MOVIE_MAX_METADATA - 1) - cflen = MOVIE_MAX_METADATA - 1; - - [comment getCharacters: unistr range: NSMakeRange(0, cflen)]; - - for (unsigned i = 0; i < cflen; i++) - macRecordWChar[i] = (wchar_t) unistr[i]; - macRecordWChar[cflen] = 0; - } - else - macRecordWChar[0] = 0; - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavObjectFilterUPP filterUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// NavPreviewUPP previewUPP; +//#endif +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("PlaySMV"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("PlayFromPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("PlayFromMes"), "Play"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 6; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavPlayMovieFromEventHandler : NavGenericOpenEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +//#endif +// filterUPP = NewNavObjectFilterUPP(NavPlayMovieFromFilter); +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// previewUPP = NewNavPreviewUPP(NavPlayMovieFromPreview); +//#endif +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); +//#else +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); +//#endif +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSButton *cbro, *cbqt; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 326, 29)] autorelease]; +// +// CocoaAddCheckBoxToView(view, @"PlaySMV1", 5, 6, 76, 18, &cbro); +// CocoaAddCheckBoxToView(view, @"PlaySMV2", 100, 6, 220, 18, &cbqt); +// +// [cbro setState: (macPlayFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cbqt setState: (macPlayFlag & (1 << 1) ? NSOnState : NSOffState)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macPlayFlag = 0; +// macPlayFlag |= ((([cbro state] == NSOnState) ? 1 : 0) << 0); +// macPlayFlag |= ((([cbqt state] == NSOnState) ? 1 : 0) << 1); +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// DisposeNavPreviewUPP(previewUPP); +//#endif +// DisposeNavObjectFilterUPP(filterUPP); +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavPlayMovieFrom (char *path) +NSURL *NavQTMovieRecordTo () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; -#ifdef MAC_TIGER_PANTHER_SUPPORT - NavPreviewUPP previewUPP; -#endif - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("PlaySMV"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("PlayFromPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("PlayFromMes"), "Play"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 6; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavPlayMovieFromEventHandler : NavGenericOpenEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - filterUPP = NewNavObjectFilterUPP(NavPlayMovieFromFilter); -#ifdef MAC_TIGER_PANTHER_SUPPORT - previewUPP = NewNavPreviewUPP(NavPlayMovieFromPreview); -#endif - -#ifdef MAC_TIGER_PANTHER_SUPPORT - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); -#else - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); -#endif - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSButton *cbro, *cbqt; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 326, 29)] autorelease]; - - CocoaAddCheckBoxToView(view, @"PlaySMV1", 5, 6, 76, 18, &cbro); - CocoaAddCheckBoxToView(view, @"PlaySMV2", 100, 6, 220, 18, &cbqt); - - [cbro setState: (macPlayFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cbqt setState: (macPlayFlag & (1 << 1) ? NSOnState : NSOffState)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macPlayFlag = 0; - macPlayFlag |= ((([cbro state] == NSOnState) ? 1 : 0) << 0); - macPlayFlag |= ((([cbqt state] == NSOnState) ? 1 : 0) << 1); - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - -#ifdef MAC_TIGER_PANTHER_SUPPORT - DisposeNavPreviewUPP(previewUPP); -#endif - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("QTMovie"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("QTRecordPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("QTRecordMes"), "QT"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".mov", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 7; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavQTMovieRecordToEventHandler : NavGenericSaveEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +//#endif +// +// err = NavCreatePutFileDialog(&dialogOptions, 'MooV', 'TVOD', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSPopUpButton *fpop; +// NSButton *cbds, *cbov, *comp; +// NSArray *array; +// NavController *controller; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// controller = [[[NavController alloc] init] autorelease]; +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 31)] autorelease]; +// +// array = [NSArray arrayWithObjects: @"0", @"1", @"2", @"3", @"4", @"5", nil]; +// CocoaAddStatTextToView(view, @"QTRecord3", 185, 9, 70, 14, NULL); +// CocoaAddCheckBoxToView(view, @"QTRecord1", 5, 7, 85, 18, &cbds); +// CocoaAddCheckBoxToView(view, @"QTRecord2", 97, 7, 71, 18, &cbov); +// CocoaAddMPushBtnToView(view, @"QTRecord4", 313, 1, 117, 28, &comp); +// CocoaAddPopUpBtnToView(view, array, 255, 4, 50, 22, &fpop); +// +// [cbds setState: (macQTMovFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cbov setState: (macQTMovFlag & (1 << 1) ? NSOnState : NSOffState)]; +// [fpop selectItemAtIndex: (macQTMovFlag >> 8)]; +// +// [comp setTarget: controller]; +// [comp setAction: @selector(handleCompressButton:)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macQTMovFlag = 0; +// macQTMovFlag |= ((([cbds state] == NSOnState) ? 1 : 0) << 0); +// macQTMovFlag |= ((([cbov state] == NSOnState) ? 1 : 0) << 1); +// macQTMovFlag |= ([fpop indexOfSelectedItem] << 8); +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavQTMovieRecordTo (char *path) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("QTMovie"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("QTRecordPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("QTRecordMes"), "QT"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".mov", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 7; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavQTMovieRecordToEventHandler : NavGenericSaveEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); -#endif - - err = NavCreatePutFileDialog(&dialogOptions, 'MooV', 'TVOD', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSPopUpButton *fpop; - NSButton *cbds, *cbov, *comp; - NSArray *array; - NavController *controller; - - pool = [[NSAutoreleasePool alloc] init]; - - controller = [[[NavController alloc] init] autorelease]; - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 31)] autorelease]; - - array = [NSArray arrayWithObjects: @"0", @"1", @"2", @"3", @"4", @"5", nil]; - CocoaAddStatTextToView(view, @"QTRecord3", 185, 9, 70, 14, NULL); - CocoaAddCheckBoxToView(view, @"QTRecord1", 5, 7, 85, 18, &cbds); - CocoaAddCheckBoxToView(view, @"QTRecord2", 97, 7, 71, 18, &cbov); - CocoaAddMPushBtnToView(view, @"QTRecord4", 313, 1, 117, 28, &comp); - CocoaAddPopUpBtnToView(view, array, 255, 4, 50, 22, &fpop); - - [cbds setState: (macQTMovFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cbov setState: (macQTMovFlag & (1 << 1) ? NSOnState : NSOffState)]; - [fpop selectItemAtIndex: (macQTMovFlag >> 8)]; - - [comp setTarget: controller]; - [comp setAction: @selector(handleCompressButton:)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macQTMovFlag = 0; - macQTMovFlag |= ((([cbds state] == NSOnState) ? 1 : 0) << 0); - macQTMovFlag |= ((([cbov state] == NSOnState) ? 1 : 0) << 1); - macQTMovFlag |= ([fpop indexOfSelectedItem] << 8); - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } -} - -bool8 NavBeginChooseFolderSheet (WindowRef parent) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 8; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.modality = kWindowModalityWindowModal; - dialogOptions.parentWindow = parent; - gSheetNav.parent = parent; - - gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); - - err = NavCreateChooseFolderDialog(&dialogOptions, gSheetEventUPP, NULL, &gSheetNav, &(gSheetNav.nref)); - if (err == noErr) - { - err = NavDialogRun(gSheetNav.nref); - if (err) - { - NavDialogDispose(gSheetNav.nref); - DisposeNavEventUPP(gSheetEventUPP); - return (false); - } - } - else - { - DisposeNavEventUPP(gSheetEventUPP); - return (false); - } - - return (true); -} - -bool8 NavEndChooseFolderSheet (FSRef *ref) -{ - DisposeNavEventUPP(gSheetEventUPP); - - if (gSheetNav.reply) - { - *ref = gSheetNav.ref; - return (true); - } - else - return (false); -} - -static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - AEDesc resultDesc; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - break; - - case kNavCBStart: - nav->reply = false; - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - - if (nav->parent) - { - EventRef event; - HICommand cmd; - - cmd.commandID = 'NvDn'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, GetCurrentEventTime(), kEventAttributeUserEvent, &event); - if (err == noErr) - { - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = SendEventToWindow(event, nav->parent); - - ReleaseEvent(event); - } - } - - break; - } -} - -static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - AEDesc resultDesc; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - break; - - case kNavCBStart: - nav->reply = false; - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'CCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'CCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - cid.id = 101; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, romDetect + 1); - - cid.id = 102; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, interleaveDetect + 1); - - cid.id = 103; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, videoDetect + 1); - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, headerDetect + 1); - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - cid.signature = 'CCTL'; - - cid.id = 101; - HIViewFindByID(nav->customPane, cid, &ctl); - romDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 102; - HIViewFindByID(nav->customPane, cid, &ctl); - interleaveDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 103; - HIViewFindByID(nav->customPane, cid, &ctl); - videoDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - headerDetect = GetControl32BitValue(ctl) - 1; - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - - if (nav->parent) - { - EventRef event; - HICommand cmd; - - cmd.commandID = 'NvDn'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, GetCurrentEventTime(), kEventAttributeUserEvent, &event); - if (err == noErr) - { - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = SendEventToWindow(event, nav->parent); - - ReleaseEvent(event); - } - } - - break; - } -} - -static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'PCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'PCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macPlayFlag & (1 << (cid.id - 101))) ? true : false); - } - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - macPlayFlag = 0; - cid.signature = 'PCTL'; - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macPlayFlag |= (1 << (cid.id - 101)); - } - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - CFStringRef sref; - CFIndex cflen; - AEDesc resultDesc; - Point pt; - UniChar unistr[MOVIE_MAX_METADATA]; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'RCTL') - { - if (cid.id == 107) - { - HIViewRef tmp; - - err = GetKeyboardFocus(callBackParms->window, &tmp); - if ((err == noErr) && (tmp != ctl)) - err = SetKeyboardFocus(callBackParms->window, ctl, kControlFocusNextPart); - } - - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'RCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 106; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macRecordFlag & (1 << (cid.id - 101))) ? true : false); - } - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - break; - - case kNavCBAccept: - macRecordFlag = 0; - cid.signature = 'RCTL'; - - for (cid.id = 101; cid.id <= 106; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macRecordFlag |= (1 << (cid.id - 101)); - } - - cid.id = 107; - HIViewFindByID(nav->customPane, cid, &ctl); - CopyEditTextCFString(ctl, &sref); - if (sref) - { - cflen = CFStringGetLength(sref); - if (cflen > MOVIE_MAX_METADATA - 1) - cflen = MOVIE_MAX_METADATA - 1; - - CFStringGetCharacters(sref, CFRangeMake(0, cflen), unistr); - - for (int i = 0; i < cflen; i++) - macRecordWChar[i] = (wchar_t) unistr[i]; - macRecordWChar[cflen] = 0; - - CFRelease(sref); - } - else - macRecordWChar[0] = 0; - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'QCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - - if (cid.id == 103) - MacQTVideoConfig(); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'QCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macQTMovFlag & (1 << (cid.id - 101))) ? true : false); - } - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, ((macQTMovFlag & 0xFF00) >> 8) + 1); - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - macQTMovFlag = 0; - cid.signature = 'QCTL'; - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macQTMovFlag |= (1 << (cid.id - 101)); - } - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - macQTMovFlag |= ((GetControl32BitValue(ctl) - 1) << 8); - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} -#endif - -static pascal Boolean NavOpenCartFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask) && (unistr.length > 4)) - { - UInt16 i = unistr.length; - - if ((unistr.unicode[i - 4] == '.') && - (((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'r') && (unistr.unicode[i - 1] == 'm')) || - ((unistr.unicode[i - 3] == 'f') && (unistr.unicode[i - 2] == 'r') && (unistr.unicode[i - 1] == 'z')) || - ((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'm') && (unistr.unicode[i - 1] == 'v')) || - ((unistr.unicode[i - 3] == 'm') && (unistr.unicode[i - 2] == 'o') && (unistr.unicode[i - 1] == 'v')) || - ((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 'c')) || - ((unistr.unicode[i - 3] == 'r') && (unistr.unicode[i - 2] == 't') && (unistr.unicode[i - 1] == 'c')) || - ((unistr.unicode[i - 3] == 'd') && (unistr.unicode[i - 2] == 'a') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'o') && (unistr.unicode[i - 2] == 'u') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'c') && (unistr.unicode[i - 2] == 'h') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'i') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 's')) || - ((unistr.unicode[i - 3] == 'u') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 's')) || - ((unistr.unicode[i - 3] == 'p') && (unistr.unicode[i - 2] == 'n') && (unistr.unicode[i - 1] == 'g')))) - result = false; - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -static pascal Boolean NavDefrostFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - if (((FileInfo *) &catinfo.finderInfo)->fileType != 'SAVE') - { - UInt16 i = unistr.length; - - if (i < 4) - result = false; - else - if ((unistr.unicode[i - 4] == '.') && (unistr.unicode[i - 3] == 'f') && (unistr.unicode[i - 2] == 'r')) - result = true; - else - result = false; - } - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -static pascal Boolean NavPlayMovieFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - if (((FileInfo *) &catinfo.finderInfo)->fileType != 'SMOV') - { - UInt16 i = unistr.length; - - if (i < 4) - result = false; - else - if ((unistr.unicode[i - 4] == '.') && (unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'm') && (unistr.unicode[i - 1] == 'v')) - result = true; - else - result = false; - } - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -#ifdef MAC_TIGER_PANTHER_SUPPORT -static pascal Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - if (systemVersion >= 0x1050) - return (true); - - OSStatus err; - Boolean previewShowing, result = false; - - err = NavCustomControl(callBackParms->context, kNavCtlIsPreviewShowing, &previewShowing); - if ((err == noErr) && previewShowing) - { - AEDesc resultDesc; - - err = AECoerceDesc((AEDesc *) callBackParms->eventData.eventDataParms.param, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoContentMod, &catinfo, NULL, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - CFMutableStringRef sref; - - sref = CFStringCreateMutable(kCFAllocatorDefault, 0); - if (sref) - { - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - - err = UCConvertUTCDateTimeToCFAbsoluteTime(&(catinfo.contentModDate), &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - CFStringAppend(sref, datstr); - CFRelease(datstr); - CFRelease(format); - CFRelease(locale); - - CGContextRef ctx; - CGRect bounds; - CGrafPtr port; - Rect rct; - int rightedge; - - port = GetWindowPort(callBackParms->window); - GetWindowBounds(callBackParms->window, kWindowContentRgn, &rct); - - err = QDBeginCGContext(port, &ctx); - - rightedge = (callBackParms->previewRect.right < (rct.right - rct.left - 11)) ? callBackParms->previewRect.right : (rct.right - rct.left - 11); - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom); - bounds.size.width = (float) (rightedge - callBackParms->previewRect.left); - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top); - - CGContextClipToRect(ctx, bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - bounds.origin.x = (float) (callBackParms->previewRect.left + ((callBackParms->previewRect.right - callBackParms->previewRect.left - 128) >> 1)); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 120 - 25); - bounds.size.width = 128.0f; - bounds.size.height = 120.0f; - - DrawThumbnailResource(&ref, ctx, bounds); - - HIThemeTextInfo textinfo; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushTop; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushCenter; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationMiddle; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - bounds.origin.x = (float) (callBackParms->previewRect.left + 10); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 20); - bounds.size.width = (float) (callBackParms->previewRect.right - callBackParms->previewRect.left - 20); - bounds.size.height = 20.0f; - - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - - CGContextSynchronize(ctx); - - err = QDEndCGContext(port, &ctx); - - CFRelease(sref); - - result = true; - } - } - } - - AEDisposeDesc(&resultDesc); - } - } - - return (result); -} - -static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - if (systemVersion >= 0x1050) - return (true); - - OSStatus err; - Boolean previewShowing, result = false; - - err = NavCustomControl(callBackParms->context, kNavCtlIsPreviewShowing, &previewShowing); - if ((err == noErr) && previewShowing) - { - AEDesc resultDesc; - - err = AECoerceDesc((AEDesc *) callBackParms->eventData.eventDataParms.param, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - char path[PATH_MAX + 1]; - - err = FSRefMakePath(&ref, (unsigned char *) path, PATH_MAX); - if (err == noErr) - { - MovieInfo movinfo; - int r; - - r = S9xMovieGetInfo(path, &movinfo); - if (r == SUCCESS) - { - UTCDateTime utctime; - CGContextRef ctx; - CGRect bounds; - CGrafPtr port; - Rect rct; - CFStringRef sref; - UInt64 t; - int rightedge, border, width, l, sec, min, hr, n; - char cstr[256], cbuf[512]; - UniChar unistr[MOVIE_MAX_METADATA]; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevBorder"), "1"); - if (sref) - { - border = CFStringGetIntValue(sref); - CFRelease(sref); - } - else - border = 1; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevWidth"), "1"); - if (sref) - { - width = CFStringGetIntValue(sref); - CFRelease(sref); - } - else - width = 1; - - // Date - - t = (UInt64) movinfo.TimeCreated + ((365 * 66 + 17) * 24 * 60 * 60); - utctime.highSeconds = (UInt16) (t >> 32); - utctime.lowSeconds = (UInt32) (t & 0xFFFFFFFF); - utctime.fraction = 0; - - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - Boolean e; - - err = UCConvertUTCDateTimeToCFAbsoluteTime(&utctime, &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterNoStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - e = CFStringGetCString(datstr, cbuf, sizeof(cbuf), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - strcat(cbuf, "\n"); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterNoStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - e = CFStringGetCString(datstr, cstr, sizeof(cstr), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - strcat(cbuf, cstr); - strcat(cbuf, "\n"); - CFRelease(locale); - - // Length - - l = (movinfo.LengthFrames + 30) / ((movinfo.Opts & MOVIE_OPT_PAL) ? 50 : 60); - sec = l % 60; l /= 60; - min = l % 60; l /= 60; - hr = l % 60; - - sprintf(cstr, "%02d:%02d:%02d\n", hr, min, sec); - strcat(cbuf, cstr); - - // Frames - - sprintf(cstr, "%d\n", movinfo.LengthFrames); - strcat(cbuf, cstr); - - // - - port = GetWindowPort(callBackParms->window); - GetWindowBounds(callBackParms->window, kWindowContentRgn, &rct); - - err = QDBeginCGContext(port, &ctx); - - rightedge = (callBackParms->previewRect.right < (rct.right - rct.left - 11)) ? callBackParms->previewRect.right : (rct.right - rct.left - 11); - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom); - bounds.size.width = (float) (rightedge - callBackParms->previewRect.left); - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top); - - CGContextClipToRect(ctx, bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - // Thumbnail - - bounds.origin.x = (float) (callBackParms->previewRect.left + ((callBackParms->previewRect.right - callBackParms->previewRect.left - 128) >> 1)); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 120 - 25); - bounds.size.width = 128.0f; - bounds.size.height = 120.0f; - - DrawThumbnailResource(&ref, ctx, bounds); - - // Text - - HIThemeTextInfo textinfo; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushTop; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationMiddle; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - bounds.origin.x = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - width) >> 1) + callBackParms->previewRect.left + border + 7); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 60); - bounds.size.width = (float) callBackParms->previewRect.right - bounds.origin.x; - bounds.size.height = 60.0f; - - sref = CFStringCreateWithCString(kCFAllocatorDefault, cbuf, CFStringGetSystemEncoding()); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushLeft; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 60); - bounds.size.width = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - width) >> 1) + border); - bounds.size.height = 60.0f; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevMes"), "MovieInfo"); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushRight; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - bounds.origin.x = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - 132) >> 1) + callBackParms->previewRect.left); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom + 10); - bounds.size.width = 132.0f; - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top - 223 - 10); - - n = wcslen(movinfo.Metadata); - - for (int i = 0; i < n; i++) - unistr[i] = (UniChar) movinfo.Metadata[i]; - unistr[n] = 0; - - sref = CFStringCreateWithCharacters(kCFAllocatorDefault, unistr, n); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushLeft; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - CGContextSynchronize(ctx); - - err = QDEndCGContext(port, &ctx); - - result = true; - } - } - } - - AEDisposeDesc(&resultDesc); - } - } - - return (result); -} -#endif - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void GlobalPointToWindowLocalPoint (Point *pt, WindowRef window) -{ - if (systemVersion >= 0x1040) - { - HIViewRef view; - HIPoint cpt = CGPointMake((float) pt->h, (float) pt->v); - - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &view); - HIPointConvert(&cpt, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, view); - pt->h = (short) cpt.x; - pt->v = (short) cpt.y; - } -#ifdef MAC_PANTHER_SUPPORT - else - QDGlobalToLocalPoint(GetWindowPort(window), pt); -#endif -} -#endif +//bool8 NavChooseFolderSheet (WindowRef parent) +//{ +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 8; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.modality = kWindowModalityWindowModal; +// dialogOptions.parentWindow = parent; +// gSheetNav.parent = parent; +// +// gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +// +// err = NavCreateChooseFolderDialog(&dialogOptions, gSheetEventUPP, NULL, &gSheetNav, &(gSheetNav.nref)); +// if (err == noErr) +// { +// err = NavDialogRun(gSheetNav.nref); +// if (err) +// { +// NavDialogDispose(gSheetNav.nref); +// DisposeNavEventUPP(gSheetEventUPP); +// return (false); +// } +// } +// else +// { +// DisposeNavEventUPP(gSheetEventUPP); +// return (false); +// } +// +// return (true); +//} +// +//bool8 NavEndChooseFolderSheet (FSRef *ref) +//{ +// DisposeNavEventUPP(gSheetEventUPP); +// +// if (gSheetNav.reply) +// { +// *ref = gSheetNav.ref; +// return (true); +// } +// else +// return (false); +//} diff --git a/macosx/mac-cheat.cpp b/macosx/mac-cheat.cpp deleted file mode 100755 index 27da88cc..00000000 --- a/macosx/mac-cheat.cpp +++ /dev/null @@ -1,594 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" -#include "cheats.h" - -#define __STDC_FORMAT_MACROS -#include - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-stringtools.h" -#include "mac-cheat.h" - -#define kDataBrowser 'BRSR' -#define kCmCheckBox 'CHK_' -#define kCmAddress 'ADDR' -#define kCmValue 'VALU' -#define kCmDescription 'DESC' -#define kNewButton 'NEW_' -#define kDelButton 'DEL_' -#define kAllButton 'ALL_' - -extern SCheatData Cheat; - -typedef struct -{ - uint32 id; - uint32 address; - uint8 value; - bool8 valid; - bool8 enabled; - char description[22]; -} CheatItem; - -static WindowRef wRef; -static HIViewRef dbRef; -static CheatItem citem[MAC_MAX_CHEATS]; -static uint32 numofcheats; - -static void InitCheatItems (void); -static void ImportCheatItems (void); -static void DetachCheatItems (void); -static void AddCheatItem (void); -static void DeleteCheatItem (void); -static void EnableAllCheatItems (void); -static pascal void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification); -static pascal Boolean DBCompareCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemID, DataBrowserPropertyID); -static pascal OSStatus DBClientDataCallback (HIViewRef, DataBrowserItemID, DataBrowserPropertyID, DataBrowserItemDataRef, Boolean); -static pascal OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *); - - -static void InitCheatItems (void) -{ - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - citem[i].id = i + 1; - citem[i].valid = false; - citem[i].enabled = false; - citem[i].address = 0; - citem[i].value = 0; - sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); - } -} - -static void ImportCheatItems (void) -{ - int cheat_num = std::min((int)Cheat.g.size(), MAC_MAX_CHEATS); - for (unsigned int i = 0; i < cheat_num; i++) - { - citem[i].valid = true; - citem[i].enabled = Cheat.g[i].enabled; - citem[i].address = Cheat.g[i].c[0].address; // mac dialog only supports one cheat per group at the moment - citem[i].value = Cheat.g[i].c[0].byte; - strncpy(citem[i].description, Cheat.g[i].name, 21); - citem[i].description[21] = '\0'; - } -} - -static void DetachCheatItems (void) -{ - S9xDeleteCheats(); - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - if (citem[i].valid) - { - char code[10]; - snprintf(code, 10, "%x=%x", citem[i].address, citem[i].value); - int index = S9xAddCheatGroup(citem[i].description, code); - if(citem[i].enabled && index >= 0) - S9xEnableCheatGroup(index); - } - } -} - -void ConfigureCheat (void) -{ - if (!cartOpen) - return; - - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - err = CreateWindowFromNib(nibRef, CFSTR("CheatEntry"), &wRef); - if (err == noErr) - { - DataBrowserCallbacks callbacks; - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec events[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }; - HIViewRef ctl, root; - HIViewID cid; - - root = HIViewGetRoot(wRef); - cid.id = 0; - cid.signature = kDataBrowser; - HIViewFindByID(root, cid, &dbRef); - - #ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - { - HISize minSize; - Rect rct; - - GetWindowBounds(wRef, kWindowContentRgn, &rct); - minSize.width = (float) (rct.right - rct.left); - minSize.height = (float) (rct.bottom - rct.top ); - err = SetWindowResizeLimits(wRef, &minSize, NULL); - } - #endif - - callbacks.version = kDataBrowserLatestCallbacks; - err = InitDataBrowserCallbacks(&callbacks); - callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(DBClientDataCallback); - callbacks.u.v1.itemCompareCallback = NewDataBrowserItemCompareUPP(DBCompareCallBack); - callbacks.u.v1.itemNotificationCallback = NewDataBrowserItemNotificationUPP(DBItemNotificationCallBack); - err = SetDataBrowserCallbacks(dbRef, &callbacks); - - if (systemVersion >= 0x1040) - err = DataBrowserChangeAttributes(dbRef, kDataBrowserAttributeListViewAlternatingRowColors, kDataBrowserAttributeNone); - - InitCheatItems(); - ImportCheatItems(); - - DataBrowserItemID *id; - - id = new DataBrowserItemID[MAC_MAX_CHEATS]; - if (!id) - QuitWithFatalError(0, "cheat 01"); - - numofcheats = 0; - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - if (citem[i].valid) - { - id[numofcheats] = citem[i].id; - numofcheats++; - } - } - - if (numofcheats) - err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, numofcheats, id, kDataBrowserItemNoProperty); - - delete [] id; - - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - if (numofcheats == MAC_MAX_CHEATS) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - if (numofcheats == 0) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - - cid.signature = kDelButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - - eUPP = NewEventHandlerUPP(CheatEventHandler); - err = InstallWindowEventHandler(wRef, eUPP, GetEventTypeCount(events), events, (void *) wRef, &eref); - - err = SetKeyboardFocus(wRef, dbRef, kControlFocusNextPart); - - MoveWindowPosition(wRef, kWindowCheatEntry, true); - ShowWindow(wRef); - err = RunAppModalLoopForWindow(wRef); - HideWindow(wRef); - SaveWindowPosition(wRef, kWindowCheatEntry); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - - DisposeDataBrowserItemNotificationUPP(callbacks.u.v1.itemNotificationCallback); - DisposeDataBrowserItemCompareUPP(callbacks.u.v1.itemCompareCallback); - DisposeDataBrowserItemDataUPP(callbacks.u.v1.itemDataCallback); - - CFRelease(wRef); - - DetachCheatItems(); - } - - DisposeNibReference(nibRef); - } -} - -static void AddCheatItem (void) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - DataBrowserItemID id[1]; - unsigned int i; - - if (numofcheats == MAC_MAX_CHEATS) - return; - - for (i = 0; i < MAC_MAX_CHEATS; i++) - if (citem[i].valid == false) - break; - - if (i == MAC_MAX_CHEATS) - return; - - numofcheats++; - citem[i].valid = true; - citem[i].enabled = false; - citem[i].address = 0; - citem[i].value = 0; - sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); - - id[0] = citem[i].id; - err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty); - err = RevealDataBrowserItem(dbRef, id[0], kCmAddress, true); - - root = HIViewGetRoot(wRef); - cid.id = 0; - - if (numofcheats == MAC_MAX_CHEATS) - { - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - } - - if (numofcheats) - { - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - err = ActivateControl(ctl); - } -} - -static void DeleteCheatItem (void) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - Handle selectedItems; - ItemCount selectionCount; - - selectedItems = NewHandle(0); - if (!selectedItems) - return; - - err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems); - selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID)); - - if (selectionCount == 0) - { - DisposeHandle(selectedItems); - return; - } - - err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty); - - for (unsigned int i = 0; i < selectionCount; i++) - { - citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid = false; - citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false; - numofcheats--; - } - - DisposeHandle(selectedItems); - - root = HIViewGetRoot(wRef); - cid.id = 0; - - if (numofcheats < MAC_MAX_CHEATS) - { - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - err = ActivateControl(ctl); - } - - if (numofcheats == 0) - { - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - } -} - -static void EnableAllCheatItems (void) -{ - OSStatus err; - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - if (citem[i].valid) - citem[i].enabled = true; - - err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox); -} - -static pascal OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue) -{ - OSStatus err, result; - CFStringRef str; - Boolean r; - uint32 address; - uint8 value; - char code[256]; - - result = noErr; - - switch (property) - { - case kCmCheckBox: - ThemeButtonValue buttonValue; - - if (changeValue) - { - err = GetDataBrowserItemDataButtonValue(itemData, &buttonValue); - citem[itemID - 1].enabled = (buttonValue == kThemeButtonOn) ? true : false; - } - else - err = SetDataBrowserItemDataButtonValue(itemData, citem[itemID - 1].enabled ? kThemeButtonOn : kThemeButtonOff); - - break; - - case kCmAddress: - if (changeValue) - { - err = GetDataBrowserItemDataText(itemData, &str); - r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); - CFRelease(str); - if (r) - { - Boolean translated; - - if (S9xProActionReplayToRaw(code, address, value) == NULL) - translated = true; - else - if (S9xGameGenieToRaw(code, address, value) == NULL) - translated = true; - else - { - translated = false; - if (sscanf(code, "%" SCNx32, &address) != 1) - address = 0; - else - address &= 0xFFFFFF; - } - - citem[itemID - 1].address = address; - sprintf(code, "%06" PRIX32, address); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - - if (translated) - { - DataBrowserItemID id[1]; - - citem[itemID - 1].value = value; - id[0] = itemID; - err = UpdateDataBrowserItems(browser, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty, kCmValue); - } - } - } - else - { - sprintf(code, "%06" PRIX32, citem[itemID - 1].address); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kCmValue: - if (changeValue) - { - err = GetDataBrowserItemDataText(itemData, &str); - r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); - CFRelease(str); - if (r) - { - uint32 byte; - - if (sscanf(code, "%" SCNx32, &byte) == 1) - citem[itemID - 1].value = (uint8) byte; - else - { - citem[itemID - 1].value = 0; - err = SetDataBrowserItemDataText(itemData, CFSTR("00")); - } - } - } - else - { - sprintf(code, "%02" PRIX8, citem[itemID - 1].value); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kCmDescription: - if (changeValue) - { - code[0] = 0; - err = GetDataBrowserItemDataText(itemData, &str); - strcpy(code, GetMultiByteCharacters(str, 19)); - CFRelease(str); - - if (code[0] == 0) - { - code[0] = ' '; - code[1] = 0; - } - - strcpy(citem[itemID - 1].description, code); - } - else - { - str = CFStringCreateWithCString(kCFAllocatorDefault, citem[itemID - 1].description, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kDataBrowserItemIsActiveProperty: - err = SetDataBrowserItemDataBooleanValue(itemData, true); - break; - - case kDataBrowserItemIsEditableProperty: - err = SetDataBrowserItemDataBooleanValue(itemData, true); - break; - - default: - result = errDataBrowserPropertyNotSupported; - } - - return (result); -} - -static pascal Boolean DBCompareCallBack (HIViewRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty) -{ - Boolean result = false; - - switch (sortProperty) - { - case kCmCheckBox: - result = (citem[itemOne - 1].enabled && !(citem[itemTwo - 1].enabled)) ? true : false; - break; - - case kCmAddress: - result = (citem[itemOne - 1].address < citem[itemTwo - 1].address) ? true : false; - break; - - case kCmValue: - result = (citem[itemOne - 1].value < citem[itemTwo - 1].value) ? true : false; - break; - - case kCmDescription: - result = (strcmp(citem[itemOne - 1].description, citem[itemTwo - 1].description) < 0) ? true : false; - } - - return (result); -} - -static pascal void DBItemNotificationCallBack (HIViewRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message) -{ - OSStatus err; - HIViewRef ctl; - HIViewID cid = { kDelButton, 0 }; - ItemCount selectionCount; - - switch (message) - { - case kDataBrowserSelectionSetChanged: - HIViewFindByID(HIViewGetRoot(wRef), cid, &ctl); - - err = GetDataBrowserItemCount(browser, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, &selectionCount); - if (selectionCount == 0) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - } -} - -static pascal OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef; - - tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case kNewButton: - AddCheatItem(); - result = noErr; - break; - - case kDelButton: - DeleteCheatItem(); - result = noErr; - break; - - case kAllButton: - EnableAllCheatItems(); - result = noErr; - } - } - } - } - - return (result); -} diff --git a/macosx/mac-cheat.h b/macosx/mac-cheat.h index fed7c33e..bef15b91 100755 --- a/macosx/mac-cheat.h +++ b/macosx/mac-cheat.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cheat.mm b/macosx/mac-cheat.mm new file mode 100755 index 00000000..f0baf09a --- /dev/null +++ b/macosx/mac-cheat.mm @@ -0,0 +1,551 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" +#include "cheats.h" + +#define __STDC_FORMAT_MACROS +#include + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-stringtools.h" +#include "mac-cheat.h" + +#define kDataBrowser 'BRSR' +#define kCmCheckBox 'CHK_' +#define kCmAddress 'ADDR' +#define kCmValue 'VALU' +#define kCmDescription 'DESC' +#define kNewButton 'NEW_' +#define kDelButton 'DEL_' +#define kAllButton 'ALL_' + +extern SCheatData Cheat; + +typedef struct +{ + uint32 id; + uint32 address; + uint8 value; + bool8 valid; + bool8 enabled; + char description[22]; +} CheatItem; + +static WindowRef wRef; +static HIViewRef dbRef; +static CheatItem citem[MAC_MAX_CHEATS]; +static uint32 numofcheats; + +static void InitCheatItems (void); +static void ImportCheatItems (void); +static void DetachCheatItems (void); +static void AddCheatItem (void); +static void DeleteCheatItem (void); +static void EnableAllCheatItems (void); +static void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification); +static OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *); + + +static void InitCheatItems (void) +{ + for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) + { + citem[i].id = i + 1; + citem[i].valid = false; + citem[i].enabled = false; + citem[i].address = 0; + citem[i].value = 0; + sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); + } +} + +static void ImportCheatItems (void) +{ + int cheat_num = std::min((int)Cheat.g.size(), MAC_MAX_CHEATS); + for (unsigned int i = 0; i < cheat_num; i++) + { + citem[i].valid = true; + citem[i].enabled = Cheat.g[i].enabled; + citem[i].address = Cheat.g[i].c[0].address; // mac dialog only supports one cheat per group at the moment + citem[i].value = Cheat.g[i].c[0].byte; + strncpy(citem[i].description, Cheat.g[i].name, 21); + citem[i].description[21] = '\0'; + } +} + +static void DetachCheatItems (void) +{ + S9xDeleteCheats(); + + for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) + { + if (citem[i].valid) + { + char code[10]; + snprintf(code, 10, "%x=%x", citem[i].address, citem[i].value); + int index = S9xAddCheatGroup(citem[i].description, code); + if(citem[i].enabled && index >= 0) + S9xEnableCheatGroup(index); + } + } +} + +void ConfigureCheat (void) +{ + if (!cartOpen) + return; + +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// err = CreateWindowFromNib(nibRef, CFSTR("CheatEntry"), &wRef); +// if (err == noErr) +// { +// DataBrowserCallbacks callbacks; +// EventHandlerRef eref; +// EventHandlerUPP eUPP; +// EventTypeSpec events[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus }, +// { kEventClassWindow, kEventWindowClose } }; +// HIViewRef ctl, root; +// HIViewID cid; +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// cid.signature = kDataBrowser; +// HIViewFindByID(root, cid, &dbRef); +// +// #ifdef MAC_PANTHER_SUPPORT +// if (systemVersion < 0x1040) +// { +// HISize minSize; +// Rect rct; +// +// GetWindowBounds(wRef, kWindowContentRgn, &rct); +// minSize.width = (float) (rct.right - rct.left); +// minSize.height = (float) (rct.bottom - rct.top ); +// err = SetWindowResizeLimits(wRef, &minSize, NULL); +// } +// #endif +// +// callbacks.version = kDataBrowserLatestCallbacks; +// err = InitDataBrowserCallbacks(&callbacks); +// callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(DBClientDataCallback); +// callbacks.u.v1.itemCompareCallback = NewDataBrowserItemCompareUPP(DBCompareCallBack); +// callbacks.u.v1.itemNotificationCallback = NewDataBrowserItemNotificationUPP(DBItemNotificationCallBack); +// err = SetDataBrowserCallbacks(dbRef, &callbacks); +// +// if (systemVersion >= 0x1040) +// err = DataBrowserChangeAttributes(dbRef, kDataBrowserAttributeListViewAlternatingRowColors, kDataBrowserAttributeNone); +// +// InitCheatItems(); +// ImportCheatItems(); +// +// DataBrowserItemID *id; +// +// id = new DataBrowserItemID[MAC_MAX_CHEATS]; +// if (!id) +// QuitWithFatalError(@"cheat 01"); +// +// numofcheats = 0; +// +// for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) +// { +// if (citem[i].valid) +// { +// id[numofcheats] = citem[i].id; +// numofcheats++; +// } +// } +// +// if (numofcheats) +// err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, numofcheats, id, kDataBrowserItemNoProperty); +// +// delete [] id; +// +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// if (numofcheats == MAC_MAX_CHEATS) +// err = DeactivateControl(ctl); +// else +// err = ActivateControl(ctl); +// +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// if (numofcheats == 0) +// err = DeactivateControl(ctl); +// else +// err = ActivateControl(ctl); +// +// cid.signature = kDelButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// +// eUPP = NewEventHandlerUPP(CheatEventHandler); +// err = InstallWindowEventHandler(wRef, eUPP, GetEventTypeCount(events), events, (void *) wRef, &eref); +// +// err = SetKeyboardFocus(wRef, dbRef, kControlFocusNextPart); +// +// MoveWindowPosition(wRef, kWindowCheatEntry, true); +// ShowWindow(wRef); +// err = RunAppModalLoopForWindow(wRef); +// HideWindow(wRef); +// SaveWindowPosition(wRef, kWindowCheatEntry); +// +// err = RemoveEventHandler(eref); +// DisposeEventHandlerUPP(eUPP); +// +// DisposeDataBrowserItemNotificationUPP(callbacks.u.v1.itemNotificationCallback); +// DisposeDataBrowserItemCompareUPP(callbacks.u.v1.itemCompareCallback); +// DisposeDataBrowserItemDataUPP(callbacks.u.v1.itemDataCallback); +// +// CFRelease(wRef); +// +// DetachCheatItems(); +// } +// +// DisposeNibReference(nibRef); +// } +} + +static void AddCheatItem (void) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// DataBrowserItemID id[1]; +// unsigned int i; +// +// if (numofcheats == MAC_MAX_CHEATS) +// return; +// +// for (i = 0; i < MAC_MAX_CHEATS; i++) +// if (citem[i].valid == false) +// break; +// +// if (i == MAC_MAX_CHEATS) +// return; +// +// numofcheats++; +// citem[i].valid = true; +// citem[i].enabled = false; +// citem[i].address = 0; +// citem[i].value = 0; +// sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); +// +// id[0] = citem[i].id; +// err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty); +// err = RevealDataBrowserItem(dbRef, id[0], kCmAddress, true); +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// +// if (numofcheats == MAC_MAX_CHEATS) +// { +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// } +// +// if (numofcheats) +// { +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// err = ActivateControl(ctl); +// } +} + +static void DeleteCheatItem (void) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// Handle selectedItems; +// ItemCount selectionCount; +// +// selectedItems = NewHandle(0); +// if (!selectedItems) +// return; +// +// err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems); +// selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID)); +// +// if (selectionCount == 0) +// { +// DisposeHandle(selectedItems); +// return; +// } +// +// err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty); +// +// for (unsigned int i = 0; i < selectionCount; i++) +// { +// citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid = false; +// citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false; +// numofcheats--; +// } +// +// DisposeHandle(selectedItems); +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// +// if (numofcheats < MAC_MAX_CHEATS) +// { +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// err = ActivateControl(ctl); +// } +// +// if (numofcheats == 0) +// { +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// } +} + +static void EnableAllCheatItems (void) +{ +// OSStatus err; +// +// for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) +// if (citem[i].valid) +// citem[i].enabled = true; +// +// err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox); +} + +static OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue) +{ +// OSStatus err, result; +// CFStringRef str; +// Boolean r; +// uint32 address; +// uint8 value; +// char code[256]; +// +// result = noErr; +// +// switch (property) +// { +// case kCmCheckBox: +// ThemeButtonValue buttonValue; +// +// if (changeValue) +// { +// err = GetDataBrowserItemDataButtonValue(itemData, &buttonValue); +// citem[itemID - 1].enabled = (buttonValue == kThemeButtonOn) ? true : false; +// } +// else +// err = SetDataBrowserItemDataButtonValue(itemData, citem[itemID - 1].enabled ? kThemeButtonOn : kThemeButtonOff); +// +// break; +// +// case kCmAddress: +// if (changeValue) +// { +// err = GetDataBrowserItemDataText(itemData, &str); +// r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); +// CFRelease(str); +// if (r) +// { +// Boolean translated; +// +// if (S9xProActionReplayToRaw(code, address, value) == NULL) +// translated = true; +// else +// if (S9xGameGenieToRaw(code, address, value) == NULL) +// translated = true; +// else +// { +// translated = false; +// if (sscanf(code, "%" SCNx32, &address) != 1) +// address = 0; +// else +// address &= 0xFFFFFF; +// } +// +// citem[itemID - 1].address = address; +// sprintf(code, "%06" PRIX32, address); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// +// if (translated) +// { +// DataBrowserItemID id[1]; +// +// citem[itemID - 1].value = value; +// id[0] = itemID; +// err = UpdateDataBrowserItems(browser, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty, kCmValue); +// } +// } +// } +// else +// { +// sprintf(code, "%06" PRIX32, citem[itemID - 1].address); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kCmValue: +// if (changeValue) +// { +// err = GetDataBrowserItemDataText(itemData, &str); +// r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); +// CFRelease(str); +// if (r) +// { +// uint32 byte; +// +// if (sscanf(code, "%" SCNx32, &byte) == 1) +// citem[itemID - 1].value = (uint8) byte; +// else +// { +// citem[itemID - 1].value = 0; +// err = SetDataBrowserItemDataText(itemData, CFSTR("00")); +// } +// } +// } +// else +// { +// sprintf(code, "%02" PRIX8, citem[itemID - 1].value); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kCmDescription: +// if (changeValue) +// { +// code[0] = 0; +// err = GetDataBrowserItemDataText(itemData, &str); +// strcpy(code, GetMultiByteCharacters(str, 19)); +// CFRelease(str); +// +// if (code[0] == 0) +// { +// code[0] = ' '; +// code[1] = 0; +// } +// +// strcpy(citem[itemID - 1].description, code); +// } +// else +// { +// str = CFStringCreateWithCString(kCFAllocatorDefault, citem[itemID - 1].description, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kDataBrowserItemIsActiveProperty: +// err = SetDataBrowserItemDataBooleanValue(itemData, true); +// break; +// +// case kDataBrowserItemIsEditableProperty: +// err = SetDataBrowserItemDataBooleanValue(itemData, true); +// break; +// +// default: +// result = errDataBrowserPropertyNotSupported; +// } +// +// return (result); + return 0; +} + + +static OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// WindowRef tWindowRef; +// +// tWindowRef = (WindowRef) inUserData; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowClose: +// QuitAppModalLoopForWindow(tWindowRef); +// result = noErr; +// break; +// } +// +// break; +// +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand tHICommand; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(true); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr) +// { +// switch (tHICommand.commandID) +// { +// case kNewButton: +// AddCheatItem(); +// result = noErr; +// break; +// +// case kDelButton: +// DeleteCheatItem(); +// result = noErr; +// break; +// +// case kAllButton: +// EnableAllCheatItems(); +// result = noErr; +// } +// } +// } +// } +// +// return (result); + return 0; +} diff --git a/macosx/mac-cheatfinder.cpp b/macosx/mac-cheatfinder.cpp deleted file mode 100755 index 34547fa0..00000000 --- a/macosx/mac-cheatfinder.cpp +++ /dev/null @@ -1,2037 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "cheats.h" - -#include "mac-prefix.h" -#include "mac-audio.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-screenshot.h" -#include "mac-stringtools.h" -#include "mac-cheatfinder.h" - -#define kCFNumBytesPop 'Size' -#define kCFViewModeRad 'Mode' -#define kCFCompModePop 'Math' -#define kCFCompStoredRad 'RSto' -#define kCFCompLastRad 'RLst' -#define kCFCompThisRad 'RThs' -#define kCFCompValueTxt 'CTxt' -#define kCFSearchBtn 'BSea' -#define kCFStoreValueBtn 'BSto' -#define kCFWatchBtn 'BWat' -#define kCFDrawerBtn 'Drwr' -#define kCFWatchAddrTxt 'WTxt' -#define kCFRestoreBtn 'BRes' -#define kCFRemoveBtn 'BRem' -#define kCFAddEntryBtn 'BAdd' -#define kCFUserPane 'Pane' -#define kCFSheetAddrTxt 'AEad' -#define kCFSheetCurrentValueTxt 'AEcv' -#define kCFSheetCheetValueTxt 'AEtx' -#define kCFSheetDescriptionTxt 'AEde' -#define kCFSheetAddBtn 'SHTa' -#define kCFSheetCancelBtn 'SHTc' -#define kCFListView 'List' -#define kCFUpperViews 'UI_T' -#define kCFLowerViews 'UI_B' - -#define kEventScrollableScrollThere 'ESST' -#define kEventCheatFinderList 'ECFL' -#define kControlListLinePart 172 - -#define MAIN_MEMORY_SIZE 0x20000 - -#define kCheatFinderListViewClassID CFSTR("com.snes9x.macos.snes9x.cheatfinder") - -enum -{ - kCFHexadecimal = 1, - kCFSignedDecimal, - kCFUnsignedDecimal -}; - -enum -{ - kCFCompWithStored = 1, - kCFCompWithLast, - kCFCompWithThis -}; - -enum -{ - kCFSearchEqual = 1, - kCFSearchNotEqual, - kCFSearchGreater, - kCFSearchGreaterOrEqual, - kCFSearchLess, - kCFSearchLessOrEqual -}; - -typedef struct -{ - IBNibRef nibRef; - WindowRef main; - WindowRef sheet; - WindowRef drawer; - HIViewRef list; - HIViewRef scroll; - EventHandlerRef sEref; - EventHandlerUPP sUPP; -} WindowData; - -typedef struct -{ - HIViewRef view; - HIPoint originPoint; - HISize lineSize; - Boolean inFocus; -} ListViewData; - -Boolean cfIsWatching = false; - -extern SCheatData Cheat; - -static UInt8 *cfStoredRAM; -static UInt8 *cfLastRAM; -static UInt8 *cfCurrentRAM; -static UInt8 *cfStatusFlag; -static UInt32 *cfAddress; - -static SInt32 cfNumRows; -static SInt32 cfListSelection; - -static SInt32 cfViewMode; -static SInt32 cfCompMode; -static SInt32 cfCompWith; -static UInt32 cfViewNumBytes; -static UInt32 cfWatchAddr; -static Boolean cfIsNewGame; -static Boolean cfIsStored; -static Boolean cfDrawerShow; - -static int cfListAddrColumnWidth; -static char cfWatchTextFormat[32]; -static CTFontRef cfListLineCTFontRef; -#ifdef MAC_TIGER_PANTHER_SUPPORT -static ATSUStyle cfListLineATSUStyle; -#endif - -static HIViewID kCheatFinderListViewID = { 'CHET', 'FNDR' }; - -static void CheatFinderSearch (WindowData *); -static void CheatFinderRestoreList (WindowData *); -static void CheatFinderRemoveFromList (WindowData *); -static void CheatFinderAdjustButtons (WindowData *); -static void CheatFinderBuildResultList (void); -static void CheatFinderHandleAddEntryButton (WindowData *); -static void CheatFinderMakeValueFormat (char *); -static void CheatFinderAddEntry (SInt64, char *); -static void CheatFinderBeginAddEntrySheet (WindowData *); -static void CheatFinderEndAddEntrySheet (WindowData *); -static void CheatFinderListViewScrollToThere (float, ListViewData *); -static void CheatFinderListViewDraw (CGContextRef, HIRect *, ListViewData *); -static float CheatFinderListViewSanityCheck (float, ListViewData *); -static SInt64 CheatFinderReadBytes (UInt8 *, UInt32); -static SInt64 CheatFinderGetValueEditText (ControlRef); -static Boolean CheatFinderCompare (SInt64, SInt64); -static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *); -static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef, EventRef, void *); - - -void InitCheatFinder (void) -{ - cfStoredRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfLastRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfCurrentRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfStatusFlag = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfAddress = new UInt32[MAIN_MEMORY_SIZE + 10]; - - if (!cfStoredRAM || !cfLastRAM || !cfCurrentRAM || !cfStatusFlag || !cfAddress) - QuitWithFatalError(0, "cheatfinder 01"); - - memset(cfCurrentRAM, 0x00, MAIN_MEMORY_SIZE + 10); - - cfViewMode = kCFUnsignedDecimal; - cfViewNumBytes = 2; - cfCompMode = kCFSearchEqual; - cfCompWith = kCFCompWithThis; - - if (systemVersion >= 0x1050) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Lucida Sans Typewriter Regular"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Menlo"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Monaco"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - QuitWithFatalError(0, "cheatfinder 02"); - } - } - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - OSStatus err; - - err = CreateATSUIStyleFromFontFullNameAndSize("Lucida Sans Typewriter Regular", 11, &cfListLineATSUStyle); - if (err) - { - err = CreateATSUIStyleFromFontFullNameAndSize("Menlo", 11, &cfListLineATSUStyle); - if (err) - { - err = CreateATSUIStyleFromFontFullNameAndSize("Monaco", 11, &cfListLineATSUStyle); - if (err) - QuitWithFatalError(0, "cheatfinder 02"); - } - } - } -#endif -} - -void ResetCheatFinder (void) -{ - memset(cfStoredRAM, 0x00, MAIN_MEMORY_SIZE); - memset(cfLastRAM, 0x00, MAIN_MEMORY_SIZE); - memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); - - cfWatchAddr = 0; - cfIsNewGame = true; - cfIsWatching = false; - cfIsStored = false; - cfDrawerShow = false; - - CheatFinderMakeValueFormat(cfWatchTextFormat); -} - -void DeinitCheatFinder (void) -{ - if (systemVersion >= 0x1050) - CFRelease(cfListLineCTFontRef); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - ATSUDisposeStyle(cfListLineATSUStyle); -#endif - - delete [] cfStoredRAM; - delete [] cfLastRAM; - delete [] cfCurrentRAM; - delete [] cfStatusFlag; - delete [] cfAddress; -} - -void CheatFinder (void) -{ - static HIObjectClassRef cfListViewClass = NULL; - - OSStatus err; - HIViewRef ctl; - HIViewID cid; - char num[256]; - WindowData cf; - EventHandlerRef wEref, pEref; - EventHandlerUPP wUPP, pUPP; - EventTypeSpec wEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }, - pEvents[] = { { kEventClassControl, kEventControlDraw } }, - cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassScrollable, kEventScrollableGetInfo }, - { kEventClassScrollable, kEventScrollableScrollTo }, - { kEventCheatFinderList, kEventScrollableScrollThere }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlTrack }, - { kEventClassControl, kEventControlValueFieldChanged }, - { kEventClassControl, kEventControlDraw } }; - - if (!cartOpen) - return; - - err = CreateNibReference(kMacS9XCFString, &(cf.nibRef)); - if (err == noErr) - { - err = CreateWindowFromNib(cf.nibRef, CFSTR("CheatFinder"), &(cf.main)); - if (err == noErr) - { - err = CreateWindowFromNib(cf.nibRef, CFSTR("CFDrawer"), &(cf.drawer)); - if (err == noErr) - { - memcpy(cfCurrentRAM, Memory.RAM, MAIN_MEMORY_SIZE); - CheatFinderBuildResultList(); - - err = noErr; - if (!cfListViewClass) - err = HIObjectRegisterSubclass(kCheatFinderListViewClassID, kHIViewClassID, 0, CheatFinderListViewHandler, GetEventTypeCount(cEvents), cEvents, NULL, &cfListViewClass); - if (err == noErr) - { - HIObjectRef hiObject; - HIViewRef userpane, scrollview, listview, imageview, root; - HILayoutInfo layoutinfo; - HIRect frame; - HISize minSize; - CGImageRef image; - Rect rct; - float pich; - - GetWindowBounds(cf.main, kWindowContentRgn, &rct); - - minSize.width = (float) (rct.right - rct.left); - minSize.height = (float) (rct.bottom - rct.top ); - err = SetWindowResizeLimits(cf.main, &minSize, NULL); - - root = HIViewGetRoot(cf.main); - cid.id = 0; - cid.signature = kCFUserPane; - HIViewFindByID(root, cid, &userpane); - - err = HIScrollViewCreate(kHIScrollViewOptionsVertScroll, &scrollview); - HIViewAddSubview(userpane, scrollview); - HIViewGetBounds(userpane, &frame); - cfListAddrColumnWidth = (int) (frame.size.width * 0.4); - frame.origin.y += 16.0f; - frame.size.height -= 16.0f; - frame = CGRectInset(frame, 1.0f, 1.0f); - HIViewSetFrame(scrollview, &frame); - HIViewSetVisible(scrollview, true); - cf.scroll = scrollview; - - layoutinfo.version = kHILayoutInfoVersionZero; - HIViewGetLayoutInfo(scrollview, &layoutinfo); - - layoutinfo.binding.top.toView = userpane; - layoutinfo.binding.top.kind = kHILayoutBindTop; - layoutinfo.binding.bottom.toView = userpane; - layoutinfo.binding.bottom.kind = kHILayoutBindBottom; - layoutinfo.binding.left.toView = userpane; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = userpane; - layoutinfo.binding.right.kind = kHILayoutBindRight; - HIViewSetLayoutInfo(scrollview, &layoutinfo); - - err = HIObjectCreate(kCheatFinderListViewClassID, NULL, &hiObject); - listview = (HIViewRef) hiObject; - HIViewAddSubview(scrollview, listview); - SetControl32BitMinimum(listview, 1); - SetControl32BitMaximum(listview, cfNumRows); - SetControl32BitValue(listview, 1); - HIViewSetVisible(listview, true); - cf.list = listview; - - cid.signature = kCFNumBytesPop; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfViewNumBytes); - - cid.signature = kCFViewModeRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfViewMode); - - cid.signature = kCFCompModePop; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompMode); - - if (cfIsNewGame || (!cfIsStored && (cfCompWith == kCFCompWithStored))) - cfCompWith = kCFCompWithThis; - - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); - if (cfIsStored) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - cid.signature = kCFCompLastRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); - if (!cfIsNewGame) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - cid.signature = kCFCompThisRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); - - cid.signature = kCFCompValueTxt; - HIViewFindByID(root, cid, &ctl); - SetEditTextCFString(ctl, CFSTR(""), false); - err = SetKeyboardFocus(cf.main, ctl, kControlFocusNextPart); - - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfIsWatching); - - cid.signature = kCFDrawerBtn; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfDrawerShow); - - cid.signature = kCFWatchAddrTxt; - HIViewFindByID(root, cid, &ctl); - if (cfIsWatching) - { - sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); - SetStaticTextCStr(ctl, num, false); - } - else - SetStaticTextCFString(ctl, CFSTR(""), false); - - CheatFinderAdjustButtons(&cf); - - pUPP = NewEventHandlerUPP(CheatFinderListFrameEventHandler); - err = InstallControlEventHandler(userpane, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) userpane, &pEref); - - wUPP = NewEventHandlerUPP(CheatFinderWindowEventHandler); - err = InstallWindowEventHandler (cf.main, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) &cf, &wEref); - - pich = (float) (IPPU.RenderedScreenHeight >> ((IPPU.RenderedScreenHeight > 256) ? 1 : 0)); - - err = SetDrawerParent(cf.drawer, cf.main); - err = SetDrawerOffsets(cf.drawer, 0.0f, (float) ((rct.bottom - rct.top) - (pich + 37))); - - image = CreateGameScreenCGImage(); - if (image) - { - err = HIImageViewCreate(image, &imageview); - if (err == noErr) - { - HIViewFindByID(HIViewGetRoot(cf.drawer), kHIViewWindowContentID, &ctl); - - HIViewAddSubview(ctl, imageview); - HIImageViewSetOpaque(imageview, false); - HIImageViewSetScaleToFit(imageview, true); - HIViewSetVisible(imageview, true); - - frame.origin.x = 8.0f; - frame.origin.y = 8.0f; - frame.size.width = (float) SNES_WIDTH; - frame.size.height = pich; - HIViewSetFrame(imageview, &frame); - } - } - - MoveWindowPosition(cf.main, kWindowCheatFinder, true); - ShowWindow(cf.main); - - if (cfDrawerShow) - err = OpenDrawer(cf.drawer, kWindowEdgeDefault, false); - - err = RunAppModalLoopForWindow(cf.main); - - HideWindow(cf.main); - SaveWindowPosition(cf.main, kWindowCheatFinder); - - err = RemoveEventHandler(pEref); - DisposeEventHandlerUPP(pUPP); - - err = RemoveEventHandler(wEref); - DisposeEventHandlerUPP(wUPP); - - if (image) - CGImageRelease(image); - } - - CFRelease(cf.drawer); - } - - CFRelease(cf.main); - } - - DisposeNibReference(cf.nibRef); - - memcpy(cfLastRAM, Memory.RAM, MAIN_MEMORY_SIZE); - cfIsNewGame = false; - } -} - -static SInt64 CheatFinderReadBytes (UInt8 *mem, UInt32 addr) -{ - switch (cfViewMode) - { - case kCFSignedDecimal: - { - switch (cfViewNumBytes) - { - case 1: return ((SInt64) (SInt8) mem[addr]); - case 2: return ((SInt64) (SInt16) (mem[addr] | (mem[addr + 1] << 8))); - case 4: return ((SInt64) (SInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); - case 3: return ((SInt64) (((SInt32) ((mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16)) << 8)) >> 8)); - } - - break; - } - - case kCFUnsignedDecimal: - case kCFHexadecimal: - { - switch (cfViewNumBytes) - { - case 1: return ((SInt64) (UInt8) mem[addr]); - case 2: return ((SInt64) (UInt16) (mem[addr] | (mem[addr + 1] << 8))); - case 3: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16))); - case 4: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); - } - - break; - } - } - - return (0); -} - -static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowData *cf; - HIViewRef control, ctl, root; - HIViewID controlID, cid; - Boolean update = false; - char num[256]; - - cf = (WindowData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - { - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - { - QuitAppModalLoopForWindow(cf->main); - result = noErr; - break; - } - } - - break; - } - - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - root = HIViewGetRoot(cf->main); - controlID.id = 0; - controlID.signature = tHICommand.commandID; - HIViewFindByID(root, controlID, &control); - - switch (tHICommand.commandID) - { - case kCFNumBytesPop: - { - cfViewNumBytes = GetControl32BitValue(control); - update = true; - result = noErr; - break; - } - - case kCFViewModeRad: - { - cfViewMode = GetControl32BitValue(control); - update = true; - result = noErr; - break; - } - - case kCFCompModePop: - { - cfCompMode = GetControl32BitValue(control); - result = noErr; - break; - } - - case kCFCompStoredRad: - case kCFCompLastRad: - case kCFCompThisRad: - { - if (tHICommand.commandID == kCFCompStoredRad) - cfCompWith = kCFCompWithStored; - else - if (tHICommand.commandID == kCFCompLastRad) - cfCompWith = kCFCompWithLast; - else - cfCompWith = kCFCompWithThis; - - cid.id = 0; - - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); - - cid.signature = kCFCompLastRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); - - cid.signature = kCFCompThisRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); - - result = noErr; - break; - } - - case kCFStoreValueBtn: - { - memcpy(cfStoredRAM, Memory.RAM, MAIN_MEMORY_SIZE); - cfIsStored = true; - - cid.id = 0; - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - result = noErr; - break; - } - - case kCFSearchBtn: - { - CheatFinderSearch(cf); - update = true; - result = noErr; - break; - } - - case kCFRemoveBtn: - { - CheatFinderRemoveFromList(cf); - update = true; - result = noErr; - break; - } - - case kCFRestoreBtn: - { - CheatFinderRestoreList(cf); - update = true; - result = noErr; - break; - } - - case kCFAddEntryBtn: - { - CheatFinderHandleAddEntryButton(cf); - result = noErr; - break; - } - - case kCFDrawerBtn: - { - cfDrawerShow = !cfDrawerShow; - - if (cfDrawerShow) - err = OpenDrawer(cf->drawer, kWindowEdgeDefault, false); - else - err = CloseDrawer(cf->drawer, false); - - result = noErr; - break; - } - - case kCFWatchBtn: - { - cid.id = 0; - cid.signature = kCFWatchAddrTxt; - HIViewFindByID(root, cid, &ctl); - - if (!cfIsWatching) - { - if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) - { - PlayAlertSound(); - SetControl32BitValue(control, 0); - } - else - { - cfWatchAddr = cfAddress[cfListSelection]; - cfIsWatching = true; - - sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); - SetStaticTextCStr(ctl, num, true); - } - } - else - { - cfWatchAddr = 0; - cfIsWatching = false; - - SetControl32BitValue(control, 0); - SetStaticTextCFString(ctl, CFSTR(""), true); - - CheatFinderAdjustButtons(cf); - } - - result = noErr; - break; - } - } - - if (update) - { - HIViewSetNeedsDisplay(cf->list, true); - CheatFinderAdjustButtons(cf); - } - - CheatFinderMakeValueFormat(cfWatchTextFormat); - } - - break; - } - } - - break; - } - } - - return (result); -} - -static SInt64 CheatFinderGetValueEditText (HIViewRef control) -{ - SInt64 result = 0; - UInt32 uvalue; - SInt32 svalue; - char num[256]; - - GetEditTextCStr(control, num); - if (num[0] == 0) - { - SetEditTextCFString(control, CFSTR("0"), true); - return (0); - } - - switch (cfViewMode) - { - case kCFSignedDecimal: - { - if (sscanf(num, "%ld", &svalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (svalue > 127) - { - svalue = 127; - SetEditTextCFString(control, CFSTR("127"), true); - } - else - if (svalue < -128) - { - svalue = -128; - SetEditTextCFString(control, CFSTR("-128"), true); - } - - break; - } - - case 2: - { - if (svalue > 32767) - { - svalue = 32767; - SetEditTextCFString(control, CFSTR("32767"), true); - } - else - if (svalue < -32768) - { - svalue = -32768; - SetEditTextCFString(control, CFSTR("-32768"), true); - } - - break; - } - - case 3: - { - if (svalue > 8388607) - { - svalue = 8388607; - SetEditTextCFString(control, CFSTR("8388607"), true); - } - else - if (svalue < -8388608) - { - svalue = -8388608; - SetEditTextCFString(control, CFSTR("-8388608"), true); - } - - break; - } - } - } - else - { - svalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) svalue; - - break; - } - - case kCFUnsignedDecimal: - { - if (sscanf(num, "%lu", &uvalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (uvalue > 255) - { - uvalue = 255; - SetEditTextCFString(control, CFSTR("255"), true); - } - - break; - } - - case 2: - { - if (uvalue > 65535) - { - uvalue = 65535; - SetEditTextCFString(control, CFSTR("65535"), true); - } - - break; - } - - case 3: - { - if (uvalue > 16777215) - { - uvalue = 16777215; - SetEditTextCFString(control, CFSTR("16777215"), true); - } - - break; - } - } - } - else - { - uvalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) uvalue; - - break; - } - - case kCFHexadecimal: - { - if (sscanf(num, "%lx", &uvalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (uvalue > 0xFF) - { - uvalue = 0xFF; - SetEditTextCFString(control, CFSTR("FF"), true); - } - - break; - } - - case 2: - { - if (uvalue > 0xFFFF) - { - uvalue = 0xFFFF; - SetEditTextCFString(control, CFSTR("FFFF"), true); - } - - break; - } - - case 3: - { - if (uvalue > 0xFFFFFF) - { - uvalue = 0xFFFFFF; - SetEditTextCFString(control, CFSTR("FFFFFF"), true); - } - - break; - } - } - } - else - { - uvalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) uvalue; - - break; - } - } - - return (result); -} - -static void CheatFinderSearch (WindowData *cf) -{ - SInt64 cmpvalue; - UInt8 *mem; - - if (cfCompWith == kCFCompWithThis) - { - HIViewRef ctl; - HIViewID cid = { kCFCompValueTxt, 0 }; - - HIViewFindByID(HIViewGetRoot(cf->main), cid, &ctl); - cmpvalue = CheatFinderGetValueEditText(ctl); - - for (int i = 0; i < cfNumRows; i++) - if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), cmpvalue)) - cfStatusFlag[cfAddress[i]] = 0; - } - else - { - mem = (cfCompWith == kCFCompWithStored) ? cfStoredRAM : cfLastRAM; - - for (int i = 0; i < cfNumRows; i++) - if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), CheatFinderReadBytes(mem, cfAddress[i]))) - cfStatusFlag[cfAddress[i]] = 0; - } - - CheatFinderBuildResultList(); - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, 1); -} - -static Boolean CheatFinderCompare (SInt64 ramvalue, SInt64 cmpvalue) -{ - switch (cfCompMode) - { - case kCFSearchEqual: return (ramvalue == cmpvalue); - case kCFSearchNotEqual: return (ramvalue != cmpvalue); - case kCFSearchGreater: return (ramvalue > cmpvalue); - case kCFSearchGreaterOrEqual: return (ramvalue >= cmpvalue); - case kCFSearchLess: return (ramvalue < cmpvalue); - case kCFSearchLessOrEqual: return (ramvalue <= cmpvalue); - } - - return (false); -} - -static void CheatFinderBuildResultList (void) -{ - cfNumRows = 0; - - for (int i = 0; i < MAIN_MEMORY_SIZE; i++) - { - if (cfStatusFlag[i] == 0xFF) - { - cfAddress[cfNumRows] = i; - cfNumRows++; - } - } - - cfListSelection = 0; -} - -static void CheatFinderAdjustButtons (WindowData *cf) -{ - HIViewRef ctl, root; - HIViewID cid; - - cid.id = 0; - root = HIViewGetRoot(cf->main); - - if (cfNumRows > 0) - { - cid.signature = kCFAddEntryBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - cid.signature = kCFRemoveBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - } - else - { - cid.signature = kCFAddEntryBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - - cid.signature = kCFRemoveBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - - if (!cfIsWatching) - { - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - } - } -} - -static void CheatFinderRemoveFromList (WindowData *cf) -{ - if (cfNumRows > 0) - { - cfStatusFlag[cfAddress[cfListSelection]] = 0; - - if (cfNumRows == 1) - { - cfNumRows = 0; - - SetControl32BitMaximum(cf->list, 0); - SetControl32BitValue(cf->list, 1); - } - else - { - for (int i = cfListSelection; i < cfNumRows - 1; i++) - cfAddress[i] = cfAddress[i + 1]; - - cfNumRows--; - if (cfListSelection >= cfNumRows) - cfListSelection = cfNumRows - 1; - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, cfListSelection + 1); - } - } -} - -static void CheatFinderRestoreList (WindowData *cf) -{ - memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); - CheatFinderBuildResultList(); - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, 1); -} - -static void CheatFinderMakeValueFormat (char *text) -{ - switch (cfViewMode) - { - case kCFSignedDecimal: - case kCFUnsignedDecimal: - { - strcpy(text, "%lld"); - break; - } - - case kCFHexadecimal: - { - sprintf(text, "%%0%lullX", cfViewNumBytes * 2); - break; - } - } -} - -void CheatFinderDrawWatchAddr (void) -{ - static char code[256]; - - uint16 *basePtr; - int len; - - sprintf(code, cfWatchTextFormat, CheatFinderReadBytes(Memory.RAM, cfWatchAddr)); - - basePtr = GFX.Screen + 1; - len = strlen(code); - - for (int i = 0; i < len; i++) - { - S9xDisplayChar(basePtr, code[i]); - basePtr += (8 - 1); - } -} - -static void CheatFinderHandleAddEntryButton (WindowData *cf) -{ - if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) - PlayAlertSound(); - else - if (Cheat.g.size() + cfViewNumBytes > MAC_MAX_CHEATS) - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertCFCantAddEntry, kS9xMacAlertCFCantAddEntryHint); - else - CheatFinderBeginAddEntrySheet(cf); -} - -static void CheatFinderBeginAddEntrySheet (WindowData *cf) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - UInt32 addr; - char str[256], form[256]; - EventTypeSpec sEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - - err = CreateWindowFromNib(cf->nibRef, CFSTR("CFAddEntry"), &(cf->sheet)); - if (err == noErr) - { - addr = cfAddress[cfListSelection]; - - root = HIViewGetRoot(cf->sheet); - cid.id = 0; - - cid.signature = kCFSheetAddrTxt; - HIViewFindByID(root, cid, &ctl); - sprintf(str, "%06lX", addr + 0x7E0000); - SetStaticTextCStr(ctl, str, false); - - cid.signature = kCFSheetCurrentValueTxt; - HIViewFindByID(root, cid, &ctl); - CheatFinderMakeValueFormat(form); - sprintf(str, form, CheatFinderReadBytes(cfCurrentRAM, addr)); - SetStaticTextCStr(ctl, str, false); - - cid.signature = kCFSheetCheetValueTxt; - HIViewFindByID(root, cid, &ctl); - SetEditTextCStr(ctl, str, false); - - err = ClearKeyboardFocus(cf->sheet); - err = SetKeyboardFocus(cf->sheet, ctl, kControlFocusNextPart); - - cid.signature = kCFSheetDescriptionTxt; - HIViewFindByID(root, cid, &ctl); - sprintf(str, "%06lX-%06lX", addr + 0x7E0000, addr + cfViewNumBytes - 1 + 0x7E0000); - SetStaticTextCStr(ctl, str, false); - - cf->sUPP = NewEventHandlerUPP(CheatFinderSheetEventHandler); - err = InstallWindowEventHandler(cf->sheet, cf->sUPP, GetEventTypeCount(sEvents), sEvents, (void *) cf, &(cf->sEref)); - - err = ShowSheetWindow(cf->sheet, cf->main); - } -} - -static void CheatFinderEndAddEntrySheet (WindowData *cf) -{ - if (cf->sheet) - { - OSStatus err; - - err = HideSheetWindow(cf->sheet); - - err = RemoveEventHandler(cf->sEref); - DisposeEventHandlerUPP(cf->sUPP); - - CFRelease(cf->sheet); - } -} - -static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowData *cf = (WindowData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case kCFSheetAddBtn: - { - HIViewRef ctl, root; - HIViewID cid; - CFStringRef str; - SInt64 rv; - char buf[256]; - - root = HIViewGetRoot(cf->sheet); - cid.id = 0; - - cid.signature = kCFSheetCheetValueTxt; - HIViewFindByID(root, cid, &ctl); - rv = CheatFinderGetValueEditText(ctl); - - cid.signature = kCFSheetDescriptionTxt; - HIViewFindByID(root, cid, &ctl); - - buf[0] = 0; - CopyEditTextCFString(ctl, &str); - if (str) - { - strcpy(buf, GetMultiByteCharacters(str, 19)); - CFRelease(str); - } - - if (buf[0] == 0) - { - buf[0] = ' '; - buf[1] = 0; - } - - CheatFinderAddEntry(rv, buf); - - CheatFinderEndAddEntrySheet(cf); - - result = noErr; - break; - } - - case kCFSheetCancelBtn: - { - CheatFinderEndAddEntrySheet(cf); - result = noErr; - break; - } - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -static void CheatFinderAddEntry (SInt64 value, char *description) -{ - UInt32 addr, v; - - addr = cfAddress[cfListSelection]; - v = (UInt32) (SInt32) value; - - for (unsigned int i = 0; i < cfViewNumBytes; i++) - { - char code[10]; - snprintf(code, 10, "%x=%x", addr + i + 0x7E0000, (UInt8) ((v & (0x000000FF << (i * 8))) >> (i * 8))); - int index = S9xAddCheatGroup(description, code); - if(index >= 0) - S9xEnableCheatGroup(index); - } -} - -static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *userData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view = (HIViewRef) userData; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - CGContextRef ctx; - HIRect bounds; - - HIViewGetBounds(view, &bounds); - cfListAddrColumnWidth = (int) (bounds.size.width * 0.4); - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIRect drawBounds; - - if (systemVersion >= 0x1040) - { - HIShapeRef shape = NULL; - - err = GetEventParameter(inEvent, kEventParamShape, typeHIShapeRef, NULL, sizeof(HIShapeRef), NULL, &shape); - if (err == noErr) - { - if (shape) - HIShapeGetBounds(shape, &drawBounds); - else - drawBounds = bounds; - } - } - #ifdef MAC_PANTHER_SUPPORT - else - { - RgnHandle rgn = NULL; - - err = GetEventParameter(inEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof(RgnHandle), NULL, &rgn); - if (err == noErr) - { - if (rgn) - { - Rect rgnBounds; - - GetRegionBounds(rgn, &rgnBounds); - drawBounds.origin.x = (float) rgnBounds.left; - drawBounds.origin.y = (float) rgnBounds.top; - drawBounds.size.width = (float) (rgnBounds.right - rgnBounds.left); - drawBounds.size.height = (float) (rgnBounds.bottom - rgnBounds.top ); - } - else - drawBounds = bounds; - } - } - #endif - - if (err == noErr) - { - if (CGRectContainsRect(drawBounds, bounds)) - { - HIRect rct; - HIThemeFrameDrawInfo frameinfo; - HIThemeButtonDrawInfo buttoninfo; - HIThemeTextInfo textinfo; - CFStringRef str; - - buttoninfo.version = 0; - buttoninfo.state = kThemeStateActive; - buttoninfo.kind = kThemeListHeaderButton; - buttoninfo.value = kThemeButtonOff; - buttoninfo.adornment = kThemeAdornmentNone; - - frameinfo.version = 0; - frameinfo.state = kThemeStateActive; - frameinfo.kind = kHIThemeFrameListBox; - frameinfo.isFocused = false; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushCenter; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationNone; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - CGContextSaveGState(ctx); - - rct = CGRectInset(bounds, 1.0f, 1.0f); - err = HIThemeDrawFrame(&rct, &frameinfo, ctx, kHIThemeOrientationNormal); - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width = (float) cfListAddrColumnWidth + 1.0f; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - rct.size.width = (float) cfListAddrColumnWidth; - rct.origin.y++; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushCenter; - str = CFCopyLocalizedString(CFSTR("Address"), "address"); - if (str) - { - err = HIThemeDrawTextBox(str, &rct, &textinfo, ctx, kHIThemeOrientationNormal); - CFRelease(str); - } - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width -= (float) cfListAddrColumnWidth; - rct.origin.x += (float) cfListAddrColumnWidth; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - rct.size.width -= 28.0f; - rct.origin.y++; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushRight; - str = CFCopyLocalizedString(CFSTR("Value"), "value"); - if (str) - { - err = HIThemeDrawTextBox(str, &rct, &textinfo, ctx, kHIThemeOrientationNormal); - CFRelease(str); - } - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width = 16.0f; - rct.origin.x = bounds.size.width - 16.0f; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextRestoreGState(ctx); - } - - result = noErr; - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -static void CheatFinderListViewDraw (CGContextRef ctx, HIRect *bounds, ListViewData *myData) -{ - static Boolean init = true; - - if (systemVersion >= 0x1050) - { - static CGRect aRct, vRct; - - CTLineRef line; - CFDictionaryRef attr; - CFAttributedStringRef astr; - CFStringRef str; - HIRect lineBounds; - SInt32 start, end, val, max; - float ax, vx, y, f; - char format[32], t1[64], t2[64]; - - CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName }; - CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }, - wval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorWhite) }; - - CheatFinderMakeValueFormat(format); - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; - - y = start * myData->lineSize.height - myData->originPoint.y; - - lineBounds = *bounds; - lineBounds.size.height = myData->lineSize.height; - lineBounds.origin.y = y; - - val = GetControl32BitValue(myData->view) - 1; - max = GetControl32BitMaximum(myData->view); - - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - - CGContextSetTextMatrix(ctx, CGAffineTransformIdentity); - - if (init) - { - CGContextSetTextPosition(ctx, 0.0f, 0.0f); - - astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFF"), attr); - line = CTLineCreateWithAttributedString(astr); - aRct = CTLineGetImageBounds(line, ctx); - CFRelease(line); - CFRelease(astr); - - astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFFFFFFF"), attr); - line = CTLineCreateWithAttributedString(astr); - vRct = CTLineGetImageBounds(line, ctx); - CFRelease(line); - CFRelease(astr); - - init = false; - } - - ax = (float) (int) (((float) cfListAddrColumnWidth - 2.0 - aRct.size.width) / 2.0); - vx = (float) (int) (lineBounds.origin.x + lineBounds.size.width - vRct.size.width - 12.0); - - for (int i = start; i <= end; i++) - { - if ((i == val) && cfNumRows) - CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); - else - if ((i - start) % 2 == 0) - CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); - - CGContextFillRect(ctx, lineBounds); - - if (i < max) - { - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - { - CFRelease(attr); - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &wval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - } - - f = -(y + 12.0f); - - sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); - str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); - astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); - line = CTLineCreateWithAttributedString(astr); - CGContextSetTextPosition(ctx, ax, f); - CTLineDraw(line, ctx); - CFRelease(line); - CFRelease(astr); - CFRelease(str); - - sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); - strcpy(t1, " "); - t1[11 - strlen(t2)] = 0; - strcat(t1, t2); - str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); - astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); - line = CTLineCreateWithAttributedString(astr); - CGContextSetTextPosition(ctx, vx, f); - CTLineDraw(line, ctx); - CFRelease(line); - CFRelease(astr); - CFRelease(str); - - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - { - CFRelease(attr); - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - } - } - - y += myData->lineSize.height; - lineBounds.origin.y += myData->lineSize.height; - } - - CFRelease(attr); - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - static Rect aRect = { 0, 0, 0, 0 }, vRect = { 0, 0, 0, 0 }; - - OSStatus err; - ATSUTextLayout layout; - HIRect lineBounds; - UniCharCount runLength[1], len; - SInt32 start, end, val, max; - Fixed ax, vx, f; - float y; - UniChar unistr[64]; - char format[32], t1[64], t2[64]; - - ATSUAttributeTag theTags[] = { kATSUCGContextTag }; - ByteCount theSizes[] = { sizeof(CGContextRef) }; - ATSUAttributeValuePtr theValues[] = { &ctx }; - - CheatFinderMakeValueFormat(format); - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; - - y = start * myData->lineSize.height - myData->originPoint.y; - - lineBounds = *bounds; - lineBounds.size.height = myData->lineSize.height; - lineBounds.origin.y = y; - - val = GetControl32BitValue(myData->view) - 1; - max = GetControl32BitMaximum(myData->view); - - if (init) - { - f = Long2Fix(0); - for (unsigned int n = 0; n < 11; n++) - unistr[n] = 'F'; - - len = runLength[0] = 6; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &aRect); - err = ATSUDisposeTextLayout(layout); - - len = runLength[0] = 11; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &vRect); - err = ATSUDisposeTextLayout(layout); - - init = false; - } - - ax = Long2Fix((cfListAddrColumnWidth - 2 - (aRect.right - aRect.left)) >> 1); - vx = Long2Fix((int) (lineBounds.origin.x + lineBounds.size.width) - (vRect.right - vRect.left) - 13); - - for (int i = start; i <= end; i++) - { - if ((i == val) && cfNumRows) - CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); - else - if ((i - start) % 2 == 0) - CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); - - CGContextFillRect(ctx, lineBounds); - - if (i < max) - { - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - f = Long2Fix(-((int) y + 12)); - - sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); - len = runLength[0] = strlen(t1); - for (unsigned int n = 0; n < len; n++) - unistr[n] = t1[n]; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, ax, f); - err = ATSUDisposeTextLayout(layout); - - sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); - strcpy(t1, " "); - t1[11 - strlen(t2)] = 0; - strcat(t1, t2); - len = runLength[0] = strlen(t1); - for (unsigned int n = 0; n < len; n++) - unistr[n] = t1[n]; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, vx, f); - err = ATSUDisposeTextLayout(layout); - - CGContextScaleCTM(ctx, 1, -1); - } - - y += myData->lineSize.height; - lineBounds.origin.y += myData->lineSize.height; - } - } -#endif -} - -static HIViewPartCode CheatFinderListViewFindPart (EventRef inEvent, ListViewData *myData, SInt32 *whichLine) -{ - OSStatus err; - HIViewPartCode part; - HIPoint hipt; - SInt32 start, line; - float y; - - part = kControlNoPart; - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - y = start * myData->lineSize.height - myData->originPoint.y; - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); - if (err == noErr) - { - line = start + (SInt32) ((hipt.y - y - 1) / myData->lineSize.height) + 1; - - if (line <= GetControl32BitMaximum(myData->view)) - part = kControlListLinePart; - - if (whichLine != NULL) - *whichLine = line; - } - - return (part); -} - -static float CheatFinderListViewSanityCheck (float where, ListViewData *myData) -{ - HIRect bounds; - HISize imageSize; - - HIViewGetBounds(myData->view, &bounds); - imageSize = myData->lineSize; - imageSize.height *= GetControl32BitMaximum(myData->view); - - if (where + bounds.size.height > imageSize.height) - where = imageSize.height - bounds.size.height; - if (where < 0) - where = 0; - - return (where); -} - -static void CheatFinderListViewScrollToThere (float where, ListViewData *myData) -{ - OSStatus err; - EventRef theEvent; - HIPoint whereP = { 0.0f, where }; - - err = CreateEvent(kCFAllocatorDefault, kEventCheatFinderList, kEventScrollableScrollThere, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); - if (err == noErr) - { - err = SetEventParameter(theEvent, kEventParamOrigin, typeHIPoint, sizeof(whereP), &whereP); - if (err == noErr) - err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); - - ReleaseEvent(theEvent); - } -} - -static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - ListViewData *myData = (ListViewData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassHIObject: - { - switch (GetEventKind(inEvent)) - { - case kEventHIObjectConstruct: - { - ListViewData *data; - - data = (ListViewData *) calloc(1, sizeof(ListViewData)); - if (data) - { - HIViewRef epView; - - err = GetEventParameter(inEvent, kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof(epView), NULL, &epView); - if (err == noErr) - { - data->view = epView; - data->originPoint.x = 0.0f; - data->originPoint.y = 0.0f; - data->lineSize.width = 0.0f; - data->lineSize.height = 16.0f; - data->inFocus = false; - - SetControlID(epView, &kCheatFinderListViewID); - - result = SetEventParameter(inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof(data), &data); - } - } - - break; - } - - case kEventHIObjectDestruct: - { - if (myData) - free(myData); - - result = noErr; - break; - } - - case kEventHIObjectInitialize: - { - result = CallNextEventHandler(inHandlerCallRef, inEvent); - break; - } - } - - break; - } - - case kEventClassScrollable: - { - switch (GetEventKind(inEvent)) - { - case kEventScrollableGetInfo: - { - HIRect bounds; - HISize imageSize; - - HIViewGetBounds(myData->view, &bounds); - imageSize = myData->lineSize; - imageSize.height *= GetControl32BitMaximum(myData->view); - - err = SetEventParameter(inEvent, kEventParamImageSize, typeHISize, sizeof(imageSize), &imageSize); - err = SetEventParameter(inEvent, kEventParamViewSize, typeHISize, sizeof(bounds.size), &bounds.size); - err = SetEventParameter(inEvent, kEventParamLineSize, typeHISize, sizeof(myData->lineSize), &myData->lineSize); - err = SetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, sizeof(myData->originPoint), &myData->originPoint); - - result = noErr; - break; - } - - case kEventScrollableScrollTo: - { - HIPoint where; - - err = GetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, NULL, sizeof(where), NULL, &where); - if (err == noErr) - { - where.y = CheatFinderListViewSanityCheck(where.y, myData); - if ((int) myData->originPoint.y == (int) where.y) - break; - myData->originPoint.y = where.y; - - HIViewSetNeedsDisplay(myData->view, true); - } - - break; - } - } - - break; - } - - case kEventCheatFinderList: - { - switch (GetEventKind(inEvent)) - { - case kEventScrollableScrollThere: - { - HIPoint where; - - err = GetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, NULL, sizeof(where), NULL, &where); - if (err == noErr) - { - where.y = CheatFinderListViewSanityCheck(where.y, myData); - if ((int) myData->originPoint.y != (int) where.y) - { - myData->originPoint.y = where.y; - SetControl32BitValue(HIViewGetNextView(myData->view), (SInt32) myData->originPoint.y); - - HIViewSetNeedsDisplay(myData->view, true); - } - } - - break; - } - } - - break; - } - - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(ctx), NULL, &ctx); - if (err == noErr) - { - HIRect bounds; - - HIViewGetBounds(myData->view, &bounds); - - CGContextSaveGState(ctx); - CheatFinderListViewDraw(ctx, &bounds, myData); - CGContextRestoreGState(ctx); - - result = noErr; - } - - break; - } - - case kEventControlHitTest: - { - HIViewPartCode part; - - part = CheatFinderListViewFindPart(inEvent, myData, NULL); - - result = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - break; - } - - case kEventControlTrack: - { - MouseTrackingResult trackResult; - WindowRef window; - HIViewRef contentView; - HIViewPartCode part; - HIRect frame; - SInt32 whichLine = 0; - - part = CheatFinderListViewFindPart(inEvent, myData, &whichLine); - if (part == kControlListLinePart) - SetControl32BitValue(myData->view, whichLine); - - window = GetControlOwner(myData->view); - - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &contentView); - HIViewGetFrame(myData->view, &frame); - HIViewConvertRect(&frame, myData->view, contentView); - - HIPoint hipt; - #ifdef MAC_TIGER_PANTHER_SUPPORT - CGrafPtr oldPort; - Point qdpt; - Boolean portChanged = false; - - if (systemVersion < 0x1050) - portChanged = QDSwapPort(GetWindowPort(window), &oldPort); - #endif - - if (systemVersion >= 0x1050) - err = HIViewTrackMouseLocation(contentView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - TrackMouseLocation(NULL, &qdpt, &trackResult); - #endif - - while (trackResult != kMouseTrackingMouseUp) - { - SInt32 start, line = 0; - float y; - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - y = start * myData->lineSize.height - myData->originPoint.y; - - if (systemVersion >= 0x1050) - { - line = (SInt32) ((hipt.y - frame.origin.y - y - 1) / myData->lineSize.height) + 1; - if (hipt.y < frame.origin.y) - line--; - } - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - line = (SInt32) ((qdpt.v - frame.origin.y - y - 1) / myData->lineSize.height) + 1; - if (qdpt.v < frame.origin.y) - line--; - } - #endif - line += start; - - if (line != whichLine) - { - whichLine = line; - SetControl32BitValue(myData->view, whichLine); - - SInt32 goThere = -1; - - if (whichLine <= start) - goThere = whichLine - 1; - else - if (whichLine >= start + (SInt32) (frame.size.height / myData->lineSize.height) + 1) - goThere = whichLine - (SInt32) (frame.size.height / myData->lineSize.height) - 1; - - if (goThere != -1) - { - float where; - - where = goThere * myData->lineSize.height; - where = CheatFinderListViewSanityCheck(where, myData); - if ((int) where != (int) myData->originPoint.y) - CheatFinderListViewScrollToThere(where, myData); - } - } - - if (systemVersion >= 0x1050) - err = HIViewTrackMouseLocation(contentView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - TrackMouseLocation(NULL, &qdpt, &trackResult); - #endif - } - - #ifdef MAC_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1050) - { - if (portChanged) - QDSwapPort(oldPort, NULL); - } - #endif - - err = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - cfListSelection = GetControl32BitValue(myData->view) - 1; - - result = noErr; - break; - } - - case kEventControlValueFieldChanged: - { - EventRef theEvent; - - myData->originPoint.y = CheatFinderListViewSanityCheck(myData->originPoint.y, myData); - - err = CreateEvent(kCFAllocatorDefault, kEventClassScrollable, kEventScrollableInfoChanged, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); - if (err == noErr) - { - err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); - ReleaseEvent(theEvent); - - HIViewSetNeedsDisplay(myData->view, true); - } - - break; - } - } - - break; - } - } - - return (result); -} diff --git a/macosx/mac-cheatfinder.h b/macosx/mac-cheatfinder.h index e467023e..529bebc1 100755 --- a/macosx/mac-cheatfinder.h +++ b/macosx/mac-cheatfinder.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cheatfinder.mm b/macosx/mac-cheatfinder.mm new file mode 100755 index 00000000..855caeeb --- /dev/null +++ b/macosx/mac-cheatfinder.mm @@ -0,0 +1,1237 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "snes9x.h" +#include "memmap.h" +#include "cheats.h" + +#include "mac-prefix.h" +#include "mac-audio.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-screenshot.h" +#include "mac-stringtools.h" +#include "mac-cheatfinder.h" + +#define kCFNumBytesPop 'Size' +#define kCFViewModeRad 'Mode' +#define kCFCompModePop 'Math' +#define kCFCompStoredRad 'RSto' +#define kCFCompLastRad 'RLst' +#define kCFCompThisRad 'RThs' +#define kCFCompValueTxt 'CTxt' +#define kCFSearchBtn 'BSea' +#define kCFStoreValueBtn 'BSto' +#define kCFWatchBtn 'BWat' +#define kCFDrawerBtn 'Drwr' +#define kCFWatchAddrTxt 'WTxt' +#define kCFRestoreBtn 'BRes' +#define kCFRemoveBtn 'BRem' +#define kCFAddEntryBtn 'BAdd' +#define kCFUserPane 'Pane' +#define kCFSheetAddrTxt 'AEad' +#define kCFSheetCurrentValueTxt 'AEcv' +#define kCFSheetCheetValueTxt 'AEtx' +#define kCFSheetDescriptionTxt 'AEde' +#define kCFSheetAddBtn 'SHTa' +#define kCFSheetCancelBtn 'SHTc' +#define kCFListView 'List' +#define kCFUpperViews 'UI_T' +#define kCFLowerViews 'UI_B' + +#define kEventScrollableScrollThere 'ESST' +#define kEventCheatFinderList 'ECFL' +#define kControlListLinePart 172 + +#define MAIN_MEMORY_SIZE 0x20000 + +#define kCheatFinderListViewClassID CFSTR("com.snes9x.macos.snes9x.cheatfinder") + +enum +{ + kCFHexadecimal = 1, + kCFSignedDecimal, + kCFUnsignedDecimal +}; + +enum +{ + kCFCompWithStored = 1, + kCFCompWithLast, + kCFCompWithThis +}; + +enum +{ + kCFSearchEqual = 1, + kCFSearchNotEqual, + kCFSearchGreater, + kCFSearchGreaterOrEqual, + kCFSearchLess, + kCFSearchLessOrEqual +}; + +typedef struct +{ + IBNibRef nibRef; + WindowRef main; + WindowRef sheet; + WindowRef drawer; + HIViewRef list; + HIViewRef scroll; + EventHandlerRef sEref; + EventHandlerUPP sUPP; +} WindowData; + +typedef struct +{ + HIViewRef view; + HIPoint originPoint; + HISize lineSize; + Boolean inFocus; +} ListViewData; + +Boolean cfIsWatching = false; + +extern SCheatData Cheat; + +static UInt8 *cfStoredRAM; +static UInt8 *cfLastRAM; +static UInt8 *cfCurrentRAM; +static UInt8 *cfStatusFlag; +static UInt32 *cfAddress; + +static SInt32 cfNumRows; +static SInt32 cfListSelection; + +static SInt32 cfViewMode; +static SInt32 cfCompMode; +static SInt32 cfCompWith; +static UInt32 cfViewNumBytes; +static UInt32 cfWatchAddr; +static Boolean cfIsNewGame; +static Boolean cfIsStored; +static Boolean cfDrawerShow; + +static int cfListAddrColumnWidth; +static char cfWatchTextFormat[32]; +static CTFontRef cfListLineCTFontRef; +#ifdef MAC_TIGER_PANTHER_SUPPORT +static ATSUStyle cfListLineATSUStyle; +#endif + +static HIViewID kCheatFinderListViewID = { 'CHET', 'FNDR' }; + +static void CheatFinderSearch (WindowData *); +static void CheatFinderRestoreList (WindowData *); +static void CheatFinderRemoveFromList (WindowData *); +static void CheatFinderAdjustButtons (WindowData *); +static void CheatFinderBuildResultList (void); +static void CheatFinderHandleAddEntryButton (WindowData *); +static void CheatFinderMakeValueFormat (char *); +static void CheatFinderAddEntry (SInt64, char *); +static void CheatFinderBeginAddEntrySheet (WindowData *); +static void CheatFinderEndAddEntrySheet (WindowData *); +static void CheatFinderListViewScrollToThere (float, ListViewData *); +static void CheatFinderListViewDraw (CGContextRef, HIRect *, ListViewData *); +static float CheatFinderListViewSanityCheck (float, ListViewData *); +static SInt64 CheatFinderReadBytes (UInt8 *, UInt32); +static SInt64 CheatFinderGetValueEditText (ControlRef); +static Boolean CheatFinderCompare (SInt64, SInt64); +static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *); + + +void InitCheatFinder (void) +{ + cfStoredRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfLastRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfCurrentRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfStatusFlag = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfAddress = new UInt32[MAIN_MEMORY_SIZE + 10]; + + if (!cfStoredRAM || !cfLastRAM || !cfCurrentRAM || !cfStatusFlag || !cfAddress) + QuitWithFatalError(@"cheatfinder 01"); + + memset(cfCurrentRAM, 0x00, MAIN_MEMORY_SIZE + 10); + + cfViewMode = kCFUnsignedDecimal; + cfViewNumBytes = 2; + cfCompMode = kCFSearchEqual; + cfCompWith = kCFCompWithThis; + + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Lucida Sans Typewriter Regular"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + { + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Menlo"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + { + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Monaco"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + QuitWithFatalError(@"cheatfinder 02"); + } + } +} + +void ResetCheatFinder (void) +{ + memset(cfStoredRAM, 0x00, MAIN_MEMORY_SIZE); + memset(cfLastRAM, 0x00, MAIN_MEMORY_SIZE); + memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); + + cfWatchAddr = 0; + cfIsNewGame = true; + cfIsWatching = false; + cfIsStored = false; + cfDrawerShow = false; + + CheatFinderMakeValueFormat(cfWatchTextFormat); +} + +void DeinitCheatFinder (void) +{ + CFRelease(cfListLineCTFontRef); + + delete [] cfStoredRAM; + delete [] cfLastRAM; + delete [] cfCurrentRAM; + delete [] cfStatusFlag; + delete [] cfAddress; +} + +void CheatFinder (void) +{ +// static HIObjectClassRef cfListViewClass = NULL; +// +// OSStatus err; +// HIViewRef ctl; +// HIViewID cid; +// char num[256]; +// WindowData cf; +// EventHandlerRef wEref, pEref; +// EventHandlerUPP wUPP, pUPP; +// EventTypeSpec wEvents[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus }, +// { kEventClassWindow, kEventWindowClose } }, +// pEvents[] = { { kEventClassControl, kEventControlDraw } }, +// cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, +// { kEventClassHIObject, kEventHIObjectInitialize }, +// { kEventClassHIObject, kEventHIObjectDestruct }, +// { kEventClassScrollable, kEventScrollableGetInfo }, +// { kEventClassScrollable, kEventScrollableScrollTo }, +// { kEventCheatFinderList, kEventScrollableScrollThere }, +// { kEventClassControl, kEventControlHitTest }, +// { kEventClassControl, kEventControlTrack }, +// { kEventClassControl, kEventControlValueFieldChanged }, +// { kEventClassControl, kEventControlDraw } }; +// +// if (!cartOpen) +// return; +// +// err = CreateNibReference(kMacS9XCFString, &(cf.nibRef)); +// if (err == noErr) +// { +// err = CreateWindowFromNib(cf.nibRef, CFSTR("CheatFinder"), &(cf.main)); +// if (err == noErr) +// { +// err = CreateWindowFromNib(cf.nibRef, CFSTR("CFDrawer"), &(cf.drawer)); +// if (err == noErr) +// { +// memcpy(cfCurrentRAM, Memory.RAM, MAIN_MEMORY_SIZE); +// CheatFinderBuildResultList(); +// +// err = noErr; +// if (!cfListViewClass) +// err = HIObjectRegisterSubclass(kCheatFinderListViewClassID, kHIViewClassID, 0, CheatFinderListViewHandler, GetEventTypeCount(cEvents), cEvents, NULL, &cfListViewClass); +// if (err == noErr) +// { +// HIObjectRef hiObject; +// HIViewRef userpane, scrollview, listview, imageview, root; +// HILayoutInfo layoutinfo; +// HIRect frame; +// HISize minSize; +// CGImageRef image; +// Rect rct; +// float pich; +// +// GetWindowBounds(cf.main, kWindowContentRgn, &rct); +// +// minSize.width = (float) (rct.right - rct.left); +// minSize.height = (float) (rct.bottom - rct.top ); +// err = SetWindowResizeLimits(cf.main, &minSize, NULL); +// +// root = HIViewGetRoot(cf.main); +// cid.id = 0; +// cid.signature = kCFUserPane; +// HIViewFindByID(root, cid, &userpane); +// +// err = HIScrollViewCreate(kHIScrollViewOptionsVertScroll, &scrollview); +// HIViewAddSubview(userpane, scrollview); +// HIViewGetBounds(userpane, &frame); +// cfListAddrColumnWidth = (int) (frame.size.width * 0.4); +// frame.origin.y += 16.0f; +// frame.size.height -= 16.0f; +// frame = CGRectInset(frame, 1.0f, 1.0f); +// HIViewSetFrame(scrollview, &frame); +// HIViewSetVisible(scrollview, true); +// cf.scroll = scrollview; +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// HIViewGetLayoutInfo(scrollview, &layoutinfo); +// +// layoutinfo.binding.top.toView = userpane; +// layoutinfo.binding.top.kind = kHILayoutBindTop; +// layoutinfo.binding.bottom.toView = userpane; +// layoutinfo.binding.bottom.kind = kHILayoutBindBottom; +// layoutinfo.binding.left.toView = userpane; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = userpane; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// HIViewSetLayoutInfo(scrollview, &layoutinfo); +// +// err = HIObjectCreate(kCheatFinderListViewClassID, NULL, &hiObject); +// listview = (HIViewRef) hiObject; +// HIViewAddSubview(scrollview, listview); +// SetControl32BitMinimum(listview, 1); +// SetControl32BitMaximum(listview, cfNumRows); +// SetControl32BitValue(listview, 1); +// HIViewSetVisible(listview, true); +// cf.list = listview; +// +// cid.signature = kCFNumBytesPop; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfViewNumBytes); +// +// cid.signature = kCFViewModeRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfViewMode); +// +// cid.signature = kCFCompModePop; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompMode); +// +// if (cfIsNewGame || (!cfIsStored && (cfCompWith == kCFCompWithStored))) +// cfCompWith = kCFCompWithThis; +// +// cid.signature = kCFCompStoredRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); +// if (cfIsStored) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// cid.signature = kCFCompLastRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); +// if (!cfIsNewGame) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// cid.signature = kCFCompThisRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); +// +// cid.signature = kCFCompValueTxt; +// HIViewFindByID(root, cid, &ctl); +// SetEditTextCFString(ctl, CFSTR(""), false); +// err = SetKeyboardFocus(cf.main, ctl, kControlFocusNextPart); +// +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfIsWatching); +// +// cid.signature = kCFDrawerBtn; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfDrawerShow); +// +// cid.signature = kCFWatchAddrTxt; +// HIViewFindByID(root, cid, &ctl); +// if (cfIsWatching) +// { +// sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); +// SetStaticTextCStr(ctl, num, false); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), false); +// +// CheatFinderAdjustButtons(&cf); +// +// pUPP = NewEventHandlerUPP(CheatFinderListFrameEventHandler); +// err = InstallControlEventHandler(userpane, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) userpane, &pEref); +// +// wUPP = NewEventHandlerUPP(CheatFinderWindowEventHandler); +// err = InstallWindowEventHandler (cf.main, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) &cf, &wEref); +// +// pich = (float) (IPPU.RenderedScreenHeight >> ((IPPU.RenderedScreenHeight > 256) ? 1 : 0)); +// +// err = SetDrawerParent(cf.drawer, cf.main); +// err = SetDrawerOffsets(cf.drawer, 0.0f, (float) ((rct.bottom - rct.top) - (pich + 37))); +// +// image = CreateGameScreenCGImage(); +// if (image) +// { +// err = HIImageViewCreate(image, &imageview); +// if (err == noErr) +// { +// HIViewFindByID(HIViewGetRoot(cf.drawer), kHIViewWindowContentID, &ctl); +// +// HIViewAddSubview(ctl, imageview); +// HIImageViewSetOpaque(imageview, false); +// HIImageViewSetScaleToFit(imageview, true); +// HIViewSetVisible(imageview, true); +// +// frame.origin.x = 8.0f; +// frame.origin.y = 8.0f; +// frame.size.width = (float) SNES_WIDTH; +// frame.size.height = pich; +// HIViewSetFrame(imageview, &frame); +// } +// } +// +// MoveWindowPosition(cf.main, kWindowCheatFinder, true); +// ShowWindow(cf.main); +// +// if (cfDrawerShow) +// err = OpenDrawer(cf.drawer, kWindowEdgeDefault, false); +// +// err = RunAppModalLoopForWindow(cf.main); +// +// HideWindow(cf.main); +// SaveWindowPosition(cf.main, kWindowCheatFinder); +// +// err = RemoveEventHandler(pEref); +// DisposeEventHandlerUPP(pUPP); +// +// err = RemoveEventHandler(wEref); +// DisposeEventHandlerUPP(wUPP); +// +// if (image) +// CGImageRelease(image); +// } +// +// CFRelease(cf.drawer); +// } +// +// CFRelease(cf.main); +// } +// +// DisposeNibReference(cf.nibRef); +// +// memcpy(cfLastRAM, Memory.RAM, MAIN_MEMORY_SIZE); +// cfIsNewGame = false; +// } +} + +static SInt64 CheatFinderReadBytes (UInt8 *mem, UInt32 addr) +{ + switch (cfViewMode) + { + case kCFSignedDecimal: + { + switch (cfViewNumBytes) + { + case 1: return ((SInt64) (SInt8) mem[addr]); + case 2: return ((SInt64) (SInt16) (mem[addr] | (mem[addr + 1] << 8))); + case 4: return ((SInt64) (SInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); + case 3: return ((SInt64) (((SInt32) ((mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16)) << 8)) >> 8)); + } + + break; + } + + case kCFUnsignedDecimal: + case kCFHexadecimal: + { + switch (cfViewNumBytes) + { + case 1: return ((SInt64) (UInt8) mem[addr]); + case 2: return ((SInt64) (UInt16) (mem[addr] | (mem[addr + 1] << 8))); + case 3: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16))); + case 4: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); + } + + break; + } + } + + return (0); +} + + +static SInt64 CheatFinderGetValueEditText (HIViewRef control) +{ + SInt64 result = 0; + UInt32 uvalue; + SInt32 svalue; + char num[256]; + + GetEditTextCStr(control, num); + if (num[0] == 0) + { + SetEditTextCFString(control, CFSTR("0"), true); + return (0); + } + + switch (cfViewMode) + { + case kCFSignedDecimal: + { + if (sscanf(num, "%ld", &svalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (svalue > 127) + { + svalue = 127; + SetEditTextCFString(control, CFSTR("127"), true); + } + else + if (svalue < -128) + { + svalue = -128; + SetEditTextCFString(control, CFSTR("-128"), true); + } + + break; + } + + case 2: + { + if (svalue > 32767) + { + svalue = 32767; + SetEditTextCFString(control, CFSTR("32767"), true); + } + else + if (svalue < -32768) + { + svalue = -32768; + SetEditTextCFString(control, CFSTR("-32768"), true); + } + + break; + } + + case 3: + { + if (svalue > 8388607) + { + svalue = 8388607; + SetEditTextCFString(control, CFSTR("8388607"), true); + } + else + if (svalue < -8388608) + { + svalue = -8388608; + SetEditTextCFString(control, CFSTR("-8388608"), true); + } + + break; + } + } + } + else + { + svalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) svalue; + + break; + } + + case kCFUnsignedDecimal: + { + if (sscanf(num, "%lu", &uvalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (uvalue > 255) + { + uvalue = 255; + SetEditTextCFString(control, CFSTR("255"), true); + } + + break; + } + + case 2: + { + if (uvalue > 65535) + { + uvalue = 65535; + SetEditTextCFString(control, CFSTR("65535"), true); + } + + break; + } + + case 3: + { + if (uvalue > 16777215) + { + uvalue = 16777215; + SetEditTextCFString(control, CFSTR("16777215"), true); + } + + break; + } + } + } + else + { + uvalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) uvalue; + + break; + } + + case kCFHexadecimal: + { + if (sscanf(num, "%lx", &uvalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (uvalue > 0xFF) + { + uvalue = 0xFF; + SetEditTextCFString(control, CFSTR("FF"), true); + } + + break; + } + + case 2: + { + if (uvalue > 0xFFFF) + { + uvalue = 0xFFFF; + SetEditTextCFString(control, CFSTR("FFFF"), true); + } + + break; + } + + case 3: + { + if (uvalue > 0xFFFFFF) + { + uvalue = 0xFFFFFF; + SetEditTextCFString(control, CFSTR("FFFFFF"), true); + } + + break; + } + } + } + else + { + uvalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) uvalue; + + break; + } + } + + return (result); +} + +static void CheatFinderSearch (WindowData *cf) +{ +// SInt64 cmpvalue; +// UInt8 *mem; +// +// if (cfCompWith == kCFCompWithThis) +// { +// HIViewRef ctl; +// HIViewID cid = { kCFCompValueTxt, 0 }; +// +// HIViewFindByID(HIViewGetRoot(cf->main), cid, &ctl); +// cmpvalue = CheatFinderGetValueEditText(ctl); +// +// for (int i = 0; i < cfNumRows; i++) +// if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), cmpvalue)) +// cfStatusFlag[cfAddress[i]] = 0; +// } +// else +// { +// mem = (cfCompWith == kCFCompWithStored) ? cfStoredRAM : cfLastRAM; +// +// for (int i = 0; i < cfNumRows; i++) +// if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), CheatFinderReadBytes(mem, cfAddress[i]))) +// cfStatusFlag[cfAddress[i]] = 0; +// } +// +// CheatFinderBuildResultList(); +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, 1); +} + +static Boolean CheatFinderCompare (SInt64 ramvalue, SInt64 cmpvalue) +{ + switch (cfCompMode) + { + case kCFSearchEqual: return (ramvalue == cmpvalue); + case kCFSearchNotEqual: return (ramvalue != cmpvalue); + case kCFSearchGreater: return (ramvalue > cmpvalue); + case kCFSearchGreaterOrEqual: return (ramvalue >= cmpvalue); + case kCFSearchLess: return (ramvalue < cmpvalue); + case kCFSearchLessOrEqual: return (ramvalue <= cmpvalue); + } + + return (false); +} + +static void CheatFinderBuildResultList (void) +{ + cfNumRows = 0; + + for (int i = 0; i < MAIN_MEMORY_SIZE; i++) + { + if (cfStatusFlag[i] == 0xFF) + { + cfAddress[cfNumRows] = i; + cfNumRows++; + } + } + + cfListSelection = 0; +} + +static void CheatFinderAdjustButtons (WindowData *cf) +{ +// HIViewRef ctl, root; +// HIViewID cid; +// +// cid.id = 0; +// root = HIViewGetRoot(cf->main); +// +// if (cfNumRows > 0) +// { +// cid.signature = kCFAddEntryBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// +// cid.signature = kCFRemoveBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// } +// else +// { +// cid.signature = kCFAddEntryBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// +// cid.signature = kCFRemoveBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// +// if (!cfIsWatching) +// { +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// } +// } +} + +static void CheatFinderRemoveFromList (WindowData *cf) +{ +// if (cfNumRows > 0) +// { +// cfStatusFlag[cfAddress[cfListSelection]] = 0; +// +// if (cfNumRows == 1) +// { +// cfNumRows = 0; +// +// SetControl32BitMaximum(cf->list, 0); +// SetControl32BitValue(cf->list, 1); +// } +// else +// { +// for (int i = cfListSelection; i < cfNumRows - 1; i++) +// cfAddress[i] = cfAddress[i + 1]; +// +// cfNumRows--; +// if (cfListSelection >= cfNumRows) +// cfListSelection = cfNumRows - 1; +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, cfListSelection + 1); +// } +// } +} + +static void CheatFinderRestoreList (WindowData *cf) +{ +// memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); +// CheatFinderBuildResultList(); +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, 1); +} + +static void CheatFinderMakeValueFormat (char *text) +{ +// switch (cfViewMode) +// { +// case kCFSignedDecimal: +// case kCFUnsignedDecimal: +// { +// strcpy(text, "%lld"); +// break; +// } +// +// case kCFHexadecimal: +// { +// sprintf(text, "%%0%lullX", cfViewNumBytes * 2); +// break; +// } +// } +} + +void CheatFinderDrawWatchAddr (void) +{ +// static char code[256]; +// +// uint16 *basePtr; +// int len; +// +// sprintf(code, cfWatchTextFormat, CheatFinderReadBytes(Memory.RAM, cfWatchAddr)); +// +// basePtr = GFX.Screen + 1; +// len = strlen(code); +// +// for (int i = 0; i < len; i++) +// { +// S9xDisplayChar(basePtr, code[i]); +// basePtr += (8 - 1); +// } +} + +static void CheatFinderHandleAddEntryButton (WindowData *cf) +{ +// if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) +// NSBeep(); +// else +// if (Cheat.g.size() + cfViewNumBytes > MAC_MAX_CHEATS) +// AppearanceAlert(kAlertCautionAlert, kS9xMacAlertCFCantAddEntry, kS9xMacAlertCFCantAddEntryHint); +// else +// CheatFinderBeginAddEntrySheet(cf); +} + +static void CheatFinderBeginAddEntrySheet (WindowData *cf) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// UInt32 addr; +// char str[256], form[256]; +// EventTypeSpec sEvents[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// +// err = CreateWindowFromNib(cf->nibRef, CFSTR("CFAddEntry"), &(cf->sheet)); +// if (err == noErr) +// { +// addr = cfAddress[cfListSelection]; +// +// root = HIViewGetRoot(cf->sheet); +// cid.id = 0; +// +// cid.signature = kCFSheetAddrTxt; +// HIViewFindByID(root, cid, &ctl); +// sprintf(str, "%06lX", addr + 0x7E0000); +// SetStaticTextCStr(ctl, str, false); +// +// cid.signature = kCFSheetCurrentValueTxt; +// HIViewFindByID(root, cid, &ctl); +// CheatFinderMakeValueFormat(form); +// sprintf(str, form, CheatFinderReadBytes(cfCurrentRAM, addr)); +// SetStaticTextCStr(ctl, str, false); +// +// cid.signature = kCFSheetCheetValueTxt; +// HIViewFindByID(root, cid, &ctl); +// SetEditTextCStr(ctl, str, false); +// +// err = ClearKeyboardFocus(cf->sheet); +// err = SetKeyboardFocus(cf->sheet, ctl, kControlFocusNextPart); +// +// cid.signature = kCFSheetDescriptionTxt; +// HIViewFindByID(root, cid, &ctl); +// sprintf(str, "%06lX-%06lX", addr + 0x7E0000, addr + cfViewNumBytes - 1 + 0x7E0000); +// SetStaticTextCStr(ctl, str, false); +// +// cf->sUPP = NewEventHandlerUPP(CheatFinderSheetEventHandler); +// err = InstallWindowEventHandler(cf->sheet, cf->sUPP, GetEventTypeCount(sEvents), sEvents, (void *) cf, &(cf->sEref)); +// +// err = ShowSheetWindow(cf->sheet, cf->main); +// } +} + +static void CheatFinderEndAddEntrySheet (WindowData *cf) +{ +// if (cf->sheet) +// { +// OSStatus err; +// +// err = HideSheetWindow(cf->sheet); +// +// err = RemoveEventHandler(cf->sEref); +// DisposeEventHandlerUPP(cf->sUPP); +// +// CFRelease(cf->sheet); +// } +} + + +static void CheatFinderAddEntry (SInt64 value, char *description) +{ + UInt32 addr, v; + + addr = cfAddress[cfListSelection]; + v = (UInt32) (SInt32) value; + + for (unsigned int i = 0; i < cfViewNumBytes; i++) + { + char code[10]; + snprintf(code, 10, "%x=%x", addr + i + 0x7E0000, (UInt8) ((v & (0x000000FF << (i * 8))) >> (i * 8))); + int index = S9xAddCheatGroup(description, code); + if(index >= 0) + S9xEnableCheatGroup(index); + } +} + +static void CheatFinderListViewDraw (CGContextRef ctx, HIRect *bounds, ListViewData *myData) +{ +// static Boolean init = true; +// +// if (systemVersion >= 0x1050) +// { +// static CGRect aRct, vRct; +// +// CTLineRef line; +// CFDictionaryRef attr; +// CFAttributedStringRef astr; +// CFStringRef str; +// HIRect lineBounds; +// SInt32 start, end, val, max; +// float ax, vx, y, f; +// char format[32], t1[64], t2[64]; +// +// CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName }; +// CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }, +// wval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorWhite) }; +// +// CheatFinderMakeValueFormat(format); +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; +// +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// lineBounds = *bounds; +// lineBounds.size.height = myData->lineSize.height; +// lineBounds.origin.y = y; +// +// val = GetControl32BitValue(myData->view) - 1; +// max = GetControl32BitMaximum(myData->view); +// +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// +// CGContextSetTextMatrix(ctx, CGAffineTransformIdentity); +// +// if (init) +// { +// CGContextSetTextPosition(ctx, 0.0f, 0.0f); +// +// astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFF"), attr); +// line = CTLineCreateWithAttributedString(astr); +// aRct = CTLineGetImageBounds(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// +// astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFFFFFFF"), attr); +// line = CTLineCreateWithAttributedString(astr); +// vRct = CTLineGetImageBounds(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// +// init = false; +// } +// +// ax = (float) (int) (((float) cfListAddrColumnWidth - 2.0 - aRct.size.width) / 2.0); +// vx = (float) (int) (lineBounds.origin.x + lineBounds.size.width - vRct.size.width - 12.0); +// +// for (int i = start; i <= end; i++) +// { +// if ((i == val) && cfNumRows) +// CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); +// else +// if ((i - start) % 2 == 0) +// CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); +// +// CGContextFillRect(ctx, lineBounds); +// +// if (i < max) +// { +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// { +// CFRelease(attr); +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &wval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// } +// +// f = -(y + 12.0f); +// +// sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); +// str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); +// astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); +// line = CTLineCreateWithAttributedString(astr); +// CGContextSetTextPosition(ctx, ax, f); +// CTLineDraw(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// CFRelease(str); +// +// sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); +// strcpy(t1, " "); +// t1[11 - strlen(t2)] = 0; +// strcat(t1, t2); +// str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); +// astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); +// line = CTLineCreateWithAttributedString(astr); +// CGContextSetTextPosition(ctx, vx, f); +// CTLineDraw(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// CFRelease(str); +// +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// { +// CFRelease(attr); +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// } +// } +// +// y += myData->lineSize.height; +// lineBounds.origin.y += myData->lineSize.height; +// } +// +// CFRelease(attr); +// } +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// else +// { +// static Rect aRect = { 0, 0, 0, 0 }, vRect = { 0, 0, 0, 0 }; +// +// OSStatus err; +// ATSUTextLayout layout; +// HIRect lineBounds; +// UniCharCount runLength[1], len; +// SInt32 start, end, val, max; +// Fixed ax, vx, f; +// float y; +// UniChar unistr[64]; +// char format[32], t1[64], t2[64]; +// +// ATSUAttributeTag theTags[] = { kATSUCGContextTag }; +// ByteCount theSizes[] = { sizeof(CGContextRef) }; +// ATSUAttributeValuePtr theValues[] = { &ctx }; +// +// CheatFinderMakeValueFormat(format); +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; +// +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// lineBounds = *bounds; +// lineBounds.size.height = myData->lineSize.height; +// lineBounds.origin.y = y; +// +// val = GetControl32BitValue(myData->view) - 1; +// max = GetControl32BitMaximum(myData->view); +// +// if (init) +// { +// f = Long2Fix(0); +// for (unsigned int n = 0; n < 11; n++) +// unistr[n] = 'F'; +// +// len = runLength[0] = 6; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &aRect); +// err = ATSUDisposeTextLayout(layout); +// +// len = runLength[0] = 11; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &vRect); +// err = ATSUDisposeTextLayout(layout); +// +// init = false; +// } +// +// ax = Long2Fix((cfListAddrColumnWidth - 2 - (aRect.right - aRect.left)) >> 1); +// vx = Long2Fix((int) (lineBounds.origin.x + lineBounds.size.width) - (vRect.right - vRect.left) - 13); +// +// for (int i = start; i <= end; i++) +// { +// if ((i == val) && cfNumRows) +// CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); +// else +// if ((i - start) % 2 == 0) +// CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); +// +// CGContextFillRect(ctx, lineBounds); +// +// if (i < max) +// { +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); +// +// f = Long2Fix(-((int) y + 12)); +// +// sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); +// len = runLength[0] = strlen(t1); +// for (unsigned int n = 0; n < len; n++) +// unistr[n] = t1[n]; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, ax, f); +// err = ATSUDisposeTextLayout(layout); +// +// sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); +// strcpy(t1, " "); +// t1[11 - strlen(t2)] = 0; +// strcat(t1, t2); +// len = runLength[0] = strlen(t1); +// for (unsigned int n = 0; n < len; n++) +// unistr[n] = t1[n]; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, vx, f); +// err = ATSUDisposeTextLayout(layout); +// +// CGContextScaleCTM(ctx, 1, -1); +// } +// +// y += myData->lineSize.height; +// lineBounds.origin.y += myData->lineSize.height; +// } +// } +//#endif +} + +static HIViewPartCode CheatFinderListViewFindPart (EventRef inEvent, ListViewData *myData, SInt32 *whichLine) +{ +// OSStatus err; +// HIViewPartCode part; +// HIPoint hipt; +// SInt32 start, line; +// float y; +// +// part = kControlNoPart; +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); +// if (err == noErr) +// { +// line = start + (SInt32) ((hipt.y - y - 1) / myData->lineSize.height) + 1; +// +// if (line <= GetControl32BitMaximum(myData->view)) +// part = kControlListLinePart; +// +// if (whichLine != NULL) +// *whichLine = line; +// } +// +// return (part); + return 0; +} + +static float CheatFinderListViewSanityCheck (float where, ListViewData *myData) +{ + HIRect bounds; + HISize imageSize; + +// HIViewGetBounds(myData->view, &bounds); +// imageSize = myData->lineSize; +// imageSize.height *= GetControl32BitMaximum(myData->view); + + if (where + bounds.size.height > imageSize.height) + where = imageSize.height - bounds.size.height; + if (where < 0) + where = 0; + + return (where); +} + +static void CheatFinderListViewScrollToThere (float where, ListViewData *myData) +{ + OSStatus err; + EventRef theEvent; + HIPoint whereP = { 0.0f, where }; + + err = CreateEvent(kCFAllocatorDefault, kEventCheatFinderList, kEventScrollableScrollThere, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); + if (err == noErr) + { + err = SetEventParameter(theEvent, kEventParamOrigin, typeHIPoint, sizeof(whereP), &whereP); +// if (err == noErr) +// err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); + + ReleaseEvent(theEvent); + } +} diff --git a/macosx/mac-client.cpp b/macosx/mac-client.mm similarity index 97% rename from macosx/mac-client.cpp rename to macosx/mac-client.mm index e7f0d217..82969182 100644 --- a/macosx/mac-client.cpp +++ b/macosx/mac-client.mm @@ -136,9 +136,9 @@ static bool8 NPClientReplyPhaseSpanTest (void); static void * NPClientConnectThread (void *); static void * NPClientPrepareThread (void *); static void * NPClientNetPlayThread (void *); -static pascal void NPClientDialogTimerHandler (EventLoopTimerRef, void *); -static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *); +static void NPClientDialogTimerHandler (EventLoopTimerRef, void *); +static OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *); bool8 NPClientDialog (void) @@ -230,7 +230,7 @@ bool8 NPClientDialog (void) return (!npclient.dialogcancel); } -static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; @@ -335,7 +335,7 @@ static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandler return (result); } -static pascal void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) +static void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) { WindowRef window = (WindowRef) userData; HIViewRef ctl; @@ -740,7 +740,7 @@ static bool8 NPClientBeginOpenROMImage (WindowRef window) replaceAt = CFStringGetIntValue(numRef); CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - r = NavBeginOpenROMImageSheet(window, mesRef); + // r = NavBeginOpenROMImageSheet(window, mesRef); CFRelease(mesRef); CFRelease(baseRef); @@ -1017,7 +1017,7 @@ static void NPClientEndPlayerListSheet (void) err = HideSheetWindow(sRef); } -static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { if (!npclient.dialogsheet) return (eventNotHandledErr); diff --git a/macosx/mac-cocoatools.h b/macosx/mac-cocoatools.h index 2281c236..02870031 100644 --- a/macosx/mac-cocoatools.h +++ b/macosx/mac-cocoatools.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cocoatools.mm b/macosx/mac-cocoatools.mm index 2cdc91d2..b716166c 100644 --- a/macosx/mac-cocoatools.mm +++ b/macosx/mac-cocoatools.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -25,37 +26,34 @@ void CocoaPlayFreezeDefrostSound (void) { - NSAutoreleasePool *pool; NSBundle *bundle; NSString *path; NSSound *sound; BOOL r; - pool = [[NSAutoreleasePool alloc] init]; - - bundle = [NSBundle mainBundle]; - path = [bundle pathForSoundResource: @"freeze_defrost"]; - if (path) - { - sound = [[NSSound alloc] initWithContentsOfFile: path byReference: YES]; - if (sound) - { - r = [sound play]; - [sound release]; - } - } - - [pool release]; + @autoreleasepool + { + bundle = [NSBundle mainBundle]; + path = [bundle pathForSoundResource: @"freeze_defrost"]; + if (path) + { + sound = [[NSSound alloc] initWithContentsOfFile: path byReference: YES]; + if (sound) + { + r = [sound play]; + } + } + } } void CocoaAddStatTextToView (NSView *view, NSString *label, float x, float y, float w, float h, NSTextField **out) { NSTextField *control; - control = [[[NSTextField alloc] init] autorelease]; + control = [[NSTextField alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setStringValue: NSLocalizedString(label, @"")]; [control setBezeled: NO]; [control setDrawsBackground: NO]; @@ -73,10 +71,10 @@ void CocoaAddEditTextToView (NSView *view, NSString *label, float x, float y, fl { NSTextField *control; - control = [[[NSTextField alloc] init] autorelease]; + control = [[NSTextField alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setStringValue: NSLocalizedString(label, @"")]; [control setBezeled: YES]; [control setDrawsBackground: YES]; @@ -94,13 +92,13 @@ void CocoaAddMPushBtnToView (NSView *view, NSString *label, float x, float y, fl { NSButton *control; - control = [[[NSButton alloc] init] autorelease]; + control = [[NSButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setTitle: NSLocalizedString(label, @"")]; - [control setBezelStyle: NSRoundedBezelStyle]; - [control setButtonType: NSMomentaryPushInButton]; + [control setBezelStyle: NSBezelStyleRounded]; + [control setButtonType: NSButtonTypeMomentaryPushIn]; [view addSubview: control]; [control setFrame: NSMakeRect(x, y, w, h)]; @@ -113,12 +111,12 @@ void CocoaAddCheckBoxToView (NSView *view, NSString *label, float x, float y, fl { NSButton *control; - control = [[[NSButton alloc] init] autorelease]; + control = [[NSButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setTitle: NSLocalizedString(label, @"")]; - [control setButtonType: NSSwitchButton]; + [control setButtonType: NSButtonTypeSwitch]; [view addSubview: control]; [control setFrame: NSMakeRect(x, y, w, h)]; @@ -131,9 +129,9 @@ void CocoaAddPopUpBtnToView (NSView *view, NSArray *array, float x, float y, flo { NSPopUpButton *control; NSMenu *menu; - int n; + NSUInteger n; - menu = [[[NSMenu alloc] init] autorelease]; + menu = [[NSMenu alloc] init]; n = [array count]; for (int i = 0; i < n; i++) @@ -145,10 +143,10 @@ void CocoaAddPopUpBtnToView (NSView *view, NSArray *array, float x, float y, flo [menu addItemWithTitle: item action: NULL keyEquivalent: @""]; } - control = [[[NSPopUpButton alloc] init] autorelease]; + control = [[NSPopUpButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setPullsDown: NO]; [control setMenu: menu]; diff --git a/macosx/mac-controls.cpp b/macosx/mac-controls.cpp deleted file mode 100644 index 4a5e5faf..00000000 --- a/macosx/mac-controls.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" -#include "controls.h" - -#include "mac-prefix.h" -#include "mac-joypad.h" -#include "mac-keyboard.h" -#include "mac-os.h" -#include "mac-controls.h" - -#define ASSIGN_BUTTONf(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), false) -#define ASSIGN_BUTTONt(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), true) -#define ASSIGN_POINTRf(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), false) -#define ASSIGN_POINTRt(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), true) - -#define KeyIsPressed(km, k) (1 & (((unsigned char *) km) [(k) >> 3] >> ((k) & 7))) - - -void S9xSetupDefaultKeymap (void) -{ - s9xcommand_t cmd; - - ASSIGN_BUTTONf(kMacCMapPad1PX, "Joypad1 X"); - ASSIGN_BUTTONf(kMacCMapPad1PA, "Joypad1 A"); - ASSIGN_BUTTONf(kMacCMapPad1PB, "Joypad1 B"); - ASSIGN_BUTTONf(kMacCMapPad1PY, "Joypad1 Y"); - ASSIGN_BUTTONf(kMacCMapPad1PL, "Joypad1 L"); - ASSIGN_BUTTONf(kMacCMapPad1PR, "Joypad1 R"); - ASSIGN_BUTTONf(kMacCMapPad1PSelect, "Joypad1 Select"); - ASSIGN_BUTTONf(kMacCMapPad1PStart, "Joypad1 Start"); - ASSIGN_BUTTONf(kMacCMapPad1PUp, "Joypad1 Up"); - ASSIGN_BUTTONf(kMacCMapPad1PDown, "Joypad1 Down"); - ASSIGN_BUTTONf(kMacCMapPad1PLeft, "Joypad1 Left"); - ASSIGN_BUTTONf(kMacCMapPad1PRight, "Joypad1 Right"); - - ASSIGN_BUTTONf(kMacCMapPad2PX, "Joypad2 X"); - ASSIGN_BUTTONf(kMacCMapPad2PA, "Joypad2 A"); - ASSIGN_BUTTONf(kMacCMapPad2PB, "Joypad2 B"); - ASSIGN_BUTTONf(kMacCMapPad2PY, "Joypad2 Y"); - ASSIGN_BUTTONf(kMacCMapPad2PL, "Joypad2 L"); - ASSIGN_BUTTONf(kMacCMapPad2PR, "Joypad2 R"); - ASSIGN_BUTTONf(kMacCMapPad2PSelect, "Joypad2 Select"); - ASSIGN_BUTTONf(kMacCMapPad2PStart, "Joypad2 Start"); - ASSIGN_BUTTONf(kMacCMapPad2PUp, "Joypad2 Up"); - ASSIGN_BUTTONf(kMacCMapPad2PDown, "Joypad2 Down"); - ASSIGN_BUTTONf(kMacCMapPad2PLeft, "Joypad2 Left"); - ASSIGN_BUTTONf(kMacCMapPad2PRight, "Joypad2 Right"); - - ASSIGN_BUTTONf(kMacCMapPad3PX, "Joypad3 X"); - ASSIGN_BUTTONf(kMacCMapPad3PA, "Joypad3 A"); - ASSIGN_BUTTONf(kMacCMapPad3PB, "Joypad3 B"); - ASSIGN_BUTTONf(kMacCMapPad3PY, "Joypad3 Y"); - ASSIGN_BUTTONf(kMacCMapPad3PL, "Joypad3 L"); - ASSIGN_BUTTONf(kMacCMapPad3PR, "Joypad3 R"); - ASSIGN_BUTTONf(kMacCMapPad3PSelect, "Joypad3 Select"); - ASSIGN_BUTTONf(kMacCMapPad3PStart, "Joypad3 Start"); - ASSIGN_BUTTONf(kMacCMapPad3PUp, "Joypad3 Up"); - ASSIGN_BUTTONf(kMacCMapPad3PDown, "Joypad3 Down"); - ASSIGN_BUTTONf(kMacCMapPad3PLeft, "Joypad3 Left"); - ASSIGN_BUTTONf(kMacCMapPad3PRight, "Joypad3 Right"); - - ASSIGN_BUTTONf(kMacCMapPad4PX, "Joypad4 X"); - ASSIGN_BUTTONf(kMacCMapPad4PA, "Joypad4 A"); - ASSIGN_BUTTONf(kMacCMapPad4PB, "Joypad4 B"); - ASSIGN_BUTTONf(kMacCMapPad4PY, "Joypad4 Y"); - ASSIGN_BUTTONf(kMacCMapPad4PL, "Joypad4 L"); - ASSIGN_BUTTONf(kMacCMapPad4PR, "Joypad4 R"); - ASSIGN_BUTTONf(kMacCMapPad4PSelect, "Joypad4 Select"); - ASSIGN_BUTTONf(kMacCMapPad4PStart, "Joypad4 Start"); - ASSIGN_BUTTONf(kMacCMapPad4PUp, "Joypad4 Up"); - ASSIGN_BUTTONf(kMacCMapPad4PDown, "Joypad4 Down"); - ASSIGN_BUTTONf(kMacCMapPad4PLeft, "Joypad4 Left"); - ASSIGN_BUTTONf(kMacCMapPad4PRight, "Joypad4 Right"); - - ASSIGN_BUTTONf(kMacCMapPad5PX, "Joypad5 X"); - ASSIGN_BUTTONf(kMacCMapPad5PA, "Joypad5 A"); - ASSIGN_BUTTONf(kMacCMapPad5PB, "Joypad5 B"); - ASSIGN_BUTTONf(kMacCMapPad5PY, "Joypad5 Y"); - ASSIGN_BUTTONf(kMacCMapPad5PL, "Joypad5 L"); - ASSIGN_BUTTONf(kMacCMapPad5PR, "Joypad5 R"); - ASSIGN_BUTTONf(kMacCMapPad5PSelect, "Joypad5 Select"); - ASSIGN_BUTTONf(kMacCMapPad5PStart, "Joypad5 Start"); - ASSIGN_BUTTONf(kMacCMapPad5PUp, "Joypad5 Up"); - ASSIGN_BUTTONf(kMacCMapPad5PDown, "Joypad5 Down"); - ASSIGN_BUTTONf(kMacCMapPad5PLeft, "Joypad5 Left"); - ASSIGN_BUTTONf(kMacCMapPad5PRight, "Joypad5 Right"); - - ASSIGN_BUTTONf(kMacCMapPad6PX, "Joypad6 X"); - ASSIGN_BUTTONf(kMacCMapPad6PA, "Joypad6 A"); - ASSIGN_BUTTONf(kMacCMapPad6PB, "Joypad6 B"); - ASSIGN_BUTTONf(kMacCMapPad6PY, "Joypad6 Y"); - ASSIGN_BUTTONf(kMacCMapPad6PL, "Joypad6 L"); - ASSIGN_BUTTONf(kMacCMapPad6PR, "Joypad6 R"); - ASSIGN_BUTTONf(kMacCMapPad6PSelect, "Joypad6 Select"); - ASSIGN_BUTTONf(kMacCMapPad6PStart, "Joypad6 Start"); - ASSIGN_BUTTONf(kMacCMapPad6PUp, "Joypad6 Up"); - ASSIGN_BUTTONf(kMacCMapPad6PDown, "Joypad6 Down"); - ASSIGN_BUTTONf(kMacCMapPad6PLeft, "Joypad6 Left"); - ASSIGN_BUTTONf(kMacCMapPad6PRight, "Joypad6 Right"); - - ASSIGN_BUTTONf(kMacCMapPad7PX, "Joypad7 X"); - ASSIGN_BUTTONf(kMacCMapPad7PA, "Joypad7 A"); - ASSIGN_BUTTONf(kMacCMapPad7PB, "Joypad7 B"); - ASSIGN_BUTTONf(kMacCMapPad7PY, "Joypad7 Y"); - ASSIGN_BUTTONf(kMacCMapPad7PL, "Joypad7 L"); - ASSIGN_BUTTONf(kMacCMapPad7PR, "Joypad7 R"); - ASSIGN_BUTTONf(kMacCMapPad7PSelect, "Joypad7 Select"); - ASSIGN_BUTTONf(kMacCMapPad7PStart, "Joypad7 Start"); - ASSIGN_BUTTONf(kMacCMapPad7PUp, "Joypad7 Up"); - ASSIGN_BUTTONf(kMacCMapPad7PDown, "Joypad7 Down"); - ASSIGN_BUTTONf(kMacCMapPad7PLeft, "Joypad7 Left"); - ASSIGN_BUTTONf(kMacCMapPad7PRight, "Joypad7 Right"); - - ASSIGN_BUTTONf(kMacCMapPad8PX, "Joypad8 X"); - ASSIGN_BUTTONf(kMacCMapPad8PA, "Joypad8 A"); - ASSIGN_BUTTONf(kMacCMapPad8PB, "Joypad8 B"); - ASSIGN_BUTTONf(kMacCMapPad8PY, "Joypad8 Y"); - ASSIGN_BUTTONf(kMacCMapPad8PL, "Joypad8 L"); - ASSIGN_BUTTONf(kMacCMapPad8PR, "Joypad8 R"); - ASSIGN_BUTTONf(kMacCMapPad8PSelect, "Joypad8 Select"); - ASSIGN_BUTTONf(kMacCMapPad8PStart, "Joypad8 Start"); - ASSIGN_BUTTONf(kMacCMapPad8PUp, "Joypad8 Up"); - ASSIGN_BUTTONf(kMacCMapPad8PDown, "Joypad8 Down"); - ASSIGN_BUTTONf(kMacCMapPad8PLeft, "Joypad8 Left"); - ASSIGN_BUTTONf(kMacCMapPad8PRight, "Joypad8 Right"); - - ASSIGN_BUTTONt(kMacCMapMouse1PL, "Mouse1 L"); - ASSIGN_BUTTONt(kMacCMapMouse1PR, "Mouse1 R"); - ASSIGN_BUTTONt(kMacCMapMouse2PL, "Mouse2 L"); - ASSIGN_BUTTONt(kMacCMapMouse2PR, "Mouse2 R"); - - ASSIGN_BUTTONt(kMacCMapScopeOffscreen, "Superscope AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapScopeFire, "Superscope Fire"); - ASSIGN_BUTTONt(kMacCMapScopeCursor, "Superscope Cursor"); - ASSIGN_BUTTONt(kMacCMapScopeTurbo, "Superscope ToggleTurbo"); - ASSIGN_BUTTONt(kMacCMapScopePause, "Superscope Pause"); - - ASSIGN_BUTTONt(kMacCMapLGun1Offscreen, "Justifier1 AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapLGun1Trigger, "Justifier1 Trigger"); - ASSIGN_BUTTONt(kMacCMapLGun1Start, "Justifier1 Start"); - ASSIGN_BUTTONt(kMacCMapLGun2Offscreen, "Justifier2 AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapLGun2Trigger, "Justifier2 Trigger"); - ASSIGN_BUTTONt(kMacCMapLGun2Start, "Justifier2 Start"); - - ASSIGN_POINTRt(kMacCMapMouse1Pointer, "Pointer Mouse1"); - ASSIGN_POINTRt(kMacCMapMouse2Pointer, "Pointer Mouse2"); - ASSIGN_POINTRt(kMacCMapSuperscopePointer, "Pointer Superscope"); - ASSIGN_POINTRt(kMacCMapJustifier1Pointer, "Pointer Justifier1"); - - ASSIGN_POINTRf(PseudoPointerBase, "Pointer Justifier2"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 0, "ButtonToPointer 1u Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 1, "ButtonToPointer 1d Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 2, "ButtonToPointer 1l Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 3, "ButtonToPointer 1r Med"); -} - -bool S9xPollButton (uint32 id, bool *pressed) -{ - #define kmControlKey 0x3B - - KeyMap keys; - - GetKeys(keys); - - *pressed = false; - - if (id & k_MO) // mouse - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpMouseL); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseR); - } - } - else - if (id & k_SS) // superscope - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpOffScreen) | KeyIsPressed(keys, keyCode[kKeyOffScreen]); break; - case 2: *pressed = ISpKeyIsPressed(kISpScopeC) | KeyIsPressed(keys, keyCode[kKeyScopeCursor]); break; - case 3: *pressed = ISpKeyIsPressed(kISpScopeT) | KeyIsPressed(keys, keyCode[kKeyScopeTurbo]); break; - case 4: *pressed = ISpKeyIsPressed(kISpScopeP) | KeyIsPressed(keys, keyCode[kKeyScopePause]); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseL); - } - } - else - if (id & k_LG) // justifier - { - if (id & k_C1) - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpOffScreen) | KeyIsPressed(keys, keyCode[kKeyOffScreen]); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseL); break; - case 2: *pressed = ISpKeyIsPressed(kISpMouseR); - } - } - else - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISp2PStart) | KeyIsPressed(keys, keyCode[k2PStart]); break; - case 1: *pressed = ISpKeyIsPressed(kISp2PB) | KeyIsPressed(keys, keyCode[k2PB]); break; - case 2: *pressed = ISpKeyIsPressed(kISp2PA) | KeyIsPressed(keys, keyCode[k2PA]); - } - } - } - - return (true); -} - -bool S9xPollPointer (uint32 id, int16 *x, int16 *y) -{ - if (id & k_PT) - { - if ((id & k_MO) && fullscreen) - GetGameScreenPointer(x, y, true); - else - GetGameScreenPointer(x, y, false); - } - else - *x = *y = 0; - - return (true); -} - -bool S9xPollAxis (uint32 id, int16 *value) -{ - return (false); -} - -s9xcommand_t S9xGetPortCommandT (const char *name) -{ - s9xcommand_t cmd; - - memset(&cmd, 0, sizeof(cmd)); - cmd.type = S9xBadMapping; - - return (cmd); -} - -char * S9xGetPortCommandName (s9xcommand_t command) -{ - static char str[] = "PortCommand"; - - return (str); -} - -void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) -{ - return; -} - -bool8 S9xMapInput (const char *name, s9xcommand_t *cmd) -{ - return (true); -} - -void ControlPadFlagsToS9xReportButtons (int n, uint32 p) -{ - uint32 base = k_HD | k_BT | k_JP | (0x100 << n); - - S9xReportButton(base + 0, (p & 0x0040)); - S9xReportButton(base + 1, (p & 0x0080)); - S9xReportButton(base + 2, (p & 0x8000)); - S9xReportButton(base + 3, (p & 0x4000)); - S9xReportButton(base + 4, (p & 0x0020)); - S9xReportButton(base + 5, (p & 0x0010)); - S9xReportButton(base + 6, (p & 0x2000)); - S9xReportButton(base + 7, (p & 0x1000)); - S9xReportButton(base + 8, (p & 0x0800)); - S9xReportButton(base + 9, (p & 0x0400)); - S9xReportButton(base + 10, (p & 0x0200)); - S9xReportButton(base + 11, (p & 0x0100)); -} - -void ControlPadFlagsToS9xPseudoPointer (uint32 p) -{ - // prevent screwiness caused by trying to move the pointer left+right or up+down - if ((p & 0x0c00) == 0x0c00) p &= ~0x0c00; - if ((p & 0x0300) == 0x0300) p &= ~0x0300; - - // checks added to prevent a lack of right/down movement from breaking left/up movement - if (!(p & 0x0400)) - S9xReportButton(kMacCMapPseudoPtrBase + 0, (p & 0x0800)); - if (!(p & 0x0800)) - S9xReportButton(kMacCMapPseudoPtrBase + 1, (p & 0x0400)); - if (!(p & 0x0100)) - S9xReportButton(kMacCMapPseudoPtrBase + 2, (p & 0x0200)); - if (!(p & 0x0200)) - S9xReportButton(kMacCMapPseudoPtrBase + 3, (p & 0x0100)); -} diff --git a/macosx/mac-controls.h b/macosx/mac-controls.h index 409cfdaf..c29751c1 100644 --- a/macosx/mac-controls.h +++ b/macosx/mac-controls.h @@ -15,12 +15,17 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_controls_h_ #define _mac_controls_h_ +#define MAC_MAX_PLAYERS 8 + +#define KeyIsPressed(km, bm, p, k) (km[p][k] || bm[p][k]) + enum { k_HD = 0x80000000, @@ -172,11 +177,71 @@ enum kMacCMapMouse2Pointer = k_HD | k_PT | k_MO | k_C2, kMacCMapSuperscopePointer = k_HD | k_PT | k_SS | k_C1, kMacCMapJustifier1Pointer = k_HD | k_PT | k_LG | k_C1, + kMacCMapJustifier2Pointer = k_HD | k_PT | k_LG | k_C2, kMacCMapPseudoPtrBase = k_HD | k_PS | k_LG | k_C2 // for Justifier 2P }; +typedef enum +{ + kUp, + kDown, + kLeft, + kRight, + kY, + kB, + kX, + kA, + kL, + kR, + kStart, + kSelect, + + kKeyFastForward, + kKeyFreeze, + kKeyDefrost, + + kKeyScreenshot, + kKeySPC, + kKeyScopeTurbo, + kKeyScopePause, + kKeyScopeCursor, + kKeyOffScreen, + kKeyFunction, + kKeyAlt, + kKeyFFDown, + kKeyFFUp, + kKeyEsc, + kKeyTC, + kKeyMouseLeft, + kKeyMouseRight, + + kNumButtons +} S9xButtonCode; + +typedef enum { + kISpFastForward, + kISpFreeze, + kISpDefrost, + kISpScreenshot, + kISpSPC, + kISpScopeTurbo, + kISpScopePause, + kISpScopeCursor, + kISpOffScreen, + kISpFunction, + kISpAlt, + kISpFFDown, + kISpFFUp, + kISpEsc, + kISpTC, + kISpMouseLeft, + kISpMouseRight +} ISpKey; + void ControlPadFlagsToS9xReportButtons (int, uint32); void ControlPadFlagsToS9xPseudoPointer (uint32); +long ISpKeyIsPressed (bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons], ISpKey key); + #endif diff --git a/macosx/mac-controls.mm b/macosx/mac-controls.mm new file mode 100644 index 00000000..fd5570d0 --- /dev/null +++ b/macosx/mac-controls.mm @@ -0,0 +1,508 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" +#include "controls.h" + +#include "mac-prefix.h" +#include "mac-joypad.h" +#include "mac-keyboard.h" +#include "mac-os.h" +#include "mac-controls.h" + +#define ASSIGN_BUTTONf(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), false) +#define ASSIGN_BUTTONt(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), true) +#define ASSIGN_POINTRf(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), false) +#define ASSIGN_POINTRt(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), true) + +void S9xSetupDefaultKeymap (void) +{ + s9xcommand_t cmd; + + ASSIGN_BUTTONf(kMacCMapPad1PX, "Joypad1 X"); + ASSIGN_BUTTONf(kMacCMapPad1PA, "Joypad1 A"); + ASSIGN_BUTTONf(kMacCMapPad1PB, "Joypad1 B"); + ASSIGN_BUTTONf(kMacCMapPad1PY, "Joypad1 Y"); + ASSIGN_BUTTONf(kMacCMapPad1PL, "Joypad1 L"); + ASSIGN_BUTTONf(kMacCMapPad1PR, "Joypad1 R"); + ASSIGN_BUTTONf(kMacCMapPad1PSelect, "Joypad1 Select"); + ASSIGN_BUTTONf(kMacCMapPad1PStart, "Joypad1 Start"); + ASSIGN_BUTTONf(kMacCMapPad1PUp, "Joypad1 Up"); + ASSIGN_BUTTONf(kMacCMapPad1PDown, "Joypad1 Down"); + ASSIGN_BUTTONf(kMacCMapPad1PLeft, "Joypad1 Left"); + ASSIGN_BUTTONf(kMacCMapPad1PRight, "Joypad1 Right"); + + ASSIGN_BUTTONf(kMacCMapPad2PX, "Joypad2 X"); + ASSIGN_BUTTONf(kMacCMapPad2PA, "Joypad2 A"); + ASSIGN_BUTTONf(kMacCMapPad2PB, "Joypad2 B"); + ASSIGN_BUTTONf(kMacCMapPad2PY, "Joypad2 Y"); + ASSIGN_BUTTONf(kMacCMapPad2PL, "Joypad2 L"); + ASSIGN_BUTTONf(kMacCMapPad2PR, "Joypad2 R"); + ASSIGN_BUTTONf(kMacCMapPad2PSelect, "Joypad2 Select"); + ASSIGN_BUTTONf(kMacCMapPad2PStart, "Joypad2 Start"); + ASSIGN_BUTTONf(kMacCMapPad2PUp, "Joypad2 Up"); + ASSIGN_BUTTONf(kMacCMapPad2PDown, "Joypad2 Down"); + ASSIGN_BUTTONf(kMacCMapPad2PLeft, "Joypad2 Left"); + ASSIGN_BUTTONf(kMacCMapPad2PRight, "Joypad2 Right"); + + ASSIGN_BUTTONf(kMacCMapPad3PX, "Joypad3 X"); + ASSIGN_BUTTONf(kMacCMapPad3PA, "Joypad3 A"); + ASSIGN_BUTTONf(kMacCMapPad3PB, "Joypad3 B"); + ASSIGN_BUTTONf(kMacCMapPad3PY, "Joypad3 Y"); + ASSIGN_BUTTONf(kMacCMapPad3PL, "Joypad3 L"); + ASSIGN_BUTTONf(kMacCMapPad3PR, "Joypad3 R"); + ASSIGN_BUTTONf(kMacCMapPad3PSelect, "Joypad3 Select"); + ASSIGN_BUTTONf(kMacCMapPad3PStart, "Joypad3 Start"); + ASSIGN_BUTTONf(kMacCMapPad3PUp, "Joypad3 Up"); + ASSIGN_BUTTONf(kMacCMapPad3PDown, "Joypad3 Down"); + ASSIGN_BUTTONf(kMacCMapPad3PLeft, "Joypad3 Left"); + ASSIGN_BUTTONf(kMacCMapPad3PRight, "Joypad3 Right"); + + ASSIGN_BUTTONf(kMacCMapPad4PX, "Joypad4 X"); + ASSIGN_BUTTONf(kMacCMapPad4PA, "Joypad4 A"); + ASSIGN_BUTTONf(kMacCMapPad4PB, "Joypad4 B"); + ASSIGN_BUTTONf(kMacCMapPad4PY, "Joypad4 Y"); + ASSIGN_BUTTONf(kMacCMapPad4PL, "Joypad4 L"); + ASSIGN_BUTTONf(kMacCMapPad4PR, "Joypad4 R"); + ASSIGN_BUTTONf(kMacCMapPad4PSelect, "Joypad4 Select"); + ASSIGN_BUTTONf(kMacCMapPad4PStart, "Joypad4 Start"); + ASSIGN_BUTTONf(kMacCMapPad4PUp, "Joypad4 Up"); + ASSIGN_BUTTONf(kMacCMapPad4PDown, "Joypad4 Down"); + ASSIGN_BUTTONf(kMacCMapPad4PLeft, "Joypad4 Left"); + ASSIGN_BUTTONf(kMacCMapPad4PRight, "Joypad4 Right"); + + ASSIGN_BUTTONf(kMacCMapPad5PX, "Joypad5 X"); + ASSIGN_BUTTONf(kMacCMapPad5PA, "Joypad5 A"); + ASSIGN_BUTTONf(kMacCMapPad5PB, "Joypad5 B"); + ASSIGN_BUTTONf(kMacCMapPad5PY, "Joypad5 Y"); + ASSIGN_BUTTONf(kMacCMapPad5PL, "Joypad5 L"); + ASSIGN_BUTTONf(kMacCMapPad5PR, "Joypad5 R"); + ASSIGN_BUTTONf(kMacCMapPad5PSelect, "Joypad5 Select"); + ASSIGN_BUTTONf(kMacCMapPad5PStart, "Joypad5 Start"); + ASSIGN_BUTTONf(kMacCMapPad5PUp, "Joypad5 Up"); + ASSIGN_BUTTONf(kMacCMapPad5PDown, "Joypad5 Down"); + ASSIGN_BUTTONf(kMacCMapPad5PLeft, "Joypad5 Left"); + ASSIGN_BUTTONf(kMacCMapPad5PRight, "Joypad5 Right"); + + ASSIGN_BUTTONf(kMacCMapPad6PX, "Joypad6 X"); + ASSIGN_BUTTONf(kMacCMapPad6PA, "Joypad6 A"); + ASSIGN_BUTTONf(kMacCMapPad6PB, "Joypad6 B"); + ASSIGN_BUTTONf(kMacCMapPad6PY, "Joypad6 Y"); + ASSIGN_BUTTONf(kMacCMapPad6PL, "Joypad6 L"); + ASSIGN_BUTTONf(kMacCMapPad6PR, "Joypad6 R"); + ASSIGN_BUTTONf(kMacCMapPad6PSelect, "Joypad6 Select"); + ASSIGN_BUTTONf(kMacCMapPad6PStart, "Joypad6 Start"); + ASSIGN_BUTTONf(kMacCMapPad6PUp, "Joypad6 Up"); + ASSIGN_BUTTONf(kMacCMapPad6PDown, "Joypad6 Down"); + ASSIGN_BUTTONf(kMacCMapPad6PLeft, "Joypad6 Left"); + ASSIGN_BUTTONf(kMacCMapPad6PRight, "Joypad6 Right"); + + ASSIGN_BUTTONf(kMacCMapPad7PX, "Joypad7 X"); + ASSIGN_BUTTONf(kMacCMapPad7PA, "Joypad7 A"); + ASSIGN_BUTTONf(kMacCMapPad7PB, "Joypad7 B"); + ASSIGN_BUTTONf(kMacCMapPad7PY, "Joypad7 Y"); + ASSIGN_BUTTONf(kMacCMapPad7PL, "Joypad7 L"); + ASSIGN_BUTTONf(kMacCMapPad7PR, "Joypad7 R"); + ASSIGN_BUTTONf(kMacCMapPad7PSelect, "Joypad7 Select"); + ASSIGN_BUTTONf(kMacCMapPad7PStart, "Joypad7 Start"); + ASSIGN_BUTTONf(kMacCMapPad7PUp, "Joypad7 Up"); + ASSIGN_BUTTONf(kMacCMapPad7PDown, "Joypad7 Down"); + ASSIGN_BUTTONf(kMacCMapPad7PLeft, "Joypad7 Left"); + ASSIGN_BUTTONf(kMacCMapPad7PRight, "Joypad7 Right"); + + ASSIGN_BUTTONf(kMacCMapPad8PX, "Joypad8 X"); + ASSIGN_BUTTONf(kMacCMapPad8PA, "Joypad8 A"); + ASSIGN_BUTTONf(kMacCMapPad8PB, "Joypad8 B"); + ASSIGN_BUTTONf(kMacCMapPad8PY, "Joypad8 Y"); + ASSIGN_BUTTONf(kMacCMapPad8PL, "Joypad8 L"); + ASSIGN_BUTTONf(kMacCMapPad8PR, "Joypad8 R"); + ASSIGN_BUTTONf(kMacCMapPad8PSelect, "Joypad8 Select"); + ASSIGN_BUTTONf(kMacCMapPad8PStart, "Joypad8 Start"); + ASSIGN_BUTTONf(kMacCMapPad8PUp, "Joypad8 Up"); + ASSIGN_BUTTONf(kMacCMapPad8PDown, "Joypad8 Down"); + ASSIGN_BUTTONf(kMacCMapPad8PLeft, "Joypad8 Left"); + ASSIGN_BUTTONf(kMacCMapPad8PRight, "Joypad8 Right"); + + ASSIGN_BUTTONt(kMacCMapMouse1PL, "Mouse1 L"); + ASSIGN_BUTTONt(kMacCMapMouse1PR, "Mouse1 R"); + ASSIGN_BUTTONt(kMacCMapMouse2PL, "Mouse2 L"); + ASSIGN_BUTTONt(kMacCMapMouse2PR, "Mouse2 R"); + + ASSIGN_BUTTONt(kMacCMapScopeOffscreen, "Superscope AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapScopeFire, "Superscope Fire"); + ASSIGN_BUTTONt(kMacCMapScopeCursor, "Superscope Cursor"); + ASSIGN_BUTTONt(kMacCMapScopeTurbo, "Superscope ToggleTurbo"); + ASSIGN_BUTTONt(kMacCMapScopePause, "Superscope Pause"); + + ASSIGN_BUTTONt(kMacCMapLGun1Offscreen, "Justifier1 AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapLGun1Trigger, "Justifier1 Trigger"); + ASSIGN_BUTTONt(kMacCMapLGun1Start, "Justifier1 Start"); + ASSIGN_BUTTONt(kMacCMapLGun2Offscreen, "Justifier2 AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapLGun2Trigger, "Justifier2 Trigger"); + ASSIGN_BUTTONt(kMacCMapLGun2Start, "Justifier2 Start"); + + ASSIGN_POINTRt(kMacCMapMouse1Pointer, "Pointer Mouse1"); + ASSIGN_POINTRt(kMacCMapMouse2Pointer, "Pointer Mouse2"); + ASSIGN_POINTRt(kMacCMapSuperscopePointer, "Pointer Superscope"); + ASSIGN_POINTRt(kMacCMapJustifier1Pointer, "Pointer Justifier1"); + ASSIGN_POINTRt(kMacCMapJustifier2Pointer, "Pointer Justifier2"); + + ASSIGN_POINTRf(PseudoPointerBase, "Pointer Justifier2 (Controller)"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 0, "ButtonToPointer 1u Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 1, "ButtonToPointer 1d Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 2, "ButtonToPointer 1l Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 3, "ButtonToPointer 1r Med"); +} + +bool S9xPollButton (uint32 id, bool *pressed) +{ + #define kmControlKey 0x3B + + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + + CopyPressedKeys(keys, gamepadButtons); + + *pressed = false; + + if (id & k_MO) // mouse + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseRight); + } + } + else + if (id & k_SS) // superscope + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpOffScreen); break; + case 2: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopeCursor); break; + case 3: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopeTurbo); break; + case 4: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopePause); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); + } + } + else + if (id & k_LG) // justifier + { + if (id & k_C1) + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpOffScreen); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); break; + case 2: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseRight); + } + } + else + { + switch (id & 0xFF) + { + case 0: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kStart); break; + case 1: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kB); break; + case 2: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kA); + } + } + } + + return (true); +} + +bool S9xPollPointer (uint32 id, int16 *x, int16 *y) +{ + if (id & k_PT) + { + *x = (int16) mouseX; + *y = (int16) mouseY; + } + else + { + *x = *y = 0; + } + + return (true); +} + +bool S9xPollAxis (uint32 id, int16 *value) +{ + return (false); +} + +s9xcommand_t S9xGetPortCommandT (const char *name) +{ + s9xcommand_t cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.type = S9xBadMapping; + + return (cmd); +} + +char * S9xGetPortCommandName (s9xcommand_t command) +{ + static char str[] = "PortCommand"; + + return (str); +} + +void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) +{ + return; +} + +bool8 S9xMapInput (const char *name, s9xcommand_t *cmd) +{ + return (true); +} + +void ControlPadFlagsToS9xReportButtons (int n, uint32 p) +{ + uint32 base = k_HD | k_BT | k_JP | (0x100 << n); + + S9xReportButton(base + 0, (p & 0x0040)); + S9xReportButton(base + 1, (p & 0x0080)); + S9xReportButton(base + 2, (p & 0x8000)); + S9xReportButton(base + 3, (p & 0x4000)); + S9xReportButton(base + 4, (p & 0x0020)); + S9xReportButton(base + 5, (p & 0x0010)); + S9xReportButton(base + 6, (p & 0x2000)); + S9xReportButton(base + 7, (p & 0x1000)); + S9xReportButton(base + 8, (p & 0x0800)); + S9xReportButton(base + 9, (p & 0x0400)); + S9xReportButton(base + 10, (p & 0x0200)); + S9xReportButton(base + 11, (p & 0x0100)); +} + +void ControlPadFlagsToS9xPseudoPointer (uint32 p) +{ + // prevent screwiness caused by trying to move the pointer left+right or up+down + if ((p & 0x0c00) == 0x0c00) p &= ~0x0c00; + if ((p & 0x0300) == 0x0300) p &= ~0x0300; + + // checks added to prevent a lack of right/down movement from breaking left/up movement + if (!(p & 0x0400)) + S9xReportButton(kMacCMapPseudoPtrBase + 0, (p & 0x0800)); + if (!(p & 0x0800)) + S9xReportButton(kMacCMapPseudoPtrBase + 1, (p & 0x0400)); + if (!(p & 0x0100)) + S9xReportButton(kMacCMapPseudoPtrBase + 2, (p & 0x0200)); + if (!(p & 0x0200)) + S9xReportButton(kMacCMapPseudoPtrBase + 3, (p & 0x0100)); +} + +long ISpKeyIsPressed (bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons], ISpKey key) +{ + switch (key) + { + case kISpFastForward: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFastForward); + + case kISpFreeze: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFreeze); + + case kISpDefrost: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyDefrost); + + case kISpScreenshot: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScreenshot); + + case kISpSPC: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 1, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 2, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 3, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 4, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 5, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 6, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 7, kKeySPC); + + case kISpScopeTurbo: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopeTurbo); + + case kISpScopePause: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopePause); + + case kISpScopeCursor: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopeCursor); + + case kISpOffScreen: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyOffScreen); + + case kISpFunction: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFunction); + + case kISpAlt: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyAlt); + + case kISpFFDown: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFFDown); + + case kISpFFUp: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFFUp); + + case kISpEsc: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyEsc); + + case kISpTC: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyTC); + + case kISpMouseLeft: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyMouseLeft); + + case kISpMouseRight: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyMouseRight); + + default: + break; + } +} diff --git a/macosx/mac-coreimage.mm b/macosx/mac-coreimage.mm deleted file mode 100644 index 48f479a6..00000000 --- a/macosx/mac-coreimage.mm +++ /dev/null @@ -1,846 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#import "port.h" - -#import -#import -#import - -#import "mac-prefix.h" -#import "mac-dialog.h" -#import "mac-os.h" -#import "mac-coreimage.h" - -enum -{ - kCITypeNone = 0, - kCITypeBoolean = 1000, - kCITypeScalar, - kCITypeColor -}; - -#define mCoreImageFilter 501 -#define FIXEDRANGE 0x10000 -#define kCommandFilterMenuBase 0x41000000 -#define kCommandCheckBoxBase 0x49000000 -#define kCommandSliderBase 0x51000000 -#define kCommandColorButtonBase 0x59000000 -#define kCIFilterNamePrefKey CFSTR("CoreImageFilterName") - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -#define truncEnd 0 -#endif - -typedef struct { - char name[256]; - char displayName[256]; - int type; - union { - struct { - bool8 cur; - } b; - - struct { - float max, min, cur; - } s; - - struct { - float r, g, b, a; - } c; - } u; -} FilterParam; - -static NSMutableArray *ciFilterNameList = NULL; -static NSMutableArray *ciFilterLocalizedNameList = NULL; -static NSArray *ciFilterInputKeys = NULL; -static CIFilter *ciFilter = NULL; -static CIContext *ciContext = NULL; -static FilterParam *ciFilterParam = NULL; -static CFStringRef ciFilterName = NULL; -static HIViewRef ciFilterUIPane = NULL; -static MenuRef ciFilterMenu = NULL; -static CGColorSpaceRef cgColor = NULL; -static MPSemaphoreID cisem = NULL; -static bool8 ciFilterHasInputCenter = false; -static bool8 ciFilterHasInputImage = false; -static int ciFilterInputKeysCount = 0; - -static void LoadFilterPrefs (void); -static void SaveFilterPrefs (void); -static void FilterParamToFilter (void); -static void FilterToFilterParam (void); -static void BuildCoreImageFilterListAndMenu (void); -static void ReleaseCoreImageFilterListAndMenu (void); -static void ReplaceFilterUI (WindowRef); -static void FilterUIAddSubviews (WindowRef, HIViewRef); -static void FilterUISetValues (HIViewRef); -static bool8 IsCoreImageFilterSupported (CIFilter *); -static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef, EventRef, void *); - - -void InitCoreImage (void) -{ - OSStatus err; - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - ciFilterName = (CFStringRef) CFPreferencesCopyAppValue(kCIFilterNamePrefKey, kCFPreferencesCurrentApplication); - if (!ciFilterName) - ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("CIGammaAdjust")); - - BuildCoreImageFilterListAndMenu(); - - err = MPCreateBinarySemaphore(&cisem); - - [pool release]; -} - -void DeinitCoreImage (void) -{ - OSStatus err; - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - err = MPDeleteSemaphore(cisem); - - ReleaseCoreImageFilterListAndMenu(); - - CFPreferencesSetAppValue(kCIFilterNamePrefKey, ciFilterName, kCFPreferencesCurrentApplication); - - CFRelease(ciFilterName); - - [pool release]; -} - -void InitCoreImageFilter (void) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - ciFilter = [[CIFilter filterWithName: (NSString *) ciFilterName] retain]; - [ciFilter setDefaults]; - - ciFilterInputKeys = [[ciFilter inputKeys] retain]; - ciFilterInputKeysCount = [ciFilterInputKeys count]; - - ciFilterParam = new FilterParam [ciFilterInputKeysCount]; - memset(ciFilterParam, 0, sizeof(FilterParam) * ciFilterInputKeysCount); - - ciFilterHasInputCenter = false; - ciFilterHasInputImage = false; - - LoadFilterPrefs(); - - [pool release]; -} - -void DeinitCoreImageFilter (void) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - SaveFilterPrefs(); - - ciFilterHasInputCenter = false; - ciFilterHasInputImage = false; - - delete [] ciFilterParam; - - [ciFilterInputKeys release]; - ciFilterInputKeysCount = 0; - - [ciFilter release]; - - [pool release]; -} - -static void LoadFilterPrefs (void) -{ - CFDataRef data; - int n = sizeof(FilterParam) * ciFilterInputKeysCount; - - data = (CFDataRef) CFPreferencesCopyAppValue(ciFilterName, kCFPreferencesCurrentApplication); - if (data) - { - if (CFDataGetLength(data) == n) - { - CFDataGetBytes(data, CFRangeMake(0, n), (UInt8 *) ciFilterParam); - FilterParamToFilter(); - } - - CFRelease(data); - } - - FilterToFilterParam(); -} - -static void SaveFilterPrefs (void) -{ - CFDataRef data; - int n = sizeof(FilterParam) * ciFilterInputKeysCount; - - data = CFDataCreate(kCFAllocatorDefault, (UInt8 *) ciFilterParam, n); - if (data) - { - CFPreferencesSetAppValue(ciFilterName, data, kCFPreferencesCurrentApplication); - CFRelease(data); - } -} - -static void FilterParamToFilter (void) -{ - NSString *key; - NSNumber *num; - CIColor *color; - - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - key = [NSString stringWithUTF8String: ciFilterParam[i].name]; - if (key) - { - switch (ciFilterParam[i].type) - { - case kCITypeBoolean: - num = [NSNumber numberWithBool: ciFilterParam[i].u.b.cur]; - [ciFilter setValue: num forKey: key]; - break; - - case kCITypeScalar: - num = [NSNumber numberWithFloat: ciFilterParam[i].u.s.cur]; - [ciFilter setValue: num forKey: key]; - break; - - case kCITypeColor: - color = [CIColor colorWithRed: ciFilterParam[i].u.c.r green: ciFilterParam[i].u.c.g - blue: ciFilterParam[i].u.c.b alpha: ciFilterParam[i].u.c.a]; - [ciFilter setValue: color forKey: key]; - break; - - default: - break; - } - } - } -} - -static void FilterToFilterParam (void) -{ - NSDictionary *attr; - NSString *key, *label, *className, *typeName; - NSNumber *num; - CIColor *color; - id param; - - attr = [ciFilter attributes]; - ciFilterHasInputCenter = false; - ciFilterHasInputImage = false; - - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - key = [ciFilterInputKeys objectAtIndex: i]; - param = [attr objectForKey: key]; - - strncpy(ciFilterParam[i].name, [key UTF8String], sizeof(ciFilterParam[i].name)); - ciFilterParam[i].displayName[0] = 0; - - if ([param isKindOfClass: [NSDictionary class]]) - { - label = [(NSDictionary *) param objectForKey: kCIAttributeDisplayName]; - if (!label) - label = [NSString stringWithString: key]; - strncpy(ciFilterParam[i].displayName, [label UTF8String], sizeof(ciFilterParam[i].displayName)); - - className = [(NSDictionary *) param objectForKey: kCIAttributeClass]; - - if ([className isEqualToString: @"NSNumber"]) - { - typeName = [(NSDictionary *) param objectForKey: kCIAttributeType]; - - if ([typeName isEqualToString: kCIAttributeTypeBoolean]) - { - ciFilterParam[i].type = kCITypeBoolean; - - num = [ciFilter valueForKey: key]; - ciFilterParam[i].u.b.cur = [num boolValue]; - } - else - { - ciFilterParam[i].type = kCITypeScalar; - - num = [ciFilter valueForKey: key]; - ciFilterParam[i].u.s.cur = [num floatValue]; - - num = [(NSDictionary *) param objectForKey: kCIAttributeSliderMax]; - if (!num) - num = [(NSDictionary *) param objectForKey: kCIAttributeMax]; - ciFilterParam[i].u.s.max = [num floatValue]; - - num = [(NSDictionary *) param objectForKey: kCIAttributeSliderMin]; - if (!num) - num = [(NSDictionary *) param objectForKey: kCIAttributeMin]; - ciFilterParam[i].u.s.min = [num floatValue]; - } - } - else - if ([className isEqualToString: @"CIColor"]) - { - ciFilterParam[i].type = kCITypeColor; - - color = [ciFilter valueForKey: key]; - ciFilterParam[i].u.c.r = [color red]; - ciFilterParam[i].u.c.g = [color green]; - ciFilterParam[i].u.c.b = [color blue]; - ciFilterParam[i].u.c.a = [color alpha]; - } - else - { - ciFilterParam[i].type = kCITypeNone; - - if ([className isEqualToString: @"CIVector"] && [key isEqualToString: @"inputCenter"]) - ciFilterHasInputCenter = true; - - if ([className isEqualToString: @"CIImage" ] && [key isEqualToString: @"inputImage" ]) - ciFilterHasInputImage = true; - } - } - } -} - -static void BuildCoreImageFilterListAndMenu (void) -{ - NSArray *categories, *filterNames; - OSStatus err; - - categories = [NSArray arrayWithObject: kCICategoryStillImage]; - filterNames = [CIFilter filterNamesInCategories: categories]; - - ciFilterNameList = [[NSMutableArray alloc] initWithCapacity: 1]; - ciFilterLocalizedNameList = [[NSMutableArray alloc] initWithCapacity: 1]; - err = CreateNewMenu(mCoreImageFilter, 0, &ciFilterMenu); - - int n = [filterNames count], m = 0; - for (int i = 0; i < n; i++) - { - CIFilter *filter; - NSString *name, *localName; - - name = [filterNames objectAtIndex: i]; - filter = [CIFilter filterWithName: name]; - - if (IsCoreImageFilterSupported(filter)) - { - [ciFilterNameList addObject: name]; - - localName = [CIFilter localizedNameForFilterName: name]; - if (!localName) - localName = [NSString stringWithString: name]; - - [ciFilterLocalizedNameList addObject: localName]; - - err = AppendMenuItemTextWithCFString(ciFilterMenu, (CFStringRef) localName, 0, kCommandFilterMenuBase + m, NULL); - m++; - } - } -} - -static void ReleaseCoreImageFilterListAndMenu (void) -{ - CFRelease(ciFilterMenu); - [ciFilterLocalizedNameList release]; - [ciFilterNameList release]; -} - -static bool8 IsCoreImageFilterSupported (CIFilter *filter) -{ - NSDictionary *attr; - NSArray *inputKeys; - NSString *key, *className; - id param; - bool8 result = true, hasInputImage = false; - - attr = [filter attributes]; - inputKeys = [filter inputKeys]; - - int n = [inputKeys count]; - for (int i = 0; i < n; i++) - { - key = [inputKeys objectAtIndex: i]; - param = [attr objectForKey: key]; - - if ([param isKindOfClass: [NSDictionary class]]) - { - className = [(NSDictionary *) param objectForKey: kCIAttributeClass]; - - if ([className isEqualToString: @"CIImage"]) - { - if (![key isEqualToString: @"inputImage"]) - result = false; - else - hasInputImage = true; - } - else - if ([className isEqualToString: @"CIVector"]) - { - if (![key isEqualToString: @"inputCenter"]) - result = false; - } - else - if (![className isEqualToString: @"NSNumber"] && ![className isEqualToString: @"CIColor"]) - result = false; - } - } - - if (hasInputImage == false) - result = false; - - return (result); -} - -void ConfigureCoreImageFilter (void) -{ - NSAutoreleasePool *pool; - OSStatus err; - IBNibRef nibRef; - - pool = [[NSAutoreleasePool alloc] init]; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef window; - - err = CreateWindowFromNib(nibRef, CFSTR("CIFilter"), &window); - if (err == noErr) - { - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, root; - HIViewID cid; - Rect rct; - int value; - - ciFilterUIPane = NULL; - - FilterToFilterParam(); - - root = HIViewGetRoot(window); - - SetHIViewID(&cid, 'FILT', 0); - rct.left = 74; - rct.top = 20; - rct.right = 74 + 279; - rct.bottom = 20 + 20; - err = CreatePopupButtonControl(window, &rct, NULL, -12345, false, 0, 0, 0, &ctl); - HIViewSetID(ctl, cid); - int n = CountMenuItems(ciFilterMenu); - SetControlPopupMenuHandle(ctl, ciFilterMenu); - HIViewSetMaximum(ctl, n); - value = [ciFilterNameList indexOfObject: (NSString *) ciFilterName]; - HIViewSetValue(ctl, value + 1); - - ReplaceFilterUI(window); - - eUPP = NewEventHandlerUPP(CoreImageFilterEventHandler); - err = InstallWindowEventHandler(window, eUPP, GetEventTypeCount(event), event, (void *) window, &eref); - - MoveWindowPosition(window, kWindowCoreImageFilter, false); - ShowWindow(window); - err = RunAppModalLoopForWindow(window); - HideWindow(window); - SaveWindowPosition(window, kWindowCoreImageFilter); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - - FilterParamToFilter(); - - CFRelease(window); - } - - DisposeNibReference(nibRef); - } - - [pool release]; -} - -static void ReplaceFilterUI (WindowRef window) -{ - OSStatus err; - HIRect frame; - Rect bounds, rct; - - if (ciFilterUIPane) - { - HIViewSetVisible(ciFilterUIPane, false); - DisposeControl(ciFilterUIPane); - ciFilterUIPane = NULL; - } - - GetWindowBounds(window, kWindowStructureRgn, &bounds); - - rct.left = 15; - rct.right = bounds.right - bounds.left - 15; - rct.top = 81; - rct.bottom = rct.top + 40; - err = CreateUserPaneControl(window, &rct, kControlSupportsEmbedding, &ciFilterUIPane); - HIViewSetVisible(ciFilterUIPane, false); - FilterUIAddSubviews(window, ciFilterUIPane); - - HIViewGetFrame(ciFilterUIPane, &frame); - bounds.bottom = bounds.top + (short) (frame.origin.y + frame.size.height + 30); - - err = TransitionWindow(window, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &bounds); - HIViewSetVisible(ciFilterUIPane, true); -} - -static void FilterUIAddSubviews (WindowRef window, HIViewRef parent) -{ - OSStatus err; - CFMutableStringRef label; - CFStringRef str; - HIViewRef ctl; - HIViewID cid; - HIRect bounds, frame; - Rect rct; - SInt32 value; - - HIViewGetFrame(parent, &bounds); - rct.left = 0; - rct.top = 0; - rct.right = 200; - rct.bottom = 20; - - int m = 0; - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - str = CFStringCreateWithCString(kCFAllocatorDefault, ciFilterParam[i].displayName, kCFStringEncodingUTF8); - if (!str) - str = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("Parameter")); - label = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, str); - CFRelease(str); - - switch (ciFilterParam[i].type) - { - case kCITypeBoolean: - { - err = CreateCheckBoxControl(window, &rct, label, ciFilterParam[i].u.b.cur, true, &ctl); - SetHIViewID(&cid, kCommandCheckBoxBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 5.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = bounds.size.width - 10.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - case kCITypeScalar: - { - CFStringAppend(label, CFSTR(" :")); - err = CreateStaticTextControl(window, &rct, label, NULL, &ctl); - SetStaticTextTrunc(ctl, truncEnd, true); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 5.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = 120.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - - value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); - err = CreateSliderControl(window, &rct, value, 0, FIXEDRANGE, kControlSliderDoesNotPoint, 0, false, NULL, &ctl); - SetHIViewID(&cid, kCommandSliderBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 135.0f; - frame.origin.y = (float) (m * 28) - 1.0f; - frame.size.width = bounds.size.width - 140.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - case kCITypeColor: - { - CFStringAppend(label, CFSTR("...")); - err = CreatePushButtonControl(window, &rct, label, &ctl); - SetHIViewID(&cid, kCommandColorButtonBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = bounds.size.width - 180.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = 175.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - default: - break; - } - - CFRelease(label); - } - - if (m) - { - str = CFCopyLocalizedString(CFSTR("ResetCIFilter"), "Reset"); - err = CreatePushButtonControl(window, &rct, str, &ctl); - SetHIViewID(&cid, 'rSET', 0); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = bounds.size.width - 180.0f; - frame.origin.y = (float) (m * 28 + 12); - frame.size.width = 175.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - CFRelease(str); - bounds.size.height = frame.origin.y + 32.0f; - } - else - bounds.size.height = 4.0f; - - err = HIViewSetFrame(parent, &bounds); -} - -static void FilterUISetValues (HIViewRef parent) -{ - HIViewRef ctl; - HIViewID cid; - SInt32 value; - - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - switch (ciFilterParam[i].type) - { - case kCITypeBoolean: - SetHIViewID(&cid, kCommandCheckBoxBase + i, i); - HIViewFindByID(parent, cid, &ctl); - HIViewSetValue(ctl, ciFilterParam[i].u.b.cur); - break; - - case kCITypeScalar: - value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); - SetHIViewID(&cid, kCommandSliderBase + i, i); - HIViewFindByID(parent, cid, &ctl); - HIViewSetValue(ctl, value); - break; - - default: - break; - } - } -} - -static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef window = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(window); - result = noErr; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommandExtended tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); - if (err == noErr) - { - err = MPWaitOnSemaphore(cisem, kDurationForever); - - if (tHICommand.commandID == 'rSET') - { - [ciFilter setDefaults]; - FilterToFilterParam(); - FilterUISetValues(ciFilterUIPane); - - result = noErr; - } - else - { - unsigned long i = tHICommand.commandID & 0x00FFFFFF; - - switch (tHICommand.commandID & 0xFF000000) - { - case kCommandFilterMenuBase: - DeinitCoreImageFilter(); - - CFRelease(ciFilterName); - ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef) [ciFilterNameList objectAtIndex: i]); - - InitCoreImageFilter(); - - ReplaceFilterUI(window); - - break; - - case kCommandCheckBoxBase: - ciFilterParam[i].u.b.cur = !(ciFilterParam[i].u.b.cur); - FilterParamToFilter(); - result = noErr; - - break; - - case kCommandSliderBase: - SInt32 value; - - value = HIViewGetValue(tHICommand.source.control); - ciFilterParam[i].u.s.cur = ciFilterParam[i].u.s.min + (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) value / (float) FIXEDRANGE; - FilterParamToFilter(); - result = noErr; - - break; - - case kCommandColorButtonBase: - NColorPickerInfo info; - - memset(&info, 0, sizeof(NColorPickerInfo)); - info.placeWhere = kCenterOnMainScreen; - info.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal; - info.theColor.color.rgb.red = (int) (65535.0 * ciFilterParam[i].u.c.r); - info.theColor.color.rgb.green = (int) (65535.0 * ciFilterParam[i].u.c.g); - info.theColor.color.rgb.blue = (int) (65535.0 * ciFilterParam[i].u.c.b); - - err = NPickColor(&info); - - if ((err == noErr) && info.newColorChosen) - { - ciFilterParam[i].u.c.r = (float) info.theColor.color.rgb.red / 65535.0f; - ciFilterParam[i].u.c.g = (float) info.theColor.color.rgb.green / 65535.0f; - ciFilterParam[i].u.c.b = (float) info.theColor.color.rgb.blue / 65535.0f; - } - - FilterParamToFilter(); - result = noErr; - - break; - } - } - - err = MPSignalSemaphore(cisem); - } - } - } - - return (result); -} - -void InitCoreImageContext (CGLContextObj cglctx, CGLPixelFormatObj cglpix) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - FilterToFilterParam(); - - cgColor = CGColorSpaceCreateDeviceRGB(); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - ciContext = [[CIContext contextWithCGLContext: cglctx pixelFormat: cglpix options: NULL] retain]; -#else - ciContext = [[CIContext contextWithCGLContext: cglctx pixelFormat: cglpix colorSpace: cgColor options: NULL] retain]; -#endif - - [pool release]; -} - -void DeinitCoreImageContext (void) -{ - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - [ciContext release]; - CGColorSpaceRelease(cgColor); - - [pool release]; -} - -void DrawWithCoreImageFilter (CGRect src, CGImageRef img) -{ - OSStatus err; - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - err = MPWaitOnSemaphore(cisem, kDurationForever); - - if (ciFilterHasInputImage) - { - CIImage *image; - - image = [CIImage imageWithCGImage: img]; - [ciFilter setValue: image forKey: @"inputImage" ]; - } - - if (ciFilterHasInputCenter) - { - CIVector *vector; - - vector = [CIVector vectorWithX: (src.origin.x + src.size.width / 2) Y: (src.origin.y + src.size.height / 2)]; - [ciFilter setValue: vector forKey: @"inputCenter"]; - } - - [ciContext drawImage: [ciFilter valueForKey: @"outputImage"] atPoint: CGPointZero fromRect: src]; - - err = MPSignalSemaphore(cisem); - - [pool release]; -} diff --git a/macosx/mac-dialog.h b/macosx/mac-dialog.h index b2b1b900..9edff485 100755 --- a/macosx/mac-dialog.h +++ b/macosx/mac-dialog.h @@ -25,8 +25,8 @@ enum { kS9xMacAlertFolderNotFound = 1, kS9xMacAlertFolderNotFoundHint, - kS9xMacAlertFolderFailToCreate, - kS9xMacAlertFolderFailToCreateHint, + kS9xMacAlertFolderNotWritable, + kS9xMacAlertFolderNotWritableHint, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint, kS9xMacAlertCFCantAddEntry, @@ -55,6 +55,6 @@ OSStatus SetEditTextCStr (HIViewRef, char *, Boolean); OSStatus CopyEditTextCFString (HIViewRef, CFStringRef *); OSStatus SetEditTextCFString (HIViewRef, CFStringRef, Boolean); OSStatus SetEditTextSelection (HIViewRef, SInt16, SInt16); -pascal OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *); +OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *); #endif diff --git a/macosx/mac-dialog.cpp b/macosx/mac-dialog.mm similarity index 97% rename from macosx/mac-dialog.cpp rename to macosx/mac-dialog.mm index 71bf8dc6..32c20524 100755 --- a/macosx/mac-dialog.cpp +++ b/macosx/mac-dialog.mm @@ -44,10 +44,10 @@ static void AutofireWriteAllSettings (int, HIViewRef); static void AutofireWriteSetting (int, uint16 *, HIViewRef); static void AutofireSelectTabPane (HIViewRef, SInt16); static OSStatus UpdateTextControlView (HIViewRef); -static pascal void AutofireSliderActionProc (HIViewRef, HIViewPartCode); -static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *); +static void AutofireSliderActionProc (HIViewRef, HIViewPartCode); +static OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *); #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 extern "C" FMFont FMGetFontFromATSFontRef (ATSFontRef iFont); @@ -253,7 +253,7 @@ void AppearanceAlert (AlertType type, int stringID1, int stringID2) if (key1) mes1 = CFCopyLocalizedString(key1, "mes1"); else mes1 = NULL; if (key2) mes2 = CFCopyLocalizedString(key2, "mes2"); else mes2 = NULL; - PlayAlertSound(); + NSBeep(); err = CreateStandardAlert(type, mes1, mes2, NULL, &dialog); err = RunStandardAlert(dialog, NULL, &outItemHit); @@ -333,7 +333,7 @@ void AboutDialog (void) } } -pascal OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; @@ -787,7 +787,7 @@ static void AutofireSelectTabPane (HIViewRef tabControl, SInt16 index) HIViewSetNeedsDisplay(tabControl, true); } -static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; HIViewRef ctl; @@ -810,7 +810,7 @@ static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef return (result); } -static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; @@ -880,7 +880,7 @@ static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandler return (result); } -static pascal void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode) +static void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode) { HIViewRef ctl; HIViewID cid; @@ -1081,7 +1081,7 @@ static void RomInfoBuildInfoText (char *romtext) sprintf(romtext, "%s%s", s1, s2); } -static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; diff --git a/macosx/mac-file.cpp b/macosx/mac-file.cpp deleted file mode 100644 index 1252b6c2..00000000 --- a/macosx/mac-file.cpp +++ /dev/null @@ -1,619 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "movie.h" -#include "display.h" - -#include - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-stringtools.h" -#include "mac-file.h" - -static void AddFolderIcon (FSRef *, const char *); -static OSStatus FindSNESFolder (FSRef *, char *, const char *); -static OSStatus FindApplicationSupportFolder (FSRef *, char *, const char *); -static OSStatus FindCustomFolder (FSRef *, char *, const char *); - - -void CheckSaveFolder (FSRef *cartRef) -{ - OSStatus err; - Boolean r; - FSCatalogInfo finfo; - FSVolumeInfo vinfo; - FSRef ref; - CFURLRef burl, purl; - char s[PATH_MAX + 1]; - - switch (saveInROMFolder) - { - case 0: // Snes9x folder - burl = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - purl = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, burl); - r = CFURLGetFSRef(purl, &ref); - CFRelease(purl); - CFRelease(burl); - break; - - case 1: // ROM folder - err = FSGetCatalogInfo(cartRef, kFSCatInfoNone, NULL, NULL, NULL, &ref); - break; - - case 2: // Application Support folder - return; - - case 4: // Custom folder - if (saveFolderPath == NULL) - { - saveInROMFolder = 2; - return; - } - - r = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8); - err = FSPathMakeRef((unsigned char *) s, &ref, NULL); - if (err) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotFound, kS9xMacAlertFolderNotFoundHint); - saveInROMFolder = 2; - return; - } - - break; - } - - err = FSGetCatalogInfo(&ref, kFSCatInfoUserPrivs | kFSCatInfoVolume, &finfo, NULL, NULL, NULL); - if (err == noErr) - { - if (finfo.userPrivileges & kioACUserNoMakeChangesMask) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint); - saveInROMFolder = 2; - return; - } - - err = FSGetVolumeInfo(finfo.volume, 0, NULL, kFSVolInfoFlags, &vinfo, NULL, NULL); - if (err == noErr) - { - if ((vinfo.flags & kFSVolFlagHardwareLockedMask) || (vinfo.flags & kFSVolFlagSoftwareLockedMask)) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint); - saveInROMFolder = 2; - return; - } - } - } - - if (err) - saveInROMFolder = 2; -} - -static OSStatus FindSNESFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - CFURLRef burl, purl; - CFStringRef fstr; - FSRef pref; - UniChar buffer[PATH_MAX + 1]; - Boolean r; - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - burl = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - purl = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, burl); - r = CFURLGetFSRef(purl, &pref); - - err = FSMakeFSRefUnicode(&pref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&pref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(purl); - CFRelease(burl); - CFRelease(fstr); - - return (err); -} - -static OSStatus FindApplicationSupportFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - FSRef p2ref, p1ref; - CFStringRef fstr; - UniChar buffer[PATH_MAX + 1]; - UniChar s9xfolder[6] = { 'S', 'n', 'e', 's', '9', 'x' }, - oldfolder[6] = { 'S', 'N', 'E', 'S', '9', 'X' }; - - err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, kCreateFolder, &p2ref); - if (err) - return (err); - - err = FSMakeFSRefUnicode(&p2ref, 6, s9xfolder, kTextEncodingUnicodeDefault, &p1ref); - if (err == dirNFErr || err == fnfErr) - { - err = FSMakeFSRefUnicode(&p2ref, 6, oldfolder, kTextEncodingUnicodeDefault, &p1ref); - if (err == dirNFErr || err == fnfErr) - err = FSCreateDirectoryUnicode(&p2ref, 6, s9xfolder, kFSCatInfoNone, NULL, &p1ref, NULL, NULL); - } - - if (err) - return (err); - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - err = FSMakeFSRefUnicode(&p1ref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&p1ref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(fstr); - - return (err); -} - -static OSStatus FindCustomFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - CFStringRef fstr; - FSRef pref; - UniChar buffer[PATH_MAX + 1]; - char s[PATH_MAX + 1]; - - if (saveFolderPath == NULL) - return (-1); - - err = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8) ? noErr : -1; - if (err == noErr) - err = FSPathMakeRef((unsigned char *) s, &pref, NULL); - - if (err) - return (err); - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - err = FSMakeFSRefUnicode(&pref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&pref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(fstr); - - return (err); -} - -void ChangeTypeAndCreator (const char *path, OSType type, OSType creator) -{ - OSStatus err; - FSRef ref; - - err = FSPathMakeRef((unsigned char *) path, &ref, NULL); - if (err == noErr) - { - FSCatalogInfo catinfo; - - err = FSGetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catinfo, NULL, NULL, NULL); - if (err == noErr) - { - ((FileInfo *) &catinfo.finderInfo)->fileCreator = creator; - ((FileInfo *) &catinfo.finderInfo)->fileType = type; - - err = FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catinfo); - } - } -} - -static void AddFolderIcon (FSRef *fref, const char *folderName) -{ - OSStatus err; - FSCatalogInfo fcat, icat; - FSRef bref, iref; - CFStringRef str; - CFURLRef url; - IconFamilyHandle family; - IconRef icon; - HFSUniStr255 fork; - Boolean r; - SInt16 resf; - char name[64]; - UniChar iconName[5] = { 'I', 'c', 'o', 'n', '\r' }; - - strcpy(name, "folder_"); - strcat(name, folderName); - - str = CFStringCreateWithCString(kCFAllocatorDefault, name, CFStringGetSystemEncoding()); - if (str) - { - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), str, CFSTR("icns"), NULL); - if (url) - { - r = CFURLGetFSRef(url, &bref); - if (r) - { - err = RegisterIconRefFromFSRef('~9X~', 'TEMP', &bref, &icon); - if (err == noErr) - { - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSCreateResourceFile(fref, 5, iconName, kFSCatInfoNone, NULL, fork.length, fork.unicode, &iref, NULL); - if (err == noErr) - { - err = FSOpenResourceFile(&iref, fork.length, fork.unicode, fsWrPerm, &resf); - if (err == noErr) - { - err = IconRefToIconFamily(icon, kSelectorAllAvailableData, &family); - if (err == noErr) - { - AddResource((Handle) family, 'icns', -16455, "\p"); - WriteResource((Handle) family); - ReleaseResource((Handle) family); - - err = FSGetCatalogInfo(&iref, kFSCatInfoFinderInfo, &icat, NULL, NULL, NULL); - ((FileInfo *) &icat.finderInfo)->finderFlags |= kIsInvisible; - ((FileInfo *) &icat.finderInfo)->fileCreator = 'MACS'; - ((FileInfo *) &icat.finderInfo)->fileType = 'icon'; - err = FSSetCatalogInfo(&iref, kFSCatInfoFinderInfo, &icat); - - err = FSGetCatalogInfo(fref, kFSCatInfoFinderInfo, &fcat, NULL, NULL, NULL); - ((FolderInfo *) &fcat.finderInfo)->finderFlags |= kHasCustomIcon; - ((FolderInfo *) &fcat.finderInfo)->finderFlags &= ~kHasBeenInited; - err = FSSetCatalogInfo(fref, kFSCatInfoFinderInfo, &fcat); - } - - CloseResFile(resf); - } - } - } - - err = UnregisterIconRef('~9X~', 'TEMP'); - } - } - - CFRelease(url); - } - - CFRelease(str); - } -} - -const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype) -{ - static int index = 0; - static char filePath[4][PATH_MAX + 1]; - - OSStatus err; - FSRef ref; - uint32 type; - char folderName[16]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - const char *p; - - index++; - if (index > 3) - index = 0; - - folderName[0] = filePath[index][0] = 0; - - if (strlen(inExt) < 4) - return (filePath[index]); - - p = inExt + strlen(inExt) - 4; - type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; - - switch (type) - { - case '.srm': - case '.rtc': - strcpy(folderName, "SRAMs"); - break; - - case '.frz': - strcpy(folderName, "Freezes"); - break; - - case '.spc': - strcpy(folderName, "SPCs"); - break; - - case '.cht': - strcpy(folderName, "Cheats"); - break; - - case '.ups': - case '.ips': - strcpy(folderName, "Patches"); - break; - - case '.png': - strcpy(folderName, "Screenshots"); - break; - - case '.dat': - case '.out': - case '.log': - strcpy(folderName, "Logs"); - break; - - case '.bio': // dummy - strcpy(folderName, "BIOSes"); - break; - } - - if (folderName[0] && (saveInROMFolder != 1)) - { - char s[PATH_MAX + 1]; - - s[0] = 0; - err = -1; - - if (saveInROMFolder == 0) - { - err = FindSNESFolder(&ref, s, folderName); - if (err) - saveInROMFolder = 2; - } - - if (saveInROMFolder == 4) - { - err = FindCustomFolder(&ref, s, folderName); - if (err) - saveInROMFolder = 2; - - } - - if (saveInROMFolder == 2) - err = FindApplicationSupportFolder(&ref, s, folderName); - - if (err == noErr) - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf(filePath[index], PATH_MAX + 1, "%s%s%s%s", s, MAC_PATH_SEPARATOR, fname, inExt); - } - else - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - _makepath(filePath[index], drive, dir, fname, inExt); - } - } - else - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - _makepath(filePath[index], drive, dir, fname, inExt); - } - - return (filePath[index]); -} - -const char * S9xGetSPCFilename (void) -{ - char spcExt[16]; - - sprintf(spcExt, ".%03d.spc", (int) spcFileCount); - - spcFileCount++; - if (spcFileCount == 1000) - spcFileCount = 0; - - return (S9xGetFilename(spcExt, SPC_DIR)); -} - -const char * S9xGetPNGFilename (void) -{ - char pngExt[16]; - - sprintf(pngExt, ".%03d.png", (int) pngFileCount); - - pngFileCount++; - if (pngFileCount == 1000) - pngFileCount = 0; - - return (S9xGetFilename(pngExt, SCREENSHOT_DIR)); -} - -const char * S9xGetFreezeFilename (int which) -{ - char frzExt[16]; - - sprintf(frzExt, ".%03d.frz", which); - - return (S9xGetFilename(frzExt, SNAPSHOT_DIR)); -} - -const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype) -{ - uint32 type; - const char *p; - - if (strlen(inExt) < 4) - return (NULL); - - p = inExt + strlen(inExt) - 4; - type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; - - switch (type) - { - case '.spc': - return (S9xGetSPCFilename()); - - case '.png': - return (S9xGetPNGFilename()); - } - - return (NULL); -} - -const char * S9xChooseFilename (bool8 read_only) -{ - return (NULL); -} - -const char * S9xChooseMovieFilename (bool8 read_only) -{ - return (NULL); -} - -bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) -{ - if (read_only) - { - if (0 != (*file = OPEN_STREAM(fname, "rb"))) - return (true); - } - else - { - if (0 != (*file = OPEN_STREAM(fname, "wb"))) - return (true); - } - - return (false); -} - -void S9xCloseSnapshotFile (STREAM file) -{ - CLOSE_STREAM(file); -} - -const char * S9xBasename (const char *in) -{ - static char s[PATH_MAX + 1]; - - strncpy(s, in, PATH_MAX + 1); - s[PATH_MAX] = 0; - - size_t l = strlen(s); - - for (unsigned int i = 0; i < l; i++) - { - if (s[i] < 32 || s[i] >= 127) - s[i] = '_'; - } - - return (basename(s)); -} - -const char * S9xGetDirectory (enum s9x_getdirtype dirtype) -{ - static int index = 0; - static char path[4][PATH_MAX + 1]; - - char inExt[16]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - index++; - if (index > 3) - index = 0; - - switch (dirtype) - { - case SNAPSHOT_DIR: strcpy(inExt, ".frz"); break; - case SRAM_DIR: strcpy(inExt, ".srm"); break; - case SCREENSHOT_DIR: strcpy(inExt, ".png"); break; - case SPC_DIR: strcpy(inExt, ".spc"); break; - case CHEAT_DIR: strcpy(inExt, ".cht"); break; - case BIOS_DIR: strcpy(inExt, ".bio"); break; - case LOG_DIR: strcpy(inExt, ".log"); break; - default: strcpy(inExt, ".xxx"); break; - } - - _splitpath(S9xGetFilename(inExt, dirtype), drive, dir, fname, ext); - _makepath(path[index], drive, dir, "", ""); - - int l = strlen(path[index]); - if (l > 1) - path[index][l - 1] = 0; - - return (path[index]); -} - -void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) -{ - drive[0] = 0; - fname[0] = 0; - ext[0] = 0; - dir[0] = 0; - - int x; - - x = strlen(path) - 1; - if (x < 0) - return; - - while (x && (path[x] != MAC_PATH_SEP_CHAR)) - x--; - - if (x) - { - strcpy(dir, path); - dir[x + 1] = 0; - - strcpy(fname, path + x + 1); - } - else - strcpy(fname, path); - - x = strlen(fname); - while (x && (fname[x] != '.')) - x--; - - if (x) - { - strcpy(ext, fname + x); - fname[x] = 0; - } -} - -void _makepath (char *path, const char *drive, const char *dir, const char *fname, const char *ext) -{ - static const char emp[] = "", dot[] = "."; - - const char *d, *f, *e, *p; - - d = dir ? dir : emp; - f = fname ? fname : emp; - e = ext ? ext : emp; - p = (e[0] && e[0] != '.') ? dot : emp; - - snprintf(path, PATH_MAX + 1, "%s%s%s%s", d, f, p, e); -} diff --git a/macosx/mac-file.h b/macosx/mac-file.h index d84c6487..2f721274 100644 --- a/macosx/mac-file.h +++ b/macosx/mac-file.h @@ -15,13 +15,14 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_file_h_ #define _mac_file_h_ -void CheckSaveFolder (FSRef *); +void CheckSaveFolder (NSURL *); void ChangeTypeAndCreator (const char *, OSType, OSType); const char * S9xGetSPCFilename (void); const char * S9xGetPNGFilename (void); diff --git a/macosx/mac-file.mm b/macosx/mac-file.mm new file mode 100644 index 00000000..74466db2 --- /dev/null +++ b/macosx/mac-file.mm @@ -0,0 +1,443 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +#include "snes9x.h" +#include "memmap.h" +#include "movie.h" +#include "display.h" + +#include + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-stringtools.h" +#include "mac-file.h" + +static void AddFolderIcon (NSURL *, const char *); +static NSURL *FindSNESFolder (const char *); +static NSURL *FindApplicationSupportFolder (NSURL *, const char *); +static NSURL *FindCustomFolder (NSURL *, const char *); + + +void CheckSaveFolder (NSURL *cartURL) +{ + NSString *folderPath = nil; + + switch (saveInROMFolder) + { + case 1: // ROM folder + folderPath = cartURL.URLByDeletingLastPathComponent.path; + break; + + case 2: // Application Support folder + return; + + case 4: // Custom folder + if (saveFolderPath == NULL) + { + saveInROMFolder = 2; + return; + } + + BOOL isDirectory = NO; + BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:saveFolderPath isDirectory:&isDirectory]; + + if (exists && isDirectory) + { + folderPath = saveFolderPath; + } + else + { + //AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotFound, kS9xMacAlertFolderNotFoundHint); + saveInROMFolder = 2; + return; + } + + break; + } + + BOOL writable = [[NSFileManager defaultManager] isWritableFileAtPath:folderPath]; + + if (!writable) + { + //AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotWritable, kS9xMacAlertFolderNotWritableHint); + saveInROMFolder = 2; + return; + } +} + +static NSURL *FindSNESFolder (const char *folderName) +{ + NSURL *purl = nil; + NSString *fstr = [NSString stringWithUTF8String:folderName]; + + purl = [[[NSBundle mainBundle] bundleURL].URLByDeletingLastPathComponent URLByAppendingPathComponent:fstr]; + + if (![NSFileManager.defaultManager fileExistsAtPath:purl.path]) + { + NSError *error = nil; + if ( [NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:&error] ) + { + AddFolderIcon(purl, folderName); + } + else + { + [[NSAlert alertWithError:error] runModal]; + } + } + + return purl; +} + +static NSURL *FindApplicationSupportFolder (const char *folderName) +{ + NSURL *purl = nil; + NSURL *baseURL = nil; + NSURL *s9xURL = nil; + NSURL *oldURL = nil; + NSString *fstr = [NSString stringWithUTF8String:folderName]; + + baseURL = [NSFileManager.defaultManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask].firstObject; + + if (!baseURL) + { + return nil; + } + + s9xURL = [baseURL URLByAppendingPathComponent:@"Snes9x"]; + oldURL = [baseURL URLByAppendingPathComponent:@"SNES9X"]; + + if ([NSFileManager.defaultManager fileExistsAtPath:s9xURL.path]) + { + purl = [s9xURL URLByAppendingPathComponent:fstr]; + } + else if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path]) + { + purl = [oldURL URLByAppendingPathComponent:fstr]; + } + + if (purl == NULL) + { + purl = [s9xURL URLByAppendingPathComponent:fstr]; + } + + [NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:NULL]; + + return purl; +} + +static NSURL *FindCustomFolder (const char *folderName) +{ + NSURL *purl = nil; + + if (saveFolderPath == NULL) + return nil; + + purl = [NSURL fileURLWithPath:saveFolderPath]; + + if (![NSFileManager.defaultManager fileExistsAtPath:saveFolderPath]) + { + NSError *error = nil; + if (![NSFileManager.defaultManager createDirectoryAtPath:saveFolderPath withIntermediateDirectories:YES attributes:nil error:&error]) + { + [[NSAlert alertWithError:error] runModal]; + return nil; + } + } + + purl = [purl URLByAppendingPathComponent:[NSString stringWithUTF8String:folderName]]; + + if (![NSFileManager.defaultManager fileExistsAtPath:purl.path]) + { + NSError *error = nil; + if ([NSFileManager.defaultManager createDirectoryAtPath:saveFolderPath withIntermediateDirectories:YES attributes:nil error:&error]) + { + AddFolderIcon(purl, folderName); + } + { + [[NSAlert alertWithError:error] runModal]; + return nil; + } + } + + return purl; +} + +void ChangeTypeAndCreator (const char *path, OSType type, OSType creator) +{ +// NSError *error = nil; +// if (![NSFileManager.defaultManager setAttributes:@{NSFileHFSCreatorCode: @(creator), NSFileHFSTypeCode: @(type)} ofItemAtPath:[NSString stringWithUTF8String:path] error:&error]) +// { +// [[NSAlert alertWithError:error] runModal]; +// } +} + +static void AddFolderIcon (NSURL *fref, const char *folderName) +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSString *filename = [@"folder_" stringByAppendingString:[NSString stringWithUTF8String:folderName]]; + NSURL *imageURL = [bundle URLForResource:filename withExtension:@"icns"]; + NSImage *image = [[NSImage alloc] initWithContentsOfURL:imageURL]; + + if ( image != nil ) + { + [NSWorkspace.sharedWorkspace setIcon:image forFile:fref.path options:0]; + } +} + +const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype) +{ + static int index = 0; + static char filePath[4][PATH_MAX + 1]; + + uint32 type; + char folderName[16]; + char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; + const char *p; + + index++; + if (index > 3) + index = 0; + + folderName[0] = filePath[index][0] = 0; + + if (strlen(inExt) < 4) + return (filePath[index]); + + p = inExt + strlen(inExt) - 4; + type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; + + switch (type) + { + case '.srm': + case '.rtc': + strlcpy(folderName, "SRAMs", sizeof(folderName)); + break; + + case '.frz': + strlcpy(folderName, "Freezes", sizeof(folderName)); + break; + + case '.spc': + strlcpy(folderName, "SPCs", sizeof(folderName)); + break; + + case '.cht': + strlcpy(folderName, "Cheats", sizeof(folderName)); + break; + + case '.ups': + case '.ips': + strlcpy(folderName, "Patches", sizeof(folderName)); + break; + + case '.png': + strlcpy(folderName, "Screenshots", sizeof(folderName)); + break; + + case '.dat': + case '.out': + case '.log': + strlcpy(folderName, "Logs", sizeof(folderName)); + break; + + case '.bio': // dummy + strlcpy(folderName, "BIOSes", sizeof(folderName)); + break; + } + + if (folderName[0] && (saveInROMFolder != 1)) + { + NSURL *folderURL = nil; + if (saveInROMFolder == 0) + { + folderURL = FindSNESFolder(folderName); + if (folderURL == nil) + saveInROMFolder = 2; + } + + if (saveInROMFolder == 4) + { + folderURL = FindCustomFolder(folderName); + if (folderURL == nil) + saveInROMFolder = 2; + + } + + if (saveInROMFolder == 2) + folderURL = FindApplicationSupportFolder(folderName); + + if (folderURL != nil) + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + snprintf(filePath[index], PATH_MAX + 1, "%s%s%s%s", folderURL.path.UTF8String, MAC_PATH_SEPARATOR, fname, inExt); + } + else + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + + strlcat(fname, inExt, sizeof(fname)); + _makepath(filePath[index], drive, dir, fname, ""); + } + } + else + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + + strlcat(fname, inExt, sizeof(fname)); + _makepath(filePath[index], drive, dir, fname, ""); + } + + return (filePath[index]); +} + +const char * S9xGetSPCFilename (void) +{ + char spcExt[16]; + + sprintf(spcExt, ".%03d.spc", (int) spcFileCount); + + spcFileCount++; + if (spcFileCount == 1000) + spcFileCount = 0; + + return (S9xGetFilename(spcExt, SPC_DIR)); +} + +const char * S9xGetPNGFilename (void) +{ + char pngExt[16]; + + sprintf(pngExt, ".%03d.png", (int) pngFileCount); + + pngFileCount++; + if (pngFileCount == 1000) + pngFileCount = 0; + + return (S9xGetFilename(pngExt, SCREENSHOT_DIR)); +} + +const char * S9xGetFreezeFilename (int which) +{ + char frzExt[16]; + + sprintf(frzExt, ".%03d.frz", which); + + return (S9xGetFilename(frzExt, SNAPSHOT_DIR)); +} + +const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype) +{ + uint32 type; + const char *p; + + if (strlen(inExt) < 4) + return (NULL); + + p = inExt + strlen(inExt) - 4; + type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; + + switch (type) + { + case '.spc': + return (S9xGetSPCFilename()); + + case '.png': + return (S9xGetPNGFilename()); + } + + return (NULL); +} + +bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) +{ + if (read_only) + { + if (0 != (*file = OPEN_STREAM(fname, "rb"))) + return (true); + } + else + { + if (0 != (*file = OPEN_STREAM(fname, "wb"))) + return (true); + } + + return (false); +} + +void S9xCloseSnapshotFile (STREAM file) +{ + CLOSE_STREAM(file); +} + +const char * S9xBasename (const char *in) +{ + static char s[PATH_MAX + 1]; + + strlcpy(s, in, sizeof(s)); + s[PATH_MAX] = 0; + + size_t l = strlen(s); + + for (unsigned int i = 0; i < l; i++) + { + if (s[i] < 32 || s[i] >= 127) + s[i] = '_'; + } + + return (basename(s)); +} + +const char * S9xGetDirectory (enum s9x_getdirtype dirtype) +{ + static int index = 0; + static char path[4][PATH_MAX + 1]; + + char inExt[16]; + char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; + + index++; + if (index > 3) + index = 0; + + switch (dirtype) + { + case SNAPSHOT_DIR: strlcpy(inExt, ".frz", sizeof(inExt)); break; + case SRAM_DIR: strlcpy(inExt, ".srm", sizeof(inExt)); break; + case SCREENSHOT_DIR: strlcpy(inExt, ".png", sizeof(inExt)); break; + case SPC_DIR: strlcpy(inExt, ".spc", sizeof(inExt)); break; + case CHEAT_DIR: strlcpy(inExt, ".cht", sizeof(inExt)); break; + case BIOS_DIR: strlcpy(inExt, ".bio", sizeof(inExt)); break; + case LOG_DIR: strlcpy(inExt, ".log", sizeof(inExt)); break; + default: strlcpy(inExt, ".xxx", sizeof(inExt)); break; + } + + _splitpath(S9xGetFilename(inExt, dirtype), drive, dir, fname, ext); + _makepath(path[index], drive, dir, "", ""); + + size_t l = strlen(path[index]); + if (l > 1) + path[index][l - 1] = 0; + + return (path[index]); +} diff --git a/macosx/mac-global_prefix.h b/macosx/mac-global_prefix.h index 17287a57..b20fa1f4 100644 --- a/macosx/mac-global_prefix.h +++ b/macosx/mac-global_prefix.h @@ -15,15 +15,16 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ -#undef READ_WORD(s) -#undef READ_3WORD(s) -#undef READ_DWORD(s) -#undef WRITE_WORD(s, d) -#undef WRITE_3WORD(s, d) -#undef WRITE_DWORD(s, d) +#undef READ_WORD +#undef READ_3WORD +#undef READ_DWORD +#undef WRITE_WORD +#undef WRITE_3WORD +#undef WRITE_DWORD #define ZLIB #define UNZIP_SUPPORT diff --git a/macosx/mac-gworld.h b/macosx/mac-gworld.h index 961b50d3..3cf1a899 100755 --- a/macosx/mac-gworld.h +++ b/macosx/mac-gworld.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-gworld.cpp b/macosx/mac-gworld.mm similarity index 94% rename from macosx/mac-gworld.cpp rename to macosx/mac-gworld.mm index 08bc10e3..97cfefb5 100755 --- a/macosx/mac-gworld.cpp +++ b/macosx/mac-gworld.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -57,12 +58,7 @@ void DrawSubCGImage (CGContextRef ctx, CGImageRef image, CGRect src, CGRect dst) static void SetIconImage (CGImageRef image, CGRect rct, int n) { - if (systemVersion >= 0x1040) - macIconImage[n] = CGImageCreateWithImageInRect(image, rct); -#ifdef MAC_PANTHER_SUPPORT - else - macIconRef[n] = CreateIconRefFromImage(image, rct); -#endif + macIconImage[n] = CGImageCreateWithImageInRect(image, rct); } void CreateIconImages (void) @@ -160,18 +156,8 @@ void ReleaseIconImages (void) { for (int i = 0; i < 118; i++) { - if (systemVersion >= 0x1040) - { - if (macIconImage[i]) - CGImageRelease(macIconImage[i]); - } - #ifdef MAC_PANTHER_SUPPORT - else - { - if (macIconRef[i]) - ReleaseIconRef(macIconRef[i]); - } - #endif + if (macIconImage[i]) + CGImageRelease(macIconImage[i]); } #ifdef MAC_PANTHER_SUPPORT diff --git a/macosx/mac-joypad.cpp b/macosx/mac-joypad.cpp deleted file mode 100755 index 8b1b664d..00000000 --- a/macosx/mac-joypad.cpp +++ /dev/null @@ -1,1148 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include -#include "HID_Utilities_External.h" - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-joypad.h" - -#define kUp(i) (i * 4) -#define kDn(i) (i * 4 + 1) -#define kLf(i) (i * 4 + 2) -#define kRt(i) (i * 4 + 3) - -#define kPadElemTypeNone 0 -#define kPadElemTypeHat4 1 -#define kPadElemTypeHat8 2 -#define kPadElemTypeAxis 3 -#define kPadElemTypeButton 4 -#define kPadElemTypeOtherHat4 5 -#define kPadElemTypeOtherHat8 6 - -#define kPadXAxis 1 -#define kPadYAxis 0 -#define kPadHat 0 - -#define kMaskUp 0x0800 -#define kMaskDn 0x0400 -#define kMaskLf 0x0200 -#define kMaskRt 0x0100 - -typedef hu_device_t *pRecDevice; -typedef hu_element_t *pRecElement; - -typedef struct actionStruct -{ - pRecDevice fDevice; - pRecElement fElement; - long fValue; - long fOldValue; -} actionRec, *actionPtr; - -typedef struct padDirectionInfo -{ - int type; - pRecDevice device [2]; - pRecElement element[2]; - long max [2]; - long maxmid [2]; - long mid [2]; - long midmin [2]; - long min [2]; -} directionInfo; - -static actionRec gActionRecs[kNeedCount]; -static directionInfo gDirectionInfo[MAC_MAX_PLAYERS]; -static int gDirectionHint[MAC_MAX_PLAYERS]; - -static const HIViewID gControlIDs[kNeedCount] = -{ - { '1_Up', 0 }, - { '1_Dn', 0 }, - { '1_Lf', 0 }, - { '1_Rt', 0 }, - - { '2_Up', 0 }, - { '2_Dn', 0 }, - { '2_Lf', 0 }, - { '2_Rt', 0 }, - - { '3_Up', 0 }, - { '3_Dn', 0 }, - { '3_Lf', 0 }, - { '3_Rt', 0 }, - - { '4_Up', 0 }, - { '4_Dn', 0 }, - { '4_Lf', 0 }, - { '4_Rt', 0 }, - - { '5_Up', 0 }, - { '5_Dn', 0 }, - { '5_Lf', 0 }, - { '5_Rt', 0 }, - - { '6_Up', 0 }, - { '6_Dn', 0 }, - { '6_Lf', 0 }, - { '6_Rt', 0 }, - - { '7_Up', 0 }, - { '7_Dn', 0 }, - { '7_Lf', 0 }, - { '7_Rt', 0 }, - - { '8_Up', 0 }, - { '8_Dn', 0 }, - { '8_Lf', 0 }, - { '8_Rt', 0 }, - - { '1__B', 0 }, - { '1__A', 0 }, - { '1__X', 0 }, - { '1__Y', 0 }, - { '1__L', 0 }, - { '1__R', 0 }, - { '1Sel', 0 }, - { '1Srt', 0 }, - - { '2__B', 0 }, - { '2__A', 0 }, - { '2__X', 0 }, - { '2__Y', 0 }, - { '2__L', 0 }, - { '2__R', 0 }, - { '2Sel', 0 }, - { '2Srt', 0 }, - - { '3__B', 0 }, - { '3__A', 0 }, - { '3__X', 0 }, - { '3__Y', 0 }, - { '3__L', 0 }, - { '3__R', 0 }, - { '3Sel', 0 }, - { '3Srt', 0 }, - - { '4__B', 0 }, - { '4__A', 0 }, - { '4__X', 0 }, - { '4__Y', 0 }, - { '4__L', 0 }, - { '4__R', 0 }, - { '4Sel', 0 }, - { '4Srt', 0 }, - - { '5__B', 0 }, - { '5__A', 0 }, - { '5__X', 0 }, - { '5__Y', 0 }, - { '5__L', 0 }, - { '5__R', 0 }, - { '5Sel', 0 }, - { '5Srt', 0 }, - - { '6__B', 0 }, - { '6__A', 0 }, - { '6__X', 0 }, - { '6__Y', 0 }, - { '6__L', 0 }, - { '6__R', 0 }, - { '6Sel', 0 }, - { '6Srt', 0 }, - - { '7__B', 0 }, - { '7__A', 0 }, - { '7__X', 0 }, - { '7__Y', 0 }, - { '7__L', 0 }, - { '7__R', 0 }, - { '7Sel', 0 }, - { '7Srt', 0 }, - - { '8__B', 0 }, - { '8__A', 0 }, - { '8__X', 0 }, - { '8__Y', 0 }, - { '8__L', 0 }, - { '8__R', 0 }, - { '8Sel', 0 }, - { '8Srt', 0 }, - - { '__FF', 0 }, - { '_Frz', 0 }, - { '_DeF', 0 }, - { '_Snp', 0 }, - { '_Esc', 0 }, - { '_SPC', 0 }, - { 'MouL', 0 }, - { 'MouR', 0 }, - { 'ScoT', 0 }, - { 'ScoP', 0 }, - { 'ScoC', 0 }, - { 'Ofsc', 0 }, - { '__Fn', 0 }, - { '_Alt', 0 }, - { 'FFUp', 0 }, - { 'FFDn', 0 }, - { '__TC', 0 } -}; - -static char gNeeds[kNeedCount][64] = -{ - "1P Up", - "1P Down", - "1P Left", - "1P Right", - - "2P Up", - "2P Down", - "2P Left", - "2P Right", - - "3P Up", - "3P Down", - "3P Left", - "3P Right", - - "4P Up", - "4P Down", - "4P Left", - "4P Right", - - "5P Up", - "5P Down", - "5P Left", - "5P Right", - - "6P Up", - "6P Down", - "6P Left", - "6P Right", - - "7P Up", - "7P Down", - "7P Left", - "7P Right", - - "8P Up", - "8P Down", - "8P Left", - "8P Right", - - "1P B Button", - "1P A Button", - "1P X Button", - "1P Y Button", - "1P L Button", - "1P R Button", - "1P Select", - "1P Start", - - "2P B Button", - "2P A Button", - "2P X Button", - "2P Y Button", - "2P L Button", - "2P R Button", - "2P Select", - "2P Start", - - "3P B Button", - "3P A Button", - "3P X Button", - "3P Y Button", - "3P L Button", - "3P R Button", - "3P Select", - "3P Start", - - "4P B Button", - "4P A Button", - "4P X Button", - "4P Y Button", - "4P L Button", - "4P R Button", - "4P Select", - "4P Start", - - "5P B Button", - "5P A Button", - "5P X Button", - "5P Y Button", - "5P L Button", - "5P R Button", - "5P Select", - "5P Start", - - "6P B Button", - "6P A Button", - "6P X Button", - "6P Y Button", - "6P L Button", - "6P R Button", - "6P Select", - "6P Start", - - "7P B Button", - "7P A Button", - "7P X Button", - "7P Y Button", - "7P L Button", - "7P R Button", - "7P Select", - "7P Start", - - "8P B Button", - "8P A Button", - "8P X Button", - "8P Y Button", - "8P L Button", - "8P R Button", - "8P Select", - "8P Start", - - "Fast Forward", - "Freeze Game", - "Defrost Game", - "Screenshot", - "Break", - "Save SPC", - "Mouse Left", - "Mouse Right", - "Scope Turbo", - "Scope Pause", - "Scope Cursor", - "Offscreen", - "Fn Modifier", - "Alt Modifier", - "Turbo Speed Up", - "Turbo Speed Down", - "Turbo Control Modifier" -}; - -static int gIconNumber[kNeedCount] = -{ - 0, - 1, - 2, - 3, - - 12, - 13, - 14, - 15, - - 24, - 25, - 26, - 27, - - 36, - 37, - 38, - 39, - - 48, - 49, - 50, - 51, - - 60, - 61, - 62, - 63, - - 72, - 73, - 74, - 75, - - 84, - 85, - 86, - 87, - - 5, - 7, - 6, - 4, - 8, - 9, - 11, - 10, - - 17, - 19, - 18, - 16, - 20, - 21, - 23, - 22, - - 29, - 31, - 30, - 28, - 32, - 33, - 35, - 34, - - 41, - 43, - 42, - 40, - 44, - 45, - 47, - 46, - - 53, - 55, - 54, - 52, - 56, - 57, - 59, - 58, - - 65, - 67, - 66, - 64, - 68, - 69, - 71, - 70, - - 77, - 79, - 78, - 76, - 80, - 81, - 83, - 82, - - 89, - 91, - 90, - 88, - 92, - 93, - 95, - 94, - - 101, - 102, - 103, - 104, - 114, - 105, - 116, - 117, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 115 -}; - -static void JoypadSetDirectionInfo (void); -static pascal void IdleTimer (EventLoopTimerRef, void *); -static pascal OSStatus ControllerEventHandler (EventHandlerCallRef, EventRef, void *); - - -void SaveControllerSettings (void) -{ - CFStringRef keyCFStringRef; - Boolean syncFlag; - - JoypadSetDirectionInfo(); - - for (int a = 0; a < kNeedCount; a++) - { - char needCStr[64], num[10]; - - strcpy(needCStr, gNeeds[a]); - if (padSetting > 1) - { - sprintf(num, "_%d", padSetting); - strcat(needCStr, num); - } - - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), needCStr); - if (keyCFStringRef) - { - if (gActionRecs[a].fDevice && gActionRecs[a].fElement) - syncFlag = HIDSaveElementPref(keyCFStringRef, kCFPreferencesCurrentApplication, gActionRecs[a].fDevice, gActionRecs[a].fElement); - else - CFPreferencesSetAppValue(keyCFStringRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyCFStringRef); - } - } - - for (int a = 0; a < MAC_MAX_PLAYERS; a++) - { - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("DirectionHint_%d_%d"), a, padSetting); - if (keyCFStringRef) - { - CFNumberRef numRef; - CFIndex v; - - v = (CFIndex) gDirectionHint[a]; - numRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &v); - if (numRef) - { - CFPreferencesSetAppValue(keyCFStringRef, numRef, kCFPreferencesCurrentApplication); - CFRelease(numRef); - } - - CFRelease(keyCFStringRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -void LoadControllerSettings (void) -{ - CFStringRef keyCFStringRef; - - for (int a = 0; a < kNeedCount; a++) - { - pRecDevice pDevice = NULL; - pRecElement pElement = NULL; - Boolean r = false; - char needCStr[64], num[10]; - - strcpy(needCStr, gNeeds[a]); - if (padSetting > 1) - { - sprintf(num, "_%d", padSetting); - strcat(needCStr, num); - } - - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), needCStr); - if (keyCFStringRef) - { - r = HIDRestoreElementPref(keyCFStringRef, kCFPreferencesCurrentApplication, &pDevice, &pElement); - if (r && pDevice && pElement) - { - gActionRecs[a].fDevice = pDevice; - gActionRecs[a].fElement = pElement; - } - else - { - gActionRecs[a].fDevice = NULL; - gActionRecs[a].fElement = NULL; - } - - CFRelease(keyCFStringRef); - } - } - - for (int a = 0; a < MAC_MAX_PLAYERS; a++) - { - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("DirectionHint_%d_%d"), a, padSetting); - if (keyCFStringRef) - { - Boolean r; - - gDirectionHint[a] = (int) CFPreferencesGetAppIntegerValue(keyCFStringRef, kCFPreferencesCurrentApplication, &r); - if (!r) - gDirectionHint[a] = kPadElemTypeNone; - - CFRelease(keyCFStringRef); - } - else - gDirectionHint[a] = kPadElemTypeNone; - } - - JoypadSetDirectionInfo(); -} - -static pascal OSStatus ControllerEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef; - - tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - if (tHICommand.commandID == 'CLRa') - { - ClearPadSetting(); - result = noErr; - } - else - { - SInt32 command = -1, count; - - for (count = 0; count < kNeedCount; count++) - if (tHICommand.commandID == gControlIDs[count].signature) - command = count; - - if (command >= 0) - { - pRecDevice pDevice; - pRecElement pElement; - - FlushEventQueue(GetCurrentEventQueue()); - - if (HIDConfigureAction(&pDevice, &pElement, 2.5f)) - { - if (command < MAC_MAX_PLAYERS * 4) // Direction - { - int i = command >> 2; // Player - long curv = HIDGetElementValue(pDevice, pElement); - - if (pElement->usage == kHIDUsage_GD_Hatswitch) // Hat Switch - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = pDevice; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = pElement; - - if (pDevice->vendorID == 1103) // Thrustmaster - gDirectionInfo[i].type = (pElement->max > 4) ? kPadElemTypeOtherHat8 : kPadElemTypeOtherHat4; - else - { - if (pElement->max > 4) - { - if (((command % 4 == 0) && (curv == 0)) || // Up : 0 - ((command % 4 == 1) && (curv == 4)) || // Down : 4 - ((command % 4 == 2) && (curv == 6)) || // Left : 6 - ((command % 4 == 3) && (curv == 2))) // Right : 2 - gDirectionInfo[i].type = kPadElemTypeOtherHat8; - else - gDirectionInfo[i].type = kPadElemTypeHat8; - } - else - { - if (((command % 4 == 0) && (curv == 0)) || // Up : 0 - ((command % 4 == 1) && (curv == 2)) || // Down : 2 - ((command % 4 == 2) && (curv == 3)) || // Left : 3 - ((command % 4 == 3) && (curv == 1))) // Right : 1 - gDirectionInfo[i].type = kPadElemTypeOtherHat4; - else - gDirectionInfo[i].type = kPadElemTypeHat4; - } - } - - gDirectionInfo[i].device [kPadHat] = pDevice; - gDirectionInfo[i].element[kPadHat] = pElement; - gDirectionInfo[i].max [kPadHat] = pElement->max; - gDirectionInfo[i].min [kPadHat] = pElement->min; - } - else - if (pElement->max - pElement->min > 1) // Axis (maybe) - { - if ((command % 4 == 0) || (command % 4 == 1)) // Up or Dn - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = pDevice; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = pElement; - - gDirectionInfo[i].type = kPadElemTypeAxis; - gDirectionInfo[i].device [kPadYAxis] = pDevice; - gDirectionInfo[i].element[kPadYAxis] = pElement; - gDirectionInfo[i].max [kPadYAxis] = pElement->max; - gDirectionInfo[i].min [kPadYAxis] = pElement->min; - gDirectionInfo[i].mid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].mid[kPadYAxis]) >> 1; - gDirectionInfo[i].midmin [kPadYAxis] = (gDirectionInfo[i].mid[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - } - else // Lf or Rt - { - gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = pDevice; - gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = pElement; - - gDirectionInfo[i].type = kPadElemTypeAxis; - gDirectionInfo[i].device [kPadXAxis] = pDevice; - gDirectionInfo[i].element[kPadXAxis] = pElement; - gDirectionInfo[i].max [kPadXAxis] = pElement->max; - gDirectionInfo[i].min [kPadXAxis] = pElement->min; - gDirectionInfo[i].mid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].mid[kPadXAxis]) >> 1; - gDirectionInfo[i].midmin [kPadXAxis] = (gDirectionInfo[i].mid[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - } - } - else // Button (maybe) - { - gActionRecs[command].fDevice = pDevice; - gActionRecs[command].fElement = pElement; - gDirectionInfo[i].type = kPadElemTypeButton; - } - - gDirectionHint[i] = gDirectionInfo[i].type; - } - else - { - gActionRecs[command].fDevice = pDevice; - gActionRecs[command].fElement = pElement; - } - } - else - { - if (command < MAC_MAX_PLAYERS * 4) // Direction - { - int i = command >> 2; // Player - - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = NULL; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = NULL; - - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - else - { - gActionRecs[command].fDevice = NULL; - gActionRecs[command].fElement = NULL; - } - } - - gActionRecs[command].fValue = 0; - gActionRecs[command].fOldValue = -2; - - FlushEventQueue(GetCurrentEventQueue()); - - result = noErr; - } - } - } - - break; - } - - break; - } - - return (result); -} - -static pascal void IdleTimer (EventLoopTimerRef inTimer, void *userData) -{ - static uint32 old[MAC_MAX_PLAYERS] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 }; - - HIViewRef ctl, root; - uint32 pad[MAC_MAX_PLAYERS]; - - root = HIViewGetRoot((WindowRef) userData); - - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - pad[i] = 0; - JoypadScanDirection(i, &(pad[i])); - - if (old[i] != pad[i]) - { - old[i] = pad[i]; - - HIViewFindByID(root, gControlIDs[kUp(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskUp) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kDn(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskDn) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kLf(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskLf) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kRt(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskRt) ? 1 : 0); - } - } - - for (int i = MAC_MAX_PLAYERS * 4; i < kNeedCount; i++) - { - gActionRecs[i].fValue = ISpKeyIsPressed(i); - - if (gActionRecs[i].fOldValue != gActionRecs[i].fValue) - { - gActionRecs[i].fOldValue = gActionRecs[i].fValue; - - HIViewFindByID(root, gControlIDs[i], &ctl); - SetControl32BitValue(ctl, (gActionRecs[i].fValue ? 1 : 0)); - } - } -} - -void SetUpHID (void) -{ - pRecDevice device; - - HIDBuildDeviceList(NULL, NULL); - device = HIDGetFirstDevice(); - if (!device) - { - hidExist = false; - return; - } - - hidExist = true; - - ClearPadSetting(); - - LoadControllerSettings(); -} - -void ClearPadSetting (void) -{ - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - - for (int i = 0; i < kNeedCount; i++) - { - gActionRecs[i].fDevice = NULL; - gActionRecs[i].fElement = NULL; - gActionRecs[i].fValue = 0; - gActionRecs[i].fOldValue = -2; - } -} - -void ReleaseHID (void) -{ - if (hidExist) - HIDReleaseDeviceList(); -} - -void ConfigureHID (void) -{ - OSStatus err; - IBNibRef nibRef; - - if (!hidExist) - return; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("Controllers"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef eref; - EventLoopTimerRef tref; - EventHandlerUPP eventUPP; - EventLoopTimerUPP timerUPP; - EventTypeSpec windowEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }; - HIViewRef ctl, root; - HIViewID cid; - CFStringRef str1, str2; - ControlButtonContentInfo info; - - LoadControllerSettings(); - - root = HIViewGetRoot(tWindowRef); - cid.id = 0; - cid.signature = 'PRES'; - HIViewFindByID(root, cid, &ctl); - str1 = CFCopyLocalizedString(CFSTR("PresetNum"), "PresetNum"); - str2 = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, str1, padSetting); - SetStaticTextCFString(ctl, str2, false); - CFRelease(str2); - CFRelease(str1); - - if (systemVersion >= 0x1040) - { - info.contentType = kControlContentCGImageRef; - for (int i = 0; i < kNeedCount; i++) - { - HIViewFindByID(root, gControlIDs[i], &ctl); - info.u.imageRef = macIconImage[gIconNumber[i]]; - err = SetBevelButtonContentInfo(ctl, &info); - } - } - #ifdef MAC_PANTHER_SUPPORT - else - { - info.contentType = kControlContentIconRef; - for (int i = 0; i < kNeedCount; i++) - { - HIViewFindByID(root, gControlIDs[i], &ctl); - info.u.iconRef = macIconRef[gIconNumber[i]]; - err = SetBevelButtonContentInfo(ctl, &info); - } - } - #endif - - eventUPP = NewEventHandlerUPP(ControllerEventHandler); - err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref); - - timerUPP = NewEventLoopTimerUPP(IdleTimer); - err = InstallEventLoopTimer(GetCurrentEventLoop(), 0.0f, 0.1f, timerUPP, (void *) tWindowRef, &tref); - - MoveWindowPosition(tWindowRef, kWindowControllers, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowControllers); - - err = RemoveEventLoopTimer(tref); - DisposeEventLoopTimerUPP(timerUPP); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(tWindowRef); - - SaveControllerSettings(); - } - - DisposeNibReference(nibRef); - } -} - -long ISpKeyIsPressed (int needID) -{ - return (gActionRecs[needID].fDevice ? HIDGetElementValue(gActionRecs[needID].fDevice, gActionRecs[needID].fElement) : 0); -} - -void JoypadScanDirection (int i, uint32 *pad) -{ - long state; - - switch (gDirectionInfo[i].type) - { - case kPadElemTypeAxis: // Axis (maybe) - if (gDirectionInfo[i].device[kPadYAxis]) // Y-Axis - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadYAxis], gDirectionInfo[i].element[kPadYAxis]); - if (state >= gDirectionInfo[i].maxmid[kPadYAxis]) - *pad |= kMaskDn; - else - if (state <= gDirectionInfo[i].midmin[kPadYAxis]) - *pad |= kMaskUp; - } - - if (gDirectionInfo[i].device[kPadXAxis]) // X-Axis - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadXAxis], gDirectionInfo[i].element[kPadXAxis]); - if (state >= gDirectionInfo[i].maxmid[kPadXAxis]) - *pad |= kMaskRt; - else - if (state <= gDirectionInfo[i].midmin[kPadXAxis]) - *pad |= kMaskLf; - } - - break; - - case kPadElemTypeHat8: // Hat Switch (8 Directions) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 1: *pad |= kMaskUp ; break; - case 2: *pad |= (kMaskUp | kMaskRt); break; - case 3: *pad |= kMaskRt ; break; - case 4: *pad |= (kMaskRt | kMaskDn); break; - case 5: *pad |= kMaskDn ; break; - case 6: *pad |= (kMaskDn | kMaskLf); break; - case 7: *pad |= kMaskLf ; break; - case 8: *pad |= (kMaskLf | kMaskUp); break; - } - } - - break; - - case kPadElemTypeHat4: // Hat Switch (4 Directions) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 1: *pad |= kMaskUp; break; - case 2: *pad |= kMaskRt; break; - case 3: *pad |= kMaskDn; break; - case 4: *pad |= kMaskLf; break; - } - } - - break; - - case kPadElemTypeOtherHat8: // Hat Switch (8 Directions, Start at 0) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 0: *pad |= kMaskUp ; break; - case 1: *pad |= (kMaskUp | kMaskRt); break; - case 2: *pad |= kMaskRt ; break; - case 3: *pad |= (kMaskRt | kMaskDn); break; - case 4: *pad |= kMaskDn ; break; - case 5: *pad |= (kMaskDn | kMaskLf); break; - case 6: *pad |= kMaskLf ; break; - case 7: *pad |= (kMaskLf | kMaskUp); break; - } - } - - break; - - case kPadElemTypeOtherHat4: // Hat Switch (4 Directions, Start at 0) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 0: *pad |= kMaskUp; break; - case 1: *pad |= kMaskRt; break; - case 2: *pad |= kMaskDn; break; - case 3: *pad |= kMaskLf; break; - } - } - - break; - - case kPadElemTypeButton: // Button (maybe) - if (gActionRecs[kUp(i)].fDevice && HIDGetElementValue(gActionRecs[kUp(i)].fDevice, gActionRecs[kUp(i)].fElement)) - *pad |= kMaskUp; - if (gActionRecs[kDn(i)].fDevice && HIDGetElementValue(gActionRecs[kDn(i)].fDevice, gActionRecs[kDn(i)].fElement)) - *pad |= kMaskDn; - if (gActionRecs[kLf(i)].fDevice && HIDGetElementValue(gActionRecs[kLf(i)].fDevice, gActionRecs[kLf(i)].fElement)) - *pad |= kMaskLf; - if (gActionRecs[kRt(i)].fDevice && HIDGetElementValue(gActionRecs[kRt(i)].fDevice, gActionRecs[kRt(i)].fElement)) - *pad |= kMaskRt; - - break; - } -} - -static void JoypadSetDirectionInfo (void) -{ - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - if (((gActionRecs[kUp(i)].fDevice) && (gActionRecs[kUp(i)].fElement)) && - ((gActionRecs[kDn(i)].fDevice) && (gActionRecs[kDn(i)].fElement)) && - ((gActionRecs[kLf(i)].fDevice) && (gActionRecs[kLf(i)].fElement)) && - ((gActionRecs[kRt(i)].fDevice) && (gActionRecs[kRt(i)].fElement))) - { - if ((gActionRecs[kUp(i)].fDevice == gActionRecs[kDn(i)].fDevice) && - (gActionRecs[kDn(i)].fDevice == gActionRecs[kLf(i)].fDevice) && - (gActionRecs[kLf(i)].fDevice == gActionRecs[kRt(i)].fDevice) && - (gActionRecs[kUp(i)].fElement == gActionRecs[kDn(i)].fElement) && - (gActionRecs[kDn(i)].fElement == gActionRecs[kLf(i)].fElement) && - (gActionRecs[kLf(i)].fElement == gActionRecs[kRt(i)].fElement) && - (gActionRecs[kUp(i)].fElement->usage == kHIDUsage_GD_Hatswitch)) // Hat Switch - { - if ((gDirectionHint[i] == kPadElemTypeHat8) || (gDirectionHint[i] == kPadElemTypeOtherHat8) || - (gDirectionHint[i] == kPadElemTypeHat4) || (gDirectionHint[i] == kPadElemTypeOtherHat4)) - gDirectionInfo[i].type = gDirectionHint[i]; - else // Assuming... - { - if ((gActionRecs[kUp(i)].fDevice->vendorID == 1103) || (gActionRecs[kUp(i)].fElement->min == 0)) - gDirectionInfo[i].type = (gActionRecs[kUp(i)].fElement->max > 4) ? kPadElemTypeOtherHat8 : kPadElemTypeOtherHat4; - else - gDirectionInfo[i].type = (gActionRecs[kUp(i)].fElement->max > 4) ? kPadElemTypeHat8 : kPadElemTypeHat4; - - gDirectionHint[i] = gDirectionInfo[i].type; - } - - gDirectionInfo[i].device [kPadHat] = gActionRecs[kUp(i)].fDevice; - gDirectionInfo[i].element[kPadHat] = gActionRecs[kUp(i)].fElement; - gDirectionInfo[i].max [kPadHat] = gActionRecs[kUp(i)].fElement->max; - gDirectionInfo[i].min [kPadHat] = gActionRecs[kUp(i)].fElement->min; - } - else - if ((gActionRecs[kUp(i)].fDevice == gActionRecs[kDn(i)].fDevice) && - (gActionRecs[kLf(i)].fDevice == gActionRecs[kRt(i)].fDevice) && - (gActionRecs[kUp(i)].fElement == gActionRecs[kDn(i)].fElement) && - (gActionRecs[kLf(i)].fElement == gActionRecs[kRt(i)].fElement) && - (gActionRecs[kUp(i)].fElement->max - gActionRecs[kUp(i)].fElement->min > 1) && - (gActionRecs[kLf(i)].fElement->max - gActionRecs[kLf(i)].fElement->min > 1)) // Axis (maybe) - { - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeAxis; - - gDirectionInfo[i].device [kPadYAxis] = gActionRecs[kUp(i)].fDevice; - gDirectionInfo[i].element[kPadYAxis] = gActionRecs[kUp(i)].fElement; - gDirectionInfo[i].max [kPadYAxis] = gActionRecs[kUp(i)].fElement->max; - gDirectionInfo[i].min [kPadYAxis] = gActionRecs[kUp(i)].fElement->min; - gDirectionInfo[i].mid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].mid[kPadYAxis]) >> 1; - gDirectionInfo[i].midmin [kPadYAxis] = (gDirectionInfo[i].mid[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - - gDirectionInfo[i].device [kPadXAxis] = gActionRecs[kLf(i)].fDevice; - gDirectionInfo[i].element[kPadXAxis] = gActionRecs[kLf(i)].fElement; - gDirectionInfo[i].max [kPadXAxis] = gActionRecs[kLf(i)].fElement->max; - gDirectionInfo[i].min [kPadXAxis] = gActionRecs[kLf(i)].fElement->min; - gDirectionInfo[i].mid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].mid[kPadXAxis]) >> 1; - gDirectionInfo[i].midmin [kPadXAxis] = (gDirectionInfo[i].mid[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - } - else // Button (maybe) - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeButton; - } - else - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = NULL; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = NULL; - - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - } -} diff --git a/macosx/mac-joypad.h b/macosx/mac-joypad.h index 7f5e74b6..1f77a39c 100755 --- a/macosx/mac-joypad.h +++ b/macosx/mac-joypad.h @@ -15,154 +15,124 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_joypad_h_ #define _mac_joypad_h_ -enum -{ - kISp1PUp = 0, - kISp1PDn, - kISp1PLf, - kISp1PRt, +#include +#include +#include - kISp2PUp, - kISp2PDn, - kISp2PLf, - kISp2PRt, +#include "mac-controls.h" - kISp3PUp, - kISp3PDn, - kISp3PLf, - kISp3PRt, +struct JoypadDevice { + uint16 vendorID; + uint16 productID; + uint32 index; - kISp4PUp, - kISp4PDn, - kISp4PLf, - kISp4PRt, + bool operator==(const struct JoypadDevice &o) const + { + return vendorID == o.vendorID && productID == o.productID && index == o.index; + } - kISp5PUp, - kISp5PDn, - kISp5PLf, - kISp5PRt, - - kISp6PUp, - kISp6PDn, - kISp6PLf, - kISp6PRt, - - kISp7PUp, - kISp7PDn, - kISp7PLf, - kISp7PRt, - - kISp8PUp, - kISp8PDn, - kISp8PLf, - kISp8PRt, - - kISp1PB, - kISp1PA, - kISp1PX, - kISp1PY, - kISp1PL, - kISp1PR, - kISp1PSelect, - kISp1PStart, - - kISp2PB, - kISp2PA, - kISp2PX, - kISp2PY, - kISp2PL, - kISp2PR, - kISp2PSelect, - kISp2PStart, - - kISp3PB, - kISp3PA, - kISp3PX, - kISp3PY, - kISp3PL, - kISp3PR, - kISp3PSelect, - kISp3PStart, - - kISp4PB, - kISp4PA, - kISp4PX, - kISp4PY, - kISp4PL, - kISp4PR, - kISp4PSelect, - kISp4PStart, - - kISp5PB, - kISp5PA, - kISp5PX, - kISp5PY, - kISp5PL, - kISp5PR, - kISp5PSelect, - kISp5PStart, - - kISp6PB, - kISp6PA, - kISp6PX, - kISp6PY, - kISp6PL, - kISp6PR, - kISp6PSelect, - kISp6PStart, - - kISp7PB, - kISp7PA, - kISp7PX, - kISp7PY, - kISp7PL, - kISp7PR, - kISp7PSelect, - kISp7PStart, - - kISp8PB, - kISp8PA, - kISp8PX, - kISp8PY, - kISp8PL, - kISp8PR, - kISp8PSelect, - kISp8PStart, - - kISpFastForward, - kISpFreeze, - kISpDefrost, - kISpScreenshot, - kISpEsc, - kISpSPC, - kISpMouseL, - kISpMouseR, - kISpScopeT, - kISpScopeP, - kISpScopeC, - kISpOffScreen, - kISpFunction, - kISpAlt, - kISpFFUp, - kISpFFDown, - kISpTC, - - kNeedCount + bool operator<(const struct JoypadDevice &o) const + { + return vendorID < o.vendorID || productID < o.productID || index < o.index; + } }; +struct JoypadCookie { + struct JoypadDevice device; + uint32 cookie; + + JoypadCookie() {} + + struct JoypadCookie &operator=(const struct JoypadCookie &o) + { + device = o.device; + cookie = o.cookie; + return *this; + } + + bool operator==(const struct JoypadCookie &o) const + { + return device == o.device && cookie == o.cookie; + } + + bool operator<(const struct JoypadCookie &o) const + { + return device < o.device || cookie < o.cookie; + } +}; + +struct JoypadCookieInfo { + uint32 usage; + uint32 index; + int32 midpoint; + int32 min; + int32 max; +}; + +struct JoypadInput { + struct JoypadCookie cookie; + int32 value; + + bool operator==(const struct JoypadInput &o) const + { + return cookie == o.cookie && value == o.value; + } + + bool operator<(const struct JoypadInput &o) const + { + return cookie < o.cookie || value < o.value; + } +}; + +namespace std { + template <> + struct hash + { + std::size_t operator()(const JoypadDevice& k) const + { + return k.vendorID ^ k.productID ^ k.index; + } + }; + + template <> + struct hash + { + std::size_t operator()(const JoypadCookie& k) const + { + return std::hash()(k.device) ^ k.cookie; + } + }; + + template <> + struct hash + { + std::size_t operator()(const JoypadInput& k) const + { + return std::hash()(k.cookie) ^ k.value; + } + }; +} + void SetUpHID (void); void ReleaseHID (void); -void ConfigureHID (void); -void ClearPadSetting (void); -void SaveControllerSettings (void); -void LoadControllerSettings (void); -long ISpKeyIsPressed (int); -void JoypadScanDirection (int, uint32 *); + +std::unordered_set ListJoypads (void); +std::string NameForDevice(struct JoypadDevice device); + +void SetPlayerForJoypad(int8 playerNum, uint32 vendorID, uint32 productID, uint32 index, int8 *oldPlayerNum); +bool SetButtonCodeForJoypadControl(uint32 vendorID, uint32 productID, uint32 index, uint32 cookie, int32 value, S9xButtonCode buttonCode, bool overwrite, S9xButtonCode *oldButtonCode); +void ClearButtonCodeForJoypad(uint32 vendorID, uint32 productID, uint32 index, S9xButtonCode buttonCode); + +void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index); +std::unordered_map GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index); + +std::string LabelForInput(uint32 vendorID, uint32 productID, uint32 cookie, int32 value); #endif diff --git a/macosx/mac-joypad.mm b/macosx/mac-joypad.mm new file mode 100755 index 00000000..111b8e4e --- /dev/null +++ b/macosx/mac-joypad.mm @@ -0,0 +1,1039 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include + +#include + +#include "port.h" + +#include +#include +#include +#include "HID_Utilities_External.h" + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-joypad.h" + +std::unordered_set allDevices; +std::unordered_map>> defaultAxes; +std::unordered_map> defaultButtons; +std::unordered_map> defaultHatValues; +std::unordered_map playerNumByDevice; +std::unordered_map deviceIndexByPort; +std::unordered_map infoByCookie; +std::unordered_map buttonCodeByJoypadInput; +std::unordered_map namesByDevice; + +@interface NSData (S9xHexString) ++(id)s9x_dataWithHexString:(NSString *)hex; +@end + +@implementation NSData (S9xHexString) + +// Not efficent ++ (id)s9x_dataWithHexString:(NSString *)hex +{ + char buf[3]; + buf[2] = '\0'; + NSAssert(0 == [hex length] % 2, @"Hex strings should have an even number of digits (%@)", hex); + unsigned char *bytes = (unsigned char *)malloc([hex length]/2); + unsigned char *bp = bytes; + for (CFIndex i = 0; i < [hex length]; i += 2) { + buf[0] = [hex characterAtIndex:i]; + buf[1] = [hex characterAtIndex:i+1]; + char *b2 = NULL; + *bp++ = strtol(buf, &b2, 16); + NSAssert(b2 == buf + 2, @"String should be all hex digits: %@ (bad digit around %ld)", hex, (long)i); + } + + return [NSData dataWithBytesNoCopy:bytes length:[hex length]/2 freeWhenDone:YES]; +} + +@end + +IOHIDManagerRef hidManager = NULL; + +std::unordered_set ListJoypads (void) { + return allDevices; +} + +std::string NameForDevice(struct JoypadDevice device) { + auto it = namesByDevice.find(device); + if (it != namesByDevice.end()) + { + return it->second; + } + + return ""; +} + +void gamepadAction(void *inContext, IOReturn inResult, void *inSender, IOHIDValueRef v) { + pthread_mutex_lock(&keyLock); + + IOHIDDeviceRef device = (IOHIDDeviceRef) inSender; + uint32 port = ((NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey))).unsignedIntValue; + + if (deviceIndexByPort.find(port) == deviceIndexByPort.end()) + { + pthread_mutex_unlock(&keyLock); + return; + } + + IOHIDElementRef element = IOHIDValueGetElement(v); + + NSNumber *vendor = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)); + NSNumber *product = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)); + + struct JoypadDevice deviceStruct; + deviceStruct.vendorID = vendor.unsignedIntValue; + deviceStruct.productID = product.unsignedIntValue; + deviceStruct.index = deviceIndexByPort[port]; + + if (allDevices.find(deviceStruct) == allDevices.end()) + { + pthread_mutex_unlock(&keyLock); + return; + } + + if ( playerNumByDevice.find(deviceStruct) == playerNumByDevice.end()) + { + pthread_mutex_unlock(&keyLock); + return; + } + + int8 playerNum = playerNumByDevice[deviceStruct]; + if (playerNum < 0 || playerNum >= MAC_MAX_PLAYERS) + { + pthread_mutex_unlock(&keyLock); + return; + } + + struct JoypadCookie cookieStruct; + cookieStruct.device = deviceStruct; + cookieStruct.cookie = (int32_t)IOHIDElementGetCookie(element); + + if (infoByCookie.find(cookieStruct) != infoByCookie.end()) + { + auto info = infoByCookie[cookieStruct]; + + struct JoypadInput inputStruct; + inputStruct.cookie = cookieStruct; + inputStruct.value = (int32_t)IOHIDValueGetIntegerValue(v); + + S9xJoypad *objcJoypad = [S9xJoypad new]; + objcJoypad.vendorID = deviceStruct.vendorID; + objcJoypad.productID = deviceStruct.productID; + objcJoypad.index = deviceStruct.index; + + S9xJoypadInput *objcInput = [S9xJoypadInput new]; + objcInput.cookie = inputStruct.cookie.cookie; + objcInput.value =inputStruct.value; + + pthread_mutex_unlock(&keyLock); + if (info.usage != kHIDUsage_GD_Hatswitch && info.min != info.max) + { + if (inputStruct.value <= info.min || inputStruct.value >= info.max) + { + if ([inputDelegate handleInput:objcInput fromJoypad:objcJoypad]) + { + return; + } + } + } + else + { + if (inputStruct.value >= info.min && inputStruct.value <= info.max) + { + if ([inputDelegate handleInput:objcInput fromJoypad:objcJoypad]) + { + return; + } + } + } + pthread_mutex_lock(&keyLock); + + struct JoypadInput oppositeInputStruct = inputStruct; + + if (info.usage != kHIDUsage_GD_Hatswitch && info.min != info.max) + { + if (inputStruct.value < info.min) + { + inputStruct.value = info.min; + oppositeInputStruct.value = info.max; + } + else if ( inputStruct.value > info.max) + { + inputStruct.value = info.max; + oppositeInputStruct.value = info.min; + } + else + { + inputStruct.value = info.midpoint; + } + + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = true; + + if ( buttonCodeByJoypadInput.find(oppositeInputStruct) != buttonCodeByJoypadInput.end() ) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + } + + } + else + { + oppositeInputStruct.value = info.min; + if ( buttonCodeByJoypadInput.find(oppositeInputStruct) != buttonCodeByJoypadInput.end() ) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + } + oppositeInputStruct.value = info.max; + + if ( buttonCodeByJoypadInput.find(oppositeInputStruct) != buttonCodeByJoypadInput.end() ) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + } + } + } + else if (info.usage == kHIDUsage_GD_Hatswitch) + { + int32 value = inputStruct.value; + + for (int i = info.min; i <= info.max; i++) + { + inputStruct.value = i; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = false; + } + } + + if (value % 2 == 0) + { + inputStruct.value = value; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = true; + } + } + else + { + for (int i = value - 1; i <= value + 1; i++) + { + int button = i; + if (i < info.min) + { + button = info.max; + } + else if (i > info.max) + { + button = info.min; + } + inputStruct.value = button; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = true; + } + } + } + } + else + { + bool value = (inputStruct.value != 0); + inputStruct.value = 0; + + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = value; + } + } + } + + pthread_mutex_unlock(&keyLock); +} + +void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutableArray *buttons, NSMutableArray *axes, NSMutableDictionary *hat) +{ + if (properties == nil) + { + return; + } + + int usagePage = [properties[@kIOHIDElementUsagePageKey] intValue]; + int usage = [properties[@kIOHIDElementUsageKey] intValue]; + if (usagePage == kHIDPage_Button) + { + [buttons addObject:properties]; + } + else if (usagePage == kHIDPage_GenericDesktop && (usage == kHIDUsage_GD_X || usage == kHIDUsage_GD_Y || usage == kHIDUsage_GD_Z || usage == kHIDUsage_GD_Rx || usage == kHIDUsage_GD_Ry || usage == kHIDUsage_GD_Rz)) + { + [axes addObject:properties]; + } + else if (usagePage == kHIDPage_GenericDesktop && usage == kHIDUsage_GD_Hatswitch) + { + [hat setDictionary:properties]; + } + + for ( NSDictionary *child in properties[@kIOHIDElementKey] ) + { + findControls(device, child, buttons, axes, hat); + } +} + +void ParseDefaults (void) +{ + NSString *contents = [NSString stringWithContentsOfURL:[[NSBundle bundleForClass:[S9xEngine class]] URLForResource:@"gamecontrollerdb" withExtension:@"txt"] encoding:NSUTF8StringEncoding error:NULL]; + + for ( NSString *line in [contents componentsSeparatedByString:@"\n"]) + { + NSMutableArray *components = [[line componentsSeparatedByString:@","] mutableCopy]; + if (components.count > 0) + { + [components removeLastObject]; + } + + if (![components.lastObject isEqualToString:@"platform:Mac OS X"]) + { + continue; + } + + [components removeLastObject]; + + if (components.firstObject.length != 32) + { + continue; + } + + NSData *guidData = [NSData s9x_dataWithHexString:components.firstObject]; + uint16 *bytes = (uint16 *)guidData.bytes; + + struct JoypadDevice key; + key.vendorID = bytes[2]; + key.productID = bytes[4]; + key.index = 0; + + [components removeObjectAtIndex:0]; + [components removeObjectAtIndex:0]; + + for (NSString *component in components) + { + NSArray *subcomponents = [component componentsSeparatedByString:@":"]; + + if (subcomponents.count != 2) + { + continue; + } + + NSString *control = subcomponents.lastObject; + NSString *codeString = subcomponents.firstObject; + + if ([control hasPrefix:@"b"]) + { + control = [control substringFromIndex:1]; + int buttonNum = control.intValue; + int16 code = -1; + + // Buttons are mirrored horizontally, since the config uses the Xbox controller as a reference. + if ([codeString isEqualToString:@"a"]) + { + code = kB; + } + else if ([codeString isEqualToString:@"b"]) + { + code = kA; + } + else if ([codeString isEqualToString:@"x"]) + { + code = kY; + } + else if ([codeString isEqualToString:@"y"]) + { + code = kX; + } + else if ([codeString isEqualToString:@"start"]) + { + code = kStart; + } + else if ([codeString isEqualToString:@"back"]) + { + code = kSelect; + } + else if ([codeString isEqualToString:@"rightshoulder"]) + { + code = kR; + } + else if ([codeString isEqualToString:@"leftshoulder"]) + { + code = kL; + } + else if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultButtons[key][buttonNum] = (S9xButtonCode)code; + } + } + else if ([control hasPrefix:@"h0."]) + { + control = [control substringFromIndex:3]; + int value = control.intValue; + int16 code = -1; + + if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultHatValues[key][value] = (S9xButtonCode)code; + } + } + else if ([control hasPrefix:@"a"] || [control hasPrefix:@"+a"] || [control hasPrefix:@"-a"]) + { + BOOL negative = [control hasPrefix:@"-"]; + + if ( negative || [control hasPrefix:@"+"]) + { + control = [control substringFromIndex:2]; + } + else + { + control = [control substringFromIndex:1]; + } + + int axisNum = control.intValue; + int16 code = -1; + + if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultAxes[key][axisNum][negative ? -1 : 1] = (S9xButtonCode)code; + } + else + { + if ([codeString isEqualToString:@"leftx"]) + { + defaultAxes[key][axisNum][-1] = kLeft; + defaultAxes[key][axisNum][-1] = kRight; + } + else if ([codeString isEqualToString:@"lefty"]) + { + defaultAxes[key][axisNum][-1] = kUp; + defaultAxes[key][axisNum][-1] = kDown; + } + } + } + } + } +} + +void SetDefaultButtonCodeForJoypadControl(struct JoypadInput &input, S9xButtonCode buttonCode) +{ + SetButtonCodeForJoypadControl(input.cookie.device.vendorID, input.cookie.device.productID, input.cookie.device.index, input.cookie.cookie, input.value, buttonCode, false, NULL); +} + +void AddDevice (IOHIDDeviceRef device) +{ + NSNumber *vendor = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)); + NSNumber *product = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)); + NSString *name = (NSString *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)); + + NSMutableArray *buttons = [NSMutableArray new]; + NSMutableArray *axes = [NSMutableArray new]; + NSMutableDictionary *hat = [NSMutableDictionary new]; + + struct JoypadDevice deviceStruct; + deviceStruct.vendorID = vendor.unsignedIntValue; + deviceStruct.productID = product.unsignedIntValue; + deviceStruct.index = 0; + + struct JoypadDevice defaultsKey = deviceStruct; + + while (allDevices.find(deviceStruct) != allDevices.end()) + { + deviceStruct.index += 1; + } + + allDevices.insert(deviceStruct); + std::string s = std::string(name.UTF8String); + + if (deviceStruct.index > 0) + { + s = s + " (" + std::to_string(deviceStruct.index + 1) + ")"; + } + + namesByDevice[deviceStruct] = s; + uint32_t port = ((NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey))).unsignedIntValue; + deviceIndexByPort[port] = deviceStruct.index; + + CFMutableDictionaryRef properties = NULL; + + IORegistryEntryCreateCFProperties(IOHIDDeviceGetService(device), &properties, kCFAllocatorDefault, kNilOptions); + + for ( NSDictionary *child in ((__bridge NSDictionary *)properties)[@kIOHIDElementKey] ) + { + findControls(deviceStruct, child, buttons, axes, hat); + } + + NSComparisonResult (^comparitor)(NSDictionary *a, NSDictionary *b) = ^NSComparisonResult(NSDictionary *a, NSDictionary *b) + { + NSNumber *usageA = a[@kIOHIDElementUsageKey]; + NSNumber *usageB = b[@kIOHIDElementUsageKey]; + + return [usageA compare:usageB]; + }; + + [buttons sortWithOptions:NSSortStable usingComparator:comparitor]; + + uint32 buttonIndex = 0; + for (NSDictionary *buttonDict in buttons) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = buttonDict[@kIOHIDElementCookieKey].unsignedIntValue; + + info.usage = kHIDUsage_Undefined; + info.min = 0; + info.max = 0; + info.midpoint = 0; + + if (defaultButtons.find(defaultsKey) != defaultButtons.end()) + { + std::map &buttonMap = defaultButtons[defaultsKey]; + if (buttonMap.find(buttonIndex) != buttonMap.end()) + { + struct JoypadInput input; + input.cookie = cookie; + input.value = 0; + SetDefaultButtonCodeForJoypadControl(input, buttonMap[buttonIndex]); + } + } + + info.index = buttonIndex++; + infoByCookie[cookie] = info; + } + + [axes sortWithOptions:NSSortStable usingComparator:comparitor]; + + uint32 axisIndex = 0; + const float deadZone = 0.3; + for ( NSDictionary *axisDict in axes) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = axisDict[@kIOHIDElementCookieKey].unsignedIntValue; + + info.min = axisDict[@kIOHIDElementMinKey].intValue; + info.max = axisDict[@kIOHIDElementMaxKey].intValue; + info.midpoint = (info.min + info.max) / 2; + info.max = info.midpoint + ((info.max - info.midpoint) * deadZone); + info.min = info.midpoint - ((info.midpoint - info.min) * deadZone); + + if (defaultAxes.find(defaultsKey) != defaultAxes.end()) + { + auto axisMap = defaultAxes[defaultsKey]; + + if (axisMap.find(axisIndex) != axisMap.end()) + { + { + struct JoypadInput input; + input.cookie = cookie; + input.value = info.min; + SetDefaultButtonCodeForJoypadControl(input, axisMap[axisIndex][-1]); + } + + { + struct JoypadInput input; + input.cookie = cookie; + input.value = info.max; + SetDefaultButtonCodeForJoypadControl(input, axisMap[axisIndex][1]); + } + } + } + + info.usage = axisDict[@kIOHIDElementUsageKey].intValue; + info.index = axisIndex++; + infoByCookie[cookie] = info; + } + + if ([hat count] >= 0) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = hat[@kIOHIDElementCookieKey].unsignedIntValue; + + info.usage = kHIDUsage_GD_Hatswitch; + info.min = hat[@kIOHIDElementMinKey].intValue; + info.max = hat[@kIOHIDElementMaxKey].intValue; + info.midpoint = 0; + + if (defaultHatValues.find(defaultsKey) != defaultHatValues.end()) + { + for (auto value : defaultHatValues[defaultsKey]) + { + struct JoypadInput input; + input.cookie = cookie; + input.value = value.first; + SetDefaultButtonCodeForJoypadControl(input, value.second); + } + } + + info.index = 0; + infoByCookie[cookie] = info; + } + + CFRelease(properties); +} + +void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->first.cookie.device == device) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } +} + +std::unordered_map GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + std::unordered_map joypadButtons; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end(); ++it) + { + if ( it->first.cookie.device == device) + { + joypadButtons[it->first] = it->second; + } + } + + return joypadButtons; +} + +void SetUpHID (void) +{ + hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); + + if (hidManager != NULL && IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone) == kIOReturnSuccess) + { + IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL); + IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode); + IOHIDManagerSetDeviceMatching(hidManager, NULL); + + ParseDefaults(); + + NSSet* devices = (NSSet *)CFBridgingRelease(IOHIDManagerCopyDevices(hidManager)); + NSMutableArray *orderedDevices = [devices.allObjects mutableCopy]; + + [orderedDevices removeObjectsAtIndexes:[orderedDevices indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) + { + IOHIDDeviceRef device = (__bridge IOHIDDeviceRef)obj; + + NSNumber *usagePage = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDPrimaryUsagePageKey)); + NSNumber *usage = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDPrimaryUsageKey)); + + return usagePage.intValue != kHIDPage_GenericDesktop || (usage.intValue != kHIDUsage_GD_GamePad && usage.intValue != kHIDUsage_GD_Joystick && usage.intValue != kHIDUsage_GD_Mouse); + }]]; + + [orderedDevices sortUsingComparator:^NSComparisonResult(id a, id b) + { + NSNumber *vendorA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDVendorIDKey)); + + NSNumber *vendorB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDVendorIDKey)); + + NSComparisonResult result = [vendorA compare:vendorB]; + + if (result == NSOrderedSame) + { + NSNumber *productA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDProductIDKey)); + + NSNumber *productB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDProductIDKey)); + + result = [productA compare:productB]; + } + + if (result == NSOrderedSame) + { + NSNumber *portA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDLocationIDKey)); + + NSNumber *portB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDLocationIDKey)); + + result = [portA compare:portB]; + } + + return result; + }]; + + for (id device in orderedDevices) + { + AddDevice((__bridge IOHIDDeviceRef)device); + } + } + else + { + printf("Unable to open IOHIDManager\n"); + hidManager = NULL; + } +} + +void ReleaseHID (void) +{ + if ( hidManager != NULL) + { + IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone); + } +} + +void SetPlayerForJoypad(int8 playerNum, uint32 vendorID, uint32 productID, uint32 index, int8 *oldPlayerNum) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + if ( oldPlayerNum != NULL ) + { + *oldPlayerNum = -1; + + if (playerNumByDevice.find(device) != playerNumByDevice.end()) + { + *oldPlayerNum = playerNumByDevice[device]; + } + } + + playerNumByDevice[device] = playerNum; +} + +bool SetButtonCodeForJoypadControl(uint32 vendorID, uint32 productID, uint32 index, uint32 cookie, int32 value, S9xButtonCode buttonCode, bool overwrite, S9xButtonCode *oldButtonCode) +{ + if (buttonCode < 0 || buttonCode >= kNumButtons) + { + return false; + } + + if (oldButtonCode != NULL) + { + *oldButtonCode = (S9xButtonCode)-1; + } + + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + struct JoypadCookie cookieStruct; + cookieStruct.device = device; + cookieStruct.cookie = cookie; + + if ( infoByCookie.find(cookieStruct) != infoByCookie.end()) + { + auto info = infoByCookie[cookieStruct]; + + if (info.usage != kHIDUsage_GD_Hatswitch && info.min != info.max) + { + if (value <= info.min) + { + value = info.min; + } + else if (value >= info.max) + { + value = info.max; + } + else + { + value = info.midpoint; + } + } + } + + struct JoypadInput input; + input.cookie = cookieStruct; + input.value = value; + + if (buttonCodeByJoypadInput.find(input) == buttonCodeByJoypadInput.end()) + { + overwrite = true; + } + else if (overwrite && oldButtonCode != NULL) + { + *oldButtonCode = buttonCodeByJoypadInput[input]; + } + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->second == buttonCode && it->first.cookie.device == device) + { + if (overwrite) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } + else + { + ++it; + } + } + + if (overwrite) + { + buttonCodeByJoypadInput[input] = buttonCode; + } + + return true; +} + +void ClearButtonCodeForJoypad(uint32 vendorID, uint32 productID, uint32 index, S9xButtonCode buttonCode) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->first.cookie.device == device && it->second == buttonCode) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } +} + +std::string LabelForInput(uint32 vendorID, uint32 productID, uint32 cookie, int32 value) +{ + struct JoypadDevice deviceStruct; + deviceStruct.productID = productID; + deviceStruct.vendorID = vendorID; + deviceStruct.index = 0; + + struct JoypadCookie cookieStruct; + cookieStruct.device = deviceStruct; + cookieStruct.cookie = cookie; + + auto it = infoByCookie.find(cookieStruct); + if (it != infoByCookie.end()) + { + auto info = it->second; + switch(info.usage) + { + case kHIDUsage_GD_X: + { + if (value <= info.min) + { + return "X-"; + } + else if (value >= info.max) + { + return "X+"; + } + } + + case kHIDUsage_GD_Y: + { + if (value <= info.min) + { + return "Y-"; + } + else if (value >= info.max) + { + return "Y+"; + } + } + + case kHIDUsage_GD_Z: + { + if (value <= info.min) + { + return "Z-"; + } + else if (value >= info.max) + { + return "Z+"; + } + } + + case kHIDUsage_GD_Rx: + { + if (value <= info.min) + { + return "Right X-"; + } + else if (value >= info.max) + { + return "Right X+"; + } + } + + case kHIDUsage_GD_Ry: + { + if (value <= info.min) + { + return "Right Y-"; + } + else if (value >= info.max) + { + return "Right Y+"; + } + } + + case kHIDUsage_GD_Rz: + { + if (value <= info.min) + { + return "Right Z-"; + } + else if (value >= info.max) + { + return "Right Z+"; + } + } + + case kHIDUsage_GD_Hatswitch: + { + auto defaultIT = defaultHatValues.find(deviceStruct); + if (defaultIT != defaultHatValues.end()) + { + auto hatDict = defaultIT->second; + auto hatIT = hatDict.find(value); + if ( hatIT != hatDict.end()) + { + switch (hatIT->second) + { + case kUp: + return "D-Pad Up"; + + case kDown: + return "D-Pad Down"; + + case kLeft: + return "D-Pad Left"; + + case kRight: + return "D-Pad Right"; + + default: + break; + } + } + } + + if (value == 0) + { + return "D-Pad Up"; + } + else if (value == 2) + { + return "D-Pad Right"; + } + else if (value == 4) + { + return "D-Pad Down"; + } + else if (value == 6) + { + return "D-Pad Left"; + } + } + + default: + { + return std::string("Button " + std::to_string(info.index)); + } + } + } + + return std::to_string(cookie); +} diff --git a/macosx/mac-keyboard.cpp b/macosx/mac-keyboard.cpp deleted file mode 100755 index 8e77767b..00000000 --- a/macosx/mac-keyboard.cpp +++ /dev/null @@ -1,1034 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-gworld.h" -#include "mac-os.h" -#include "mac-keyboard.h" - -#define kmUpArrowKey 0x7E -#define kmDownArrowKey 0x7D -#define kmRightArrowKey 0x7C -#define kmLeftArrowKey 0x7B -#define kmReturnKey 0x24 -#define kmTabKey 0x30 -#define kmShiftKey 0x38 -#define kmControlKey 0x3B -#define kmOptionKey 0x3A -#define kmCommandKey 0x37 -#define kmXKey 0x07 -#define kmZKey 0x06 -#define kmKP2Key 0x54 -#define kmKP4Key 0x56 -#define kmKP5Key 0x57 -#define kmKP6Key 0x58 -#define kmKP8Key 0x5B -#define kmKPEnterKey 0x4C -#define kmKPPlusKey 0x45 -#define kmKP0Key 0x52 -#define kmKPPeriodKey 0x41 -#define kmHomeKey 0x73 -#define kmPageUpKey 0x74 -#define kmEndKey 0x77 -#define kmPageDownKey 0x79 -#define kmBackslashKey 0x2A -#define km1Key 0x12 -#define km0Key 0x1D -#define kmIKey 0x22 -#define kmJKey 0x26 -#define kmKKey 0x28 -#define kmLKey 0x25 -#define kmTildeKey 0x32 -#define kmRKey 0x0F -#define kmBKey 0x0B -#define kmNKey 0x2D -#define kmMKey 0x2E -#define kmSpaceKey 0x31 -#define kmSlashKey 0x2C -#define kmPeriodKey 0x2F -#define kmQKey 0x0C -#define kmWKey 0x0D -#define kmEscKey 0x35 -#define kmCommaKey 0x2B - -#define kIconSize 16 -#define kKeySize 24 -#define KS kKeySize - -uint8 keyCode[kKeys] = -{ - kmUpArrowKey, - kmDownArrowKey, - kmLeftArrowKey, - kmRightArrowKey, - kmShiftKey, - kmOptionKey, - kmControlKey, - kmCommandKey, - kmZKey, - kmXKey, - kmReturnKey, - kmTabKey, - - kmKP8Key, - kmKP2Key, - kmKP4Key, - kmKP6Key, - kmPageDownKey, - kmPageUpKey, - kmEndKey, - kmHomeKey, - kmKP0Key, - kmKPPeriodKey, - kmKPEnterKey, - kmKPPlusKey, - - kmBackslashKey, - km1Key, - km0Key, - kmTildeKey, - kmRKey, - kmBKey, - kmNKey, - kmMKey, - kmSpaceKey, - kmSlashKey, - kmPeriodKey, - kmQKey, - kmWKey, - kmEscKey, - kmCommaKey -}; - -typedef struct -{ - int keyWidth, keyHeight; - uint8 scancode; - const char *keyLabel; -} KeyboardLayout; - -typedef struct -{ - HIViewRef view; -} CustomViewData; - -static CGImageRef iconTableImage; -static CGImageRef keyLayoutImage; -static CGImageRef iconPlaceImage; -static Ptr iconTableCGWld; -static Ptr keyLayoutWorld; -static Ptr iconPlaceWorld; - -static CGRect keyRect[0x80][2]; -static uint8 defaultKeys[kKeys]; - -static HIObjectClassRef theClass; -static HIViewRef customView; -static HIPoint mousePos; -static float ofsx, ofsy; -static int dragKey; -static CGPoint dragKeyOfs; -static CGRect dragKeyRect; -static volatile Boolean keyInDrag; - -static const int kKeyLayoutWidth = kKeySize * 23 + 1, - kKeyLayoutHeight = kKeySize * 7 + 1; - -static KeyboardLayout keys[] = -{ - { KS, KS, 0x35, "esc" }, - { KS, KS, 0x00, NULL }, - { KS, KS, 0x7a, "F1" }, - { KS, KS, 0x78, "F2" }, - { KS, KS, 0x63, "F3" }, - { KS, KS, 0x76, "F4" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x60, "F5" }, - { KS, KS, 0x61, "F6" }, - { KS, KS, 0x62, "F7" }, - { KS, KS, 0x64, "F8" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x65, "F9" }, - { KS, KS, 0x6d, "F10" }, - { KS, KS, 0x67, "F11" }, - { KS, KS, 0x6f, "F12" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x69, "F13" }, - { KS, KS, 0x6b, "F14" }, - { KS, KS, 0x71, "F15" }, - { 0, 0, 0x00, NULL }, - - { 0, 0, 0x00, NULL }, - - { KS, KS, 0x32, "`" }, - { KS, KS, 0x12, "1" }, - { KS, KS, 0x13, "2" }, - { KS, KS, 0x14, "3" }, - { KS, KS, 0x15, "4" }, - { KS, KS, 0x17, "5" }, - { KS, KS, 0x16, "6" }, - { KS, KS, 0x1a, "7" }, - { KS, KS, 0x1c, "8" }, - { KS, KS, 0x19, "9" }, - { KS, KS, 0x1d, "0" }, - { KS, KS, 0x1b, "-" }, - { KS, KS, 0x18, "=" }, - { KS * 2, KS, 0x33, "delete" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x72, "ins" }, - { KS, KS, 0x73, "hom" }, - { KS, KS, 0x74, "pgu" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x47, "clr" }, - { KS, KS, 0x51, "=" }, - { KS, KS, 0x4b, "/" }, - { KS, KS, 0x43, "*" }, - { 0, 0, 0x00, NULL }, - - { KS * 3 / 2, KS, 0x30, "tab" }, - { KS, KS, 0x0c, "Q" }, - { KS, KS, 0x0d, "W" }, - { KS, KS, 0x0e, "E" }, - { KS, KS, 0x0f, "R" }, - { KS, KS, 0x11, "T" }, - { KS, KS, 0x10, "Y" }, - { KS, KS, 0x20, "U" }, - { KS, KS, 0x22, "I" }, - { KS, KS, 0x1f, "O" }, - { KS, KS, 0x23, "P" }, - { KS, KS, 0x21, "[" }, - { KS, KS, 0x1e, "]" }, - { KS * 3 / 2, KS, 0x2a, "\\" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x75, "del" }, - { KS, KS, 0x77, "end" }, - { KS, KS, 0x79, "pgd" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x59, "7" }, - { KS, KS, 0x5b, "8" }, - { KS, KS, 0x5c, "9" }, - { KS, KS, 0x4e, "-" }, - { 0, 0, 0x00, NULL }, - - { KS * 2, KS, 0x39, "caps" }, - { KS, KS, 0x00, "A" }, - { KS, KS, 0x01, "S" }, - { KS, KS, 0x02, "D" }, - { KS, KS, 0x03, "F" }, - { KS, KS, 0x05, "G" }, - { KS, KS, 0x04, "H" }, - { KS, KS, 0x26, "J" }, - { KS, KS, 0x28, "K" }, - { KS, KS, 0x25, "L" }, - { KS, KS, 0x29, ";" }, - { KS, KS, 0x27, "\xd3" }, - { KS * 2, KS, 0x24, "return" }, - { KS * 4, KS, 0x00, NULL }, - { KS, KS, 0x56, "4" }, - { KS, KS, 0x57, "5" }, - { KS, KS, 0x58, "6" }, - { KS, KS, 0x45, "+" }, - { 0, 0, 0x00, NULL }, - - { KS * 5 / 2, KS, 0x38, "shift" }, - { KS, KS, 0x06, "Z" }, - { KS, KS, 0x07, "X" }, - { KS, KS, 0x08, "C" }, - { KS, KS, 0x09, "V" }, - { KS, KS, 0x0b, "B" }, - { KS, KS, 0x2d, "N" }, - { KS, KS, 0x2e, "M" }, - { KS, KS, 0x2b, "," }, - { KS, KS, 0x2f, "." }, - { KS, KS, 0x2c, "/" }, - { KS * 5 / 2, KS, 0x38, "shift" }, - { KS * 3 / 2, KS, 0x00, NULL }, - { KS, KS, 0x7e, "up" }, - { KS * 3 / 2, KS, 0x00, NULL }, - { KS, KS, 0x53, "1" }, - { KS, KS, 0x54, "2" }, - { KS, KS, 0x55, "3" }, - { KS, KS * 2, 0x4c, "ent" }, - { 0, 0, 0x00, NULL }, - - { KS * 3 / 2, KS, 0x3b, "ctrl" }, - { KS * 3 / 2, KS, 0x3a, "opt" }, - { KS * 3 / 2, KS, 0x37, "cmd" }, - { KS * 6, KS, 0x31, " " }, - { KS * 3 / 2, KS, 0x37, "cmd" }, - { KS * 3 / 2, KS, 0x3a, "opt" }, - { KS * 3 / 2, KS, 0x3b, "ctrl" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x7b, "lt" }, - { KS, KS, 0x7d, "dn" }, - { KS, KS, 0x7c, "rt" }, - { KS / 2, KS, 0x00, NULL }, - { KS * 2, KS, 0x52, "0" }, - { KS, KS, 0x41, "." }, - { 0, 0, 0x00, NULL } -}; - -static void CreateIconTableImage (void); -static void ReleaseIconTableImage (void); -static void CreateKeyLayoutImage (void); -static void ReleaseKeyLayoutImage (void); -static void CreateIconPlaceImage (void); -static void UpdateIconPlaceImage (void); -static void ReleaseIconPlaceImage (void); -static void DrawPlacedIcon (CGContextRef, int); -static void DrawDraggedIcon (CGContextRef, int, CGPoint *); -static Boolean KeyCodeInUse (int); -static int FindHitKey (HIPoint, CGRect *, CGPoint *); -static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef, EventRef, void *); - -#define kCustomLayoutViewClassID CFSTR("com.snes9x.macos.snes9x.keylayout") - - -void ConfigureKeyboard (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("Keyboard"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef wref, iref1, iref2; - EventHandlerUPP wUPP, iUPP; - EventTypeSpec wEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlTrack } }, - iEvents[] = { { kEventClassControl, kEventControlDraw } }; - HIObjectRef hiObject; - HIViewRef contentView, image1, image2; - HIViewID cid; - HIRect frame; - Rect winBounds; - - UpdateIconPlaceImage(); - - keyInDrag = false; - dragKey = -1; - dragKeyOfs = CGPointMake(0.0f, 0.0f); - dragKeyRect = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - mousePos = CGPointMake(0.0f, 0.0f); - - err = noErr; - if (theClass == NULL) - err = HIObjectRegisterSubclass(kCustomLayoutViewClassID, kHIViewClassID, 0, KeyLayoutEventHandler, GetEventTypeCount(cEvents), cEvents, NULL, &theClass); - - if (err == noErr) - { - err = HIObjectCreate(kCustomLayoutViewClassID, NULL, &hiObject); - if (err == noErr) - { - GetWindowBounds(tWindowRef, kWindowContentRgn, &winBounds); - - frame.origin.x = 2.0f; - frame.origin.y = 2.0f; - frame.size.width = (float) (winBounds.right - winBounds.left) - 4.0f; - frame.size.height = (float) kKeyLayoutHeight + 36.0f; - - ofsx = (float) (((int) frame.size.width - kKeyLayoutWidth ) >> 1) + 1.0f; - ofsy = (float) (((int) frame.size.height - kKeyLayoutHeight) >> 1) + 1.0f; - - customView = (HIViewRef) hiObject; - - HIViewFindByID(HIViewGetRoot(tWindowRef), kHIViewWindowContentID, &contentView); - HIViewAddSubview(contentView, customView); - HIViewSetFrame(customView, &frame); - HIViewSetVisible(customView, true); - - cid.signature = 'Lgnd'; - cid.id = 0; - HIViewFindByID(contentView, cid, &image1); - cid.id = 1; - HIViewFindByID(contentView, cid, &image2); - iUPP = NewEventHandlerUPP(KeyLegendEventHandler); - err = InstallControlEventHandler(image1, iUPP, GetEventTypeCount(iEvents), iEvents, (void *) image1, &iref1); - err = InstallControlEventHandler(image2, iUPP, GetEventTypeCount(iEvents), iEvents, (void *) image2, &iref2); - - wUPP = NewEventHandlerUPP(KeyWindowEventHandler); - err = InstallWindowEventHandler(tWindowRef, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) tWindowRef, &wref); - - MoveWindowPosition(tWindowRef, kWindowKeyConfig, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowKeyConfig); - - err = RemoveEventHandler(iref2); - err = RemoveEventHandler(iref1); - DisposeEventHandlerUPP(iUPP); - - err = RemoveEventHandler(wref); - DisposeEventHandlerUPP(wUPP); - } - } - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - } -} - -static void CreateIconTableImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGRect rct; - - rct = CGRectMake(0.0f, 0.0f, (float) kIconSize, (float) kIconSize); - - iconTableCGWld = (Ptr) malloc(kIconSize * kKeys * (kIconSize + 1) * 4); - if (!iconTableCGWld) - QuitWithFatalError(0, "keyboard 08"); - - ctx = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(iconTableCGWld, kIconSize * kKeys, kIconSize, 8, kIconSize * kKeys * 4, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - CGColorSpaceRelease(color); - } - - if (!ctx) - QuitWithFatalError(0, "keyboard 09"); - - CGContextTranslateCTM(ctx, 0.0f, (float) kIconSize); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - - // SNES pads - for (int i = macPadIconIndex; i < macPadIconIndex + 12 * 2; i++) - { - if (systemVersion >= 0x1040) - CGContextDrawImage(ctx, rct, macIconImage[i]); - #ifdef MAC_PANTHER_SUPPORT - else - PlotIconRefInContext(ctx, &rct, kAlignNone, kTransformNone, NULL, kPlotIconRefNormalFlags, macIconRef[i]); - #endif - rct = CGRectOffset(rct, kIconSize, 0); - } - - // Function buttons - for (int i = macFunctionIconIndex; i < macFunctionIconIndex + 17; i++) - { - if (systemVersion >= 0x1040) - CGContextDrawImage(ctx, rct, macIconImage[i]); - #ifdef MAC_PANTHER_SUPPORT - else - PlotIconRefInContext(ctx, &rct, kAlignNone, kTransformNone, NULL, kPlotIconRefNormalFlags, macIconRef[i]); - #endif - rct = CGRectOffset(rct, kIconSize, 0); - } - - CGContextRelease(ctx); - - iconTableImage = NULL; - - prov = CGDataProviderCreateWithData(NULL, iconTableCGWld, kIconSize * kKeys * kIconSize * 4, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - iconTableImage = CGImageCreate(kIconSize * kKeys, kIconSize, 8, 32, kIconSize * kKeys * 4, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - if (!iconTableImage) - QuitWithFatalError(0, "keyboard 10"); -} - -static void ReleaseIconTableImage (void) -{ - CGImageRelease(iconTableImage); - free(iconTableCGWld); -} - -static void CreateKeyLayoutImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGAffineTransform flipMatrix; - CGRect rct, r; - int index, scancode; - - rct = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - for (int i = 0; i < 0x80; i++) - keyRect[i][0] = keyRect[i][1] = rct; - - keyLayoutWorld = (Ptr) malloc(kKeyLayoutWidth * (kKeyLayoutHeight + 1) * 4); - if (!keyLayoutWorld) - QuitWithFatalError(0, "keyboard 02"); - - ctx = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(keyLayoutWorld, kKeyLayoutWidth, kKeyLayoutHeight, 8, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - CGColorSpaceRelease(color); - } - - if (!ctx) - QuitWithFatalError(0, "keyboard 04"); - - CGContextSetLineJoin(ctx, kCGLineJoinMiter); - - flipMatrix = CGAffineTransformMake(1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f); - CGContextSelectFont(ctx, "Helvetica", 10.0f, kCGEncodingMacRoman); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetTextMatrix(ctx, flipMatrix); - - rct = CGRectMake(0.0f, 0.0f, (float) kKeyLayoutWidth, (float) kKeyLayoutHeight); - CGContextClearRect(ctx, rct); - - index = 0; - rct = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - - for (int i = 0; i < 7; i++) - { - while (keys[index].keyWidth) - { - rct.size.width = (float) keys[index].keyWidth; - - if (keys[index].keyLabel) - { - rct.size.height = (float) keys[index].keyHeight; - scancode = keys[index].scancode; - - if (keyRect[scancode][0].size.height < 1.0) - keyRect[scancode][0] = rct; - else - keyRect[scancode][1] = rct; - - r = rct; - - r.origin.x += 1.0f; - r.origin.y += 1.0f; - r.size.width -= 1.0f; - r.size.height -= 1.0f; - - CGContextSetRGBStrokeColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f); - CGContextStrokeRect(ctx, r); - - float h, p; - - CGRectInset(r, 2.0f, 2.0f); - h = r.size.height; - for (float f = h; f >= 1.0f; f -= 1.0f) - { - p = (155.0f + (h - f)) / 180.0f; - CGContextSetRGBFillColor(ctx, p, p, p, 1.0f); - CGContextFillRect(ctx, r); - r.size.height -= 1.0f; - } - - CGContextSetRGBFillColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f); - CGContextShowTextAtPoint(ctx, rct.origin.x + 3.0f, rct.origin.y + rct.size.height - 3.0f, keys[index].keyLabel, strlen(keys[index].keyLabel)); - } - - rct.origin.x += rct.size.width; - index++; - } - - rct.origin.y += kKeySize; - rct.origin.x = rct.size.width = 0; - index++; - } - - CGContextRelease(ctx); - - keyLayoutImage = NULL; - - prov = CGDataProviderCreateWithData(NULL, keyLayoutWorld, kKeyLayoutWidth * kKeyLayoutHeight * 4, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - keyLayoutImage = CGImageCreate(kKeyLayoutWidth, kKeyLayoutHeight, 8, 32, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - if (!keyLayoutImage) - QuitWithFatalError(0, "keyboard 05"); -} - -static void ReleaseKeyLayoutImage (void) -{ - CGImageRelease(keyLayoutImage); - free(keyLayoutWorld); -} - -static void CreateIconPlaceImage (void) -{ - iconPlaceWorld = (Ptr) malloc(kKeyLayoutWidth * (kKeyLayoutHeight + 1) * 4); - if (!iconPlaceWorld) - QuitWithFatalError(0, "keyboard 06"); - - iconPlaceImage = NULL; - - UpdateIconPlaceImage(); -} - -static void UpdateIconPlaceImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGRect rct; - - if (iconPlaceImage) - CGImageRelease(iconPlaceImage); - - iconPlaceImage = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(iconPlaceWorld, kKeyLayoutWidth, kKeyLayoutHeight, 8, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - if (ctx) - { - rct = CGRectMake(0.0f, 0.0f, (float) kKeyLayoutWidth, (float) kKeyLayoutHeight); - CGContextDrawImage(ctx, rct, keyLayoutImage); - - for (int i = 0; i < kKeys; i++) - DrawPlacedIcon(ctx, i); - - CGContextRelease(ctx); - } - - prov = CGDataProviderCreateWithData(NULL, iconPlaceWorld, kKeyLayoutWidth * kKeyLayoutHeight * 4, NULL); - if (prov) - { - iconPlaceImage = CGImageCreate(kKeyLayoutWidth, kKeyLayoutHeight, 8, 32, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } - - CGColorSpaceRelease(color); - } - - if (!iconPlaceImage) - QuitWithFatalError(0, "keyboard 07"); -} - -static void ReleaseIconPlaceImage (void) -{ - CGImageRelease(iconPlaceImage); - free(iconPlaceWorld); -} - -void InitKeyboard (void) -{ - theClass = NULL; - - memcpy(defaultKeys, keyCode, sizeof(keyCode)); - - CreateIconTableImage(); - CreateKeyLayoutImage(); - CreateIconPlaceImage(); -} - -void DeinitKeyboard (void) -{ - ReleaseIconPlaceImage(); - ReleaseKeyLayoutImage(); - ReleaseIconTableImage(); -} - -static void DrawPlacedIcon (CGContextRef ctx, int which) -{ - CGRect keyBounds, srcRect, dstRect; - - CGContextSaveGState(ctx); - - CGContextSetRGBFillColor(ctx, 0.40f, 0.40f, 0.65f, 0.5f); - - for (int each = 0; each <= 1; each++) - { - keyBounds = keyRect[keyCode[which]][each]; - - if (keyBounds.size.height > 1.0f) - { - keyBounds.origin.x += 1.0f; - keyBounds.origin.y += 1.0f; - keyBounds.size.width -= 1.0f; - keyBounds.size.height -= 1.0f; - - CGContextFillRect(ctx, keyBounds); - - keyBounds.origin.x -= 1.0f; - keyBounds.origin.y -= 1.0f; - keyBounds.size.width += 1.0f; - keyBounds.size.height += 1.0f; - - srcRect.origin.x = (float) (which * kIconSize); - srcRect.origin.y = 0.0f; - srcRect.size.width = (float) kIconSize; - srcRect.size.height = (float) kIconSize; - - dstRect.origin.x = keyBounds.origin.x + (keyBounds.size.width - kIconSize) / 2.0f; - dstRect.origin.y = keyBounds.origin.y + (keyBounds.size.height - kIconSize) / 2.0f; - dstRect.size.width = (float) kIconSize; - dstRect.size.height = (float) kIconSize; - - DrawSubCGImage(ctx, iconTableImage, srcRect, dstRect); - } - } - - CGContextRestoreGState(ctx); -} - -static void DrawDraggedIcon (CGContextRef ctx, int which, CGPoint *offset) -{ - CGRect srcRect, dstRect; - - CGContextSaveGState(ctx); - - srcRect.origin.x = (float) (which * kIconSize); - srcRect.origin.y = 0.0f; - srcRect.size.width = (float) kIconSize; - srcRect.size.height = (float) kIconSize; - - dstRect.origin.x = mousePos.x + offset->x; - dstRect.origin.y = mousePos.y + offset->y; - dstRect.size.width = (float) kIconSize; - dstRect.size.height = (float) kIconSize; - - CGContextSetAlpha(ctx, 0.5f); - DrawSubCGImage(ctx, iconTableImage, srcRect, dstRect); - - CGContextRestoreGState(ctx); -} - -static Boolean KeyCodeInUse (int code) -{ - for (int i = 0; i < kKeys; i++) - if (keyCode[i] == code) - return (true); - - return (false); -} - -static int FindHitKey (HIPoint where, CGRect *keybounds, CGPoint *offset) -{ - int hit; - - hit = -1; - *offset = CGPointMake(0.0f, 0.0f); - *keybounds = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - - for (int which = 0; which < kKeys; which++) - { - for (int each = 0; each <= 1; each++) - { - if (CGRectContainsPoint(keyRect[keyCode[which]][each], where)) - { - hit = which; - - *keybounds = keyRect[keyCode[which]][each]; - offset->x = keybounds->origin.x + (keybounds->size.width - kIconSize) / 2.0f - where.x + 18.0f; - offset->y = keybounds->origin.y + (keybounds->size.height - kIconSize) / 2.0f - where.y + 18.0f; - } - } - } - - return (hit); -} - -static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - if (tHICommand.commandID == 'DFLT') - { - memcpy(keyCode, defaultKeys, sizeof(keyCode)); - UpdateIconPlaceImage(); - HIViewSetNeedsDisplay(customView, true); - result = noErr; - } - } - } - } - - return (result); -} - -static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view = (HIViewRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIViewID cid; - HIRect bounds; - - GetControlID(view, &cid); - HIViewGetBounds(view, &bounds); - CGContextTranslateCTM(ctx, 0, bounds.size.height); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - CGContextDrawImage(ctx, CGRectMake(0, 0, kIconSize, kIconSize), macIconImage[macLegendIconIndex + cid.id]); - - result = noErr; - } - } - } - - return (result); -} - -static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - CustomViewData *data = (CustomViewData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassHIObject: - switch (GetEventKind(inEvent)) - { - case kEventHIObjectConstruct: - data = (CustomViewData *) calloc(1, sizeof(CustomViewData)); - if (data) - { - HIViewRef epView; - - err = GetEventParameter(inEvent, kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof(epView), NULL, &epView); - if (err == noErr) - { - data->view = epView; - result = SetEventParameter(inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof(data), &data); - } - } - - break; - - case kEventHIObjectDestruct: - if (data) - free(data); - - result = noErr; - break; - - case kEventHIObjectInitialize: - result = CallNextEventHandler(inHandlerRef, inEvent); - } - - break; - - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(ctx), NULL, &ctx); - if (err == noErr) - { - HIRect bounds, srcRect, dstRect; - - HIViewGetBounds(customView, &bounds); - srcRect = CGRectMake(0, 0, kKeyLayoutWidth, kKeyLayoutHeight); - - dstRect.origin.x = (float) (((int) bounds.size.width - kKeyLayoutWidth ) >> 1); - dstRect.origin.y = (float) (((int) bounds.size.height - kKeyLayoutHeight) >> 1); - dstRect.size.width = (float) kKeyLayoutWidth; - dstRect.size.height = (float) kKeyLayoutHeight; - - DrawSubCGImage(ctx, iconPlaceImage, srcRect, dstRect); - if (keyInDrag && (dragKey != -1)) - DrawDraggedIcon(ctx, dragKey, &dragKeyOfs); - } - - result = noErr; - break; - - case kEventControlHitTest: - ControlPartCode part; - - part = kControlButtonPart; - result = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - break; - - case kEventControlTrack: - MouseTrackingResult trackResult; - WindowRef window; - HIViewRef contentView; - HIPoint hipt; - - dragKey = -1; - dragKeyOfs = CGPointMake(0.0f, 0.0f); - dragKeyRect = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - mousePos = CGPointMake(0.0f, 0.0f); - trackResult = kMouseTrackingMouseDown; - - window = GetControlOwner(customView); - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &contentView); - - #ifdef MAC_TIGER_PANTHER_SUPPORT - CGrafPtr oldPort; - Point qdpt; - Boolean portChanged = false; - - if (systemVersion < 0x1050) - portChanged = QDSwapPort(GetWindowPort(window), &oldPort); - #endif - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); - if (err == noErr) - { - hipt.x -= ofsx; - hipt.y -= ofsy; - - dragKey = FindHitKey(hipt, &dragKeyRect, &dragKeyOfs); - if (dragKey != -1) - { - keyInDrag = true; - - while (trackResult != kMouseTrackingMouseUp) - { - if (CGPointEqualToPoint(mousePos, hipt) == 0) - { - mousePos = hipt; - HIViewSetNeedsDisplay(customView, true); - } - - if (systemVersion >= 0x1050) - { - err = HIViewTrackMouseLocation(customView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - hipt.x -= ofsx; - hipt.y -= ofsy; - } - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - TrackMouseLocation(NULL, &qdpt, &trackResult); - hipt.x = qdpt.h - ofsx; - hipt.y = qdpt.v - ofsy; - HIViewConvertPoint(&hipt, contentView, customView); - } - #endif - } - - keyInDrag = false; - - for (int code = 0; code < 0x80; code++) - { - for (int each = 0; each <= 1; each++) - { - if (CGRectContainsPoint(keyRect[code][each], mousePos)) - { - if (!KeyCodeInUse(code)) - { - keyCode[dragKey] = code; - UpdateIconPlaceImage(); - } - } - } - } - - HIViewSetNeedsDisplay(customView, true); - } - } - - #ifdef MAC_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1050) - { - if (portChanged) - QDSwapPort(oldPort, NULL); - } - #endif - - result = noErr; - } - } - - return (result); -} diff --git a/macosx/mac-keyboard.h b/macosx/mac-keyboard.h index 53f3ca96..23f16c4b 100755 --- a/macosx/mac-keyboard.h +++ b/macosx/mac-keyboard.h @@ -15,63 +15,28 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_keyboard_h_ #define _mac_keyboard_h_ -#define kKeys 39 +#include "mac-controls.h" -extern uint8 keyCode[kKeys]; +#define MAC_NUM_KEYCODES 255 -enum -{ - k1PUp, - k1PDown, - k1PLeft, - k1PRight, - k1PY, - k1PB, - k1PX, - k1PA, - k1PL, - k1PR, - k1PStart, - k1PSelect, - - k2PUp, - k2PDown, - k2PLeft, - k2PRight, - k2PY, - k2PB, - k2PX, - k2PA, - k2PL, - k2PR, - k2PStart, - k2PSelect, - - kKeyFastForward, - kKeyFreeze, - kKeyDefrost, - kKeyScreenshot, - kKeySPC, - kKeyScopeTurbo, - kKeyScopePause, - kKeyScopeCursor, - kKeyOffScreen, - kKeyFunction, - kKeyAlt, - kKeyFFDown, - kKeyFFUp, - kKeyEsc, - kKeyTC +struct S9xButton { + int16 buttonCode; + int8 player; }; +extern struct S9xButton keyCodes[MAC_NUM_KEYCODES]; + void InitKeyboard (void); void DeinitKeyboard (void); -void ConfigureKeyboard (void); + +bool SetKeyCode(int16 keyCode, S9xButtonCode button, int8 player, int16 *oldKeyCode, S9xButtonCode *oldButton, int8 *oldPlayer); +void ClearKeyCode(S9xButtonCode buttonCode, int8 player); #endif diff --git a/macosx/mac-keyboard.mm b/macosx/mac-keyboard.mm new file mode 100755 index 00000000..e6073864 --- /dev/null +++ b/macosx/mac-keyboard.mm @@ -0,0 +1,100 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include + +#include "port.h" + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-gworld.h" +#include "mac-os.h" +#include "mac-keyboard.h" + +struct S9xButton keyCodes[MAC_NUM_KEYCODES]; + +void InitKeyboard (void) +{ + for (int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + keyCodes[i] = { -1, -1 }; + } +} + +void DeinitKeyboard (void) +{ + for (int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + keyCodes[i] = { -1, -1 }; + } +} + +bool SetKeyCode(int16 keyCode, S9xButtonCode buttonCode, int8 player, int16 *oldKeyCode, S9xButtonCode *oldButtonCode, int8 *oldPlayer) +{ + if (player < 0 || player >= MAC_MAX_PLAYERS || buttonCode < 0 || buttonCode >= kNumButtons) + { + return false; + } + + for ( int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + struct S9xButton button = keyCodes[i]; + if (button.player == player && button.buttonCode == buttonCode && i != keyCode) + { + keyCodes[i] = { -1, -1 }; + + if (oldKeyCode !=NULL) + { + *oldKeyCode = i; + } + } + } + + if (oldButtonCode != NULL) + { + *oldButtonCode = (S9xButtonCode)keyCodes[keyCode].buttonCode; + } + + if (oldPlayer != NULL ) + { + *oldPlayer = (S9xButtonCode)keyCodes[keyCode].player; + } + + keyCodes[keyCode] = { static_cast(buttonCode), player }; + + return true; +} + +void ClearKeyCode(S9xButtonCode buttonCode, int8 player) +{ + if (player < 0 || player >= MAC_MAX_PLAYERS || buttonCode < 0 || buttonCode >= kNumButtons) + { + return; + } + + for ( int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + struct S9xButton button = keyCodes[i]; + if (button.player == player && button.buttonCode == buttonCode) + { + keyCodes[i] = { -1, -1 }; + } + } +} diff --git a/macosx/mac-multicart.cpp b/macosx/mac-multicart.cpp deleted file mode 100644 index 0f075145..00000000 --- a/macosx/mac-multicart.cpp +++ /dev/null @@ -1,534 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-cart.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-multicart.h" - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -#define truncEnd 0 -#endif - -static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *); - -static int multiCartDragHilite; -static Boolean multiCartDialogResult; - -void InitMultiCart (void) -{ - CFStringRef keyRef, pathRef; - char key[32]; - - multiCartPath[0] = multiCartPath[1] = NULL; - - for (int i = 0; i < 2; i++) - { - sprintf(key, "MultiCartPath_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); - if (pathRef) - multiCartPath[i] = pathRef; - - CFRelease(keyRef); - } - } -} - -void DeinitMultiCart (void) -{ - CFStringRef keyRef; - char key[32]; - - for (int i = 0; i < 2; i++) - { - sprintf(key, "MultiCartPath_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - if (multiCartPath[i]) - { - CFPreferencesSetAppValue(keyRef, multiCartPath[i], kCFPreferencesCurrentApplication); - CFRelease(multiCartPath[i]); - } - else - CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -Boolean MultiCartDialog (void) -{ - OSStatus err; - IBNibRef nibRef; - - multiCartDragHilite = -1; - multiCartDialogResult = false; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef window; - - err = CreateWindowFromNib(nibRef, CFSTR("MultiCart"), &window); - if (err == noErr) - { - static int index[2] = { 0, 1 }; - - EventHandlerRef wRef, cRef[2]; - EventHandlerUPP wUPP, cUPP[2]; - EventTypeSpec wEvent[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - cEvent[] = { { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlDragEnter }, - { kEventClassControl, kEventControlDragWithin }, - { kEventClassControl, kEventControlDragLeave }, - { kEventClassControl, kEventControlDragReceive } }; - HIViewRef ctl, root, pane[2]; - HIViewID cid; - - root = HIViewGetRoot(window); - - wUPP = NewEventHandlerUPP(MultiCartEventHandler); - err = InstallWindowEventHandler(window, wUPP, GetEventTypeCount(wEvent), wEvent, (void *) window, &wRef); - err = SetAutomaticControlDragTrackingEnabledForWindow(window, true); - - for (int i = 0; i < 2; i++) - { - cid.id = i; - - cid.signature = 'MPan'; - HIViewFindByID(root, cid, &pane[i]); - cUPP[i] = NewEventHandlerUPP(MultiCartPaneEventHandler); - err = InstallControlEventHandler(pane[i], cUPP[i], GetEventTypeCount(cEvent), cEvent, (void *) &index[i], &cRef[i]); - err = SetControlDragTrackingEnabled(pane[i], true); - - cid.signature = 'MNAM'; - HIViewFindByID(root, cid, &ctl); - SetStaticTextTrunc(ctl, truncEnd, false); - if (multiCartPath[i]) - { - CFStringRef str; - CFURLRef url; - - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, false); - CFRelease(str); - CFRelease(url); - } - else - SetStaticTextCFString(ctl, CFSTR(""), false); - } - - MoveWindowPosition(window, kWindowMultiCart, false); - ShowWindow(window); - err = RunAppModalLoopForWindow(window); - HideWindow(window); - SaveWindowPosition(window, kWindowMultiCart); - - for (int i = 0; i < 2; i++) - { - err = RemoveEventHandler(cRef[i]); - DisposeEventHandlerUPP(cUPP[i]); - } - - err = RemoveEventHandler(wRef); - DisposeEventHandlerUPP(wUPP); - - CFRelease(window); - } - - DisposeNibReference(nibRef); - } - - return (multiCartDialogResult); -} - -static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef window = (WindowRef) inUserData; - static int index = -1; - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - HIViewRef ctl, root; - HIViewID cid; - FSRef ref; - bool8 r; - - root = HIViewGetRoot(window); - - switch (tHICommand.commandID) - { - case 'Cho0': - case 'Cho1': - { - index = (tHICommand.commandID & 0xFF) - '0'; - r = NavBeginOpenROMImageSheet(window, NULL); - result = noErr; - break; - } - - case 'NvDn': - { - r = NavEndOpenROMImageSheet(&ref); - if (r) - { - CFStringRef str; - CFURLRef url; - - url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); - str = CFURLCopyLastPathComponent(url); - cid.signature = 'MNAM'; - cid.id = index; - HIViewFindByID(root, cid, &ctl); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (multiCartPath[index]) - CFRelease(multiCartPath[index]); - multiCartPath[index] = str; - CFRelease(url); - } - - index = -1; - result = noErr; - break; - } - - case 'Cle0': - case 'Cle1': - { - index = (tHICommand.commandID & 0xFF) - '0'; - cid.signature = 'MNAM'; - cid.id = index; - HIViewFindByID(root, cid, &ctl); - SetStaticTextCFString(ctl, CFSTR(""), true); - if (multiCartPath[index]) - { - CFRelease(multiCartPath[index]); - multiCartPath[index] = NULL; - } - - index = -1; - result = noErr; - break; - } - - case 'SWAP': - { - CFStringRef str; - CFURLRef url; - - str = multiCartPath[0]; - multiCartPath[0] = multiCartPath[1]; - multiCartPath[1] = str; - - cid.signature = 'MNAM'; - - for (int i = 0; i < 2; i++) - { - cid.id = i; - HIViewFindByID(root, cid, &ctl); - - if (multiCartPath[i]) - { - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - CFRelease(url); - } - else - SetStaticTextCFString(ctl, CFSTR(""), true); - } - - result = noErr; - break; - } - - case 'ok ': - { - QuitAppModalLoopForWindow(window); - multiCartDialogResult = true; - result = noErr; - break; - } - - case 'not!': - { - QuitAppModalLoopForWindow(window); - multiCartDialogResult = false; - result = noErr; - break; - } - } - } - } - } - } - } - - return (result); -} - -static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view; - DragRef drag; - PasteboardRef pasteboard; - PasteboardItemID itemID; - CFArrayRef array; - CFStringRef flavorType; - CFIndex numFlavors; - ItemCount numItems; - int index = *((int *) inUserData); - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIThemeFrameDrawInfo info; - HIRect bounds, frame; - - HIViewGetBounds(view, &bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - - info.version = 0; - info.kind = kHIThemeFrameTextFieldSquare; - info.state = kThemeStateInactive; - info.isFocused = false; - err = HIThemeDrawFrame(&bounds, &info, ctx, kHIThemeOrientationNormal); - - if (multiCartDragHilite == index && systemVersion >= 0x1040) - { - err = HIThemeSetStroke(kThemeBrushDragHilite, NULL, ctx, kHIThemeOrientationNormal); - frame = CGRectInset(bounds, 1, 1); - CGContextBeginPath(ctx); - CGContextAddRect(ctx, frame); - CGContextStrokePath(ctx); - } - } - } - - result = noErr; - break; - } - - case kEventControlDragEnter: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); - if (err == noErr) - { - err = GetDragPasteboard(drag, &pasteboard); - if (err == noErr) - { - err = PasteboardGetItemCount(pasteboard, &numItems); - if (err == noErr && numItems == 1) - { - err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); - if (err == noErr) - { - err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); - if (err == noErr) - { - numFlavors = CFArrayGetCount(array); - for (CFIndex i = 0; i < numFlavors; i++) - { - flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); - if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) - { - Boolean accept = true; - - err = SetEventParameter(inEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof(Boolean), &accept); - if (err == noErr) - { - multiCartDragHilite = index; - HIViewSetNeedsDisplay(view, true); - result = noErr; - } - } - } - - CFRelease(array); - } - } - } - } - } - } - - break; - } - - case kEventControlDragWithin: - { - result = noErr; - break; - } - - case kEventControlDragLeave: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - multiCartDragHilite = -1; - HIViewSetNeedsDisplay(view, true); - } - - result = noErr; - break; - } - - case kEventControlDragReceive: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); - if (err == noErr) - { - multiCartDragHilite = -1; - HIViewSetNeedsDisplay(view, true); - - err = GetDragPasteboard(drag, &pasteboard); - if (err == noErr) - { - err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); - if (err == noErr) - { - err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); - if (err == noErr) - { - numFlavors = CFArrayGetCount(array); - for (CFIndex i = 0; i < numFlavors; i++) - { - flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); - if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) - { - CFDataRef flavorData; - - err = PasteboardCopyItemFlavorData(pasteboard, itemID, flavorType, &flavorData); - if (err == noErr) - { - CFIndex dataSize; - UInt8 *data; - - dataSize = CFDataGetLength(flavorData); - data = (UInt8 *) malloc(dataSize); - if (data) - { - CFDataGetBytes(flavorData, CFRangeMake(0, dataSize), data); - - HIViewRef ctl; - HIViewID cid; - CFStringRef str; - CFURLRef url; - - GetControlID(view, &cid); - cid.signature = 'MNAM'; - HIViewFindByID(view, cid, &ctl); - - url = CFURLCreateWithBytes(kCFAllocatorDefault, data, dataSize, kCFStringEncodingUTF8, NULL); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (multiCartPath[cid.id]) - CFRelease(multiCartPath[cid.id]); - multiCartPath[cid.id] = str; - CFRelease(url); - - result = noErr; - - free(data); - } - - CFRelease(flavorData); - } - } - } - - CFRelease(array); - } - } - } - } - } - } - } - } - } - - return (result); -} diff --git a/macosx/mac-multicart.h b/macosx/mac-multicart.h index c7ef139a..28a24993 100644 --- a/macosx/mac-multicart.h +++ b/macosx/mac-multicart.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-multicart.mm b/macosx/mac-multicart.mm new file mode 100644 index 00000000..da53f2da --- /dev/null +++ b/macosx/mac-multicart.mm @@ -0,0 +1,540 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" + +#include "mac-prefix.h" +#include "mac-cart.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-multicart.h" + +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +#define truncEnd 0 +#endif + +static OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *); + +static int multiCartDragHilite; +static Boolean multiCartDialogResult; + +void InitMultiCart (void) +{ + CFStringRef keyRef, pathRef; + char key[32]; + + multiCartPath[0] = multiCartPath[1] = NULL; + + for (int i = 0; i < 2; i++) + { + sprintf(key, "MultiCartPath_%02d", i); + keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); + if (keyRef) + { + pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); + if (pathRef) + multiCartPath[i] = pathRef; + + CFRelease(keyRef); + } + } +} + +void DeinitMultiCart (void) +{ + CFStringRef keyRef; + char key[32]; + + for (int i = 0; i < 2; i++) + { + sprintf(key, "MultiCartPath_%02d", i); + keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); + if (keyRef) + { + if (multiCartPath[i]) + { + CFPreferencesSetAppValue(keyRef, multiCartPath[i], kCFPreferencesCurrentApplication); + CFRelease(multiCartPath[i]); + } + else + CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); + + CFRelease(keyRef); + } + } + + CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); +} + +Boolean MultiCartDialog (void) +{ +// OSStatus err; +// IBNibRef nibRef; +// +// multiCartDragHilite = -1; +// multiCartDialogResult = false; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef window; +// +// err = CreateWindowFromNib(nibRef, CFSTR("MultiCart"), &window); +// if (err == noErr) +// { +// static int index[2] = { 0, 1 }; +// +// EventHandlerRef wRef, cRef[2]; +// EventHandlerUPP wUPP, cUPP[2]; +// EventTypeSpec wEvent[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }, +// cEvent[] = { { kEventClassControl, kEventControlDraw }, +// { kEventClassControl, kEventControlDragEnter }, +// { kEventClassControl, kEventControlDragWithin }, +// { kEventClassControl, kEventControlDragLeave }, +// { kEventClassControl, kEventControlDragReceive } }; +// HIViewRef ctl, root, pane[2]; +// HIViewID cid; +// +// root = HIViewGetRoot(window); +// +// wUPP = NewEventHandlerUPP(MultiCartEventHandler); +// err = InstallWindowEventHandler(window, wUPP, GetEventTypeCount(wEvent), wEvent, (void *) window, &wRef); +// err = SetAutomaticControlDragTrackingEnabledForWindow(window, true); +// +// for (int i = 0; i < 2; i++) +// { +// cid.id = i; +// +// cid.signature = 'MPan'; +// HIViewFindByID(root, cid, &pane[i]); +// cUPP[i] = NewEventHandlerUPP(MultiCartPaneEventHandler); +// err = InstallControlEventHandler(pane[i], cUPP[i], GetEventTypeCount(cEvent), cEvent, (void *) &index[i], &cRef[i]); +// err = SetControlDragTrackingEnabled(pane[i], true); +// +// cid.signature = 'MNAM'; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextTrunc(ctl, truncEnd, false); +// if (multiCartPath[i]) +// { +// CFStringRef str; +// CFURLRef url; +// +// url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, false); +// CFRelease(str); +// CFRelease(url); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), false); +// } +// +// MoveWindowPosition(window, kWindowMultiCart, false); +// ShowWindow(window); +// err = RunAppModalLoopForWindow(window); +// HideWindow(window); +// SaveWindowPosition(window, kWindowMultiCart); +// +// for (int i = 0; i < 2; i++) +// { +// err = RemoveEventHandler(cRef[i]); +// DisposeEventHandlerUPP(cUPP[i]); +// } +// +// err = RemoveEventHandler(wRef); +// DisposeEventHandlerUPP(wUPP); +// +// CFRelease(window); +// } +// +// DisposeNibReference(nibRef); +// } +// +// return (multiCartDialogResult); + + return 0; +} + +static OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// WindowRef window = (WindowRef) inUserData; +// static int index = -1; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// { +// switch (GetEventKind(inEvent)) +// { +// HICommand tHICommand; +// +// case kEventCommandUpdateStatus: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// } +// +// case kEventCommandProcess: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr) +// { +// HIViewRef ctl, root; +// HIViewID cid; +// FSRef ref; +// bool8 r; +// +// root = HIViewGetRoot(window); +// +// switch (tHICommand.commandID) +// { +// case 'Cho0': +// case 'Cho1': +// { +// index = (tHICommand.commandID & 0xFF) - '0'; +// // r = NavBeginOpenROMImageSheet(window, NULL); +// result = noErr; +// break; +// } +// +// case 'NvDn': +// { +// r = NavEndOpenROMImageSheet(&ref); +// if (r) +// { +// CFStringRef str; +// CFURLRef url; +// +// url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); +// str = CFURLCopyLastPathComponent(url); +// cid.signature = 'MNAM'; +// cid.id = index; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); +// if (multiCartPath[index]) +// CFRelease(multiCartPath[index]); +// multiCartPath[index] = str; +// CFRelease(url); +// } +// +// index = -1; +// result = noErr; +// break; +// } +// +// case 'Cle0': +// case 'Cle1': +// { +// index = (tHICommand.commandID & 0xFF) - '0'; +// cid.signature = 'MNAM'; +// cid.id = index; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextCFString(ctl, CFSTR(""), true); +// if (multiCartPath[index]) +// { +// CFRelease(multiCartPath[index]); +// multiCartPath[index] = NULL; +// } +// +// index = -1; +// result = noErr; +// break; +// } +// +// case 'SWAP': +// { +// CFStringRef str; +// CFURLRef url; +// +// str = multiCartPath[0]; +// multiCartPath[0] = multiCartPath[1]; +// multiCartPath[1] = str; +// +// cid.signature = 'MNAM'; +// +// for (int i = 0; i < 2; i++) +// { +// cid.id = i; +// HIViewFindByID(root, cid, &ctl); +// +// if (multiCartPath[i]) +// { +// url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// CFRelease(url); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), true); +// } +// +// result = noErr; +// break; +// } +// +// case 'ok ': +// { +// QuitAppModalLoopForWindow(window); +// multiCartDialogResult = true; +// result = noErr; +// break; +// } +// +// case 'not!': +// { +// QuitAppModalLoopForWindow(window); +// multiCartDialogResult = false; +// result = noErr; +// break; +// } +// } +// } +// } +// } +// } +// } +// +// return (result); + + return 0; +} + +static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// HIViewRef view; +// DragRef drag; +// PasteboardRef pasteboard; +// PasteboardItemID itemID; +// CFArrayRef array; +// CFStringRef flavorType; +// CFIndex numFlavors; +// ItemCount numItems; +// int index = *((int *) inUserData); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassControl: +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventControlDraw: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// CGContextRef ctx; +// +// err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); +// if (err == noErr) +// { +// HIThemeFrameDrawInfo info; +// HIRect bounds, frame; +// +// HIViewGetBounds(view, &bounds); +// +// CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); +// CGContextFillRect(ctx, bounds); +// +// info.version = 0; +// info.kind = kHIThemeFrameTextFieldSquare; +// info.state = kThemeStateInactive; +// info.isFocused = false; +// err = HIThemeDrawFrame(&bounds, &info, ctx, kHIThemeOrientationNormal); +// +// if (multiCartDragHilite == index && systemVersion >= 0x1040) +// { +// err = HIThemeSetStroke(kThemeBrushDragHilite, NULL, ctx, kHIThemeOrientationNormal); +// frame = CGRectInset(bounds, 1, 1); +// CGContextBeginPath(ctx); +// CGContextAddRect(ctx, frame); +// CGContextStrokePath(ctx); +// } +// } +// } +// +// result = noErr; +// break; +// } +// +// case kEventControlDragEnter: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); +// if (err == noErr) +// { +// err = GetDragPasteboard(drag, &pasteboard); +// if (err == noErr) +// { +// err = PasteboardGetItemCount(pasteboard, &numItems); +// if (err == noErr && numItems == 1) +// { +// err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); +// if (err == noErr) +// { +// err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); +// if (err == noErr) +// { +// numFlavors = CFArrayGetCount(array); +// for (CFIndex i = 0; i < numFlavors; i++) +// { +// flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); +// if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) +// { +// Boolean accept = true; +// +// err = SetEventParameter(inEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof(Boolean), &accept); +// if (err == noErr) +// { +// multiCartDragHilite = index; +// HIViewSetNeedsDisplay(view, true); +// result = noErr; +// } +// } +// } +// +// CFRelease(array); +// } +// } +// } +// } +// } +// } +// +// break; +// } +// +// case kEventControlDragWithin: +// { +// result = noErr; +// break; +// } +// +// case kEventControlDragLeave: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// multiCartDragHilite = -1; +// HIViewSetNeedsDisplay(view, true); +// } +// +// result = noErr; +// break; +// } +// +// case kEventControlDragReceive: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); +// if (err == noErr) +// { +// multiCartDragHilite = -1; +// HIViewSetNeedsDisplay(view, true); +// +// err = GetDragPasteboard(drag, &pasteboard); +// if (err == noErr) +// { +// err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); +// if (err == noErr) +// { +// err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); +// if (err == noErr) +// { +// numFlavors = CFArrayGetCount(array); +// for (CFIndex i = 0; i < numFlavors; i++) +// { +// flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); +// if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) +// { +// CFDataRef flavorData; +// +// err = PasteboardCopyItemFlavorData(pasteboard, itemID, flavorType, &flavorData); +// if (err == noErr) +// { +// CFIndex dataSize; +// UInt8 *data; +// +// dataSize = CFDataGetLength(flavorData); +// data = (UInt8 *) malloc(dataSize); +// if (data) +// { +// CFDataGetBytes(flavorData, CFRangeMake(0, dataSize), data); +// +// HIViewRef ctl; +// HIViewID cid; +// CFStringRef str; +// CFURLRef url; +// +// GetControlID(view, &cid); +// cid.signature = 'MNAM'; +// HIViewFindByID(view, cid, &ctl); +// +// url = CFURLCreateWithBytes(kCFAllocatorDefault, data, dataSize, kCFStringEncodingUTF8, NULL); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); +// if (multiCartPath[cid.id]) +// CFRelease(multiCartPath[cid.id]); +// multiCartPath[cid.id] = str; +// CFRelease(url); +// +// result = noErr; +// +// free(data); +// } +// +// CFRelease(flavorData); +// } +// } +// } +// +// CFRelease(array); +// } +// } +// } +// } +// } +// } +// } +// } +// } +// +// return (result); + return 0; +} diff --git a/macosx/mac-musicbox.h b/macosx/mac-musicbox.h index cd1dca76..17866a9c 100755 --- a/macosx/mac-musicbox.h +++ b/macosx/mac-musicbox.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -26,7 +27,7 @@ @interface MusicBoxController : NSObject { - IBOutlet id window; + IBOutlet NSWindow *window; IBOutlet id gametitle; IBOutlet id disclosure; IBOutlet id rewind; diff --git a/macosx/mac-musicbox.mm b/macosx/mac-musicbox.mm index ef1a8717..615fa680 100755 --- a/macosx/mac-musicbox.mm +++ b/macosx/mac-musicbox.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -122,7 +123,7 @@ static void * SoundTask (void *); MacStartSound(); pthread_create(&mbxThread, NULL, SoundTask, NULL); - timer = [[NSTimer scheduledTimerWithTimeInterval: (2.0 / (double) Memory.ROMFramesPerSecond) target: self selector: @selector(updateIndicator:) userInfo: nil repeats: YES] retain]; + timer = [NSTimer scheduledTimerWithTimeInterval: (2.0 / (double) Memory.ROMFramesPerSecond) target: self selector: @selector(updateIndicator:) userInfo: nil repeats: YES]; return (self); } @@ -134,7 +135,7 @@ static void * SoundTask (void *); BOOL r; [timer invalidate]; - [timer release]; + timer = nil; showIndicator = false; @@ -159,10 +160,6 @@ static void * SoundTask (void *); SPCPlayDefrost(); else MusicBoxForceDefrost(); - - [window release]; - - [super dealloc]; } - (NSWindow *) window @@ -268,7 +265,7 @@ static void * SoundTask (void *); const float length[] = { 1.0f, 1.0f }; CGContextSetLineWidth(mboxctx, mbxBarWidth); - CGContextSetLineDash(mboxctx, 0, length, 2); + //CGContextSetLineDash(mboxctx, 0, length, 2); CGContextSetLineJoin(mboxctx, kCGLineJoinMiter); CGContextBeginPath(mboxctx); @@ -417,20 +414,20 @@ static void SPCPlayExec (void) static void MusicBoxForceFreeze (void) { - char filename[PATH_MAX + 1]; + char filename[PATH_MAX + 1]; - strcpy(filename, S9xGetFreezeFilename(999)); - strcat(filename, ".tmp"); + strlcpy(filename, S9xGetFreezeFilename(999), sizeof(filename)); + strlcat(filename, ".tmp", sizeof(filename)); S9xFreezeGame(filename); } static void MusicBoxForceDefrost (void) { - char filename[PATH_MAX + 1]; + char filename[PATH_MAX + 1]; - strcpy(filename, S9xGetFreezeFilename(999)); - strcat(filename, ".tmp"); + strlcpy(filename, S9xGetFreezeFilename(999), sizeof(filename)); + strlcat(filename, ".tmp", sizeof(filename)); S9xUnfreezeGame(filename); remove(filename); @@ -457,21 +454,14 @@ static void SPCPlayDefrost (void) void MusicBoxDialog (void) { MusicBoxController *controller; - NSAutoreleasePool *pool; if (!cartOpen) return; - pool = [[NSAutoreleasePool alloc] init]; controller = [[MusicBoxController alloc] init]; - [pool release]; if (!controller) return; [NSApp runModalForWindow: [controller window]]; - - pool = [[NSAutoreleasePool alloc] init]; - [controller release]; - [pool release]; } diff --git a/macosx/mac-netplay.h b/macosx/mac-netplay.h index dc299f07..ecdf8299 100644 --- a/macosx/mac-netplay.h +++ b/macosx/mac-netplay.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-netplay.cpp b/macosx/mac-netplay.mm similarity index 96% rename from macosx/mac-netplay.cpp rename to macosx/mac-netplay.mm index 16b70212..b9d92007 100644 --- a/macosx/mac-netplay.cpp +++ b/macosx/mac-netplay.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-os.h b/macosx/mac-os.h index b8cd91ef..8c84ba81 100644 --- a/macosx/mac-os.h +++ b/macosx/mac-os.h @@ -15,39 +15,19 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_os_h_ #define _mac_os_h_ -enum -{ - kDrawingReserved1 = 1, // unused - kDrawingOpenGL, - kDrawingBlitGL -}; +#import +#import -enum -{ - kWindowControllers = 0, - kWindowPreferences, - kWindowAbout, - kWindowAutoFire, - kWindowRomInfo, - kWindowCheatFinder, - kWindowKeyConfig, - kWindowCheatEntry, - kWindowScreen, - kWindowServer, - kWindowClient, - kWindowExtra, - kWindowSoundEffect, - kWindowCoreImageFilter, - kWindowMultiCart, +#import - kWindowCount -}; +#import "mac-controls.h" enum { @@ -85,6 +65,17 @@ enum VIDEOMODE_NTSC_TV_M }; +typedef enum S9xMacDeviceSettings { + Gamepads = 1, + Mouse = 2, + Mouse2 = 3, + SuperScope = 4, + MultiTap = 5, + DoubleMultiTap = 6, + Justifier1 = 7, + Justifier2 = 8, +} S9xDeviceSetting; + typedef struct { long long nextTime[12]; @@ -95,42 +86,26 @@ typedef struct SInt32 frequency; } AutoFireState; -typedef struct -{ - bool8 benchmark; - bool8 glForceNoTextureRectangle; - bool8 glUseClientStrageApple; - bool8 glUseTexturePriority; - int glStorageHint; -} ExtraOption; - -#define kMacWindowHeight (SNES_HEIGHT_EXTENDED << 1) -#define MAC_MAX_PLAYERS 8 +#define kMacWindowHeight (SNES_HEIGHT_EXTENDED) #define MAC_MAX_CHEATS 150 extern volatile bool8 running, s9xthreadrunning; extern volatile bool8 eventQueued, windowExtend; -extern volatile int windowResizeCount; extern uint32 controlPad[MAC_MAX_PLAYERS]; extern uint8 romDetect, interleaveDetect, videoDetect, headerDetect; extern WindowRef gWindow; -extern HIRect gWindowRect; -extern int glScreenW, glScreenH; +extern uint32 glScreenW, glScreenH; +extern CGFloat rawMouseX, rawMouseY; +extern int16 mouseX, mouseY; extern CGRect glScreenBounds; -extern Point windowPos[kWindowCount]; -extern CGSize windowSize[kWindowCount]; extern CGImageRef macIconImage[118]; extern int macPadIconIndex, macLegendIconIndex, macMusicBoxIconIndex, macFunctionIconIndex; extern int macFrameSkip; extern int32 skipFrames; extern int64 lastFrame; extern unsigned long spcFileCount, pngFileCount; -extern SInt32 systemVersion; -extern bool8 finished, cartOpen, - autofire, hidExist, directDisplay; -extern bool8 fullscreen, autoRes, - glstretch, gl32bit, vsync, drawoverscan, lastoverscan, screencurvature, - multiprocessor, ciFilterEnable; +extern bool8 finished, cartOpen, autofire; +extern bool8 autoRes, glstretch, gl32bit, vsync, drawoverscan, lastoverscan; extern long drawingMethod; extern int videoMode; extern SInt32 macSoundVolume; @@ -138,7 +113,7 @@ extern uint32 macSoundBuffer_ms, macSoundInterval_ms; extern bool8 macSoundLagEnable; extern uint16 aueffect; extern uint8 saveInROMFolder; -extern CFStringRef saveFolderPath; +extern NSString *saveFolderPath; extern int macCurvatureWarp, macAspectRatio; extern int macFastForwardRate, macFrameAdvanceRate; extern int inactiveMode; @@ -147,30 +122,94 @@ extern uint16 macRecordFlag, macPlayFlag, macQTMovFlag; extern bool8 startopendlog, showtimeinfrz, enabletoggle, savewindowpos, onscreeninfo; extern int musicboxmode; extern bool8 applycheat; -extern int padSetting, deviceSetting, deviceSettingMaster; +extern S9xDeviceSetting deviceSetting, deviceSettingMaster; extern int macControllerOption; extern CGPoint unlimitedCursor; extern char npServerIP[256], npName[256]; extern AutoFireState autofireRec[MAC_MAX_PLAYERS]; -extern ExtraOption extraOptions; extern CFStringRef multiCartPath[2]; #ifdef MAC_PANTHER_SUPPORT extern IconRef macIconRef[118]; #endif -void InitGameWindow (void); -void DeinitGameWindow (void); -void UpdateGameWindow (void); -void AddRecentItem (FSRef *); -void BuildRecentMenu (void); +extern bool8 pressedKeys[MAC_MAX_PLAYERS][kNumButtons]; +extern bool8 pressedGamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; +extern pthread_mutex_t keyLock; + +@interface S9xView: MTKView +- (void)updatePauseOverlay; +@end +extern S9xView *s9xView; + void AdjustMenus (void); void UpdateMenuCommandStatus (Boolean); void ApplyNSRTHeaderControllers (void); -void QuitWithFatalError (OSStatus, const char *); +void QuitWithFatalError (NSString *); void ChangeInputDevice (void); -void GetGameScreenPointer (int16 *, int16 *, bool); void PostQueueToSubEventLoop (void); int PromptFreezeDefrost (Boolean); +uint64 GetMicroseconds(void); + +void CopyPressedKeys(uint8 keys[MAC_MAX_PLAYERS][kNumButtons], uint8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]); + +@interface S9xJoypad : NSObject +@property (nonatomic, assign) uint32 vendorID; +@property (nonatomic, assign) uint32 productID; +@property (nonatomic, assign) uint8 index; +@property (nonatomic, copy) NSString *name; +@end + +@interface S9xJoypadInput : NSObject +@property (nonatomic, assign) uint32 cookie; +@property (nonatomic, assign) int32 value; +@property (nonatomic, assign) S9xButtonCode buttonCode; +@end + +@protocol S9xInputDelegate +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad; +- (void)deviceSettingChanged:(S9xDeviceSetting)deviceSetting; +@end + +extern id inputDelegate; + +@interface S9xEngine : NSObject + +@property (nonatomic, weak) id inputDelegate; + +- (void)recreateS9xView; + +- (void)start; +- (void)stop; +- (void)softwareReset; +- (void)hardwareReset; + +- (BOOL)isRunning; +- (BOOL)isPaused; +- (void)pause; +- (void)quit; +- (void)resume; + +- (BOOL)setButton:(S9xButtonCode)button forKey:(int16)key player:(int8)player oldButton:(S9xButtonCode *)oldButton oldPlayer:(int8 *)oldPlayer oldKey:(int16 *)oldKey; +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player; + +- (NSArray *)listJoypads; +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index oldPlayer:(int8 *)oldPlayer; +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value oldButton:(S9xButtonCode *)oldButton; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode; +- (NSArray *)getInputsForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value; + +- (BOOL)loadROM:(NSURL *)fileURL; + +- (void)setVideoMode:(int)videoMode; +- (void)setMacFrameSkip:(int)_macFrameSkip; +- (void)setShowFPS:(BOOL)showFPS; + +- (void)setDeviceSetting:(S9xDeviceSetting)_deviceSetting; + +@end #endif diff --git a/macosx/mac-os.mm b/macosx/mac-os.mm index 3ea95f0b..a4d8771a 100644 --- a/macosx/mac-os.mm +++ b/macosx/mac-os.mm @@ -15,8 +15,17 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import +#import + +#include +#include +#include +#include +#include #import "snes9x.h" #import "memmap.h" @@ -33,19 +42,14 @@ #import "debug.h" #endif -#import -#import #import #import "mac-prefix.h" -#import "mac-appleevent.h" #import "mac-audio.h" #import "mac-cheat.h" #import "mac-cheatfinder.h" -#import "mac-client.h" #import "mac-cocoatools.h" #import "mac-controls.h" -#import "mac-coreimage.h" #import "mac-dialog.h" #import "mac-file.h" #import "mac-gworld.h" @@ -54,28 +58,19 @@ #import "mac-multicart.h" #import "mac-musicbox.h" #import "mac-netplay.h" -#import "mac-prefs.h" -#import "mac-quicktime.h" #import "mac-render.h" #import "mac-screenshot.h" -#import "mac-server.h" #import "mac-snes9x.h" #import "mac-stringtools.h" #import "mac-os.h" #define kRecentMenu_MAX 20 -#define KeyIsPressed(km, k) (1 & (((unsigned char *) km) [(k) >> 3] >> ((k) & 7))) volatile bool8 running = false; volatile bool8 s9xthreadrunning = false; -volatile bool8 eventQueued = false; - -volatile int windowResizeCount = 1; volatile bool8 windowExtend = true; -SInt32 systemVersion; - uint32 controlPad[MAC_MAX_PLAYERS]; uint8 romDetect = 0, @@ -84,12 +79,12 @@ uint8 romDetect = 0, headerDetect = 0; WindowRef gWindow = NULL; -HIRect gWindowRect; -int glScreenW, +uint32 glScreenW, glScreenH; CGRect glScreenBounds; -Point windowPos[kWindowCount]; -CGSize windowSize[kWindowCount]; + +CGFloat rawMouseX, rawMouseY = 0; +int16 mouseX, mouseY = 0; CGImageRef macIconImage[118]; int macPadIconIndex, @@ -101,29 +96,24 @@ int macFrameSkip = -1; int32 skipFrames = 3; int64 lastFrame = 0; +int64 machTimeNumerator = 0; +int64 machTimeDenominator = 0; + int macFastForwardRate = 5, macFrameAdvanceRate = 1000000; unsigned long spcFileCount = 0, pngFileCount = 0; -bool8 finished = false, - cartOpen = false, - autofire = false, - hidExist = true, - directDisplay = false; +bool8 cartOpen = false, + autofire = false; -bool8 fullscreen = false, - autoRes = false, +bool8 autoRes = false, glstretch = true, gl32bit = true, vsync = true, - drawoverscan = false, - screencurvature = false, - multiprocessor = false, - ciFilterEnable = false; -long drawingMethod = kDrawingOpenGL; -int videoMode = VIDEOMODE_SMOOTH; + drawoverscan = false; +int videoMode = VIDEOMODE_BLOCKY; SInt32 macSoundVolume = 80; // % uint32 macSoundBuffer_ms = 80; // ms @@ -132,13 +122,13 @@ bool8 macSoundLagEnable = false; uint16 aueffect = 0; uint8 saveInROMFolder = 2; // 0 : Snes9x 1 : ROM 2 : Application Support -CFStringRef saveFolderPath; +NSString *saveFolderPath; int macCurvatureWarp = 15, macAspectRatio = 0; bool8 startopendlog = false, - showtimeinfrz = true, + showtimeinfrz = false, enabletoggle = true, savewindowpos = false, onscreeninfo = true; @@ -146,9 +136,8 @@ int inactiveMode = 2; int musicboxmode = kMBXSoundEmulation; bool8 applycheat = false; -int padSetting = 1, - deviceSetting = 1, - deviceSettingMaster = 1; +S9xDeviceSetting deviceSetting = Gamepads, + deviceSettingMaster = Gamepads; int macControllerOption = SNES_JOYPAD; AutoFireState autofireRec[MAC_MAX_PLAYERS]; @@ -166,112 +155,126 @@ bool8 lastoverscan = false; CGPoint unlimitedCursor; -ExtraOption extraOptions; - CFStringRef multiCartPath[2]; #ifdef MAC_PANTHER_SUPPORT IconRef macIconRef[118]; #endif -enum +id inputDelegate = nil; + +typedef enum { - mApple = 128, - iAbout = 1, + ToggleBG0, + ToggleBG1, + ToggleBG2, + ToggleBG3, + ToggleSprites, + SwapJoypads, + SoundChannel0, + SoundChannel1, + SoundChannel2, + SoundChannel3, + SoundChannel4, + SoundChannel5, + SoundChannel6, + SoundChannel7, + SoundChannelsOn, + ToggleDisplayPressedKeys, + ToggleDisplayMovieFrame, + IncreaseFrameAdvanceRate, + DecreaseFrameAdvanceRate, + ToggleEmulationPause, + AdvanceFrame, + kNumFunctionButtons +} S9xFunctionButtonCommand; - mFile = 129, - iOpen = 1, - iOpenMulti = 2, - iOpenRecent = 3, - iClose = 5, - iRomInfo = 7, - - mControl = 134, - iKeyboardLayout = 1, - iISpLayout = 2, - iAutoFire = 4, - iISpPreset = 6, - - mEdit = 130, - - mEmulation = 131, - iResume = 1, - iSoftReset = 3, - iReset = 4, - iDevice = 6, - - mCheat = 132, - iApplyCheats = 1, - iGameGenie = 3, - iCheatFinder = 4, - - mOption = 133, - iFreeze = 1, - iDefrost = 2, - iFreezeTo = 4, - iDefrostFrom = 5, - iRecordMovie = 7, - iPlayMovie = 8, - iQTMovie = 10, - iSaveSPC = 12, - iSaveSRAM = 13, - iCIFilter = 15, - iMusicBox = 17, - - mNetplay = 135, - iServer = 1, - iClient = 2, - - mPresets = 201, - - mDevice = 202, - iPad = 1, - iMouse = 2, - iMouse2 = 3, - iSuperScope = 4, - iMultiPlayer5 = 5, - iMultiPlayer5_2 = 6, - iJustifier1 = 7, - iJustifier2 = 8, - - mRecentItem = 203 +uint8 functionButtons[kNumFunctionButtons] = { + kVK_F1, + kVK_F2, + kVK_F3, + kVK_F4, + kVK_F5, + kVK_F6, + kVK_ANSI_1, + kVK_ANSI_2, + kVK_ANSI_3, + kVK_ANSI_4, + kVK_ANSI_5, + kVK_ANSI_6, + kVK_ANSI_7, + kVK_ANSI_8, + kVK_ANSI_9, + kVK_ANSI_0, + kVK_ANSI_Minus, + kVK_ANSI_Q, + kVK_ANSI_W, + kVK_ANSI_O, + kVK_ANSI_P }; +bool8 pressedKeys[MAC_MAX_PLAYERS][kNumButtons] = { 0 }; +bool8 pressedGamepadButtons[MAC_MAX_PLAYERS][kNumButtons] = { 0 }; +bool8 pressedFunctionButtons[kNumFunctionButtons] = { 0 }; +bool8 pressedRawKeyboardButtons[MAC_NUM_KEYCODES] = { 0 }; +bool8 heldFunctionButtons[kNumFunctionButtons] = { 0 }; +pthread_mutex_t keyLock; + +S9xView *s9xView; + enum { - kmF1Key = 0x7A, - kmF2Key = 0x78, - kmF3Key = 0x63, - kmF4Key = 0x76, - kmF5Key = 0x60, - kmF6Key = 0x61, - km0Key = 0x1D, - km1Key = 0x12, - km2Key = 0x13, - km3Key = 0x14, - km4Key = 0x15, - km5Key = 0x17, - km6Key = 0x16, - km7Key = 0x1A, - km8Key = 0x1C, - km9Key = 0x19, - kmAKey = 0x00, - kmBKey = 0x0B, - kmCKey = 0x08, - kmEscKey = 0x35, - kmCtrKey = 0x3B, - kmMinusKey = 0x1B, - kmQKey = 0x0C, - kmWKey = 0x0D, - kmOKey = 0x1F, - kmPKey = 0x23 -}; + mApple = 128, + iAbout = 1, -struct ButtonCommand -{ - char command[16]; - uint8 keycode; - bool8 held; + mFile = 129, + iOpen = 1, + iOpenMulti = 2, + iOpenRecent = 3, + iClose = 5, + iRomInfo = 7, + + mControl = 134, + iKeyboardLayout = 1, + iISpLayout = 2, + iAutoFire = 4, + iISpPreset = 6, + + mEdit = 130, + + mEmulation = 131, + iResume = 1, + iSoftReset = 3, + iReset = 4, + iDevice = 6, + + mCheat = 132, + iApplyCheats = 1, + iGameGenie = 3, + iCheatFinder = 4, + + mOption = 133, + iFreeze = 1, + iDefrost = 2, + iFreezeTo = 4, + iDefrostFrom = 5, + iRecordMovie = 7, + iPlayMovie = 8, + iQTMovie = 10, + iSaveSPC = 12, + iSaveSRAM = 13, + iCIFilter = 15, + iMusicBox = 17, + + mNetplay = 135, + iServer = 1, + iClient = 2, + + mPresets = 201, + + mDevice = 202, + + mRecentItem = 203 }; struct GameViewInfo @@ -285,19 +288,9 @@ struct GameViewInfo static volatile bool8 rejectinput = false; static bool8 pauseEmulation = false, - frameAdvance = false; - -static pthread_t s9xthread; - -static MenuRef recentMenu; -static CFStringRef recentItem[kRecentMenu_MAX + 1]; - -static EventHandlerUPP gameWindowUPP, - gameWUPaneUPP; -static EventHandlerRef gameWindowEventRef, - gameWUPaneEventRef; - -static int windowZoomCount = 0; + escKeyDown = false, + frameAdvance = false, + useMouse = false; static int frameCount = 0; @@ -305,2723 +298,2205 @@ static bool8 frzselecting = false; static uint16 changeAuto[2] = { 0x0000, 0x0000 }; -static GameViewInfo scopeViewInfo; - -static ButtonCommand btncmd[] = -{ - { "ToggleBG0", kmF1Key, false }, - { "ToggleBG1", kmF2Key, false }, - { "ToggleBG2", kmF3Key, false }, - { "ToggleBG3", kmF4Key, false }, - { "ToggleSprites", kmF5Key, false }, - { "SwapJoypads", kmF6Key, false }, - { "SoundChannel0", km1Key, false }, - { "SoundChannel1", km2Key, false }, - { "SoundChannel2", km3Key, false }, - { "SoundChannel3", km4Key, false }, - { "SoundChannel4", km5Key, false }, - { "SoundChannel5", km6Key, false }, - { "SoundChannel6", km7Key, false }, - { "SoundChannel7", km8Key, false }, - { "SoundChannelsOn", km9Key, false }, - { "_mac1", km0Key, false }, - { "_mac2", kmMinusKey, false }, - { "_mac3", kmQKey, false }, - { "_mac4", kmWKey, false }, - { "_mac5", kmOKey, false }, - { "_mac6", kmPKey, false } -}; - -#define kCommandListSize (sizeof(btncmd) / sizeof(btncmd[0])) - static void Initialize (void); static void Deinitialize (void); static void InitAutofire (void); -static void InitRecentItems (void); -static void DeinitRecentItems (void); -static void ClearRecentItems (void); -static void InitRecentMenu (void); -static void DeinitRecentMenu (void); static void ProcessInput (void); -static void ResizeGameWindow (void); static void ChangeAutofireSettings (int, int); static void ChangeTurboRate (int); -static void ForceChangingKeyScript (void); -static void CFTimerCallback (CFRunLoopTimerRef, void *); static void UpdateFreezeDefrostScreen (int, CGImageRef, uint8 *, CGContextRef); static void * MacSnes9xThread (void *); -static OSStatus HandleMenuChoice (UInt32, Boolean *); static inline void EmulationLoop (void); -static pascal OSStatus MainEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus SubEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef, EventRef, void *); - -int main (int argc, char **argv) +int main (int argc, const char *argv[]) { -#ifdef MAC_PANTHER_SUPPORT - NSAutoreleasePool *pool; -#endif - OSStatus err; - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec mEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - sEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassMouse, kEventMouseDragged } }; - -#ifdef MAC_PANTHER_SUPPORT - pool = [[NSAutoreleasePool alloc] init]; -#endif - eUPP = NewEventHandlerUPP(MainEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(mEvents), mEvents, NULL, &eref); - - Initialize(); - - while (!finished) - { - if (cartOpen && running) - { - #ifdef DEBUGGER - CPU.Flags |= DEBUG_MODE_FLAG; - S9xDoDebug(); - #endif - - eventQueued = false; - - Microseconds((UnsignedWide *) &lastFrame); - frameCount = 0; - if (macFrameSkip < 0) - skipFrames = 3; - else - skipFrames = macFrameSkip; - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - #ifdef MAC_PANTHER_SUPPORT - [pool release]; - - pool = [[NSAutoreleasePool alloc] init]; - #endif - eUPP = NewEventHandlerUPP(SubEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(sEvents), sEvents, NULL, &eref); - - S9xInitDisplay(NULL, NULL); - ClearGFXScreen(); - - if (!fullscreen) - ForceChangingKeyScript(); - - pthread_create(&s9xthread, NULL, MacSnes9xThread, NULL); - - CFRunLoopTimerRef cftimer = NULL; - CFRunLoopTimerContext cftimerctx = { 0, NULL, NULL, NULL, NULL }; - - if (!fullscreen) - { - cftimer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 30, 0, 0, CFTimerCallback, &cftimerctx); - if (cftimer) - CFRunLoopAddTimer(CFRunLoopGetCurrent(), cftimer, kCFRunLoopCommonModes); - } - - AdjustMenus(); - - RunApplicationEventLoop(); - - if (!fullscreen) - { - if (cftimer) - { - CFRunLoopTimerInvalidate(cftimer); - CFRelease(cftimer); - cftimer = NULL; - } - } - - pthread_join(s9xthread, NULL); - - if (!Settings.NetPlay || Settings.NetPlayServer) - { - SNES9X_SaveSRAM(); - S9xResetSaveTimer(false); - S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); - } - - S9xDeinitDisplay(); - - if (Settings.NetPlay) - { - if (!Settings.NetPlayServer) - { - DeinitGameWindow(); - cartOpen = false; - } - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - } - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - #ifdef MAC_PANTHER_SUPPORT - [pool release]; - - pool = [[NSAutoreleasePool alloc] init]; - #endif - eUPP = NewEventHandlerUPP(MainEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(mEvents), mEvents, NULL, &eref); - } - - if (!finished) - { - AdjustMenus(); - RunApplicationEventLoop(); - } - } - - Deinitialize(); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); -#ifdef MAC_PANTHER_SUPPORT - [pool release]; -#endif - - return (0); -} - -static void CFTimerCallback (CFRunLoopTimerRef timer, void *info) -{ - OSStatus err; - - err = UpdateSystemActivity(OverallAct); + return NSApplicationMain(argc, argv); } static void * MacSnes9xThread (void *) { - Settings.StopEmulation = false; - s9xthreadrunning = true; + Settings.StopEmulation = false; + s9xthreadrunning = true; - EmulationLoop(); + EmulationLoop(); - s9xthreadrunning = false; - Settings.StopEmulation = true; + s9xthreadrunning = false; + Settings.StopEmulation = true; - return (NULL); + return (NULL); +} + +void CopyPressedKeys(bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]) +{ + pthread_mutex_lock(&keyLock); + memcpy(keys, pressedKeys, sizeof(pressedKeys)); + memcpy(gamepadButtons, pressedGamepadButtons, sizeof(pressedGamepadButtons)); + pthread_mutex_unlock(&keyLock); } static inline void EmulationLoop (void) { - bool8 olddisplayframerate = false; - int storedMacFrameSkip = macFrameSkip; + bool8 olddisplayframerate = false; + int storedMacFrameSkip = macFrameSkip; - pauseEmulation = false; - frameAdvance = false; + pauseEmulation = false; + frameAdvance = false; + [s9xView updatePauseOverlay]; - if (macQTRecord) - { - olddisplayframerate = Settings.DisplayFrameRate; - Settings.DisplayFrameRate = false; - } - MacStartSound(); + if (macQTRecord) + { + olddisplayframerate = Settings.DisplayFrameRate; + Settings.DisplayFrameRate = false; + } - if (Settings.NetPlay) - { - if (Settings.NetPlayServer) - { - NPServerDetachNetPlayThread(); - NPServerStartClients(); + MacStartSound(); - while (running) - { - NPServerProcessInput(); - S9xMainLoop(); - } + if (Settings.NetPlay) + { +// if (Settings.NetPlayServer) +// { +// NPServerDetachNetPlayThread(); +// NPServerStartClients(); +// +// while (running) +// { +// NPServerProcessInput(); +// S9xMainLoop(); +// } +// +// NPServerStopNetPlayThread(); +// NPServerStopServer(); +// } +// else +// { +// NPClientDetachNetPlayThread(); +// NPClientNetPlayWaitStart(); +// +// while (running) +// { +// NPClientProcessInput(); +// S9xMainLoop(); +// } +// +// NPClientStopNetPlayThread(); +// NPClientDisconnect(); +// +// NPClientRestoreConfig(); +// } + } + else + { + while (running) + { + ProcessInput(); - NPServerStopNetPlayThread(); - NPServerStopServer(); - } - else - { - NPClientDetachNetPlayThread(); - NPClientNetPlayWaitStart(); + if (!pauseEmulation) + { + S9xMainLoop(); + } + else + { + if (frameAdvance) + { + macFrameSkip = 1; + skipFrames = 1; + frameAdvance = false; + S9xMainLoop(); + macFrameSkip = storedMacFrameSkip; + } - while (running) - { - NPClientProcessInput(); - S9xMainLoop(); - } + usleep(Settings.FrameTime); + } + } + } - NPClientStopNetPlayThread(); - NPClientDisconnect(); + MacStopSound(); - NPClientRestoreConfig(); - } - } - else - { - while (running) - { - ProcessInput(); + if (macQTRecord) + { +// MacQTStopRecording(); +// macQTRecord = false; - if (!pauseEmulation) - S9xMainLoop(); - else - { - if (frameAdvance) - { - macFrameSkip = 1; - skipFrames = 1; - frameAdvance = false; - S9xMainLoop(); - macFrameSkip = storedMacFrameSkip; - } + Settings.DisplayFrameRate = olddisplayframerate; + } - usleep(Settings.FrameTime); - } - } - } - - MacStopSound(); - - if (macQTRecord) - { - MacQTStopRecording(); - macQTRecord = false; - - Settings.DisplayFrameRate = olddisplayframerate; - } - - S9xMovieShutdown(); + S9xMovieShutdown(); } - -static pascal OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - Boolean done = false; - - if (frzselecting) - return (result); - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand cmd; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr && cmd.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr) - { - UInt32 modifierkey; - - err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); - if (err == noErr) - { - if ((cmd.commandID == 'pref') && (modifierkey & optionKey)) - cmd.commandID = 'EXTR'; - - result = HandleMenuChoice(cmd.commandID, &done); - - if (done) - QuitApplicationEventLoop(); - } - } - - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - - if (frzselecting) - return (result); - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand cmd; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr && cmd.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr) - { - switch (cmd.commandID) - { - case 'Erun': // Pause - case 'SubQ': // Queue from emulation thread - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - break; - - case 'Ocif': // Core Image Filter - HiliteMenu(0); - ConfigureCoreImageFilter(); - result = noErr; - break; - } - } - - break; - } - - break; - - case kEventClassMouse: - if (fullscreen) - { - if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - switch (GetEventKind(inEvent)) - { - case kEventMouseUp: - HIPoint hipt; - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); - if (err == noErr) - { - if (CGRectContainsPoint(glScreenBounds, hipt)) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - } - - break; - } - } - } - else - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) - { - switch (GetEventKind(inEvent)) - { - case kEventMouseMoved: - case kEventMouseDragged: - HIPoint hipt; - - err = GetEventParameter(inEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); - if (err == noErr) - { - unlimitedCursor.x += hipt.x; - unlimitedCursor.y += hipt.y; - } - - break; - } - } - } - - break; - } - - return (result); -} - -void PostQueueToSubEventLoop (void) -{ - OSStatus err; - EventRef event; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, 0, kEventAttributeUserEvent, &event); - if (err == noErr) - { - HICommand cmd; - - cmd.commandID = 'SubQ'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard); - - ReleaseEvent(event); - } -} - -void InitGameWindow (void) -{ - OSStatus err; - IBNibRef nibRef; - WindowAttributes attr; - CFStringRef ref; - HIViewRef ctl; - HIViewID cid = { 'Pict', 0 }; - Rect rct; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - EventTypeSpec wupaneEvents[] = { { kEventClassControl, kEventControlClick }, - { kEventClassControl, kEventControlDraw } }, - windowEvents[] = { { kEventClassWindow, kEventWindowDeactivated }, - { kEventClassWindow, kEventWindowActivated }, - { kEventClassWindow, kEventWindowBoundsChanging }, - { kEventClassWindow, kEventWindowBoundsChanged }, - { kEventClassWindow, kEventWindowZoom }, - { kEventClassWindow, kEventWindowToolbarSwitchMode } }; - - if (gWindow) - return; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err) - QuitWithFatalError(err, "os 02"); - - err = CreateWindowFromNib(nibRef, CFSTR("GameWindow"), &gWindow); - if (err) - QuitWithFatalError(err, "os 03"); - - DisposeNibReference(nibRef); - - HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); - - gameWindowUPP = NewEventHandlerUPP(GameWindowEventHandler); - err = InstallWindowEventHandler(gWindow, gameWindowUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) gWindow, &gameWindowEventRef); - - gameWUPaneUPP = NewEventHandlerUPP(GameWindowUserPaneEventHandler); - err = InstallControlEventHandler(ctl, gameWUPaneUPP, GetEventTypeCount(wupaneEvents), wupaneEvents, (void *) gWindow, &gameWUPaneEventRef); - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - ref = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - if (ref) - { - SetWindowTitleWithCFString(gWindow, ref); - CFRelease(ref); - } - - attr = kWindowFullZoomAttribute | kWindowResizableAttribute | kWindowLiveResizeAttribute; - err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); - - attr = kWindowToolbarButtonAttribute; - if (!drawoverscan) - err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); - else - err = ChangeWindowAttributes(gWindow, kWindowNoAttributes, attr); - - if (savewindowpos) - { - MoveWindow(gWindow, windowPos[kWindowScreen].h, windowPos[kWindowScreen].v, false); - - if ((windowSize[kWindowScreen].width <= 0) || (windowSize[kWindowScreen].height <= 0)) - { - windowExtend = true; - windowSize[kWindowScreen].width = 512; - windowSize[kWindowScreen].height = kMacWindowHeight; - } - - if (!lastoverscan && !windowExtend && drawoverscan) - { - windowExtend = true; - windowSize[kWindowScreen].height = (int) ((float) (windowSize[kWindowScreen].height + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); - } - - SizeWindow(gWindow, (short) windowSize[kWindowScreen].width, (short) windowSize[kWindowScreen].height, false); - } - else - { - if (drawoverscan) - windowExtend = true; - - SizeWindow(gWindow, 512, (windowExtend ? kMacWindowHeight : (SNES_HEIGHT << 1)), false); - RepositionWindow(gWindow, NULL, kWindowCenterOnMainScreen); - } - - windowZoomCount = 0; - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - - ActivateWindow(gWindow, true); -} - -void UpdateGameWindow (void) -{ - OSStatus err; - HIViewRef ctl; - HIViewID cid = { 'Pict', 0 }; - - if (!gWindow) - return; - - HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); - err = HIViewSetNeedsDisplay(ctl, true); -} - -static void ResizeGameWindow (void) -{ - Rect rct; - int ww, wh; - - if (!gWindow) - return; - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - - wh = (windowExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * ((windowZoomCount >> 1) + 1); - - if (windowZoomCount % 2) - ww = SNES_NTSC_OUT_WIDTH(SNES_WIDTH) * ((windowZoomCount >> 1) + 1) / 2; - else - ww = SNES_WIDTH * ((windowZoomCount >> 1) + 1); - - rct.right = rct.left + ww; - rct.bottom = rct.top + wh; - - SetWindowBounds(gWindow, kWindowContentRgn, &rct); - - printf("Window Size: %d, %d\n", ww, wh); - - windowZoomCount++; - if (windowZoomCount == 8) - windowZoomCount = 0; -} - -void DeinitGameWindow (void) -{ - OSStatus err; - - if (!gWindow) - return; - - SaveWindowPosition(gWindow, kWindowScreen); - lastoverscan = drawoverscan; - - err = RemoveEventHandler(gameWUPaneEventRef); - DisposeEventHandlerUPP(gameWUPaneUPP); - - err = RemoveEventHandler(gameWindowEventRef); - DisposeEventHandlerUPP(gameWindowUPP); - - CFRelease(gWindow); - gWindow = NULL; -} - -static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIRect rct; - Rect r; - UInt32 attr; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowDeactivated: - if (running) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - if (inactiveMode == 3) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - else - if (inactiveMode == 2) - { - rejectinput = true; - result = noErr; - } - } - } - - break; - - case kEventWindowActivated: - if (running) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - ForceChangingKeyScript(); - - if (inactiveMode == 2) - { - rejectinput = false; - result = noErr; - } - } - } - - break; - - case kEventWindowBoundsChanging: - windowResizeCount = 0x7FFFFFFF; - - err = GetEventParameter(inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof(UInt32), NULL, &attr); - if ((err == noErr) && (attr & kWindowBoundsChangeSizeChanged)) - { - err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &rct); - if (err == noErr) - { - if (GetCurrentEventKeyModifiers() & shiftKey) - { - HIRect origRct; - - err = GetEventParameter(inEvent, kEventParamOriginalBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &origRct); - if (err == noErr) - { - rct.size.width = (float) (int) (origRct.size.width * rct.size.height / origRct.size.height); - err = SetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, sizeof(HIRect), &rct); - } - } - - gWindowRect = rct; - } - } - - result = noErr; - break; - - case kEventWindowBoundsChanged: - windowResizeCount = 3; - result = noErr; - break; - - case kEventWindowZoom: - ResizeGameWindow(); - result = noErr; - break; - - case kEventWindowToolbarSwitchMode: - windowExtend = !windowExtend; - - GetWindowBounds(gWindow, kWindowContentRgn, &r); - - if (windowExtend) - r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); - else - r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT / SNES_HEIGHT_EXTENDED); - - SetWindowBounds(gWindow, kWindowContentRgn, &r); - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlClick: - if (running) - { - if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - if (!frzselecting) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - } - } - } - else - { - UInt32 count; - - err = GetEventParameter(inEvent, kEventParamClickCount, typeUInt32, NULL, sizeof(UInt32), NULL, &count); - if ((err == noErr) && (count == 2)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - result = noErr; - } - } - - break; - - case kEventControlDraw: - CGContextRef ctx; - HIViewRef view; - HIRect bounds; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - if (!running) - { - HIViewGetBounds(view, &bounds); - CGContextTranslateCTM(ctx, 0, bounds.size.height); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - DrawPauseScreen(ctx, bounds); - } - } - } - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static void InitRecentItems (void) -{ - CFStringRef keyRef, pathRef; - int count; - char key[32]; - - count = 0; - - for (int i = 0; i <= kRecentMenu_MAX; i++) - recentItem[i] = NULL; - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - sprintf(key, "RecentItem_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); - if (pathRef) - { - recentItem[count] = pathRef; - count++; - } - - CFRelease(keyRef); - } - } -} - -static void DeinitRecentItems (void) -{ - CFStringRef keyRef; - char key[32]; - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - sprintf(key, "RecentItem_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - if (recentItem[i]) - { - CFPreferencesSetAppValue(keyRef, recentItem[i], kCFPreferencesCurrentApplication); - CFRelease(recentItem[i]); - recentItem[i] = NULL; - } - else - CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -static void ClearRecentItems (void) -{ - for (int i = 0; i < kRecentMenu_MAX; i++) - { - if (recentItem[i]) - { - CFRelease(recentItem[i]); - recentItem[i] = NULL; - } - } -} - -void AddRecentItem (FSRef *ref) -{ - OSStatus err; - char path[PATH_MAX + 1]; - - err = FSRefMakePath(ref, (unsigned char *) path, PATH_MAX); - if (err == noErr) - { - CFStringRef pathRef; - - pathRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (pathRef) - { - int i, j; - - for (i = 0; i < kRecentMenu_MAX; i++) - if (recentItem[i] && (CFStringCompare(pathRef, recentItem[i], 0) == 0)) - break; - - if (i == kRecentMenu_MAX) - { - for (j = kRecentMenu_MAX - 1; j >= 0; j--) - recentItem[j + 1] = recentItem[j]; - - if (recentItem[kRecentMenu_MAX]) - { - CFRelease(recentItem[kRecentMenu_MAX]); - recentItem[kRecentMenu_MAX] = NULL; - } - - recentItem[0] = pathRef; - } - else - { - CFRelease(pathRef); - - if (i > 0) - { - CFStringRef temp; - - temp = recentItem[i]; - - for (j = i - 1; j >= 0; j--) - recentItem[j + 1] = recentItem[j]; - - recentItem[0] = temp; - } - } - } - } -} - -static void InitRecentMenu (void) -{ - OSStatus err; - - err = CreateNewMenu(mRecentItem, 0, &recentMenu); - err = SetMenuItemHierarchicalMenu(GetMenuRef(mFile), iOpenRecent, recentMenu); -} - -static void DeinitRecentMenu (void) -{ - CFRelease(recentMenu); -} - -void BuildRecentMenu (void) -{ - OSStatus err; - CFStringRef str; - - err = DeleteMenuItems(recentMenu, 1, CountMenuItems(recentMenu)); - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - if (!recentItem[i]) - break; - - Boolean r; - char path[PATH_MAX + 1]; - - r = CFStringGetCString(recentItem[i], path, PATH_MAX, kCFStringEncodingUTF8); - if (r) - { - CFStringRef nameRef; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - _splitpath(path, drive, dir, fname, ext); - snprintf(path, PATH_MAX + 1, "%s%s", fname, ext); - nameRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (nameRef) - { - err = AppendMenuItemTextWithCFString(recentMenu, nameRef, 0, 'FRe0' + i, NULL); - CFRelease(nameRef); - } - } - } - - err = AppendMenuItemTextWithCFString(recentMenu, NULL, kMenuItemAttrSeparator, 'FR__', NULL); - - str = CFCopyLocalizedString(CFSTR("ClearMenu"), "ClearMenu"); - if (str) - { - err = AppendMenuItemTextWithCFString(recentMenu, str, 0, 'FRcr', NULL); - CFRelease(str); - } -} - -void AdjustMenus (void) -{ - OSStatus err; - MenuRef menu; - CFStringRef str; - - if (running) - { - menu = GetMenuRef(mApple); - DisableMenuItem(menu, iAbout); - DisableMenuCommand(NULL, kHICommandPreferences); - DisableMenuCommand(NULL, kHICommandQuit); - - menu = GetMenuRef(mFile); - DisableMenuItem(menu, iOpen); - DisableMenuItem(menu, iOpenMulti); - DisableMenuItem(menu, iOpenRecent); - DisableMenuItem(menu, iRomInfo); - - menu = GetMenuRef(mControl); - DisableMenuItem(menu, iKeyboardLayout); - DisableMenuItem(menu, iISpLayout); - DisableMenuItem(menu, iAutoFire); - DisableMenuItem(menu, iISpPreset); - - menu = GetMenuRef(mEmulation); - str = CFCopyLocalizedString(CFSTR("PauseMenu"), "pause"); - err = SetMenuItemTextWithCFString(menu, iResume, str); - CFRelease(str); - DisableMenuItem(menu, iSoftReset); - DisableMenuItem(menu, iReset); - DisableMenuItem(menu, iDevice); - - if (Settings.NetPlay) - { - if (Settings.NetPlayServer) - EnableMenuItem(menu, iResume); - else - DisableMenuItem(menu, iResume); - } - else - EnableMenuItem(menu, iResume); - - menu = GetMenuRef(mCheat); - DisableMenuItem(menu, iApplyCheats); - DisableMenuItem(menu, iGameGenie); - DisableMenuItem(menu, iCheatFinder); - - menu = GetMenuRef(mOption); - DisableMenuItem(menu, iFreeze); - DisableMenuItem(menu, iDefrost); - DisableMenuItem(menu, iFreezeTo); - DisableMenuItem(menu, iDefrostFrom); - DisableMenuItem(menu, iRecordMovie); - DisableMenuItem(menu, iPlayMovie); - DisableMenuItem(menu, iQTMovie); - DisableMenuItem(menu, iSaveSPC); - DisableMenuItem(menu, iSaveSRAM); - DisableMenuItem(menu, iMusicBox); - if (ciFilterEnable) - EnableMenuItem(menu, iCIFilter); - else - DisableMenuItem(menu, iCIFilter); - - menu = GetMenuRef(mNetplay); - DisableMenuItem(menu, iServer); - DisableMenuItem(menu, iClient); - } - else - { - menu = GetMenuRef(mApple); - EnableMenuItem(menu, iAbout); - EnableMenuCommand(NULL, kHICommandPreferences); - EnableMenuCommand(NULL, kHICommandQuit); - - menu = GetMenuRef(mFile); - EnableMenuItem(menu, iOpen); - EnableMenuItem(menu, iOpenMulti); - EnableMenuItem(menu, iOpenRecent); - if (cartOpen) - EnableMenuItem(menu, iRomInfo); - else - DisableMenuItem(menu, iRomInfo); - - menu = GetMenuRef(mControl); - EnableMenuItem(menu, iKeyboardLayout); - EnableMenuItem(menu, iAutoFire); - if (hidExist) - { - EnableMenuItem(menu, iISpLayout); - EnableMenuItem(menu, iISpPreset); - } - else - { - DisableMenuItem(menu, iISpLayout); - DisableMenuItem(menu, iISpPreset); - } - - menu = GetMenuRef(mEmulation); - str = CFCopyLocalizedString(CFSTR("RunMenu"), "run"); - err = SetMenuItemTextWithCFString(menu, iResume, str); - CFRelease(str); - EnableMenuItem(menu, iDevice); - if (cartOpen) - { - EnableMenuItem(menu, iResume); - EnableMenuItem(menu, iSoftReset); - EnableMenuItem(menu, iReset); - } - else - { - DisableMenuItem(menu, iResume); - DisableMenuItem(menu, iSoftReset); - DisableMenuItem(menu, iReset); - } - - menu = GetMenuRef(mCheat); - if (cartOpen) - { - EnableMenuItem(menu, iApplyCheats); - EnableMenuItem(menu, iGameGenie); - EnableMenuItem(menu, iCheatFinder); - } - else - { - DisableMenuItem(menu, iApplyCheats); - DisableMenuItem(menu, iGameGenie); - DisableMenuItem(menu, iCheatFinder); - } - - menu = GetMenuRef(mOption); - DisableMenuItem(menu, iCIFilter); - if (cartOpen) - { - EnableMenuItem(menu, iFreeze); - EnableMenuItem(menu, iDefrost); - EnableMenuItem(menu, iFreezeTo); - EnableMenuItem(menu, iDefrostFrom); - EnableMenuItem(menu, iRecordMovie); - EnableMenuItem(menu, iPlayMovie); - EnableMenuItem(menu, iQTMovie); - EnableMenuItem(menu, iSaveSPC); - EnableMenuItem(menu, iSaveSRAM); - EnableMenuItem(menu, iMusicBox); - } - else - { - DisableMenuItem(menu, iFreeze); - DisableMenuItem(menu, iDefrost); - DisableMenuItem(menu, iFreezeTo); - DisableMenuItem(menu, iDefrostFrom); - DisableMenuItem(menu, iRecordMovie); - DisableMenuItem(menu, iPlayMovie); - DisableMenuItem(menu, iQTMovie); - DisableMenuItem(menu, iSaveSPC); - DisableMenuItem(menu, iSaveSRAM); - DisableMenuItem(menu, iMusicBox); - } - - menu = GetMenuRef(mNetplay); - EnableMenuItem(menu, iClient); - if (cartOpen) - EnableMenuItem(menu, iServer); - else - DisableMenuItem(menu, iServer); - } - - DrawMenuBar(); -} - -void UpdateMenuCommandStatus (Boolean closeMenu) -{ - if (closeMenu) - EnableMenuItem(GetMenuRef(mFile), iClose); - else - DisableMenuItem(GetMenuRef(mFile), iClose); -} - -static OSStatus HandleMenuChoice (UInt32 command, Boolean *done) -{ - OSStatus err, result = noErr; - MenuRef mh; - int item; - bool8 isok = true; - - if ((command & 0xFFFFFF00) == 'FRe\0') - { - Boolean r; - int index; - char path[PATH_MAX + 1]; - - index = (int) (command & 0x000000FF) - (int) '0'; - r = CFStringGetCString(recentItem[index], path, PATH_MAX, kCFStringEncodingUTF8); - if (r) - { - FSRef ref; - - err = FSPathMakeRef((unsigned char *) path, &ref, NULL); - if (err == noErr) - { - if (SNES9X_OpenCart(&ref)) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - } - } - } - else - { - switch (command) - { - case 'abou': // About SNES9X - StartCarbonModalDialog(); - AboutDialog(); - FinishCarbonModalDialog(); - - break; - - case 'pref': // Preferences... - StartCarbonModalDialog(); - ConfigurePreferences(); - FinishCarbonModalDialog(); - - break; - - case 'EXTR': // Extra Options... - StartCarbonModalDialog(); - ConfigureExtraOptions(); - FinishCarbonModalDialog(); - - break; - - case 'quit': // Quit SNES9X - SNES9X_Quit(); - *done = true; - - break; - - case 'open': // Open ROM Image... - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - - break; - - case 'Mult': // Open Multiple ROM Images... - if (SNES9X_OpenMultiCart()) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - - break; - - case 'FRcr': // Clear Menu - ClearRecentItems(); - BuildRecentMenu(); - - break; - - case 'Finf': // ROM Information - StartCarbonModalDialog(); - RomInfoDialog(); - FinishCarbonModalDialog(); - - break; - - case 'Ckey': // Configure Keyboard... - StartCarbonModalDialog(); - ConfigureKeyboard(); - FinishCarbonModalDialog(); - - break; - - case 'Cpad': // Configure Controllers... - StartCarbonModalDialog(); - ConfigureHID(); - FinishCarbonModalDialog(); - - break; - - case 'Caut': // Automatic Fire... - StartCarbonModalDialog(); - ConfigureAutofire(); - FinishCarbonModalDialog(); - - break; - - case 'Hapl': // Apply Cheat Entries - mh = GetMenuRef(mCheat); - applycheat = !applycheat; - CheckMenuItem(mh, iApplyCheats, applycheat); - Settings.ApplyCheats = applycheat; - - if (!Settings.ApplyCheats) - S9xCheatsDisable(); - else - S9xCheatsEnable(); - - break; - - case 'Hent': // Cheat Entry... - StartCarbonModalDialog(); - ConfigureCheat(); - FinishCarbonModalDialog(); - - break; - - case 'Hfnd': // Cheat Finder... - StartCarbonModalDialog(); - CheatFinder(); - FinishCarbonModalDialog(); - - break; - - case 'Erun': // Run - SNES9X_Go(); - *done = true; - - break; - - case 'Esrs': // Software Reset - SNES9X_SoftReset(); - SNES9X_Go(); - *done = true; - - break; - - case 'Erst': // Hardware Reset - SNES9X_Reset(); - SNES9X_Go(); - *done = true; - - break; - - case 'Ofrz': // Freeze State - isok = SNES9X_Freeze(); - *done = true; - - break; - - case 'Odfr': // Defrost state - isok = SNES9X_Defrost(); - *done = true; - - break; - - case 'Ofrd': // Freeze State to... - StartCarbonModalDialog(); - isok = SNES9X_FreezeTo(); - FinishCarbonModalDialog(); - - break; - - case 'Odfd': // Defrost State From... - StartCarbonModalDialog(); - isok = SNES9X_DefrostFrom(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'MVrc': // Record Movie... - StartCarbonModalDialog(); - isok = SNES9X_RecordMovie(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'MVpl': // Play Movie... - StartCarbonModalDialog(); - isok = SNES9X_PlayMovie(); - if (isok && (macPlayFlag & 0x2)) - { - running = false; - isok = SNES9X_QTMovieRecord(); - running = true; - } - - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'QTmv': // Record QuickTime Movie... - StartCarbonModalDialog(); - isok = SNES9X_QTMovieRecord(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'Ospc': // Save SPC File at Next Note-on - S9xDumpSPCSnapshot(); - - break; - - case 'Osrm': // Save SRAM Now - SNES9X_SaveSRAM(); - - break; - - case 'Ombx': // Music Box - StartCarbonModalDialog(); - MusicBoxDialog(); - FinishCarbonModalDialog(); - - break; - - case 'Nser': // Server... - bool8 sr; - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - - NPServerInit(); - - if (!NPServerStartServer(NP_PORT)) - { - NPServerStopServer(); - break; - } - - StartCarbonModalDialog(); - sr = NPServerDialog(); - FinishCarbonModalDialog(); - - if (sr) - { - SNES9X_Reset(); - SNES9X_Go(); - Settings.NetPlay = true; - Settings.NetPlayServer = true; - - *done = true; - } - else - NPServerStopServer(); - - break; - - case 'Ncli': // Client... - bool8 cr; - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - - NPClientInit(); - - StartCarbonModalDialog(); - cr = NPClientDialog(); - FinishCarbonModalDialog(); - - if (cr) - { - SNES9X_Go(); - Settings.NetPlay = true; - Settings.NetPlayServer = false; - - *done = true; - } - else - AdjustMenus(); - - break; - - case 'CPr1': // Controller Preset - case 'CPr2': - case 'CPr3': - case 'CPr4': - case 'CPr5': - item = (int) (command & 0x000000FF) - (int) '0'; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &mh); - CheckMenuItem(mh, padSetting, false); - padSetting = item; - CheckMenuItem(mh, padSetting, true); - ClearPadSetting(); - LoadControllerSettings(); - - break; - - case 'EIp1': // Input Device - case 'EIp2': - case 'EIp3': - case 'EIp4': - case 'EIp5': - case 'EIp6': - case 'EIp7': - case 'EIp8': - item = (int) (command & 0x000000FF) - (int) '0'; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &mh); - CheckMenuItem(mh, deviceSetting, false); - deviceSetting = item; - deviceSettingMaster = deviceSetting; - CheckMenuItem(mh, deviceSetting, true); - ChangeInputDevice(); - - break; - - default: - result = eventNotHandledErr; - break; - } - } - - return (result); -} - +// +//static OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// Boolean done = false; +// +// if (frzselecting) +// return (result); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand cmd; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr && cmd.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr) +// { +// UInt32 modifierkey; +// +// err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); +// if (err == noErr) +// { +// if ((cmd.commandID == 'pref') && (modifierkey & optionKey)) +// cmd.commandID = 'EXTR'; +// +// result = HandleMenuChoice(cmd.commandID, &done); +// +// if (done) +// QuitApplicationEventLoop(); +// } +// } +// +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +//static OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// +// if (frzselecting) +// return (result); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand cmd; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr && cmd.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr) +// { +// switch (cmd.commandID) +// { +// case 'Erun': // Pause +// case 'SubQ': // Queue from emulation thread +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// break; +// +// case 'Ocif': // Core Image Filter +// HiliteMenu(0); +// ConfigureCoreImageFilter(); +// result = noErr; +// break; +// } +// } +// +// break; +// } +// +// break; +// +// case kEventClassMouse: +// if (fullscreen) +// { +// if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventMouseUp: +// HIPoint hipt; +// +// err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); +// if (err == noErr) +// { +// if (CGRectContainsPoint(glScreenBounds, hipt)) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// +// break; +// } +// } +// } +// else +// if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventMouseMoved: +// case kEventMouseDragged: +// HIPoint hipt; +// +// err = GetEventParameter(inEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); +// if (err == noErr) +// { +// unlimitedCursor.x += hipt.x; +// unlimitedCursor.y += hipt.y; +// } +// +// break; +// } +// } +// } +// +// break; +// } +// +// return (result); +//} +// +//void PostQueueToSubEventLoop (void) +//{ +// OSStatus err; +// EventRef event; +// +// err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, 0, kEventAttributeUserEvent, &event); +// if (err == noErr) +// { +// HICommand cmd; +// +// cmd.commandID = 'SubQ'; +// cmd.attributes = kEventAttributeUserEvent; +// cmd.menu.menuRef = NULL; +// cmd.menu.menuItemIndex = 0; +// +// err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); +// if (err == noErr) +// err = PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard); +// +// ReleaseEvent(event); +// } +//} +// +//void InitGameWindow (void) +//{ +// OSStatus err; +// IBNibRef nibRef; +// WindowAttributes attr; +// CFStringRef ref; +// HIViewRef ctl; +// HIViewID cid = { 'Pict', 0 }; +// Rect rct; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// EventTypeSpec wupaneEvents[] = { { kEventClassControl, kEventControlClick }, +// { kEventClassControl, kEventControlDraw } }, +// windowEvents[] = { { kEventClassWindow, kEventWindowDeactivated }, +// { kEventClassWindow, kEventWindowActivated }, +// { kEventClassWindow, kEventWindowBoundsChanging }, +// { kEventClassWindow, kEventWindowBoundsChanged }, +// { kEventClassWindow, kEventWindowZoom }, +// { kEventClassWindow, kEventWindowToolbarSwitchMode } }; +// +// if (gWindow) +// return; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err) +// QuitWithFatalError(err, "os 02"); +// +// err = CreateWindowFromNib(nibRef, CFSTR("GameWindow"), &gWindow); +// if (err) +// QuitWithFatalError(err, "os 03"); +// +// DisposeNibReference(nibRef); +// +// HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); +// +// gameWindowUPP = NewEventHandlerUPP(GameWindowEventHandler); +// err = InstallWindowEventHandler(gWindow, gameWindowUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) gWindow, &gameWindowEventRef); +// +// gameWUPaneUPP = NewEventHandlerUPP(GameWindowUserPaneEventHandler); +// err = InstallControlEventHandler(ctl, gameWUPaneUPP, GetEventTypeCount(wupaneEvents), wupaneEvents, (void *) gWindow, &gameWUPaneEventRef); +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// ref = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// if (ref) +// { +// SetWindowTitleWithCFString(gWindow, ref); +// CFRelease(ref); +// } +// +// attr = kWindowFullZoomAttribute | kWindowResizableAttribute | kWindowLiveResizeAttribute; +// err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); +// +// attr = kWindowToolbarButtonAttribute; +// if (!drawoverscan) +// err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); +// else +// err = ChangeWindowAttributes(gWindow, kWindowNoAttributes, attr); +// +// if (savewindowpos) +// { +// MoveWindow(gWindow, windowPos[kWindowScreen].h, windowPos[kWindowScreen].v, false); +// +// if ((windowSize[kWindowScreen].width <= 0) || (windowSize[kWindowScreen].height <= 0)) +// { +// windowExtend = true; +// windowSize[kWindowScreen].width = 512; +// windowSize[kWindowScreen].height = kMacWindowHeight; +// } +// +// if (!lastoverscan && !windowExtend && drawoverscan) +// { +// windowExtend = true; +// windowSize[kWindowScreen].height = (int) ((float) (windowSize[kWindowScreen].height + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); +// } +// +// SizeWindow(gWindow, (short) windowSize[kWindowScreen].width, (short) windowSize[kWindowScreen].height, false); +// } +// else +// { +// if (drawoverscan) +// windowExtend = true; +// +// SizeWindow(gWindow, 512, (windowExtend ? kMacWindowHeight : (SNES_HEIGHT << 1)), false); +// RepositionWindow(gWindow, NULL, kWindowCenterOnMainScreen); +// } +// +// windowZoomCount = 0; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &rct); +// gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); +// +// ActivateWindow(gWindow, true); +//} +// +//void UpdateGameWindow (void) +//{ +// OSStatus err; +// HIViewRef ctl; +// HIViewID cid = { 'Pict', 0 }; +// +// if (!gWindow) +// return; +// +// HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); +// err = HIViewSetNeedsDisplay(ctl, true); +//} +// +//static void ResizeGameWindow (void) +//{ +// Rect rct; +// int ww, wh; +// +// if (!gWindow) +// return; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &rct); +// +// wh = (windowExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * ((windowZoomCount >> 1) + 1); +// +// if (windowZoomCount % 2) +// ww = SNES_NTSC_OUT_WIDTH(SNES_WIDTH) * ((windowZoomCount >> 1) + 1) / 2; +// else +// ww = SNES_WIDTH * ((windowZoomCount >> 1) + 1); +// +// rct.right = rct.left + ww; +// rct.bottom = rct.top + wh; +// +// SetWindowBounds(gWindow, kWindowContentRgn, &rct); +// +// printf("Window Size: %d, %d\n", ww, wh); +// +// windowZoomCount++; +// if (windowZoomCount == 8) +// windowZoomCount = 0; +//} +// +//void DeinitGameWindow (void) +//{ +// OSStatus err; +// +// if (!gWindow) +// return; +// +// SaveWindowPosition(gWindow, kWindowScreen); +// lastoverscan = drawoverscan; +// +// err = RemoveEventHandler(gameWUPaneEventRef); +// DisposeEventHandlerUPP(gameWUPaneUPP); +// +// err = RemoveEventHandler(gameWindowEventRef); +// DisposeEventHandlerUPP(gameWindowUPP); +// +// CFRelease(gWindow); +// gWindow = NULL; +//} +// +//static OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// HIRect rct; +// Rect r; +// UInt32 attr; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowDeactivated: +// if (running) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// if (inactiveMode == 3) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// else +// if (inactiveMode == 2) +// { +// rejectinput = true; +// result = noErr; +// } +// } +// } +// +// break; +// +// case kEventWindowActivated: +// if (running) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// ForceChangingKeyScript(); +// +// if (inactiveMode == 2) +// { +// rejectinput = false; +// result = noErr; +// } +// } +// } +// +// break; +// +// case kEventWindowBoundsChanging: +// windowResizeCount = 0x7FFFFFFF; +// +// err = GetEventParameter(inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof(UInt32), NULL, &attr); +// if ((err == noErr) && (attr & kWindowBoundsChangeSizeChanged)) +// { +// err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &rct); +// if (err == noErr) +// { +// if (GetCurrentEventKeyModifiers() & shiftKey) +// { +// HIRect origRct; +// +// err = GetEventParameter(inEvent, kEventParamOriginalBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &origRct); +// if (err == noErr) +// { +// rct.size.width = (float) (int) (origRct.size.width * rct.size.height / origRct.size.height); +// err = SetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, sizeof(HIRect), &rct); +// } +// } +// +// gWindowRect = rct; +// } +// } +// +// result = noErr; +// break; +// +// case kEventWindowBoundsChanged: +// windowResizeCount = 3; +// result = noErr; +// break; +// +// case kEventWindowZoom: +// ResizeGameWindow(); +// result = noErr; +// break; +// +// case kEventWindowToolbarSwitchMode: +// windowExtend = !windowExtend; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &r); +// +// if (windowExtend) +// r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); +// else +// r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT / SNES_HEIGHT_EXTENDED); +// +// SetWindowBounds(gWindow, kWindowContentRgn, &r); +// +// result = noErr; +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +//static OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassControl: +// switch (GetEventKind(inEvent)) +// { +// case kEventControlClick: +// if (running) +// { +// if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// if (!frzselecting) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// } +// } +// else +// { +// UInt32 count; +// +// err = GetEventParameter(inEvent, kEventParamClickCount, typeUInt32, NULL, sizeof(UInt32), NULL, &count); +// if ((err == noErr) && (count == 2)) +// { +// SNES9X_Go(); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// +// break; +// +// case kEventControlDraw: +// CGContextRef ctx; +// HIViewRef view; +// HIRect bounds; +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); +// if (err == noErr) +// { +// if (!running) +// { +// HIViewGetBounds(view, &bounds); +// CGContextTranslateCTM(ctx, 0, bounds.size.height); +// CGContextScaleCTM(ctx, 1.0f, -1.0f); +// DrawPauseScreen(ctx, bounds); +// } +// } +// } +// +// result = noErr; +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +// +//static void InitRecentMenu (void) +//{ +// OSStatus err; +// +// err = CreateNewMenu(mRecentItem, 0, &recentMenu); +// err = SetMenuItemHierarchicalMenu(GetMenuRef(mFile), iOpenRecent, recentMenu); +//} +// +//static void DeinitRecentMenu (void) +//{ +// CFRelease(recentMenu); +//} +// +//void BuildRecentMenu (void) +//{ +// OSStatus err; +// CFStringRef str; +// +// err = DeleteMenuItems(recentMenu, 1, CountMenuItems(recentMenu)); +// +// for (int i = 0; i < kRecentMenu_MAX; i++) +// { +// if (!recentItem[i]) +// break; +// +// Boolean r; +// char path[PATH_MAX + 1]; +// +// r = CFStringGetCString(recentItem[i], path, PATH_MAX, kCFStringEncodingUTF8); +// if (r) +// { +// CFStringRef nameRef; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +// _splitpath(path, drive, dir, fname, ext); +// snprintf(path, PATH_MAX + 1, "%s%s", fname, ext); +// nameRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); +// if (nameRef) +// { +// err = AppendMenuItemTextWithCFString(recentMenu, nameRef, 0, 'FRe0' + i, NULL); +// CFRelease(nameRef); +// } +// } +// } +// +// err = AppendMenuItemTextWithCFString(recentMenu, NULL, kMenuItemAttrSeparator, 'FR__', NULL); +// +// str = CFCopyLocalizedString(CFSTR("ClearMenu"), "ClearMenu"); +// if (str) +// { +// err = AppendMenuItemTextWithCFString(recentMenu, str, 0, 'FRcr', NULL); +// CFRelease(str); +// } +//} +// +//void AdjustMenus (void) +//{ +// OSStatus err; +// MenuRef menu; +// CFStringRef str; +// +// if (running) +// { +// menu = GetMenuRef(mApple); +// DisableMenuItem(menu, iAbout); +// DisableMenuCommand(NULL, kHICommandPreferences); +// DisableMenuCommand(NULL, kHICommandQuit); +// +// menu = GetMenuRef(mFile); +// DisableMenuItem(menu, iOpen); +// DisableMenuItem(menu, iOpenMulti); +// DisableMenuItem(menu, iOpenRecent); +// DisableMenuItem(menu, iRomInfo); +// +// menu = GetMenuRef(mControl); +// DisableMenuItem(menu, iKeyboardLayout); +// DisableMenuItem(menu, iISpLayout); +// DisableMenuItem(menu, iAutoFire); +// DisableMenuItem(menu, iISpPreset); +// +// menu = GetMenuRef(mEmulation); +// str = CFCopyLocalizedString(CFSTR("PauseMenu"), "pause"); +// err = SetMenuItemTextWithCFString(menu, iResume, str); +// CFRelease(str); +// DisableMenuItem(menu, iSoftReset); +// DisableMenuItem(menu, iReset); +// DisableMenuItem(menu, iDevice); +// +// if (Settings.NetPlay) +// { +// if (Settings.NetPlayServer) +// EnableMenuItem(menu, iResume); +// else +// DisableMenuItem(menu, iResume); +// } +// else +// EnableMenuItem(menu, iResume); +// +// menu = GetMenuRef(mCheat); +// DisableMenuItem(menu, iApplyCheats); +// DisableMenuItem(menu, iGameGenie); +// DisableMenuItem(menu, iCheatFinder); +// +// menu = GetMenuRef(mOption); +// DisableMenuItem(menu, iFreeze); +// DisableMenuItem(menu, iDefrost); +// DisableMenuItem(menu, iFreezeTo); +// DisableMenuItem(menu, iDefrostFrom); +// DisableMenuItem(menu, iRecordMovie); +// DisableMenuItem(menu, iPlayMovie); +// DisableMenuItem(menu, iQTMovie); +// DisableMenuItem(menu, iSaveSPC); +// DisableMenuItem(menu, iSaveSRAM); +// DisableMenuItem(menu, iMusicBox); +// if (ciFilterEnable) +// EnableMenuItem(menu, iCIFilter); +// else +// DisableMenuItem(menu, iCIFilter); +// +// menu = GetMenuRef(mNetplay); +// DisableMenuItem(menu, iServer); +// DisableMenuItem(menu, iClient); +// } +// else +// { +// menu = GetMenuRef(mApple); +// EnableMenuItem(menu, iAbout); +// EnableMenuCommand(NULL, kHICommandPreferences); +// EnableMenuCommand(NULL, kHICommandQuit); +// +// menu = GetMenuRef(mFile); +// EnableMenuItem(menu, iOpen); +// EnableMenuItem(menu, iOpenMulti); +// EnableMenuItem(menu, iOpenRecent); +// if (cartOpen) +// EnableMenuItem(menu, iRomInfo); +// else +// DisableMenuItem(menu, iRomInfo); +// +// menu = GetMenuRef(mControl); +// EnableMenuItem(menu, iKeyboardLayout); +// EnableMenuItem(menu, iAutoFire); +// +// menu = GetMenuRef(mEmulation); +// str = CFCopyLocalizedString(CFSTR("RunMenu"), "run"); +// err = SetMenuItemTextWithCFString(menu, iResume, str); +// CFRelease(str); +// EnableMenuItem(menu, iDevice); +// if (cartOpen) +// { +// EnableMenuItem(menu, iResume); +// EnableMenuItem(menu, iSoftReset); +// EnableMenuItem(menu, iReset); +// } +// else +// { +// DisableMenuItem(menu, iResume); +// DisableMenuItem(menu, iSoftReset); +// DisableMenuItem(menu, iReset); +// } +// +// menu = GetMenuRef(mCheat); +// if (cartOpen) +// { +// EnableMenuItem(menu, iApplyCheats); +// EnableMenuItem(menu, iGameGenie); +// EnableMenuItem(menu, iCheatFinder); +// } +// else +// { +// DisableMenuItem(menu, iApplyCheats); +// DisableMenuItem(menu, iGameGenie); +// DisableMenuItem(menu, iCheatFinder); +// } +// +// menu = GetMenuRef(mOption); +// DisableMenuItem(menu, iCIFilter); +// if (cartOpen) +// { +// EnableMenuItem(menu, iFreeze); +// EnableMenuItem(menu, iDefrost); +// EnableMenuItem(menu, iFreezeTo); +// EnableMenuItem(menu, iDefrostFrom); +// EnableMenuItem(menu, iRecordMovie); +// EnableMenuItem(menu, iPlayMovie); +// EnableMenuItem(menu, iQTMovie); +// EnableMenuItem(menu, iSaveSPC); +// EnableMenuItem(menu, iSaveSRAM); +// EnableMenuItem(menu, iMusicBox); +// } +// else +// { +// DisableMenuItem(menu, iFreeze); +// DisableMenuItem(menu, iDefrost); +// DisableMenuItem(menu, iFreezeTo); +// DisableMenuItem(menu, iDefrostFrom); +// DisableMenuItem(menu, iRecordMovie); +// DisableMenuItem(menu, iPlayMovie); +// DisableMenuItem(menu, iQTMovie); +// DisableMenuItem(menu, iSaveSPC); +// DisableMenuItem(menu, iSaveSRAM); +// DisableMenuItem(menu, iMusicBox); +// } +// +// menu = GetMenuRef(mNetplay); +// EnableMenuItem(menu, iClient); +// if (cartOpen) +// EnableMenuItem(menu, iServer); +// else +// DisableMenuItem(menu, iServer); +// } +// +// DrawMenuBar(); +//} +// +//void UpdateMenuCommandStatus (Boolean closeMenu) +//{ +// if (closeMenu) +// EnableMenuItem(GetMenuRef(mFile), iClose); +// else +// DisableMenuItem(GetMenuRef(mFile), iClose); +//} +// +//static OSStatus HandleMenuChoice (UInt32 command, Boolean *done) +//{ +// OSStatus err, result = noErr; +// MenuRef mh; +// int item; +// bool8 isok = true; +// +// if ((command & 0xFFFFFF00) == 'FRe\0') +// { +// Boolean r; +// int index; +// char path[PATH_MAX + 1]; +// +// index = (int) (command & 0x000000FF) - (int) '0'; +// r = CFStringGetCString(recentItem[index], path, PATH_MAX, kCFStringEncodingUTF8); +// if (r) +// { +// FSRef ref; +// +// err = FSPathMakeRef((unsigned char *) path, &ref, NULL); +// if (err == noErr) +// { +// if (SNES9X_OpenCart(&ref)) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// } +// } +// } +// else +// { +// switch (command) +// { +// case 'abou': // About SNES9X +// StartCarbonModalDialog(); +// AboutDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'pref': // Preferences... +// StartCarbonModalDialog(); +// ConfigurePreferences(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'EXTR': // Extra Options... +// StartCarbonModalDialog(); +// ConfigureExtraOptions(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'quit': // Quit SNES9X +// SNES9X_Quit(); +// *done = true; +// +// break; +// +// case 'open': // Open ROM Image... +// if (SNES9X_OpenCart(NULL)) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'Mult': // Open Multiple ROM Images... +// if (SNES9X_OpenMultiCart()) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'FRcr': // Clear Menu +// ClearRecentItems(); +// BuildRecentMenu(); +// +// break; +// +// case 'Finf': // ROM Information +// StartCarbonModalDialog(); +// RomInfoDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Ckey': // Configure Keyboard... +// StartCarbonModalDialog(); +// ConfigureKeyboard(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Cpad': // Configure Controllers... +// StartCarbonModalDialog(); +// ConfigureHID(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Caut': // Automatic Fire... +// StartCarbonModalDialog(); +// ConfigureAutofire(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Hapl': // Apply Cheat Entries +// mh = GetMenuRef(mCheat); +// applycheat = !applycheat; +// CheckMenuItem(mh, iApplyCheats, applycheat); +// Settings.ApplyCheats = applycheat; +// +// if (!Settings.ApplyCheats) +// S9xCheatsDisable(); +// else +// S9xCheatsEnable(); +// +// break; +// +// case 'Hent': // Cheat Entry... +// StartCarbonModalDialog(); +// ConfigureCheat(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Hfnd': // Cheat Finder... +// StartCarbonModalDialog(); +// CheatFinder(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Erun': // Run +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Esrs': // Software Reset +// SNES9X_SoftReset(); +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Erst': // Hardware Reset +// SNES9X_Reset(); +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Ofrz': // Freeze State +// isok = SNES9X_Freeze(); +// *done = true; +// +// break; +// +// case 'Odfr': // Defrost state +// isok = SNES9X_Defrost(); +// *done = true; +// +// break; +// +// case 'Ofrd': // Freeze State to... +// StartCarbonModalDialog(); +// isok = SNES9X_FreezeTo(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Odfd': // Defrost State From... +// StartCarbonModalDialog(); +// isok = SNES9X_DefrostFrom(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'MVrc': // Record Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_RecordMovie(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'MVpl': // Play Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_PlayMovie(); +// if (isok && (macPlayFlag & 0x2)) +// { +// running = false; +// isok = SNES9X_QTMovieRecord(); +// running = true; +// } +// +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'QTmv': // Record QuickTime Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_QTMovieRecord(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'Ospc': // Save SPC File at Next Note-on +// S9xDumpSPCSnapshot(); +// +// break; +// +// case 'Osrm': // Save SRAM Now +// SNES9X_SaveSRAM(); +// +// break; +// +// case 'Ombx': // Music Box +// StartCarbonModalDialog(); +// MusicBoxDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Nser': // Server... +// bool8 sr; +// +// Settings.NetPlay = false; +// Settings.NetPlayServer = false; +// +// NPServerInit(); +// +// if (!NPServerStartServer(NP_PORT)) +// { +// NPServerStopServer(); +// break; +// } +// +// StartCarbonModalDialog(); +// sr = NPServerDialog(); +// FinishCarbonModalDialog(); +// +// if (sr) +// { +// SNES9X_Reset(); +// SNES9X_Go(); +// Settings.NetPlay = true; +// Settings.NetPlayServer = true; +// +// *done = true; +// } +// else +// NPServerStopServer(); +// +// break; +// +// case 'Ncli': // Client... +// bool8 cr; +// +// Settings.NetPlay = false; +// Settings.NetPlayServer = false; +// +// NPClientInit(); +// +// StartCarbonModalDialog(); +// cr = NPClientDialog(); +// FinishCarbonModalDialog(); +// +// if (cr) +// { +// SNES9X_Go(); +// Settings.NetPlay = true; +// Settings.NetPlayServer = false; +// +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'CPr1': // Controller Preset +// case 'CPr2': +// case 'CPr3': +// case 'CPr4': +// case 'CPr5': +// item = (int) (command & 0x000000FF) - (int) '0'; +// err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &mh); +// CheckMenuItem(mh, padSetting, false); +// padSetting = item; +// CheckMenuItem(mh, padSetting, true); +// ClearPadSetting(); +// LoadControllerSettings(); +// +// break; +// +// case 'EIp1': // Input Device +// case 'EIp2': +// case 'EIp3': +// case 'EIp4': +// case 'EIp5': +// case 'EIp6': +// case 'EIp7': +// case 'EIp8': +// item = (int) (command & 0x000000FF) - (int) '0'; +// err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &mh); +// CheckMenuItem(mh, deviceSetting, false); +// deviceSetting = item; +// deviceSettingMaster = deviceSetting; +// CheckMenuItem(mh, deviceSetting, true); +// ChangeInputDevice(); +// +// break; +// +// default: +// result = eventNotHandledErr; +// break; +// } +// } +// +// return (result); +//} +// void ChangeInputDevice (void) { - switch (deviceSetting) - { - case iPad: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); - macControllerOption = SNES_JOYPAD; - break; + switch (deviceSetting) + { + case Gamepads: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); + macControllerOption = SNES_JOYPAD; + useMouse = false; + break; - case iMouse: - S9xSetController(0, CTL_MOUSE, 0, 0, 0, 0); - S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); - macControllerOption = SNES_MOUSE; - break; + case Mouse: + S9xSetController(0, CTL_MOUSE, 0, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); + macControllerOption = SNES_MOUSE; + useMouse = true; + break; - case iMouse2: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_MOUSE, 1, 0, 0, 0); - macControllerOption = SNES_MOUSE_SWAPPED; - break; + case Mouse2: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_MOUSE, 1, 0, 0, 0); + macControllerOption = SNES_MOUSE_SWAPPED; + useMouse = true; + break; - case iSuperScope: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_SUPERSCOPE, 0, 0, 0, 0); - macControllerOption = SNES_SUPERSCOPE; - break; + case SuperScope: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_SUPERSCOPE, 0, 0, 0, 0); + macControllerOption = SNES_SUPERSCOPE; + useMouse = true; + break; - case iMultiPlayer5: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_MP5, 1, 2, 3, 4); - macControllerOption = SNES_MULTIPLAYER5; - break; + case MultiTap: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_MP5, 1, 2, 3, 4); + macControllerOption = SNES_MULTIPLAYER5; + useMouse = false; + break; - case iMultiPlayer5_2: - S9xSetController(0, CTL_MP5, 0, 1, 2, 3); - S9xSetController(1, CTL_MP5, 4, 5, 6, 7); - macControllerOption = SNES_MULTIPLAYER5_2; - break; + case DoubleMultiTap: + S9xSetController(0, CTL_MP5, 0, 1, 2, 3); + S9xSetController(1, CTL_MP5, 4, 5, 6, 7); + macControllerOption = SNES_MULTIPLAYER5_2; + useMouse = false; + break; - case iJustifier1: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JUSTIFIER, 0, 0, 0, 0); - macControllerOption = SNES_JUSTIFIER; - break; + case Justifier1: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JUSTIFIER, 0, 0, 0, 0); + macControllerOption = SNES_JUSTIFIER; + useMouse = true; + break; - case iJustifier2: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JUSTIFIER, 1, 0, 0, 0); - macControllerOption = SNES_JUSTIFIER_2; - break; - } + case Justifier2: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JUSTIFIER, 1, 0, 0, 0); + macControllerOption = SNES_JUSTIFIER_2; + useMouse = true; + break; + } + + [inputDelegate deviceSettingChanged:deviceSetting]; } void ApplyNSRTHeaderControllers (void) { - OSStatus err; - MenuRef menu; + uint32 valid = 0; + deviceSetting = deviceSettingMaster; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &menu); - if (err) - return; + if (!strncmp((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) + { + switch (Memory.NSRTHeader[29]) + { + case 0x00: // Everything goes + deviceSetting = Gamepads; + valid = (1 << Gamepads); + break; - for (int i = 1; i <= CountMenuItems(menu); i++) - { - CheckMenuItem(menu, i, false); - SetItemStyle(menu, i, normal); - } + case 0x10: // Mouse in Port 0 + deviceSetting = Mouse; + valid = (1 << Mouse); + break; - deviceSetting = deviceSettingMaster; + case 0x01: // Mouse in Port 1 + deviceSetting = Mouse2; + valid = (1 << Mouse2); + break; - uint32 valid = 0; + case 0x03: // Super Scope in Port 1 + deviceSetting = SuperScope; + valid = (1 << SuperScope); + break; - if (!strncmp((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) - { - switch (Memory.NSRTHeader[29]) - { - case 0x00: // Everything goes - deviceSetting = iPad; - valid = (1 << iPad); - break; + case 0x06: // Multitap in Port 1 + deviceSetting = MultiTap; + valid = (1 << Gamepads) | (1 << MultiTap); + break; - case 0x10: // Mouse in Port 0 - deviceSetting = iMouse; - valid = (1 << iMouse); - break; + case 0x66: // Multitap in Ports 0 and 1 + deviceSetting = DoubleMultiTap; + valid = (1 << Gamepads) | (1 << MultiTap) | (1 << DoubleMultiTap); + break; - case 0x01: // Mouse in Port 1 - deviceSetting = iMouse2; - valid = (1 << iMouse2); - break; + case 0x08: // Multitap in Port 1, Mouse in new Port 1 + deviceSetting = Mouse; + valid = (1 << Gamepads) | (1 << Mouse2) | (1 << MultiTap); + break; - case 0x03: // Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iSuperScope); - break; + case 0x04: // Pad or Super Scope in Port 1 + deviceSetting = SuperScope; + valid = (1 << Gamepads) | (1 << SuperScope); + break; - case 0x06: // Multitap in Port 1 - deviceSetting = iMultiPlayer5; - valid = (1 << iPad) | (1 << iMultiPlayer5); - break; + case 0x05: // Justifier - Must ask user... + deviceSetting = Justifier1; + valid = (1 << Justifier1) | (1 << Justifier2); + break; - case 0x66: // Multitap in Ports 0 and 1 - deviceSetting = iMultiPlayer5_2; - valid = (1 << iPad) | (1 << iMultiPlayer5) | (1 << iMultiPlayer5_2); - break; + case 0x20: // Pad or Mouse in Port 0 + deviceSetting = Mouse; + valid = (1 << Gamepads) | (1 << Mouse); + break; - case 0x08: // Multitap in Port 1, Mouse in new Port 1 - deviceSetting = iMouse2; - valid = (1 << iPad) | (1 << iMouse2) | (1 << iMultiPlayer5); - break; + case 0x22: // Pad or Mouse in Port 0 & 1 + deviceSetting = Mouse; + valid = (1 << Gamepads) | (1 << Mouse) | (1 << Mouse2); + break; - case 0x04: // Pad or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iSuperScope); - break; + case 0x24: // Pad or Mouse in Port 0, Pad or Super Scope in Port 1 + deviceSetting = SuperScope; + valid = (1 << Gamepads) | (1 << Mouse) | (1 << SuperScope); + break; - case 0x05: // Justifier - Must ask user... - deviceSetting = iJustifier1; - valid = (1 << iJustifier1) | (1 << iJustifier2); - break; + case 0x27: // Pad or Mouse in Port 0, Pad or Mouse or Super Scope in Port 1 + deviceSetting = SuperScope; + valid = (1 << Gamepads) | (1 << Mouse) | (1 << Mouse2) | (1 << SuperScope); + break; - case 0x20: // Pad or Mouse in Port 0 - deviceSetting = iMouse; - valid = (1 << iPad) | (1 << iMouse); - break; + case 0x99: // Lasabirdie + break; - case 0x22: // Pad or Mouse in Port 0 & 1 - deviceSetting = iMouse; - valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2); - break; + case 0x0A: // Barcode Battler + break; - case 0x24: // Pad or Mouse in Port 0, Pad or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iMouse) | (1 << iSuperScope); - break; + default: + break; + } + } - case 0x27: // Pad or Mouse in Port 0, Pad or Mouse or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2) | (1 << iSuperScope); - break; + ChangeInputDevice(); +} - case 0x99: // Lasabirdie - break; +void DrawString(CGContextRef ctx, NSString *string, CGFloat size, CGFloat x, CGFloat y) +{ + NSAttributedString *astr = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: [NSFont fontWithName:@"Helvetica" size:size], NSForegroundColorAttributeName: NSColor.whiteColor}]; - case 0x0A: // Barcode Battler - break; + CTLineRef line = CTLineCreateWithAttributedString((__bridge CFAttributedStringRef)astr); + CGFloat ascent = 0.0; + CGFloat descent = 0.0; + CGFloat leading = 0.0; + CTLineGetTypographicBounds(line, &ascent, &descent, &leading); - default: - break; - } - } - - CheckMenuItem(menu, deviceSetting, true); - - for (int i = 1; i <= CountMenuItems(menu); i++) - { - if (valid & (1 << i)) - SetItemStyle(menu, i, underline); - } - - ChangeInputDevice(); + // Draw the text in the new CoreGraphics Context + CGContextSetTextPosition(ctx, x, y + descent); + CTLineDraw(line, ctx); + CFRelease(line); } int PromptFreezeDefrost (Boolean freezing) { - OSStatus err; - CGContextRef ctx; - CGColorSpaceRef color; - CGDataProviderRef prov; - CGImageRef image; - CGRect rct; - CGPoint pt; - CFURLRef url; - FSCatalogInfo info; - FSRef ref; - KeyMap keys; - UInt64 newestDate, currentDate; - UInt32 startTime; - float x, y, textw; - int result, newestIndex, current_selection, oldInactiveMode; - char dateC[256]; - uint8 *back, *draw; + OSStatus err; + CGContextRef ctx; + CGColorSpaceRef color; + CGDataProviderRef prov; + CGImageRef image; + CGRect rct; + CFURLRef url; + FSCatalogInfo info; + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + CFAbsoluteTime newestDate, currentDate; + int64 startTime; + float x, y; + int result, newestIndex, current_selection, oldInactiveMode; + char dateC[256]; + uint8 *back, *draw; - const UInt32 repeatDelay = 10; - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; - const char letters[] = "123456789ABC", *filename; - const uint8 keyCheck[] = { kmEscKey, km1Key, km2Key, km3Key, km4Key, km5Key, km6Key, km7Key, km8Key, km9Key, kmAKey, kmBKey, kmCKey }; + const UInt32 repeatDelay = 200000; + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; + const char letters[] = "123456789ABC", *filename; - if (!directDisplay) - { - S9xInitDisplay(NULL, NULL); - SNES9X_Go(); - } + frzselecting = true; + [s9xView updatePauseOverlay]; + oldInactiveMode = inactiveMode; + if (inactiveMode == 3) + inactiveMode = 2; - frzselecting = true; - oldInactiveMode = inactiveMode; - if (inactiveMode == 3) - inactiveMode = 2; + S9xSetSoundMute(true); - S9xSetSoundMute(true); + back = (uint8 *) malloc(w * h * 2); + draw = (uint8 *) malloc(w * h * 2); + if (!back || !draw) + QuitWithFatalError(@"os 04"); - back = (uint8 *) malloc(w * h * 2); - draw = (uint8 *) malloc(w * h * 2); - if (!back || !draw) - QuitWithFatalError(0, "os 04"); + color = CGColorSpaceCreateDeviceRGB(); + if (!color) + QuitWithFatalError(@"os 05"); - color = CGColorSpaceCreateDeviceRGB(); - if (!color) - QuitWithFatalError(0, "os 05"); + ctx = CGBitmapContextCreate(back, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host); + if (!ctx) + QuitWithFatalError(@"os 06"); - ctx = CGBitmapContextCreate(back, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0)); - if (!ctx) - QuitWithFatalError(0, "os 06"); + rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); + CGContextClearRect(ctx, rct); - rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); - CGContextClearRect(ctx, rct); + image = NULL; + CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.snes9x.macos.snes9x-framework")); - image = NULL; + if (freezing) + url = CFBundleCopyResourceURL(bundle, CFSTR("logo_freeze"), CFSTR("png"), NULL); + else + url = CFBundleCopyResourceURL(bundle, CFSTR("logo_defrost"), CFSTR("png"), NULL); + if (url) + { + prov = CGDataProviderCreateWithURL(url); + if (prov) + { + image = CGImageCreateWithPNGDataProvider(prov, NULL, true, kCGRenderingIntentDefault); + CGDataProviderRelease(prov); + } - if (freezing) - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("logo_freeze"), CFSTR("png"), NULL); - else - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("logo_defrost"), CFSTR("png"), NULL); - if (url) - { - prov = CGDataProviderCreateWithURL(url); - if (prov) - { - image = CGImageCreateWithPNGDataProvider(prov, NULL, true, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } + CFRelease(url); + } - CFRelease(url); - } + if (image) + { + rct = CGRectMake(0.0f, (float) h - 88.0f, w, 88.0f); + CGContextDrawImage(ctx, rct, image); + CGImageRelease(image); + } - if (image) - { - rct = CGRectMake(0.0f, (float) h - 118.0f, 512.0f, 118.0f); - CGContextDrawImage(ctx, rct, image); - CGImageRelease(image); - } + newestDate = 0; + newestIndex = -1; - newestDate = 0; - newestIndex = -1; + CGContextSetLineJoin(ctx, kCGLineJoinRound); - CGContextSetLineJoin(ctx, kCGLineJoinRound); + rct = CGRectMake(0.0f, (float) h - 208.0f, 128.0f, 120.0f); - rct = CGRectMake(0.0f, (float) h - 238.0f, 128.0f, 120.0f); + for (int count = 0; count < 12; count++) + { + url = nil; + filename = S9xGetFreezeFilename(count); + CFStringRef cfFilename = CFStringCreateWithCString(kCFAllocatorDefault, filename, kCFStringEncodingUTF8); - for (int count = 0; count < 12; count++) - { - filename = S9xGetFreezeFilename(count); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (err == noErr) - { - err = FSGetCatalogInfo(&ref, kFSCatInfoContentMod, &info, NULL, NULL, NULL); - currentDate = (((UInt64) info.contentModDate.highSeconds << 48) | ((UInt64) info.contentModDate.lowSeconds << 16) | (UInt64) info.contentModDate.fraction); + if (cfFilename != NULL) + { + url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfFilename, kCFURLPOSIXPathStyle, false); + CFRelease(cfFilename); + } - if (currentDate > newestDate) - { - newestIndex = count; - newestDate = currentDate; - } + if (url != NULL) + { + CFDateRef date = NULL; + if (CFURLCopyResourcePropertyForKey(url, kCFURLAttributeModificationDateKey, &date, NULL)) + { + currentDate = CFDateGetAbsoluteTime(date); + CFRelease(date); + } + else + { + currentDate = DBL_MIN; + } - DrawThumbnailResource(&ref, ctx, rct); + if (currentDate > newestDate) + { + newestIndex = count; + newestDate = currentDate; + } - CGContextSetShouldAntialias(ctx, false); - CGContextSetLineWidth(ctx, 1.0f); + DrawThumbnailFromExtendedAttribute(filename, ctx, rct); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - x = rct.origin.x + 127.0f; - y = rct.origin.y + 119.0f; - CGContextBeginPath(ctx); - CGContextMoveToPoint(ctx, x, y); - CGContextAddLineToPoint(ctx, x, y - 119.0f); - CGContextAddLineToPoint(ctx, x - 127.0f, y - 119.0f); - CGContextStrokePath(ctx); + CGContextSetShouldAntialias(ctx, false); + CGContextSetLineWidth(ctx, 1.0f); - CGContextSetShouldAntialias(ctx, true); - CGContextSetLineWidth(ctx, 3.0f); + CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + x = rct.origin.x + 127.0f; + y = rct.origin.y + 119.0f; + CGContextBeginPath(ctx); + CGContextMoveToPoint(ctx, x, y); + CGContextAddLineToPoint(ctx, x, y - 119.0f); + CGContextAddLineToPoint(ctx, x - 127.0f, y - 119.0f); + CGContextStrokePath(ctx); - CGContextSelectFont(ctx, "Helvetica", 12.0f, kCGEncodingMacRoman); - x = rct.origin.x + 5.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextStroke); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 0.8f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 1.0f, 0.7f, 0.7f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); + CGContextSetShouldAntialias(ctx, true); + CGContextSetLineWidth(ctx, 3.0f); - if (showtimeinfrz) - { - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - Boolean r; + CGContextSetRGBFillColor(ctx, 1.0, 0.7, 0.7, 1.0); + x = rct.origin.x + 5.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithFormat:@"%c", letters[count]], 12.0, x, y); - err = UCConvertUTCDateTimeToCFAbsoluteTime(&(info.contentModDate), &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - r = CFStringGetCString(datstr, dateC, sizeof(dateC), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - CFRelease(locale); + if (showtimeinfrz) + { + CFAbsoluteTime at; + CFDateFormatterRef format; + CFLocaleRef locale; + CFStringRef datstr; + Boolean r; - CGContextSelectFont(ctx, "Helvetica", 10.0f, kCGEncodingMacRoman); - x = rct.origin.x + 20.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextInvisible); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - pt = CGContextGetTextPosition(ctx); - textw = pt.x - x; - x = rct.origin.x + 122.0f - textw; - CGContextSetTextDrawingMode(ctx, kCGTextStroke); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 0.8f); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - } - } - else - { - CGContextSelectFont(ctx, "Helvetica", 12.0f, kCGEncodingMacRoman); - x = rct.origin.x + 5.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 0.7f, 0.7f, 0.7f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); - } + err = UCConvertUTCDateTimeToCFAbsoluteTime(&(info.contentModDate), &at); + locale = CFLocaleCopyCurrent(); + format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); + datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); + r = CFStringGetCString(datstr, dateC, sizeof(dateC), CFStringGetSystemEncoding()); + CFRelease(datstr); + CFRelease(format); + CFRelease(locale); - if ((count % 4) == 3) - rct = CGRectOffset(rct, -128.0f * 3.0f, -120.0f); - else - rct = CGRectOffset(rct, 128.0f, 0.0f); - } + x = rct.origin.x + 20.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithUTF8String:dateC], 10.0, x, y); + } + } + else + { + x = rct.origin.x + 5.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithFormat:@"%c", letters[count]], 12.0, x, y); + } - if (newestIndex < 0) - newestIndex = 0; + if ((count % 4) == 3) + rct = CGRectOffset(rct, -128.0f * 3.0f, -120.0f); + else + rct = CGRectOffset(rct, 128.0f, 0.0f); + } - CGContextRelease(ctx); + if (newestIndex < 0) + newestIndex = 0; - image = NULL; + CGContextRelease(ctx); - prov = CGDataProviderCreateWithData(NULL, back, w * h * 2, NULL); - if (prov) - { - image = CGImageCreate(w, h, 5, 16, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } + image = NULL; - if (!image) - QuitWithFatalError(0, "os 07"); + prov = CGDataProviderCreateWithData(NULL, back, w * h * 2, NULL); + if (prov) + { + image = CGImageCreate(w, h, 5, 16, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 0, kCGRenderingIntentDefault); + CGDataProviderRelease(prov); + } - ctx = CGBitmapContextCreate(draw, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0)); - if (!ctx) - QuitWithFatalError(0, "os 08"); + if (!image) + QuitWithFatalError(@"os 07"); - CGContextSetShouldAntialias(ctx, false); + ctx = CGBitmapContextCreate(draw, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host); + if (!ctx) + QuitWithFatalError(@"os 08"); - UpdateFreezeDefrostScreen(newestIndex, image, draw, ctx); + CGContextSetShouldAntialias(ctx, false); - CocoaPlayFreezeDefrostSound(); + UpdateFreezeDefrostScreen(newestIndex, image, draw, ctx); - result = -2; - current_selection = newestIndex; + CocoaPlayFreezeDefrostSound(); - do - { - if (!rejectinput) - { - GetKeys(keys); + result = -2; + current_selection = newestIndex; - for (int count = 0; count <= 12; count++) - { - while (KeyIsPressed(keys, keyCheck[count])) - { - result = count - 1; - GetKeys(keys); - } - } + do + { + if (!rejectinput) + { + CopyPressedKeys(keys, gamepadButtons); - while (KeyIsPressed(keys, keyCode[k1PRight])) - { - startTime = TickCount(); - current_selection += 1; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PRight]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_1]) + { + result = 0; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PLeft])) - { - startTime = TickCount(); - current_selection -= 1; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PLeft]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_2]) + { + result = 1; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PDown])) - { - startTime = TickCount(); - current_selection += 4; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PDown]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_3]) + { + result = 2; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PUp])) - { - startTime = TickCount(); - current_selection -= 4; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PUp]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_4]) + { + result = 3; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PA] ) || - KeyIsPressed(keys, keyCode[k2PA] ) || - KeyIsPressed(keys, keyCode[k1PB] ) || - KeyIsPressed(keys, keyCode[k2PB] ) || - KeyIsPressed(keys, keyCode[k1PX] ) || - KeyIsPressed(keys, keyCode[k2PX] ) || - KeyIsPressed(keys, keyCode[k1PY] ) || - KeyIsPressed(keys, keyCode[k2PY] ) || - KeyIsPressed(keys, keyCode[k1PStart] ) || - KeyIsPressed(keys, keyCode[k2PStart] ) || - KeyIsPressed(keys, keyCode[k1PSelect]) || - KeyIsPressed(keys, keyCode[k2PSelect])) - { - GetKeys(keys); - result = current_selection; - } + while (pressedRawKeyboardButtons[kVK_ANSI_5]) + { + result = 4; + usleep(repeatDelay); + } - uint32 pad1, pad2; + while (pressedRawKeyboardButtons[kVK_ANSI_6]) + { + result = 5; + usleep(repeatDelay); + } - while (ISpKeyIsPressed(kISpEsc ) || - ISpKeyIsPressed(kISp1PStart) || - ISpKeyIsPressed(kISp2PStart)) - result = -1; + while (pressedRawKeyboardButtons[kVK_ANSI_7]) + { + result = 6; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0100) || (pad2 & 0x0100)) // Rt - { - startTime = TickCount(); - current_selection += 1; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0100) || (pad2 & 0x0100)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_8]) + { + result = 7; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0200) || (pad2 & 0x0200)) // Lf - { - startTime = TickCount(); - current_selection -= 1; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0200) || (pad2 & 0x0200)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_9]) + { + result = 8; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0800) || (pad2 & 0x0800)) // Up - { - startTime = TickCount(); - current_selection -= 4; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0800) || (pad2 & 0x0800)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_A]) + { + result = 9; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0400) || (pad2 & 0x0400)) // Dn - { - startTime = TickCount(); - current_selection += 4; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0400) || (pad2 & 0x0400)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_B]) + { + result = 10; + usleep(repeatDelay); + } - while (ISpKeyIsPressed(kISp1PA) || - ISpKeyIsPressed(kISp2PA) || - ISpKeyIsPressed(kISp1PB) || - ISpKeyIsPressed(kISp2PB) || - ISpKeyIsPressed(kISp1PX) || - ISpKeyIsPressed(kISp2PX) || - ISpKeyIsPressed(kISp1PY) || - ISpKeyIsPressed(kISp2PY)) - result = current_selection; - } + while (pressedRawKeyboardButtons[kVK_ANSI_C]) + { + result = 11; + usleep(repeatDelay); + } - usleep(30000); + while (pressedRawKeyboardButtons[kVK_Return] || pressedRawKeyboardButtons[kVK_ANSI_KeypadEnter]) + { + result = current_selection; + usleep(repeatDelay); + } - windowResizeCount = 2; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - } while (result == -2); + while (KeyIsPressed(keys, gamepadButtons, 0, kRight)) + { + startTime = mach_absolute_time(); + current_selection += 1; + if (current_selection > 11) + current_selection -= 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - CocoaPlayFreezeDefrostSound(); + while (KeyIsPressed(keys, gamepadButtons, 0, kLeft)) + { + startTime = mach_absolute_time(); + current_selection -= 1; + if (current_selection < 0) + current_selection += 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - CGContextRelease(ctx); - CGImageRelease(image); - CGColorSpaceRelease(color); - free(draw); - free(back); + while (KeyIsPressed(keys, gamepadButtons, 0, kDown)) + { + startTime = mach_absolute_time(); + current_selection += 4; + if (current_selection > 11) + current_selection -= 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - S9xSetSoundMute(false); + while (KeyIsPressed(keys, gamepadButtons, 0, kUp)) + { + startTime = mach_absolute_time(); + current_selection -= 4; + if (current_selection < 0) + current_selection += 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - inactiveMode = oldInactiveMode; - frzselecting = false; + while (ISpKeyIsPressed(keys, gamepadButtons, kISpEsc)) + { + result = -1; + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - windowResizeCount = 2; + while (KeyIsPressed(keys, gamepadButtons, 0, kA) || + KeyIsPressed(keys, gamepadButtons, 1, kA) || + KeyIsPressed(keys, gamepadButtons, 0, kB) || + KeyIsPressed(keys, gamepadButtons, 1, kB) || + KeyIsPressed(keys, gamepadButtons, 0, kX) || + KeyIsPressed(keys, gamepadButtons, 1, kX) || + KeyIsPressed(keys, gamepadButtons, 0, kY) || + KeyIsPressed(keys, gamepadButtons, 1, kY)) + { + result = current_selection; + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } + } - return (result); + usleep(30000); + + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + } while (result == -2 && frzselecting); + + CocoaPlayFreezeDefrostSound(); + + CGContextRelease(ctx); + CGImageRelease(image); + CGColorSpaceRelease(color); + free(draw); + free(back); + + S9xSetSoundMute(false); + + inactiveMode = oldInactiveMode; + frzselecting = false; + pauseEmulation = false; + + [s9xView updatePauseOverlay]; + + return (result); } static void UpdateFreezeDefrostScreen (int newIndex, CGImageRef image, uint8 *draw, CGContextRef ctx) { - if (newIndex >= 0 && newIndex < 12) - { - CGRect rct; - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; + if (newIndex >= 0 && newIndex < 12) + { + CGRect rct; + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; - CGContextSetLineWidth(ctx, 1.0f); + CGContextSetLineWidth(ctx, 1.0f); - rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); - CGContextDrawImage(ctx, rct, image); + rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); + CGContextDrawImage(ctx, rct, image); - rct = CGRectMake(0.0f, (float) h - 238.0f, 128.0f, 120.0f); - rct = CGRectOffset(rct, (float) (128 * (newIndex % 4)), (float) (-120 * (newIndex / 4))); - rct.size.width -= 1.0f; - rct.size.height -= 1.0f; + rct = CGRectMake(0.0f, (float) h - 208.0f, 128.0f, 120.0f); + rct = CGRectOffset(rct, (float) (128 * (newIndex % 4)), (float) (-120 * (newIndex / 4))); + rct.size.width -= 1.0f; + rct.size.height -= 1.0f; - CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 0.0f, 1.0f); - CGContextStrokeRect(ctx, rct); - rct = CGRectInset(rct, 1.0f, 1.0f); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - CGContextStrokeRect(ctx, rct); - } + CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 0.0f, 1.0f); + CGContextStrokeRect(ctx, rct); + rct = CGRectInset(rct, 1.0f, 1.0f); + CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + CGContextStrokeRect(ctx, rct); + } - DrawFreezeDefrostScreen(draw); + DrawFreezeDefrostScreen(draw); } static void ProcessInput (void) { - KeyMap myKeys; - bool8 isok, fnbtn, altbtn, tcbtn; - static bool8 toggleff = false, lastTimeTT = false, lastTimeFn = false, ffUp = false, ffDown = false, ffUpSp = false, ffDownSp = false; + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + bool8 isok, fnbtn, altbtn, tcbtn; + static bool8 toggleff = false, lastTimeTT = false, lastTimeFn = false, ffUp = false, ffDown = false; - if (rejectinput) - return; + if (rejectinput) + return; - if (ISpKeyIsPressed(kISpEsc)) - { - if (s9xthreadrunning) - { - if (!eventQueued) + CopyPressedKeys(keys, gamepadButtons); + + fnbtn = ISpKeyIsPressed(keys, gamepadButtons, kISpFunction); + altbtn = ISpKeyIsPressed(keys, gamepadButtons, kISpAlt); + + if (fnbtn) + { + if (!lastTimeFn) + { + memset(heldFunctionButtons, 0, kNumFunctionButtons); + } + + lastTimeFn = true; + lastTimeTT = false; + ffUp = ffDown = false; + + for (unsigned int i = 0; i < kNumFunctionButtons; i++) + { + if (pressedFunctionButtons[i]) + { + if (!heldFunctionButtons[i]) + { + s9xcommand_t s9xcmd; + static char msg[64]; + + heldFunctionButtons[i] = true; + + switch ((S9xFunctionButtonCommand) i) + { + case ToggleBG0: + s9xcmd = S9xGetCommandT("ToggleBG0"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case ToggleBG1: + s9xcmd = S9xGetCommandT("ToggleBG1"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case ToggleBG2: + s9xcmd = S9xGetCommandT("ToggleBG2"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case ToggleBG3: + s9xcmd = S9xGetCommandT("ToggleBG3"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case ToggleSprites: + s9xcmd = S9xGetCommandT("ToggleSprites"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SwapJoypads: + s9xcmd = S9xGetCommandT("SwapJoypads"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel0: + s9xcmd = S9xGetCommandT("SoundChannel0"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel1: + s9xcmd = S9xGetCommandT("SoundChannel1"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel2: + s9xcmd = S9xGetCommandT("SoundChannel2"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel3: + s9xcmd = S9xGetCommandT("SoundChannel3"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel4: + s9xcmd = S9xGetCommandT("SoundChannel4"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel5: + s9xcmd = S9xGetCommandT("SoundChannel5"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel6: + s9xcmd = S9xGetCommandT("SoundChannel6"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannel7: + s9xcmd = S9xGetCommandT("SoundChannel7"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case SoundChannelsOn: + s9xcmd = S9xGetCommandT("SoundChannelsOn"); + S9xApplyCommand(s9xcmd, 1, 0); + break; + + case ToggleDisplayPressedKeys: + Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; + break; + + case ToggleDisplayMovieFrame: + if (S9xMovieActive()) + Settings.DisplayMovieFrame = !Settings.DisplayMovieFrame; + break; + + case IncreaseFrameAdvanceRate: + if (macFrameAdvanceRate < 5000000) + macFrameAdvanceRate += 100000; + sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); + S9xSetInfoString(msg); + break; + + case DecreaseFrameAdvanceRate: + if (macFrameAdvanceRate > 500000) + macFrameAdvanceRate -= 100000; + sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); + S9xSetInfoString(msg); + break; + + case ToggleEmulationPause: + pauseEmulation = !pauseEmulation; + [s9xView updatePauseOverlay]; + break; + + case AdvanceFrame: + frameAdvance = true; + break; + + case kNumFunctionButtons: + break; + + } + } + } + } + } + else + { + lastTimeFn = false; + + if (ISpKeyIsPressed(keys, gamepadButtons, kISpEsc)) + { + if (!escKeyDown) { - PostQueueToSubEventLoop(); - eventQueued = true; - } - } - else - running = false; + escKeyDown = true; + pauseEmulation = !pauseEmulation; + [s9xView updatePauseOverlay]; - return; - } - - if (ISpKeyIsPressed(kISpFreeze)) - { - MacStopSound(); - while (ISpKeyIsPressed(kISpFreeze)); - - isok = SNES9X_Freeze(); - ClearGFXScreen(); - return; - } - - if (ISpKeyIsPressed(kISpDefrost)) - { - MacStopSound(); - while (ISpKeyIsPressed(kISpDefrost)); - - isok = SNES9X_Defrost(); - ClearGFXScreen(); - return; - } - - if (ISpKeyIsPressed(kISpScreenshot)) - { - Settings.TakeScreenshot = true; - while (ISpKeyIsPressed(kISpScreenshot)); - } - - if (ISpKeyIsPressed(kISpSPC)) - { - S9xDumpSPCSnapshot(); - while (ISpKeyIsPressed(kISpSPC)); - } - - if (ISpKeyIsPressed(kISpFFUp)) - { - if (!ffUpSp) - { - ChangeTurboRate(+1); - ffUpSp = true; - } - } - else - ffUpSp = false; - - if (ISpKeyIsPressed(kISpFFDown)) - { - if (!ffDownSp) - { - ChangeTurboRate(-1); - ffDownSp = true; - } - } - else - ffDownSp = false; - - controlPad[0] = controlPad[1] = 0; - - JoypadScanDirection(0, &(controlPad[0])); - if (ISpKeyIsPressed(kISp1PR )) controlPad[0] |= 0x0010; - if (ISpKeyIsPressed(kISp1PL )) controlPad[0] |= 0x0020; - if (ISpKeyIsPressed(kISp1PX )) controlPad[0] |= 0x0040; - if (ISpKeyIsPressed(kISp1PA )) controlPad[0] |= 0x0080; - if (ISpKeyIsPressed(kISp1PStart )) controlPad[0] |= 0x1000; - if (ISpKeyIsPressed(kISp1PSelect)) controlPad[0] |= 0x2000; - if (ISpKeyIsPressed(kISp1PY )) controlPad[0] |= 0x4000; - if (ISpKeyIsPressed(kISp1PB )) controlPad[0] |= 0x8000; - - JoypadScanDirection(1, &(controlPad[1])); - if (ISpKeyIsPressed(kISp2PR )) controlPad[1] |= 0x0010; - if (ISpKeyIsPressed(kISp2PL )) controlPad[1] |= 0x0020; - if (ISpKeyIsPressed(kISp2PX )) controlPad[1] |= 0x0040; - if (ISpKeyIsPressed(kISp2PA )) controlPad[1] |= 0x0080; - if (ISpKeyIsPressed(kISp2PStart )) controlPad[1] |= 0x1000; - if (ISpKeyIsPressed(kISp2PSelect)) controlPad[1] |= 0x2000; - if (ISpKeyIsPressed(kISp2PY )) controlPad[1] |= 0x4000; - if (ISpKeyIsPressed(kISp2PB )) controlPad[1] |= 0x8000; - - if (((macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) && Settings.MultiPlayer5Master) - { - controlPad[2] = controlPad[3] = controlPad[4] = 0; - - JoypadScanDirection(2, &(controlPad[2])); - if (ISpKeyIsPressed(kISp3PR )) controlPad[2] |= 0x0010; - if (ISpKeyIsPressed(kISp3PL )) controlPad[2] |= 0x0020; - if (ISpKeyIsPressed(kISp3PX )) controlPad[2] |= 0x0040; - if (ISpKeyIsPressed(kISp3PA )) controlPad[2] |= 0x0080; - if (ISpKeyIsPressed(kISp3PStart )) controlPad[2] |= 0x1000; - if (ISpKeyIsPressed(kISp3PSelect)) controlPad[2] |= 0x2000; - if (ISpKeyIsPressed(kISp3PY )) controlPad[2] |= 0x4000; - if (ISpKeyIsPressed(kISp3PB )) controlPad[2] |= 0x8000; - - JoypadScanDirection(3, &(controlPad[3])); - if (ISpKeyIsPressed(kISp4PR )) controlPad[3] |= 0x0010; - if (ISpKeyIsPressed(kISp4PL )) controlPad[3] |= 0x0020; - if (ISpKeyIsPressed(kISp4PX )) controlPad[3] |= 0x0040; - if (ISpKeyIsPressed(kISp4PA )) controlPad[3] |= 0x0080; - if (ISpKeyIsPressed(kISp4PStart )) controlPad[3] |= 0x1000; - if (ISpKeyIsPressed(kISp4PSelect)) controlPad[3] |= 0x2000; - if (ISpKeyIsPressed(kISp4PY )) controlPad[3] |= 0x4000; - if (ISpKeyIsPressed(kISp4PB )) controlPad[3] |= 0x8000; - - JoypadScanDirection(4, &(controlPad[4])); - if (ISpKeyIsPressed(kISp5PR )) controlPad[4] |= 0x0010; - if (ISpKeyIsPressed(kISp5PL )) controlPad[4] |= 0x0020; - if (ISpKeyIsPressed(kISp5PX )) controlPad[4] |= 0x0040; - if (ISpKeyIsPressed(kISp5PA )) controlPad[4] |= 0x0080; - if (ISpKeyIsPressed(kISp5PStart )) controlPad[4] |= 0x1000; - if (ISpKeyIsPressed(kISp5PSelect)) controlPad[4] |= 0x2000; - if (ISpKeyIsPressed(kISp5PY )) controlPad[4] |= 0x4000; - if (ISpKeyIsPressed(kISp5PB )) controlPad[4] |= 0x8000; - - ControlPadFlagsToS9xReportButtons(2, controlPad[2]); - ControlPadFlagsToS9xReportButtons(3, controlPad[3]); - ControlPadFlagsToS9xReportButtons(4, controlPad[4]); - - if (macControllerOption == SNES_MULTIPLAYER5_2) - { - controlPad[5] = controlPad[6] = controlPad[7] = 0; - - JoypadScanDirection(5, &(controlPad[5])); - if (ISpKeyIsPressed(kISp6PR )) controlPad[5] |= 0x0010; - if (ISpKeyIsPressed(kISp6PL )) controlPad[5] |= 0x0020; - if (ISpKeyIsPressed(kISp6PX )) controlPad[5] |= 0x0040; - if (ISpKeyIsPressed(kISp6PA )) controlPad[5] |= 0x0080; - if (ISpKeyIsPressed(kISp6PStart )) controlPad[5] |= 0x1000; - if (ISpKeyIsPressed(kISp6PSelect)) controlPad[5] |= 0x2000; - if (ISpKeyIsPressed(kISp6PY )) controlPad[5] |= 0x4000; - if (ISpKeyIsPressed(kISp6PB )) controlPad[5] |= 0x8000; - - JoypadScanDirection(6, &(controlPad[6])); - if (ISpKeyIsPressed(kISp7PR )) controlPad[6] |= 0x0010; - if (ISpKeyIsPressed(kISp7PL )) controlPad[6] |= 0x0020; - if (ISpKeyIsPressed(kISp7PX )) controlPad[6] |= 0x0040; - if (ISpKeyIsPressed(kISp7PA )) controlPad[6] |= 0x0080; - if (ISpKeyIsPressed(kISp7PStart )) controlPad[6] |= 0x1000; - if (ISpKeyIsPressed(kISp7PSelect)) controlPad[6] |= 0x2000; - if (ISpKeyIsPressed(kISp7PY )) controlPad[6] |= 0x4000; - if (ISpKeyIsPressed(kISp7PB )) controlPad[6] |= 0x8000; - - JoypadScanDirection(7, &(controlPad[7])); - if (ISpKeyIsPressed(kISp8PR )) controlPad[7] |= 0x0010; - if (ISpKeyIsPressed(kISp8PL )) controlPad[7] |= 0x0020; - if (ISpKeyIsPressed(kISp8PX )) controlPad[7] |= 0x0040; - if (ISpKeyIsPressed(kISp8PA )) controlPad[7] |= 0x0080; - if (ISpKeyIsPressed(kISp8PStart )) controlPad[7] |= 0x1000; - if (ISpKeyIsPressed(kISp8PSelect)) controlPad[7] |= 0x2000; - if (ISpKeyIsPressed(kISp8PY )) controlPad[7] |= 0x4000; - if (ISpKeyIsPressed(kISp8PB )) controlPad[7] |= 0x8000; - - ControlPadFlagsToS9xReportButtons(5, controlPad[5]); - ControlPadFlagsToS9xReportButtons(6, controlPad[6]); - ControlPadFlagsToS9xReportButtons(7, controlPad[7]); - } - } - - GetKeys(myKeys); - - fnbtn = (KeyIsPressed(myKeys, keyCode[kKeyFunction]) || ISpKeyIsPressed(kISpFunction)); - altbtn = (KeyIsPressed(myKeys, keyCode[kKeyAlt] ) || ISpKeyIsPressed(kISpAlt) ); - - if (fnbtn) - { - if (!lastTimeFn) - { - for (unsigned int i = 0; i < kCommandListSize; i++) - btncmd[i].held = false; - } - - lastTimeFn = true; - lastTimeTT = false; - ffUp = ffDown = false; - - for (unsigned int i = 0; i < kCommandListSize; i++) - { - if (KeyIsPressed(myKeys, btncmd[i].keycode)) - { - if (!(btncmd[i].held)) + dispatch_async(dispatch_get_main_queue(), ^ { - btncmd[i].held = true; - - if (strncmp(btncmd[i].command, "_mac", 4) == 0) - { - static char msg[64]; - - switch (btncmd[i].command[4] - '0') - { - case 1: - Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; - break; - - case 2: - if (S9xMovieActive()) - Settings.DisplayMovieFrame = !Settings.DisplayMovieFrame; - break; - - case 3: - if (macFrameAdvanceRate < 5000000) - macFrameAdvanceRate += 100000; - sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); - S9xSetInfoString(msg); - break; - - case 4: - if (macFrameAdvanceRate > 500000) - macFrameAdvanceRate -= 100000; - sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); - S9xSetInfoString(msg); - break; - - case 5: - pauseEmulation = !pauseEmulation; - break; - - case 6: - frameAdvance = true; - break; - } - } - else - { - s9xcommand_t s9xcmd; - - s9xcmd = S9xGetCommandT(btncmd[i].command); - S9xApplyCommand(s9xcmd, 1, 0); - } - } + [s9xView setNeedsDisplay:YES]; + }); } - else - btncmd[i].held = false; - } - } - else - { - lastTimeFn = false; - - if (KeyIsPressed(myKeys, keyCode[kKeyEsc])) - { - if (s9xthreadrunning) - { - if (!eventQueued) - { - PostQueueToSubEventLoop(); - eventQueued = true; - } - } - else - running = false; - - return; - } - - if (KeyIsPressed(myKeys, keyCode[kKeyFreeze])) - { - MacStopSound(); - while (KeyIsPressed(myKeys, keyCode[kKeyFreeze])) - GetKeys(myKeys); - - isok = SNES9X_Freeze(); - ClearGFXScreen(); - return; - } - - if (KeyIsPressed(myKeys, keyCode[kKeyDefrost])) - { - MacStopSound(); - while (KeyIsPressed(myKeys, keyCode[kKeyDefrost])) - GetKeys(myKeys); - - isok = SNES9X_Defrost(); - ClearGFXScreen(); - return; - } - - if (KeyIsPressed(myKeys, keyCode[kKeyScreenshot])) - { - Settings.TakeScreenshot = true; - while (KeyIsPressed(myKeys, keyCode[kKeyScreenshot])) - GetKeys(myKeys); - } - - if (KeyIsPressed(myKeys, keyCode[kKeySPC])) - { - S9xDumpSPCSnapshot(); - while (KeyIsPressed(myKeys, keyCode[kKeySPC])) - GetKeys(myKeys); - } - - if (KeyIsPressed(myKeys, keyCode[kKeyFFUp])) - { - if (!ffUp) - { - ChangeTurboRate(+1); - ffUp = true; - } - } + } else - ffUp = false; - - if (KeyIsPressed(myKeys, keyCode[kKeyFFDown])) { - if (!ffDown) - { - ChangeTurboRate(-1); - ffDown = true; - } + escKeyDown = false; } - else - ffDown = false; - if (KeyIsPressed(myKeys, keyCode[k1PR] )) controlPad[0] |= 0x0010; - if (KeyIsPressed(myKeys, keyCode[k1PL] )) controlPad[0] |= 0x0020; - if (KeyIsPressed(myKeys, keyCode[k1PX] )) controlPad[0] |= 0x0040; - if (KeyIsPressed(myKeys, keyCode[k1PA] )) controlPad[0] |= 0x0080; - if (KeyIsPressed(myKeys, keyCode[k1PRight] )) controlPad[0] |= 0x0100; - if (KeyIsPressed(myKeys, keyCode[k1PLeft] )) controlPad[0] |= 0x0200; - if (KeyIsPressed(myKeys, keyCode[k1PDown] )) controlPad[0] |= 0x0400; - if (KeyIsPressed(myKeys, keyCode[k1PUp] )) controlPad[0] |= 0x0800; - if (KeyIsPressed(myKeys, keyCode[k1PStart] )) controlPad[0] |= 0x1000; - if (KeyIsPressed(myKeys, keyCode[k1PSelect])) controlPad[0] |= 0x2000; - if (KeyIsPressed(myKeys, keyCode[k1PY] )) controlPad[0] |= 0x4000; - if (KeyIsPressed(myKeys, keyCode[k1PB] )) controlPad[0] |= 0x8000; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFreeze)) + { + MacStopSound(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpFreeze)) + CopyPressedKeys(keys, gamepadButtons); - if (KeyIsPressed(myKeys, keyCode[k2PR] )) controlPad[1] |= 0x0010; - if (KeyIsPressed(myKeys, keyCode[k2PL] )) controlPad[1] |= 0x0020; - if (KeyIsPressed(myKeys, keyCode[k2PX] )) controlPad[1] |= 0x0040; - if (KeyIsPressed(myKeys, keyCode[k2PA] )) controlPad[1] |= 0x0080; - if (KeyIsPressed(myKeys, keyCode[k2PRight] )) controlPad[1] |= 0x0100; - if (KeyIsPressed(myKeys, keyCode[k2PLeft] )) controlPad[1] |= 0x0200; - if (KeyIsPressed(myKeys, keyCode[k2PDown] )) controlPad[1] |= 0x0400; - if (KeyIsPressed(myKeys, keyCode[k2PUp] )) controlPad[1] |= 0x0800; - if (KeyIsPressed(myKeys, keyCode[k2PStart] )) controlPad[1] |= 0x1000; - if (KeyIsPressed(myKeys, keyCode[k2PSelect])) controlPad[1] |= 0x2000; - if (KeyIsPressed(myKeys, keyCode[k2PY] )) controlPad[1] |= 0x4000; - if (KeyIsPressed(myKeys, keyCode[k2PB] )) controlPad[1] |= 0x8000; + isok = SNES9X_Freeze(); + return; + } - if (altbtn) - { - if (!lastTimeTT) - changeAuto[0] = changeAuto[1] = 0; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpDefrost)) + { + MacStopSound(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpDefrost)) + CopyPressedKeys(keys, gamepadButtons); - for (int i = 0; i < 2; i++) - { - for (int j = 0; j < 12; j++) - { - uint16 mask = 0x0010 << j; + isok = SNES9X_Defrost(); + return; + } - if (controlPad[i] & mask & autofireRec[i].toggleMask) - { - controlPad[i] &= ~mask; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpScreenshot)) + { + Settings.TakeScreenshot = true; + while (ISpKeyIsPressed(keys, gamepadButtons, kISpScreenshot)) + CopyPressedKeys(keys, gamepadButtons); + } - if (!(changeAuto[i] & mask)) - { - changeAuto[i] |= mask; - ChangeAutofireSettings(i, j); - } - } - else - changeAuto[i] &= ~mask; - } - } + if (ISpKeyIsPressed(keys, gamepadButtons, kISpSPC)) + { + S9xDumpSPCSnapshot(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpSPC)) + CopyPressedKeys(keys, gamepadButtons); + } - lastTimeTT = true; - } - else - lastTimeTT = false; - } + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFFUp)) + { + if (!ffUp) + { + ChangeTurboRate(+1); + ffUp = true; + } + } + else + ffUp = false; - if (enabletoggle) + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFFDown)) + { + if (!ffDown) + { + ChangeTurboRate(-1); + ffDown = true; + } + } + else + ffDown = false; + + for (int i = 0; i < MAC_MAX_PLAYERS; ++i) + { + controlPad[i] = 0; + if (KeyIsPressed(keys, gamepadButtons, i, kR )) controlPad[i] |= 0x0010; + if (KeyIsPressed(keys, gamepadButtons, i, kL )) controlPad[i] |= 0x0020; + if (KeyIsPressed(keys, gamepadButtons, i, kX )) controlPad[i] |= 0x0040; + if (KeyIsPressed(keys, gamepadButtons, i, kA )) controlPad[i] |= 0x0080; + if (KeyIsPressed(keys, gamepadButtons, i, kRight )) controlPad[i] |= 0x0100; + if (KeyIsPressed(keys, gamepadButtons, i, kLeft )) controlPad[i] |= 0x0200; + if (KeyIsPressed(keys, gamepadButtons, i, kDown )) controlPad[i] |= 0x0400; + if (KeyIsPressed(keys, gamepadButtons, i, kUp )) controlPad[i] |= 0x0800; + if (KeyIsPressed(keys, gamepadButtons, i, kStart )) controlPad[i] |= 0x1000; + if (KeyIsPressed(keys, gamepadButtons, i, kSelect)) controlPad[i] |= 0x2000; + if (KeyIsPressed(keys, gamepadButtons, i, kY )) controlPad[i] |= 0x4000; + if (KeyIsPressed(keys, gamepadButtons, i, kB )) controlPad[i] |= 0x8000; + } + + if (altbtn) + { + if (!lastTimeTT) + changeAuto[0] = changeAuto[1] = 0; + + for (int i = 0; i < 2; i++) + { + for (int j = 0; j < 12; j++) + { + uint16 mask = 0x0010 << j; + + if (controlPad[i] & mask & autofireRec[i].toggleMask) + { + controlPad[i] &= ~mask; + + if (!(changeAuto[i] & mask)) + { + changeAuto[i] |= mask; + ChangeAutofireSettings(i, j); + } + } + else + changeAuto[i] &= ~mask; + } + } + + lastTimeTT = true; + } + else + lastTimeTT = false; + } + + if (enabletoggle) + { + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFastForward) && !fnbtn) + { + if (!toggleff) + { + toggleff = true; + Settings.TurboMode = !Settings.TurboMode; + S9xSetInfoString(Settings.TurboMode ? "Turbo mode on" : "Turbo mode off"); + if (!Settings.TurboMode) + S9xClearSamples(); + } + } + else + toggleff = false; + } + else + { + bool8 old = Settings.TurboMode; + Settings.TurboMode = (ISpKeyIsPressed(keys, gamepadButtons, kISpFastForward) && !fnbtn) ? true : false; + if (!Settings.TurboMode && old) + S9xClearSamples(); + } + + for (int i = 0; i < 2; i++) + controlPad[i] ^= autofireRec[i].invertMask; + + if (autofire) + { + long long currentTime; + uint16 changeMask; + + currentTime = GetMicroseconds(); + tcbtn = (ISpKeyIsPressed(keys, gamepadButtons, kISpTC)); + + for (int i = 0; i < 2; i++) + { + changeMask = (lastTimeTT ? (~changeAuto[i]) : 0xFFFF); + + for (int j = 0; j < 12; j++) + { + uint16 mask = (0x0010 << j) & changeMask; + + if (autofireRec[i].tcMask & mask) + { + if (!tcbtn) + continue; + } + + if (autofireRec[i].buttonMask & mask) + { + if (controlPad[i] & mask) + { + if (currentTime > autofireRec[i].nextTime[j]) + { + if (Settings.TurboMode) + autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0 / macFastForwardRate); + else + autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0); + } + else + controlPad[i] &= ~mask; + } + } + } + } + } + + for (int i = 0; i < MAC_MAX_PLAYERS; ++i) { - if ((ISpKeyIsPressed(kISpFastForward) || KeyIsPressed(myKeys, keyCode[kKeyFastForward])) && !fnbtn) - { - if (!toggleff) - { - toggleff = true; - Settings.TurboMode = !Settings.TurboMode; - S9xSetInfoString(Settings.TurboMode ? "Turbo mode on" : "Turbo mode off"); - if (!Settings.TurboMode) - S9xClearSamples(); - } - } - else - toggleff = false; + ControlPadFlagsToS9xReportButtons(i, controlPad[i]); } - else + + if (macControllerOption == SNES_JUSTIFIER_2) { - bool8 old = Settings.TurboMode; - Settings.TurboMode = ((ISpKeyIsPressed(kISpFastForward) || KeyIsPressed(myKeys, keyCode[kKeyFastForward])) && !fnbtn) ? true : false; - if (!Settings.TurboMode && old) - S9xClearSamples(); + ControlPadFlagsToS9xPseudoPointer(controlPad[1]); } - - for (int i = 0; i < 2; i++) - controlPad[i] ^= autofireRec[i].invertMask; - - if (autofire) - { - long long currentTime; - uint16 changeMask; - - Microseconds((UnsignedWide *) ¤tTime); - tcbtn = (KeyIsPressed(myKeys, keyCode[kKeyTC]) || ISpKeyIsPressed(kISpTC)); - - for (int i = 0; i < 2; i++) - { - changeMask = (lastTimeTT ? (~changeAuto[i]) : 0xFFFF); - - for (int j = 0; j < 12; j++) - { - uint16 mask = (0x0010 << j) & changeMask; - - if (autofireRec[i].tcMask & mask) - { - if (!tcbtn) - continue; - } - - if (autofireRec[i].buttonMask & mask) - { - if (controlPad[i] & mask) - { - if (currentTime > autofireRec[i].nextTime[j]) - { - if (Settings.TurboMode) - autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0 / macFastForwardRate); - else - autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0); - } - else - controlPad[i] &= ~mask; - } - } - } - } - } - - ControlPadFlagsToS9xReportButtons(0, controlPad[0]); - ControlPadFlagsToS9xReportButtons(1, controlPad[1]); - - if (macControllerOption == SNES_JUSTIFIER_2) - ControlPadFlagsToS9xPseudoPointer(controlPad[1]); } static void ChangeAutofireSettings (int player, int btn) { - static char msg[64]; - uint16 mask, m; + static char msg[64]; + uint16 mask, m; - mask = 0x0010 << btn; - autofireRec[player].buttonMask ^= mask; - autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask); + mask = 0x0010 << btn; + autofireRec[player].buttonMask ^= mask; + autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask); - m = autofireRec[player].buttonMask; - if (m) - snprintf(msg, sizeof(msg), "Autofire %d:%s%s%s%s%s%s%s%s%s%s%s%s%s", player + 1, - (m & 0xC0F0 ? " " : ""), - (m & 0x0080 ? "A" : ""), - (m & 0x8000 ? "B" : ""), - (m & 0x0040 ? "X" : ""), - (m & 0x4000 ? "Y" : ""), - (m & 0x0020 ? "L" : ""), - (m & 0x0010 ? "R" : ""), - (m & 0x0800 ? " Up" : ""), - (m & 0x0400 ? " Dn" : ""), - (m & 0x0200 ? " Lf" : ""), - (m & 0x0100 ? " Rt" : ""), - (m & 0x1000 ? " St" : ""), - (m & 0x2000 ? " Se" : "")); - else - snprintf(msg, sizeof(msg), "Autofire %d: Off", player + 1); + m = autofireRec[player].buttonMask; + if (m) + snprintf(msg, sizeof(msg), "Autofire %d:%s%s%s%s%s%s%s%s%s%s%s%s%s", player + 1, + (m & 0xC0F0 ? " " : ""), + (m & 0x0080 ? "A" : ""), + (m & 0x8000 ? "B" : ""), + (m & 0x0040 ? "X" : ""), + (m & 0x4000 ? "Y" : ""), + (m & 0x0020 ? "L" : ""), + (m & 0x0010 ? "R" : ""), + (m & 0x0800 ? " Up" : ""), + (m & 0x0400 ? " Dn" : ""), + (m & 0x0200 ? " Lf" : ""), + (m & 0x0100 ? " Rt" : ""), + (m & 0x1000 ? " St" : ""), + (m & 0x2000 ? " Se" : "")); + else + snprintf(msg, sizeof(msg), "Autofire %d: Off", player + 1); - S9xSetInfoString(msg); + S9xSetInfoString(msg); } static void ChangeTurboRate (int d) { - static char msg[64]; + static char msg[64]; - macFastForwardRate += d; - if (macFastForwardRate < 1) - macFastForwardRate = 1; - else - if (macFastForwardRate > 15) - macFastForwardRate = 15; + macFastForwardRate += d; + if (macFastForwardRate < 1) + macFastForwardRate = 1; + else + if (macFastForwardRate > 15) + macFastForwardRate = 15; - snprintf(msg, sizeof(msg), "Turbo Rate: %d", macFastForwardRate); - S9xSetInfoString(msg); -} - -void GetGameScreenPointer (int16 *x, int16 *y, bool fullmouse) -{ - int ph; - - ph = !drawoverscan ? ((IPPU.RenderedScreenHeight > 256) ? IPPU.RenderedScreenHeight : (IPPU.RenderedScreenHeight << 1)) : (SNES_HEIGHT_EXTENDED << 1); - - if (fullscreen) - { - if (glstretch) - { - float fpw = (float) glScreenH / (float) ph * 512.0f; - - scopeViewInfo.width = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); - scopeViewInfo.height = glScreenH; - scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - scopeViewInfo.width) >> 1); - scopeViewInfo.globalTop = (int) glScreenBounds.origin.y; - } - else - { - scopeViewInfo.width = 512; - scopeViewInfo.height = ph; - scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - 512) >> 1); - scopeViewInfo.globalTop = (int) glScreenBounds.origin.y + ((glScreenH - ph ) >> 1); - } - } - else - { - Rect rct; - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - - int ww = rct.right - rct.left, - wh = rct.bottom - rct.top; - - scopeViewInfo.width = ww; - scopeViewInfo.globalLeft = rct.left; - - if (windowExtend) - { - scopeViewInfo.height = ph * wh / kMacWindowHeight; - scopeViewInfo.globalTop = rct.top + ((kMacWindowHeight - ph) >> 1) * wh / kMacWindowHeight; - } - else - { - scopeViewInfo.height = wh; - scopeViewInfo.globalTop = rct.top; - } - } - - if (!fullmouse) - { - Point pos; - - GetGlobalMouse(&pos); - - *x = (int16) (((float) (pos.h - scopeViewInfo.globalLeft)) / ((float) scopeViewInfo.width ) * (float) IPPU.RenderedScreenWidth); - *y = (int16) (((float) (pos.v - scopeViewInfo.globalTop )) / ((float) scopeViewInfo.height) * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); - } - else - { - *x = (int16) (unlimitedCursor.x / (float) scopeViewInfo.width * (float) IPPU.RenderedScreenWidth); - *y = (int16) (unlimitedCursor.y / (float) scopeViewInfo.height * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); - } + snprintf(msg, sizeof(msg), "Turbo Rate: %d", macFastForwardRate); + S9xSetInfoString(msg); } static void Initialize (void) { - OSStatus err; - IBNibRef menuNibRef; - MenuRef menu; - SInt32 qtVersion; - - printf("\nSnes9x for Mac OS X %s (%s), ", VERSION, MAC_VERSION); -#ifdef __BIG_ENDIAN__ - printf("PowerPC\n\n"); -#else - printf("Intel\n\n"); -#endif - - err = Gestalt(gestaltSystemVersion, &systemVersion); - err = Gestalt(gestaltQuickTimeVersion, &qtVersion); - - if ((systemVersion < 0x1039) || (qtVersion < 0x07008000)) - { - AppearanceAlert(kAlertStopAlert, kS9xMacAlertRequiredSystem, kS9xMacAlertRequiredSystemHint); - QuitWithFatalError(0, "os 09"); - } - - printf("OS: %x QuickTime: %x\n\n", (unsigned) systemVersion, (unsigned) qtVersion); - -#ifdef ZLIB - printf("zlib header version: %s\n\n", ZLIB_VERSION); -#endif - - NSApplicationLoad(); - bzero(&Settings, sizeof(Settings)); Settings.MouseMaster = true; Settings.SuperScopeMaster = true; @@ -3052,19 +2527,11 @@ static void Initialize (void) Settings.OneSlowClockCycle = 8; Settings.TwoClockCycles = 12; - for (int a = 0; a < kWindowCount; a++) - { - windowPos[a].h = 40; - windowPos[a].v = 80; - windowSize[a].width = -1.0f; - windowSize[a].height = -1.0f; - } + mach_timebase_info_data_t info; + mach_timebase_info(&info); - extraOptions.benchmark = false; - extraOptions.glForceNoTextureRectangle = false; - extraOptions.glUseClientStrageApple = true; - extraOptions.glUseTexturePriority = false; - extraOptions.glStorageHint = 2; + machTimeNumerator = info.numer; + machTimeDenominator = info.denom * 1000; npServerIP[0] = 0; npName[0] = 0; @@ -3073,50 +2540,16 @@ static void Initialize (void) CreateIconImages(); - InitAppleEvents(); InitKeyboard(); InitAutofire(); InitCheatFinder(); - LoadPrefs(); - InitGraphics(); InitMacSound(); SetUpHID(); - RegisterHelpBook(); - - if (systemVersion < 0x1040) - ciFilterEnable = false; - - err = CreateNibReference(kMacS9XCFString, &menuNibRef); - err = SetMenuBarFromNib(menuNibRef, CFSTR("MenuBar")); - DisposeNibReference(menuNibRef); - - EnableMenuCommand(NULL, kHICommandPreferences); - - DisableMenuItem(GetMenuRef(mEdit), 0); - - CheckMenuItem(GetMenuRef(mCheat), iApplyCheats, applycheat); - Settings.ApplyCheats = applycheat; - - err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &menu); - CheckMenuItem(menu, padSetting, true); - - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &menu); - CheckMenuItem(menu, deviceSetting, true); - deviceSettingMaster = deviceSetting; - - DisableMenuItem(GetMenuRef(mOption), iCIFilter); - - InitRecentItems(); - InitRecentMenu(); - BuildRecentMenu(); - InitMultiCart(); - DrawMenuBar(); - autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask) ? true : false; for (int a = 0; a < MAC_MAX_PLAYERS; a++) for (int b = 0; b < 12; b++) @@ -3128,50 +2561,44 @@ static void Initialize (void) S9xSetupDefaultKeymap(); ChangeInputDevice(); - err = EnterMovies(); - if (!Memory.Init() || !S9xInitAPU() || !S9xGraphicsInit()) - QuitWithFatalError(err, "os 01"); + { + + } frzselecting = false; + [s9xView updatePauseOverlay]; S9xSetControllerCrosshair(X_MOUSE1, 0, NULL, NULL); S9xSetControllerCrosshair(X_MOUSE2, 0, NULL, NULL); - - if (systemVersion >= 0x1040) - { - InitCoreImage(); - InitCoreImageFilter(); - } } static void Deinitialize (void) { - if (systemVersion >= 0x1040) - { - DeinitCoreImageFilter(); - DeinitCoreImage(); - } - deviceSetting = deviceSettingMaster; - ExitMovies(); - DeinitMultiCart(); - DeinitRecentMenu(); - DeinitRecentItems(); - SavePrefs(); ReleaseHID(); DeinitCheatFinder(); DeinitGraphics(); DeinitKeyboard(); DeinitMacSound(); - DeinitAppleEvents(); ReleaseIconImages(); S9xGraphicsDeinit(); S9xDeinitAPU(); Memory.Deinit(); + + pthread_mutex_destroy(&keyLock); +} + +uint64 GetMicroseconds(void) +{ + uint64 ms = mach_absolute_time(); + ms *= machTimeNumerator; + ms /= machTimeDenominator; + + return ms; } static void InitAutofire (void) @@ -3191,122 +2618,89 @@ static void InitAutofire (void) } } -static void ForceChangingKeyScript (void) -{ - if (systemVersion >= 0x1050) - { - OSStatus err; - TISInputSourceRef tis; - - tis = TISCopyCurrentASCIICapableKeyboardInputSource(); - err = TISSelectInputSource(tis); - CFRelease(tis); - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - long script; - - script = GetScriptManagerVariable(smKeyScript); - if (script == smJapanese) - KeyScript(smRoman | smKeyForceKeyScriptMask); - } -#endif -} - void S9xSyncSpeed (void) { long long currentFrame, adjustment; - if (directDisplay) + if (Settings.SoundSync) { - if (extraOptions.benchmark) - IPPU.RenderThisFrame = true; - else + while (!S9xSyncSound()) + usleep(0); + } + + if (!macQTRecord) + { + if (macFrameSkip < 0) // auto skip { - if (Settings.SoundSync) - { - while (!S9xSyncSound()) - usleep(0); - } + skipFrames--; - if (!macQTRecord) + if (skipFrames <= 0) { - if (macFrameSkip < 0) // auto skip + adjustment = (Settings.TurboMode ? (macFrameAdvanceRate / macFastForwardRate) : macFrameAdvanceRate) / Memory.ROMFramesPerSecond; + currentFrame = GetMicroseconds(); + + skipFrames = (int32) ((currentFrame - lastFrame) / adjustment); + lastFrame += frameCount * adjustment; + + if (skipFrames < 1) + skipFrames = 1; + else + if (skipFrames > 7) { - skipFrames--; - - if (skipFrames <= 0) - { - adjustment = (Settings.TurboMode ? (macFrameAdvanceRate / macFastForwardRate) : macFrameAdvanceRate) / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); - - skipFrames = (int32) ((currentFrame - lastFrame) / adjustment); - lastFrame += frameCount * adjustment; - - if (skipFrames < 1) - skipFrames = 1; - else - if (skipFrames > 7) - { - skipFrames = 7; - Microseconds((UnsignedWide *) &lastFrame); - } - - frameCount = skipFrames; - - if (lastFrame > currentFrame) - usleep((useconds_t) (lastFrame - currentFrame)); - - IPPU.RenderThisFrame = true; - } - else - IPPU.RenderThisFrame = false; + skipFrames = 7; + lastFrame = GetMicroseconds(); } - else // constant - { - skipFrames--; - if (skipFrames <= 0) - { - adjustment = macFrameAdvanceRate * macFrameSkip / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); + frameCount = skipFrames; - if (currentFrame - lastFrame < adjustment) - { - usleep((useconds_t) (adjustment + lastFrame - currentFrame)); - Microseconds((UnsignedWide *) ¤tFrame); - } - - lastFrame = currentFrame; - skipFrames = macFrameSkip; - if (Settings.TurboMode) - skipFrames *= macFastForwardRate; - - IPPU.RenderThisFrame = true; - } - else - IPPU.RenderThisFrame = false; - } - } - else - { - MacQTRecordFrame(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); - - adjustment = macFrameAdvanceRate / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); - - if (currentFrame - lastFrame < adjustment) - usleep((useconds_t) (adjustment + lastFrame - currentFrame)); - - lastFrame = currentFrame; + if (lastFrame > currentFrame) + usleep((useconds_t) (lastFrame - currentFrame)); IPPU.RenderThisFrame = true; } + else + IPPU.RenderThisFrame = false; + } + else // constant + { + skipFrames--; + + if (skipFrames <= 0) + { + adjustment = macFrameAdvanceRate * macFrameSkip / Memory.ROMFramesPerSecond; + currentFrame = GetMicroseconds(); + + if (currentFrame - lastFrame < adjustment) + { + usleep((useconds_t) (adjustment + lastFrame - currentFrame)); + currentFrame = GetMicroseconds(); + } + + lastFrame = currentFrame; + skipFrames = macFrameSkip; + if (Settings.TurboMode) + skipFrames *= macFastForwardRate; + + IPPU.RenderThisFrame = true; + } + else + IPPU.RenderThisFrame = false; } } else - IPPU.RenderThisFrame = false; + { + //MacQTRecordFrame(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); + + adjustment = macFrameAdvanceRate / Memory.ROMFramesPerSecond; + currentFrame = GetMicroseconds(); + + if (currentFrame - lastFrame < adjustment) + usleep((useconds_t) (adjustment + lastFrame - currentFrame)); + + lastFrame = currentFrame; + + IPPU.RenderThisFrame = true; + } } void S9xAutoSaveSRAM (void) @@ -3322,9 +2716,9 @@ void S9xMessage (int type, int number, const char *message) { printf("%s\n", message); - if ((type == S9X_INFO) && (number == S9X_ROM_INFO)) - if (strstr(message, "checksum ok") == NULL) - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint); +// if ((type == S9X_INFO) && (number == S9X_ROM_INFO)) +// if (strstr(message, "checksum ok") == NULL) +// AppearanceAlert(kAlertCautionAlert, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint); } else { @@ -3352,16 +2746,645 @@ void S9xToggleSoundChannel (int c) void S9xExit (void) { - PlayAlertSound(); + NSBeep(); running = false; cartOpen = false; - - QuitApplicationEventLoop(); } -void QuitWithFatalError (OSStatus err, const char *msg) +void QuitWithFatalError ( NSString *message) { - printf("Quit. %s err: %ld\n", msg, err); - ExitToShell(); + NSError *error = [NSError errorWithDomain:@"com.snes9x" code:0 userInfo:@{ NSLocalizedFailureReasonErrorKey: message }]; + NSAlert *alert = [NSAlert alertWithError:error]; + [alert runModal]; + [NSApp terminate:nil]; } + +@implementation S9xView + ++ (void)initialize +{ + keyLock = PTHREAD_MUTEX_INITIALIZER; +} + +- (instancetype)initWithFrame:(NSRect)frameRect +{ + self = [super initWithFrame:frameRect]; + + if (self) + { + NSView *dimmedView = [[NSView alloc] initWithFrame:frameRect]; + dimmedView.wantsLayer = YES; + dimmedView.layer.backgroundColor = NSColor.blackColor.CGColor; + dimmedView.layer.opacity = 0.5; + dimmedView.layer.zPosition = 100.0; + dimmedView.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:dimmedView]; + + [dimmedView.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES; + [dimmedView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES; + [dimmedView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES; + [dimmedView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES; + + dimmedView.hidden = YES; + } + + return self; +} + +- (void)viewWillMoveToWindow:(NSWindow *)newWindow +{ + newWindow.acceptsMouseMovedEvents = YES; +} + +- (void)keyDown:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + pthread_mutex_lock(&keyLock); + S9xButton button = keyCodes[event.keyCode]; + if ( button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player <= MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = true; + } + + for ( NSUInteger i = 0; i < kNumFunctionButtons; ++i ) + { + if ( event.keyCode == functionButtons[i]) + { + pressedFunctionButtons[i] = true; + break; + } + } + + pressedRawKeyboardButtons[event.keyCode] = true; + + pthread_mutex_unlock(&keyLock); +} + +- (void)keyUp:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + pthread_mutex_lock(&keyLock); + S9xButton button = keyCodes[event.keyCode]; + if ( button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player <= MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = false; + } + + for ( NSUInteger i = 0; i < kNumFunctionButtons; ++i ) + { + if ( event.keyCode == functionButtons[i]) + { + pressedFunctionButtons[i] = false; + heldFunctionButtons[i] = false; + break; + } + } + + pressedRawKeyboardButtons[event.keyCode] = false; + + pthread_mutex_unlock(&keyLock); +} + +- (void)flagsChanged:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + pthread_mutex_lock(&keyLock); + + NSEventModifierFlags flags = event.modifierFlags; + + struct S9xButton button = keyCodes[kVK_Shift]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagShift) != 0; + } + + button = keyCodes[kVK_Command]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagCommand) != 0; + } + + button = keyCodes[kVK_Control]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagControl) != 0; + } + + button = keyCodes[kVK_Option]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagOption) != 0; + } + + pthread_mutex_unlock(&keyLock); +} + +- (void)mouseDown:(NSEvent *)event +{ + if ( useMouse ) + { + switch (deviceSetting) + { + case Mouse: + case SuperScope: + case Justifier1: + pressedKeys[0][kKeyMouseLeft] = true; + break; + + case Mouse2: + case Justifier2: + pressedKeys[1][kKeyMouseLeft] = true; + break; + + default: + break; + } + } + else + { + pauseEmulation = true; + [s9xView updatePauseOverlay]; + } +} + +- (void)mouseUp:(NSEvent *)event +{ + if ( useMouse ) + { + switch (deviceSetting) + { + case Mouse: + case SuperScope: + case Justifier1: + pressedKeys[0][kKeyMouseLeft] = false; + break; + + case Mouse2: + case Justifier2: + pressedKeys[1][kKeyMouseLeft] = false; + break; + + default: + break; + } + } +} + +- (void)rightMouseDown:(NSEvent *)event +{ + if ( useMouse ) + { + switch (deviceSetting) + { + case Mouse: + case SuperScope: + case Justifier1: + pressedKeys[0][kKeyMouseRight] = true; + break; + + case Mouse2: + case Justifier2: + pressedKeys[1][kKeyMouseRight] = true; + break; + + default: + break; + } + } +} + +- (void)rightMouseUp:(NSEvent *)event +{ + if ( useMouse ) + { + switch (deviceSetting) + { + case Mouse: + case SuperScope: + case Justifier1: + pressedKeys[0][kKeyMouseRight] = false; + break; + + case Mouse2: + case Justifier2: + pressedKeys[1][kKeyMouseRight] = false; + break; + + default: + break; + } + } +} + +- (void)mouseMoved:(NSEvent *)event +{ + if ( useMouse && running && !pauseEmulation ) + { + rawMouseX += event.deltaX; + rawMouseY += event.deltaY; + CGRect bounds = self.bounds; + + if (rawMouseX < 0) + { + rawMouseX = 0; + } + else if (rawMouseX > bounds.size.width) + { + rawMouseX = bounds.size.width; + } + + if (rawMouseY < 0) + { + rawMouseY = 0; + } + else if ( rawMouseY > bounds.size.height) + { + rawMouseY = bounds.size.height; + } + + mouseX = (int16) (rawMouseX / ((float) bounds.size.width ) * (float) IPPU.RenderedScreenWidth); + mouseY = (int16) (rawMouseY / ((float) bounds.size.height) * (float) IPPU.RenderedScreenHeight); + } +} + +- (void)mouseDragged:(NSEvent *)event +{ + [self mouseMoved:event]; +} + +- (void)rightMouseDragged:(NSEvent *)event +{ + [self mouseMoved:event]; +} + +- (void)otherMouseDragged:(NSEvent *)event +{ + [self mouseMoved:event]; +} + +- (void)updatePauseOverlay +{ + dispatch_async(dispatch_get_main_queue(), ^{ + self.subviews[0].hidden = (frzselecting || !pauseEmulation); + CGFloat scaleFactor = MAX(self.window.backingScaleFactor, 1.0); + glScreenW = self.frame.size.width * scaleFactor; + glScreenH = self.frame.size.height * scaleFactor; + + BOOL showMouse = !useMouse || !running || pauseEmulation; + CGAssociateMouseAndMouseCursorPosition(showMouse); + + if (showMouse) + { + [NSCursor unhide]; + } + else + { + CGRect frame = self.frame; + CGPoint point = CGPointMake(frame.size.width / 2.0, frame.size.height / 2.0); + point = [self convertPoint:point toView:nil]; + point = [self.window convertPointToScreen:point]; + point.y = self.window.screen.frame.size.height - point.y; + CGWarpMouseCursorPosition(point); + [NSCursor hide]; + } + }); +} + +- (void)setFrame:(NSRect)frame +{ + if ( !NSEqualRects(frame, self.frame) ) + { + [super setFrame:frame]; + } +} + +- (BOOL)acceptsFirstResponder +{ + return YES; +} + +- (BOOL)canBecomeKeyView +{ + return YES; +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + return !( running && !pauseEmulation); +} + +@end + +@implementation S9xEngine + +- (instancetype)init +{ + if (self = [super init]) + { + Initialize(); + [self recreateS9xView]; + } + + return self; +} + +- (void)dealloc +{ + Deinitialize(); +} + +- (void)recreateS9xView +{ + [s9xView removeFromSuperview]; + S9xDeinitDisplay(); + CGRect frame = NSMakeRect(0, 0, SNES_WIDTH * 2, SNES_HEIGHT * 2); + s9xView = [[S9xView alloc] initWithFrame:frame]; + s9xView.translatesAutoresizingMaskIntoConstraints = NO; + s9xView.autoresizingMask = NSViewWidthSizable|NSViewHeightSizable; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:s9xView attribute:NSLayoutAttributeWidth multiplier:(CGFloat)SNES_HEIGHT/(CGFloat)SNES_WIDTH constant:0.0]]; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_WIDTH * 2.0]]; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_HEIGHT * 2.0]]; + s9xView.device = MTLCreateSystemDefaultDevice(); + S9xInitDisplay(NULL, NULL); +} + +- (void)start +{ +#ifdef DEBUGGER + CPU.Flags |= DEBUG_MODE_FLAG; + S9xDoDebug(); +#endif + + lastFrame = GetMicroseconds(); + frameCount = 0; + if (macFrameSkip < 0) + skipFrames = 3; + else + skipFrames = macFrameSkip; + + S9xInitDisplay(NULL, NULL); + + [NSThread detachNewThreadWithBlock:^ + { + MacSnes9xThread(NULL); + }]; +} + +- (void)stop +{ + SNES9X_Quit(); + S9xExit(); +} + +- (void)softwareReset +{ + SNES9X_SoftReset(); + SNES9X_Go(); + [self resume]; +} + + +- (void)hardwareReset +{ + SNES9X_Reset(); + SNES9X_Go(); + [self resume]; +} + +- (BOOL)isRunning +{ + return running; +} + +- (BOOL)isPaused +{ + return running && pauseEmulation; +} + +- (void)pause +{ + pauseEmulation = true; + [s9xView updatePauseOverlay]; +} + +- (void)quit +{ + SNES9X_Quit(); + [self pause]; +} + +- (void)resume +{ + pauseEmulation = false; + [s9xView updatePauseOverlay]; +} + +- (NSArray *)listJoypads +{ + pthread_mutex_lock(&keyLock); + NSMutableArray *joypads = [NSMutableArray new]; + for (auto joypadStruct : ListJoypads()) + { + S9xJoypad *joypad = [S9xJoypad new]; + joypad.vendorID = joypadStruct.vendorID; + joypad.productID = joypadStruct.productID; + joypad.index = joypadStruct.index; + joypad.name = [[NSString alloc] initWithUTF8String:NameForDevice(joypadStruct).c_str()]; + + [joypads addObject:joypad]; + } + + [joypads sortUsingComparator:^NSComparisonResult(S9xJoypad *a, S9xJoypad *b) + { + NSComparisonResult result = [a.name compare:b.name]; + + if ( result == NSOrderedSame ) + { + result = [@(a.vendorID) compare:@(b.vendorID)]; + } + + if ( result == NSOrderedSame ) + { + result = [@(a.productID) compare:@(b.productID)]; + } + + if ( result == NSOrderedSame ) + { + result = [@(a.index) compare:@(b.index)]; + } + + return result; + }]; + pthread_mutex_unlock(&keyLock); + + return joypads; +} + +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index oldPlayer:(int8 *)oldPlayer +{ + pthread_mutex_lock(&keyLock); + SetPlayerForJoypad(player, vendorID, productID, index, oldPlayer); + pthread_mutex_unlock(&keyLock); +} + +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value oldButton:(S9xButtonCode *)oldButton +{ + BOOL result = NO; + pthread_mutex_lock(&keyLock); + result = SetButtonCodeForJoypadControl(vendorID, productID, index, cookie, value, button, true, oldButton); + pthread_mutex_unlock(&keyLock); + return result; +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + pthread_mutex_lock(&keyLock); + ClearJoypad(vendorID, productID, index); + pthread_mutex_unlock(&keyLock); +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode +{ + pthread_mutex_lock(&keyLock); + ClearButtonCodeForJoypad(vendorID, productID, index, buttonCode); + pthread_mutex_unlock(&keyLock); +} + +- (NSArray *)getInputsForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + pthread_mutex_lock(&keyLock); + NSMutableArray *inputs = [NSMutableArray new]; + std::unordered_map buttonCodeMap = GetJuypadButtons(vendorID, productID, index); + for (auto it = buttonCodeMap.begin(); it != buttonCodeMap.end(); ++it) + { + S9xJoypadInput *input = [S9xJoypadInput new]; + input.cookie = it->first.cookie.cookie; + input.value = it->first.value; + input.buttonCode = it->second; + + [inputs addObject:input]; + } + pthread_mutex_unlock(&keyLock); + + return inputs; +} + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value +{ + return [NSString stringWithUTF8String:LabelForInput(vendorID, productID, cookie, value).c_str()]; +} + +- (BOOL)setButton:(S9xButtonCode)button forKey:(int16)key player:(int8)player oldButton:(S9xButtonCode *)oldButton oldPlayer:(int8 *)oldPlayer oldKey:(int16 *)oldKey +{ + BOOL result = NO; + pthread_mutex_lock(&keyLock); + result = SetKeyCode(key, button, player, oldKey, oldButton, oldPlayer); + pthread_mutex_unlock(&keyLock); + return result; +} + +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player +{ + pthread_mutex_lock(&keyLock); + ClearKeyCode(button, player); + pthread_mutex_unlock(&keyLock); +} + +- (BOOL)loadROM:(NSURL *)fileURL +{ + running = false; + frzselecting = false; + + while (!Settings.StopEmulation) + { + usleep(Settings.FrameTime); + } + + if ( SNES9X_OpenCart(fileURL) ) + { + SNES9X_Go(); + s9xView.window.title = fileURL.lastPathComponent.stringByDeletingPathExtension; + [s9xView.window makeKeyAndOrderFront:nil]; + + dispatch_async(dispatch_get_main_queue(), ^ + { + [s9xView.window makeFirstResponder:s9xView]; + }); + + [self start]; + return YES; + } + + return NO; +} + +- (void)setShowFPS:(BOOL)showFPS +{ + Settings.DisplayFrameRate = showFPS; +} + +- (void)setVideoMode:(int)mode +{ + videoMode = mode; +} + +- (void)setMacFrameSkip:(int)_macFrameSkip +{ + macFrameSkip = _macFrameSkip; + + // contrains to -1 to 200 + if (macFrameSkip < -1) + macFrameSkip = -1; + if (macFrameSkip > 200) + macFrameSkip = 200; +} + +- (void)setDeviceSetting:(S9xDeviceSetting)_deviceSetting +{ + deviceSetting = _deviceSetting; + ChangeInputDevice(); +} + +@dynamic inputDelegate; +- (void)setInputDelegate:(id)delegate +{ + inputDelegate = delegate; +} + +- (id)inputDelegate +{ + return inputDelegate; +} + +@end + +@implementation S9xJoypad + +- (BOOL)isEqual:(id)object +{ + if (![object isKindOfClass:[self class]]) + { + return NO; + } + + S9xJoypad *other = (S9xJoypad *)object; + return (self.vendorID == other.vendorID && self.productID == other.productID && self.index == other.index); +} + +@end + +@implementation S9xJoypadInput +@end diff --git a/macosx/mac-prefix.h b/macosx/mac-prefix.h index 7b29300a..f2f395e4 100755 --- a/macosx/mac-prefix.h +++ b/macosx/mac-prefix.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-prefs.cpp b/macosx/mac-prefs.cpp deleted file mode 100755 index f72b43ca..00000000 --- a/macosx/mac-prefs.cpp +++ /dev/null @@ -1,1587 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "blit.h" - -#include -#define __STDC_FORMAT_MACROS -#include - -#include "mac-prefix.h" -#include "mac-audio.h" -#include "mac-cart.h" -#include "mac-coreimage.h" -#include "mac-dialog.h" -#include "mac-file.h" -#include "mac-keyboard.h" -#include "mac-os.h" -#include "mac-render.h" -#include "mac-snes9x.h" -#include "mac-stringtools.h" -#include "mac-prefs.h" - -enum -{ - iNibGFullScreen = 1, - iNibGSwitchResolution, - iNibGShowFrameRate, - iNibGCIFilterEnable, - iNibGTransparency, - iNibGGL32bit, - iNibGGLStretch, - iNibGCoreImageFilter, - iNibGVideoMode, - iNibGDirectMP, - iNibGGLVSync, - iNibGDrawOverscan, - iNibGScreenCurvature, - iNibGCurvatureWarp, - iNibGAspectRatio, - iNibGAspectRatioText, - - iNibSSynchronize = 201, - iNibS16BitPlayback, - iNibSStereo, - iNibSReverseStereo, - iNibSPlaybackRate, - iNibSBufferSize, - iNibSVolume, - iNibSInputRate, - iNibSInputRateText, - iNibSAllowLag, - iNibSInterval, - - iNibOSaveFolder = 401, - iNibOAutoSaveInterval, - - iNibMCPUCycles = 601, - iNibMReserved1, - iNibMTurboSkipArrows, - iNibMTurboSkipText, - iNibMFrameSkip, - iNibMAllowInvalidVRAMAccess, - iNibMAllowSpecificGameHacks, - - iNibXStartOpenDialog = 801, - iNibXShowTimeInFrz, - iNibXMusicBoxMode, - iNibXEnableToggle, - iNibXBSXBootup, - iNibXSaveWindowPos, - iNibXUseIPSPatch, - iNibXOnScreenInfo, - iNibXInactiveMode -}; - -enum -{ - iOpenGLBlocky = 1, - iOpenGLTVMode, - iOpenGLSmoothMode, - iOpenGLBlendMode, - iOpenGLEagleMode, - iOpenGL2xSAIMode, - iOpenGLSuper2xSAIMode, - iOpenGLEPXMode, - iOpenGLHQ2xMode, - iOpenGLHQ3xMode, - iOpenGLHQ4xMode, - iOpenGLNTSC_CMode, - iOpenGLNTSC_SMode, - iOpenGLNTSC_RMode, - iOpenGLNTSC_MMode, - iOpenGLNTSC_TV_CMode, - iOpenGLNTSC_TV_SMode, - iOpenGLNTSC_TV_RMode, - iOpenGLNTSC_TV_MMode -}; - -enum -{ - iNibSaveFolderNameMenuItem = 5 -}; - -static int lastTabIndex = 1; -static int tabList[] = { 5, 129, 130, 131, 132, 133 }; - -struct PrefList -{ - OSType itemName; - void *itemPointer; - int size; -}; - -static PrefList prefList[] = -{ - { 'flsc', &fullscreen, sizeof(bool8 ) }, - { 'reso', &autoRes, sizeof(bool8 ) }, - { 'dfps', &Settings.DisplayFrameRate, sizeof(bool8 ) }, - { 'tran', &Settings.Transparency, sizeof(bool8 ) }, - { 'gl32', &gl32bit, sizeof(bool8 ) }, - { 'glst', &glstretch, sizeof(bool8 ) }, - { 'draw', &drawingMethod, sizeof(long ) }, - { 'Vmod', &videoMode, sizeof(int ) }, - { 'MPmt', &multiprocessor, sizeof(bool8 ) }, - { 'VSNC', &vsync, sizeof(bool8 ) }, - { 'H239', &drawoverscan, sizeof(bool8 ) }, - { 'SCur', &screencurvature, sizeof(bool8 ) }, - { 'SCuW', &macCurvatureWarp, sizeof(int ) }, - { 'ASPe', &macAspectRatio, sizeof(int ) }, - { 'CIFl', &ciFilterEnable, sizeof(bool8 ) }, - - { 'sSyn', &Settings.SoundSync, sizeof(bool8 ) }, - { 'srat', &Settings.SoundPlaybackRate, sizeof(uint32 ) }, - { 'InRt', &Settings.SoundInputRate, sizeof(uint32 ) }, - { 'MxIv', &macSoundInterval_ms, sizeof(uint32 ) }, - { 'SBuf', &macSoundBuffer_ms, sizeof(uint32 ) }, - { 'Volm', &macSoundVolume, sizeof(SInt32 ) }, - { 'AUef', &aueffect, sizeof(uint16 ) }, - { 'AUce', &cureffect, sizeof(int ) }, - - { 'romf', &saveInROMFolder, sizeof(uint8 ) }, - { 'atsv', &Settings.AutoSaveDelay, sizeof(int32 ) }, - { 'RFlg', &macRecordFlag, sizeof(uint16 ) }, - { 'PFlg', &macPlayFlag, sizeof(uint16 ) }, - { 'QTfg', &macQTMovFlag, sizeof(uint16 ) }, - - { 'HHck', &Settings.HDMATimingHack, sizeof(int32 ) }, - { 'TbRt', &macFastForwardRate, sizeof(int ) }, - { 'FSkp', &macFrameSkip, sizeof(int ) }, - { 'IvVR', &Settings.BlockInvalidVRAMAccessMaster, sizeof(bool8 ) }, - { 'GSHk', &Settings.DisableGameSpecificHacks, sizeof(bool8 ) }, - - { 'StOp', &startopendlog, sizeof(bool8 ) }, - { 'STiF', &showtimeinfrz, sizeof(bool8 ) }, - { 'Togl', &enabletoggle, sizeof(bool8 ) }, - { 'SvWp', &savewindowpos, sizeof(bool8 ) }, - { 'OnSc', &onscreeninfo, sizeof(bool8 ) }, - { 'NIPS', &Settings.NoPatch, sizeof(bool8 ) }, - { 'BSX_', &Settings.BSXBootup, sizeof(bool8 ) }, - { 'MbxM', &musicboxmode, sizeof(int ) }, - { 'InAc', &inactiveMode, sizeof(int ) }, - - { 'tab ', &lastTabIndex, sizeof(int ) }, - { 'Ftab', &autofireLastTabIndex, sizeof(int ) }, - { 'keyb', keyCode, sizeof(keyCode ) }, - { 'pset', &padSetting, sizeof(int ) }, - { 'dset', &deviceSetting, sizeof(int ) }, - { 'chea', &applycheat, sizeof(bool8 ) }, - - { 'ARec', autofireRec, sizeof(autofireRec) }, - { 'wPos', windowPos, sizeof(windowPos ) }, - { 'wSiz', windowSize, sizeof(windowSize ) }, - { 'wExt', (void *) &windowExtend, sizeof(bool8 ) }, - - { 'NPIP', npServerIP, sizeof(npServerIP ) }, - { 'NPNM', npName, sizeof(npName ) }, - - { 'L239', &lastoverscan, sizeof(bool8 ) }, - - { 'ExT1', &(extraOptions.benchmark), sizeof(bool8 ) }, - { 'ExT2', &(extraOptions.glForceNoTextureRectangle), sizeof(bool8 ) }, - { 'ExT3', &(extraOptions.glUseClientStrageApple), sizeof(bool8 ) }, - { 'ExT4', &(extraOptions.glUseTexturePriority), sizeof(bool8 ) }, - { 'ExT5', &(extraOptions.glStorageHint), sizeof(int ) } -}; - -#define kPrefListSize (sizeof(prefList) / sizeof(prefList[0])) - -static void SelectTabPane (HIViewRef, SInt16); -static pascal void InputRateSliderActionProc (HIViewRef, HIViewPartCode); -static pascal void LittleArrowsActionProc (HIViewRef, HIViewPartCode); -static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus TabEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef, EventRef, void *); - - -void SavePrefs (void) -{ - CFMutableStringRef mref; - CFStringRef sref; - CFDataRef data; - - for (unsigned int i = 0; i < kPrefListSize; i++) - { - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); - if (mref) - { - sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); - if (sref) - { - CFStringAppend(mref, sref); - - data = CFDataCreate(kCFAllocatorDefault, (UInt8 *) prefList[i].itemPointer, prefList[i].size); - if (data) - { - CFPreferencesSetAppValue(mref, data, kCFPreferencesCurrentApplication); - CFRelease(data); - } - - CFRelease(sref); - } - - CFRelease(mref); - } - } - - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); - if (mref) - { - if (saveFolderPath) - { - CFPreferencesSetAppValue(mref, saveFolderPath, kCFPreferencesCurrentApplication); - CFRelease(saveFolderPath); - } - else - CFPreferencesSetAppValue(mref, NULL, kCFPreferencesCurrentApplication); - - CFRelease(mref); - } - - sref = (CFStringRef) CFDictionaryGetValue(CFBundleGetInfoDictionary(CFBundleGetMainBundle()), CFSTR("CFBundleShortVersionString")); - if (sref) - { - CFPreferencesSetAppValue(CFSTR("LastVersionUsed"), sref, kCFPreferencesCurrentApplication); - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -void LoadPrefs (void) -{ - CFMutableStringRef mref; - CFStringRef sref; - CFDataRef data; - - for (unsigned int i = 0; i < kPrefListSize; i++) - { - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); - if (mref) - { - sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); - if (sref) - { - CFStringAppend(mref, sref); - - data = (CFDataRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); - if (data) - { - if (CFDataGetLength(data) == prefList[i].size) - CFDataGetBytes(data, CFRangeMake(0, prefList[i].size), (UInt8 *) prefList[i].itemPointer); - CFRelease(data); - } - - CFRelease(sref); - } - - CFRelease(mref); - } - } - - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); - if (mref) - { - sref = (CFStringRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); - if (sref) - saveFolderPath = sref; - - CFRelease(mref); - } - - sref = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("LastVersionUsed"), kCFPreferencesCurrentApplication); - if (!sref) { - Settings.SoundInputRate = 31950; - macSoundBuffer_ms = 80; - } - else CFRelease(sref); -} - -void ConfigurePreferences (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - SInt32 oldVolume; - uint32 oldPlaybackRate, oldInputRate, oldInterval, oldBufferSize; - bool8 oldSynchronize, old16BitPlayback, oldStereo, oldReverseStereo, oldLagEnable; - - oldSynchronize = Settings.SoundSync; - old16BitPlayback = Settings.SixteenBitSound; - oldStereo = Settings.Stereo; - oldReverseStereo = Settings.ReverseStereo; - oldPlaybackRate = Settings.SoundPlaybackRate; - oldInputRate = Settings.SoundInputRate; - oldInterval = macSoundInterval_ms; - oldBufferSize = macSoundBuffer_ms; - oldLagEnable = macSoundLagEnable; - oldVolume = macSoundVolume; - - if (cartOpen) - DeinitGameWindow(); - - S9xGraphicsDeinit(); - - err = CreateWindowFromNib(nibRef, CFSTR("Preferences"), &tWindowRef); - if (err == noErr) - { - EventHandlerUPP tUPP, iUPP, aUPP, pUPP; - EventHandlerRef tRef, iRef, aRef, pRef; - EventTypeSpec tEvents[] = { { kEventClassControl, kEventControlHit } }, - iEvents[] = { { kEventClassControl, kEventControlClick } }, - aEvents[] = { { kEventClassControl, kEventControlClick } }, - pEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - ControlActionUPP arrowsUPP, sliderUPP; - HIViewRef ctl, root; - HIViewID cid; - MenuRef menu; - char num[16]; - - root = HIViewGetRoot(tWindowRef); - - cid.signature = 'tabs'; - cid.id = 128; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, lastTabIndex); - SelectTabPane(ctl, lastTabIndex); - tUPP = NewEventHandlerUPP(TabEventHandler); - err = InstallControlEventHandler(ctl, tUPP, GetEventTypeCount(tEvents), tEvents, 0, &tRef); - - cid.signature = 'snd_'; - cid.id = iNibSInputRateText; - HIViewFindByID(root, cid, &ctl); - iUPP = NewEventHandlerUPP(InputRateTextEventHandler); - err = InstallControlEventHandler(ctl, iUPP, GetEventTypeCount(iEvents), iEvents, 0, &iRef); - - cid.signature = 'grap'; - cid.id = iNibGAspectRatioText; - HIViewFindByID(root, cid, &ctl); - aUPP = NewEventHandlerUPP(AspectRatioTextEventHandler); - err = InstallControlEventHandler(ctl, aUPP, GetEventTypeCount(aEvents), aEvents, 0, &aRef); - - pUPP = NewEventHandlerUPP(PreferencesEventHandler); - err = InstallWindowEventHandler(tWindowRef, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) tWindowRef, &pRef); - - sliderUPP = NewControlActionUPP(InputRateSliderActionProc); - arrowsUPP = NewControlActionUPP(LittleArrowsActionProc); - - cid.signature = 'grap'; - - cid.id = iNibGFullScreen; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, fullscreen); - - cid.id = iNibGSwitchResolution; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, autoRes); - - cid.id = iNibGShowFrameRate; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.DisplayFrameRate); - - cid.id = iNibGTransparency; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.Transparency); - - cid.id = iNibGGL32bit; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, gl32bit); - - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, glstretch); - - cid.id = iNibGVideoMode; - HIViewFindByID(root, cid, &ctl); - switch (videoMode) - { - case VIDEOMODE_BLOCKY: - SetControl32BitValue(ctl, iOpenGLBlocky); - break; - - case VIDEOMODE_TV: - SetControl32BitValue(ctl, iOpenGLTVMode); - break; - - case VIDEOMODE_SMOOTH: - SetControl32BitValue(ctl, iOpenGLSmoothMode); - break; - - case VIDEOMODE_BLEND: - SetControl32BitValue(ctl, iOpenGLBlendMode); - break; - - case VIDEOMODE_SUPEREAGLE: - SetControl32BitValue(ctl, iOpenGLEagleMode); - break; - - case VIDEOMODE_2XSAI: - SetControl32BitValue(ctl, iOpenGL2xSAIMode); - break; - - case VIDEOMODE_SUPER2XSAI: - SetControl32BitValue(ctl, iOpenGLSuper2xSAIMode); - break; - - case VIDEOMODE_EPX: - SetControl32BitValue(ctl, iOpenGLEPXMode); - break; - - case VIDEOMODE_HQ2X: - SetControl32BitValue(ctl, iOpenGLHQ2xMode); - break; - - case VIDEOMODE_HQ3X: - SetControl32BitValue(ctl, iOpenGLHQ3xMode); - break; - - case VIDEOMODE_HQ4X: - SetControl32BitValue(ctl, iOpenGLHQ4xMode); - break; - - case VIDEOMODE_NTSC_C: - SetControl32BitValue(ctl, iOpenGLNTSC_CMode); - break; - - case VIDEOMODE_NTSC_S: - SetControl32BitValue(ctl, iOpenGLNTSC_SMode); - break; - - case VIDEOMODE_NTSC_R: - SetControl32BitValue(ctl, iOpenGLNTSC_RMode); - break; - - case VIDEOMODE_NTSC_M: - SetControl32BitValue(ctl, iOpenGLNTSC_MMode); - break; - - case VIDEOMODE_NTSC_TV_C: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_CMode); - break; - - case VIDEOMODE_NTSC_TV_S: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_SMode); - break; - - case VIDEOMODE_NTSC_TV_R: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_RMode); - break; - - case VIDEOMODE_NTSC_TV_M: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_MMode); - break; - } - - cid.id = iNibGDirectMP; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, multiprocessor); - - cid.id = iNibGGLVSync; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, vsync); - - cid.id = iNibGDrawOverscan; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, drawoverscan); - - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, screencurvature); - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macCurvatureWarp); - if (!screencurvature) - DeactivateControl(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macAspectRatio); - if (!glstretch) - DeactivateControl(ctl); - - cid.id = iNibGCIFilterEnable; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, ciFilterEnable); - if (systemVersion < 0x1040) - DisableControl(ctl); - - if (systemVersion < 0x1040) - { - cid.id = iNibGCoreImageFilter; - HIViewFindByID(root, cid, &ctl); - DisableControl(ctl); - } - - cid.signature = 'snd_'; - - cid.id = iNibSSynchronize; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SoundSync); - - cid.id = iNibS16BitPlayback; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SixteenBitSound); - DeactivateControl(ctl); - - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.Stereo); - DeactivateControl(ctl); - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.ReverseStereo); - DeactivateControl(ctl); - - cid.id = iNibSPlaybackRate; - HIViewFindByID(root, cid, &ctl); - switch (Settings.SoundPlaybackRate) - { - case 48000: - SetControl32BitValue(ctl, 1); - break; - - case 44100: - SetControl32BitValue(ctl, 2); - break; - - case 35000: - SetControl32BitValue(ctl, 3); - break; - - case 32000: - SetControl32BitValue(ctl, 4); - break; - - case 30000: - SetControl32BitValue(ctl, 5); - break; - - case 22050: - SetControl32BitValue(ctl, 6); - break; - - case 16000: - SetControl32BitValue(ctl, 7); - break; - - case 11025: - SetControl32BitValue(ctl, 8); - break; - - case 8000: - SetControl32BitValue(ctl, 9); - break; - } - - cid.id = iNibSInputRate; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SoundInputRate); - SetControlAction(ctl, sliderUPP); - - cid.id = iNibSInputRateText; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", Settings.SoundInputRate); - SetStaticTextCStr(ctl, num, false); - - cid.id = iNibSInterval; - HIViewFindByID(root, cid, &ctl); - switch (macSoundInterval_ms) - { - case 8: - SetControl32BitValue(ctl, 1); - break; - - case 16: - SetControl32BitValue(ctl, 2); - break; - - case 32: - SetControl32BitValue(ctl, 3); - break; - - case 64: - SetControl32BitValue(ctl, 4); - break; - - case 0: - default: - SetControl32BitValue(ctl, 6); - break; - } - - cid.id = iNibSBufferSize; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundBuffer_ms / 20); - - cid.id = iNibSAllowLag; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundLagEnable); - DeactivateControl(ctl); - - cid.id = iNibSVolume; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundVolume); - - cid.signature = 'othe'; - - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, saveInROMFolder + 1); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - if (saveFolderPath) - { - CFURLRef url; - CFStringRef ref; - - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, saveFolderPath, kCFURLPOSIXPathStyle, true); - ref = CFURLCopyLastPathComponent(url); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); - CFRelease(ref); - CFRelease(url); - EnableMenuItem(menu, iNibSaveFolderNameMenuItem); - } - else - { - CFStringRef ref; - - ref = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); - CFRelease(ref); - DisableMenuItem(menu, iNibSaveFolderNameMenuItem); - } - - cid.id = iNibOAutoSaveInterval; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", Settings.AutoSaveDelay); - SetEditTextCStr(ctl, num, false); - - cid.signature = 'msc2'; - - cid.id = iNibMCPUCycles; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%" PRIi32, Settings.HDMATimingHack); - SetEditTextCStr(ctl, num, false); - - cid.id = iNibMTurboSkipArrows; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macFastForwardRate); - SetControlAction(ctl, arrowsUPP); - - cid.id = iNibMTurboSkipText; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", macFastForwardRate); - SetStaticTextCStr(ctl, num, false); - - cid.id = iNibMFrameSkip; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macFrameSkip + 2); - - cid.id = iNibMAllowInvalidVRAMAccess; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.BlockInvalidVRAMAccessMaster); - - cid.id = iNibMAllowSpecificGameHacks; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.DisableGameSpecificHacks); - - cid.signature = 'osx_'; - - cid.id = iNibXStartOpenDialog; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, startopendlog); - - cid.id = iNibXShowTimeInFrz; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, showtimeinfrz); - - cid.id = iNibXMusicBoxMode; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, musicboxmode); - - cid.id = iNibXEnableToggle; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, enabletoggle); - - cid.id = iNibXSaveWindowPos; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, savewindowpos); - - cid.id = iNibXUseIPSPatch; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.NoPatch); - - cid.id = iNibXOnScreenInfo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, onscreeninfo); - - cid.id = iNibXInactiveMode; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, inactiveMode); - - cid.id = iNibXBSXBootup; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.BSXBootup); - - MoveWindowPosition(tWindowRef, kWindowPreferences, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowPreferences); - - cid.signature = 'grap'; - - cid.id = iNibGFullScreen; - HIViewFindByID(root, cid, &ctl); - fullscreen = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGSwitchResolution; - HIViewFindByID(root, cid, &ctl); - autoRes = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGShowFrameRate; - HIViewFindByID(root, cid, &ctl); - Settings.DisplayFrameRate = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGTransparency; - HIViewFindByID(root, cid, &ctl); - Settings.Transparency = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGL32bit; - HIViewFindByID(root, cid, &ctl); - gl32bit = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - glstretch = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGVideoMode; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case iOpenGLBlocky: - drawingMethod = kDrawingOpenGL; - videoMode = VIDEOMODE_BLOCKY; - break; - - case iOpenGLTVMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_TV; - break; - - case iOpenGLSmoothMode: - drawingMethod = kDrawingOpenGL; - videoMode = VIDEOMODE_SMOOTH; - break; - - case iOpenGLBlendMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_BLEND; - break; - - case iOpenGLEagleMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_SUPEREAGLE; - break; - - case iOpenGL2xSAIMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_2XSAI; - break; - - case iOpenGLSuper2xSAIMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_SUPER2XSAI; - break; - - case iOpenGLEPXMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_EPX; - break; - - case iOpenGLHQ2xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ2X; - break; - - case iOpenGLHQ3xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ3X; - break; - - case iOpenGLHQ4xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ4X; - break; - - case iOpenGLNTSC_CMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_C; - S9xBlitNTSCFilterSet(&snes_ntsc_composite); - break; - - case iOpenGLNTSC_SMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_S; - S9xBlitNTSCFilterSet(&snes_ntsc_svideo); - break; - - case iOpenGLNTSC_RMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_R; - S9xBlitNTSCFilterSet(&snes_ntsc_rgb); - break; - - case iOpenGLNTSC_MMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_M; - S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); - break; - - case iOpenGLNTSC_TV_CMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_C; - S9xBlitNTSCFilterSet(&snes_ntsc_composite); - break; - - case iOpenGLNTSC_TV_SMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_S; - S9xBlitNTSCFilterSet(&snes_ntsc_svideo); - break; - - case iOpenGLNTSC_TV_RMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_R; - S9xBlitNTSCFilterSet(&snes_ntsc_rgb); - break; - - case iOpenGLNTSC_TV_MMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_M; - S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); - break; - } - - cid.id = iNibGDirectMP; - HIViewFindByID(root, cid, &ctl); - multiprocessor = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGLVSync; - HIViewFindByID(root, cid, &ctl); - vsync = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGDrawOverscan; - HIViewFindByID(root, cid, &ctl); - drawoverscan = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - screencurvature = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - macCurvatureWarp = GetControl32BitValue(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - macAspectRatio = GetControl32BitValue(ctl); - - cid.id = iNibGCIFilterEnable; - HIViewFindByID(root, cid, &ctl); - ciFilterEnable = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'snd_'; - - cid.id = iNibSSynchronize; - HIViewFindByID(root, cid, &ctl); - Settings.SoundSync = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibS16BitPlayback; - HIViewFindByID(root, cid, &ctl); - Settings.SixteenBitSound = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - Settings.Stereo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - Settings.ReverseStereo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSPlaybackRate; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case 1: - Settings.SoundPlaybackRate = 48000; - break; - - case 2: - Settings.SoundPlaybackRate = 44100; - break; - - case 3: - Settings.SoundPlaybackRate = 35000; - break; - - case 4: - Settings.SoundPlaybackRate = 32000; - break; - - case 5: - Settings.SoundPlaybackRate = 30000; - break; - - case 6: - Settings.SoundPlaybackRate = 22050; - break; - - case 7: - Settings.SoundPlaybackRate = 16000; - break; - - case 8: - Settings.SoundPlaybackRate = 11025; - break; - - case 9: - Settings.SoundPlaybackRate = 8000; - break; - } - - cid.id = iNibSInputRate; - HIViewFindByID(root, cid, &ctl); - Settings.SoundInputRate = GetControl32BitValue(ctl); - - cid.id = iNibSInterval; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case 1: - macSoundInterval_ms = 8; - break; - - case 2: - macSoundInterval_ms = 16; - break; - - case 3: - macSoundInterval_ms = 32; - break; - - case 4: - macSoundInterval_ms = 64; - break; - - case 6: - default: - macSoundInterval_ms = 0; - break; - } - - cid.id = iNibSBufferSize; - HIViewFindByID(root, cid, &ctl); - macSoundBuffer_ms = GetControl32BitValue(ctl) * 20; - - cid.id = iNibSAllowLag; - HIViewFindByID(root, cid, &ctl); - macSoundLagEnable = GetControl32BitValue(ctl); - - cid.id = iNibSVolume; - HIViewFindByID(root, cid, &ctl); - macSoundVolume = GetControl32BitValue(ctl); - - cid.signature = 'othe'; - - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - saveInROMFolder = GetControl32BitValue(ctl) - 1; - - cid.id = iNibOAutoSaveInterval; - HIViewFindByID(root, cid, &ctl); - GetEditTextCStr(ctl, num); - Settings.AutoSaveDelay = atoi(num); - - cid.signature = 'msc2'; - - cid.id = iNibMCPUCycles; - HIViewFindByID(root, cid, &ctl); - GetEditTextCStr(ctl, num); - Settings.HDMATimingHack = atoi(num); - if ((Settings.HDMATimingHack <= 0) || (Settings.HDMATimingHack >= 200)) - Settings.HDMATimingHack = 100; - - cid.id = iNibMTurboSkipArrows; - HIViewFindByID(root, cid, &ctl); - macFastForwardRate = GetControl32BitValue(ctl); - - cid.id = iNibMFrameSkip; - HIViewFindByID(root, cid, &ctl); - macFrameSkip = GetControl32BitValue(ctl) - 2; - - cid.id = iNibMAllowInvalidVRAMAccess; - HIViewFindByID(root, cid, &ctl); - Settings.BlockInvalidVRAMAccessMaster = GetControl32BitValue(ctl) ? false : true; - - cid.id = iNibMAllowSpecificGameHacks; - HIViewFindByID(root, cid, &ctl); - Settings.DisableGameSpecificHacks = GetControl32BitValue(ctl) ? false : true; - - cid.signature = 'osx_'; - - cid.id = iNibXStartOpenDialog; - HIViewFindByID(root, cid, &ctl); - startopendlog = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXShowTimeInFrz; - HIViewFindByID(root, cid, &ctl); - showtimeinfrz = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXMusicBoxMode; - HIViewFindByID(root, cid, &ctl); - musicboxmode = GetControl32BitValue(ctl); - - cid.id = iNibXEnableToggle; - HIViewFindByID(root, cid, &ctl); - enabletoggle = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXSaveWindowPos; - HIViewFindByID(root, cid, &ctl); - savewindowpos = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXUseIPSPatch; - HIViewFindByID(root, cid, &ctl); - Settings.NoPatch = GetControl32BitValue(ctl) ? false : true; - - cid.id = iNibXOnScreenInfo; - HIViewFindByID(root, cid, &ctl); - onscreeninfo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXInactiveMode; - HIViewFindByID(root, cid, &ctl); - inactiveMode = GetControl32BitValue(ctl); - - cid.id = iNibXBSXBootup; - HIViewFindByID(root, cid, &ctl); - Settings.BSXBootup = GetControl32BitValue(ctl) ? true : false; - - DisposeControlActionUPP(arrowsUPP); - DisposeControlActionUPP(sliderUPP); - - err = RemoveEventHandler(pRef); - DisposeEventHandlerUPP(pUPP); - - err = RemoveEventHandler(aRef); - DisposeEventHandlerUPP(aUPP); - - err = RemoveEventHandler(iRef); - DisposeEventHandlerUPP(iUPP); - - err = RemoveEventHandler(tRef); - DisposeEventHandlerUPP(tUPP); - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - - S9xGraphicsInit(); - - if (((oldSynchronize != Settings.SoundSync ) || - (old16BitPlayback != Settings.SixteenBitSound ) || - (oldStereo != Settings.Stereo ) || - (oldReverseStereo != Settings.ReverseStereo ) || - (oldPlaybackRate != Settings.SoundPlaybackRate) || - (oldInputRate != Settings.SoundInputRate ) || - (oldInterval != macSoundInterval_ms ) || - (oldBufferSize != macSoundBuffer_ms ) || - (oldLagEnable != macSoundLagEnable ) || - (oldVolume != macSoundVolume )) && cartOpen) - SNES9X_InitSound(); - - if (!fullscreen && cartOpen) - { - InitGameWindow(); - ShowWindow(gWindow); - } - - if (cartOpen) - { - FSRef ref; - - err = FSPathMakeRef((unsigned char *) Memory.ROMFilename, &ref, NULL); - if (err == noErr) - CheckSaveFolder(&ref); - } - } -} - -static void SelectTabPane (HIViewRef tabControl, SInt16 index) -{ - HIViewRef sup, userPane, selectedPane = NULL; - HIViewID cid; - - lastTabIndex = index; - - sup = HIViewGetSuperview(tabControl); - cid.signature = 'tabs'; - - for (int i = 1; i < tabList[0] + 1; i++) - { - cid.id = tabList[i]; - HIViewFindByID(sup, cid, &userPane); - - if (i == index) - selectedPane = userPane; - else - HIViewSetVisible(userPane, false); - } - - if (selectedPane != NULL) - HIViewSetVisible(selectedPane, true); - - HIViewSetNeedsDisplay(tabControl, true); -} - -static pascal void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode) -{ - HIViewRef ctl; - HIViewID cid; - char num[10]; - - cid.signature = 'snd_'; - cid.id = iNibSInputRateText; - HIViewFindByID(HIViewGetSuperview(slider), cid, &ctl); - - sprintf(num, "%ld", GetControl32BitValue(slider)); - SetStaticTextCStr(ctl, num, true); -} - -static pascal void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode) -{ - HIViewRef ctl; - HIViewID cid = { 'msc2', iNibMTurboSkipText }; - char num[8]; - - if (partCode == kControlUpButtonPart) - SetControl32BitValue(arrows, GetControl32BitValue(arrows) + 1); - else - if (partCode == kControlDownButtonPart) - SetControl32BitValue(arrows, GetControl32BitValue(arrows) - 1); - - HIViewFindByID(HIViewGetSuperview(arrows), cid, &ctl); - sprintf(num, "%ld", GetControl32BitValue(arrows)); - SetStaticTextCStr(ctl, num, true); -} - -static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl, slider; - HIViewID cid; - SInt32 value; - char num[10]; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - cid.signature = 'snd_'; - cid.id = iNibSInputRate; - HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); - value = GetControl32BitValue(slider); - - value /= 50; - value *= 50; - if (value > 33000) - value = 33000; - if (value < 31000) - value = 31000; - - SetControl32BitValue(slider, value); - sprintf(num, "%ld", value); - SetEditTextCStr(ctl, num, true); - - result = noErr; - } - - return (result); -} - -static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl, slider; - HIViewID cid; - float w, h, v; - int iw, ih; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - cid.signature = 'grap'; - cid.id = iNibGAspectRatio; - HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); - - GetGameDisplay(&iw, &ih); - w = (float) iw; - h = (float) ih; - - v = (float) SNES_WIDTH / (float) SNES_HEIGHT * h; - macAspectRatio = (int) (((4.0f / 3.0f) * h - v) / (w - v) * 10000.0f); - - SetControl32BitValue(slider, macAspectRatio); - - result = noErr; - } - - return (result); -} - -static pascal OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl; - HIViewID cid; - SInt32 value; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - GetControlID(ctl, &cid); - value = GetControl32BitValue(ctl); - - if ((cid.id == 128) && (value != lastTabIndex)) - { - SelectTabPane(ctl, value); - result = noErr; - } - } - - return (result); -} - -static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - { - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - { - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - } - - break; - } - - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - HIViewRef ctl, root; - HIViewID cid; - SInt32 value; - FSRef ref; - bool8 r; - - root = HIViewGetRoot(tWindowRef); - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case 'S_EF': - { - HideWindow(tWindowRef); - ConfigureSoundEffects(); - ShowWindow(tWindowRef); - - result = noErr; - break; - } - - case 'G_FL': - { - if (systemVersion >= 0x1040) - { - HideWindow(tWindowRef); - ConfigureCoreImageFilter(); - ShowWindow(tWindowRef); - } - - result = noErr; - break; - } - - case 'G__7': - { - cid.signature = 'grap'; - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'G_13': - { - cid.signature = 'grap'; - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'S__3': - { - cid.signature = 'snd_'; - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'F_FL': - { - UInt32 modifierkey; - - err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); - if (err == noErr) - { - if (modifierkey & optionKey) - { - CFStringRef str; - MenuRef menu; - - str = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); - - cid.signature = 'othe'; - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, 3); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); - DisableMenuItem(menu, iNibSaveFolderNameMenuItem); - HIViewSetNeedsDisplay(ctl, true); - - CFRelease(str); - - if (saveFolderPath) - CFRelease(saveFolderPath); - saveFolderPath = NULL; - } - else - r = NavBeginChooseFolderSheet(tWindowRef); - } - - result = noErr; - break; - } - - case 'NvDn': - { - r = NavEndChooseFolderSheet(&ref); - if (r) - { - CFStringRef str; - CFURLRef url; - MenuRef menu; - - url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); - str = CFURLCopyLastPathComponent(url); - - cid.signature = 'othe'; - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, iNibSaveFolderNameMenuItem); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); - EnableMenuItem(menu, iNibSaveFolderNameMenuItem); - HIViewSetNeedsDisplay(ctl, true); - - CFRelease(str); - - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (saveFolderPath) - CFRelease(saveFolderPath); - saveFolderPath = str; - - CFRelease(url); - } - - result = noErr; - break; - } - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -void ConfigureExtraOptions (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("ExtraOptions"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef eref; - EventHandlerUPP eventUPP; - EventTypeSpec windowEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, root; - HIViewID cid; - - root = HIViewGetRoot(tWindowRef); - cid.id = 0; - - cid.signature = 'BMrk'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.benchmark); - - cid.signature = 'NoTR'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glForceNoTextureRectangle); - - cid.signature = 'CSAp'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glUseClientStrageApple); - - cid.signature = 'AGPT'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glUseTexturePriority); - - cid.signature = 'Hint'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glStorageHint); - - eventUPP = NewEventHandlerUPP(DefaultEventHandler); - err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref); - - MoveWindowPosition(tWindowRef, kWindowExtra, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowExtra); - - cid.signature = 'BMrk'; - HIViewFindByID(root, cid, &ctl); - extraOptions.benchmark = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'NoTR'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glForceNoTextureRectangle = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'CSAp'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glUseClientStrageApple = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'AGPT'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glUseTexturePriority = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'Hint'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glStorageHint = GetControl32BitValue(ctl); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - } -} diff --git a/macosx/mac-quicktime.cpp b/macosx/mac-quicktime.mm similarity index 100% rename from macosx/mac-quicktime.cpp rename to macosx/mac-quicktime.mm diff --git a/macosx/mac-render.cpp b/macosx/mac-render.cpp deleted file mode 100644 index 3b4357bb..00000000 --- a/macosx/mac-render.cpp +++ /dev/null @@ -1,1755 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "apu.h" -#include "display.h" -#include "blit.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "mac-prefix.h" -#include "mac-cheatfinder.h" -#include "mac-coreimage.h" -#include "mac-os.h" -#include "mac-quicktime.h" -#include "mac-screenshot.h" -#include "mac-render.h" - -typedef void (* Blitter) (uint8 *, int, uint8 *, int, int, int); - -static OSStatus BlitMPGLTask (void *); -static OSStatus PrepareMPBlitGL (void); -static void S9xInitFullScreen (void); -static void S9xDeinitFullScreen (void); -static void S9xInitWindowMode (void); -static void S9xDeinitWindowMode (void); -static void S9xInitOpenGLFullScreen (void); -static void S9xDeinitOpenGLFullScreen (void); -static void S9xInitOpenGLWindowMode (void); -static void S9xDeinitOpenGLWindowMode (void); -static void S9xInitBlitGL (void); -static void S9xDeinitBlitGL (void); -static void S9xInitOpenGLContext (void); -static void S9xDeinitOpenGLContext (void); -static void S9xInitCoreImage (void); -static void S9xDeinitCoreImage (void); -static void S9xPutImageOpenGL (int, int); -static void S9xPutImageBlitGL (int, int); -static void S9xPutImageBlitGL2 (int, int); -static void GLMakeScreenMesh (GLfloat *, int, int); -static void GLMakeTextureMesh (GLfloat *, int, int, float, float); -static void GLPrepareTexture (bool8, int, int, int, int, int, int); -static inline void RenderBlitScreen (Blitter, int, int, int, int, int, uint16 *); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void SetBestDisplayMode (int, int); -#endif - -enum -{ - kMPBlitFrame = 1, - kMPBlitDone, - kMPBlitNone -}; - -enum -{ - kGL256256 = 0, - kGL256512, - kGL512256, - kGL512512, - kGLBlit2x, - kGLBlit3x, - kGLBlit4x, - kGLNTS256, - kGLNTS512, - kGLNumTextures -}; - -enum -{ - kSC2xNormal = 0, - kSC2xExtend, - kSC2xNHiRes, - kSC2xEHiRes, - kSC2xNInter, - kSC2xEInter, - kSC3xNormal, - kSC3xExtend, - kSC3xNHiRes, - kSC3xEHiRes, - kSCNTNormal, - kSCNTExtend, - kSCNumTextures -}; - -enum -{ - kSCMeshX = 10, - kSCMeshY = 9 -}; - -typedef struct -{ - Blitter blitFn; - int nx; - int srcWidth; - int srcHeight; - int copyWidth; - int copyHeight; - uint16 *gfxBuffer; -} MPData; - -typedef struct -{ - GLint internal_format; - GLint format; - GLint type; - GLenum target; - GLuint textures[kGLNumTextures]; - GLfloat vertex[kGLNumTextures][8]; - GLint texW[kGLNumTextures]; - GLint texH[kGLNumTextures]; - GLboolean rangeExt; - GLint storage_hint; - GLint storage_apple; - GLfloat agp_texturing; -} OpenGLData; - -static uint16 *gfxScreen[2], - *snesScreenA, - *snesScreenB; -static uint8 *blitGLBuffer; - -static CGDirectDisplayID gGameDisplayID; - -static MPTaskID taskID = NULL; -static MPQueueID notificationQueue = NULL, - taskQueue = NULL; -static MPSemaphoreID readySemaphore = NULL; -static MPData *mpBlit = NULL; - -static OpenGLData OpenGL; -static CGLContextObj glContext; -static AGLContext agContext; -static CGLPixelFormatObj cglpix; -static AGLPixelFormat aglpix; -static GLint glSwapInterval = 0; -static GLint agSwapInterval = 0; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static CFDictionaryRef oldDisplayMode; -#else -static CGDisplayModeRef oldDisplayModeRef; -#endif -static CGImageRef cgGameImage = NULL, - cgBlitImage = NULL; - -static int whichBuf = 0; -static int textureNum = 0; -static int prevBlitWidth, prevBlitHeight; -static int imageWidth[2], imageHeight[2]; -static int nx = 2; - -static GLfloat *scTexArray[kSCNumTextures]; -static GLfloat *scScnArray; - -static struct timeval bencht1, bencht2; - -static const int ntsc_width = SNES_NTSC_OUT_WIDTH(SNES_WIDTH); // 602 - - -void InitGraphics (void) -{ - int safemarginbytes = (520 * 520 - 512 * 512) * 2; - - snesScreenA = (uint16 *) calloc( 520 * 520 * 2, 1); - snesScreenB = (uint16 *) calloc( 520 * 520 * 2, 1); - blitGLBuffer = (uint8 *) calloc(1024 * 1024 * 2, 1); - - gfxScreen[0] = snesScreenA + (safemarginbytes >> 2); - gfxScreen[1] = snesScreenB + (safemarginbytes >> 2); - - GFX.Pitch = 512 * 2; - GFX.Screen = gfxScreen[0]; - - if (!snesScreenA || !snesScreenB || !blitGLBuffer) - QuitWithFatalError(0, "render 01"); - - if (!S9xBlitFilterInit() | - !S9xBlit2xSaIFilterInit() | - !S9xBlitHQ2xFilterInit() | - !S9xBlitNTSCFilterInit()) - QuitWithFatalError(0, "render 02"); - - switch (videoMode) - { - default: - case VIDEOMODE_NTSC_C: - case VIDEOMODE_NTSC_TV_C: - S9xBlitNTSCFilterSet(&snes_ntsc_composite); - break; - - case VIDEOMODE_NTSC_S: - case VIDEOMODE_NTSC_TV_S: - S9xBlitNTSCFilterSet(&snes_ntsc_svideo); - break; - - case VIDEOMODE_NTSC_R: - case VIDEOMODE_NTSC_TV_R: - S9xBlitNTSCFilterSet(&snes_ntsc_rgb); - break; - - case VIDEOMODE_NTSC_M: - case VIDEOMODE_NTSC_TV_M: - S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); - break; - } -} - -void DeinitGraphics (void) -{ - S9xBlitNTSCFilterDeinit(); - S9xBlitHQ2xFilterDeinit(); - S9xBlit2xSaIFilterDeinit(); - S9xBlitFilterDeinit(); - - if (snesScreenA) - { - free(snesScreenA); - snesScreenA = NULL; - } - - if (snesScreenB) - { - free(snesScreenB); - snesScreenB = NULL; - } - - if (blitGLBuffer) - { - free(blitGLBuffer); - blitGLBuffer = NULL; - } -} - -void DrawPauseScreen (CGContextRef ctx, HIRect bounds) -{ - CGImageRef image; - CGRect rct; - float sh, mh, rofs, ry; - - if ((IPPU.RenderedScreenWidth == 0) || (IPPU.RenderedScreenHeight == 0)) - return; - - sh = (float) ((IPPU.RenderedScreenHeight > 256) ? IPPU.RenderedScreenHeight : IPPU.RenderedScreenHeight * 2); - mh = (float) (SNES_HEIGHT_EXTENDED * 2); - - if (drawoverscan) - { - rofs = (mh - sh) / mh; - ry = sh / mh; - } - else - if (windowExtend) - { - rofs = (mh - sh) / mh / 2.0f; - ry = sh / mh; - } - else - { - rofs = 0.0f; - ry = 1.0f; - } - - image = CreateGameScreenCGImage(); - if (image) - { - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - CGContextFillRect(ctx, bounds); - - rct = CGRectMake(0.0f, bounds.size.height * rofs, bounds.size.width, bounds.size.height * ry); - CGContextDrawImage(ctx, rct, image); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 0.5f); - CGContextFillRect(ctx, bounds); - - CGImageRelease(image); - } -} - -void DrawFreezeDefrostScreen (uint8 *draw) -{ - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; - - imageWidth[0] = imageHeight[0] = 0; - imageWidth[1] = imageHeight[1] = 0; - prevBlitWidth = prevBlitHeight = 0; - - if ((drawingMethod == kDrawingBlitGL) && multiprocessor) - { - MPWaitOnSemaphore(readySemaphore, kDurationForever); - printf("MP: Send dummy signal.\n"); - MPNotifyQueue(taskQueue, (void *) kMPBlitNone, 0, 0); - } - - if (nx < 0 && !ciFilterEnable) - { - for (int y = 0; y < h; y++) - memcpy(blitGLBuffer + y * 1024 * 2, draw + y * w * 2, w * 2); - } - else - memcpy(blitGLBuffer, draw, w * h * 2); - - S9xPutImageBlitGL2(512, kMacWindowHeight); -} - -void ClearGFXScreen (void) -{ - memset(gfxScreen[0], 0, 512 * 512 * 2); - memset(gfxScreen[1], 0, 512 * 512 * 2); - memset(blitGLBuffer, 0, 1024 * 1024 * 2); - - S9xBlitClearDelta(); - - imageWidth[0] = imageHeight[0] = 0; - imageWidth[1] = imageHeight[1] = 0; - prevBlitWidth = prevBlitHeight = 0; - - if (fullscreen) - { - CGLSetCurrentContext(glContext); - glViewport(0, 0, glScreenW, glScreenH); - } - else - { - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - glViewport(0, 0, (GLsizei) gWindowRect.size.width, (GLsizei) gWindowRect.size.height); - } - - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - for (int i = 0; i < 2; i++) - { - glClear(GL_COLOR_BUFFER_BIT); - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); - } -} - -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void SetBestDisplayMode (int width, int height) -{ - if (autoRes || !gl32bit) - { - CGError err; - CGDisplayModeRef mode; - CFArrayRef array; - CFStringRef pixenc, pix; - CFIndex n, i; - size_t w, h; - bool r; - - pixenc = gl32bit ? CFSTR(IO32BitDirectPixels) : CFSTR(IO16BitDirectPixels); - - array = CGDisplayCopyAllDisplayModes(gGameDisplayID, NULL); - n = CFArrayGetCount(array); - - for (i = 0; i < n; i++) - { - mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(array, i); - - w = CGDisplayModeGetWidth(mode); - h = CGDisplayModeGetHeight(mode); - pix = CGDisplayModeCopyPixelEncoding(mode); - r = CFStringCompare(pix, pixenc, 0) == kCFCompareEqualTo; - CFRelease(pix); - - if (w == (size_t) width && h == (size_t) height && r) - break; - } - - if (i < n) - err = CGDisplaySetDisplayMode(gGameDisplayID, mode, NULL); - - CFRelease(array); - } -} -#endif - -static void S9xInitFullScreen (void) -{ - DeinitGameWindow(); - - size_t width, height; - - width = autoRes ? 640 : CGDisplayPixelsWide(gGameDisplayID); - height = autoRes ? 480 : CGDisplayPixelsHigh(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CFDictionaryRef mode; - boolean_t exactMatch; - size_t depth = gl32bit ? 32 : 16; - - oldDisplayMode = CGDisplayCurrentMode(gGameDisplayID); - mode = CGDisplayBestModeForParameters(gGameDisplayID, depth, width, height, &exactMatch); - CGDisplayCapture(gGameDisplayID); - CGDisplaySwitchToMode(gGameDisplayID, mode); -#else - oldDisplayModeRef = CGDisplayCopyDisplayMode(gGameDisplayID); - CGDisplayCapture(gGameDisplayID); - SetBestDisplayMode(width, height); -#endif - - CGDisplayErr cgErr; - CGDisplayCount numDisplays, maxDisplays = 32; - CGDirectDisplayID activeDisplays[32]; - - cgErr = CGGetActiveDisplayList(maxDisplays, activeDisplays, &numDisplays); - if (cgErr == noErr) - { - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED) || (numDisplays == 1)) - CGDisplayHideCursor(gGameDisplayID); - - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) - { - CGDisplayMoveCursorToPoint(gGameDisplayID, CGPointMake((float) (width >> 1), (float) (height >> 1))); - CGAssociateMouseAndMouseCursorPosition(false); - } - } -} - -static void S9xDeinitFullScreen (void) -{ - CGAssociateMouseAndMouseCursorPosition(true); - CGDisplayShowCursor(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGDisplaySwitchToMode(gGameDisplayID, oldDisplayMode); -#else - CGError err; - - err = CGDisplaySetDisplayMode(gGameDisplayID, oldDisplayModeRef, NULL); - CGDisplayModeRelease(oldDisplayModeRef); -#endif - - CGDisplayRelease(gGameDisplayID); -} - -static void S9xInitWindowMode (void) -{ - Rect rct; - size_t width, height; - - width = CGDisplayPixelsWide(gGameDisplayID); - height = CGDisplayPixelsHigh(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CFDictionaryRef mode; - boolean_t exactMatch; - size_t depth = gl32bit ? 32 : 16; - - oldDisplayMode = CGDisplayCurrentMode(gGameDisplayID); - mode = CGDisplayBestModeForParameters(gGameDisplayID, depth, width, height, &exactMatch); - if (exactMatch) - CGDisplaySwitchToMode(gGameDisplayID, mode); -#else - oldDisplayModeRef = CGDisplayCopyDisplayMode(gGameDisplayID); - SetBestDisplayMode(width, height); -#endif - - InitGameWindow(); - ShowWindow(gWindow); - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - - UpdateGameWindow(); -} - -static void S9xDeinitWindowMode (void) -{ -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGDisplaySwitchToMode(gGameDisplayID, oldDisplayMode); -#else - CGError err; - - err = CGDisplaySetDisplayMode(gGameDisplayID, oldDisplayModeRef, NULL); - CGDisplayModeRelease(oldDisplayModeRef); -#endif - - UpdateGameWindow(); -} - -static void S9xInitOpenGLFullScreen (void) -{ - CGOpenGLDisplayMask displayMask; - GLint numPixelFormats; - - displayMask = CGDisplayIDToOpenGLDisplayMask(gGameDisplayID); - CGLPixelFormatAttribute attribs[] = { (CGLPixelFormatAttribute) kCGLPFAFullScreen, - (CGLPixelFormatAttribute) kCGLPFADoubleBuffer, - (CGLPixelFormatAttribute) kCGLPFAAccelerated, - (CGLPixelFormatAttribute) kCGLPFANoRecovery, - (CGLPixelFormatAttribute) kCGLPFAColorSize, - (CGLPixelFormatAttribute) (gl32bit ? 32 : 16), - (CGLPixelFormatAttribute) kCGLPFADisplayMask, - (CGLPixelFormatAttribute) displayMask, - (CGLPixelFormatAttribute) 0 }; - - CGLChoosePixelFormat(attribs, &cglpix, &numPixelFormats); - CGLCreateContext(cglpix, NULL, &glContext); - glSwapInterval = vsync ? 1 : 0; - if (extraOptions.benchmark) - glSwapInterval = 0; - CGLSetParameter(glContext, kCGLCPSwapInterval, &glSwapInterval); - CGLSetCurrentContext(glContext); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGLSetFullScreen(glContext); -#else - CGLSetFullScreenOnDisplay(glContext, CGDisplayIDToOpenGLDisplayMask(gGameDisplayID)); -#endif - - glScreenW = CGDisplayPixelsWide(gGameDisplayID); - glScreenH = CGDisplayPixelsHigh(gGameDisplayID); -} - -static void S9xDeinitOpenGLFullScreen (void) -{ - if (glContext) - { - CGLSetCurrentContext(NULL); - CGLClearDrawable(glContext); - CGLDestroyContext(glContext); - CGLDestroyPixelFormat(cglpix); - } -} - -static void S9xInitOpenGLWindowMode (void) -{ - GLint attribs[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_ACCELERATED, - AGL_NO_RECOVERY, - AGL_PIXEL_SIZE, gl32bit ? 32 : 16, - AGL_NONE }; - - aglpix = aglChoosePixelFormat(NULL, 0, attribs); - agContext = aglCreateContext(aglpix, NULL); - - if (systemVersion >= 0x1050) - aglSetWindowRef(agContext, gWindow); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - aglSetDrawable(agContext, GetWindowPort(gWindow)); -#endif - - agSwapInterval = vsync ? 1 : 0; - if (extraOptions.benchmark) - agSwapInterval = 0; - aglSetInteger(agContext, AGL_SWAP_INTERVAL, &agSwapInterval); - aglSetCurrentContext(agContext); - - if (systemVersion >= 0x1040) - { - aglGetCGLPixelFormat(aglpix, (void **) &cglpix); - aglGetCGLContext(agContext, (void **) &glContext); - } -} - -static void S9xDeinitOpenGLWindowMode (void) -{ - if (agContext) - { - if (systemVersion >= 0x1050) - aglSetWindowRef(agContext, NULL); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - aglSetDrawable(agContext, NULL); - #endif - - aglSetCurrentContext(NULL); - aglDestroyContext(agContext); - aglDestroyPixelFormat(aglpix); - } -} - -static void S9xInitBlitGL (void) -{ - if (multiprocessor) - { - printf("MP: Creating BlitGL thread.\n"); - - if (noErr != PrepareMPBlitGL()) - multiprocessor = false; - } -} - -static void S9xDeinitBlitGL (void) -{ - if (multiprocessor) - { - MPNotifyQueue(taskQueue, (void *) kMPBlitDone, 0, 0); - MPWaitOnQueue(notificationQueue, NULL, NULL, NULL, kDurationForever); - MPDeleteQueue(notificationQueue); - notificationQueue = NULL; - - printf("MP: Successfully received terminate signal from BlitGL thread.\n"); - } -} - -static void GLPrepareTexture (bool8 useRange, int texNo, int rangeOnW, int rangeOnH, int rangeOffW, int rangeOffH, int filter) -{ - bool8 rangeAvailable = OpenGL.rangeExt & useRange; - - OpenGL.texW[texNo] = rangeAvailable ? rangeOnW : rangeOffW; - OpenGL.texH[texNo] = rangeAvailable ? rangeOnH : rangeOffH; - - OpenGL.vertex[texNo][0] = 0; - OpenGL.vertex[texNo][1] = 0; - OpenGL.vertex[texNo][2] = rangeAvailable ? rangeOnW : 1; - OpenGL.vertex[texNo][3] = 0; - OpenGL.vertex[texNo][4] = rangeAvailable ? rangeOnW : 1; - OpenGL.vertex[texNo][5] = rangeAvailable ? rangeOnH : 1; - OpenGL.vertex[texNo][6] = 0; - OpenGL.vertex[texNo][7] = rangeAvailable ? rangeOnH : 1; - - glBindTexture(OpenGL.target, OpenGL.textures[texNo]); - - if (rangeAvailable) - { - glTextureRangeAPPLE(OpenGL.target, OpenGL.texW[texNo] * OpenGL.texH[texNo] * 2, GFX.Screen); - glTexParameteri(OpenGL.target, GL_TEXTURE_STORAGE_HINT_APPLE, OpenGL.storage_hint); - } - - glTexParameterf(OpenGL.target, GL_TEXTURE_PRIORITY, OpenGL.agp_texturing); - glTexParameteri(OpenGL.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(OpenGL.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(OpenGL.target, GL_TEXTURE_MAG_FILTER, filter); - glTexParameteri(OpenGL.target, GL_TEXTURE_MIN_FILTER, filter); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexImage2D(OpenGL.target, 0, OpenGL.internal_format, OpenGL.texW[texNo], OpenGL.texH[texNo], 0, OpenGL.format, OpenGL.type, GFX.Screen); -} - -static void GLMakeScreenMesh (GLfloat *vertex3D, int meshx, int meshy) -{ - GLfloat *v; - float warp; - - v = vertex3D; - warp = macCurvatureWarp * 0.001f; - - for (int y = 0; y < meshy; y++) - { - for (int x = 0; x <= meshx; x++) - { - float u1, v1, v2; - - u1 = -1.0f + 2.0f / (float) meshx * (float) x; - v1 = -1.0f + 2.0f / (float) meshy * (float) y; - v2 = -1.0f + 2.0f / (float) meshy * (float) (y + 1); - - *v++ = u1; - *v++ = v2; - *v++ = -1.0f - (u1 * u1 + v2 * v2) * warp; - - *v++ = u1; - *v++ = v1; - *v++ = -1.0f - (u1 * u1 + v1 * v1) * warp; - } - } -} - -static void GLMakeTextureMesh (GLfloat *vertex2D, int meshx, int meshy, float lx, float ly) -{ - GLfloat *v; - - v = vertex2D; - - for (int y = meshy; y > 0; y--) - { - for (int x = 0; x <= meshx; x++) - { - float u1, v1, v2; - - u1 = lx / (float) meshx * (float) x; - v1 = ly / (float) meshy * (float) y; - v2 = ly / (float) meshy * (float) (y - 1); - - *v++ = u1; - *v++ = v2; - - *v++ = u1; - *v++ = v1; - } - } -} - -static void S9xInitOpenGLContext (void) -{ - OpenGL.internal_format = GL_RGB5_A1; - OpenGL.format = GL_BGRA; - OpenGL.type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - OpenGL.rangeExt = gluCheckExtension((const GLubyte *) "GL_APPLE_texture_range", glGetString(GL_EXTENSIONS)); - OpenGL.target = OpenGL.rangeExt ? GL_TEXTURE_RECTANGLE_EXT : GL_TEXTURE_2D; - - OpenGL.storage_apple = extraOptions.glUseClientStrageApple ? 1 : 0; - OpenGL.agp_texturing = extraOptions.glUseTexturePriority ? 0.0f : 1.0f; - switch (extraOptions.glStorageHint) - { - case 1: OpenGL.storage_hint = GL_STORAGE_PRIVATE_APPLE; break; - case 2: OpenGL.storage_hint = GL_STORAGE_CACHED_APPLE; break; - case 3: OpenGL.storage_hint = GL_STORAGE_SHARED_APPLE; break; - } - - if (screencurvature || videoMode >= VIDEOMODE_NTSC_C || extraOptions.glForceNoTextureRectangle) - { - OpenGL.rangeExt = false; - OpenGL.target = GL_TEXTURE_2D; - } - - printf("TextureRange: %s\n", OpenGL.rangeExt ? "enable" : "disable"); - - glDisable(GL_BLEND); - glDisable(GL_DITHER); - glDisable(GL_LIGHTING); - glDisable(GL_DEPTH_TEST); - - glEnable(GL_CULL_FACE); - glPolygonMode(GL_FRONT, GL_FILL); - glCullFace(GL_BACK); - - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_RECTANGLE_EXT); - glEnable(OpenGL.target); - - glGenTextures(kGLNumTextures, OpenGL.textures); - - glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, OpenGL.storage_apple); - glPixelStorei(GL_UNPACK_ALIGNMENT, 8); - - int filter = (videoMode == VIDEOMODE_SMOOTH) ? GL_LINEAR : GL_NEAREST; - GLPrepareTexture(true, kGL256256, SNES_WIDTH, SNES_HEIGHT_EXTENDED, 256, 256, filter); - GLPrepareTexture(true, kGL256512, SNES_WIDTH, SNES_HEIGHT_EXTENDED * 2, 256, 512, filter); - GLPrepareTexture(true, kGL512256, SNES_WIDTH * 2, SNES_HEIGHT_EXTENDED, 512, 256, filter); - GLPrepareTexture(true, kGL512512, SNES_WIDTH * 2, SNES_HEIGHT_EXTENDED * 2, 512, 512, filter); - GLPrepareTexture(true, kGLBlit2x, SNES_WIDTH * 2, SNES_HEIGHT_EXTENDED * 2, 512, 512, GL_LINEAR); - GLPrepareTexture(true, kGLBlit3x, SNES_WIDTH * 3, SNES_HEIGHT_EXTENDED * 3, 1024, 1024, GL_LINEAR); - GLPrepareTexture(true, kGLBlit4x, SNES_WIDTH * 4, SNES_HEIGHT_EXTENDED * 4, 1024, 1024, GL_LINEAR); - GLPrepareTexture(false, kGLNTS256, 1024, 256, 1024, 256, GL_LINEAR); - GLPrepareTexture(false, kGLNTS512, 1024, 512, 1024, 512, GL_LINEAR); - - if (!screencurvature) - { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - } - else - { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -1.0, 1.0, 0.95, 5.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - - int mesh = (kSCMeshX + 1) * 2 * kSCMeshY * 2; - scTexArray[kSC2xNormal] = new GLfloat [mesh]; - scTexArray[kSC2xExtend] = new GLfloat [mesh]; - scTexArray[kSC2xNHiRes] = new GLfloat [mesh]; - scTexArray[kSC2xEHiRes] = new GLfloat [mesh]; - scTexArray[kSC2xNInter] = new GLfloat [mesh]; - scTexArray[kSC2xEInter] = new GLfloat [mesh]; - scTexArray[kSC3xNormal] = new GLfloat [mesh]; - scTexArray[kSC3xExtend] = new GLfloat [mesh]; - scTexArray[kSC3xNHiRes] = new GLfloat [mesh]; - scTexArray[kSC3xEHiRes] = new GLfloat [mesh]; - scTexArray[kSCNTNormal] = new GLfloat [mesh]; - scTexArray[kSCNTExtend] = new GLfloat [mesh]; - - GLMakeTextureMesh(scTexArray[kSC2xNormal], kSCMeshX, kSCMeshY, 1.0f, 224.0f / 256.0f); - GLMakeTextureMesh(scTexArray[kSC2xExtend], kSCMeshX, kSCMeshY, 1.0f, 239.0f / 256.0f); - GLMakeTextureMesh(scTexArray[kSC2xNHiRes], kSCMeshX, kSCMeshY, 1.0f, 224.0f / 512.0f); - GLMakeTextureMesh(scTexArray[kSC2xEHiRes], kSCMeshX, kSCMeshY, 1.0f, 239.0f / 512.0f); - GLMakeTextureMesh(scTexArray[kSC2xNInter], kSCMeshX, kSCMeshY, 256.0f / 512.0f, 224.0f / 256.0f); - GLMakeTextureMesh(scTexArray[kSC2xEInter], kSCMeshX, kSCMeshY, 256.0f / 512.0f, 239.0f / 256.0f); - GLMakeTextureMesh(scTexArray[kSC3xNormal], kSCMeshX, kSCMeshY, 768.0f / 1024.0f, 672.0f / 1024.0f); - GLMakeTextureMesh(scTexArray[kSC3xExtend], kSCMeshX, kSCMeshY, 768.0f / 1024.0f, 717.0f / 1024.0f); - GLMakeTextureMesh(scTexArray[kSC3xNHiRes], kSCMeshX, kSCMeshY, 768.0f / 1024.0f, 672.0f / 2048.0f); - GLMakeTextureMesh(scTexArray[kSC3xEHiRes], kSCMeshX, kSCMeshY, 768.0f / 1024.0f, 717.0f / 2048.0f); - GLMakeTextureMesh(scTexArray[kSCNTNormal], kSCMeshX, kSCMeshY, (float) ntsc_width / 1024.0f, 224.0f / 256.0f); - GLMakeTextureMesh(scTexArray[kSCNTExtend], kSCMeshX, kSCMeshY, (float) ntsc_width / 1024.0f, 239.0f / 256.0f); - - scScnArray = new GLfloat [(kSCMeshX + 1) * 2 * kSCMeshY * 3]; - GLMakeScreenMesh(scScnArray, kSCMeshX, kSCMeshY); - } - - if (fullscreen) - { - CGLSetCurrentContext(glContext); - glViewport(0, 0, glScreenW, glScreenH); - } - else - { - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - glViewport(0, 0, (GLsizei) gWindowRect.size.width, (GLsizei) gWindowRect.size.height); - } - - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - for (int i = 0; i < 2; i++) - { - glClear(GL_COLOR_BUFFER_BIT); - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); - } -} - -static void S9xDeinitOpenGLContext (void) -{ - if (screencurvature) - { - delete [] scTexArray[kSC2xNormal]; - delete [] scTexArray[kSC2xExtend]; - delete [] scTexArray[kSC2xNHiRes]; - delete [] scTexArray[kSC2xEHiRes]; - delete [] scTexArray[kSC2xNInter]; - delete [] scTexArray[kSC2xEInter]; - delete [] scTexArray[kSC3xNormal]; - delete [] scTexArray[kSC3xExtend]; - delete [] scTexArray[kSC3xNHiRes]; - delete [] scTexArray[kSC3xEHiRes]; - delete [] scTexArray[kSCNTNormal]; - delete [] scTexArray[kSCNTExtend]; - delete [] scScnArray; - - scTexArray[kSC2xNormal] = NULL; - scTexArray[kSC2xExtend] = NULL; - scTexArray[kSC2xNHiRes] = NULL; - scTexArray[kSC2xEHiRes] = NULL; - scTexArray[kSC2xNInter] = NULL; - scTexArray[kSC2xEInter] = NULL; - scTexArray[kSC3xNormal] = NULL; - scTexArray[kSC3xExtend] = NULL; - scTexArray[kSC3xNHiRes] = NULL; - scTexArray[kSC3xEHiRes] = NULL; - scTexArray[kSCNTNormal] = NULL; - scTexArray[kSCNTExtend] = NULL; - scScnArray = NULL; - } - - glDeleteTextures(kGLNumTextures, OpenGL.textures); -} - -static void S9xInitCoreImage (void) -{ - cgGameImage = NULL; - cgBlitImage = NULL; - - InitCoreImageContext(glContext, cglpix); -} - -static void S9xDeinitCoreImage (void) -{ - DeinitCoreImageContext(); - - if (cgGameImage) - { - CGImageRelease(cgGameImage); - cgGameImage = NULL; - } - - if (cgBlitImage) - { - CGImageRelease(cgBlitImage); - cgBlitImage = NULL; - } -} - -void GetGameDisplay (int *w, int *h) -{ - CGDisplayErr cgErr; - CGDisplayCount numDisplays, maxDisplays = 32; - CGDirectDisplayID activeDisplays[32]; - CGPoint windowAt; - - gGameDisplayID = CGMainDisplayID(); - - windowAt = CGPointMake((float) windowPos[kWindowScreen].h, (float) windowPos[kWindowScreen].v); - - cgErr = CGGetDisplaysWithPoint(windowAt, maxDisplays, activeDisplays, &numDisplays); - if ((cgErr == noErr) && (numDisplays > 0)) - { - for (unsigned int i = 0; i < numDisplays; i++) - { - if (activeDisplays[i] != CGMainDisplayID()) - gGameDisplayID = activeDisplays[i]; - } - } - - if (w != NULL && h != NULL) - { - *w = CGDisplayPixelsWide(gGameDisplayID); - *h = CGDisplayPixelsHigh(gGameDisplayID); - } -} - -void S9xInitDisplay (int argc, char **argv) -{ - if (directDisplay) - return; - - GetGameDisplay(NULL, NULL); - - glScreenBounds = CGDisplayBounds(gGameDisplayID); - - unlimitedCursor = CGPointMake(0.0f, 0.0f); - - imageWidth[0] = imageHeight[0] = 0; - imageWidth[1] = imageHeight[1] = 0; - prevBlitWidth = prevBlitHeight = 0; - GFX.Screen = gfxScreen[0]; - whichBuf = 0; - textureNum = 0; - - switch (videoMode) - { - case VIDEOMODE_HQ4X: - nx = 4; - break; - - case VIDEOMODE_HQ3X: - nx = 3; - break; - - case VIDEOMODE_NTSC_C: - case VIDEOMODE_NTSC_S: - case VIDEOMODE_NTSC_R: - case VIDEOMODE_NTSC_M: - nx = -1; - break; - - case VIDEOMODE_NTSC_TV_C: - case VIDEOMODE_NTSC_TV_S: - case VIDEOMODE_NTSC_TV_R: - case VIDEOMODE_NTSC_TV_M: - nx = -2; - break; - - default: - nx = 2; - break; - } - - if (fullscreen) - { - S9xInitFullScreen(); - S9xInitOpenGLFullScreen(); - } - else - { - S9xInitWindowMode(); - S9xInitOpenGLWindowMode(); - } - - S9xInitOpenGLContext(); - if (ciFilterEnable) - S9xInitCoreImage(); - if (drawingMethod == kDrawingBlitGL) - S9xInitBlitGL(); - - S9xSetSoundMute(false); - Microseconds((UnsignedWide *) &lastFrame); - - windowResizeCount = 1; - - gettimeofday(&bencht1, NULL); - - directDisplay = true; -} - -void S9xDeinitDisplay (void) -{ - if (!directDisplay) - return; - - S9xSetSoundMute(true); - - if (drawingMethod == kDrawingBlitGL) - S9xDeinitBlitGL(); - if (ciFilterEnable) - S9xDeinitCoreImage(); - S9xDeinitOpenGLContext(); - - if (fullscreen) - { - S9xDeinitOpenGLFullScreen(); - S9xDeinitFullScreen(); - } - else - { - S9xDeinitOpenGLWindowMode(); - S9xDeinitWindowMode(); - } - - directDisplay = false; -} - -bool8 S9xInitUpdate (void) -{ - return (true); -} - -bool8 S9xDeinitUpdate (int width, int height) -{ - if (directDisplay) - S9xPutImage(width, height); - - return (true); -} - -bool8 S9xContinueUpdate (int width, int height) -{ - return (true); -} - -static inline void RenderBlitScreen (Blitter Fn, int x, int sW, int sH, int cW, int cH, uint16 *buf) -{ - switch (x) - { - case -1: - (Fn) ((uint8 *) buf, sW * 2, blitGLBuffer, 1024 * 2, sW, sH); - break; - - case -2: - if (sH > SNES_HEIGHT_EXTENDED) - (Fn) ((uint8 *) buf, sW * 2, blitGLBuffer, 1024 * 2, sW, sH); - else - { - uint8 *tmpBuffer = blitGLBuffer + (1024 * 512 * 2); - int aligned = ((ntsc_width + 2) >> 1) << 1; - (Fn) ((uint8 *) buf, sW * 2, tmpBuffer, 1024 * 2, sW, sH); - S9xBlitPixMixedTV1x2(tmpBuffer, 1024 * 2, blitGLBuffer, 1024 * 2, aligned, cH); - cH *= 2; - } - - break; - - default: - int dstbytes = (OpenGL.rangeExt ? cW : ((cW > 512) ? 1024 : ((cW > 256) ? 512 : 256))) * 2; - (Fn) ((uint8 *) buf, sW * 2, blitGLBuffer, dstbytes, sW, sH); - break; - } - - S9xPutImageBlitGL2(cW, cH); -} - -static OSStatus PrepareMPBlitGL (void) -{ - OSStatus err; - - mpBlit = (MPData *) MPAllocateAligned(sizeof(MPData), kMPAllocateDefaultAligned, kMPAllocateClearMask); - if (!mpBlit) - return (memFullErr); - - err = MPCreateQueue(¬ificationQueue); - if (err == noErr) - { - err = MPCreateQueue(&taskQueue); - if (err == noErr) - { - err = MPCreateBinarySemaphore(&readySemaphore); - if (err == noErr) - { - MPSignalSemaphore(readySemaphore); - err = MPCreateTask(BlitMPGLTask, NULL, 0, notificationQueue, NULL, NULL, 0, &taskID); - } - } - } - - return (err); -} - -static OSStatus BlitMPGLTask (void *parameter) -{ - OSStatus err = noErr; - int32 theCommand, param1, param2; - - printf("MP: Entered BlitGL thread.\n"); - - for (;;) - { - err = MPWaitOnQueue(taskQueue, (void **) &theCommand, (void **) ¶m1, (void **) ¶m2, kDurationForever); - if (err) - break; - - if (theCommand == kMPBlitFrame) - { - RenderBlitScreen(mpBlit->blitFn, mpBlit->nx, mpBlit->srcWidth, mpBlit->srcHeight, mpBlit->copyWidth, mpBlit->copyHeight, mpBlit->gfxBuffer); - MPSignalSemaphore(readySemaphore); - } - else - if (theCommand == kMPBlitNone) - MPSignalSemaphore(readySemaphore); - else - if (theCommand == kMPBlitDone) - break; - else - { - err = userCanceledErr; - break; - } - } - - MPFree(mpBlit); - MPDeleteSemaphore(readySemaphore); - MPDeleteQueue(taskQueue); - mpBlit = NULL; - readySemaphore = NULL; - taskQueue = NULL; - - printf("MP: Exited BlitGL thread.\n"); - - return (err); -} - -void S9xPutImage (int width, int height) -{ - static float fps = 0.0f; - static long count = 0; - static char text[32]; - - if (extraOptions.benchmark) - { - uint16 *basePtr; - long delta; - size_t len; - - count++; - - gettimeofday(&bencht2, NULL); - - delta = 1000000 * (bencht2.tv_sec - bencht1.tv_sec) + (bencht2.tv_usec - bencht1.tv_usec); - if (delta > 1000000) - { - fps = (1000000.0f * (float) count) / (float) delta; - count = 0; - - gettimeofday(&bencht1, NULL); - } - - sprintf(text, "%.1f", fps); - - basePtr = GFX.Screen + 1; - len = strlen(text); - - for (unsigned int i = 0; i < len; i++) - { - S9xDisplayChar(basePtr, text[i]); - basePtr += (8 - 1); - } - } - else - { - if (cfIsWatching) - CheatFinderDrawWatchAddr(); - - if (Settings.DisplayFrameRate) - { - static int drawnFrames[60] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; - static int tableIndex = 0; - int frameCalc = 0; - - drawnFrames[tableIndex] = skipFrames; - - if (Settings.TurboMode) - { - drawnFrames[tableIndex] = (drawnFrames[tableIndex] + (macFastForwardRate / 2)) / macFastForwardRate; - if (drawnFrames[tableIndex] == 0) - drawnFrames[tableIndex] = 1; - } - - tableIndex = (tableIndex + 1) % 60; - - for (int i = 0; i < 60; i++) - frameCalc += drawnFrames[i]; - - IPPU.DisplayedRenderedFrameCount = (Memory.ROMFramesPerSecond * 60) / frameCalc; - } - } - - switch (drawingMethod) - { - case kDrawingOpenGL: - S9xPutImageOpenGL(width, height); - break; - - case kDrawingBlitGL: - S9xPutImageBlitGL(width, height); - break; - } -} - -static void S9xPutImageOpenGL (int width, int height) -{ - int orig_height = height; - - if ((imageWidth[0] != width) || (imageHeight[0] != height)) - windowResizeCount += 2; - - if (windowResizeCount > 0) - { - if (drawoverscan && (height % SNES_HEIGHT == 0)) - { - int pitch = width << 1; - int extbtm = (height > 256) ? (SNES_HEIGHT_EXTENDED << 1) : SNES_HEIGHT_EXTENDED; - uint32 *extarea = (uint32 *) ((uint8 *) GFX.Screen + height * pitch); - - for (int i = 0; i < (((extbtm - height) * pitch) >> 2); i++) - extarea[i] = 0; - - height = extbtm; - } - - int vh = (height > 256) ? height : (height << 1); - - if (fullscreen) - { - CGLSetCurrentContext(glContext); - - glViewport(0, 0, glScreenW, glScreenH); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (glstretch) - { - float fpw = (float) glScreenH / vh * 512.0f; - int pw = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); - - glViewport((glScreenW - pw) >> 1, 0, pw, glScreenH); - } - else - glViewport((glScreenW - 512) >> 1, (glScreenH - vh) >> 1, 512, vh); - } - else - { - int ww = (int) gWindowRect.size.width, - wh = (int) gWindowRect.size.height; - - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - - glViewport(0, 0, ww, wh); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (windowExtend) - glViewport(0, ((kMacWindowHeight - vh) >> 1) * wh / kMacWindowHeight, ww, vh * wh / kMacWindowHeight); - } - - glPixelStorei(GL_UNPACK_ROW_LENGTH, width); - - if (!ciFilterEnable) - { - textureNum = (width <= 256) ? ((height <= 256) ? kGL256256 : kGL256512) : ((height <= 256) ? kGL512256 : kGL512512); - OpenGL.vertex[textureNum][5] = OpenGL.vertex[textureNum][7] = OpenGL.rangeExt ? height : (vh / 512.0f); - glBindTexture(OpenGL.target, OpenGL.textures[textureNum]); - } - else - { - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, width, orig_height - height, orig_height, -1, 1); - - if (cgGameImage) - CGImageRelease(cgGameImage); - cgGameImage = CreateGameScreenCGImage(); - } - - imageWidth[0] = width; - imageHeight[0] = height; - - windowResizeCount--; - } - else - { - if (drawoverscan) - height = (height > 256) ? (SNES_HEIGHT_EXTENDED << 1) : SNES_HEIGHT_EXTENDED; - } - - if (!ciFilterEnable) - { - glTexSubImage2D(OpenGL.target, 0, 0, 0, OpenGL.texW[textureNum], OpenGL.texH[textureNum], OpenGL.format, OpenGL.type, GFX.Screen); - - if (!screencurvature) - { - glBegin(GL_QUADS); - - glTexCoord2fv(&OpenGL.vertex[textureNum][6]); - glVertex2f(-1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][4]); - glVertex2f( 1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][2]); - glVertex2f( 1.0f, 1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][0]); - glVertex2f(-1.0f, 1.0f); - - glEnd(); - } - else - { - GLfloat *t, *s; - - t = scTexArray[(height % SNES_HEIGHT) ? kSC2xExtend : kSC2xNormal]; - s = scScnArray; - - for (int i = 0; i < kSCMeshY; i++) - { - glTexCoordPointer(2, GL_FLOAT, 0, t); - glVertexPointer(3, GL_FLOAT, 0, s); - glDrawArrays(GL_TRIANGLE_STRIP, 0, (kSCMeshX + 1) * 2); - - t += (kSCMeshX + 1) * 2 * 2; - s += (kSCMeshX + 1) * 2 * 3; - } - } - - glFinishObjectAPPLE(GL_TEXTURE, OpenGL.textures[textureNum]); - } - else - { - CGRect src; - - src = CGRectMake(0, 0, width, orig_height); - DrawWithCoreImageFilter(src, cgGameImage); - } - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); -} - -static void S9xPutImageBlitGL (int width, int height) -{ - Blitter blitFn; - int copyWidth, copyHeight; - - if ((imageWidth[whichBuf] != width) || (imageHeight[whichBuf] != height)) - { - if ((videoMode == VIDEOMODE_TV) && (width <= 256)) - S9xBlitClearDelta(); - - if (drawoverscan && (height % SNES_HEIGHT == 0)) - { - memset(blitGLBuffer, 0, 1024 * 1024 * 2); - - int pitch = width << 1; - int extbtm = (height > 256) ? (SNES_HEIGHT_EXTENDED << 1) : SNES_HEIGHT_EXTENDED; - uint32 *extarea = (uint32 *) ((uint8 *) GFX.Screen + height * pitch); - - for (int i = 0; i < (((extbtm - height) * pitch) >> 2); i++) - extarea[i] = 0; - - height = extbtm; - } - } - else - { - if (drawoverscan) - height = (height > 256) ? (SNES_HEIGHT_EXTENDED << 1) : SNES_HEIGHT_EXTENDED; - } - - switch (nx) - { - default: - case 2: - if (videoMode == VIDEOMODE_BLEND) - { - if (width <= 256) - { - copyWidth = width * 2; - copyHeight = height; - blitFn = S9xBlitPixBlend2x1; - } - else - { - copyWidth = width; - copyHeight = height; - blitFn = S9xBlitPixBlend1x1; - } - } - else - if (height <= 256) - { - if (width <= 256) - { - copyWidth = width * 2; - copyHeight = height * 2; - - switch (videoMode) - { - default: - case VIDEOMODE_TV: blitFn = S9xBlitPixTV2x2; break; - case VIDEOMODE_SUPEREAGLE: blitFn = S9xBlitPixSuperEagle16; break; - case VIDEOMODE_2XSAI: blitFn = S9xBlitPix2xSaI16; break; - case VIDEOMODE_SUPER2XSAI: blitFn = S9xBlitPixSuper2xSaI16; break; - case VIDEOMODE_EPX: blitFn = S9xBlitPixEPX16; break; - case VIDEOMODE_HQ2X: blitFn = S9xBlitPixHQ2x16; break; - } - } - else - { - if (videoMode == VIDEOMODE_TV) - { - copyWidth = width; - copyHeight = height * 2; - blitFn = S9xBlitPixTV1x2; - } - else - { - copyWidth = width; - copyHeight = height; - blitFn = S9xBlitPixSimple1x1; - } - } - } - else - { - copyWidth = width; - copyHeight = height; - blitFn = S9xBlitPixSimple1x1; - } - - break; - - case 3: - if (width <= 256 && height <= 256) - { - copyWidth = width * 3; - copyHeight = height * 3; - blitFn = S9xBlitPixHQ3x16; - } - else - { - copyWidth = width; - copyHeight = height; - blitFn = S9xBlitPixSimple1x1; - } - - break; - - case 4: - if (width <= 256 && height <= 256) - { - copyWidth = width * 4; - copyHeight = height * 4; - blitFn = S9xBlitPixHQ4x16; - } - else - if (width > 256 && height > 256) - { - copyWidth = width * 2; - copyHeight = height * 2; - blitFn = S9xBlitPixHQ2x16; - } - else - { - copyWidth = width; - copyHeight = height; - blitFn = S9xBlitPixSimple1x1; - } - - break; - - case -1: - case -2: - copyWidth = ntsc_width; - copyHeight = height; - - if (width <= 256) - blitFn = S9xBlitPixNTSC16; - else - blitFn = S9xBlitPixHiResNTSC16; - - break; - } - - imageWidth[whichBuf] = width; - imageHeight[whichBuf] = height; - - if (multiprocessor) - { - MPWaitOnSemaphore(readySemaphore, kDurationForever); - - mpBlit->nx = nx; - mpBlit->blitFn = blitFn; - mpBlit->srcWidth = width; - mpBlit->srcHeight = height; - mpBlit->copyWidth = copyWidth; - mpBlit->copyHeight = copyHeight; - mpBlit->gfxBuffer = GFX.Screen; - - MPNotifyQueue(taskQueue, (void *) kMPBlitFrame, 0, 0); - - whichBuf = 1 - whichBuf; - GFX.Screen = gfxScreen[whichBuf]; - } - else - RenderBlitScreen(blitFn, nx, width, height, copyWidth, copyHeight, GFX.Screen); -} - -static void S9xPutImageBlitGL2 (int blit_width, int blit_height) -{ - if ((prevBlitWidth != blit_width) || (prevBlitHeight != blit_height)) - windowResizeCount += 2; - - if (windowResizeCount > 0) - { - if (fullscreen) - { - CGLSetCurrentContext(glContext); - - glViewport(0, 0, glScreenW, glScreenH); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (glstretch) - { - int sh = (blit_width < blit_height) ? (blit_height >> 1) : ((blit_width > blit_height * 2) ? (blit_height << 1) : blit_height); - float fpw = (float) glScreenH / (float) sh * (float) blit_width; - int pw = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); - - glViewport((glScreenW - pw) >> 1, 0, pw, glScreenH); - } - else - { - int sw, sh; - - if (nx < 0) - { - sw = ntsc_width; - sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * 2; - } - else - { - sw = SNES_WIDTH * nx; - sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * nx; - } - - glViewport((glScreenW - sw) >> 1, (glScreenH - sh) >> 1, sw, sh); - } - } - else - { - int ww = (int) gWindowRect.size.width, - wh = (int) gWindowRect.size.height; - - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - - glViewport(0, 0, ww, wh); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (windowExtend) - { - int bh = (blit_height % SNES_HEIGHT) ? (SNES_HEIGHT_EXTENDED << 1) : (SNES_HEIGHT << 1); - glViewport(0, ((kMacWindowHeight - bh) >> 1) * wh / kMacWindowHeight, ww, bh * wh / kMacWindowHeight); - } - } - - if (!ciFilterEnable) - { - if (nx < 0) - textureNum = (blit_height > 256) ? kGLNTS512 : kGLNTS256; - else - { - switch (blit_width / SNES_WIDTH) - { - default: - case 1: - case 2: textureNum = kGLBlit2x; break; - case 3: textureNum = kGLBlit3x; break; - case 4: textureNum = kGLBlit4x; break; - } - } - - if (nx < 0) - { - int sh = (blit_height > 256) ? 512 : 256; - OpenGL.vertex[textureNum][2] = OpenGL.vertex[textureNum][4] = blit_width / 1024.0f; - OpenGL.vertex[textureNum][5] = OpenGL.vertex[textureNum][7] = blit_height / (float) sh; - glPixelStorei(GL_UNPACK_ROW_LENGTH, 1024); - } - else - { - if (OpenGL.rangeExt) - { - OpenGL.vertex[textureNum][2] = OpenGL.vertex[textureNum][4] = blit_width; - OpenGL.vertex[textureNum][5] = OpenGL.vertex[textureNum][7] = blit_height; - glPixelStorei(GL_UNPACK_ROW_LENGTH, blit_width); - } - else - { - int sl = (blit_width > 512) ? 1024 : 512; - int sh = (blit_height > 512) ? 1024 : 512; - OpenGL.vertex[textureNum][2] = OpenGL.vertex[textureNum][4] = blit_width / (float) sl; - OpenGL.vertex[textureNum][5] = OpenGL.vertex[textureNum][7] = blit_height / (float) sh; - glPixelStorei(GL_UNPACK_ROW_LENGTH, (blit_width > 512) ? 1024 : ((blit_width > 256) ? 512 : 256)); - } - } - - glBindTexture(OpenGL.target, OpenGL.textures[textureNum]); - } - else - { - int sl = OpenGL.rangeExt ? blit_width : ((blit_width > 512) ? 1024 : ((blit_width > 256) ? 512 : 256)); - - glPixelStorei(GL_UNPACK_ROW_LENGTH, sl); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, blit_width, 0, blit_height, -1, 1); - - if (cgBlitImage) - CGImageRelease(cgBlitImage); - cgBlitImage = CreateBlitScreenCGImage(blit_width, blit_height, sl << 1, blitGLBuffer); - } - - prevBlitWidth = blit_width; - prevBlitHeight = blit_height; - - windowResizeCount--; - } - - if (!ciFilterEnable) - { - glTexSubImage2D(OpenGL.target, 0, 0, 0, OpenGL.texW[textureNum], OpenGL.texH[textureNum], OpenGL.format, OpenGL.type, blitGLBuffer); - - if (!screencurvature) - { - glBegin(GL_QUADS); - - glTexCoord2fv(&OpenGL.vertex[textureNum][6]); - glVertex2f(-1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][4]); - glVertex2f( 1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][2]); - glVertex2f( 1.0f, 1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][0]); - glVertex2f(-1.0f, 1.0f); - - glEnd(); - } - else - { - GLfloat *t, *s; - int tex; - - if (nx < 0) - tex = (blit_height % SNES_HEIGHT) ? kSCNTExtend : kSCNTNormal; - else - if (blit_width > blit_height * 2) - { - if (blit_width / SNES_WIDTH != 3) - tex = (blit_height % SNES_HEIGHT) ? kSC2xEHiRes : kSC2xNHiRes; - else - tex = (blit_height % SNES_HEIGHT) ? kSC3xEHiRes : kSC3xNHiRes; - } - else - if (blit_width > blit_height) - { - if (blit_width / SNES_WIDTH != 3) - tex = (blit_height % SNES_HEIGHT) ? kSC2xExtend : kSC2xNormal; - else - tex = (blit_height % SNES_HEIGHT) ? kSC3xExtend : kSC3xNormal; - } - else - tex = (blit_height % SNES_HEIGHT) ? kSC2xEInter : kSC2xNInter; - - t = scTexArray[tex]; - s = scScnArray; - - for (int i = 0; i < kSCMeshY; i++) - { - glTexCoordPointer(2, GL_FLOAT, 0, t); - glVertexPointer(3, GL_FLOAT, 0, s); - glDrawArrays(GL_TRIANGLE_STRIP, 0, (kSCMeshX + 1) * 2); - - t += (kSCMeshX + 1) * 2 * 2; - s += (kSCMeshX + 1) * 2 * 3; - } - } - - glFinishObjectAPPLE(GL_TEXTURE, OpenGL.textures[textureNum]); - } - else - { - CGRect src; - - src = CGRectMake(0, 0, blit_width, blit_height); - DrawWithCoreImageFilter(src, cgBlitImage); - } - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); -} - -void S9xTextMode (void) -{ - return; -} - -void S9xGraphicsMode (void) -{ - return; -} - -void S9xSetPalette (void) -{ - return; -} diff --git a/macosx/mac-render.h b/macosx/mac-render.h index ea8af417..e034ca1d 100644 --- a/macosx/mac-render.h +++ b/macosx/mac-render.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -23,8 +24,6 @@ void InitGraphics (void); void DeinitGraphics (void); -void DrawPauseScreen (CGContextRef, HIRect); -void ClearGFXScreen (void); void DrawFreezeDefrostScreen (uint8 *); void GetGameDisplay (int *, int *); diff --git a/macosx/mac-render.mm b/macosx/mac-render.mm new file mode 100644 index 00000000..71d57b7e --- /dev/null +++ b/macosx/mac-render.mm @@ -0,0 +1,415 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +#include "snes9x.h" +#include "memmap.h" +#include "apu.h" +#include "display.h" +#include "blit.h" + +#include + +#include "mac-prefix.h" +#include "mac-cheatfinder.h" +#include "mac-os.h" +#include "mac-screenshot.h" +#include "mac-render.h" + +static void S9xInitMetal (void); +static void S9xDeinitMetal(void); +static void S9xPutImageMetal (int, int, uint16 *); + +static uint16 *gfxScreen[2], + *snesScreenA, + *snesScreenB; +static uint8 *blitGLBuffer; + +static int whichBuf = 0; +static int textureNum = 0; +static int prevBlitWidth, prevBlitHeight; +static int imageWidth[2], imageHeight[2]; +static int nx = 2; + +typedef struct +{ + vector_float2 position; + vector_float2 textureCoordinate; +} MetalVertex; + +@interface MetalLayerDelegate: NSObject +@end + +@implementation MetalLayerDelegate +- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window +{ + return YES; +} + +@end + +CAMetalLayer *metalLayer = nil; +MetalLayerDelegate *layerDelegate = nil; +id metalDevice = nil; +id metalTexture = nil; +id metalCommandQueue = nil; +id metalPipelineState = nil; + +void InitGraphics (void) +{ + int safemarginbytes = (520 * 520 - 512 * 512) * 2; + + snesScreenA = (uint16 *) calloc( 520 * 520 * 2, 1); + snesScreenB = (uint16 *) calloc( 520 * 520 * 2, 1); + blitGLBuffer = (uint8 *) calloc(1024 * 1024 * 2, 1); + + gfxScreen[0] = snesScreenA + (safemarginbytes >> 2); + gfxScreen[1] = snesScreenB + (safemarginbytes >> 2); + + GFX.Pitch = 512 * 2; + GFX.Screen = gfxScreen[0]; + + if (!snesScreenA || !snesScreenB || !blitGLBuffer) + QuitWithFatalError(@"render 01"); + + if (!S9xBlitFilterInit() | + !S9xBlit2xSaIFilterInit() | + !S9xBlitHQ2xFilterInit() | + !S9xBlitNTSCFilterInit()) + QuitWithFatalError(@"render 02"); + + switch (videoMode) + { + default: + case VIDEOMODE_NTSC_C: + case VIDEOMODE_NTSC_TV_C: + S9xBlitNTSCFilterSet(&snes_ntsc_composite); + break; + + case VIDEOMODE_NTSC_S: + case VIDEOMODE_NTSC_TV_S: + S9xBlitNTSCFilterSet(&snes_ntsc_svideo); + break; + + case VIDEOMODE_NTSC_R: + case VIDEOMODE_NTSC_TV_R: + S9xBlitNTSCFilterSet(&snes_ntsc_rgb); + break; + + case VIDEOMODE_NTSC_M: + case VIDEOMODE_NTSC_TV_M: + S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); + break; + } +} + +void DeinitGraphics (void) +{ + S9xBlitNTSCFilterDeinit(); + S9xBlitHQ2xFilterDeinit(); + S9xBlit2xSaIFilterDeinit(); + S9xBlitFilterDeinit(); + + if (snesScreenA) + { + free(snesScreenA); + snesScreenA = NULL; + } + + if (snesScreenB) + { + free(snesScreenB); + snesScreenB = NULL; + } + + if (blitGLBuffer) + { + free(blitGLBuffer); + blitGLBuffer = NULL; + } +} + +void DrawFreezeDefrostScreen (uint8 *draw) +{ + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; + S9xPutImageMetal(w, h, (uint16 *)draw); +} + +static void S9xInitMetal (void) +{ + glScreenW = glScreenBounds.size.width; + glScreenH = glScreenBounds.size.height; + + metalLayer = (CAMetalLayer *)s9xView.layer; + layerDelegate = [MetalLayerDelegate new]; + metalLayer.delegate = layerDelegate; + + metalDevice = s9xView.device; + + metalCommandQueue = [metalDevice newCommandQueue]; + + NSError *error = nil; + id defaultLibrary = [metalDevice newDefaultLibraryWithBundle:[NSBundle bundleForClass:[S9xEngine class]] error:&error]; + + MTLRenderPipelineDescriptor *pipelineDescriptor = [MTLRenderPipelineDescriptor new]; + pipelineDescriptor.label = @"Snes9x Pipeline"; + pipelineDescriptor.vertexFunction = [defaultLibrary newFunctionWithName:@"vertexShader"]; + pipelineDescriptor.colorAttachments[0].pixelFormat = s9xView.colorPixelFormat; + pipelineDescriptor.fragmentFunction = [defaultLibrary newFunctionWithName:@"fragmentShader"]; + + metalPipelineState = [metalDevice newRenderPipelineStateWithDescriptor:pipelineDescriptor error:&error]; + + if (metalPipelineState == nil) + { + NSLog(@"%@",error); + } +} + +static void S9xDeinitMetal (void) +{ + + metalCommandQueue = nil; + metalDevice = nil; + metalTexture = nil; + metalLayer = nil; +} + +void GetGameDisplay (int *w, int *h) +{ + if (w != NULL && h != NULL) + { + *w = s9xView.frame.size.width; + *h = s9xView.frame.size.height; + } +} + +void S9xInitDisplay (int argc, char **argv) +{ + glScreenBounds = s9xView.frame; + + unlimitedCursor = CGPointMake(0.0f, 0.0f); + + imageWidth[0] = imageHeight[0] = 0; + imageWidth[1] = imageHeight[1] = 0; + prevBlitWidth = prevBlitHeight = 0; + GFX.Screen = gfxScreen[0]; + whichBuf = 0; + textureNum = 0; + + switch (videoMode) + { + case VIDEOMODE_HQ4X: + nx = 4; + break; + + case VIDEOMODE_HQ3X: + nx = 3; + break; + + case VIDEOMODE_NTSC_C: + case VIDEOMODE_NTSC_S: + case VIDEOMODE_NTSC_R: + case VIDEOMODE_NTSC_M: + nx = -1; + break; + + case VIDEOMODE_NTSC_TV_C: + case VIDEOMODE_NTSC_TV_S: + case VIDEOMODE_NTSC_TV_R: + case VIDEOMODE_NTSC_TV_M: + nx = -2; + break; + + default: + nx = 2; + break; + } + + S9xInitMetal(); + + S9xSetSoundMute(false); + lastFrame = GetMicroseconds(); +} + +void S9xDeinitDisplay (void) +{ + S9xSetSoundMute(true); + S9xDeinitMetal(); +} + +bool8 S9xInitUpdate (void) +{ + return (true); +} + +bool8 S9xDeinitUpdate (int width, int height) +{ + S9xPutImage(width, height); + return true; +} + +bool8 S9xContinueUpdate (int width, int height) +{ + return (true); +} + +void S9xPutImage (int width, int height) +{ + if (cfIsWatching) + CheatFinderDrawWatchAddr(); + + if (Settings.DisplayFrameRate) + { + static int drawnFrames[60] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + static int tableIndex = 0; + int frameCalc = 0; + + drawnFrames[tableIndex] = skipFrames; + + if (Settings.TurboMode) + { + drawnFrames[tableIndex] = (drawnFrames[tableIndex] + (macFastForwardRate / 2)) / macFastForwardRate; + if (drawnFrames[tableIndex] == 0) + drawnFrames[tableIndex] = 1; + } + + tableIndex = (tableIndex + 1) % 60; + + for (int i = 0; i < 60; i++) + frameCalc += drawnFrames[i]; + + // avoid dividing by 0 + if (frameCalc == 0) + frameCalc = 1; + + IPPU.DisplayedRenderedFrameCount = (Memory.ROMFramesPerSecond * 60) / frameCalc; + } + + S9xPutImageMetal(width, height, GFX.Screen); +} + + +static void S9xPutImageMetal (int width, int height, uint16 *buffer16) +{ + uint8 *buffer = (uint8 *)malloc(width * height * 4); + for (int i = 0; i < width * height; ++i) + { + uint16 pixel = buffer16[i]; + unsigned int red = (pixel & FIRST_COLOR_MASK_RGB555) >> 10; + unsigned int green = (pixel & SECOND_COLOR_MASK_RGB555) >> 5; + unsigned int blue = (pixel & THIRD_COLOR_MASK_RGB555); + + red = ( red * 527 + 23 ) >> 6; + green = ( green * 527 + 23 ) >> 6; + blue = ( blue * 527 + 23 ) >> 6; + + int offset = i * 4; + buffer[offset++] = (uint8)red; + buffer[offset++] = (uint8)green; + buffer[offset++] = (uint8)blue; + buffer[offset] = 0xFF; + } + + CGSize layerSize = metalLayer.bounds.size; + + MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor new]; + textureDescriptor.pixelFormat = MTLPixelFormatRGBA8Unorm; + textureDescriptor.width = width; + textureDescriptor.height = height; + + metalTexture = [metalDevice newTextureWithDescriptor:textureDescriptor]; + + [metalTexture replaceRegion:MTLRegionMake2D(0, 0, width, height) mipmapLevel:0 withBytes:buffer bytesPerRow:width * 4]; + free(buffer); + + float vWidth = layerSize.width / 2.0; + float vHeight = layerSize.height / 2.0; + + const MetalVertex verticies[] = + { + // Pixel positions, Texture coordinates + { { vWidth, -vHeight }, { 1.f, 1.f } }, + { { -vWidth, -vHeight }, { 0.f, 1.f } }, + { { -vWidth, vHeight }, { 0.f, 0.f } }, + + { { vWidth, -vHeight }, { 1.f, 1.f } }, + { { -vWidth, vHeight }, { 0.f, 0.f } }, + { { vWidth, vHeight }, { 1.f, 0.f } }, + }; + + id vertexBuffer = [metalDevice newBufferWithBytes:verticies length:sizeof(verticies) options:MTLResourceStorageModeShared]; + id fragmentBuffer = [metalDevice newBufferWithBytes:&videoMode length:sizeof(videoMode) options:MTLResourceStorageModeShared]; + + id commandBuffer = [metalCommandQueue commandBuffer]; + commandBuffer.label = @"Snes9x command buffer"; + + id drawable = [metalLayer nextDrawable]; + + MTLRenderPassDescriptor *renderPassDescriptor = [MTLRenderPassDescriptor renderPassDescriptor]; + + renderPassDescriptor.colorAttachments[0].texture = drawable.texture; + renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear; + renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(0.0,0.0,0.0,1.0); + + if(renderPassDescriptor != nil) + { + id renderEncoder = + [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor]; + renderEncoder.label = @"Snes9x render encoder"; + + vector_uint2 viewportSize = { static_cast(layerSize.width), static_cast(layerSize.height) }; + + CGFloat scale = metalLayer.contentsScale; + [renderEncoder setViewport:(MTLViewport){0.0, 0.0, layerSize.width * scale, layerSize.height * scale, -1.0, 1.0 }]; + + [renderEncoder setRenderPipelineState:metalPipelineState]; + + [renderEncoder setVertexBuffer:vertexBuffer + offset:0 + atIndex:0]; + + [renderEncoder setVertexBytes:&viewportSize + length:sizeof(viewportSize) + atIndex:1]; + + [renderEncoder setFragmentTexture:metalTexture atIndex:0]; + [renderEncoder setFragmentBuffer:fragmentBuffer offset:0 atIndex:1]; + + [renderEncoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:6]; + + [renderEncoder endEncoding]; + + [commandBuffer presentDrawable:drawable]; + } + + [commandBuffer commit]; +} + +void S9xTextMode (void) +{ + return; +} + +void S9xGraphicsMode (void) +{ + return; +} diff --git a/macosx/mac-screenshot.cpp b/macosx/mac-screenshot.cpp deleted file mode 100644 index 913f373b..00000000 --- a/macosx/mac-screenshot.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "screenshot.h" - -#include - -#include "mac-prefix.h" -#include "mac-file.h" -#include "mac-gworld.h" -#include "mac-os.h" -#include "mac-render.h" -#include "mac-screenshot.h" - -static Handle GetScreenAsRawHandle (int, int); -static void ExportCGImageToPNGFile (CGImageRef, const char *); - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -typedef struct QDPict* QDPictRef; -extern "C" QDPictRef QDPictCreateWithProvider (CGDataProviderRef provider); -extern "C" void QDPictRelease (QDPictRef pictRef); -extern "C" OSStatus QDPictDrawToCGContext (CGContextRef ctx, CGRect rect, QDPictRef pictRef); -#endif - -static Handle GetScreenAsRawHandle (int destWidth, int destHeight) -{ - CGContextRef ctx; - CGColorSpaceRef color; - CGImageRef image; - Handle data = NULL; - - image = CreateGameScreenCGImage(); - if (image) - { - data = NewHandleClear(destWidth * destHeight * 2); - if (data) - { - HLock(data); - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(*data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0)); - if (ctx) - { - CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image); - CGContextRelease(ctx); - } - - CGColorSpaceRelease(color); - } - - HUnlock(data); - } - - CGImageRelease(image); - } - - return (data); -} - -void WriteThumbnailToResourceFork (FSRef *ref, int destWidth, int destHeight) -{ - OSStatus err; - HFSUniStr255 fork; - SInt16 resf; - - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSCreateResourceFork(ref, fork.length, fork.unicode, 0); - if ((err == noErr) || (err == errFSForkExists)) - { - err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsWrPerm, &resf); - if (err == noErr) - { - Handle pict; - - pict = GetScreenAsRawHandle(destWidth, destHeight); - if (pict) - { - AddResource(pict, 'Thum', 128, "\p"); - WriteResource(pict); - ReleaseResource(pict); - } - - CloseResFile(resf); - } - } - } -} - -static void ExportCGImageToPNGFile (CGImageRef image, const char *path) -{ - OSStatus err; - GraphicsExportComponent exporter; - CFStringRef str; - CFURLRef url; - Handle dataRef; - OSType dataRefType; - - str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (str) - { - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false); - if (url) - { - err = QTNewDataReferenceFromCFURL(url, 0, &dataRef, &dataRefType); - if (err == noErr) - { - err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePNG, &exporter); - if (err == noErr) - { - err = GraphicsExportSetInputCGImage(exporter, image); - if (err == noErr) - { - err = GraphicsExportSetOutputDataReference(exporter, dataRef, dataRefType); - if (err == noErr) - err = GraphicsExportDoExport(exporter, NULL); - } - - CloseComponent(exporter); - } - - DisposeHandle(dataRef); - } - - CFRelease(url); - } - - CFRelease(str); - } -} - -CGImageRef CreateGameScreenCGImage (void) -{ - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image = NULL; - int rowbytes; - - rowbytes = IPPU.RenderedScreenWidth * 2; - - prov = CGDataProviderCreateWithData(NULL, GFX.Screen, 512 * 2 * 478, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 1, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - return (image); -} - -CGImageRef CreateBlitScreenCGImage (int width, int height, int rowbytes, uint8 *buffer) -{ - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image = NULL; - - prov = CGDataProviderCreateWithData(NULL, buffer, rowbytes * height, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(width, height, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 1, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - return (image); -} - -void DrawThumbnailResource (FSRef *ref, CGContextRef ctx, CGRect bounds) -{ - OSStatus err; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image; - QDPictRef qdpr; - Handle pict; - HFSUniStr255 fork; - SInt16 resf; - Size size; - - CGContextSaveGState(ctx); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - CGContextFillRect(ctx, bounds); - - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsRdPerm, &resf); - if (err == noErr) - { - pict = Get1Resource('PICT', 128); - if (pict) - { - HLock(pict); - - size = GetHandleSize(pict); - prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL); - if (prov) - { - qdpr = QDPictCreateWithProvider(prov); - if (qdpr) - { - QDPictDrawToCGContext(ctx, bounds, qdpr); - QDPictRelease(qdpr); - } - - CGDataProviderRelease(prov); - } - - HUnlock(pict); - ReleaseResource(pict); - } - else - { - pict = Get1Resource('Thum', 128); - if (pict) - { - HLock(pict); - - size = GetHandleSize(pict); - prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(128, 120, 5, 16, 256, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0), prov, NULL, 0, kCGRenderingIntentDefault); - if (image) - { - CGContextDrawImage(ctx, bounds, image); - CGImageRelease(image); - } - - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - HUnlock(pict); - ReleaseResource(pict); - } - } - - CloseResFile(resf); - } - } - - CGContextRestoreGState(ctx); -} - -bool8 S9xDoScreenshot (int width, int height) -{ - Settings.TakeScreenshot = false; - - uint16 *data; - - data = (uint16 *) malloc(512 * 478 * 2); - if (data) - { - uint16 *sp, *dp; - - if (width > 256 && height > 239) - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 512; - - for (int x = 0; x < width; x++) - *dp++ = *sp++; - } - } - else - if (width > 256) - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 2 * 512; - - for (int x = 0; x < width; x++) - { - *dp = *(dp + 512) = *sp++; - dp++; - } - } - } - else - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 2 * 512; - - for (int x = 0; x < width; x++) - { - *dp = *(dp + 1) = *(dp + 512) = *(dp + 512 + 1) = *sp++; - dp += 2; - } - } - } - - CGImageRef image; - - image = CreateBlitScreenCGImage(512, (height > 239) ? height : (height * 2), 1024, (uint8 *) data); - if (image) - { - ExportCGImageToPNGFile(image, S9xGetPNGFilename()); - CGImageRelease(image); - } - - free(data); - } - - return (true); -} diff --git a/macosx/mac-screenshot.h b/macosx/mac-screenshot.h index 444f4e1a..7d858f7d 100644 --- a/macosx/mac-screenshot.h +++ b/macosx/mac-screenshot.h @@ -15,15 +15,15 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_scheenshot_h_ #define _mac_scheenshot_h_ -void WriteThumbnailToResourceFork (FSRef *, int, int); -void DrawThumbnailResource (FSRef *, CGContextRef, CGRect); -PicHandle GetScreenAsPicHandle (int, int, int, int); +void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight); +void DrawThumbnailFromExtendedAttribute(const char *path, CGContextRef, CGRect); CGImageRef CreateGameScreenCGImage (void); CGImageRef CreateBlitScreenCGImage (int, int, int, uint8 *); diff --git a/macosx/mac-screenshot.mm b/macosx/mac-screenshot.mm new file mode 100644 index 00000000..ae349979 --- /dev/null +++ b/macosx/mac-screenshot.mm @@ -0,0 +1,348 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include + +#include "snes9x.h" +#include "memmap.h" +#include "screenshot.h" + +#include "mac-prefix.h" +#include "mac-file.h" +#include "mac-gworld.h" +#include "mac-os.h" +#include "mac-render.h" +#include "mac-screenshot.h" + +extern "C" { +#include "FakeResources.h" +} + +const char *extendedAttributeName = "com.snes9x.preview"; + +unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength); + +unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength) +{ + if (!outLength) + { + return NULL; + } + + CFMutableDataRef dataRef = CFDataCreateMutable(kCFAllocatorDefault, 0); + if (dataRef) + { + CGImageDestinationRef dest = CGImageDestinationCreateWithData(dataRef, kUTTypePNG, 1, NULL); + + if (dest) + { + CGImageDestinationAddImage(dest, image, NULL); + CGImageDestinationFinalize(dest); + CFRelease(dest); + + *outLength = CFDataGetLength(dataRef); + unsigned char *data = (unsigned char *)malloc(*outLength); + + if (data) + { + CFDataGetBytes(dataRef, CFRangeMake(0, *outLength), data); + return data; + } + } + else + { + CFRelease(dataRef); + } + } + + return NULL; +} + +static void ExportCGImageToPNGFile (CGImageRef image, const char *path) +{ + CFStringRef str; + CFURLRef url; + + str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); + if (str) + { + url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false); + if (url) + { + CFIndex length = 0; + unsigned char *data = CGImageToPNGData(image, &length); + if (data) + { + FILE *f = fopen(path, "wb"); + if (f) + { + fwrite(data, length, 1, f); + fclose(f); + } + + free(data); + } + + CFRelease(url); + } + + CFRelease(str); + } +} + +CGImageRef CreateGameScreenCGImage (void) +{ + CGDataProviderRef prov; + CGColorSpaceRef color; + CGImageRef image = NULL; + int rowbytes; + + rowbytes = IPPU.RenderedScreenWidth * 2; + + prov = CGDataProviderCreateWithData(NULL, GFX.Screen, 512 * 2 * 478, NULL); + if (prov) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + image = CGImageCreate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 1, kCGRenderingIntentDefault); + CGColorSpaceRelease(color); + } + + CGDataProviderRelease(prov); + } + + return (image); +} + +CGImageRef CreateBlitScreenCGImage (int width, int height, int rowbytes, uint8 *buffer) +{ + CGDataProviderRef prov; + CGColorSpaceRef color; + CGImageRef image = NULL; + + prov = CGDataProviderCreateWithData(NULL, buffer, rowbytes * height, NULL); + if (prov) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + image = CGImageCreate(width, height, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 1, kCGRenderingIntentDefault); + CGColorSpaceRelease(color); + } + + CGDataProviderRelease(prov); + } + + return (image); +} + +void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight) +{ + CGContextRef ctx; + CGColorSpaceRef color = NULL; + char *data[destWidth * destHeight * 2]; + CGImageRef image = CreateGameScreenCGImage(); + + if (image) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + ctx = CGBitmapContextCreate(data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Big); + + if (ctx) + { + CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image); + CGContextRelease(ctx); + + CFIndex length = 0; + unsigned char *data = CGImageToPNGData(image, &length); + if (data) + { + setxattr(path, extendedAttributeName, data, length, 0, 0); + free(data); + } + } + + CGColorSpaceRelease(color); + } + + CGImageRelease(image); + } +} + +void DrawThumbnailFromExtendedAttribute (const char *path, CGContextRef ctx, CGRect bounds) +{ + CGContextSaveGState(ctx); + + CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + CGContextFillRect(ctx, bounds); + + ssize_t size = getxattr(path, extendedAttributeName, NULL, 0, 0, 0); + + if ( size > 0 ) + { + unsigned char *buffer = (unsigned char *)malloc(size); + if (buffer != NULL) + { + getxattr(path, extendedAttributeName, buffer, size, 0, 0); + NSData *data = [NSData dataWithBytes:buffer length:size]; + if (data) + { + NSImage *image = [[NSImage alloc] initWithData:data]; + + if (image) + { + CGContextDrawImage(ctx, bounds, [image CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]); + } + } + + free(buffer); + } + } + else + { + struct FakeResourceMap *resourceMap = FakeResFileOpen(std::string(std::string(path) + "/..namedfork/rsrc").c_str(), "r"); + if (resourceMap != NULL) + { + int16 fileNum = FakeCurResFile(); + Handle pict = FakeGet1Resource('PICT', 128); + if (pict) + { + Size size = FakeGetHandleSize(pict); + NSData *imageData = [NSData dataWithBytes:*pict length:size]; + + if (imageData) + { + NSImage *image = [[NSImage alloc] initWithData:imageData]; + + if (image) + { + CGContextDrawImage(ctx, bounds, [image CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]); + } + } + } + else + { + pict = FakeGet1Resource('Thum', 128); + Size size = FakeGetHandleSize(pict); + NSData *imageData = [NSData dataWithBytes:*pict length:size]; + + if (imageData) + { + CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, (__bridge CFDataRef)imageData, size, NULL); + + if (provider) + { + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + + if (colorSpace) + { + CGImageRef image = CGImageCreate(128, 120, 5, 16, 256, colorSpace, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Big, provider, NULL, 0, kCGRenderingIntentDefault); + + if (image) + { + CGContextDrawImage(ctx, bounds, image); + CGImageRelease(image); + } + + CGColorSpaceRelease(colorSpace); + } + + CFRelease(provider); + } + } + } + + FakeCloseResFile(fileNum); + } + + } + + CGContextRestoreGState(ctx); +} + +bool8 S9xDoScreenshot (int width, int height) +{ + Settings.TakeScreenshot = false; + + uint16 *data; + + data = (uint16 *) malloc(512 * 478 * 2); + if (data) + { + uint16 *sp, *dp; + + if (width > 256 && height > 239) + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 512; + + for (int x = 0; x < width; x++) + *dp++ = *sp++; + } + } + else + if (width > 256) + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 2 * 512; + + for (int x = 0; x < width; x++) + { + *dp = *(dp + 512) = *sp++; + dp++; + } + } + } + else + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 2 * 512; + + for (int x = 0; x < width; x++) + { + *dp = *(dp + 1) = *(dp + 512) = *(dp + 512 + 1) = *sp++; + dp += 2; + } + } + } + + CGImageRef image; + + image = CreateBlitScreenCGImage(512, (height > 239) ? height : (height * 2), 1024, (uint8 *) data); + if (image) + { + ExportCGImageToPNGFile(image, S9xGetPNGFilename()); + CGImageRelease(image); + } + + free(data); + } + + return (true); +} diff --git a/macosx/mac-server.cpp b/macosx/mac-server.mm similarity index 98% rename from macosx/mac-server.cpp rename to macosx/mac-server.mm index f2145743..69028fd8 100644 --- a/macosx/mac-server.cpp +++ b/macosx/mac-server.mm @@ -129,8 +129,8 @@ static bool8 NPServerSendPlayerListToClient (int); static void * NPServerListenLoop (void *); static void * NPServerProcessThread (void *); static void * NPServerNetPlayThread (void *); -static pascal void NPServerDialogTimerHandler (EventLoopTimerRef, void *); -static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *); +static void NPServerDialogTimerHandler (EventLoopTimerRef, void *); +static OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *); bool8 NPServerDialog (void) @@ -189,7 +189,7 @@ bool8 NPServerDialog (void) return (!npserver.dialogcancel); } -static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) +static void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) { WindowRef window = (WindowRef) userData; CFStringRef ref; @@ -308,7 +308,7 @@ static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void * } } -static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; diff --git a/macosx/mac-snes9x.h b/macosx/mac-snes9x.h index 85c6995b..cfa8bf76 100755 --- a/macosx/mac-snes9x.h +++ b/macosx/mac-snes9x.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -58,7 +59,7 @@ void SNES9X_Reset (void); void SNES9X_SoftReset (void); void SNES9X_Quit (void); void SNES9X_InitSound (void); -bool8 SNES9X_OpenCart (FSRef *); +bool8 SNES9X_OpenCart (NSURL *); bool8 SNES9X_OpenMultiCart (void); bool8 SNES9X_Freeze (void); bool8 SNES9X_FreezeTo (void); diff --git a/macosx/mac-snes9x.cpp b/macosx/mac-snes9x.mm similarity index 80% rename from macosx/mac-snes9x.cpp rename to macosx/mac-snes9x.mm index 151f785d..88574d1a 100755 --- a/macosx/mac-snes9x.cpp +++ b/macosx/mac-snes9x.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -36,7 +37,6 @@ #include "mac-file.h" #include "mac-multicart.h" #include "mac-os.h" -#include "mac-quicktime.h" #include "mac-screenshot.h" #include "mac-stringtools.h" #include "mac-snes9x.h" @@ -50,13 +50,10 @@ void SNES9X_Go (void) running = true; } -bool8 SNES9X_OpenCart (FSRef *inRef) +bool8 SNES9X_OpenCart (NSURL *inRef) { - OSStatus err; - FSRef cartRef; - char filename[PATH_MAX + 1]; - - DeinitGameWindow(); + NSURL *cartRef; + const char *filename = inRef.path.UTF8String; if (cartOpen) { @@ -69,18 +66,19 @@ bool8 SNES9X_OpenCart (FSRef *inRef) if (!inRef) { - if (!NavOpenROMImage(&cartRef)) + cartRef = NavOpenROMImage(); + if (!cartRef) { cartOpen = false; return (false); } } else - cartRef = *inRef; + cartRef = inRef; spcFileCount = pngFileCount = 0; - CheckSaveFolder(&cartRef); + CheckSaveFolder(cartRef); Settings.ForceLoROM = (romDetect == kLoROMForce ); Settings.ForceHiROM = (romDetect == kHiROMForce ); @@ -98,8 +96,6 @@ bool8 SNES9X_OpenCart (FSRef *inRef) S9xResetSaveTimer(true); - err = FSRefMakePath(&cartRef, (unsigned char *) filename, PATH_MAX); - SNES9X_InitSound(); if (Memory.LoadROM(filename)) @@ -110,9 +106,6 @@ bool8 SNES9X_OpenCart (FSRef *inRef) ChangeTypeAndCreator(filename, 'CART', '~9X~'); - AddRecentItem(&cartRef); - BuildRecentMenu(); - ApplyNSRTHeaderControllers(); for (int a = 0; a < MAC_MAX_PLAYERS; a++) @@ -133,8 +126,6 @@ bool8 SNES9X_OpenMultiCart (void) Boolean r; char cart[2][PATH_MAX + 1]; - DeinitGameWindow(); - if (cartOpen) { SNES9X_SaveSRAM(); @@ -238,8 +229,6 @@ void SNES9X_SoftReset (void) bool8 SNES9X_Freeze (void) { - OSStatus err; - FSRef ref; int which; const char *filename; @@ -253,14 +242,11 @@ bool8 SNES9X_Freeze (void) { filename = S9xGetFreezeFilename(which); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + unlink(filename); S9xFreezeGame(filename); ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + WriteThumbnailToExtendedAttribute(filename, 128, 120); SNES9X_Go(); @@ -310,22 +296,17 @@ bool8 SNES9X_Defrost (void) bool8 SNES9X_FreezeTo (void) { - OSStatus err; - FSRef ref; - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavFreezeTo(filename)) + NSURL *url = NavFreezeTo(); + if (url != nil) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + const char *filename = url.path.UTF8String; + unlink(filename); S9xFreezeGame(filename); - ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + ChangeTypeAndCreator(filename, 'SAVE', '~9X~');; + WriteThumbnailToExtendedAttribute(filename, 128, 120); return (true); } @@ -336,12 +317,12 @@ bool8 SNES9X_FreezeTo (void) bool8 SNES9X_DefrostFrom (void) { - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavDefrostFrom(filename)) + NSURL *url = NavDefrostFrom(); + if (url != nil) { + const char *filename = url.path.UTF8String; S9xUnfreezeGame(filename); SNES9X_Go(); @@ -355,17 +336,13 @@ bool8 SNES9X_DefrostFrom (void) bool8 SNES9X_RecordMovie (void) { - OSStatus err; - FSRef ref; - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavRecordMovieTo(filename)) + NSURL *url = NavRecordMovieTo(); + if (url != nil) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + const char *filename = url.path.UTF8String; + unlink(filename); int r; uint8 opt = 0, mask = 0; @@ -379,15 +356,14 @@ bool8 SNES9X_RecordMovie (void) else opt |= MOVIE_OPT_FROM_SNAPSHOT; - r = S9xMovieCreate(filename, mask, opt, macRecordWChar, wcslen(macRecordWChar)); + r = S9xMovieCreate(filename, mask, opt, macRecordWChar, (int)wcslen(macRecordWChar)); if (r == SUCCESS) { ChangeTypeAndCreator(filename, 'SMOV', '~9X~'); if ((macRecordFlag & (1 << 5)) == 0) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + WriteThumbnailToExtendedAttribute(filename, 128, 120); } SNES9X_Go(); @@ -402,12 +378,12 @@ bool8 SNES9X_RecordMovie (void) bool8 SNES9X_PlayMovie (void) { - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavPlayMovieFrom(filename)) + NSURL *url = NavPlayMovieFrom(); + if (url != nil) { + const char *filename = url.path.UTF8String; int r; r = S9xMovieOpen(filename, macPlayFlag & 1); @@ -425,13 +401,11 @@ bool8 SNES9X_PlayMovie (void) bool8 SNES9X_QTMovieRecord (void) { - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavQTMovieRecordTo(filename)) + NSURL *url = NavQTMovieRecordTo(); + if (url != nil) { - MacQTStartRecording(filename); macQTRecord = true; SNES9X_Go(); @@ -446,16 +420,12 @@ bool8 SNES9X_QTMovieRecord (void) void SNES9X_Quit (void) { - DeinitGameWindow(); - if (cartOpen) { SNES9X_SaveSRAM(); S9xResetSaveTimer(false); S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); } - - finished = true; } void SNES9X_InitSound (void) diff --git a/macosx/mac-stringtools.h b/macosx/mac-stringtools.h index 430ce462..66667fac 100755 --- a/macosx/mac-stringtools.h +++ b/macosx/mac-stringtools.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-stringtools.cpp b/macosx/mac-stringtools.mm similarity index 98% rename from macosx/mac-stringtools.cpp rename to macosx/mac-stringtools.mm index fae1c6aa..fb3ebeb2 100755 --- a/macosx/mac-stringtools.cpp +++ b/macosx/mac-stringtools.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/shaders.metal b/macosx/shaders.metal new file mode 100644 index 00000000..d29eecbe --- /dev/null +++ b/macosx/shaders.metal @@ -0,0 +1,62 @@ +#include +#include + +using namespace metal; + +typedef struct +{ + vector_float2 position; + vector_float2 textureCoordinate; +} MetalVertex; + +typedef struct +{ + // The [[position]] attribute qualifier of this member indicates this value is + // the clip space position of the vertex when this structure is returned from + // the vertex shader + float4 position [[position]]; + + // Since this member does not have a special attribute qualifier, the rasterizer + // will interpolate its value with values of other vertices making up the triangle + // and pass that interpolated value to the fragment shader for each fragment in + // that triangle. + float2 textureCoordinate; + +} RasterizerData; + +// Vertex Function +vertex RasterizerData +vertexShader(uint vertexID [[ vertex_id ]], constant MetalVertex *vertexArray [[ buffer(0) ]], constant vector_uint2 *viewportSizePointer [[ buffer(1) ]]) +{ + + RasterizerData out; + + float2 pixelSpacePosition = vertexArray[vertexID].position.xy; + + float2 viewportSize = float2(*viewportSizePointer); + + out.position = vector_float4(0.0, 0.0, 0.0, 1.0); + out.position.xy = pixelSpacePosition / (viewportSize / 2.0); + out.textureCoordinate = vertexArray[vertexID].textureCoordinate; + + return out; +} + +fragment float4 +fragmentShader(RasterizerData in [[stage_in]], texture2d colorTexture [[ texture(0) ]], constant int *videoModePointer [[ buffer(1) ]]) +{ + int videoMode = int(*videoModePointer); + + if ( videoMode == 0) + { + constexpr sampler textureSampler (mag_filter::nearest, min_filter::nearest); + const half4 colorSample = colorTexture.sample(textureSampler, in.textureCoordinate); + return float4(colorSample); + } + else + { + constexpr sampler textureSampler (mag_filter::linear, min_filter::linear); + const half4 colorSample = colorTexture.sample(textureSampler, in.textureCoordinate); + return float4(colorSample); + } +} diff --git a/macosx/snes9x framework/Info.plist b/macosx/snes9x framework/Info.plist new file mode 100644 index 00000000..e1fe4cfb --- /dev/null +++ b/macosx/snes9x framework/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/macosx/snes9x framework/gamecontrollerdb.txt b/macosx/snes9x framework/gamecontrollerdb.txt new file mode 100644 index 00000000..78d3bdf8 --- /dev/null +++ b/macosx/snes9x framework/gamecontrollerdb.txt @@ -0,0 +1,744 @@ +# Game Controller DB for SDL in 2.0.10 format +# Source: https://github.com/gabomdq/SDL_GameControllerDB + +# Windows +03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows, +03000000c82d00002038000000000000,8bitdo,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000011ab000000000000,8BitDo F30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00015900000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00065280000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000102800000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00003028000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000351000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006228000000000000,8BitDo SN30 GP,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000031000000000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000a00500003232000000000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +030000008f0e00001200000000000000,Acme GA-02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000fa190000f0ff000000000000,Acteck AGJ-3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001401000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001402000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000001d57000000000000,Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000869800002400000000007801,Astro C40 TR,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d6200000e557000000000000,Batarang,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows, +030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000000055000000000000,Betop BFM Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006321000000000000,BETOP CONTROLLER,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000006b1400000055000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006b1400000103000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +0300000066f700000500000000000000,BrutalLegendTest,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000d81d00000b00000000000000,BUFFALO BSGP1601 Series ,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows, +03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000a102000000000000,Controller (Xbox 360 Wireless Receiver for Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ff02000000000000,Controller (Xbox One For Windows) - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ea02000000000000,Controller (Xbox One For Windows) - Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Windows, +03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows, +030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000341a00000108000000000000,EXEQ RF USB Gamepad 8206,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008500000000000000,Fighting Commander 2016 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008400000000000000,Fighting Commander 5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008700000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008800000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +78696e70757403000000000000000000,Fightstick TES,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000790000000600000000000000,G-Shark GS-GP702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +0300000066f700000100000000000000,Game VIB Joystick,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows, +03000000260900002625000000000000,Gamecube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,lefttrigger:a4,leftx:a0,lefty:a1,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Windows, +030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000280400000140000000000000,GamePad Pro USB,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000ac0500003d03000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ac0500004d04000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ffff00000000000000000000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006f0e00000102000000007801,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008305000009a0000000000000,Genius,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008305000031b0000000000000,Genius Maxfire Blaze 3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000451300000010000000000000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000005c1a00003330000000000000,Genius MaxFire Grandias 12V,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c283000000000000,Gioteck,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f025000021c1000000000000,Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c383000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c483000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000007d0400000540000000000000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004900000000000000,Hatsune Miku Sho Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d81400000862000000000000,HitBox Edition Cthulhu+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +03000000632500002605000000000000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005f00000000000000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005e00000000000000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004000000000000000,Hori Fighting Stick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006e00000000000000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006600000000000000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000ee00000000000000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000250900000017000000000000,HRAP2 on PS/SS/N64 Joypad to USB BOX,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows, +030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows, +03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000830500006020000000000000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Windows, +03000000b50700001403000000000000,Impact Black,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000ac0500002c02000000000000,IPEGA,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000304000000000000,Ipega PG-9087 - Bluetooth Gamepad,+righty:+a5,-righty:-a4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows, +030000006e0500000a20000000000000,JC-DUX60 ELECOM MMO Gamepad,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows, +030000006e0500000520000000000000,JC-P301U,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000320000000000000,JC-U3613M (DInput),a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000720000000000000,JC-W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +030000007e0500000620000000000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, +030000007e0500000720000000000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000bd12000003c0000000000000,JY-P70UR,a:b1,b:b0,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b4,x:b3,y:b2,platform:Windows, +03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows, +030000006d04000016c2000000000000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000018c2000000000000,Logitech F510 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000019c2000000000000,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006652000000000000,Mad Catz C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005032000000000000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005082000000000000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008433000000000000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008483000000000000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008134000000000000,Mad Catz FightStick TE2+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008184000000000000,Mad Catz FightStick TE2+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,leftstick:b10,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006252000000000000,Mad Catz Micro C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008034000000000000,Mad Catz TE2 PS3 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008084000000000000,Mad Catz TE2 PS4 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008532000000000000,Madcatz Arcade Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700003888000000000000,Madcatz Arcade Fightstick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700001888000000000000,MadCatz SFIV FightStick PS3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000380700008081000000000000,MADCATZ SFV Arcade FightStick Alpha PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000002a0600001024000000000000,Matricom,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows, +03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows, +03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,back:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b0,leftshoulder:b4,leftstick:b0,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b0,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00001030000000000000,Mayflash USB Adapter for original Sega Saturn controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000002418000000000000,Mega Drive,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000380700006382000000000000,MLG GamePad PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Windows, +03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000bd12000015d0000000000000,Nintendo Retrolink USB Super SNES Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows, +03000000550900001472000000000000,NVIDIA Controller v01.04,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows, +030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows, +03000000782300000a10000000000000,Onlive Wireless Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows, +03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000362800000100000000000000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows, +03000000120c0000f60e000000000000,P4 Wired Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000004c050000da0c000000000000,PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000d62000006dca000000000000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000009557000000000000,Pro Elite PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000009f31000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d6200000c757000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000632500002306000000000000,PS Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000e30500009605000000000000,PS to USB convert cable,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000100800000100000000000000,PS1 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000008f0e00007530000000000000,PS1 Controller,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100800000300000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000250900008888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000666600006706000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows, +030000006b1400000303000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000009d0d00001330000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000250900000500000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows, +030000004c0500006802000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:a3~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:a4~,rightx:a2,righty:a5,start:b8,x:b3,y:b0,platform:Windows, +03000000632500007505000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000888800000803000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +030000008f0e00001431000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000003807000056a8000000000000,PS3 RF pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100000008200000000000000,PS360+ v1.66,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:h0.4,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000a00b000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000cc09000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00000011000000000000,QanBa Arcade JoyStick 1008,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b10,x:b0,y:b3,platform:Windows, +03000000300f00001611000000000000,QanBa Arcade JoyStick 4018,a:b1,b:b2,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +03000000222c00000020000000000000,QANBA DRONE ARCADE JOYSTICK,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001210000000000000,QanBa Joystick Plus,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000341a00000104000000000000,QanBa Joystick Q4RAF,a:b5,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b1,y:b2,platform:Windows, +03000000222c00000223000000000000,Qanba Obsidian Arcade Joystick PS3 Mode,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000222c00000023000000000000,Qanba Obsidian Arcade Joystick PS4 Mode,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00001100000000000000,REAL ARCADE PRO.3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00007000000000000000,REAL ARCADE PRO.4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002200000000000000,REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005b00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005c00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000020d000000000000,Revolution Pro Controller 2(1/2),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000003d0000000000000,run'n'drive,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:a3,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:a4,rightstick:b11,righttrigger:b5,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000a30600001af5000000000000,Saitek Cyborg,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000023f6000000000000,Saitek Cyborg V.1 Game pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001201000000000000,Saitek Dual Analog Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000701000000000000,Saitek P220,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b5,x:b0,y:b1,platform:Windows, +03000000a30600000cff000000000000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,x:b0,y:b1,platform:Windows, +03000000a30600000c04000000000000,Saitek P2900,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001001000000000000,Saitek P480 Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000b04000000000000,Saitek P990,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Windows, +03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows, +03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows, +03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000007d0000000000000,T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f0400000ab1000000000000,T.16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows, +03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000004f04000023b3000000000000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Windows, +030000004f04000004b3000000000000,Thrustmaster Firestorm Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +03000000666600000488000000000000,TigerGame PS/PS2 Game Controller Adapter,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows, +03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000006e0500001320000000000000,U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000341a00002308000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000005509000000b4000000000000,USB gamepad,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows, +030000006b1400000203000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000790000000a00000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c183000000000000,USB gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000ff1100004133000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000632500002305000000000000,USB Vibration Joystick (BM),a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000302000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000786901006e70000000000000,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, + +# Mac OS X +030000008f0e00000300000009010000,2In1 USB Joystick,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000031000001000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X, +03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000000600000000000000,G-Shark GP-702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000ad1b000001f9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000006f0e00000102000000000000,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007d0400000540000001010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000000000,HORI Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000000000,HORI Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00004d00000000000000,HORI Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00009200000000010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006e00000000010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000000000,HORIPAD FPS PLUS 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f0000ee00000000010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008f0e00001330000011010000,HuiJia SNES Controller,a:b4,b:b2,back:b16,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b12,rightshoulder:b14,start:b18,x:b6,y:b0,platform:Mac OS X, +03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X, +03000000830500006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X, +030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d0400001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000006d04000018c2000000010000,Logitech RumblePad 2 USB,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005032000000010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005082000000010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008433000000010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008483000000010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X, +0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X, +03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X, +03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X, +03000000632500007505000000020000,NEOGEO mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X, +030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Mac OS X, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X, +030000004c050000da0c000000010000,Playstation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008916000000fd000000000000,Razer Onza TE,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000c6240000fefa000000000000,Rock Candy Gamepad for PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X, +03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X, +03000000b40400000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X, +030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X, +030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000a00b000000000000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000005e0400008e02000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +03000000381000002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000020010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Mac OS X, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Mac OS X, +03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X, +030000006f0e00000302000025040000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000791d00000103000009010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X, +050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X, +030000005e0400008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000c6240000045d000000000000,Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000d102000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000dd02000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000e302000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, + +# Linux +05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux, +03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00003028000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +030000005e0400008e02000020010000,8BitDo Wireless Adapter,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c82d00000031000011010000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +05000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +030000006f0e00001302000000010000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux, +03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux, +03000000ffff0000ffff000000010000,Chinese-made Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux, +03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000b40400000a01000000010000,CYPRESS USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux, +03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux, +030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000007d0400000540000000010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000280400000140000000010000,Gravis GamePad Pro USB ,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys GamePad ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux, +030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +06000000adde0000efbe000002010000,Hidromancer Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux, +03000000c9110000f055000011010000,HJC Game GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,platform:Linux, +030000000d0f00001000000011010000,HORI CO. LTD. FIGHTING STICK 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006a00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006b00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00002200000011010000,HORI CO. LTD. REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005f00000011010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005e00000011010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006e00000011010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006600000011010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f0000ee00000011010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006700000001010000,HORIPAD ONE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux, +03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, +050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux, +03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux, +0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux, +03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000300f00000b01000010010000,Jess Tech GGE909 PC Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +050000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400000ac2000010010000,Logitech Inc. WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Linux, +030000006d04000015c2000010010000,Logitech Logitech Extreme 3D,a:b0,b:b4,back:b6,guide:b8,leftshoulder:b9,leftstick:h0.8,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:h0.2,start:b7,x:b2,y:b5,platform:Linux, +030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,platform:Linux, +05000000380700006652000025010000,Mad Catz C.T.R.L.R ,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005032000011010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005082000011010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Linux, +03000000380700008034000011010000,Mad Catz fightstick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008084000011010000,Mad Catz fightstick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008433000011010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008483000011010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000380700003847000090040000,Mad Catz Wired Xbox 360 Controller (SFIV),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000380700001888000010010000,MadCatz PC USB Wired Stick 8818,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700003888000010010000,MadCatz PC USB Wired Stick 8838,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +03000000790000004318000010010000,Mayflash GameCube Controller Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux, +0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +03000000780000000600000010010000,Microntek USB Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux, +030000005e0400008e02000004010000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000062230000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000e302000003020000,Microsoft X-Box One Elite pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000001010000,Microsoft X-Box One pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000dd02000003020000,Microsoft X-Box One pad (Firmware 2015),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +03000000c62400001a53000000010000,Mini PE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, +05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Linux, +030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux, +050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0500000308000010010000,Nostromo n45 Dual Analog Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux, +03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000005e0400000202000000010000,Old Xbox pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e0000a802000023020000,PDP Wired Controller for Xbox One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000004c050000da0c000011010000,Playstation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +03000000300f00001211000011010000,QanBa Arcade JoyStick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,platform:Linux, +030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux, +030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008916000000fd000024010000,Razer Onza Tournament Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000204000011010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000104000011010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000010000011010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux, +0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00004601000001010000,Rock Candy Xbox One Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux, +03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux, +03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a1,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux, +03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux, +03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux, +03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,a:b12,b:b10,back:b4,dpdown:b2,dpleft:b3,dpright:b1,dpup:b0,leftshoulder:b9,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b8,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b5,x:b13,y:b11,platform:Linux, +03000000f025000021c1000010010000,ShanWan Gioteck PS3 Wired Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000632500007505000010010000,SHANWAN PS3/PC Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000bc2000000055000010010000,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000632500002305000010010000,ShanWan USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00000908000010010000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000ad1b000038f0000090040000,Street Fighter IV FightStick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Linux, +030000004f04000026b3000002040000,Thrustmaster Gamepad GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000025b000002020000,Thrustmaster GPX Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000012b3000010010000,Thrustmaster vibrating gamepad,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +03000000bd12000015d0000010010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux, +030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux, +03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux, +030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000791d00000103000010010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux, +030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000450c00002043000010010000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux, +03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, + +# Android +05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android, +64633436313965656664373634323364,Microsoft X-Box 360 pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android, +37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +61363931656135336130663561616264,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +5477696e20555342204a6f7973746963,Twin USB Joystick,a:b22,b:b21,back:b28,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b30,lefttrigger:b24,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b31,righttrigger:b25,rightx:a3,righty:a2,start:b29,x:b23,y:b20,platform:Android, +050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android, +050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +34356136633366613530316338376136,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android, + +# iOS +05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +050000004c050000cc090000df070000,DUALSHOCK 4 Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS, +4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS, +05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, diff --git a/macosx/snes9x framework/snes9x_framework.h b/macosx/snes9x framework/snes9x_framework.h new file mode 100644 index 00000000..b4c397fd --- /dev/null +++ b/macosx/snes9x framework/snes9x_framework.h @@ -0,0 +1,20 @@ +// +// snes9x_framework.h +// snes9x framework +// +// Created by Buckley on 7/4/19. +// + +#import + + +//! Project version number for snes9x_framework. +FOUNDATION_EXPORT double snes9x_frameworkVersionNumber; + +//! Project version string for snes9x_framework. +FOUNDATION_EXPORT const unsigned char snes9x_frameworkVersionString[]; + +#import +#import + + diff --git a/macosx/snes9x.xcodeproj/project.pbxproj b/macosx/snes9x.xcodeproj/project.pbxproj index 0fd5dae8..f2127ce9 100755 --- a/macosx/snes9x.xcodeproj/project.pbxproj +++ b/macosx/snes9x.xcodeproj/project.pbxproj @@ -3,726 +3,309 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ - 85FEF90820DDB15C00C038E9 /* bml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90620DDB15B00C038E9 /* bml.cpp */; }; - 85FEF90920DDB15C00C038E9 /* bml.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90720DDB15C00C038E9 /* bml.h */; }; - 85FEF90C20DDB18E00C038E9 /* sha256.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90A20DDB18D00C038E9 /* sha256.cpp */; }; - 85FEF90D20DDB18E00C038E9 /* sha256.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90B20DDB18D00C038E9 /* sha256.h */; }; - BF0B39AF1FA5792F002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39B01FA5792F002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39B11FA5792F002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39B21FA5792F002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39B31FA5792F002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39B41FA5792F002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39B51FA5792F002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39B61FA5792F002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39B81FA5792F002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39D61FA5792F002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39D71FA5792F002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39D81FA5792F002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B39DA1FA5792F002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B39DC1FA5792F002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - BF0B39DF1FA580F9002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E01FA5810A002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E11FA5810B002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E31FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E41FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E51FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E61FA5812E002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39E71FA5812E002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39E81FA58131002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39E91FA58131002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39EA1FA5814B002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39EB1FA5814B002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39EC1FA5814D002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39ED1FA5814D002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39EE1FA58150002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39EF1FA58151002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39F01FA58154002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39F11FA58154002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39F21FA58159002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39F31FA5815A002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39F41FA5815C002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39F51FA5815C002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39F81FA58162002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39F91FA58163002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39FA1FA58165002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39FB1FA58165002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39FC1FA58167002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39FD1FA58167002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39FE1FA5816A002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B39FF1FA5816A002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B3A001FA5816D002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B3A011FA5816D002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B3A041FA58172002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - BF0B3A051FA58172002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - CE6E9065227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E9066227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E9067227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E906B227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906C227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906D227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906E227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E906F227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E9070227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E9071227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CE6E9072227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CE6E9073227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CF047D38109D0E0600FD0754 /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF047D3B109D0E0600FD0754 /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF047D3C109D0E0600FD0754 /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF047D3D109D0E0600FD0754 /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF047D3E109D0E0600FD0754 /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF047D3F109D0E0600FD0754 /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF047D40109D0E0600FD0754 /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF047D41109D0E0600FD0754 /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF047D42109D0E0600FD0754 /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF047D43109D0E0600FD0754 /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF047D44109D0E0600FD0754 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CF047D45109D0E0600FD0754 /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF047D46109D0E0600FD0754 /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF047D47109D0E0600FD0754 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF047D48109D0E0600FD0754 /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF047D49109D0E0600FD0754 /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF047D4A109D0E0600FD0754 /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF047D4B109D0E0600FD0754 /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF047D4C109D0E0600FD0754 /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF047D4D109D0E0600FD0754 /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF047D4E109D0E0600FD0754 /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF047D4F109D0E0600FD0754 /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF047D50109D0E0600FD0754 /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF047D51109D0E0600FD0754 /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF047D52109D0E0600FD0754 /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF047D53109D0E0600FD0754 /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF047D54109D0E0600FD0754 /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF047D55109D0E0600FD0754 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF047D56109D0E0600FD0754 /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF047D57109D0E0600FD0754 /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF047D58109D0E0600FD0754 /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF047D59109D0E0600FD0754 /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF047D5A109D0E0600FD0754 /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF047D5B109D0E0600FD0754 /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF047D5C109D0E0600FD0754 /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF047D5D109D0E0600FD0754 /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF047D5E109D0E0600FD0754 /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF047D5F109D0E0600FD0754 /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF047D62109D0E0600FD0754 /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF047D63109D0E0600FD0754 /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF047D64109D0E0600FD0754 /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF047D65109D0E0600FD0754 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF047D66109D0E0600FD0754 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF047D67109D0E0600FD0754 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF047D68109D0E0600FD0754 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF047D69109D0E0600FD0754 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CF047D6A109D0E0600FD0754 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CF047D6B109D0E0600FD0754 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CF047D6C109D0E0600FD0754 /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF047D6D109D0E0600FD0754 /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF047D6E109D0E0600FD0754 /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF047D6F109D0E0600FD0754 /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF047D70109D0E0600FD0754 /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF047D71109D0E0600FD0754 /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF047D72109D0E0600FD0754 /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF047D73109D0E0600FD0754 /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF047D74109D0E0600FD0754 /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF047D75109D0E0600FD0754 /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF047D76109D0E0600FD0754 /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF047D77109D0E0600FD0754 /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF047D78109D0E0600FD0754 /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF047D79109D0E0600FD0754 /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF047D7A109D0E0600FD0754 /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF047D7B109D0E0600FD0754 /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF047D7C109D0E0600FD0754 /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF047D7D109D0E0600FD0754 /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF047D7E109D0E0600FD0754 /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF047D7F109D0E0600FD0754 /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF047D80109D0E0600FD0754 /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF047D81109D0E0600FD0754 /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF047D82109D0E0600FD0754 /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF047D83109D0E0600FD0754 /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF047D84109D0E0600FD0754 /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF047D85109D0E0600FD0754 /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF047D86109D0E0600FD0754 /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF047D87109D0E0600FD0754 /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF047D88109D0E0600FD0754 /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF047D89109D0E0600FD0754 /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF047D8A109D0E0600FD0754 /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF047D8B109D0E0600FD0754 /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF047D8C109D0E0600FD0754 /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF047D8D109D0E0600FD0754 /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF047D8E109D0E0600FD0754 /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF047D8F109D0E0600FD0754 /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF047D90109D0E0600FD0754 /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF047D91109D0E0600FD0754 /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF047D92109D0E0600FD0754 /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF047D93109D0E0600FD0754 /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF047D94109D0E0600FD0754 /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF047D95109D0E0600FD0754 /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF047D96109D0E0600FD0754 /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF047D97109D0E0600FD0754 /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF047D98109D0E0600FD0754 /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF047D99109D0E0600FD0754 /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF047D9B109D0E0600FD0754 /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF047D9C109D0E0600FD0754 /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF047D9D109D0E0600FD0754 /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF047D9E109D0E0600FD0754 /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF047D9F109D0E0600FD0754 /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF047DA0109D0E0600FD0754 /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF047DA1109D0E0600FD0754 /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF047DA2109D0E0600FD0754 /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF047DA3109D0E0600FD0754 /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF047DA4109D0E0600FD0754 /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF047DA5109D0E0600FD0754 /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF047DA6109D0E0600FD0754 /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF047DA7109D0E0600FD0754 /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF047DA8109D0E0600FD0754 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF047DA9109D0E0600FD0754 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF047DAB109D0E0600FD0754 /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF047DAF109D0E0600FD0754 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF047DB0109D0E0600FD0754 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF047DB1109D0E0600FD0754 /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF047DB2109D0E0600FD0754 /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF047DB3109D0E0600FD0754 /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF047DB4109D0E0600FD0754 /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF047DB5109D0E0600FD0754 /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF047DB6109D0E0600FD0754 /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF047DB7109D0E0600FD0754 /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF047DB8109D0E0600FD0754 /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF047DB9109D0E0600FD0754 /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF047DBA109D0E0600FD0754 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CF047DBB109D0E0600FD0754 /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF047DBC109D0E0600FD0754 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CF047DBD109D0E0600FD0754 /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF047DBE109D0E0600FD0754 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF047DBF109D0E0600FD0754 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF047DC0109D0E0600FD0754 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF047DC2109D0E0600FD0754 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CF047DC3109D0E0600FD0754 /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF047DC4109D0E0600FD0754 /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF047DC5109D0E0600FD0754 /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF047DC6109D0E0600FD0754 /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF047DC7109D0E0600FD0754 /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF047DC8109D0E0600FD0754 /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF047DC9109D0E0600FD0754 /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF047DCA109D0E0600FD0754 /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF047DCB109D0E0600FD0754 /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF047DCC109D0E0600FD0754 /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF047DCD109D0E0600FD0754 /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF047DCE109D0E0600FD0754 /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF047DCF109D0E0600FD0754 /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF047DD0109D0E0600FD0754 /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF047DD1109D0E0600FD0754 /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF047DD2109D0E0600FD0754 /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF047DD3109D0E0600FD0754 /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF047DD4109D0E0600FD0754 /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF047DD5109D0E0600FD0754 /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF047DD8109D0E0600FD0754 /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF047DD9109D0E0600FD0754 /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF047DDA109D0E0600FD0754 /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF047DDB109D0E0600FD0754 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF047DDC109D0E0600FD0754 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF047DDD109D0E0600FD0754 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF047DDE109D0E0600FD0754 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF047DDF109D0E0600FD0754 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CF047DE0109D0E0600FD0754 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CF047DE1109D0E0600FD0754 /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE2109D0E0600FD0754 /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE3109D0E0600FD0754 /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE4109D0E0600FD0754 /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE5109D0E0600FD0754 /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE6109D0E0600FD0754 /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE7109D0E0600FD0754 /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE8109D0E0600FD0754 /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE9109D0E0600FD0754 /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DEA109D0E0600FD0754 /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF047DEB109D0E0600FD0754 /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF047DEC109D0E0600FD0754 /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF047DED109D0E0600FD0754 /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF047DEE109D0E0600FD0754 /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF047DEF109D0E0600FD0754 /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF047DF0109D0E0600FD0754 /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF047DF1109D0E0600FD0754 /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF047DF2109D0E0600FD0754 /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF047DF3109D0E0600FD0754 /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF047DF4109D0E0600FD0754 /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF047DF5109D0E0600FD0754 /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF047DF6109D0E0600FD0754 /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF047DF7109D0E0600FD0754 /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF047DF8109D0E0600FD0754 /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF047DF9109D0E0600FD0754 /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF047DFA109D0E0600FD0754 /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF047DFB109D0E0600FD0754 /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF047DFC109D0E0600FD0754 /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF047DFD109D0E0600FD0754 /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF047DFE109D0E0600FD0754 /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF047DFF109D0E0600FD0754 /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF047E00109D0E0600FD0754 /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF047E01109D0E0600FD0754 /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF047E02109D0E0600FD0754 /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF047E04109D0E0600FD0754 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF047E05109D0E0600FD0754 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF047E06109D0E0600FD0754 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF047E07109D0E0600FD0754 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF047E08109D0E0600FD0754 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF047E09109D0E0600FD0754 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF047E0A109D0E0600FD0754 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF047E0B109D0E0600FD0754 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF047E0C109D0E0600FD0754 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF047E0D109D0E0600FD0754 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF05677E0CF9971000C7877C /* QuartzCore.framework */; }; - CF047E0E109D0E0600FD0754 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF047E0F109D0E0600FD0754 /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF05668E0CF98E7E00C7877C /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF0566910CF98E7E00C7877C /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF0566920CF98E7E00C7877C /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF0566930CF98E7E00C7877C /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF0566940CF98E7E00C7877C /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF0566950CF98E7E00C7877C /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF0566960CF98E7E00C7877C /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF0566970CF98E7E00C7877C /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF0566980CF98E7E00C7877C /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF0566990CF98E7E00C7877C /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF05669A0CF98E7E00C7877C /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF05669B0CF98E7E00C7877C /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF05669D0CF98E7E00C7877C /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF05669E0CF98E7E00C7877C /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF05669F0CF98E7E00C7877C /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF0566A00CF98E7E00C7877C /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF0566A10CF98E7E00C7877C /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF0566A20CF98E7E00C7877C /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF0566A30CF98E7E00C7877C /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF0566A40CF98E7E00C7877C /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF0566A50CF98E7E00C7877C /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF0566A60CF98E7E00C7877C /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF0566A70CF98E7E00C7877C /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF0566A80CF98E7E00C7877C /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF0566A90CF98E7E00C7877C /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF0566AA0CF98E7E00C7877C /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF0566AB0CF98E7E00C7877C /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF0566AC0CF98E7E00C7877C /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF0566AD0CF98E7E00C7877C /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF0566AE0CF98E7E00C7877C /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF0566AF0CF98E7E00C7877C /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF0566B00CF98E7E00C7877C /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF0566B10CF98E7E00C7877C /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF0566B20CF98E7E00C7877C /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF0566B30CF98E7E00C7877C /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF0566B40CF98E7E00C7877C /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF0566B70CF98E7E00C7877C /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF0566B80CF98E7E00C7877C /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF0566B90CF98E7E00C7877C /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF0566BD0CF98E7E00C7877C /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF0566BE0CF98E7E00C7877C /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF0566BF0CF98E7E00C7877C /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF0566C00CF98E7E00C7877C /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF0566C10CF98E7E00C7877C /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF0566C20CF98E7E00C7877C /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF0566C30CF98E7E00C7877C /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF0566C40CF98E7E00C7877C /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF0566C50CF98E7E00C7877C /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF0566C60CF98E7E00C7877C /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF0566C70CF98E7E00C7877C /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF0566C80CF98E7E00C7877C /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF0566C90CF98E7E00C7877C /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF0566CA0CF98E7E00C7877C /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF0566CB0CF98E7E00C7877C /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF0566CC0CF98E7E00C7877C /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF0566CD0CF98E7E00C7877C /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF0566CE0CF98E7E00C7877C /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF0566D00CF98E7E00C7877C /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF0566D10CF98E7E00C7877C /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF0566D30CF98E7E00C7877C /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF0566D40CF98E7E00C7877C /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF0566D50CF98E7E00C7877C /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF0566D60CF98E7E00C7877C /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF0566D70CF98E7E00C7877C /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF0566D80CF98E7E00C7877C /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF0566D90CF98E7E00C7877C /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF0566DA0CF98E7E00C7877C /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF0566DC0CF98E7E00C7877C /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF0566DD0CF98E7E00C7877C /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF0566DF0CF98E7E00C7877C /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF0566E00CF98E7E00C7877C /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF0566E10CF98E7E00C7877C /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF0566E20CF98E7E00C7877C /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF0566E30CF98E7E00C7877C /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF0566E40CF98E7E00C7877C /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF0566E50CF98E7E00C7877C /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF0566E60CF98E7E00C7877C /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF0566E70CF98E7E00C7877C /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF0566E80CF98E7E00C7877C /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF0566E90CF98E7E00C7877C /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF0566EA0CF98E7E00C7877C /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF0566EB0CF98E7E00C7877C /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF0566EC0CF98E7E00C7877C /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF0566ED0CF98E7E00C7877C /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF0566EE0CF98E7E00C7877C /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF0566F00CF98E7E00C7877C /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF0566F10CF98E7E00C7877C /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF0566F20CF98E7E00C7877C /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF0566F30CF98E7E00C7877C /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF0566F40CF98E7E00C7877C /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF0566F50CF98E7E00C7877C /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF0566F60CF98E7E00C7877C /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF0566F70CF98E7E00C7877C /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF0566F80CF98E7E00C7877C /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF0566F90CF98E7E00C7877C /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF0566FA0CF98E7E00C7877C /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF0566FB0CF98E7E00C7877C /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF0566FC0CF98E7E00C7877C /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF0566FD0CF98E7E00C7877C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF0566FE0CF98E7E00C7877C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF0567000CF98E7E00C7877C /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF0567030CF98E7E00C7877C /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF0567040CF98E7E00C7877C /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF0567050CF98E7E00C7877C /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF0567060CF98E7E00C7877C /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF0567070CF98E7E00C7877C /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF0567080CF98E7E00C7877C /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF0567090CF98E7E00C7877C /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF05670A0CF98E7E00C7877C /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF05670B0CF98E7E00C7877C /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF05670C0CF98E7E00C7877C /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF05670D0CF98E7E00C7877C /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF05670F0CF98E7E00C7877C /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF0567100CF98E7E00C7877C /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF0567120CF98E7E00C7877C /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF0567130CF98E7E00C7877C /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF0567140CF98E7E00C7877C /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF0567150CF98E7E00C7877C /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF0567160CF98E7E00C7877C /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF0567170CF98E7E00C7877C /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF0567180CF98E7E00C7877C /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF0567190CF98E7E00C7877C /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF05671A0CF98E7E00C7877C /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF05671B0CF98E7E00C7877C /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF05671C0CF98E7E00C7877C /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF05671D0CF98E7E00C7877C /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF05671E0CF98E7E00C7877C /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF05671F0CF98E7E00C7877C /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF0567200CF98E7E00C7877C /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF0567210CF98E7E00C7877C /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF0567220CF98E7E00C7877C /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF0567230CF98E7E00C7877C /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF0567240CF98E7E00C7877C /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF0567270CF98E7E00C7877C /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF0567280CF98E7E00C7877C /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF0567290CF98E7E00C7877C /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF05672E0CF98E7E00C7877C /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF05672F0CF98E7E00C7877C /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567300CF98E7E00C7877C /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567310CF98E7E00C7877C /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567320CF98E7E00C7877C /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567330CF98E7E00C7877C /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567340CF98E7E00C7877C /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567350CF98E7E00C7877C /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567360CF98E7E00C7877C /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567380CF98E7E00C7877C /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF0567390CF98E7E00C7877C /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF05673B0CF98E7E00C7877C /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF05673C0CF98E7E00C7877C /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF05673D0CF98E7E00C7877C /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF05673E0CF98E7E00C7877C /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF05673F0CF98E7E00C7877C /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF0567400CF98E7E00C7877C /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF0567410CF98E7E00C7877C /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF0567420CF98E7E00C7877C /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF0567440CF98E7E00C7877C /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF0567450CF98E7E00C7877C /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF0567470CF98E7E00C7877C /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF0567480CF98E7E00C7877C /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF0567490CF98E7E00C7877C /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF05674A0CF98E7E00C7877C /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF05674B0CF98E7E00C7877C /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF05674C0CF98E7E00C7877C /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF05674D0CF98E7E00C7877C /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF05674E0CF98E7E00C7877C /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF05674F0CF98E7E00C7877C /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF0567500CF98E7E00C7877C /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF0567510CF98E7E00C7877C /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF0567520CF98E7E00C7877C /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF0567530CF98E7E00C7877C /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF0567550CF98E7E00C7877C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF0567560CF98E7E00C7877C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF0567570CF98E7E00C7877C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF0567580CF98E7E00C7877C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF0567590CF98E7E00C7877C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF05675A0CF98E7E00C7877C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF05675B0CF98E7E00C7877C /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF05675C0CF98E7E00C7877C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF05675D0CF98E7E00C7877C /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF05675E0CF98E7E00C7877C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF0567600CF98E7E00C7877C /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF0567810CF9971000C7877C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF05677E0CF9971000C7877C /* QuartzCore.framework */; }; - CF14733E132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF14733F132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF147340132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF2F46121095EE72007D33FA /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF2F46151095EE72007D33FA /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF2F46161095EE72007D33FA /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF2F46171095EE72007D33FA /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF2F46181095EE72007D33FA /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF2F46191095EE72007D33FA /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF2F461A1095EE72007D33FA /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF2F461B1095EE72007D33FA /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF2F461C1095EE72007D33FA /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF2F461D1095EE72007D33FA /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF2F461E1095EE72007D33FA /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CF2F461F1095EE72007D33FA /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF2F46201095EE72007D33FA /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF2F46211095EE72007D33FA /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF2F46221095EE72007D33FA /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF2F46231095EE72007D33FA /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF2F46241095EE72007D33FA /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF2F46251095EE72007D33FA /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF2F46261095EE72007D33FA /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF2F46271095EE72007D33FA /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF2F46281095EE72007D33FA /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF2F46291095EE72007D33FA /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF2F462A1095EE72007D33FA /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF2F462B1095EE72007D33FA /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF2F462C1095EE72007D33FA /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF2F462D1095EE72007D33FA /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF2F462E1095EE72007D33FA /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF2F462F1095EE72007D33FA /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF2F46301095EE72007D33FA /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF2F46311095EE72007D33FA /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF2F46321095EE72007D33FA /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF2F46331095EE72007D33FA /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF2F46341095EE72007D33FA /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF2F46351095EE72007D33FA /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF2F46361095EE72007D33FA /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF2F46371095EE72007D33FA /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF2F46381095EE72007D33FA /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF2F46391095EE72007D33FA /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF2F463C1095EE72007D33FA /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF2F463D1095EE72007D33FA /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF2F463E1095EE72007D33FA /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF2F463F1095EE72007D33FA /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF2F46401095EE72007D33FA /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF2F46411095EE72007D33FA /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF2F46421095EE72007D33FA /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF2F46431095EE72007D33FA /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CF2F46441095EE72007D33FA /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CF2F46451095EE72007D33FA /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CF2F46461095EE72007D33FA /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF2F46471095EE72007D33FA /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF2F46481095EE72007D33FA /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF2F46491095EE72007D33FA /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF2F464A1095EE72007D33FA /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF2F464B1095EE72007D33FA /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF2F464C1095EE72007D33FA /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF2F464D1095EE72007D33FA /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF2F464E1095EE72007D33FA /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF2F464F1095EE72007D33FA /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF2F46501095EE72007D33FA /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF2F46511095EE72007D33FA /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF2F46521095EE72007D33FA /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF2F46531095EE72007D33FA /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF2F46541095EE72007D33FA /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF2F46551095EE72007D33FA /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF2F46561095EE72007D33FA /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF2F46571095EE72007D33FA /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF2F46581095EE72007D33FA /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF2F46591095EE72007D33FA /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF2F465A1095EE72007D33FA /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF2F465B1095EE72007D33FA /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF2F465C1095EE72007D33FA /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF2F465D1095EE72007D33FA /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF2F465E1095EE72007D33FA /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF2F465F1095EE72007D33FA /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF2F46601095EE72007D33FA /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF2F46611095EE72007D33FA /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF2F46621095EE72007D33FA /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF2F46631095EE72007D33FA /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF2F46641095EE72007D33FA /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF2F46651095EE72007D33FA /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF2F46661095EE72007D33FA /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF2F46671095EE72007D33FA /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF2F46681095EE72007D33FA /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF2F46691095EE72007D33FA /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF2F466A1095EE72007D33FA /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF2F466B1095EE72007D33FA /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF2F466C1095EE72007D33FA /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF2F466D1095EE72007D33FA /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF2F466E1095EE72007D33FA /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF2F466F1095EE72007D33FA /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF2F46701095EE72007D33FA /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF2F46711095EE72007D33FA /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF2F46721095EE72007D33FA /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF2F46731095EE72007D33FA /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF2F46751095EE72007D33FA /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF2F46761095EE72007D33FA /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF2F46771095EE72007D33FA /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF2F46781095EE72007D33FA /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF2F46791095EE72007D33FA /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF2F467A1095EE72007D33FA /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF2F467B1095EE72007D33FA /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF2F467C1095EE72007D33FA /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF2F467D1095EE72007D33FA /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF2F467E1095EE72007D33FA /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF2F467F1095EE72007D33FA /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF2F46801095EE72007D33FA /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF2F46811095EE72007D33FA /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF2F46821095EE72007D33FA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF2F46831095EE72007D33FA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF2F46851095EE72007D33FA /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF2F46891095EE72007D33FA /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF2F468A1095EE72007D33FA /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF2F468B1095EE72007D33FA /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF2F468C1095EE72007D33FA /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF2F468D1095EE72007D33FA /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF2F468E1095EE72007D33FA /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF2F468F1095EE72007D33FA /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF2F46901095EE72007D33FA /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF2F46911095EE72007D33FA /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF2F46921095EE72007D33FA /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF2F46931095EE72007D33FA /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF2F46941095EE72007D33FA /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CF2F46951095EE72007D33FA /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF2F46961095EE72007D33FA /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CF2F46971095EE72007D33FA /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF2F46981095EE72007D33FA /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF2F46991095EE72007D33FA /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF2F469A1095EE72007D33FA /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF2F469C1095EE72007D33FA /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CF2F469D1095EE72007D33FA /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF2F469E1095EE72007D33FA /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF2F469F1095EE72007D33FA /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF2F46A01095EE72007D33FA /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF2F46A11095EE72007D33FA /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF2F46A21095EE72007D33FA /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF2F46A31095EE72007D33FA /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF2F46A41095EE72007D33FA /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF2F46A51095EE72007D33FA /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF2F46A61095EE72007D33FA /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF2F46A71095EE72007D33FA /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF2F46A81095EE72007D33FA /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF2F46A91095EE72007D33FA /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF2F46AA1095EE72007D33FA /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF2F46AB1095EE72007D33FA /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF2F46AC1095EE72007D33FA /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF2F46AD1095EE72007D33FA /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF2F46AE1095EE72007D33FA /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF2F46AF1095EE72007D33FA /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF2F46B21095EE72007D33FA /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF2F46B31095EE72007D33FA /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF2F46B41095EE72007D33FA /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF2F46B51095EE72007D33FA /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF2F46B61095EE72007D33FA /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF2F46B71095EE72007D33FA /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF2F46B81095EE72007D33FA /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF2F46B91095EE72007D33FA /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CF2F46BA1095EE72007D33FA /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CF2F46BB1095EE72007D33FA /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BC1095EE72007D33FA /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BD1095EE72007D33FA /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BE1095EE72007D33FA /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BF1095EE72007D33FA /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C01095EE72007D33FA /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C11095EE72007D33FA /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C21095EE72007D33FA /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C31095EE72007D33FA /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C41095EE72007D33FA /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF2F46C51095EE72007D33FA /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF2F46C61095EE72007D33FA /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF2F46C71095EE72007D33FA /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF2F46C81095EE72007D33FA /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF2F46C91095EE72007D33FA /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF2F46CA1095EE72007D33FA /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF2F46CB1095EE72007D33FA /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF2F46CC1095EE72007D33FA /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF2F46CD1095EE72007D33FA /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF2F46CE1095EE72007D33FA /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF2F46CF1095EE72007D33FA /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF2F46D01095EE72007D33FA /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF2F46D11095EE72007D33FA /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF2F46D21095EE72007D33FA /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF2F46D31095EE72007D33FA /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF2F46D41095EE72007D33FA /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF2F46D51095EE72007D33FA /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF2F46D61095EE72007D33FA /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF2F46D71095EE72007D33FA /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF2F46D81095EE72007D33FA /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF2F46D91095EE72007D33FA /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF2F46DA1095EE72007D33FA /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF2F46DB1095EE72007D33FA /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF2F46DC1095EE72007D33FA /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF2F46DE1095EE72007D33FA /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF2F46DF1095EE72007D33FA /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF2F46E01095EE72007D33FA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF2F46E11095EE72007D33FA /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF2F46E21095EE72007D33FA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF2F46E31095EE72007D33FA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF2F46E41095EE72007D33FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF2F46E51095EE72007D33FA /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF2F46E61095EE72007D33FA /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF2F46E81095EE72007D33FA /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF2F46E91095EE72007D33FA /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF3E424A1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E424B1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E424C1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E45BF137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45C1137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45C3137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45D113734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF3E45D213734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF3E45D313734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF46BEAA133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAB133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAC133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAE133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF46BEAF133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF46BEB0133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF5553C90EA24C36005957E4 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF5553CA0EA24C36005957E4 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF5553CB0EA24C36005957E4 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF5553CC0EA24C36005957E4 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF5553CD0EA24C36005957E4 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF5553CE0EA24C36005957E4 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF5553CF0EA24C36005957E4 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF5553D00EA24C36005957E4 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF5D3E130FAFD34200340007 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF5D3E240FAFD35400340007 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF5D3E250FAFD35400340007 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF5D3E260FAFD35400340007 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF5D3E2A0FAFD35A00340007 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CFA518C80EBCB3ED008379F6 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CFA518D40EBCB4AD008379F6 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CFA518D90EBCB4CA008379F6 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CFA518DD0EBCB4D2008379F6 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CFA518E80EBCB5B1008379F6 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CFCE2D47133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D48133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFCE2D49133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D4A133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFCE2D4B133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D4C133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFE7FBB10D2F6755002F3102 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CFE7FBB40D2F67BA002F3102 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CFE7FBB80D2F683C002F3102 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CFEFAE8B10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE8C10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE8D10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE9110EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9210EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9310EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; - CFEFAE9410EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9510EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9610EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; - CFEFAE9710EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9810EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9910EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; + 3000A9CF23418799007DC37F /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; + 3000A9D02341879B007DC37F /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; + 3000A9D123418852007DC37F /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; + 302EEC9C22DAD0AB006D1502 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */; }; + 302EEC9D22DAD0AB006D1502 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */; }; + 302EEC9F22DAD0B1006D1502 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9E22DAD0B1006D1502 /* AGL.framework */; }; + 302EECA322DAD0C5006D1502 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EECA222DAD0C5006D1502 /* CoreImage.framework */; }; + 302EECA522DAD1B9006D1502 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EECA422DAD1B9006D1502 /* CoreAudio.framework */; }; + 3042F7E3232E9BDD00C03F5E /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3042F7E2232E9BDD00C03F5E /* Carbon.framework */; }; + 3045A1EF22D03C4B0092B97D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3045A1EE22D03C4B0092B97D /* Cocoa.framework */; }; + 3059DA94250690DB003EF183 /* compat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3059DA93250690DB003EF183 /* compat.cpp */; }; + 30656200236A8BA700A1B3B2 /* gamecontrollerdb.txt in Resources */ = {isa = PBXBuildFile; fileRef = 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */; }; + 30714719230E379500917F82 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30714718230E379500917F82 /* AppDelegate.m */; }; + 3071471B230E379600917F82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3071471A230E379600917F82 /* Assets.xcassets */; }; + 3071471E230E379600917F82 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3071471C230E379600917F82 /* MainMenu.xib */; }; + 30714721230E379600917F82 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 30714720230E379600917F82 /* main.m */; }; + 30714729230E387700917F82 /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 307C860B22D22C87001B879E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C860A22D22C87001B879E /* libz.tbd */; }; + 307C860C22D23A5B001B879E /* mac-file.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.mm */; }; + 307C861222D27C53001B879E /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */; }; + 307C861422D27C53001B879E /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 307C860E22D27C53001B879E /* tileimpl.h */; }; + 307C861622D27C53001B879E /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */; }; + 307C861822D27C53001B879E /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */; }; + 307C861922D29CAA001B879E /* mac-joypad.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */; }; + 307C861B22D29D6D001B879E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C861A22D29D6D001B879E /* IOKit.framework */; }; + 307C861D22D29DD2001B879E /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C861C22D29DD2001B879E /* GLUT.framework */; }; + 307C861E22D29DF1001B879E /* mac-controls.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.mm */; }; + 307C861F22D29E0D001B879E /* mac-screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */; }; + 307C862122D29E29001B879E /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; + 307C862222D29E29001B879E /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; + 307C862322D29E29001B879E /* mac-cheat.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.mm */; }; + 307C862422D29E29001B879E /* mac-cheatfinder.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */; }; + 307C862622D29E29001B879E /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; + 307C862922D29E29001B879E /* mac-gworld.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.mm */; }; + 307C862A22D29E29001B879E /* mac-keyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */; }; + 307C862B22D29E29001B879E /* mac-multicart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.mm */; }; + 307C862C22D29E29001B879E /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; + 307C862D22D29E29001B879E /* mac-netplay.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.mm */; }; + 307C863022D29E29001B879E /* mac-render.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.mm */; }; + 307C863222D29E29001B879E /* mac-snes9x.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */; }; + 307C863322D29E29001B879E /* mac-stringtools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */; }; + 308092F72320B041006A2860 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 308092F62320B041006A2860 /* CoreGraphics.framework */; }; + 308092F92320B06F006A2860 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 308092F82320B06F006A2860 /* Quartz.framework */; }; + 30823CD92379200700EA2331 /* snes9x_framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; }; + 30823CDA2379200700EA2331 /* snes9x_framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 3082C4232378BCE80081CA7C /* FakeHandles.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C41E2378BCE80081CA7C /* FakeHandles.h */; }; + 3082C4242378BCE80081CA7C /* EndianStuff.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C41F2378BCE80081CA7C /* EndianStuff.h */; }; + 3082C4252378BCE80081CA7C /* FakeHandles.c in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4202378BCE80081CA7C /* FakeHandles.c */; }; + 3082C4262378BCE80081CA7C /* FakeResources.c in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4212378BCE80081CA7C /* FakeResources.c */; }; + 3082C4272378BCE80081CA7C /* FakeResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C4222378BCE80081CA7C /* FakeResources.h */; }; + 3082C42A2379199F0081CA7C /* S9xApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4292379199F0081CA7C /* S9xApplication.m */; }; + 30A6F62423B2771A00630584 /* MetalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A6F62323B2771A00630584 /* MetalKit.framework */; }; + 30A6F62623B29EF500630584 /* shaders.metal in Sources */ = {isa = PBXBuildFile; fileRef = 30A6F62523B29EF500630584 /* shaders.metal */; }; + 30A6F62823B29F8200630584 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A6F62723B29F8200630584 /* Metal.framework */; }; + 30D15CF322CE6B5A005BC352 /* snes9x_framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 30D15CFC22CE6B74005BC352 /* sha256.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90A20DDB18D00C038E9 /* sha256.cpp */; }; + 30D15CFE22CE6B74005BC352 /* bml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90620DDB15B00C038E9 /* bml.cpp */; }; + 30D15D2D22CE6B74005BC352 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; + 30D15D2E22CE6B74005BC352 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; + 30D15D2F22CE6B74005BC352 /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; + 30D15D3022CE6B74005BC352 /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; + 30D15D3122CE6B74005BC352 /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; + 30D15D3222CE6B74005BC352 /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; + 30D15D3322CE6B74005BC352 /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; + 30D15D3422CE6B74005BC352 /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; + 30D15D3522CE6B74005BC352 /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; + 30D15D3622CE6B74005BC352 /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; + 30D15D3722CE6B74005BC352 /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; + 30D15D3822CE6B74005BC352 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; + 30D15D3922CE6B74005BC352 /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; + 30D15D3A22CE6B74005BC352 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; + 30D15D3B22CE6B74005BC352 /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; + 30D15D3C22CE6B74005BC352 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; + 30D15D3D22CE6B74005BC352 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; + 30D15D3E22CE6B74005BC352 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; + 30D15D3F22CE6B74005BC352 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; + 30D15D4022CE6B74005BC352 /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; + 30D15D4122CE6B74005BC352 /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; + 30D15D4222CE6B74005BC352 /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; + 30D15D4322CE6B74005BC352 /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; + 30D15D4422CE6B74005BC352 /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; + 30D15D4522CE6B74005BC352 /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; + 30D15D4622CE6B74005BC352 /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; + 30D15D4722CE6B74005BC352 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; + 30D15D4822CE6B74005BC352 /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; + 30D15D4922CE6B74005BC352 /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; + 30D15D4A22CE6B74005BC352 /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; + 30D15D4B22CE6B74005BC352 /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; + 30D15D4C22CE6B74005BC352 /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; + 30D15D4D22CE6B74005BC352 /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; + 30D15D4E22CE6B74005BC352 /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; + 30D15D4F22CE6B74005BC352 /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; + 30D15D5022CE6B74005BC352 /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; + 30D15D5122CE6B74005BC352 /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; + 30D15D5222CE6B74005BC352 /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; + 30D15D5322CE6B74005BC352 /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; + 30D15D5422CE6B74005BC352 /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; + 30D15D5722CE6B74005BC352 /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; + 30D15D5922CE6B74005BC352 /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; + 30D15D5A22CE6B74005BC352 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; + 30D15D6022CE6B74005BC352 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; + 30D15D6422CE6B74005BC352 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; + 30D15D6622CE6B74005BC352 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; + 30D15D7022CE6B75005BC352 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; + 30D15D7122CE6B75005BC352 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; + 30D15D7222CE6B75005BC352 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; + 30D15D7322CE6B75005BC352 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; + 30D15D7422CE6B75005BC352 /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; + 30D15D8722CE6B75005BC352 /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; }; + 30D15D8822CE6B75005BC352 /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; }; + 30D15D8922CE6B75005BC352 /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; }; + 30D15D8A22CE6B75005BC352 /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; }; + 30D15D8B22CE6B75005BC352 /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; }; + 30D15D8C22CE6B75005BC352 /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; }; + 30D15D8D22CE6B75005BC352 /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; }; + 30D15D8E22CE6B75005BC352 /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; }; + 30D15D8F22CE6B75005BC352 /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; }; + 30D15D9322CE6B75005BC352 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; + 30D15D9422CE6B75005BC352 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; + 30D15D9522CE6BC9005BC352 /* sha256.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90B20DDB18D00C038E9 /* sha256.h */; }; + 30D15D9622CE6BC9005BC352 /* bml.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90720DDB15C00C038E9 /* bml.h */; }; + 30D15D9722CE6BC9005BC352 /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; + 30D15D9822CE6BC9005BC352 /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; + 30D15D9922CE6BC9005BC352 /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; + 30D15D9A22CE6BC9005BC352 /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; + 30D15D9B22CE6BC9005BC352 /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; + 30D15D9C22CE6BC9005BC352 /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; + 30D15D9D22CE6BC9005BC352 /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; + 30D15D9E22CE6BC9005BC352 /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; + 30D15D9F22CE6BC9005BC352 /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; + 30D15DA022CE6BC9005BC352 /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; + 30D15DA122CE6BC9005BC352 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; + 30D15DA222CE6BC9005BC352 /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; + 30D15DA322CE6BC9005BC352 /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; + 30D15DA422CE6BC9005BC352 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; + 30D15DA522CE6BC9005BC352 /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; + 30D15DA622CE6BC9005BC352 /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; + 30D15DA722CE6BC9005BC352 /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; + 30D15DA822CE6BC9005BC352 /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; + 30D15DA922CE6BC9005BC352 /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; + 30D15DAA22CE6BC9005BC352 /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; + 30D15DAB22CE6BC9005BC352 /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; + 30D15DAC22CE6BC9005BC352 /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; + 30D15DAD22CE6BC9005BC352 /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; + 30D15DAE22CE6BC9005BC352 /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; + 30D15DAF22CE6BC9005BC352 /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; + 30D15DB022CE6BC9005BC352 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; + 30D15DB122CE6BC9005BC352 /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; + 30D15DB222CE6BC9005BC352 /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; + 30D15DB322CE6BC9005BC352 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 30D15DB422CE6BC9005BC352 /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; + 30D15DB522CE6BC9005BC352 /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; + 30D15DB622CE6BC9005BC352 /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; + 30D15DB722CE6BC9005BC352 /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; + 30D15DB822CE6BC9005BC352 /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; + 30D15DB922CE6BC9005BC352 /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; + 30D15DBA22CE6BC9005BC352 /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; + 30D15DBB22CE6BC9005BC352 /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; + 30D15DBC22CE6BC9005BC352 /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; + 30D15DBD22CE6BC9005BC352 /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; + 30D15DBE22CE6BC9005BC352 /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; + 30D15DC122CE6BC9005BC352 /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; + 30D15DC322CE6BC9005BC352 /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; + 30D15DC422CE6BC9005BC352 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; + 30D15DC522CE6BC9005BC352 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; + 30D15DC622CE6BC9005BC352 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; + 30D15DC722CE6BC9005BC352 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; + 30D15DC822CE6BC9005BC352 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; + 30D15DC922CE6BC9005BC352 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; + 30D15DCA22CE6BC9005BC352 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; + 30D15DCB22CE6BC9005BC352 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; + 30D15DCC22CE6BC9005BC352 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; + 30D15DCD22CE6BC9005BC352 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; + 30D15DCE22CE6BC9005BC352 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; + 30D15DCF22CE6BC9005BC352 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; + 30D15DD022CE6BC9005BC352 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; + 30D15DD122CE6BC9005BC352 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; + 30D15DD222CE6BC9005BC352 /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; + 30D15DD322CE6BC9005BC352 /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; + 30D15DD422CE6BC9005BC352 /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; + 30D15DD522CE6BC9005BC352 /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; + 30D15DD622CE6BC9005BC352 /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; + 30D15DD722CE6BC9005BC352 /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; + 30D15DD822CE6BC9005BC352 /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; + 30D15DD922CE6BC9005BC352 /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; + 30D15DDA22CE6BC9005BC352 /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; + 30D15DDB22CE6BC9005BC352 /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; + 30D15DDC22CE6BC9005BC352 /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; + 30D15DDD22CE6BC9005BC352 /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; + 30D15DDE22CE6BC9005BC352 /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; + 30D15DDF22CE6BC9005BC352 /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; + 30D15DE022CE6BC9005BC352 /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; + 30D15DE122CE6BC9005BC352 /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; + 30D15DE222CE6BC9005BC352 /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; + 30D15DE322CE6BC9005BC352 /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; + 30D15DE422CE6BC9005BC352 /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; + 30D15DE522CE6BC9005BC352 /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; + 30D15DE622CE6BC9005BC352 /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; + 30D15DE722CE6BC9005BC352 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; + 30D15DE822CE6BC9005BC352 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; + 30D15DE922CE6BC9005BC352 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; + 30D15DEA22CE6FE1005BC352 /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; + 30D709B0236F583600AAB7C3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; + 30D709B1236F585100AAB7C3 /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; + 30D709B2236F731B00AAB7C3 /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; + 30D709B3236F731B00AAB7C3 /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; + 30D709B4236F731B00AAB7C3 /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; + 30D709B5236F731B00AAB7C3 /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; + 30D709B6236F731B00AAB7C3 /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; + 30D709B7236F731B00AAB7C3 /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; + 30D709B8236F731B00AAB7C3 /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; + 30D709C1236F7E3200AAB7C3 /* S9xPreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D709BF236F7E3200AAB7C3 /* S9xPreferencesWindowController.m */; }; + 30D709C2236F7E3200AAB7C3 /* S9xPreferencesWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 30D709C0236F7E3200AAB7C3 /* S9xPreferencesWindowController.xib */; }; + 30D709C5236F90DF00AAB7C3 /* S9xButtonConfigTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 30714726230E379C00917F82 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 20286C28FDCF999611CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 30D15CEE22CE6B5A005BC352; + remoteInfo = "snes9x framework"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 30823CDB2379200700EA2331 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 30823CDA2379200700EA2331 /* snes9x_framework.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; - 85FEF90620DDB15B00C038E9 /* bml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bml.cpp; sourceTree = ""; }; - 85FEF90720DDB15C00C038E9 /* bml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bml.h; sourceTree = ""; }; - 85FEF90A20DDB18D00C038E9 /* sha256.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256.cpp; sourceTree = ""; }; - 85FEF90B20DDB18D00C038E9 /* sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256.h; sourceTree = ""; }; + 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; + 302EEC9E22DAD0B1006D1502 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = System/Library/Frameworks/AGL.framework; sourceTree = SDKROOT; }; + 302EECA022DAD0B9006D1502 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 302EECA222DAD0C5006D1502 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; + 302EECA422DAD1B9006D1502 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + 3042F7E0232E9BD200C03F5E /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; + 3042F7E2232E9BDD00C03F5E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 3045A1EC22D03C430092B97D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 3045A1EE22D03C4B0092B97D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 3059DA93250690DB003EF183 /* compat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compat.cpp; sourceTree = ""; }; + 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = gamecontrollerdb.txt; sourceTree = ""; }; + 30714715230E379500917F82 /* Snes9x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Snes9x.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 30714717230E379500917F82 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 30714718230E379500917F82 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; usesTabs = 0; }; + 3071471A230E379600917F82 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3071471D230E379600917F82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 3071471F230E379600917F82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 30714720230E379600917F82 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 30714722230E379600917F82 /* Snes9x.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Snes9x.entitlements; sourceTree = ""; }; + 307C860A22D22C87001B879E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n1x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C860E22D27C53001B879E /* tileimpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tileimpl.h; sourceTree = ""; usesTabs = 1; }; + 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n2x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-h2x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C861A22D29D6D001B879E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 307C861C22D29DD2001B879E /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = System/Library/Frameworks/GLUT.framework; sourceTree = SDKROOT; }; + 308092F62320B041006A2860 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 308092F82320B06F006A2860 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; + 3082C41E2378BCE80081CA7C /* FakeHandles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeHandles.h; sourceTree = ""; }; + 3082C41F2378BCE80081CA7C /* EndianStuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EndianStuff.h; sourceTree = ""; }; + 3082C4202378BCE80081CA7C /* FakeHandles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FakeHandles.c; sourceTree = ""; }; + 3082C4212378BCE80081CA7C /* FakeResources.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FakeResources.c; sourceTree = ""; }; + 3082C4222378BCE80081CA7C /* FakeResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeResources.h; sourceTree = ""; }; + 3082C4282379199F0081CA7C /* S9xApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xApplication.h; sourceTree = ""; }; + 3082C4292379199F0081CA7C /* S9xApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xApplication.m; sourceTree = ""; }; + 30A6F62323B2771A00630584 /* MetalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalKit.framework; path = System/Library/Frameworks/MetalKit.framework; sourceTree = SDKROOT; }; + 30A6F62523B29EF500630584 /* shaders.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = shaders.metal; sourceTree = ""; }; + 30A6F62723B29F8200630584 /* Metal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Metal.framework; path = System/Library/Frameworks/Metal.framework; sourceTree = SDKROOT; }; + 30AD1D1E22FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 30AD1D1F22FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 30AD1D2022FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = folder; name = en; path = "en.lproj/Snes9x Help"; sourceTree = ""; }; + 30AD1D2122FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Snes9x.xib; sourceTree = ""; }; + 30C49EF6250C0F2B007D04F8 /* Snes9xDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Snes9xDebug.entitlements; sourceTree = ""; }; + 30CCAD422290472E00549AED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Users/buckley/Projects/snes9x/macosx/Info.plist; sourceTree = ""; }; + 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = snes9x_framework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = snes9x_framework.h; sourceTree = ""; }; + 30D15CF222CE6B5A005BC352 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 30D709BE236F7E3200AAB7C3 /* S9xPreferencesWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xPreferencesWindowController.h; sourceTree = ""; }; + 30D709BF236F7E3200AAB7C3 /* S9xPreferencesWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xPreferencesWindowController.m; sourceTree = ""; }; + 30D709C0236F7E3200AAB7C3 /* S9xPreferencesWindowController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = S9xPreferencesWindowController.xib; sourceTree = ""; }; + 30D709C3236F90DF00AAB7C3 /* S9xButtonConfigTextField.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xButtonConfigTextField.h; sourceTree = ""; }; + 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xButtonConfigTextField.m; sourceTree = ""; }; + 85FEF90620DDB15B00C038E9 /* bml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bml.cpp; sourceTree = ""; usesTabs = 1; }; + 85FEF90720DDB15C00C038E9 /* bml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bml.h; sourceTree = ""; usesTabs = 1; }; + 85FEF90A20DDB18D00C038E9 /* sha256.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256.cpp; sourceTree = ""; usesTabs = 1; }; + 85FEF90B20DDB18D00C038E9 /* sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256.h; sourceTree = ""; usesTabs = 1; }; BF0B397A1FA5792F002B04D3 /* apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = apu.cpp; sourceTree = ""; }; BF0B397B1FA5792F002B04D3 /* apu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apu.h; sourceTree = ""; }; BF0B397E1FA5792F002B04D3 /* blargg_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blargg_common.h; sourceTree = ""; }; @@ -738,27 +321,16 @@ BF0B39A81FA5792F002B04D3 /* smp_state.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smp_state.cpp; sourceTree = ""; }; BF0B39AB1FA5792F002B04D3 /* snes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = snes.hpp; sourceTree = ""; }; BF0B39AD1FA5792F002B04D3 /* resampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler.h; sourceTree = ""; }; - BF0B39DE1FA580F9002B04D3 /* msu1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msu1.cpp; sourceTree = ""; }; - BF0B39E21FA58124002B04D3 /* msu1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msu1.h; sourceTree = ""; }; - CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tileimpl.h; sourceTree = ""; }; - CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-h2x1.cpp"; sourceTree = ""; }; - CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n2x1.cpp"; sourceTree = ""; }; - CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n1x1.cpp"; sourceTree = ""; }; - CF047E15109D0E0600FD0754 /* Snes9x (i386).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Snes9x (i386).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - CF047E17109D0E0600FD0754 /* Info_i386.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info_i386.plist; sourceTree = ""; }; - CF0567660CF98E7E00C7877C /* Snes9x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Snes9x.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BF0B39DE1FA580F9002B04D3 /* msu1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msu1.cpp; sourceTree = ""; usesTabs = 1; }; + BF0B39E21FA58124002B04D3 /* msu1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msu1.h; sourceTree = ""; usesTabs = 1; }; CF05677E0CF9971000C7877C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; - CF14733D132DA4E1000D0F91 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Snes9x.xib; sourceTree = ""; }; - CF2CFFD30F10F2C000B8B35E /* spc7110emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110emu.cpp; sourceTree = ""; }; - CF2CFFD40F10F2C000B8B35E /* spc7110dec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110dec.cpp; sourceTree = ""; }; - CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110emu.h; sourceTree = ""; }; - CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110dec.h; sourceTree = ""; }; - CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Snes9x (ppc).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - CF2F47C41095F093007D33FA /* Info_ppc.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info_ppc.plist; sourceTree = ""; }; + CF2CFFD30F10F2C000B8B35E /* spc7110emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110emu.cpp; sourceTree = ""; usesTabs = 1; }; + CF2CFFD40F10F2C000B8B35E /* spc7110dec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110dec.cpp; sourceTree = ""; usesTabs = 1; }; + CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110emu.h; sourceTree = ""; usesTabs = 1; }; + CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110dec.h; sourceTree = ""; usesTabs = 1; }; CF3E42491372D48F0077DE32 /* libz_u.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libz_u.a; sourceTree = ""; }; CF3E45BD137349960077DE32 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = zconf.h; sourceTree = ""; }; CF3E45D013734A920077DE32 /* zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = zlib.h; sourceTree = ""; }; - CF46BEA9133E2559005A17A5 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/musicbox.xib; sourceTree = ""; }; CF46BEAD133E256D005A17A5 /* musicbox_pause.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_pause.png; sourceTree = ""; }; CF4B7C420CF841580080E643 /* icons.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icons.png; sourceTree = ""; }; CF5553B10EA24C36005957E4 /* 2xsai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = 2xsai.cpp; sourceTree = ""; }; @@ -769,51 +341,42 @@ CF5553B60EA24C36005957E4 /* epx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = epx.h; sourceTree = ""; }; CF5553B70EA24C36005957E4 /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = hq2x.cpp; sourceTree = ""; }; CF5553B80EA24C36005957E4 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = hq2x.h; sourceTree = ""; }; - CF5D3E100FAFD34200340007 /* dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsp.h; sourceTree = ""; }; - CF5D3E1B0FAFD35400340007 /* dsp2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp2.cpp; sourceTree = ""; }; - CF5D3E1C0FAFD35400340007 /* dsp4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp4.cpp; sourceTree = ""; }; - CF5D3E1D0FAFD35400340007 /* dsp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp3.cpp; sourceTree = ""; }; - CF5D3E270FAFD35A00340007 /* dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp.cpp; sourceTree = ""; }; + CF5D3E100FAFD34200340007 /* dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsp.h; sourceTree = ""; usesTabs = 1; }; + CF5D3E1B0FAFD35400340007 /* dsp2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp2.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E1C0FAFD35400340007 /* dsp4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp4.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E1D0FAFD35400340007 /* dsp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp3.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E270FAFD35A00340007 /* dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp.cpp; sourceTree = ""; usesTabs = 1; }; CFA518BC0EBCB3ED008379F6 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = ""; }; CFA518D10EBCB4AD008379F6 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = ""; }; CFA518D60EBCB4CA008379F6 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = ""; }; CFA518DA0EBCB4D2008379F6 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = ""; }; CFA518E50EBCB5B1008379F6 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = ""; }; - CFA82C3D0F1B43A60089C17F /* srtcemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srtcemu.h; sourceTree = ""; }; - CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = srtcemu.cpp; sourceTree = ""; }; + CFA82C3D0F1B43A60089C17F /* srtcemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srtcemu.h; sourceTree = ""; usesTabs = 1; }; + CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = srtcemu.cpp; sourceTree = ""; usesTabs = 1; }; CFCE2D45133F591900DF6C4E /* musicbox_effect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_effect.png; sourceTree = ""; }; CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_rewind.png; sourceTree = ""; }; CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snes_ntsc.c; sourceTree = ""; }; CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc_config.h; sourceTree = ""; }; CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc_impl.h; sourceTree = ""; }; CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc.h; sourceTree = ""; }; - EA00D01D0A5A9956000C58E0 /* logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logger.cpp; sourceTree = ""; }; - EA00D01F0A5A998F000C58E0 /* logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logger.h; sourceTree = ""; }; - EA0C952D08364A4A009307B4 /* mac-coreimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-coreimage.h"; sourceTree = ""; }; - EA0C952E08364A4A009307B4 /* mac-coreimage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-coreimage.mm"; sourceTree = ""; }; + EA00D01D0A5A9956000C58E0 /* logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logger.cpp; sourceTree = ""; usesTabs = 1; }; + EA00D01F0A5A998F000C58E0 /* logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logger.h; sourceTree = ""; usesTabs = 1; }; EA0C95D808364AAE009307B4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - EA16051C0639E4C0004412AB /* mac-client.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-client.cpp"; sourceTree = ""; }; - EA16051D0639E4C0004412AB /* mac-server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-server.cpp"; sourceTree = ""; }; EA16053E0639E655004412AB /* mac-netplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-netplay.h"; sourceTree = ""; }; - EA16054C0639E6C7004412AB /* mac-server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-server.h"; sourceTree = ""; }; - EA1605500639E735004412AB /* mac-netplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-netplay.cpp"; sourceTree = ""; }; - EA1605540639E937004412AB /* mac-client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-client.h"; sourceTree = ""; }; - EA22EFA2053EEDE500A80003 /* sdd1emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1emu.h; sourceTree = ""; }; - EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1emu.cpp; sourceTree = ""; }; - EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-multicart.cpp"; sourceTree = ""; }; + EA1605500639E735004412AB /* mac-netplay.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-netplay.mm"; sourceTree = ""; }; + EA22EFA2053EEDE500A80003 /* sdd1emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1emu.h; sourceTree = ""; usesTabs = 1; }; + EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1emu.cpp; sourceTree = ""; usesTabs = 1; }; + EA26BBD50B3676E800A570B5 /* mac-multicart.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-multicart.mm"; sourceTree = ""; }; EA26BBD90B36771500A570B5 /* mac-multicart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-multicart.h"; sourceTree = ""; }; EA2DBC070510ABE700A80003 /* mac-screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-screenshot.h"; sourceTree = ""; }; EA2DBC090510ABE700A80003 /* mac-render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-render.h"; sourceTree = ""; }; EA2DBC0A0510ABE700A80003 /* mac-file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-file.h"; sourceTree = ""; }; - EA2DBC0C0510ABE700A80003 /* mac-file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-file.cpp"; sourceTree = ""; }; - EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-screenshot.cpp"; sourceTree = ""; }; - EA2F380F09B17E070078DCA7 /* bsx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bsx.cpp; sourceTree = ""; }; - EA2F381A09B17E9E0078DCA7 /* bsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bsx.h; sourceTree = ""; }; - EA31FE2D05F7743E00E13748 /* gfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = gfx.cpp; sourceTree = ""; }; + EA2DBC0C0510ABE700A80003 /* mac-file.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-file.mm"; sourceTree = ""; usesTabs = 1; }; + EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-screenshot.mm"; sourceTree = ""; }; + EA2F380F09B17E070078DCA7 /* bsx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bsx.cpp; sourceTree = ""; usesTabs = 1; }; + EA2F381A09B17E9E0078DCA7 /* bsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bsx.h; sourceTree = ""; usesTabs = 1; }; + EA31FE2D05F7743E00E13748 /* gfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = gfx.cpp; sourceTree = ""; usesTabs = 1; }; EA362C3E086119D100FBE476 /* HID_Utilities_External.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = HID_Utilities_External.h; sourceTree = ""; }; - EA3BEA990A28384E00A8FAE5 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; - EA3BEA9F0A28384E00A8FAE5 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - EA3BEAA90A28386500A8FAE5 /* English */ = {isa = PBXFileReference; lastKnownFileType = folder; name = English; path = "English.lproj/Snes9x Help"; sourceTree = ""; }; EA3D2F360A26083B00BDACCC /* SRAM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SRAM.icns; sourceTree = ""; }; EA3D2F370A26083B00BDACCC /* SAVE.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SAVE.icns; sourceTree = ""; }; EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = musicbox_ledon.icns; sourceTree = ""; }; @@ -821,30 +384,28 @@ EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = folder_SRAMs.icns; sourceTree = ""; }; EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = folder_Freezes.icns; sourceTree = ""; }; EA3D2F3C0A26083B00BDACCC /* CART.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = CART.icns; sourceTree = ""; }; - EA3D2F3D0A26083B00BDACCC /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = APPL.icns; sourceTree = ""; }; EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libHIDUtilities_u.a; sourceTree = ""; }; EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_indicator.png; sourceTree = ""; }; EA3D300B0A260A3200BDACCC /* logo_freeze.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo_freeze.png; sourceTree = ""; }; EA3D300C0A260A3200BDACCC /* logo_defrost.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo_defrost.png; sourceTree = ""; }; - EA3D301C0A260A4D00BDACCC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EA6E6C0E08F9734500CB3555 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; - EA809E9308F8D6C40072CDFB /* controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = ""; }; - EA809E9508F8D6E00072CDFB /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; }; - EA809E9708F8D70D0072CDFB /* stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stream.h; sourceTree = ""; }; - EA809E9908F8D7240072CDFB /* controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controls.cpp; sourceTree = ""; }; - EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crosshairs.cpp; sourceTree = ""; }; - EA809E9D08F8D73A0072CDFB /* crosshairs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crosshairs.h; sourceTree = ""; }; - EA809E9F08F8D7530072CDFB /* stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stream.cpp; sourceTree = ""; }; + EA6E6C0E08F9734500CB3555 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; usesTabs = 1; }; + EA809E9308F8D6C40072CDFB /* controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = ""; usesTabs = 1; }; + EA809E9508F8D6E00072CDFB /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; usesTabs = 1; }; + EA809E9708F8D70D0072CDFB /* stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stream.h; sourceTree = ""; usesTabs = 1; }; + EA809E9908F8D7240072CDFB /* controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controls.cpp; sourceTree = ""; usesTabs = 1; }; + EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crosshairs.cpp; sourceTree = ""; usesTabs = 1; }; + EA809E9D08F8D73A0072CDFB /* crosshairs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crosshairs.h; sourceTree = ""; usesTabs = 1; }; + EA809E9F08F8D7530072CDFB /* stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stream.cpp; sourceTree = ""; usesTabs = 1; }; EA809F9D08F8F2190072CDFB /* mac-controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-controls.h"; sourceTree = ""; }; - EA809FA108F8F2420072CDFB /* mac-controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-controls.cpp"; sourceTree = ""; }; - EA813E86066F5076004F99B5 /* movie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = movie.h; sourceTree = ""; }; - EA813E9A066F50A5004F99B5 /* movie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = movie.cpp; sourceTree = ""; }; + EA809FA108F8F2420072CDFB /* mac-controls.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-controls.mm"; sourceTree = ""; }; + EA813E86066F5076004F99B5 /* movie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = movie.h; sourceTree = ""; usesTabs = 1; }; + EA813E9A066F50A5004F99B5 /* movie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = movie.cpp; sourceTree = ""; usesTabs = 1; }; EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cocoatools.h"; sourceTree = ""; }; EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cocoatools.mm"; sourceTree = ""; }; EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = freeze_defrost.aiff; sourceTree = ""; }; EA8FA89603D294C000A80004 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - EA942A50059B0F9000D7D022 /* mac-render.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-render.cpp"; sourceTree = ""; }; + EA942A50059B0F9000D7D022 /* mac-render.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-render.mm"; sourceTree = ""; }; EAA7B5D907609F76001BAB8B /* 7z.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 7z.h; sourceTree = ""; }; EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = 7zlzma.cpp; sourceTree = ""; }; EAA7B5DB07609F76001BAB8B /* aribitcd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = aribitcd.h; sourceTree = ""; }; @@ -872,163 +433,125 @@ EAA7B5F107609F76001BAB8B /* s9x-jma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "s9x-jma.h"; sourceTree = ""; }; EAA7B5F207609F76001BAB8B /* winout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = winout.cpp; sourceTree = ""; }; EAA7B5F307609F76001BAB8B /* winout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = winout.h; sourceTree = ""; }; - EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-quicktime.h"; sourceTree = ""; }; - EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; lineEnding = 0; path = "mac-quicktime.cpp"; sourceTree = ""; }; - EAB7319C0527033000A80003 /* memmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = memmap.cpp; sourceTree = ""; }; + EAB7319C0527033000A80003 /* memmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = memmap.cpp; sourceTree = ""; usesTabs = 1; }; EAC5E47003D2D9C800A80004 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; - EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-appleevent.cpp"; sourceTree = ""; }; EAD978980555059300E8BBFD /* mac-global_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-global_prefix.h"; sourceTree = ""; }; EADE6347052E5C4300A80003 /* mac-audio.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-audio.mm"; sourceTree = ""; }; EADE6349052E5C5300A80003 /* mac-audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-audio.h"; sourceTree = ""; }; EADE634B052E5D3600A80003 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; EADE634C052E5D3600A80003 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; EADE634D052E5D3600A80003 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; - EAE0615A0526CCB900A80003 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 65c816.h; sourceTree = ""; }; - EAE0615F0526CCB900A80003 /* c4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4.cpp; sourceTree = ""; }; - EAE061600526CCB900A80003 /* c4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = c4.h; sourceTree = ""; }; - EAE061610526CCB900A80003 /* c4emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4emu.cpp; sourceTree = ""; }; - EAE061630526CCB900A80003 /* cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats.cpp; sourceTree = ""; }; - EAE061640526CCB900A80003 /* cheats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cheats.h; sourceTree = ""; }; - EAE061650526CCB900A80003 /* cheats2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats2.cpp; sourceTree = ""; }; - EAE061660526CCB900A80003 /* clip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = clip.cpp; sourceTree = ""; }; - EAE061690526CCB900A80003 /* cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpu.cpp; sourceTree = ""; }; - EAE0616A0526CCB900A80003 /* cpuaddr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuaddr.h; sourceTree = ""; }; - EAE0616B0526CCB900A80003 /* cpuexec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuexec.cpp; sourceTree = ""; }; - EAE0616C0526CCB900A80003 /* cpuexec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuexec.h; sourceTree = ""; }; - EAE0616D0526CCB900A80003 /* cpumacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpumacro.h; sourceTree = ""; }; - EAE0616E0526CCB900A80003 /* cpuops.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuops.cpp; sourceTree = ""; }; - EAE0616F0526CCB900A80003 /* cpuops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuops.h; sourceTree = ""; }; - EAE061710526CCB900A80003 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = debug.cpp; sourceTree = ""; }; - EAE061730526CCB900A80003 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = display.h; sourceTree = ""; }; - EAE061740526CCB900A80003 /* dma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dma.cpp; sourceTree = ""; }; - EAE061750526CCB900A80003 /* dma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = dma.h; sourceTree = ""; }; - EAE061760526CCB900A80003 /* dsp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dsp1.cpp; sourceTree = ""; }; - EAE0617A0526CCB900A80003 /* font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = font.h; sourceTree = ""; }; - EAE0617C0526CCB900A80003 /* fxemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxemu.cpp; sourceTree = ""; }; - EAE0617D0526CCB900A80003 /* fxemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxemu.h; sourceTree = ""; }; - EAE0617E0526CCB900A80003 /* fxinst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxinst.cpp; sourceTree = ""; }; - EAE0617F0526CCB900A80003 /* fxinst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxinst.h; sourceTree = ""; }; - EAE061800526CCB900A80003 /* getset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = getset.h; sourceTree = ""; }; - EAE061820526CCB900A80003 /* gfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = gfx.h; sourceTree = ""; }; - EAE061830526CCB900A80003 /* globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = globals.cpp; sourceTree = ""; }; - EAE061A90526CCB900A80003 /* loadzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = loadzip.cpp; sourceTree = ""; }; - EAE061B10526CCB900A80003 /* memmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = memmap.h; sourceTree = ""; }; - EAE061B20526CCB900A80003 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = messages.h; sourceTree = ""; }; - EAE061B30526CCB900A80003 /* missing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = missing.h; sourceTree = ""; }; - EAE061C30526CCB900A80003 /* obc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = obc1.cpp; sourceTree = ""; }; - EAE061C40526CCB900A80003 /* obc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = obc1.h; sourceTree = ""; }; - EAE061C60526CCB900A80003 /* pixform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = pixform.h; sourceTree = ""; }; - EAE061C70526CCB900A80003 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = port.h; sourceTree = ""; }; - EAE061C80526CCB900A80003 /* ppu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ppu.cpp; sourceTree = ""; }; - EAE061C90526CCB900A80003 /* ppu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ppu.h; sourceTree = ""; }; - EAE061CB0526CCB900A80003 /* sa1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1.cpp; sourceTree = ""; }; - EAE061CC0526CCB900A80003 /* sa1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sa1.h; sourceTree = ""; }; - EAE061CD0526CCB900A80003 /* sa1cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1cpu.cpp; sourceTree = ""; }; - EAE061CE0526CCB900A80003 /* sar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sar.h; sourceTree = ""; }; - EAE061D00526CCB900A80003 /* screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = screenshot.h; sourceTree = ""; }; - EAE061D10526CCB900A80003 /* sdd1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1.cpp; sourceTree = ""; }; - EAE061D20526CCB900A80003 /* sdd1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1.h; sourceTree = ""; }; - EAE061D40526CCB900A80003 /* seta.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta.cpp; sourceTree = ""; }; - EAE061D50526CCB900A80003 /* seta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = seta.h; sourceTree = ""; }; - EAE061D60526CCB900A80003 /* seta010.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta010.cpp; sourceTree = ""; }; - EAE061D70526CCB900A80003 /* seta011.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta011.cpp; sourceTree = ""; }; - EAE061D80526CCB900A80003 /* seta018.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta018.cpp; sourceTree = ""; }; - EAE061DB0526CCB900A80003 /* snapshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = snapshot.cpp; sourceTree = ""; }; - EAE061DC0526CCB900A80003 /* snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snapshot.h; sourceTree = ""; }; - EAE061DE0526CCB900A80003 /* snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snes9x.h; sourceTree = ""; }; - EAE061E50526CCB900A80003 /* spc7110.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = spc7110.cpp; sourceTree = ""; }; - EAE061E60526CCB900A80003 /* spc7110.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = spc7110.h; sourceTree = ""; }; - EAE061E90526CCB900A80003 /* srtc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = srtc.cpp; sourceTree = ""; }; - EAE061EA0526CCB900A80003 /* srtc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = srtc.h; sourceTree = ""; }; - EAE061EB0526CCB900A80003 /* tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = tile.cpp; sourceTree = ""; }; - EAE061EC0526CCB900A80003 /* tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = tile.h; sourceTree = ""; }; + EAE0615A0526CCB900A80003 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 65c816.h; sourceTree = ""; usesTabs = 1; }; + EAE0615F0526CCB900A80003 /* c4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061600526CCB900A80003 /* c4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = c4.h; sourceTree = ""; usesTabs = 1; }; + EAE061610526CCB900A80003 /* c4emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4emu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061630526CCB900A80003 /* cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061640526CCB900A80003 /* cheats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cheats.h; sourceTree = ""; usesTabs = 1; }; + EAE061650526CCB900A80003 /* cheats2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats2.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061660526CCB900A80003 /* clip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = clip.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061690526CCB900A80003 /* cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616A0526CCB900A80003 /* cpuaddr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuaddr.h; sourceTree = ""; usesTabs = 1; }; + EAE0616B0526CCB900A80003 /* cpuexec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuexec.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616C0526CCB900A80003 /* cpuexec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuexec.h; sourceTree = ""; usesTabs = 1; }; + EAE0616D0526CCB900A80003 /* cpumacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpumacro.h; sourceTree = ""; usesTabs = 1; }; + EAE0616E0526CCB900A80003 /* cpuops.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuops.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616F0526CCB900A80003 /* cpuops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuops.h; sourceTree = ""; usesTabs = 1; }; + EAE061710526CCB900A80003 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = debug.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061730526CCB900A80003 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = display.h; sourceTree = ""; usesTabs = 1; }; + EAE061740526CCB900A80003 /* dma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dma.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061750526CCB900A80003 /* dma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = dma.h; sourceTree = ""; usesTabs = 1; }; + EAE061760526CCB900A80003 /* dsp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dsp1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617A0526CCB900A80003 /* font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = font.h; sourceTree = ""; usesTabs = 1; }; + EAE0617C0526CCB900A80003 /* fxemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxemu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617D0526CCB900A80003 /* fxemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxemu.h; sourceTree = ""; usesTabs = 1; }; + EAE0617E0526CCB900A80003 /* fxinst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxinst.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617F0526CCB900A80003 /* fxinst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxinst.h; sourceTree = ""; usesTabs = 1; }; + EAE061800526CCB900A80003 /* getset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = getset.h; sourceTree = ""; usesTabs = 1; }; + EAE061820526CCB900A80003 /* gfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = gfx.h; sourceTree = ""; usesTabs = 1; }; + EAE061830526CCB900A80003 /* globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = globals.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061A90526CCB900A80003 /* loadzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = loadzip.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061B10526CCB900A80003 /* memmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = memmap.h; sourceTree = ""; usesTabs = 1; }; + EAE061B20526CCB900A80003 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = messages.h; sourceTree = ""; usesTabs = 1; }; + EAE061B30526CCB900A80003 /* missing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = missing.h; sourceTree = ""; usesTabs = 1; }; + EAE061C30526CCB900A80003 /* obc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = obc1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061C40526CCB900A80003 /* obc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = obc1.h; sourceTree = ""; usesTabs = 1; }; + EAE061C60526CCB900A80003 /* pixform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = pixform.h; sourceTree = ""; usesTabs = 1; }; + EAE061C70526CCB900A80003 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = port.h; sourceTree = ""; usesTabs = 1; }; + EAE061C80526CCB900A80003 /* ppu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ppu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061C90526CCB900A80003 /* ppu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ppu.h; sourceTree = ""; usesTabs = 1; }; + EAE061CB0526CCB900A80003 /* sa1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061CC0526CCB900A80003 /* sa1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sa1.h; sourceTree = ""; usesTabs = 1; }; + EAE061CD0526CCB900A80003 /* sa1cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1cpu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061CE0526CCB900A80003 /* sar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sar.h; sourceTree = ""; usesTabs = 1; }; + EAE061D00526CCB900A80003 /* screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = screenshot.h; sourceTree = ""; usesTabs = 1; }; + EAE061D10526CCB900A80003 /* sdd1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D20526CCB900A80003 /* sdd1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1.h; sourceTree = ""; usesTabs = 1; }; + EAE061D40526CCB900A80003 /* seta.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D50526CCB900A80003 /* seta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = seta.h; sourceTree = ""; usesTabs = 1; }; + EAE061D60526CCB900A80003 /* seta010.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta010.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D70526CCB900A80003 /* seta011.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta011.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D80526CCB900A80003 /* seta018.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta018.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061DB0526CCB900A80003 /* snapshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = snapshot.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061DC0526CCB900A80003 /* snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snapshot.h; sourceTree = ""; usesTabs = 1; }; + EAE061DE0526CCB900A80003 /* snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snes9x.h; sourceTree = ""; usesTabs = 1; }; + EAE061E50526CCB900A80003 /* spc7110.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = spc7110.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061E60526CCB900A80003 /* spc7110.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = spc7110.h; sourceTree = ""; usesTabs = 1; }; + EAE061E90526CCB900A80003 /* srtc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = srtc.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061EA0526CCB900A80003 /* srtc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = srtc.h; sourceTree = ""; usesTabs = 1; }; + EAE061EB0526CCB900A80003 /* tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = tile.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061EC0526CCB900A80003 /* tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = tile.h; sourceTree = ""; usesTabs = 1; }; EAE0E96604D582B700A80003 /* mac-os.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-os.mm"; sourceTree = ""; }; - EAE0E96B04D584B700A80003 /* mac-prefs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-prefs.cpp"; sourceTree = ""; }; - EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-appleevent.h"; sourceTree = ""; }; EAECB67004AC7FCE00A80003 /* mac-cart.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cart.mm"; sourceTree = ""; }; EAECB67104AC7FCE00A80003 /* mac-cart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cart.h"; sourceTree = ""; }; - EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-cheat.cpp"; sourceTree = ""; }; + EAECB67204AC7FCE00A80003 /* mac-cheat.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cheat.mm"; sourceTree = ""; }; EAECB67304AC7FCE00A80003 /* mac-cheat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cheat.h"; sourceTree = ""; }; - EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-cheatfinder.cpp"; sourceTree = ""; }; + EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cheatfinder.mm"; sourceTree = ""; }; EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cheatfinder.h"; sourceTree = ""; }; - EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-dialog.cpp"; sourceTree = ""; }; - EAECB67804AC7FCE00A80003 /* mac-dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-dialog.h"; sourceTree = ""; }; - EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-gworld.cpp"; sourceTree = ""; }; + EAECB67904AC7FCE00A80003 /* mac-gworld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-gworld.mm"; sourceTree = ""; }; EAECB67A04AC7FCE00A80003 /* mac-gworld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-gworld.h"; sourceTree = ""; }; - EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-joypad.cpp"; sourceTree = ""; }; + EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-joypad.mm"; sourceTree = ""; }; EAECB67C04AC7FCE00A80003 /* mac-joypad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-joypad.h"; sourceTree = ""; }; - EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-keyboard.cpp"; sourceTree = ""; }; + EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-keyboard.mm"; sourceTree = ""; }; EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-keyboard.h"; sourceTree = ""; }; EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-musicbox.mm"; sourceTree = ""; }; EAECB68004AC7FCE00A80003 /* mac-musicbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-musicbox.h"; sourceTree = ""; }; - EAECB68204AC7FCE00A80003 /* mac-os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-os.h"; sourceTree = ""; }; + EAECB68204AC7FCE00A80003 /* mac-os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-os.h"; sourceTree = ""; usesTabs = 1; }; EAECB68304AC7FCE00A80003 /* mac-prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-prefix.h"; sourceTree = ""; }; - EAECB68504AC7FCE00A80003 /* mac-prefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-prefs.h"; sourceTree = ""; }; - EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-snes9x.cpp"; sourceTree = ""; }; + EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-snes9x.mm"; sourceTree = ""; usesTabs = 1; }; EAECB68704AC7FCE00A80003 /* mac-snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-snes9x.h"; sourceTree = ""; }; - EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-stringtools.cpp"; sourceTree = ""; }; + EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-stringtools.mm"; sourceTree = ""; }; EAECB68904AC7FCE00A80003 /* mac-stringtools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-stringtools.h"; sourceTree = ""; }; F5C108DD0386806001A80002 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; F5FC76BD03873BBF01A80002 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - CF047E03109D0E0600FD0754 /* Frameworks */ = { + 30714712230E379500917F82 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CF047E04109D0E0600FD0754 /* AGL.framework in Frameworks */, - CF047E05109D0E0600FD0754 /* AppKit.framework in Frameworks */, - CF047E06109D0E0600FD0754 /* AudioToolbox.framework in Frameworks */, - CF047E07109D0E0600FD0754 /* AudioUnit.framework in Frameworks */, - CF047E08109D0E0600FD0754 /* Carbon.framework in Frameworks */, - CF047E09109D0E0600FD0754 /* CoreAudio.framework in Frameworks */, - CF047E0A109D0E0600FD0754 /* Foundation.framework in Frameworks */, - CF047E0B109D0E0600FD0754 /* IOKit.framework in Frameworks */, - CF047E0C109D0E0600FD0754 /* OpenGL.framework in Frameworks */, - CF047E0D109D0E0600FD0754 /* QuartzCore.framework in Frameworks */, - CF047E0E109D0E0600FD0754 /* QuickTime.framework in Frameworks */, - CF047E0F109D0E0600FD0754 /* libHIDUtilities_u.a in Frameworks */, - CF3E424B1372D48F0077DE32 /* libz_u.a in Frameworks */, + 30823CD92379200700EA2331 /* snes9x_framework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0567540CF98E7E00C7877C /* Frameworks */ = { + 30D15CEC22CE6B5A005BC352 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CF05675D0CF98E7E00C7877C /* AGL.framework in Frameworks */, - CF0567570CF98E7E00C7877C /* AppKit.framework in Frameworks */, - CF05675A0CF98E7E00C7877C /* AudioToolbox.framework in Frameworks */, - CF0567590CF98E7E00C7877C /* AudioUnit.framework in Frameworks */, - CF0567550CF98E7E00C7877C /* Carbon.framework in Frameworks */, - CF0567580CF98E7E00C7877C /* CoreAudio.framework in Frameworks */, - CF0567560CF98E7E00C7877C /* Foundation.framework in Frameworks */, - CF05675E0CF98E7E00C7877C /* IOKit.framework in Frameworks */, - CF05675C0CF98E7E00C7877C /* OpenGL.framework in Frameworks */, - CF0567810CF9971000C7877C /* QuartzCore.framework in Frameworks */, - CF05675B0CF98E7E00C7877C /* QuickTime.framework in Frameworks */, - CF0567600CF98E7E00C7877C /* libHIDUtilities_u.a in Frameworks */, - CF3E424A1372D48F0077DE32 /* libz_u.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46DD1095EE72007D33FA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46DE1095EE72007D33FA /* AGL.framework in Frameworks */, - CF2F46DF1095EE72007D33FA /* AppKit.framework in Frameworks */, - CF2F46E01095EE72007D33FA /* AudioToolbox.framework in Frameworks */, - CF2F46E11095EE72007D33FA /* AudioUnit.framework in Frameworks */, - CF2F46E21095EE72007D33FA /* Carbon.framework in Frameworks */, - CF2F46E31095EE72007D33FA /* CoreAudio.framework in Frameworks */, - CF2F46E41095EE72007D33FA /* Foundation.framework in Frameworks */, - CF2F46E51095EE72007D33FA /* IOKit.framework in Frameworks */, - CF2F46E61095EE72007D33FA /* OpenGL.framework in Frameworks */, - CF2F46E81095EE72007D33FA /* QuickTime.framework in Frameworks */, - CF2F46E91095EE72007D33FA /* libHIDUtilities_u.a in Frameworks */, - CF3E424C1372D48F0077DE32 /* libz_u.a in Frameworks */, + 30A6F62823B29F8200630584 /* Metal.framework in Frameworks */, + 30A6F62423B2771A00630584 /* MetalKit.framework in Frameworks */, + 3042F7E3232E9BDD00C03F5E /* Carbon.framework in Frameworks */, + 308092F92320B06F006A2860 /* Quartz.framework in Frameworks */, + 308092F72320B041006A2860 /* CoreGraphics.framework in Frameworks */, + 302EECA522DAD1B9006D1502 /* CoreAudio.framework in Frameworks */, + 302EECA322DAD0C5006D1502 /* CoreImage.framework in Frameworks */, + 302EEC9F22DAD0B1006D1502 /* AGL.framework in Frameworks */, + 302EEC9C22DAD0AB006D1502 /* AudioToolbox.framework in Frameworks */, + 302EEC9D22DAD0AB006D1502 /* AudioUnit.framework in Frameworks */, + 307C861D22D29DD2001B879E /* GLUT.framework in Frameworks */, + 307C861B22D29D6D001B879E /* IOKit.framework in Frameworks */, + 307C860B22D22C87001B879E /* libz.tbd in Frameworks */, + 3045A1EF22D03C4B0092B97D /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1038,9 +561,8 @@ 195DF8C9FE9D4F0611CA2CBB /* Products */ = { isa = PBXGroup; children = ( - CF0567660CF98E7E00C7877C /* Snes9x.app */, - CF047E15109D0E0600FD0754 /* Snes9x (i386).app */, - CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */, + 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */, + 30714715230E379500917F82 /* Snes9x.app */, ); name = Products; sourceTree = ""; @@ -1050,10 +572,15 @@ children = ( 20286C2AFDCF999611CA2CEA /* Sources */, 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */, + 30D15CF022CE6B5A005BC352 /* snes9x framework */, + 30714716230E379500917F82 /* Snes9x */, + 3082C41D2378BC280081CA7C /* ReClassicfication */, 195DF8C9FE9D4F0611CA2CBB /* Products */, + 3045A1EB22D03C420092B97D /* Frameworks */, ); name = "Snes9x CVS"; sourceTree = ""; + usesTabs = 1; }; 20286C2AFDCF999611CA2CEA /* Sources */ = { isa = PBXGroup; @@ -1081,6 +608,82 @@ name = "External Frameworks and Libraries"; sourceTree = ""; }; + 3045A1EB22D03C420092B97D /* Frameworks */ = { + isa = PBXGroup; + children = ( + 30A6F62723B29F8200630584 /* Metal.framework */, + 30A6F62323B2771A00630584 /* MetalKit.framework */, + 3042F7E2232E9BDD00C03F5E /* Carbon.framework */, + 3042F7E0232E9BD200C03F5E /* CoreServices.framework */, + 308092F82320B06F006A2860 /* Quartz.framework */, + 308092F62320B041006A2860 /* CoreGraphics.framework */, + 302EECA422DAD1B9006D1502 /* CoreAudio.framework */, + 302EECA222DAD0C5006D1502 /* CoreImage.framework */, + 302EECA022DAD0B9006D1502 /* OpenGL.framework */, + 302EEC9E22DAD0B1006D1502 /* AGL.framework */, + 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */, + 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */, + 307C861C22D29DD2001B879E /* GLUT.framework */, + 307C861A22D29D6D001B879E /* IOKit.framework */, + 307C860A22D22C87001B879E /* libz.tbd */, + 3045A1EE22D03C4B0092B97D /* Cocoa.framework */, + 3045A1EC22D03C430092B97D /* AppKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 30714716230E379500917F82 /* Snes9x */ = { + isa = PBXGroup; + children = ( + 600546BE250F8F1700EC0977 /* S9xPreferences */, + 30C49EF6250C0F2B007D04F8 /* Snes9xDebug.entitlements */, + 30714717230E379500917F82 /* AppDelegate.h */, + 30714718230E379500917F82 /* AppDelegate.m */, + 3071471A230E379600917F82 /* Assets.xcassets */, + 3071471C230E379600917F82 /* MainMenu.xib */, + 3071471F230E379600917F82 /* Info.plist */, + 30714720230E379600917F82 /* main.m */, + 30714722230E379600917F82 /* Snes9x.entitlements */, + 3082C4282379199F0081CA7C /* S9xApplication.h */, + 3082C4292379199F0081CA7C /* S9xApplication.m */, + ); + path = Snes9x; + sourceTree = ""; + }; + 3082C41D2378BC280081CA7C /* ReClassicfication */ = { + isa = PBXGroup; + children = ( + 3082C41F2378BCE80081CA7C /* EndianStuff.h */, + 3082C4202378BCE80081CA7C /* FakeHandles.c */, + 3082C41E2378BCE80081CA7C /* FakeHandles.h */, + 3082C4212378BCE80081CA7C /* FakeResources.c */, + 3082C4222378BCE80081CA7C /* FakeResources.h */, + ); + path = ReClassicfication; + sourceTree = ""; + }; + 30D15CF022CE6B5A005BC352 /* snes9x framework */ = { + isa = PBXGroup; + children = ( + 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */, + 30D15CF222CE6B5A005BC352 /* Info.plist */, + 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */, + ); + path = "snes9x framework"; + sourceTree = ""; + }; + 600546BE250F8F1700EC0977 /* S9xPreferences */ = { + isa = PBXGroup; + children = ( + 30D709C3236F90DF00AAB7C3 /* S9xButtonConfigTextField.h */, + 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */, + 30D709BE236F7E3200AAB7C3 /* S9xPreferencesWindowController.h */, + 30D709BF236F7E3200AAB7C3 /* S9xPreferencesWindowController.m */, + 30D709C0236F7E3200AAB7C3 /* S9xPreferencesWindowController.xib */, + ); + path = S9xPreferences; + sourceTree = ""; + }; BF0B39791FA5792F002B04D3 /* apu */ = { isa = PBXGroup; children = ( @@ -1191,109 +794,110 @@ EAE061540526CCB900A80003 /* snes9x */ = { isa = PBXGroup; children = ( - 85FEF90A20DDB18D00C038E9 /* sha256.cpp */, - 85FEF90B20DDB18D00C038E9 /* sha256.h */, + EAE0615A0526CCB900A80003 /* 65c816.h */, + BF0B39791FA5792F002B04D3 /* apu */, 85FEF90620DDB15B00C038E9 /* bml.cpp */, 85FEF90720DDB15C00C038E9 /* bml.h */, - EAE0615A0526CCB900A80003 /* 65c816.h */, - EA2F381A09B17E9E0078DCA7 /* bsx.h */, - EAE061600526CCB900A80003 /* c4.h */, - EAE061640526CCB900A80003 /* cheats.h */, - EA809E9308F8D6C40072CDFB /* controls.h */, - EAE0616A0526CCB900A80003 /* cpuaddr.h */, - EAE0616C0526CCB900A80003 /* cpuexec.h */, - EAE0616D0526CCB900A80003 /* cpumacro.h */, - EAE0616F0526CCB900A80003 /* cpuops.h */, - EA809E9D08F8D73A0072CDFB /* crosshairs.h */, - EA6E6C0E08F9734500CB3555 /* debug.h */, - EAE061730526CCB900A80003 /* display.h */, - EAE061750526CCB900A80003 /* dma.h */, - CF5D3E100FAFD34200340007 /* dsp.h */, - EAE0617A0526CCB900A80003 /* font.h */, - EAE0617D0526CCB900A80003 /* fxemu.h */, - EAE0617F0526CCB900A80003 /* fxinst.h */, - EAE061800526CCB900A80003 /* getset.h */, - EAE061820526CCB900A80003 /* gfx.h */, - EA809E9508F8D6E00072CDFB /* language.h */, - EA00D01F0A5A998F000C58E0 /* logger.h */, - EAE061B10526CCB900A80003 /* memmap.h */, - EAE061B20526CCB900A80003 /* messages.h */, - EAE061B30526CCB900A80003 /* missing.h */, - EA813E86066F5076004F99B5 /* movie.h */, - BF0B39E21FA58124002B04D3 /* msu1.h */, - EAE061C40526CCB900A80003 /* obc1.h */, - EAE061C60526CCB900A80003 /* pixform.h */, - EAE061C70526CCB900A80003 /* port.h */, - EAE061C90526CCB900A80003 /* ppu.h */, - EA809E9708F8D70D0072CDFB /* stream.h */, - EAE061CC0526CCB900A80003 /* sa1.h */, - EAE061CE0526CCB900A80003 /* sar.h */, - EAE061D00526CCB900A80003 /* screenshot.h */, - EAE061D20526CCB900A80003 /* sdd1.h */, - EA22EFA2053EEDE500A80003 /* sdd1emu.h */, - EAE061D50526CCB900A80003 /* seta.h */, - EAE061DC0526CCB900A80003 /* snapshot.h */, - EAE061DE0526CCB900A80003 /* snes9x.h */, - EAE061E60526CCB900A80003 /* spc7110.h */, - CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */, - CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */, - EAE061EA0526CCB900A80003 /* srtc.h */, - CFA82C3D0F1B43A60089C17F /* srtcemu.h */, - EAE061EC0526CCB900A80003 /* tile.h */, - CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */, EA2F380F09B17E070078DCA7 /* bsx.cpp */, + EA2F381A09B17E9E0078DCA7 /* bsx.h */, EAE0615F0526CCB900A80003 /* c4.cpp */, + EAE061600526CCB900A80003 /* c4.h */, EAE061610526CCB900A80003 /* c4emu.cpp */, EAE061630526CCB900A80003 /* cheats.cpp */, + EAE061640526CCB900A80003 /* cheats.h */, EAE061650526CCB900A80003 /* cheats2.cpp */, EAE061660526CCB900A80003 /* clip.cpp */, + 3059DA93250690DB003EF183 /* compat.cpp */, EA809E9908F8D7240072CDFB /* controls.cpp */, + EA809E9308F8D6C40072CDFB /* controls.h */, EAE061690526CCB900A80003 /* cpu.cpp */, + EAE0616A0526CCB900A80003 /* cpuaddr.h */, EAE0616B0526CCB900A80003 /* cpuexec.cpp */, + EAE0616C0526CCB900A80003 /* cpuexec.h */, + EAE0616D0526CCB900A80003 /* cpumacro.h */, EAE0616E0526CCB900A80003 /* cpuops.cpp */, + EAE0616F0526CCB900A80003 /* cpuops.h */, EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */, + EA809E9D08F8D73A0072CDFB /* crosshairs.h */, EAE061710526CCB900A80003 /* debug.cpp */, + EA6E6C0E08F9734500CB3555 /* debug.h */, + EAE061730526CCB900A80003 /* display.h */, EAE061740526CCB900A80003 /* dma.cpp */, + EAE061750526CCB900A80003 /* dma.h */, CF5D3E270FAFD35A00340007 /* dsp.cpp */, + CF5D3E100FAFD34200340007 /* dsp.h */, EAE061760526CCB900A80003 /* dsp1.cpp */, CF5D3E1B0FAFD35400340007 /* dsp2.cpp */, CF5D3E1D0FAFD35400340007 /* dsp3.cpp */, CF5D3E1C0FAFD35400340007 /* dsp4.cpp */, + CF5553B00EA24C36005957E4 /* filter */, + EAE0617A0526CCB900A80003 /* font.h */, EAE0617C0526CCB900A80003 /* fxemu.cpp */, + EAE0617D0526CCB900A80003 /* fxemu.h */, EAE0617E0526CCB900A80003 /* fxinst.cpp */, + EAE0617F0526CCB900A80003 /* fxinst.h */, + EAE061800526CCB900A80003 /* getset.h */, EA31FE2D05F7743E00E13748 /* gfx.cpp */, + EAE061820526CCB900A80003 /* gfx.h */, EAE061830526CCB900A80003 /* globals.cpp */, + EAA7B5D807609F76001BAB8B /* jma */, + EA809E9508F8D6E00072CDFB /* language.h */, EAE061A90526CCB900A80003 /* loadzip.cpp */, EA00D01D0A5A9956000C58E0 /* logger.cpp */, + EA00D01F0A5A998F000C58E0 /* logger.h */, + EAECB65C04AC7FCD00A80003 /* macosx */, EAB7319C0527033000A80003 /* memmap.cpp */, + EAE061B10526CCB900A80003 /* memmap.h */, + EAE061B20526CCB900A80003 /* messages.h */, + EAE061B30526CCB900A80003 /* missing.h */, EA813E9A066F50A5004F99B5 /* movie.cpp */, + EA813E86066F5076004F99B5 /* movie.h */, BF0B39DE1FA580F9002B04D3 /* msu1.cpp */, + BF0B39E21FA58124002B04D3 /* msu1.h */, EAE061C30526CCB900A80003 /* obc1.cpp */, + EAE061C40526CCB900A80003 /* obc1.h */, + EAE061C60526CCB900A80003 /* pixform.h */, + EAE061C70526CCB900A80003 /* port.h */, EAE061C80526CCB900A80003 /* ppu.cpp */, - EA809E9F08F8D7530072CDFB /* stream.cpp */, + EAE061C90526CCB900A80003 /* ppu.h */, EAE061CB0526CCB900A80003 /* sa1.cpp */, + EAE061CC0526CCB900A80003 /* sa1.h */, EAE061CD0526CCB900A80003 /* sa1cpu.cpp */, + EAE061CE0526CCB900A80003 /* sar.h */, + EAE061D00526CCB900A80003 /* screenshot.h */, EAE061D10526CCB900A80003 /* sdd1.cpp */, + EAE061D20526CCB900A80003 /* sdd1.h */, EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */, + EA22EFA2053EEDE500A80003 /* sdd1emu.h */, EAE061D40526CCB900A80003 /* seta.cpp */, + EAE061D50526CCB900A80003 /* seta.h */, EAE061D60526CCB900A80003 /* seta010.cpp */, EAE061D70526CCB900A80003 /* seta011.cpp */, EAE061D80526CCB900A80003 /* seta018.cpp */, + 85FEF90A20DDB18D00C038E9 /* sha256.cpp */, + 85FEF90B20DDB18D00C038E9 /* sha256.h */, EAE061DB0526CCB900A80003 /* snapshot.cpp */, + EAE061DC0526CCB900A80003 /* snapshot.h */, + EAE061DE0526CCB900A80003 /* snes9x.h */, EAE061E50526CCB900A80003 /* spc7110.cpp */, + EAE061E60526CCB900A80003 /* spc7110.h */, CF2CFFD40F10F2C000B8B35E /* spc7110dec.cpp */, + CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */, CF2CFFD30F10F2C000B8B35E /* spc7110emu.cpp */, + CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */, EAE061E90526CCB900A80003 /* srtc.cpp */, + EAE061EA0526CCB900A80003 /* srtc.h */, CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */, + CFA82C3D0F1B43A60089C17F /* srtcemu.h */, + EA809E9F08F8D7530072CDFB /* stream.cpp */, + EA809E9708F8D70D0072CDFB /* stream.h */, EAE061EB0526CCB900A80003 /* tile.cpp */, - CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */, - CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */, - CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */, - BF0B39791FA5792F002B04D3 /* apu */, - CF5553B00EA24C36005957E4 /* filter */, - EAA7B5D807609F76001BAB8B /* jma */, + EAE061EC0526CCB900A80003 /* tile.h */, + 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */, + 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */, + 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */, + 307C860E22D27C53001B879E /* tileimpl.h */, EAE061FD0526CCB900A80003 /* unzip */, - EAECB65C04AC7FCD00A80003 /* macosx */, ); name = snes9x; path = ..; @@ -1314,16 +918,12 @@ EAECB65C04AC7FCD00A80003 /* macosx */ = { isa = PBXGroup; children = ( - EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */, EADE6349052E5C5300A80003 /* mac-audio.h */, EAECB67104AC7FCE00A80003 /* mac-cart.h */, EAECB67304AC7FCE00A80003 /* mac-cheat.h */, EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */, - EA1605540639E937004412AB /* mac-client.h */, EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */, EA809F9D08F8F2190072CDFB /* mac-controls.h */, - EA0C952D08364A4A009307B4 /* mac-coreimage.h */, - EAECB67804AC7FCE00A80003 /* mac-dialog.h */, EA2DBC0A0510ABE700A80003 /* mac-file.h */, EAECB67A04AC7FCE00A80003 /* mac-gworld.h */, EAECB67C04AC7FCE00A80003 /* mac-joypad.h */, @@ -1332,11 +932,8 @@ EAECB68004AC7FCE00A80003 /* mac-musicbox.h */, EA16053E0639E655004412AB /* mac-netplay.h */, EAECB68204AC7FCE00A80003 /* mac-os.h */, - EAECB68504AC7FCE00A80003 /* mac-prefs.h */, - EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */, EA2DBC090510ABE700A80003 /* mac-render.h */, EA2DBC070510ABE700A80003 /* mac-screenshot.h */, - EA16054C0639E6C7004412AB /* mac-server.h */, EAECB68704AC7FCE00A80003 /* mac-snes9x.h */, EAECB68904AC7FCE00A80003 /* mac-stringtools.h */, EAECB68304AC7FCE00A80003 /* mac-prefix.h */, @@ -1344,32 +941,24 @@ EA362C3E086119D100FBE476 /* HID_Utilities_External.h */, CF3E45BD137349960077DE32 /* zconf.h */, CF3E45D013734A920077DE32 /* zlib.h */, - EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */, EADE6347052E5C4300A80003 /* mac-audio.mm */, EAECB67004AC7FCE00A80003 /* mac-cart.mm */, - EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */, - EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */, - EA16051C0639E4C0004412AB /* mac-client.cpp */, + EAECB67204AC7FCE00A80003 /* mac-cheat.mm */, + EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */, EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */, - EA809FA108F8F2420072CDFB /* mac-controls.cpp */, - EA0C952E08364A4A009307B4 /* mac-coreimage.mm */, - EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */, - EA2DBC0C0510ABE700A80003 /* mac-file.cpp */, - EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */, - EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */, - EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */, - EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */, + EA809FA108F8F2420072CDFB /* mac-controls.mm */, + EA2DBC0C0510ABE700A80003 /* mac-file.mm */, + EAECB67904AC7FCE00A80003 /* mac-gworld.mm */, + EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */, + EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */, + EA26BBD50B3676E800A570B5 /* mac-multicart.mm */, EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */, - EA1605500639E735004412AB /* mac-netplay.cpp */, + EA1605500639E735004412AB /* mac-netplay.mm */, EAE0E96604D582B700A80003 /* mac-os.mm */, - EAE0E96B04D584B700A80003 /* mac-prefs.cpp */, - EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */, - EA942A50059B0F9000D7D022 /* mac-render.cpp */, - EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */, - EA16051D0639E4C0004412AB /* mac-server.cpp */, - EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */, - EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */, - EA3D2F3D0A26083B00BDACCC /* APPL.icns */, + EA942A50059B0F9000D7D022 /* mac-render.mm */, + EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */, + EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */, + EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */, EA3D2F3C0A26083B00BDACCC /* CART.icns */, EA3D2F360A26083B00BDACCC /* SRAM.icns */, EA3D2F370A26083B00BDACCC /* SAVE.icns */, @@ -1388,13 +977,11 @@ EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */, EA3BEA980A28384E00A8FAE5 /* Localizable.strings */, CF14733C132DA4E1000D0F91 /* Snes9x.xib */, - CF46BEA8133E2559005A17A5 /* musicbox.xib */, EA3BEAA80A28386500A8FAE5 /* Snes9x Help */, EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */, CF3E42491372D48F0077DE32 /* libz_u.a */, - EA3D301C0A260A4D00BDACCC /* Info.plist */, - CF047E17109D0E0600FD0754 /* Info_i386.plist */, - CF2F47C41095F093007D33FA /* Info_ppc.plist */, + 30CCAD422290472E00549AED /* Info.plist */, + 30A6F62523B29EF500630584 /* shaders.metal */, ); path = macosx; sourceTree = ""; @@ -1402,421 +989,140 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - CF047D37109D0E0600FD0754 /* Headers */ = { + 30D15CEA22CE6B5A005BC352 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - CF047D38109D0E0600FD0754 /* 65c816.h in Headers */, - CF047D3B109D0E0600FD0754 /* bsx.h in Headers */, - BF0B39F01FA58154002B04D3 /* blargg_source.h in Headers */, - CF047D3C109D0E0600FD0754 /* c4.h in Headers */, - BF0B39F41FA5815C002B04D3 /* sdsp.hpp in Headers */, - CF047D3D109D0E0600FD0754 /* cheats.h in Headers */, - CF047D3E109D0E0600FD0754 /* controls.h in Headers */, - CF047D3F109D0E0600FD0754 /* cpuaddr.h in Headers */, - CF047D40109D0E0600FD0754 /* cpuexec.h in Headers */, - CF047D41109D0E0600FD0754 /* cpumacro.h in Headers */, - BF0B39F81FA58162002B04D3 /* SPC_DSP.h in Headers */, - CF047D42109D0E0600FD0754 /* cpuops.h in Headers */, - CF047D43109D0E0600FD0754 /* crosshairs.h in Headers */, - CF047D44109D0E0600FD0754 /* debug.h in Headers */, - CF047D45109D0E0600FD0754 /* display.h in Headers */, - BF0B3A001FA5816D002B04D3 /* snes.hpp in Headers */, - CF047D46109D0E0600FD0754 /* dma.h in Headers */, - CF047D47109D0E0600FD0754 /* dsp.h in Headers */, - CF047D48109D0E0600FD0754 /* font.h in Headers */, - CF047D49109D0E0600FD0754 /* fxemu.h in Headers */, - CF047D4A109D0E0600FD0754 /* fxinst.h in Headers */, - CF047D4B109D0E0600FD0754 /* getset.h in Headers */, - BF0B39EE1FA58150002B04D3 /* blargg_endian.h in Headers */, - CF047D4C109D0E0600FD0754 /* gfx.h in Headers */, - CF047D4D109D0E0600FD0754 /* language.h in Headers */, - CF047D4E109D0E0600FD0754 /* logger.h in Headers */, - CF047D4F109D0E0600FD0754 /* memmap.h in Headers */, - CF047D50109D0E0600FD0754 /* messages.h in Headers */, - CF047D51109D0E0600FD0754 /* missing.h in Headers */, - CF047D52109D0E0600FD0754 /* movie.h in Headers */, - CF047D53109D0E0600FD0754 /* obc1.h in Headers */, - CE6E9066227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF047D54109D0E0600FD0754 /* pixform.h in Headers */, - CF047D55109D0E0600FD0754 /* port.h in Headers */, - CF047D56109D0E0600FD0754 /* ppu.h in Headers */, - CF047D57109D0E0600FD0754 /* stream.h in Headers */, - CF047D58109D0E0600FD0754 /* sa1.h in Headers */, - CF047D59109D0E0600FD0754 /* sar.h in Headers */, - CF047D5A109D0E0600FD0754 /* screenshot.h in Headers */, - CF047D5B109D0E0600FD0754 /* sdd1.h in Headers */, - CF047D5C109D0E0600FD0754 /* sdd1emu.h in Headers */, - CF047D5D109D0E0600FD0754 /* seta.h in Headers */, - CF047D5E109D0E0600FD0754 /* snapshot.h in Headers */, - CF047D5F109D0E0600FD0754 /* snes9x.h in Headers */, - CF047D62109D0E0600FD0754 /* spc7110.h in Headers */, - CF047D63109D0E0600FD0754 /* srtc.h in Headers */, - CF047D64109D0E0600FD0754 /* tile.h in Headers */, - CF047D65109D0E0600FD0754 /* 2xsai.h in Headers */, - CF047D66109D0E0600FD0754 /* blit.h in Headers */, - CF047D67109D0E0600FD0754 /* epx.h in Headers */, - CF047D68109D0E0600FD0754 /* hq2x.h in Headers */, - CFEFAE9610EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9410EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9510EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - CF047D69109D0E0600FD0754 /* crypt.h in Headers */, - CF047D6A109D0E0600FD0754 /* ioapi.h in Headers */, - CF047D6B109D0E0600FD0754 /* unzip.h in Headers */, - CF047D6C109D0E0600FD0754 /* 7z.h in Headers */, - CF047D6D109D0E0600FD0754 /* aribitcd.h in Headers */, - CF047D6E109D0E0600FD0754 /* ariconst.h in Headers */, - CF047D6F109D0E0600FD0754 /* ariprice.h in Headers */, - CF047D70109D0E0600FD0754 /* btreecd.h in Headers */, - CF047D71109D0E0600FD0754 /* crc32.h in Headers */, - BF0B39EC1FA5814D002B04D3 /* blargg_config.h in Headers */, - CF047D72109D0E0600FD0754 /* iiostrm.h in Headers */, - BF0B39EA1FA5814B002B04D3 /* blargg_common.h in Headers */, - CF047D73109D0E0600FD0754 /* inbyte.h in Headers */, - CF047D74109D0E0600FD0754 /* jma.h in Headers */, - CF047D75109D0E0600FD0754 /* lencoder.h in Headers */, - CF047D76109D0E0600FD0754 /* litcoder.h in Headers */, - BF0B3A041FA58172002B04D3 /* resampler.h in Headers */, - CF047D77109D0E0600FD0754 /* lzma.h in Headers */, - BF0B39FC1FA58167002B04D3 /* smp.hpp in Headers */, - CF047D78109D0E0600FD0754 /* lzmadec.h in Headers */, - CF047D79109D0E0600FD0754 /* portable.h in Headers */, - CF047D7A109D0E0600FD0754 /* rcdefs.h in Headers */, - CF047D7B109D0E0600FD0754 /* rngcoder.h in Headers */, - CF047D7C109D0E0600FD0754 /* s9x-jma.h in Headers */, - CF047D7D109D0E0600FD0754 /* winout.h in Headers */, - CF047D7E109D0E0600FD0754 /* mac-appleevent.h in Headers */, - CF047D7F109D0E0600FD0754 /* mac-audio.h in Headers */, - CF047D80109D0E0600FD0754 /* mac-cart.h in Headers */, - CF047D81109D0E0600FD0754 /* mac-cheat.h in Headers */, - CF047D82109D0E0600FD0754 /* mac-cheatfinder.h in Headers */, - CF047D83109D0E0600FD0754 /* mac-client.h in Headers */, - CF047D84109D0E0600FD0754 /* mac-cocoatools.h in Headers */, - CF047D85109D0E0600FD0754 /* mac-controls.h in Headers */, - CF047D86109D0E0600FD0754 /* mac-coreimage.h in Headers */, - CF047D87109D0E0600FD0754 /* mac-dialog.h in Headers */, - CF047D88109D0E0600FD0754 /* mac-file.h in Headers */, - CF047D89109D0E0600FD0754 /* mac-gworld.h in Headers */, - CF047D8A109D0E0600FD0754 /* mac-joypad.h in Headers */, - CF047D8B109D0E0600FD0754 /* mac-keyboard.h in Headers */, - BF0B39E81FA58131002B04D3 /* apu.h in Headers */, - CF047D8C109D0E0600FD0754 /* mac-multicart.h in Headers */, - CF047D8D109D0E0600FD0754 /* mac-musicbox.h in Headers */, - CF047D8E109D0E0600FD0754 /* mac-netplay.h in Headers */, - CF047D8F109D0E0600FD0754 /* mac-os.h in Headers */, - CF047D90109D0E0600FD0754 /* mac-prefs.h in Headers */, - CF047D91109D0E0600FD0754 /* mac-quicktime.h in Headers */, - CF047D92109D0E0600FD0754 /* mac-render.h in Headers */, - BF0B39E41FA58124002B04D3 /* msu1.h in Headers */, - CF047D93109D0E0600FD0754 /* mac-screenshot.h in Headers */, - CF047D94109D0E0600FD0754 /* mac-server.h in Headers */, - CF047D95109D0E0600FD0754 /* mac-snes9x.h in Headers */, - CF047D96109D0E0600FD0754 /* mac-stringtools.h in Headers */, - CF047D97109D0E0600FD0754 /* mac-prefix.h in Headers */, - CF047D98109D0E0600FD0754 /* mac-global_prefix.h in Headers */, - CF047D99109D0E0600FD0754 /* HID_Utilities_External.h in Headers */, - CF3E45C1137349960077DE32 /* zconf.h in Headers */, - CF3E45D213734A920077DE32 /* zlib.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF05668D0CF98E7E00C7877C /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - CF05668E0CF98E7E00C7877C /* 65c816.h in Headers */, - BF0B39B01FA5792F002B04D3 /* apu.h in Headers */, - CF0566910CF98E7E00C7877C /* bsx.h in Headers */, - CF0566920CF98E7E00C7877C /* c4.h in Headers */, - CF0566930CF98E7E00C7877C /* cheats.h in Headers */, - CF0566940CF98E7E00C7877C /* controls.h in Headers */, - CF0566950CF98E7E00C7877C /* cpuaddr.h in Headers */, - CF0566960CF98E7E00C7877C /* cpuexec.h in Headers */, - CF0566970CF98E7E00C7877C /* cpumacro.h in Headers */, - CF0566980CF98E7E00C7877C /* cpuops.h in Headers */, - CF0566990CF98E7E00C7877C /* crosshairs.h in Headers */, - CFE7FBB80D2F683C002F3102 /* debug.h in Headers */, - CF05669A0CF98E7E00C7877C /* display.h in Headers */, - CF05669B0CF98E7E00C7877C /* dma.h in Headers */, - CF5D3E130FAFD34200340007 /* dsp.h in Headers */, - BF0B39DA1FA5792F002B04D3 /* snes.hpp in Headers */, - CF05669D0CF98E7E00C7877C /* font.h in Headers */, - 85FEF90D20DDB18E00C038E9 /* sha256.h in Headers */, - CF05669E0CF98E7E00C7877C /* fxemu.h in Headers */, - CF05669F0CF98E7E00C7877C /* fxinst.h in Headers */, - CF0566A00CF98E7E00C7877C /* getset.h in Headers */, - CF0566A10CF98E7E00C7877C /* gfx.h in Headers */, - CF0566A20CF98E7E00C7877C /* language.h in Headers */, - CF0566A30CF98E7E00C7877C /* logger.h in Headers */, - CF0566A40CF98E7E00C7877C /* memmap.h in Headers */, - CF0566A50CF98E7E00C7877C /* messages.h in Headers */, - CF0566A60CF98E7E00C7877C /* missing.h in Headers */, - CF0566A70CF98E7E00C7877C /* movie.h in Headers */, - CF0566A80CF98E7E00C7877C /* obc1.h in Headers */, - CF0566A90CF98E7E00C7877C /* pixform.h in Headers */, - CF0566AA0CF98E7E00C7877C /* port.h in Headers */, - CF0566AB0CF98E7E00C7877C /* ppu.h in Headers */, - CF0566AC0CF98E7E00C7877C /* stream.h in Headers */, - CF0566AD0CF98E7E00C7877C /* sa1.h in Headers */, - CF0566AE0CF98E7E00C7877C /* sar.h in Headers */, - CF0566AF0CF98E7E00C7877C /* screenshot.h in Headers */, - CF0566B00CF98E7E00C7877C /* sdd1.h in Headers */, - CF0566B10CF98E7E00C7877C /* sdd1emu.h in Headers */, - CF0566B20CF98E7E00C7877C /* seta.h in Headers */, - CF0566B30CF98E7E00C7877C /* snapshot.h in Headers */, - CF0566B40CF98E7E00C7877C /* snes9x.h in Headers */, - CF0566B70CF98E7E00C7877C /* spc7110.h in Headers */, - CF0566B80CF98E7E00C7877C /* srtc.h in Headers */, - CF0566B90CF98E7E00C7877C /* tile.h in Headers */, - CF5553CA0EA24C36005957E4 /* 2xsai.h in Headers */, - CF5553CC0EA24C36005957E4 /* blit.h in Headers */, - CF5553CE0EA24C36005957E4 /* epx.h in Headers */, - CF5553D00EA24C36005957E4 /* hq2x.h in Headers */, - CFEFAE9910EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9710EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9810EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - BF0B39B11FA5792F002B04D3 /* blargg_common.h in Headers */, - 85FEF90920DDB15C00C038E9 /* bml.h in Headers */, - CFA518E80EBCB5B1008379F6 /* crypt.h in Headers */, - BF0B39B31FA5792F002B04D3 /* blargg_endian.h in Headers */, - CFA518D90EBCB4CA008379F6 /* ioapi.h in Headers */, - CFA518DD0EBCB4D2008379F6 /* unzip.h in Headers */, - CF0566BD0CF98E7E00C7877C /* 7z.h in Headers */, - CF0566BE0CF98E7E00C7877C /* aribitcd.h in Headers */, - CF0566BF0CF98E7E00C7877C /* ariconst.h in Headers */, - CF0566C00CF98E7E00C7877C /* ariprice.h in Headers */, - CF0566C10CF98E7E00C7877C /* btreecd.h in Headers */, - CF0566C20CF98E7E00C7877C /* crc32.h in Headers */, - CF0566C30CF98E7E00C7877C /* iiostrm.h in Headers */, - CF0566C40CF98E7E00C7877C /* inbyte.h in Headers */, - CF0566C50CF98E7E00C7877C /* jma.h in Headers */, - BF0B39B61FA5792F002B04D3 /* sdsp.hpp in Headers */, - CF0566C60CF98E7E00C7877C /* lencoder.h in Headers */, - BF0B39E31FA58124002B04D3 /* msu1.h in Headers */, - CF0566C70CF98E7E00C7877C /* litcoder.h in Headers */, - CF0566C80CF98E7E00C7877C /* lzma.h in Headers */, - CF0566C90CF98E7E00C7877C /* lzmadec.h in Headers */, - BF0B39DC1FA5792F002B04D3 /* resampler.h in Headers */, - CF0566CA0CF98E7E00C7877C /* portable.h in Headers */, - BF0B39D71FA5792F002B04D3 /* smp.hpp in Headers */, - CF0566CB0CF98E7E00C7877C /* rcdefs.h in Headers */, - CF0566CC0CF98E7E00C7877C /* rngcoder.h in Headers */, - CF0566CD0CF98E7E00C7877C /* s9x-jma.h in Headers */, - CF0566CE0CF98E7E00C7877C /* winout.h in Headers */, - CF0566D00CF98E7E00C7877C /* mac-appleevent.h in Headers */, - CF0566D10CF98E7E00C7877C /* mac-audio.h in Headers */, - CF0566D30CF98E7E00C7877C /* mac-cart.h in Headers */, - CF0566D40CF98E7E00C7877C /* mac-cheat.h in Headers */, - BF0B39B41FA5792F002B04D3 /* blargg_source.h in Headers */, - CF0566D50CF98E7E00C7877C /* mac-cheatfinder.h in Headers */, - CF0566D60CF98E7E00C7877C /* mac-client.h in Headers */, - CF0566D70CF98E7E00C7877C /* mac-cocoatools.h in Headers */, - CF0566D80CF98E7E00C7877C /* mac-controls.h in Headers */, - BF0B39B21FA5792F002B04D3 /* blargg_config.h in Headers */, - CF0566D90CF98E7E00C7877C /* mac-coreimage.h in Headers */, - CF0566DA0CF98E7E00C7877C /* mac-dialog.h in Headers */, - CF0566DC0CF98E7E00C7877C /* mac-file.h in Headers */, - CF0566DD0CF98E7E00C7877C /* mac-gworld.h in Headers */, - CF0566DF0CF98E7E00C7877C /* mac-joypad.h in Headers */, - CF0566E00CF98E7E00C7877C /* mac-keyboard.h in Headers */, - CF0566E10CF98E7E00C7877C /* mac-multicart.h in Headers */, - CF0566E20CF98E7E00C7877C /* mac-musicbox.h in Headers */, - CF0566E30CF98E7E00C7877C /* mac-netplay.h in Headers */, - CF0566E40CF98E7E00C7877C /* mac-os.h in Headers */, - CF0566E50CF98E7E00C7877C /* mac-prefs.h in Headers */, - CE6E9065227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF0566E60CF98E7E00C7877C /* mac-quicktime.h in Headers */, - BF0B39B81FA5792F002B04D3 /* SPC_DSP.h in Headers */, - CF0566E70CF98E7E00C7877C /* mac-render.h in Headers */, - CF0566E80CF98E7E00C7877C /* mac-screenshot.h in Headers */, - CF0566E90CF98E7E00C7877C /* mac-server.h in Headers */, - CF0566EA0CF98E7E00C7877C /* mac-snes9x.h in Headers */, - CF0566EB0CF98E7E00C7877C /* mac-stringtools.h in Headers */, - CF0566EC0CF98E7E00C7877C /* mac-prefix.h in Headers */, - CF0566ED0CF98E7E00C7877C /* mac-global_prefix.h in Headers */, - CF0566EE0CF98E7E00C7877C /* HID_Utilities_External.h in Headers */, - CF3E45BF137349960077DE32 /* zconf.h in Headers */, - CF3E45D113734A920077DE32 /* zlib.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46111095EE72007D33FA /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46121095EE72007D33FA /* 65c816.h in Headers */, - CF2F46151095EE72007D33FA /* bsx.h in Headers */, - BF0B39F11FA58154002B04D3 /* blargg_source.h in Headers */, - CF2F46161095EE72007D33FA /* c4.h in Headers */, - BF0B39F51FA5815C002B04D3 /* sdsp.hpp in Headers */, - CF2F46171095EE72007D33FA /* cheats.h in Headers */, - CF2F46181095EE72007D33FA /* controls.h in Headers */, - CF2F46191095EE72007D33FA /* cpuaddr.h in Headers */, - CF2F461A1095EE72007D33FA /* cpuexec.h in Headers */, - CF2F461B1095EE72007D33FA /* cpumacro.h in Headers */, - BF0B39F91FA58163002B04D3 /* SPC_DSP.h in Headers */, - CF2F461C1095EE72007D33FA /* cpuops.h in Headers */, - CF2F461D1095EE72007D33FA /* crosshairs.h in Headers */, - CF2F461E1095EE72007D33FA /* debug.h in Headers */, - CF2F461F1095EE72007D33FA /* display.h in Headers */, - BF0B3A011FA5816D002B04D3 /* snes.hpp in Headers */, - CF2F46201095EE72007D33FA /* dma.h in Headers */, - CF2F46211095EE72007D33FA /* dsp.h in Headers */, - CF2F46221095EE72007D33FA /* font.h in Headers */, - CF2F46231095EE72007D33FA /* fxemu.h in Headers */, - CF2F46241095EE72007D33FA /* fxinst.h in Headers */, - CF2F46251095EE72007D33FA /* getset.h in Headers */, - BF0B39EF1FA58151002B04D3 /* blargg_endian.h in Headers */, - CF2F46261095EE72007D33FA /* gfx.h in Headers */, - CF2F46271095EE72007D33FA /* language.h in Headers */, - CF2F46281095EE72007D33FA /* logger.h in Headers */, - CF2F46291095EE72007D33FA /* memmap.h in Headers */, - CF2F462A1095EE72007D33FA /* messages.h in Headers */, - CF2F462B1095EE72007D33FA /* missing.h in Headers */, - CF2F462C1095EE72007D33FA /* movie.h in Headers */, - CF2F462D1095EE72007D33FA /* obc1.h in Headers */, - CE6E9067227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF2F462E1095EE72007D33FA /* pixform.h in Headers */, - CF2F462F1095EE72007D33FA /* port.h in Headers */, - CF2F46301095EE72007D33FA /* ppu.h in Headers */, - CF2F46311095EE72007D33FA /* stream.h in Headers */, - CF2F46321095EE72007D33FA /* sa1.h in Headers */, - CF2F46331095EE72007D33FA /* sar.h in Headers */, - CF2F46341095EE72007D33FA /* screenshot.h in Headers */, - CF2F46351095EE72007D33FA /* sdd1.h in Headers */, - CF2F46361095EE72007D33FA /* sdd1emu.h in Headers */, - CF2F46371095EE72007D33FA /* seta.h in Headers */, - CF2F46381095EE72007D33FA /* snapshot.h in Headers */, - CF2F46391095EE72007D33FA /* snes9x.h in Headers */, - CF2F463C1095EE72007D33FA /* spc7110.h in Headers */, - CF2F463D1095EE72007D33FA /* srtc.h in Headers */, - CF2F463E1095EE72007D33FA /* tile.h in Headers */, - CF2F463F1095EE72007D33FA /* 2xsai.h in Headers */, - CF2F46401095EE72007D33FA /* blit.h in Headers */, - CF2F46411095EE72007D33FA /* epx.h in Headers */, - CF2F46421095EE72007D33FA /* hq2x.h in Headers */, - CFEFAE9310EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9110EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9210EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - CF2F46431095EE72007D33FA /* crypt.h in Headers */, - CF2F46441095EE72007D33FA /* ioapi.h in Headers */, - CF2F46451095EE72007D33FA /* unzip.h in Headers */, - CF2F46461095EE72007D33FA /* 7z.h in Headers */, - CF2F46471095EE72007D33FA /* aribitcd.h in Headers */, - CF2F46481095EE72007D33FA /* ariconst.h in Headers */, - CF2F46491095EE72007D33FA /* ariprice.h in Headers */, - CF2F464A1095EE72007D33FA /* btreecd.h in Headers */, - CF2F464B1095EE72007D33FA /* crc32.h in Headers */, - BF0B39ED1FA5814D002B04D3 /* blargg_config.h in Headers */, - CF2F464C1095EE72007D33FA /* iiostrm.h in Headers */, - BF0B39EB1FA5814B002B04D3 /* blargg_common.h in Headers */, - CF2F464D1095EE72007D33FA /* inbyte.h in Headers */, - CF2F464E1095EE72007D33FA /* jma.h in Headers */, - CF2F464F1095EE72007D33FA /* lencoder.h in Headers */, - CF2F46501095EE72007D33FA /* litcoder.h in Headers */, - BF0B3A051FA58172002B04D3 /* resampler.h in Headers */, - CF2F46511095EE72007D33FA /* lzma.h in Headers */, - BF0B39FD1FA58167002B04D3 /* smp.hpp in Headers */, - CF2F46521095EE72007D33FA /* lzmadec.h in Headers */, - CF2F46531095EE72007D33FA /* portable.h in Headers */, - CF2F46541095EE72007D33FA /* rcdefs.h in Headers */, - CF2F46551095EE72007D33FA /* rngcoder.h in Headers */, - CF2F46561095EE72007D33FA /* s9x-jma.h in Headers */, - CF2F46571095EE72007D33FA /* winout.h in Headers */, - CF2F46581095EE72007D33FA /* mac-appleevent.h in Headers */, - CF2F46591095EE72007D33FA /* mac-audio.h in Headers */, - CF2F465A1095EE72007D33FA /* mac-cart.h in Headers */, - CF2F465B1095EE72007D33FA /* mac-cheat.h in Headers */, - CF2F465C1095EE72007D33FA /* mac-cheatfinder.h in Headers */, - CF2F465D1095EE72007D33FA /* mac-client.h in Headers */, - CF2F465E1095EE72007D33FA /* mac-cocoatools.h in Headers */, - CF2F465F1095EE72007D33FA /* mac-controls.h in Headers */, - CF2F46601095EE72007D33FA /* mac-coreimage.h in Headers */, - CF2F46611095EE72007D33FA /* mac-dialog.h in Headers */, - CF2F46621095EE72007D33FA /* mac-file.h in Headers */, - CF2F46631095EE72007D33FA /* mac-gworld.h in Headers */, - CF2F46641095EE72007D33FA /* mac-joypad.h in Headers */, - CF2F46651095EE72007D33FA /* mac-keyboard.h in Headers */, - BF0B39E91FA58131002B04D3 /* apu.h in Headers */, - CF2F46661095EE72007D33FA /* mac-multicart.h in Headers */, - CF2F46671095EE72007D33FA /* mac-musicbox.h in Headers */, - CF2F46681095EE72007D33FA /* mac-netplay.h in Headers */, - CF2F46691095EE72007D33FA /* mac-os.h in Headers */, - CF2F466A1095EE72007D33FA /* mac-prefs.h in Headers */, - CF2F466B1095EE72007D33FA /* mac-quicktime.h in Headers */, - CF2F466C1095EE72007D33FA /* mac-render.h in Headers */, - BF0B39E51FA58124002B04D3 /* msu1.h in Headers */, - CF2F466D1095EE72007D33FA /* mac-screenshot.h in Headers */, - CF2F466E1095EE72007D33FA /* mac-server.h in Headers */, - CF2F466F1095EE72007D33FA /* mac-snes9x.h in Headers */, - CF2F46701095EE72007D33FA /* mac-stringtools.h in Headers */, - CF2F46711095EE72007D33FA /* mac-prefix.h in Headers */, - CF2F46721095EE72007D33FA /* mac-global_prefix.h in Headers */, - CF2F46731095EE72007D33FA /* HID_Utilities_External.h in Headers */, - CF3E45C3137349960077DE32 /* zconf.h in Headers */, - CF3E45D313734A920077DE32 /* zlib.h in Headers */, + 30D15DB322CE6BC9005BC352 /* port.h in Headers */, + 30D15CF322CE6B5A005BC352 /* snes9x_framework.h in Headers */, + 30714729230E387700917F82 /* mac-os.h in Headers */, + 30D15D9522CE6BC9005BC352 /* sha256.h in Headers */, + 30D15D9622CE6BC9005BC352 /* bml.h in Headers */, + 30D15D9722CE6BC9005BC352 /* 65c816.h in Headers */, + 307C861422D27C53001B879E /* tileimpl.h in Headers */, + 30D15D9822CE6BC9005BC352 /* bsx.h in Headers */, + 30D15D9922CE6BC9005BC352 /* c4.h in Headers */, + 30D15D9A22CE6BC9005BC352 /* cheats.h in Headers */, + 30D15D9B22CE6BC9005BC352 /* controls.h in Headers */, + 30D15D9C22CE6BC9005BC352 /* cpuaddr.h in Headers */, + 30D15D9D22CE6BC9005BC352 /* cpuexec.h in Headers */, + 30D15D9E22CE6BC9005BC352 /* cpumacro.h in Headers */, + 30D15D9F22CE6BC9005BC352 /* cpuops.h in Headers */, + 30D15DA022CE6BC9005BC352 /* crosshairs.h in Headers */, + 30D15DA122CE6BC9005BC352 /* debug.h in Headers */, + 30D15DA222CE6BC9005BC352 /* display.h in Headers */, + 30D15DA322CE6BC9005BC352 /* dma.h in Headers */, + 3082C4242378BCE80081CA7C /* EndianStuff.h in Headers */, + 30D15DA422CE6BC9005BC352 /* dsp.h in Headers */, + 30D15DA522CE6BC9005BC352 /* font.h in Headers */, + 30D15DA622CE6BC9005BC352 /* fxemu.h in Headers */, + 30D15DA722CE6BC9005BC352 /* fxinst.h in Headers */, + 30D15DA822CE6BC9005BC352 /* getset.h in Headers */, + 30D15DA922CE6BC9005BC352 /* gfx.h in Headers */, + 30D15DAA22CE6BC9005BC352 /* language.h in Headers */, + 30D15DAB22CE6BC9005BC352 /* logger.h in Headers */, + 30D15DAC22CE6BC9005BC352 /* memmap.h in Headers */, + 30D15DAD22CE6BC9005BC352 /* messages.h in Headers */, + 30D15DAE22CE6BC9005BC352 /* missing.h in Headers */, + 3082C4272378BCE80081CA7C /* FakeResources.h in Headers */, + 30D15DAF22CE6BC9005BC352 /* movie.h in Headers */, + 30D15DB022CE6BC9005BC352 /* msu1.h in Headers */, + 30D15DB122CE6BC9005BC352 /* obc1.h in Headers */, + 30D15DB222CE6BC9005BC352 /* pixform.h in Headers */, + 30D15DB422CE6BC9005BC352 /* ppu.h in Headers */, + 30D15DB522CE6BC9005BC352 /* stream.h in Headers */, + 30D15DB622CE6BC9005BC352 /* sa1.h in Headers */, + 30D15DB722CE6BC9005BC352 /* sar.h in Headers */, + 30D15DB822CE6BC9005BC352 /* screenshot.h in Headers */, + 30D15DB922CE6BC9005BC352 /* sdd1.h in Headers */, + 30D15DBA22CE6BC9005BC352 /* sdd1emu.h in Headers */, + 30D15DBB22CE6BC9005BC352 /* seta.h in Headers */, + 30D15DBC22CE6BC9005BC352 /* snapshot.h in Headers */, + 30D15DBD22CE6BC9005BC352 /* snes9x.h in Headers */, + 30D15DBE22CE6BC9005BC352 /* spc7110.h in Headers */, + 30D15DC122CE6BC9005BC352 /* srtc.h in Headers */, + 30D15DC322CE6BC9005BC352 /* tile.h in Headers */, + 30D15DC422CE6BC9005BC352 /* apu.h in Headers */, + 30D15DC522CE6BC9005BC352 /* blargg_common.h in Headers */, + 3082C4232378BCE80081CA7C /* FakeHandles.h in Headers */, + 30D15DC622CE6BC9005BC352 /* blargg_config.h in Headers */, + 30D15DC722CE6BC9005BC352 /* blargg_endian.h in Headers */, + 30D15DC822CE6BC9005BC352 /* blargg_source.h in Headers */, + 30D15DC922CE6BC9005BC352 /* sdsp.hpp in Headers */, + 30D15DCA22CE6BC9005BC352 /* SPC_DSP.h in Headers */, + 30D15DCB22CE6BC9005BC352 /* smp.hpp in Headers */, + 30D15DCC22CE6BC9005BC352 /* snes.hpp in Headers */, + 30D15DCD22CE6BC9005BC352 /* resampler.h in Headers */, + 30D15DCE22CE6BC9005BC352 /* 2xsai.h in Headers */, + 30D15DCF22CE6BC9005BC352 /* blit.h in Headers */, + 30D15DD022CE6BC9005BC352 /* epx.h in Headers */, + 30D15DD122CE6BC9005BC352 /* hq2x.h in Headers */, + 30D15DD222CE6BC9005BC352 /* snes_ntsc.h in Headers */, + 30D15DD322CE6BC9005BC352 /* snes_ntsc_config.h in Headers */, + 30D15DD422CE6BC9005BC352 /* snes_ntsc_impl.h in Headers */, + 30D15DD522CE6BC9005BC352 /* 7z.h in Headers */, + 30D15DD622CE6BC9005BC352 /* aribitcd.h in Headers */, + 30D15DD722CE6BC9005BC352 /* ariconst.h in Headers */, + 30D15DD822CE6BC9005BC352 /* ariprice.h in Headers */, + 30D15DD922CE6BC9005BC352 /* btreecd.h in Headers */, + 30D15DDA22CE6BC9005BC352 /* crc32.h in Headers */, + 30D15DDB22CE6BC9005BC352 /* iiostrm.h in Headers */, + 30D15DDC22CE6BC9005BC352 /* inbyte.h in Headers */, + 30D15DDD22CE6BC9005BC352 /* jma.h in Headers */, + 30D15DDE22CE6BC9005BC352 /* lencoder.h in Headers */, + 30D15DDF22CE6BC9005BC352 /* litcoder.h in Headers */, + 30D15DE022CE6BC9005BC352 /* lzma.h in Headers */, + 30D15DE122CE6BC9005BC352 /* lzmadec.h in Headers */, + 30D15DE222CE6BC9005BC352 /* portable.h in Headers */, + 30D15DE322CE6BC9005BC352 /* rcdefs.h in Headers */, + 30D15DE422CE6BC9005BC352 /* rngcoder.h in Headers */, + 30D15DE522CE6BC9005BC352 /* s9x-jma.h in Headers */, + 30D15DE622CE6BC9005BC352 /* winout.h in Headers */, + 30D15DE722CE6BC9005BC352 /* crypt.h in Headers */, + 30D15DE822CE6BC9005BC352 /* ioapi.h in Headers */, + 30D15DE922CE6BC9005BC352 /* unzip.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - CF047D36109D0E0600FD0754 /* Intel */ = { + 30714714230E379500917F82 /* Snes9x */ = { isa = PBXNativeTarget; - buildConfigurationList = CF047E12109D0E0600FD0754 /* Build configuration list for PBXNativeTarget "Intel" */; + buildConfigurationList = 30714723230E379600917F82 /* Build configuration list for PBXNativeTarget "Snes9x" */; buildPhases = ( - CF047D37109D0E0600FD0754 /* Headers */, - CF047D9A109D0E0600FD0754 /* Resources */, - CF047DAC109D0E0600FD0754 /* Sources */, - CF047E03109D0E0600FD0754 /* Frameworks */, - CF047E11109D0E0600FD0754 /* Rez */, + 30714711230E379500917F82 /* Sources */, + 30714712230E379500917F82 /* Frameworks */, + 30714713230E379500917F82 /* Resources */, + 30823CDB2379200700EA2331 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + 30714727230E379C00917F82 /* PBXTargetDependency */, ); - name = Intel; - productName = "«PROJECTNAME»"; - productReference = CF047E15109D0E0600FD0754 /* Snes9x (i386).app */; + name = Snes9x; + productName = Snes9x; + productReference = 30714715230E379500917F82 /* Snes9x.app */; productType = "com.apple.product-type.application"; }; - CF05668C0CF98E7E00C7877C /* Snow Leopard */ = { + 30D15CEE22CE6B5A005BC352 /* snes9x framework */ = { isa = PBXNativeTarget; - buildConfigurationList = CF0567640CF98E7E00C7877C /* Build configuration list for PBXNativeTarget "Snow Leopard" */; + buildConfigurationList = 30D15CFA22CE6B5A005BC352 /* Build configuration list for PBXNativeTarget "snes9x framework" */; buildPhases = ( - CF05668D0CF98E7E00C7877C /* Headers */, - CF0566EF0CF98E7E00C7877C /* Resources */, - CF0567010CF98E7E00C7877C /* Sources */, - CF0567540CF98E7E00C7877C /* Frameworks */, - CF0567610CF98E7E00C7877C /* Rez */, + 30D15CEA22CE6B5A005BC352 /* Headers */, + 30D15CEB22CE6B5A005BC352 /* Sources */, + 30D15CEC22CE6B5A005BC352 /* Frameworks */, + 30D15CED22CE6B5A005BC352 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = "Snow Leopard"; - productName = "«PROJECTNAME»"; - productReference = CF0567660CF98E7E00C7877C /* Snes9x.app */; - productType = "com.apple.product-type.application"; - }; - CF2F46101095EE72007D33FA /* PowerPC */ = { - isa = PBXNativeTarget; - buildConfigurationList = CF2F46EE1095EE72007D33FA /* Build configuration list for PBXNativeTarget "PowerPC" */; - buildPhases = ( - CF2F46111095EE72007D33FA /* Headers */, - CF2F46741095EE72007D33FA /* Resources */, - CF2F46861095EE72007D33FA /* Sources */, - CF2F46DD1095EE72007D33FA /* Frameworks */, - CF2F46EB1095EE72007D33FA /* Rez */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PowerPC; - productName = "«PROJECTNAME»"; - productReference = CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */; - productType = "com.apple.product-type.application"; + name = "snes9x framework"; + productName = "snes9x framework"; + productReference = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; + productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -1824,456 +1130,216 @@ 20286C28FDCF999611CA2CEA /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1030; + LastUpgradeCheck = 1200; + TargetAttributes = { + 30714714230E379500917F82 = { + CreatedOnToolsVersion = 10.3; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 0; + }; + }; + }; + 30D15CEE22CE6B5A005BC352 = { + CreatedOnToolsVersion = 10.2.1; + }; + }; }; buildConfigurationList = EA6A1100085808D200A1CF18 /* Build configuration list for PBXProject "snes9x" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + fr, + de, + ja, + en, + Base, ); mainGroup = 20286C29FDCF999611CA2CEA /* Snes9x CVS */; projectDirPath = ""; projectRoot = ..; targets = ( - CF05668C0CF98E7E00C7877C /* Snow Leopard */, - CF047D36109D0E0600FD0754 /* Intel */, - CF2F46101095EE72007D33FA /* PowerPC */, + 30714714230E379500917F82 /* Snes9x */, + 30D15CEE22CE6B5A005BC352 /* snes9x framework */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - CF047D9A109D0E0600FD0754 /* Resources */ = { + 30714713230E379500917F82 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF047D9B109D0E0600FD0754 /* APPL.icns in Resources */, - CF047D9C109D0E0600FD0754 /* CART.icns in Resources */, - CF047D9D109D0E0600FD0754 /* SRAM.icns in Resources */, - CF047D9E109D0E0600FD0754 /* SAVE.icns in Resources */, - CF047D9F109D0E0600FD0754 /* folder_SRAMs.icns in Resources */, - CF047DA0109D0E0600FD0754 /* folder_Freezes.icns in Resources */, - CF047DA1109D0E0600FD0754 /* icons.png in Resources */, - CF047DA2109D0E0600FD0754 /* logo_freeze.png in Resources */, - CF047DA3109D0E0600FD0754 /* logo_defrost.png in Resources */, - CF047DA6109D0E0600FD0754 /* musicbox_indicator.png in Resources */, - CF46BEAF133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D4A133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D49133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF047DA4109D0E0600FD0754 /* musicbox_ledon.icns in Resources */, - CF047DA5109D0E0600FD0754 /* musicbox_ledoff.icns in Resources */, - CF047DA7109D0E0600FD0754 /* freeze_defrost.aiff in Resources */, - CF047DA8109D0E0600FD0754 /* InfoPlist.strings in Resources */, - CF047DA9109D0E0600FD0754 /* Localizable.strings in Resources */, - CF14733F132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAB133E2559005A17A5 /* musicbox.xib in Resources */, - CF047DAB109D0E0600FD0754 /* Snes9x Help in Resources */, + 3071471B230E379600917F82 /* Assets.xcassets in Resources */, + 30D709B4236F731B00AAB7C3 /* SAVE.icns in Resources */, + 30D709B8236F731B00AAB7C3 /* musicbox_ledoff.icns in Resources */, + 30D709B0236F583600AAB7C3 /* Localizable.strings in Resources */, + 30D709B1236F585100AAB7C3 /* Snes9x Help in Resources */, + 30D709B3236F731B00AAB7C3 /* SRAM.icns in Resources */, + 30D709B5236F731B00AAB7C3 /* folder_SRAMs.icns in Resources */, + 30D709B2236F731B00AAB7C3 /* CART.icns in Resources */, + 30D709B7236F731B00AAB7C3 /* musicbox_ledon.icns in Resources */, + 30D709B6236F731B00AAB7C3 /* folder_Freezes.icns in Resources */, + 30D709C2236F7E3200AAB7C3 /* S9xPreferencesWindowController.xib in Resources */, + 3071471E230E379600917F82 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0566EF0CF98E7E00C7877C /* Resources */ = { + 30D15CED22CE6B5A005BC352 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF0566F00CF98E7E00C7877C /* APPL.icns in Resources */, - CF0566F10CF98E7E00C7877C /* CART.icns in Resources */, - CF0566F20CF98E7E00C7877C /* SRAM.icns in Resources */, - CF0566F30CF98E7E00C7877C /* SAVE.icns in Resources */, - CF0566F40CF98E7E00C7877C /* folder_SRAMs.icns in Resources */, - CF0566F50CF98E7E00C7877C /* folder_Freezes.icns in Resources */, - CF0566F60CF98E7E00C7877C /* icons.png in Resources */, - CF0566F70CF98E7E00C7877C /* logo_freeze.png in Resources */, - CF0566F80CF98E7E00C7877C /* logo_defrost.png in Resources */, - CF0566FB0CF98E7E00C7877C /* musicbox_indicator.png in Resources */, - CF46BEAE133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D48133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D47133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF0566F90CF98E7E00C7877C /* musicbox_ledon.icns in Resources */, - CF0566FA0CF98E7E00C7877C /* musicbox_ledoff.icns in Resources */, - CF0566FC0CF98E7E00C7877C /* freeze_defrost.aiff in Resources */, - CF0566FD0CF98E7E00C7877C /* InfoPlist.strings in Resources */, - CF0566FE0CF98E7E00C7877C /* Localizable.strings in Resources */, - CF147340132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAA133E2559005A17A5 /* musicbox.xib in Resources */, - CF0567000CF98E7E00C7877C /* Snes9x Help in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46741095EE72007D33FA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46751095EE72007D33FA /* APPL.icns in Resources */, - CF2F46761095EE72007D33FA /* CART.icns in Resources */, - CF2F46771095EE72007D33FA /* SRAM.icns in Resources */, - CF2F46781095EE72007D33FA /* SAVE.icns in Resources */, - CF2F46791095EE72007D33FA /* folder_SRAMs.icns in Resources */, - CF2F467A1095EE72007D33FA /* folder_Freezes.icns in Resources */, - CF2F467B1095EE72007D33FA /* icons.png in Resources */, - CF2F467C1095EE72007D33FA /* logo_freeze.png in Resources */, - CF2F467D1095EE72007D33FA /* logo_defrost.png in Resources */, - CF2F46801095EE72007D33FA /* musicbox_indicator.png in Resources */, - CF46BEB0133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D4C133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D4B133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF2F467E1095EE72007D33FA /* musicbox_ledon.icns in Resources */, - CF2F467F1095EE72007D33FA /* musicbox_ledoff.icns in Resources */, - CF2F46811095EE72007D33FA /* freeze_defrost.aiff in Resources */, - CF2F46821095EE72007D33FA /* InfoPlist.strings in Resources */, - CF2F46831095EE72007D33FA /* Localizable.strings in Resources */, - CF14733E132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAC133E2559005A17A5 /* musicbox.xib in Resources */, - CF2F46851095EE72007D33FA /* Snes9x Help in Resources */, + 3000A9D02341879B007DC37F /* logo_defrost.png in Resources */, + 3000A9D123418852007DC37F /* freeze_defrost.aiff in Resources */, + 30656200236A8BA700A1B3B2 /* gamecontrollerdb.txt in Resources */, + 3000A9CF23418799007DC37F /* logo_freeze.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXRezBuildPhase section */ - CF047E11109D0E0600FD0754 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF0567610CF98E7E00C7877C /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46EB1095EE72007D33FA /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ - CF047DAC109D0E0600FD0754 /* Sources */ = { + 30714711230E379500917F82 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF047DAF109D0E0600FD0754 /* bsx.cpp in Sources */, - CF047DB0109D0E0600FD0754 /* c4.cpp in Sources */, - CF047DB1109D0E0600FD0754 /* c4emu.cpp in Sources */, - CF047DB2109D0E0600FD0754 /* cheats.cpp in Sources */, - CF047DB3109D0E0600FD0754 /* cheats2.cpp in Sources */, - CF047DB4109D0E0600FD0754 /* clip.cpp in Sources */, - BF0B39E61FA5812E002B04D3 /* apu.cpp in Sources */, - CF047DB5109D0E0600FD0754 /* controls.cpp in Sources */, - CF047DB6109D0E0600FD0754 /* cpu.cpp in Sources */, - CF047DB7109D0E0600FD0754 /* cpuexec.cpp in Sources */, - CF047DB8109D0E0600FD0754 /* cpuops.cpp in Sources */, - CF047DB9109D0E0600FD0754 /* crosshairs.cpp in Sources */, - CF047DBA109D0E0600FD0754 /* debug.cpp in Sources */, - CF047DBB109D0E0600FD0754 /* dma.cpp in Sources */, - CF047DBC109D0E0600FD0754 /* dsp.cpp in Sources */, - CF047DBD109D0E0600FD0754 /* dsp1.cpp in Sources */, - CF047DBE109D0E0600FD0754 /* dsp2.cpp in Sources */, - CF047DBF109D0E0600FD0754 /* dsp3.cpp in Sources */, - CF047DC0109D0E0600FD0754 /* dsp4.cpp in Sources */, - CF047DC2109D0E0600FD0754 /* fxemu.cpp in Sources */, - CF047DC3109D0E0600FD0754 /* fxinst.cpp in Sources */, - CF047DC4109D0E0600FD0754 /* gfx.cpp in Sources */, - CF047DC5109D0E0600FD0754 /* globals.cpp in Sources */, - CF047DC6109D0E0600FD0754 /* loadzip.cpp in Sources */, - CF047DC7109D0E0600FD0754 /* logger.cpp in Sources */, - CF047DC8109D0E0600FD0754 /* memmap.cpp in Sources */, - CF047DC9109D0E0600FD0754 /* movie.cpp in Sources */, - CF047DCA109D0E0600FD0754 /* obc1.cpp in Sources */, - CF047DCB109D0E0600FD0754 /* ppu.cpp in Sources */, - CF047DCC109D0E0600FD0754 /* stream.cpp in Sources */, - CF047DCD109D0E0600FD0754 /* sa1.cpp in Sources */, - CF047DCE109D0E0600FD0754 /* sa1cpu.cpp in Sources */, - CF047DCF109D0E0600FD0754 /* sdd1.cpp in Sources */, - CF047DD0109D0E0600FD0754 /* sdd1emu.cpp in Sources */, - BF0B39E01FA5810A002B04D3 /* msu1.cpp in Sources */, - CF047DD1109D0E0600FD0754 /* seta.cpp in Sources */, - CF047DD2109D0E0600FD0754 /* seta010.cpp in Sources */, - CF047DD3109D0E0600FD0754 /* seta011.cpp in Sources */, - CF047DD4109D0E0600FD0754 /* seta018.cpp in Sources */, - CF047DD5109D0E0600FD0754 /* snapshot.cpp in Sources */, - CF047DD8109D0E0600FD0754 /* spc7110.cpp in Sources */, - CF047DD9109D0E0600FD0754 /* srtc.cpp in Sources */, - CE6E906C227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - CF047DDA109D0E0600FD0754 /* tile.cpp in Sources */, - CF047DDB109D0E0600FD0754 /* 2xsai.cpp in Sources */, - CF047DDC109D0E0600FD0754 /* blit.cpp in Sources */, - CF047DDD109D0E0600FD0754 /* epx.cpp in Sources */, - CF047DDE109D0E0600FD0754 /* hq2x.cpp in Sources */, - CFEFAE8C10EAC92300FB081A /* snes_ntsc.c in Sources */, - CF047DDF109D0E0600FD0754 /* ioapi.c in Sources */, - CF047DE0109D0E0600FD0754 /* unzip.c in Sources */, - CF047DE1109D0E0600FD0754 /* 7zlzma.cpp in Sources */, - CF047DE2109D0E0600FD0754 /* crc32.cpp in Sources */, - CF047DE3109D0E0600FD0754 /* iiostrm.cpp in Sources */, - CF047DE4109D0E0600FD0754 /* inbyte.cpp in Sources */, - CF047DE5109D0E0600FD0754 /* jma.cpp in Sources */, - CF047DE6109D0E0600FD0754 /* lzma.cpp in Sources */, - CF047DE7109D0E0600FD0754 /* lzmadec.cpp in Sources */, - CF047DE8109D0E0600FD0754 /* s9x-jma.cpp in Sources */, - CF047DE9109D0E0600FD0754 /* winout.cpp in Sources */, - CF047DEA109D0E0600FD0754 /* mac-appleevent.cpp in Sources */, - CF047DEB109D0E0600FD0754 /* mac-audio.mm in Sources */, - CF047DEC109D0E0600FD0754 /* mac-cart.mm in Sources */, - CF047DED109D0E0600FD0754 /* mac-cheat.cpp in Sources */, - BF0B39FA1FA58165002B04D3 /* smp.cpp in Sources */, - CF047DEE109D0E0600FD0754 /* mac-cheatfinder.cpp in Sources */, - CF047DEF109D0E0600FD0754 /* mac-client.cpp in Sources */, - CF047DF0109D0E0600FD0754 /* mac-cocoatools.mm in Sources */, - CF047DF1109D0E0600FD0754 /* mac-controls.cpp in Sources */, - CF047DF2109D0E0600FD0754 /* mac-coreimage.mm in Sources */, - BF0B39FE1FA5816A002B04D3 /* smp_state.cpp in Sources */, - BF0B39F21FA58159002B04D3 /* sdsp.cpp in Sources */, - CF047DF3109D0E0600FD0754 /* mac-dialog.cpp in Sources */, - CF047DF4109D0E0600FD0754 /* mac-file.cpp in Sources */, - CF047DF5109D0E0600FD0754 /* mac-gworld.cpp in Sources */, - CE6E9072227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF047DF6109D0E0600FD0754 /* mac-joypad.cpp in Sources */, - CF047DF7109D0E0600FD0754 /* mac-keyboard.cpp in Sources */, - CF047DF8109D0E0600FD0754 /* mac-multicart.cpp in Sources */, - CF047DF9109D0E0600FD0754 /* mac-musicbox.mm in Sources */, - CF047DFA109D0E0600FD0754 /* mac-netplay.cpp in Sources */, - CE6E906F227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF047DFB109D0E0600FD0754 /* mac-os.mm in Sources */, - CF047DFC109D0E0600FD0754 /* mac-prefs.cpp in Sources */, - CF047DFD109D0E0600FD0754 /* mac-quicktime.cpp in Sources */, - CF047DFE109D0E0600FD0754 /* mac-render.cpp in Sources */, - CF047DFF109D0E0600FD0754 /* mac-screenshot.cpp in Sources */, - CF047E00109D0E0600FD0754 /* mac-server.cpp in Sources */, - CF047E01109D0E0600FD0754 /* mac-snes9x.cpp in Sources */, - CF047E02109D0E0600FD0754 /* mac-stringtools.cpp in Sources */, + 30D709C5236F90DF00AAB7C3 /* S9xButtonConfigTextField.m in Sources */, + 30714721230E379600917F82 /* main.m in Sources */, + 30714719230E379500917F82 /* AppDelegate.m in Sources */, + 3082C42A2379199F0081CA7C /* S9xApplication.m in Sources */, + 30D709C1236F7E3200AAB7C3 /* S9xPreferencesWindowController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0567010CF98E7E00C7877C /* Sources */ = { + 30D15CEB22CE6B5A005BC352 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF0567030CF98E7E00C7877C /* bsx.cpp in Sources */, - CF0567040CF98E7E00C7877C /* c4.cpp in Sources */, - CF0567050CF98E7E00C7877C /* c4emu.cpp in Sources */, - CF0567060CF98E7E00C7877C /* cheats.cpp in Sources */, - CE6E906B227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - BF0B39AF1FA5792F002B04D3 /* apu.cpp in Sources */, - CF0567070CF98E7E00C7877C /* cheats2.cpp in Sources */, - CF0567080CF98E7E00C7877C /* clip.cpp in Sources */, - CF0567090CF98E7E00C7877C /* controls.cpp in Sources */, - CF05670A0CF98E7E00C7877C /* cpu.cpp in Sources */, - CF05670B0CF98E7E00C7877C /* cpuexec.cpp in Sources */, - CF05670C0CF98E7E00C7877C /* cpuops.cpp in Sources */, - CF05670D0CF98E7E00C7877C /* crosshairs.cpp in Sources */, - CFE7FBB10D2F6755002F3102 /* debug.cpp in Sources */, - CF05670F0CF98E7E00C7877C /* dma.cpp in Sources */, - BF0B39DF1FA580F9002B04D3 /* msu1.cpp in Sources */, - CF5D3E2A0FAFD35A00340007 /* dsp.cpp in Sources */, - CF0567100CF98E7E00C7877C /* dsp1.cpp in Sources */, - CF5D3E240FAFD35400340007 /* dsp2.cpp in Sources */, - CF5D3E260FAFD35400340007 /* dsp3.cpp in Sources */, - CF5D3E250FAFD35400340007 /* dsp4.cpp in Sources */, - CFE7FBB40D2F67BA002F3102 /* fxemu.cpp in Sources */, - CF0567120CF98E7E00C7877C /* fxinst.cpp in Sources */, - CE6E9071227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF0567130CF98E7E00C7877C /* gfx.cpp in Sources */, - CF0567140CF98E7E00C7877C /* globals.cpp in Sources */, - CF0567150CF98E7E00C7877C /* loadzip.cpp in Sources */, - CF0567160CF98E7E00C7877C /* logger.cpp in Sources */, - CF0567170CF98E7E00C7877C /* memmap.cpp in Sources */, - CF0567180CF98E7E00C7877C /* movie.cpp in Sources */, - CF0567190CF98E7E00C7877C /* obc1.cpp in Sources */, - BF0B39D61FA5792F002B04D3 /* smp.cpp in Sources */, - CF05671A0CF98E7E00C7877C /* ppu.cpp in Sources */, - CF05671B0CF98E7E00C7877C /* stream.cpp in Sources */, - CF05671C0CF98E7E00C7877C /* sa1.cpp in Sources */, - CF05671D0CF98E7E00C7877C /* sa1cpu.cpp in Sources */, - CF05671E0CF98E7E00C7877C /* sdd1.cpp in Sources */, - CF05671F0CF98E7E00C7877C /* sdd1emu.cpp in Sources */, - CF0567200CF98E7E00C7877C /* seta.cpp in Sources */, - CF0567210CF98E7E00C7877C /* seta010.cpp in Sources */, - CF0567220CF98E7E00C7877C /* seta011.cpp in Sources */, - CF0567230CF98E7E00C7877C /* seta018.cpp in Sources */, - CF0567240CF98E7E00C7877C /* snapshot.cpp in Sources */, - CF0567270CF98E7E00C7877C /* spc7110.cpp in Sources */, - CF0567280CF98E7E00C7877C /* srtc.cpp in Sources */, - CF0567290CF98E7E00C7877C /* tile.cpp in Sources */, - CE6E906E227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF5553C90EA24C36005957E4 /* 2xsai.cpp in Sources */, - CF5553CB0EA24C36005957E4 /* blit.cpp in Sources */, - CF5553CD0EA24C36005957E4 /* epx.cpp in Sources */, - CF5553CF0EA24C36005957E4 /* hq2x.cpp in Sources */, - CFEFAE8D10EAC92300FB081A /* snes_ntsc.c in Sources */, - BF0B39B51FA5792F002B04D3 /* sdsp.cpp in Sources */, - CFA518D40EBCB4AD008379F6 /* ioapi.c in Sources */, - CFA518C80EBCB3ED008379F6 /* unzip.c in Sources */, - BF0B39D81FA5792F002B04D3 /* smp_state.cpp in Sources */, - CF05672E0CF98E7E00C7877C /* 7zlzma.cpp in Sources */, - CF05672F0CF98E7E00C7877C /* crc32.cpp in Sources */, - CF0567300CF98E7E00C7877C /* iiostrm.cpp in Sources */, - CF0567310CF98E7E00C7877C /* inbyte.cpp in Sources */, - CF0567320CF98E7E00C7877C /* jma.cpp in Sources */, - CF0567330CF98E7E00C7877C /* lzma.cpp in Sources */, - CF0567340CF98E7E00C7877C /* lzmadec.cpp in Sources */, - CF0567350CF98E7E00C7877C /* s9x-jma.cpp in Sources */, - CF0567360CF98E7E00C7877C /* winout.cpp in Sources */, - CF0567380CF98E7E00C7877C /* mac-appleevent.cpp in Sources */, - CF0567390CF98E7E00C7877C /* mac-audio.mm in Sources */, - CF05673B0CF98E7E00C7877C /* mac-cart.mm in Sources */, - CF05673C0CF98E7E00C7877C /* mac-cheat.cpp in Sources */, - CF05673D0CF98E7E00C7877C /* mac-cheatfinder.cpp in Sources */, - CF05673E0CF98E7E00C7877C /* mac-client.cpp in Sources */, - CF05673F0CF98E7E00C7877C /* mac-cocoatools.mm in Sources */, - CF0567400CF98E7E00C7877C /* mac-controls.cpp in Sources */, - 85FEF90820DDB15C00C038E9 /* bml.cpp in Sources */, - CF0567410CF98E7E00C7877C /* mac-coreimage.mm in Sources */, - CF0567420CF98E7E00C7877C /* mac-dialog.cpp in Sources */, - CF0567440CF98E7E00C7877C /* mac-file.cpp in Sources */, - CF0567450CF98E7E00C7877C /* mac-gworld.cpp in Sources */, - 85FEF90C20DDB18E00C038E9 /* sha256.cpp in Sources */, - CF0567470CF98E7E00C7877C /* mac-joypad.cpp in Sources */, - CF0567480CF98E7E00C7877C /* mac-keyboard.cpp in Sources */, - CF0567490CF98E7E00C7877C /* mac-multicart.cpp in Sources */, - CF05674A0CF98E7E00C7877C /* mac-musicbox.mm in Sources */, - CF05674B0CF98E7E00C7877C /* mac-netplay.cpp in Sources */, - CF05674C0CF98E7E00C7877C /* mac-os.mm in Sources */, - CF05674D0CF98E7E00C7877C /* mac-prefs.cpp in Sources */, - CF05674E0CF98E7E00C7877C /* mac-quicktime.cpp in Sources */, - CF05674F0CF98E7E00C7877C /* mac-render.cpp in Sources */, - CF0567500CF98E7E00C7877C /* mac-screenshot.cpp in Sources */, - CF0567510CF98E7E00C7877C /* mac-server.cpp in Sources */, - CF0567520CF98E7E00C7877C /* mac-snes9x.cpp in Sources */, - CF0567530CF98E7E00C7877C /* mac-stringtools.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46861095EE72007D33FA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46891095EE72007D33FA /* bsx.cpp in Sources */, - CF2F468A1095EE72007D33FA /* c4.cpp in Sources */, - CF2F468B1095EE72007D33FA /* c4emu.cpp in Sources */, - CF2F468C1095EE72007D33FA /* cheats.cpp in Sources */, - CF2F468D1095EE72007D33FA /* cheats2.cpp in Sources */, - CF2F468E1095EE72007D33FA /* clip.cpp in Sources */, - BF0B39E71FA5812E002B04D3 /* apu.cpp in Sources */, - CF2F468F1095EE72007D33FA /* controls.cpp in Sources */, - CF2F46901095EE72007D33FA /* cpu.cpp in Sources */, - CF2F46911095EE72007D33FA /* cpuexec.cpp in Sources */, - CF2F46921095EE72007D33FA /* cpuops.cpp in Sources */, - CF2F46931095EE72007D33FA /* crosshairs.cpp in Sources */, - CF2F46941095EE72007D33FA /* debug.cpp in Sources */, - CF2F46951095EE72007D33FA /* dma.cpp in Sources */, - CF2F46961095EE72007D33FA /* dsp.cpp in Sources */, - CF2F46971095EE72007D33FA /* dsp1.cpp in Sources */, - CF2F46981095EE72007D33FA /* dsp2.cpp in Sources */, - CF2F46991095EE72007D33FA /* dsp3.cpp in Sources */, - CF2F469A1095EE72007D33FA /* dsp4.cpp in Sources */, - CF2F469C1095EE72007D33FA /* fxemu.cpp in Sources */, - CF2F469D1095EE72007D33FA /* fxinst.cpp in Sources */, - CF2F469E1095EE72007D33FA /* gfx.cpp in Sources */, - CF2F469F1095EE72007D33FA /* globals.cpp in Sources */, - CF2F46A01095EE72007D33FA /* loadzip.cpp in Sources */, - CF2F46A11095EE72007D33FA /* logger.cpp in Sources */, - CF2F46A21095EE72007D33FA /* memmap.cpp in Sources */, - CF2F46A31095EE72007D33FA /* movie.cpp in Sources */, - CF2F46A41095EE72007D33FA /* obc1.cpp in Sources */, - CF2F46A51095EE72007D33FA /* ppu.cpp in Sources */, - CF2F46A61095EE72007D33FA /* stream.cpp in Sources */, - CF2F46A71095EE72007D33FA /* sa1.cpp in Sources */, - CF2F46A81095EE72007D33FA /* sa1cpu.cpp in Sources */, - CF2F46A91095EE72007D33FA /* sdd1.cpp in Sources */, - CF2F46AA1095EE72007D33FA /* sdd1emu.cpp in Sources */, - BF0B39E11FA5810B002B04D3 /* msu1.cpp in Sources */, - CF2F46AB1095EE72007D33FA /* seta.cpp in Sources */, - CF2F46AC1095EE72007D33FA /* seta010.cpp in Sources */, - CF2F46AD1095EE72007D33FA /* seta011.cpp in Sources */, - CF2F46AE1095EE72007D33FA /* seta018.cpp in Sources */, - CF2F46AF1095EE72007D33FA /* snapshot.cpp in Sources */, - CF2F46B21095EE72007D33FA /* spc7110.cpp in Sources */, - CF2F46B31095EE72007D33FA /* srtc.cpp in Sources */, - CE6E906D227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - CF2F46B41095EE72007D33FA /* tile.cpp in Sources */, - CF2F46B51095EE72007D33FA /* 2xsai.cpp in Sources */, - CF2F46B61095EE72007D33FA /* blit.cpp in Sources */, - CF2F46B71095EE72007D33FA /* epx.cpp in Sources */, - CF2F46B81095EE72007D33FA /* hq2x.cpp in Sources */, - CFEFAE8B10EAC92300FB081A /* snes_ntsc.c in Sources */, - CF2F46B91095EE72007D33FA /* ioapi.c in Sources */, - CF2F46BA1095EE72007D33FA /* unzip.c in Sources */, - CF2F46BB1095EE72007D33FA /* 7zlzma.cpp in Sources */, - CF2F46BC1095EE72007D33FA /* crc32.cpp in Sources */, - CF2F46BD1095EE72007D33FA /* iiostrm.cpp in Sources */, - CF2F46BE1095EE72007D33FA /* inbyte.cpp in Sources */, - CF2F46BF1095EE72007D33FA /* jma.cpp in Sources */, - CF2F46C01095EE72007D33FA /* lzma.cpp in Sources */, - CF2F46C11095EE72007D33FA /* lzmadec.cpp in Sources */, - CF2F46C21095EE72007D33FA /* s9x-jma.cpp in Sources */, - CF2F46C31095EE72007D33FA /* winout.cpp in Sources */, - CF2F46C41095EE72007D33FA /* mac-appleevent.cpp in Sources */, - CF2F46C51095EE72007D33FA /* mac-audio.mm in Sources */, - CF2F46C61095EE72007D33FA /* mac-cart.mm in Sources */, - CF2F46C71095EE72007D33FA /* mac-cheat.cpp in Sources */, - BF0B39FB1FA58165002B04D3 /* smp.cpp in Sources */, - CF2F46C81095EE72007D33FA /* mac-cheatfinder.cpp in Sources */, - CF2F46C91095EE72007D33FA /* mac-client.cpp in Sources */, - CF2F46CA1095EE72007D33FA /* mac-cocoatools.mm in Sources */, - CF2F46CB1095EE72007D33FA /* mac-controls.cpp in Sources */, - CF2F46CC1095EE72007D33FA /* mac-coreimage.mm in Sources */, - BF0B39FF1FA5816A002B04D3 /* smp_state.cpp in Sources */, - BF0B39F31FA5815A002B04D3 /* sdsp.cpp in Sources */, - CF2F46CD1095EE72007D33FA /* mac-dialog.cpp in Sources */, - CF2F46CE1095EE72007D33FA /* mac-file.cpp in Sources */, - CF2F46CF1095EE72007D33FA /* mac-gworld.cpp in Sources */, - CE6E9073227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF2F46D01095EE72007D33FA /* mac-joypad.cpp in Sources */, - CF2F46D11095EE72007D33FA /* mac-keyboard.cpp in Sources */, - CF2F46D21095EE72007D33FA /* mac-multicart.cpp in Sources */, - CF2F46D31095EE72007D33FA /* mac-musicbox.mm in Sources */, - CF2F46D41095EE72007D33FA /* mac-netplay.cpp in Sources */, - CE6E9070227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF2F46D51095EE72007D33FA /* mac-os.mm in Sources */, - CF2F46D61095EE72007D33FA /* mac-prefs.cpp in Sources */, - CF2F46D71095EE72007D33FA /* mac-quicktime.cpp in Sources */, - CF2F46D81095EE72007D33FA /* mac-render.cpp in Sources */, - CF2F46D91095EE72007D33FA /* mac-screenshot.cpp in Sources */, - CF2F46DA1095EE72007D33FA /* mac-server.cpp in Sources */, - CF2F46DB1095EE72007D33FA /* mac-snes9x.cpp in Sources */, - CF2F46DC1095EE72007D33FA /* mac-stringtools.cpp in Sources */, + 307C862122D29E29001B879E /* mac-audio.mm in Sources */, + 307C862222D29E29001B879E /* mac-cart.mm in Sources */, + 307C862322D29E29001B879E /* mac-cheat.mm in Sources */, + 307C862422D29E29001B879E /* mac-cheatfinder.mm in Sources */, + 307C862622D29E29001B879E /* mac-cocoatools.mm in Sources */, + 307C862922D29E29001B879E /* mac-gworld.mm in Sources */, + 307C862A22D29E29001B879E /* mac-keyboard.mm in Sources */, + 307C862B22D29E29001B879E /* mac-multicart.mm in Sources */, + 307C862C22D29E29001B879E /* mac-musicbox.mm in Sources */, + 307C862D22D29E29001B879E /* mac-netplay.mm in Sources */, + 307C863022D29E29001B879E /* mac-render.mm in Sources */, + 307C863222D29E29001B879E /* mac-snes9x.mm in Sources */, + 307C863322D29E29001B879E /* mac-stringtools.mm in Sources */, + 307C861F22D29E0D001B879E /* mac-screenshot.mm in Sources */, + 307C861E22D29DF1001B879E /* mac-controls.mm in Sources */, + 307C861922D29CAA001B879E /* mac-joypad.mm in Sources */, + 307C860C22D23A5B001B879E /* mac-file.mm in Sources */, + 30D15DEA22CE6FE1005BC352 /* mac-os.mm in Sources */, + 30D15CFC22CE6B74005BC352 /* sha256.cpp in Sources */, + 30D15CFE22CE6B74005BC352 /* bml.cpp in Sources */, + 30D15D2D22CE6B74005BC352 /* bsx.cpp in Sources */, + 30D15D2E22CE6B74005BC352 /* c4.cpp in Sources */, + 30D15D2F22CE6B74005BC352 /* c4emu.cpp in Sources */, + 30D15D3022CE6B74005BC352 /* cheats.cpp in Sources */, + 30D15D3122CE6B74005BC352 /* cheats2.cpp in Sources */, + 30D15D3222CE6B74005BC352 /* clip.cpp in Sources */, + 30D15D3322CE6B74005BC352 /* controls.cpp in Sources */, + 3082C4262378BCE80081CA7C /* FakeResources.c in Sources */, + 30D15D3422CE6B74005BC352 /* cpu.cpp in Sources */, + 30D15D3522CE6B74005BC352 /* cpuexec.cpp in Sources */, + 30D15D3622CE6B74005BC352 /* cpuops.cpp in Sources */, + 30D15D3722CE6B74005BC352 /* crosshairs.cpp in Sources */, + 30A6F62623B29EF500630584 /* shaders.metal in Sources */, + 30D15D3822CE6B74005BC352 /* debug.cpp in Sources */, + 30D15D3922CE6B74005BC352 /* dma.cpp in Sources */, + 307C861222D27C53001B879E /* tileimpl-n1x1.cpp in Sources */, + 30D15D3A22CE6B74005BC352 /* dsp.cpp in Sources */, + 3082C4252378BCE80081CA7C /* FakeHandles.c in Sources */, + 30D15D3B22CE6B74005BC352 /* dsp1.cpp in Sources */, + 307C861622D27C53001B879E /* tileimpl-n2x1.cpp in Sources */, + 30D15D3C22CE6B74005BC352 /* dsp2.cpp in Sources */, + 30D15D3D22CE6B74005BC352 /* dsp3.cpp in Sources */, + 30D15D3E22CE6B74005BC352 /* dsp4.cpp in Sources */, + 30D15D3F22CE6B74005BC352 /* fxemu.cpp in Sources */, + 30D15D4022CE6B74005BC352 /* fxinst.cpp in Sources */, + 30D15D4122CE6B74005BC352 /* gfx.cpp in Sources */, + 30D15D4222CE6B74005BC352 /* globals.cpp in Sources */, + 30D15D4322CE6B74005BC352 /* loadzip.cpp in Sources */, + 30D15D4422CE6B74005BC352 /* logger.cpp in Sources */, + 30D15D4522CE6B74005BC352 /* memmap.cpp in Sources */, + 30D15D4622CE6B74005BC352 /* movie.cpp in Sources */, + 30D15D4722CE6B74005BC352 /* msu1.cpp in Sources */, + 30D15D4822CE6B74005BC352 /* obc1.cpp in Sources */, + 30D15D4922CE6B74005BC352 /* ppu.cpp in Sources */, + 30D15D4A22CE6B74005BC352 /* stream.cpp in Sources */, + 30D15D4B22CE6B74005BC352 /* sa1.cpp in Sources */, + 30D15D4C22CE6B74005BC352 /* sa1cpu.cpp in Sources */, + 30D15D4D22CE6B74005BC352 /* sdd1.cpp in Sources */, + 30D15D4E22CE6B74005BC352 /* sdd1emu.cpp in Sources */, + 30D15D4F22CE6B74005BC352 /* seta.cpp in Sources */, + 30D15D5022CE6B74005BC352 /* seta010.cpp in Sources */, + 30D15D5122CE6B74005BC352 /* seta011.cpp in Sources */, + 30D15D5222CE6B74005BC352 /* seta018.cpp in Sources */, + 30D15D5322CE6B74005BC352 /* snapshot.cpp in Sources */, + 30D15D5422CE6B74005BC352 /* spc7110.cpp in Sources */, + 30D15D5722CE6B74005BC352 /* srtc.cpp in Sources */, + 30D15D5922CE6B74005BC352 /* tile.cpp in Sources */, + 30D15D5A22CE6B74005BC352 /* apu.cpp in Sources */, + 30D15D6022CE6B74005BC352 /* sdsp.cpp in Sources */, + 30D15D6422CE6B74005BC352 /* smp.cpp in Sources */, + 30D15D6622CE6B74005BC352 /* smp_state.cpp in Sources */, + 30D15D7022CE6B75005BC352 /* 2xsai.cpp in Sources */, + 30D15D7122CE6B75005BC352 /* blit.cpp in Sources */, + 30D15D7222CE6B75005BC352 /* epx.cpp in Sources */, + 30D15D7322CE6B75005BC352 /* hq2x.cpp in Sources */, + 30D15D7422CE6B75005BC352 /* snes_ntsc.c in Sources */, + 30D15D8722CE6B75005BC352 /* 7zlzma.cpp in Sources */, + 30D15D8822CE6B75005BC352 /* crc32.cpp in Sources */, + 30D15D8922CE6B75005BC352 /* iiostrm.cpp in Sources */, + 30D15D8A22CE6B75005BC352 /* inbyte.cpp in Sources */, + 30D15D8B22CE6B75005BC352 /* jma.cpp in Sources */, + 30D15D8C22CE6B75005BC352 /* lzma.cpp in Sources */, + 30D15D8D22CE6B75005BC352 /* lzmadec.cpp in Sources */, + 307C861822D27C53001B879E /* tileimpl-h2x1.cpp in Sources */, + 30D15D8E22CE6B75005BC352 /* s9x-jma.cpp in Sources */, + 30D15D8F22CE6B75005BC352 /* winout.cpp in Sources */, + 3059DA94250690DB003EF183 /* compat.cpp in Sources */, + 30D15D9322CE6B75005BC352 /* ioapi.c in Sources */, + 30D15D9422CE6B75005BC352 /* unzip.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 30714727230E379C00917F82 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 30D15CEE22CE6B5A005BC352 /* snes9x framework */; + targetProxy = 30714726230E379C00917F82 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ + 3071471C230E379600917F82 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 3071471D230E379600917F82 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; CF14733C132DA4E1000D0F91 /* Snes9x.xib */ = { isa = PBXVariantGroup; children = ( - CF14733D132DA4E1000D0F91 /* English */, + 30AD1D2122FBB2EA000EE989 /* en */, ); name = Snes9x.xib; sourceTree = ""; }; - CF46BEA8133E2559005A17A5 /* musicbox.xib */ = { - isa = PBXVariantGroup; - children = ( - CF46BEA9133E2559005A17A5 /* English */, - ); - name = musicbox.xib; - sourceTree = ""; - }; EA3BEA980A28384E00A8FAE5 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( - EA3BEA990A28384E00A8FAE5 /* English */, + 30AD1D1F22FBB2EA000EE989 /* en */, ); name = Localizable.strings; sourceTree = ""; @@ -2281,7 +1347,7 @@ EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - EA3BEA9F0A28384E00A8FAE5 /* English */, + 30AD1D1E22FBB2EA000EE989 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -2289,7 +1355,7 @@ EA3BEAA80A28386500A8FAE5 /* Snes9x Help */ = { isa = PBXVariantGroup; children = ( - EA3BEAA90A28386500A8FAE5 /* English */, + 30AD1D2022FBB2EA000EE989 /* en */, ); name = "Snes9x Help"; sourceTree = ""; @@ -2297,349 +1363,293 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 30714724230E379600917F82 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = Snes9x/Snes9x.entitlements; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Snes9x/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.snes9x.macos.snes9x; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + }; + name = Release; + }; + 30714725230E379600917F82 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = Snes9x/Snes9xDebug.entitlements; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + ENABLE_HARDENED_RUNTIME = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Snes9x/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.snes9x.macos.snes9x; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + }; + name = Debug; + }; + 30D15CF822CE6B5A005BC352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "mac-global_prefix.h"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "snes9x framework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + OTHER_CFLAGS = "-DGL_SILENCE_DEPRECATION"; + PRODUCT_BUNDLE_IDENTIFIER = "com.snes9x.macos.snes9x-framework"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 30D15CF922CE6B5A005BC352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "mac-global_prefix.h"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "snes9x framework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + OTHER_CFLAGS = "-DGL_SILENCE_DEPRECATION"; + PRODUCT_BUNDLE_IDENTIFIER = "com.snes9x.macos.snes9x-framework"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; CF047D02109C98F900FD0754 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - USER_HEADER_SEARCH_PATHS = ../apu/bapu; - }; - name = Debug; - }; - CF047D03109C98F900FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = ""; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_STRICT_ALIASING = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - PRODUCT_NAME = Snes9x; - SDKROOT = macosx10.11; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Debug; - }; - CF047D04109C98F900FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = G3; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - MAC_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_ppc.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.3; - OTHER_LDFLAGS = ( - "-weak_framework", - QuartzCore, - ); - PRODUCT_NAME = "Snes9x (ppc)"; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Debug; - }; - CF047E13109D0E0600FD0754 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = i386; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_i386.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - OTHER_CFLAGS = ( - "-fomit-frame-pointer", - "-fast", - ); - PRODUCT_NAME = "Snes9x (i386)"; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; - CF047E14109D0E0600FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = i386; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_i386.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - PRODUCT_NAME = "Snes9x (i386)"; - WARNING_CFLAGS = "-Wfloat-equal"; + ONLY_ACTIVE_ARCH = YES; + USER_HEADER_SEARCH_PATHS = "../apu/bapu .."; }; name = Debug; }; - CF0567650CF98E7E00C7877C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - OTHER_CFLAGS = ( - "-fomit-frame-pointer", - "-fast", - ); - PRODUCT_NAME = Snes9x; - SDKROOT = macosx10.11; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; - CF2F46EF1095EE72007D33FA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G3; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - MAC_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_ppc.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.3; - OTHER_CFLAGS = ( - "-mcpu=G3", - "-fomit-frame-pointer", - "-fast", - ); - OTHER_LDFLAGS = ( - "-weak_framework", - QuartzCore, - ); - PRODUCT_NAME = "Snes9x (ppc)"; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; EA6A1102085808D200A1CF18 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - USER_HEADER_SEARCH_PATHS = ../apu/bapu; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + USER_HEADER_SEARCH_PATHS = "../apu/bapu .."; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - CF047E12109D0E0600FD0754 /* Build configuration list for PBXNativeTarget "Intel" */ = { + 30714723230E379600917F82 /* Build configuration list for PBXNativeTarget "Snes9x" */ = { isa = XCConfigurationList; buildConfigurations = ( - CF047E13109D0E0600FD0754 /* Release */, - CF047E14109D0E0600FD0754 /* Debug */, + 30714724230E379600917F82 /* Release */, + 30714725230E379600917F82 /* Debug */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - CF0567640CF98E7E00C7877C /* Build configuration list for PBXNativeTarget "Snow Leopard" */ = { + 30D15CFA22CE6B5A005BC352 /* Build configuration list for PBXNativeTarget "snes9x framework" */ = { isa = XCConfigurationList; buildConfigurations = ( - CF0567650CF98E7E00C7877C /* Release */, - CF047D03109C98F900FD0754 /* Debug */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CF2F46EE1095EE72007D33FA /* Build configuration list for PBXNativeTarget "PowerPC" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CF2F46EF1095EE72007D33FA /* Release */, - CF047D04109C98F900FD0754 /* Debug */, + 30D15CF822CE6B5A005BC352 /* Release */, + 30D15CF922CE6B5A005BC352 /* Debug */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist b/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist new file mode 100644 index 00000000..5dd5da85 --- /dev/null +++ b/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme b/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme new file mode 100644 index 00000000..b86c5ce8 --- /dev/null +++ b/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/memmap.cpp b/memmap.cpp index b0541b2e..8f324b88 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -894,7 +894,7 @@ static void S9xDeinterleaveGD24 (int size, uint8 *base) bool8 CMemory::Init (void) { RAM = (uint8 *) malloc(0x20000); - SRAM = (uint8 *) malloc(0x20000); + SRAM = (uint8 *) malloc(0x80000); VRAM = (uint8 *) malloc(0x10000); ROM = (uint8 *) malloc(MAX_ROM_SIZE + 0x200 + 0x8000); @@ -935,7 +935,7 @@ bool8 CMemory::Init (void) } memset(RAM, 0, 0x20000); - memset(SRAM, 0, 0x20000); + memset(SRAM, 0, 0x80000); memset(VRAM, 0, 0x10000); memset(ROM, 0, MAX_ROM_SIZE + 0x200 + 0x8000); @@ -1104,6 +1104,11 @@ int CMemory::ScoreHiROM (bool8 skip_header, int32 romoff) uint8 *buf = ROM + 0xff00 + romoff + (skip_header ? 0x200 : 0); int score = 0; + // Check for extended HiROM expansion used in Mother 2 Deluxe et al. + // Looks for size byte 13 (8MB) and an actual ROM size greater than 4MB + if (buf[0xd7] == 13 && CalculatedSize > 1024 * 1024 * 4) + score += 5; + if (buf[0xd5] & 0x1) score += 2; @@ -2531,7 +2536,7 @@ void CMemory::InitROM (void) if (Settings.ForcePAL) Settings.PAL = TRUE; else - if (!Settings.BS && (ROMRegion >= 2) && (ROMRegion <= 12)) + if (!Settings.BS && (((ROMRegion >= 2) && (ROMRegion <= 12)) || ROMRegion == 18)) // 18 is used by "Tintin in Tibet (Europe) (En,Es,Sv)" Settings.PAL = TRUE; else Settings.PAL = FALSE; @@ -2604,6 +2609,9 @@ void CMemory::InitROM (void) and the NMI handler, time enough for an instruction or two. */ // Wild Guns, Mighty Morphin Power Rangers - The Fighting Edition Timings.NMIDMADelay = 24; + Timings.IRQTriggerCycles = 14; + Timings.APUSpeedup = 0; + S9xAPUTimingSetSpeedup(Timings.APUSpeedup); IPPU.TotalEmulatedFrames = 0; @@ -3596,131 +3604,74 @@ void CMemory::ApplyROMFixes (void) { Settings.BlockInvalidVRAMAccess = Settings.BlockInvalidVRAMAccessMaster; - //// Warnings + if (Settings.DisableGameSpecificHacks) + return; - // Reject strange hacked games - if ((ROMCRC32 == 0x6810aa95) || - (ROMCRC32 == 0x340f23e5) || - (ROMCRC32 == 0x77fd806a) || - (match_nn("HIGHWAY BATTLE 2")) || - (match_na("FX SKIING NINTENDO 96") && (ROM[0x7fda] == 0)) || - (match_nn("HONKAKUHA IGO GOSEI") && (ROM[0xffd5] != 0x31))) - { - Settings.DisplayColor = BUILD_PIXEL(31, 0, 0); - SET_UI_COLOR(255, 0, 0); - } - - //// APU timing hacks :( - - Timings.APUSpeedup = 0; - - if (!Settings.DisableGameSpecificHacks) - { - //if (match_id("AVCJ")) // Rendering Ranger R2 - // Timings.APUSpeedup = 2; - if (match_na("CIRCUIT USA")) - Timings.APUSpeedup = 3; - -/* if (match_na("GAIA GENSOUKI 1 JPN") || // Gaia Gensouki - match_id("JG ") || // Illusion of Gaia - match_id("CQ ") || // Stunt Race FX - match_na("SOULBLADER - 1") || // Soul Blader - match_na("SOULBLAZER - 1 USA") || // Soul Blazer - match_na("SLAP STICK 1 JPN") || // Slap Stick - match_id("E9 ") || // Robotrek - match_nn("ACTRAISER") || // Actraiser - match_nn("ActRaiser-2") || // Actraiser 2 - match_id("AQT") || // Tenchi Souzou, Terranigma - match_id("ATV") || // Tales of Phantasia - match_id("ARF") || // Star Ocean - match_id("APR") || // Zen-Nippon Pro Wrestling 2 - 3-4 Budoukan - match_id("A4B") || // Super Bomberman 4 - match_id("Y7 ") || // U.F.O. Kamen Yakisoban - Present Ban - match_id("Y9 ") || // U.F.O. Kamen Yakisoban - Shihan Ban - match_id("APB") || // Super Bomberman - Panic Bomber W - match_na("DARK KINGDOM") || // Dark Kingdom - match_na("ZAN3 SFC") || // Zan III Spirits - match_na("HIOUDEN") || // Hiouden - Mamono-tachi Tono Chikai - match_na("\xC3\xDD\xBC\xC9\xB3\xC0") || // Tenshi no Uta - match_na("FORTUNE QUEST") || // Fortune Quest - Dice wo Korogase - match_na("FISHING TO BASSING") || // Shimono Masaki no Fishing To Bassing - match_na("OHMONO BLACKBASS") || // Oomono Black Bass Fishing - Jinzouko Hen - match_na("MASTERS") || // Harukanaru Augusta 2 - Masters - match_na("SFC \xB6\xD2\xDD\xD7\xB2\xC0\xDE\xB0") || // Kamen Rider - match_na("ZENKI TENCHIMEIDOU") || // Kishin Douji Zenki - Tenchi Meidou - match_nn("TokyoDome '95Battle 7") || // Shin Nippon Pro Wrestling Kounin '95 - Tokyo Dome Battle 7 - match_nn("SWORD WORLD SFC") || // Sword World SFC/2 - match_nn("LETs PACHINKO(") || // BS Lets Pachinko Nante Gindama 1/2/3/4 - match_nn("THE FISHING MASTER") || // Mark Davis The Fishing Master - match_nn("Parlor") || // Parlor mini/2/3/4/5/6/7, Parlor Parlor!/2/3/4/5 - match_na("HEIWA Parlor!Mini8") || // Parlor mini 8 - match_nn("SANKYO Fever! \xCC\xA8\xB0\xCA\xDE\xB0!")) // SANKYO Fever! Fever! - Timings.APUSpeedup = 1; */ - } + // APU timing hacks + if (match_na("CIRCUIT USA")) + Timings.APUSpeedup = 3; S9xAPUTimingSetSpeedup(Timings.APUSpeedup); - //// Other timing hacks :( - - Timings.HDMAStart = SNES_HDMA_START_HC + Settings.HDMATimingHack - 100; - Timings.HBlankStart = SNES_HBLANK_START_HC + Timings.HDMAStart - SNES_HDMA_START_HC; - Timings.IRQTriggerCycles = 14; - - if (!Settings.DisableGameSpecificHacks) + // Other timing hacks + // The delay to sync CPU and DMA which Snes9x does not emulate. + // Some games need really severe delay timing... + if (match_na("BATTLE GRANDPRIX")) // Battle Grandprix + Timings.DMACPUSync = 20; + else if (match_na("KORYU NO MIMI ENG")) // Koryu no Mimi translation by rpgone) { - // The delay to sync CPU and DMA which Snes9x cannot emulate. - // Some games need really severe delay timing... - if (match_na("BATTLE GRANDPRIX")) // Battle Grandprix - { - Timings.DMACPUSync = 20; - printf("DMA sync: %d\n", Timings.DMACPUSync); - } - else if (match_na("KORYU NO MIMI ENG")) // Koryu no Mimi translation by rpgone) - { - // An infinite loop reads $4210 and checks NMI flag. This only works if LDA instruction executes before the NMI triggers, - // which doesn't work very well with s9x's default DMA timing. - Timings.DMACPUSync = 20; - printf("DMA sync: %d\n", Timings.DMACPUSync); - } + // An infinite loop reads $4210 and checks NMI flag. This only works if LDA instruction executes before the NMI triggers, + // which doesn't work very well with s9x's default DMA timing. + Timings.DMACPUSync = 20; } - //// SRAM initial value + if (Timings.DMACPUSync != 18) + printf("DMA sync: %d\n", Timings.DMACPUSync); - if (!Settings.DisableGameSpecificHacks) + // SRAM initial value + if (match_na("HITOMI3")) { - if (match_na("HITOMI3")) - { - SRAMSize = 1; - SRAMMask = ((1 << (SRAMSize + 3)) * 128) - 1; - } - - // SRAM value fixes - if (match_na("SUPER DRIFT OUT") || // Super Drift Out - match_na("SATAN IS OUR FATHER!") || - match_na("goemon 4")) // Ganbare Goemon Kirakira Douchuu - SNESGameFixes.SRAMInitialValue = 0x00; - - // Additional game fixes by sanmaiwashi ... - // XXX: unnecessary? - if (match_na("SFX \xC5\xB2\xC4\xB6\xDE\xDD\xC0\xDE\xD1\xD3\xC9\xB6\xDE\xC0\xD8 1")) // SD Gundam Gaiden - Knight Gundam Monogatari - SNESGameFixes.SRAMInitialValue = 0x6b; - - // others: BS and ST-01x games are 0x00. + SRAMSize = 1; + SRAMMask = ((1 << (SRAMSize + 3)) * 128) - 1; } - //// OAM hacks :( + // SRAM value fixes + if (match_na("SUPER DRIFT OUT") || // Super Drift Out + match_na("SATAN IS OUR FATHER!") || + match_na("goemon 4")) // Ganbare Goemon Kirakira Douchuu + SNESGameFixes.SRAMInitialValue = 0x00; - if (!Settings.DisableGameSpecificHacks) + // Additional game fixes by sanmaiwashi ... + // XXX: unnecessary? + if (match_na("SFX \xC5\xB2\xC4\xB6\xDE\xDD\xC0\xDE\xD1\xD3\xC9\xB6\xDE\xC0\xD8 1")) // SD Gundam Gaiden - Knight Gundam Monogatari + SNESGameFixes.SRAMInitialValue = 0x6b; + + // others: BS and ST-01x games are 0x00. + + // OAM hacks :( + // OAM hacks because we don't fully understand the behavior of the SNES. + // Totally wacky display in 2P mode... + // seems to need a disproven behavior, so we're definitely overlooking some other bug? + if (match_nn("UNIRACERS")) // Uniracers { - // OAM hacks because we don't fully understand the behavior of the SNES. - // Totally wacky display in 2P mode... - // seems to need a disproven behavior, so we're definitely overlooking some other bug? - if (match_nn("UNIRACERS")) // Uniracers - { - SNESGameFixes.Uniracers = TRUE; - printf("Applied Uniracers hack.\n"); - } + SNESGameFixes.Uniracers = TRUE; + printf("Applied Uniracers hack.\n"); } + + // Render Position + if (match_na("Sugoro Quest++")) + Timings.RenderPos = 128; + else if (match_na("FIREPOWER 2000") || match_na("SUPER SWIV")) + Timings.RenderPos = 32; + else if (match_na("DERBY STALLION 98")) + Timings.RenderPos = 128; + else if (match_na("AIR STRIKE PATROL") || match_na("DESERT FIGHTER")) + Timings.RenderPos = 128; // Just hides shadow + // From bsnes + else if (match_na("NHL '94") || match_na("NHL PROHOCKEY'94")) + Timings.RenderPos = 32; + else if (match_na("ADVENTURES OF FRANKEN") && Settings.PAL) + Timings.RenderPos = 32; } // BPS % UPS % IPS diff --git a/movie.cpp b/movie.cpp index c0a1afff..fe41f622 100644 --- a/movie.cpp +++ b/movie.cpp @@ -434,7 +434,7 @@ static int read_movie_extrarominfo (FILE *fd, SMovie *movie) ptr += 3; // zero bytes movie->ROMCRC32 = Read32(ptr); - sstrncpy(movie->ROMName, (char *) ptr, 23); + memcpy(movie->ROMName, (char *) ptr, 23); return (SUCCESS); } diff --git a/movie.h b/movie.h index 31fcb265..28f347ea 100644 --- a/movie.h +++ b/movie.h @@ -48,7 +48,6 @@ int S9xMovieGetInfo (const char *, struct MovieInfo *); void S9xMovieStop (bool8); void S9xMovieToggleRecState (void); void S9xMovieToggleFrameDisplay (void); -const char * S9xChooseMovieFilename (bool8); // methods used by the emulation void S9xMovieInit (void); diff --git a/port.h b/port.h index 73ea7cb1..cb010c92 100644 --- a/port.h +++ b/port.h @@ -151,12 +151,6 @@ void SetInfoDlgColor(unsigned char, unsigned char, unsigned char); #endif // __LIBRETRO__ #endif // __WIN32__ -inline void sstrncpy(char *dst, const char *src, size_t size) -{ - strncpy(dst, src, size - 1); - dst[size - 1] = '\0'; -} - #if defined(__DJGPP) || defined(__WIN32__) #define SLASH_STR "\\" #define SLASH_CHAR '\\' diff --git a/sa1.cpp b/sa1.cpp index aa008590..e56bf6ad 100644 --- a/sa1.cpp +++ b/sa1.cpp @@ -117,10 +117,12 @@ void S9xSA1PostLoadState (void) SA1.VirtualBitmapFormat = (Memory.FillRAM[0x223f] & 0x80) ? 2 : 4; Memory.BWRAM = Memory.SRAM + (Memory.FillRAM[0x2224] & 0x1f) * 0x2000; S9xSA1SetBWRAMMemMap(Memory.FillRAM[0x2225]); +#if 0 S9xSetSA1(Memory.FillRAM[0x2220], 0x2220); S9xSetSA1(Memory.FillRAM[0x2221], 0x2221); S9xSetSA1(Memory.FillRAM[0x2222], 0x2222); S9xSetSA1(Memory.FillRAM[0x2223], 0x2223); +#endif } static void S9xSetSA1MemMap (uint32 which1, uint8 map) @@ -168,7 +170,7 @@ static void S9xSetSA1MemMap (uint32 which1, uint8 map) { offset = (((map & 0x80) ? (map - 4) : which1) & 7) * 0x100000 + (c << 11) - 0x8000; block = Memory.ROM + Multi.cartOffsetB + offset; - } + } } for (int i = c + 8; i < c + 16; i++) Memory.Map[start2 + i] = SA1.Map[start2 + i] = block; diff --git a/shaders/glsl.cpp b/shaders/glsl.cpp index 022b10b1..dc1f1676 100644 --- a/shaders/glsl.cpp +++ b/shaders/glsl.cpp @@ -87,7 +87,7 @@ static const char *wrap_mode_enum_to_string(int val) } -bool GLSLShader::load_shader_preset_file(char *filename) +bool GLSLShader::load_shader_preset_file(const char *filename) { char key[256]; int length = strlen(filename); @@ -268,6 +268,7 @@ static std::string canonicalize(const std::string &noncanonical) return filename_string; } +#ifdef USE_SLANG static GLuint string_to_format(char *format) { #define MATCH(s, f) \ @@ -306,6 +307,7 @@ static GLuint string_to_format(char *format) return GL_RGBA; } +#endif // filename must be canonical void GLSLShader::read_shader_file_with_includes(std::string filename, @@ -343,6 +345,14 @@ void GLSLShader::read_shader_file_with_includes(std::string filename, sscanf(line.c_str(), "#pragma parameter %s \"%[^\"]\" %f %f %f %f", par.id, par.name, &par.val, &par.min, &par.max, &par.step); + unsigned int last_decimal = line.rfind(".") + 1; + unsigned int index = last_decimal; + while (isdigit(line[index]) && index < line.length()) + index++; + par.digits = index - last_decimal; + if (line[index - 1] == '0' && line[index - 2] == '.') + par.digits = 0; + if (par.step == 0.0f) par.step = 1.0f; @@ -431,7 +441,7 @@ GLuint GLSLShader::compile_shader(std::vector &lines, return status; } -bool GLSLShader::load_shader(char *filename) +bool GLSLShader::load_shader(const char *filename) { char shader_path[PATH_MAX]; char temp[PATH_MAX]; diff --git a/shaders/glsl.h b/shaders/glsl.h index 33f005f1..26ac25c0 100644 --- a/shaders/glsl.h +++ b/shaders/glsl.h @@ -34,15 +34,15 @@ enum GLSLFilter GLSL_UNDEFINED = 0, }; -typedef struct +struct GLSLUniformMetrics { GLint Texture; GLint InputSize; GLint TextureSize; GLint TexCoord; -} GLSLUniformMetrics; +}; -typedef struct +struct GLSLUniforms { GLint Texture; GLint InputSize; @@ -67,7 +67,7 @@ typedef struct GLSLUniformMetrics Pass[glsl_max_passes]; GLSLUniformMetrics PassPrev[glsl_max_passes]; GLint Lut[9]; -} GLSLUniforms; +}; // Size must always follow texture type enum @@ -85,7 +85,7 @@ enum SL_FEEDBACK = 10 }; -typedef struct +struct SlangUniform { // Source int type; @@ -94,9 +94,9 @@ typedef struct // Output GLint location; // -1 Indicates UBO GLint offset; -} SlangUniform; +}; -typedef struct +struct GLSLPass { char filename[PATH_MAX]; char alias[256]; @@ -129,9 +129,9 @@ typedef struct bool uses_feedback = false; GLuint feedback_texture; #endif -} GLSLPass; +}; -typedef struct +struct GLSLLut { char id[256]; char filename[PATH_MAX]; @@ -141,9 +141,9 @@ typedef struct bool mipmap; int width; int height; -} GLSLLut; +}; -typedef struct +struct GLSLParam { char name[PATH_MAX]; char id[256]; @@ -151,13 +151,14 @@ typedef struct float max; float val; float step; + int digits; GLint unif[glsl_max_passes]; -} GLSLParam; +}; -typedef struct +struct GLSLShader { - bool load_shader(char *filename); - bool load_shader_preset_file(char *filename); + bool load_shader(const char *filename); + bool load_shader_preset_file(const char *filename); void render(GLuint &orig, int width, int height, int viewport_x, int viewport_y, int viewport_width, int viewport_height, GLSLViewportCallback vpcallback); @@ -195,6 +196,6 @@ typedef struct bool using_feedback; #endif -} GLSLShader; +}; #endif diff --git a/shaders/glslang b/shaders/glslang new file mode 160000 index 00000000..bcf6a243 --- /dev/null +++ b/shaders/glslang @@ -0,0 +1 @@ +Subproject commit bcf6a2430e99e8fc24f9f266e99316905e6d5134 diff --git a/shaders/slang.cpp b/shaders/slang.cpp index 214326a5..d15749c8 100644 --- a/shaders/slang.cpp +++ b/shaders/slang.cpp @@ -9,8 +9,9 @@ #include #include #include -#include -#include +#include "glslang/glslang/Public/ShaderLang.h" +#include "glslang/SPIRV/GlslangToSpv.h" +#include "glslang/StandAlone/ResourceLimits.h" #include "SPIRV-Cross/spirv_cross.hpp" #include "SPIRV-Cross/spirv_glsl.hpp" @@ -83,114 +84,6 @@ static void printuniforms(std::vector &unif) } #endif // #if 0 -namespace glslang { -static const TBuiltInResource DefaultTBuiltInResource = { - /* .MaxLights = */ 32, - /* .MaxClipPlanes = */ 6, - /* .MaxTextureUnits = */ 32, - /* .MaxTextureCoords = */ 32, - /* .MaxVertexAttribs = */ 64, - /* .MaxVertexUniformComponents = */ 4096, - /* .MaxVaryingFloats = */ 64, - /* .MaxVertexTextureImageUnits = */ 32, - /* .MaxCombinedTextureImageUnits = */ 80, - /* .MaxTextureImageUnits = */ 32, - /* .MaxFragmentUniformComponents = */ 4096, - /* .MaxDrawBuffers = */ 32, - /* .MaxVertexUniformVectors = */ 128, - /* .MaxVaryingVectors = */ 8, - /* .MaxFragmentUniformVectors = */ 16, - /* .MaxVertexOutputVectors = */ 16, - /* .MaxFragmentInputVectors = */ 15, - /* .MinProgramTexelOffset = */ -8, - /* .MaxProgramTexelOffset = */ 7, - /* .MaxClipDistances = */ 8, - /* .MaxComputeWorkGroupCountX = */ 65535, - /* .MaxComputeWorkGroupCountY = */ 65535, - /* .MaxComputeWorkGroupCountZ = */ 65535, - /* .MaxComputeWorkGroupSizeX = */ 1024, - /* .MaxComputeWorkGroupSizeY = */ 1024, - /* .MaxComputeWorkGroupSizeZ = */ 64, - /* .MaxComputeUniformComponents = */ 1024, - /* .MaxComputeTextureImageUnits = */ 16, - /* .MaxComputeImageUniforms = */ 8, - /* .MaxComputeAtomicCounters = */ 8, - /* .MaxComputeAtomicCounterBuffers = */ 1, - /* .MaxVaryingComponents = */ 60, - /* .MaxVertexOutputComponents = */ 64, - /* .MaxGeometryInputComponents = */ 64, - /* .MaxGeometryOutputComponents = */ 128, - /* .MaxFragmentInputComponents = */ 128, - /* .MaxImageUnits = */ 8, - /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, - /* .MaxCombinedShaderOutputResources = */ 8, - /* .MaxImageSamples = */ 0, - /* .MaxVertexImageUniforms = */ 0, - /* .MaxTessControlImageUniforms = */ 0, - /* .MaxTessEvaluationImageUniforms = */ 0, - /* .MaxGeometryImageUniforms = */ 0, - /* .MaxFragmentImageUniforms = */ 8, - /* .MaxCombinedImageUniforms = */ 8, - /* .MaxGeometryTextureImageUnits = */ 16, - /* .MaxGeometryOutputVertices = */ 256, - /* .MaxGeometryTotalOutputComponents = */ 1024, - /* .MaxGeometryUniformComponents = */ 1024, - /* .MaxGeometryVaryingComponents = */ 64, - /* .MaxTessControlInputComponents = */ 128, - /* .MaxTessControlOutputComponents = */ 128, - /* .MaxTessControlTextureImageUnits = */ 16, - /* .MaxTessControlUniformComponents = */ 1024, - /* .MaxTessControlTotalOutputComponents = */ 4096, - /* .MaxTessEvaluationInputComponents = */ 128, - /* .MaxTessEvaluationOutputComponents = */ 128, - /* .MaxTessEvaluationTextureImageUnits = */ 16, - /* .MaxTessEvaluationUniformComponents = */ 1024, - /* .MaxTessPatchComponents = */ 120, - /* .MaxPatchVertices = */ 32, - /* .MaxTessGenLevel = */ 64, - /* .MaxViewports = */ 16, - /* .MaxVertexAtomicCounters = */ 0, - /* .MaxTessControlAtomicCounters = */ 0, - /* .MaxTessEvaluationAtomicCounters = */ 0, - /* .MaxGeometryAtomicCounters = */ 0, - /* .MaxFragmentAtomicCounters = */ 8, - /* .MaxCombinedAtomicCounters = */ 8, - /* .MaxAtomicCounterBindings = */ 1, - /* .MaxVertexAtomicCounterBuffers = */ 0, - /* .MaxTessControlAtomicCounterBuffers = */ 0, - /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, - /* .MaxGeometryAtomicCounterBuffers = */ 0, - /* .MaxFragmentAtomicCounterBuffers = */ 1, - /* .MaxCombinedAtomicCounterBuffers = */ 1, - /* .MaxAtomicCounterBufferSize = */ 16384, - /* .MaxTransformFeedbackBuffers = */ 4, - /* .MaxTransformFeedbackInterleavedComponents = */ 64, - /* .MaxCullDistances = */ 8, - /* .MaxCombinedClipAndCullDistances = */ 8, - /* .MaxSamples = */ 4, - /* .maxMeshOutputVerticesNV = */ 256, - /* .maxMeshOutputPrimitivesNV = */ 512, - /* .maxMeshWorkGroupSizeX_NV = */ 32, - /* .maxMeshWorkGroupSizeY_NV = */ 1, - /* .maxMeshWorkGroupSizeZ_NV = */ 1, - /* .maxTaskWorkGroupSizeX_NV = */ 32, - /* .maxTaskWorkGroupSizeY_NV = */ 1, - /* .maxTaskWorkGroupSizeZ_NV = */ 1, - /* .maxMeshViewCountNV = */ 4, - - /* .limits = */ { - /* .nonInductiveForLoops = */ 1, - /* .whileLoops = */ 1, - /* .doWhileLoops = */ 1, - /* .generalUniformIndexing = */ 1, - /* .generalAttributeMatrixVectorIndexing = */ 1, - /* .generalVaryingIndexing = */ 1, - /* .generalSamplerIndexing = */ 1, - /* .generalVariableIndexing = */ 1, - /* .generalConstantMatrixVectorIndexing = */ 1, - }}; -} // namespace glslang - GLint GLSLShader::slang_compile(std::vector &lines, std::string stage) { @@ -274,6 +167,8 @@ GLint GLSLShader::slang_compile(std::vector &lines, spirv_cross::CompilerGLSL::Options opts; opts.version = gl_version() * 10; + if (opts.version < 330 && opts.version > 150) + opts.version = 150; opts.vulkan_semantics = false; glsl.set_common_options(opts); diff --git a/snapshot.cpp b/snapshot.cpp index 7bda7019..b2a845da 100644 --- a/snapshot.cpp +++ b/snapshot.cpp @@ -1069,6 +1069,38 @@ int S9xUnfreezeGameMem (const uint8 *buf, uint32 bufSize) return result; } +void S9xMessageFromResult(int result, const char* base) +{ + switch(result) + { + case WRONG_FORMAT: + S9xMessage(S9X_ERROR, S9X_WRONG_FORMAT, SAVE_ERR_WRONG_FORMAT); + break; + + case WRONG_VERSION: + S9xMessage(S9X_ERROR, S9X_WRONG_VERSION, SAVE_ERR_WRONG_VERSION); + break; + + case WRONG_MOVIE_SNAPSHOT: + S9xMessage(S9X_ERROR, S9X_WRONG_MOVIE_SNAPSHOT, MOVIE_ERR_SNAPSHOT_WRONG_MOVIE); + break; + + case NOT_A_MOVIE_SNAPSHOT: + S9xMessage(S9X_ERROR, S9X_NOT_A_MOVIE_SNAPSHOT, MOVIE_ERR_SNAPSHOT_NOT_MOVIE); + break; + + case SNAPSHOT_INCONSISTENT: + S9xMessage(S9X_ERROR, S9X_SNAPSHOT_INCONSISTENT, MOVIE_ERR_SNAPSHOT_INCONSISTENT); + break; + + case FILE_NOT_FOUND: + default: + sprintf(String, SAVE_ERR_ROM_NOT_FOUND, base); + S9xMessage(S9X_ERROR, S9X_ROM_NOT_FOUND, String); + break; + } +} + bool8 S9xUnfreezeGame (const char *filename) { STREAM stream = NULL; @@ -1088,35 +1120,7 @@ bool8 S9xUnfreezeGame (const char *filename) if (result != SUCCESS) { - switch (result) - { - case WRONG_FORMAT: - S9xMessage(S9X_ERROR, S9X_WRONG_FORMAT, SAVE_ERR_WRONG_FORMAT); - break; - - case WRONG_VERSION: - S9xMessage(S9X_ERROR, S9X_WRONG_VERSION, SAVE_ERR_WRONG_VERSION); - break; - - case WRONG_MOVIE_SNAPSHOT: - S9xMessage(S9X_ERROR, S9X_WRONG_MOVIE_SNAPSHOT, MOVIE_ERR_SNAPSHOT_WRONG_MOVIE); - break; - - case NOT_A_MOVIE_SNAPSHOT: - S9xMessage(S9X_ERROR, S9X_NOT_A_MOVIE_SNAPSHOT, MOVIE_ERR_SNAPSHOT_NOT_MOVIE); - break; - - case SNAPSHOT_INCONSISTENT: - S9xMessage(S9X_ERROR, S9X_SNAPSHOT_INCONSISTENT, MOVIE_ERR_SNAPSHOT_INCONSISTENT); - break; - - case FILE_NOT_FOUND: - default: - sprintf(String, SAVE_ERR_ROM_NOT_FOUND, base); - S9xMessage(S9X_ERROR, S9X_ROM_NOT_FOUND, String); - break; - } - + S9xMessageFromResult(result, base); return (FALSE); } @@ -1141,6 +1145,34 @@ bool8 S9xUnfreezeGame (const char *filename) return (FALSE); } +bool8 S9xUnfreezeScreenshot(const char *filename, uint16 **image_buffer, int &width, int &height) +{ + STREAM stream = NULL; + + const char *base = S9xBasename(filename); + + if(S9xOpenSnapshotFile(filename, TRUE, &stream)) + { + int result; + + result = S9xUnfreezeScreenshotFromStream(stream, image_buffer, width, height); + S9xCloseSnapshotFile(stream); + + if(result != SUCCESS) + { + S9xMessageFromResult(result, base); + return (FALSE); + } + + return (TRUE); + } + + sprintf(String, SAVE_ERR_SAVE_NOT_FOUND, base); + S9xMessage(S9X_INFO, S9X_FREEZE_FILE_INFO, String); + + return (FALSE); +} + void S9xFreezeToStream (STREAM stream) { char buffer[8192]; @@ -1167,7 +1199,7 @@ void S9xFreezeToStream (STREAM stream) FreezeBlock (stream, "RAM", Memory.RAM, 0x20000); - FreezeBlock (stream, "SRA", Memory.SRAM, 0x20000); + FreezeBlock (stream, "SRA", Memory.SRAM, 0x80000); FreezeBlock (stream, "FIL", Memory.FillRAM, 0x8000); @@ -1372,9 +1404,9 @@ int S9xUnfreezeFromStream (STREAM stream) break; if (fast) - result = UnfreezeBlock(stream, "SRA", Memory.SRAM, 0x20000); + result = UnfreezeBlock(stream, "SRA", Memory.SRAM, 0x80000); else - result = UnfreezeBlockCopy (stream, "SRA", &local_sram, 0x20000); + result = UnfreezeBlockCopy (stream, "SRA", &local_sram, 0x80000); if (result != SUCCESS) break; @@ -1544,7 +1576,7 @@ int S9xUnfreezeFromStream (STREAM stream) memcpy(Memory.RAM, local_ram, 0x20000); if (local_sram) - memcpy(Memory.SRAM, local_sram, 0x20000); + memcpy(Memory.SRAM, local_sram, 0x80000); if (local_fillram) memcpy(Memory.FillRAM, local_fillram, 0x8000); @@ -1801,6 +1833,96 @@ int S9xUnfreezeFromStream (STREAM stream) return (result); } +// load screenshot from file, allocating memory for it +int S9xUnfreezeScreenshotFromStream(STREAM stream, uint16 **image_buffer, int &width, int &height) +{ + int result = SUCCESS; + int version, len; + char buffer[PATH_MAX + 1]; + + len = strlen(SNAPSHOT_MAGIC) + 1 + 4 + 1; + if(READ_STREAM(buffer, len, stream) != (unsigned int)len) + return (WRONG_FORMAT); + + if(strncmp(buffer, SNAPSHOT_MAGIC, strlen(SNAPSHOT_MAGIC)) != 0) + return (WRONG_FORMAT); + + version = atoi(&buffer[strlen(SNAPSHOT_MAGIC) + 1]); + if(version > SNAPSHOT_VERSION) + return (WRONG_VERSION); + + result = UnfreezeBlock(stream, "NAM", (uint8 *)buffer, PATH_MAX); + if(result != SUCCESS) + return (result); + + uint8 *local_screenshot = NULL; + + // skip all blocks until screenshot + SkipBlockWithName(stream, "CPU"); + SkipBlockWithName(stream, "REG"); + SkipBlockWithName(stream, "PPU"); + SkipBlockWithName(stream, "DMA"); + SkipBlockWithName(stream, "VRA"); + SkipBlockWithName(stream, "RAM"); + SkipBlockWithName(stream, "SRA"); + SkipBlockWithName(stream, "FIL"); + SkipBlockWithName(stream, "SND"); + SkipBlockWithName(stream, "CTL"); + SkipBlockWithName(stream, "TIM"); + SkipBlockWithName(stream, "SFX"); + SkipBlockWithName(stream, "SA1"); + SkipBlockWithName(stream, "SAR"); + SkipBlockWithName(stream, "DP1"); + SkipBlockWithName(stream, "DP2"); + SkipBlockWithName(stream, "DP4"); + SkipBlockWithName(stream, "CX4"); + SkipBlockWithName(stream, "ST0"); + SkipBlockWithName(stream, "OBC"); + SkipBlockWithName(stream, "OBM"); + SkipBlockWithName(stream, "S71"); + SkipBlockWithName(stream, "SRT"); + SkipBlockWithName(stream, "CLK"); + SkipBlockWithName(stream, "BSX"); + SkipBlockWithName(stream, "MSU"); + result = UnfreezeStructCopy(stream, "SHO", &local_screenshot, SnapScreenshot, COUNT(SnapScreenshot), version); + + + if(result == SUCCESS && local_screenshot) + { + SnapshotScreenshotInfo *ssi = new SnapshotScreenshotInfo; + + UnfreezeStructFromCopy(ssi, SnapScreenshot, COUNT(SnapScreenshot), local_screenshot, version); + + width = min(ssi->Width, IMAGE_WIDTH); + height = min(ssi->Height, IMAGE_HEIGHT); + + *image_buffer = (uint16 *)malloc(width * height * sizeof(uint16)); + + uint8 *rowpix = ssi->Data; + uint16 *screen = (*image_buffer); + + for(int y = 0; y < height; y++, screen += width) + { + for(int x = 0; x < width; x++) + { + uint32 r, g, b; + + r = *(rowpix++); + g = *(rowpix++); + b = *(rowpix++); + + screen[x] = BUILD_PIXEL(r, g, b); + } + } + + delete ssi; + } + + if(local_screenshot) delete[] local_screenshot; + + return (result); +} + static int FreezeSize (int size, int type) { switch (type) diff --git a/snapshot.h b/snapshot.h index f1a5ecc4..03e59856 100644 --- a/snapshot.h +++ b/snapshot.h @@ -31,5 +31,7 @@ bool8 S9xUnfreezeGame (const char *); int S9xUnfreezeGameMem (const uint8 *,uint32); void S9xFreezeToStream (STREAM); int S9xUnfreezeFromStream (STREAM); +bool8 S9xUnfreezeScreenshot(const char *filename, uint16 **image_buffer, int &width, int &height); +int S9xUnfreezeScreenshotFromStream(STREAM stream, uint16 **image_buffer, int &width, int &height); #endif diff --git a/snes9x.cpp b/snes9x.cpp index dc286aab..c96c52d4 100644 --- a/snes9x.cpp +++ b/snes9x.cpp @@ -764,4 +764,4 @@ char * S9xParseArgs (char **argv, int argc) S9xVerifyControllers(); return (rom_filename); -} +} \ No newline at end of file diff --git a/tile.cpp b/tile.cpp index 4399b693..35d9b151 100644 --- a/tile.cpp +++ b/tile.cpp @@ -297,6 +297,38 @@ void S9xInitTileRenderer (void) } // Functions to select which converter and renderer to use. +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; + +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; + +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; +extern template struct TileImpl::Renderers; void S9xSelectTileRenderers (int BGMode, bool8 sub, bool8 obj) { diff --git a/tileimpl.h b/tileimpl.h index 6ebfa4ff..9ea546e5 100644 --- a/tileimpl.h +++ b/tileimpl.h @@ -793,7 +793,6 @@ namespace TileImpl { template struct DrawMode7MosaicBG2 : public DrawTileMosaic {}; - #undef DRAW_PIXEL } // namespace TileImpl diff --git a/unix/Makefile.in b/unix/Makefile.in index fcef9483..852fd39e 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -8,7 +8,7 @@ OS = `uname -s -r -m|sed \"s/ /-/g\"|tr \"[A-Z]\" \"[a-z]\"|tr \"/()\" \"___\"` BUILDDIR = . -OBJECTS = ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/smp/smp.o ../apu/bapu/smp/smp_state.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../msu1.o ../movie.o ../obc1.o ../ppu.o ../stream.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../tileimpl-n1x1.o ../tileimpl-n2x1.o ../tileimpl-h2x1.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o ../statemanager.o ../sha256.o ../bml.o unix.o x11.o +OBJECTS = ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/smp/smp.o ../apu/bapu/smp/smp_state.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../msu1.o ../movie.o ../obc1.o ../ppu.o ../stream.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../tileimpl-n1x1.o ../tileimpl-n2x1.o ../tileimpl-h2x1.o ../filter/2xsai.o ../filter/blit.o ../filter/epx.o ../filter/hq2x.o ../filter/snes_ntsc.o ../statemanager.o ../sha256.o ../bml.o ../compat.o unix.o x11.o DEFS = -DMITSHM ifdef S9XDEBUGGER diff --git a/unix/unix.cpp b/unix/unix.cpp index 82118950..0fe8f013 100644 --- a/unix/unix.cpp +++ b/unix/unix.cpp @@ -12,12 +12,14 @@ #include #include #include +#include #ifdef HAVE_STRINGS_H #include #endif #ifdef USE_THREADS #include #include +#include #endif #include #include @@ -114,10 +116,6 @@ struct SoundStatus { int sound_fd; uint32 fragment_size; - uint32 err_counter; - uint32 err_rate; - int32 samples_mixed_so_far; - int32 play_position; }; @@ -127,15 +125,6 @@ static SoundStatus so; static bool8 rewinding; -#ifndef NOSOUND -static uint8 Buf[SOUND_BUFFER_SIZE]; -#endif - -#ifdef USE_THREADS -static pthread_t thread; -static pthread_mutex_t mutex; -#endif - #ifdef JOYSTICK_SUPPORT static uint8 js_mod[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; static int js_fd[8] = { -1, -1, -1, -1, -1, -1, -1, -1 }; @@ -156,81 +145,14 @@ bool S9xDisplayPollButton (uint32, bool *); bool S9xDisplayPollAxis (uint32, int16 *); bool S9xDisplayPollPointer (uint32, int16 *, int16 *); -static long log2 (long); -static void SoundTrigger (void); -static void InitTimer (void); static void NSRTControllerSetup (void); static int make_snes9x_dirs (void); -#ifndef NOSOUND -static void * S9xProcessSound (void *); -#endif #ifdef JOYSTICK_SUPPORT static void InitJoysticks (void); static bool8 ReadJoysticks (void); void S9xLatchJSEvent(); #endif - -void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) -{ - *drive = 0; - - const char *slash = strrchr(path, SLASH_CHAR), - *dot = strrchr(path, '.'); - - if (dot && slash && dot < slash) - dot = NULL; - - if (!slash) - { - *dir = 0; - - strcpy(fname, path); - - if (dot) - { - fname[dot - path] = 0; - strcpy(ext, dot + 1); - } - else - *ext = 0; - } - else - { - strcpy(dir, path); - dir[slash - path] = 0; - - strcpy(fname, slash + 1); - - if (dot) - { - fname[dot - slash - 1] = 0; - strcpy(ext, dot + 1); - } - else - *ext = 0; - } -} - -void _makepath (char *path, const char *, const char *dir, const char *fname, const char *ext) -{ - if (dir && *dir) - { - strcpy(path, dir); - strcat(path, SLASH_STR); - } - else - *path = 0; - - strcat(path, fname); - - if (ext && *ext) - { - strcat(path, "."); - strcat(path, ext); - } -} - static long log2 (long num) { long n = 0; @@ -241,6 +163,169 @@ static long log2 (long num) return (n); } +namespace { + +#if ! defined(NOSOUND) + class S9xAudioOutput + { + public: + S9xAudioOutput(int fd, uint32 sampleRateHz, bool isThreaded) + { + m_FD = fd; + uint32 bufferSizeMS = unixSettings.SoundBufferSize; // milliseconds + // 4 = sizeof(uint16) * STEREO + m_BufferSize = int(uint64(sampleRateHz) * bufferSizeMS / 1000 * 4); + +#if defined(USE_THREADS) + m_WrittenSize = 0; + m_Thread = pthread_t(); + m_isExit = false; + if (isThreaded) + { + m_BufferMutex = PTHREAD_MUTEX_INITIALIZER; + m_hasBuffer = PTHREAD_COND_INITIALIZER; + if (pthread_create(&m_Thread, NULL, AudioOutputThreadEntry, this)) + { + return; + } + } +#endif + } + + ~S9xAudioOutput() + { +#if defined(USE_THREADS) + if (m_Thread) + { + pthread_mutex_lock(&m_BufferMutex); + { + m_isExit = true; + pthread_cond_signal(&m_hasBuffer); + } + pthread_mutex_unlock(&m_BufferMutex); + + pthread_join(m_Thread, NULL); + pthread_mutex_destroy(&m_BufferMutex); + pthread_cond_destroy(&m_hasBuffer); + } +#endif + } + + void Write(void* data, int size) + { +#if defined(USE_THREADS) + if (m_Thread) + { + pthread_mutex_lock(&m_BufferMutex); + { + if (int(m_Buffering.size()) < m_BufferSize) + { + size_t oldSize = m_Buffering.size(); + size_t newSize = oldSize + size; + m_WrittenSize = newSize; + m_Buffering.resize(newSize); + memcpy(&m_Buffering[oldSize], data, size); + pthread_cond_signal(&m_hasBuffer); + } + } + pthread_mutex_unlock(&m_BufferMutex); + } + else +#endif + { + WriteImpl(data, size); + } + } + + int GetFreeBufferSize() + { +#if defined(USE_THREADS) + if (m_Thread) + { + int writtenSize; + pthread_mutex_lock(&m_BufferMutex); + { + writtenSize = m_WrittenSize; + } + pthread_mutex_unlock(&m_BufferMutex); + return m_BufferSize - writtenSize; + } + else +#endif + { + audio_buf_info info; + ioctl(m_FD, SNDCTL_DSP_GETOSPACE, &info); + int writtenSize = info.fragsize * info.fragstotal - info.bytes; + return std::max(0, m_BufferSize - writtenSize); + } + } + + private: + void WriteImpl(const void* data, int size) + { + const char* p = reinterpret_cast(data); + while (size > 0) + { + int result = write(m_FD, p, size); + if (result < 0) + { + return; + } + p += result; + size -= result; + } + } + + int m_FD; + int m_BufferSize; + +#if defined(USE_THREADS) + pthread_t m_Thread; + volatile bool m_isExit; + pthread_mutex_t m_BufferMutex; + pthread_cond_t m_hasBuffer; + std::vector m_PlayingBuffer; + std::vector m_Buffering; + int m_WrittenSize; // for dynamic rate control + + static void* AudioOutputThreadEntry(void* arg) + { + S9xAudioOutput* obj = reinterpret_cast(arg); + obj->AudioOutputThread(); + return NULL; + } + + void AudioOutputThread() + { + while (true) + { + pthread_mutex_lock(&m_BufferMutex); + { + pthread_cond_wait(&m_hasBuffer, &m_BufferMutex); + if (m_isExit) + { + return; + } + m_PlayingBuffer.swap(m_Buffering); + m_WrittenSize = 0; + } + pthread_mutex_unlock(&m_BufferMutex); + + if (! m_PlayingBuffer.empty()) + { + WriteImpl(&m_PlayingBuffer[0], m_PlayingBuffer.size()); + m_PlayingBuffer.resize(0); + } + } + } +#endif // USE_THREADS + }; + + S9xAudioOutput* s_AudioOutput = NULL; +#endif // NOSOUND + +} + void S9xExtraUsage (void) { /* 12345678901234567890123456789012345678901234567890123456789012345678901234567890 */ @@ -649,44 +734,6 @@ const char * S9xBasename (const char *f) return (f); } -const char * S9xChooseFilename (bool8 read_only) -{ - char s[PATH_MAX + 1]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - const char *filename; - char title[64]; - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf(s, PATH_MAX + 1, "%s.frz", fname); - sprintf(title, "%s snapshot filename", read_only ? "Select load" : "Choose save"); - - S9xSetSoundMute(TRUE); - filename = S9xSelectFilename(s, S9xGetDirectory(SNAPSHOT_DIR), "frz", title); - S9xSetSoundMute(FALSE); - - return (filename); -} - -const char * S9xChooseMovieFilename (bool8 read_only) -{ - char s[PATH_MAX + 1]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - const char *filename; - char title[64]; - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf(s, PATH_MAX + 1, "%s.smv", fname); - sprintf(title, "Choose movie %s filename", read_only ? "playback" : "record"); - - S9xSetSoundMute(TRUE); - filename = S9xSelectFilename(s, S9xGetDirectory(HOME_DIR), "smv", title); - S9xSetSoundMute(FALSE); - - return (filename); -} - bool8 S9xOpenSnapshotFile (const char *filename, bool8 read_only, STREAM *file) { char s[PATH_MAX + 1]; @@ -1280,49 +1327,17 @@ void S9xSamplesAvailable(void *data) { #ifndef NOSOUND - audio_buf_info info; int samples_to_write; - int bytes_to_write; - int bytes_written; static uint8 *sound_buffer = NULL; static int sound_buffer_size = 0; - - ioctl(so.sound_fd, SNDCTL_DSP_GETOSPACE, &info); - if (Settings.DynamicRateControl) { - S9xUpdateDynamicRate(info.bytes, so.fragment_size * 4); + S9xUpdateDynamicRate(s_AudioOutput->GetFreeBufferSize(), so.fragment_size * 4); } samples_to_write = S9xGetSampleCount(); - if (Settings.DynamicRateControl && !Settings.SoundSync) - { - // Using rate control, we should always keep the emulator's sound buffers empty to - // maintain an accurate measurement. - if (samples_to_write > (info.bytes >> 1)) - { - S9xClearSamples(); - return; - } - } - - if (Settings.SoundSync && !Settings.TurboMode && !Settings.Mute) - { - while (info.bytes >> 1 < samples_to_write) - { - int usec_to_sleep = ((samples_to_write >> 1) - (info.bytes >> 2)) * 10000 / - (Settings.SoundPlaybackRate / 100); - usleep(usec_to_sleep > 0 ? usec_to_sleep : 0); - ioctl(so.sound_fd, SNDCTL_DSP_GETOSPACE, &info); - } - } - else - { - samples_to_write = MIN(info.bytes >> 1, samples_to_write) & ~1; - } - if (samples_to_write < 0) return; @@ -1334,22 +1349,7 @@ void S9xSamplesAvailable(void *data) S9xMixSamples(sound_buffer, samples_to_write); - bytes_written = 0; - bytes_to_write = samples_to_write * 2; - - while (bytes_to_write > bytes_written) - { - int result; - - result = write(so.sound_fd, - ((char *)sound_buffer) + bytes_written, - bytes_to_write - bytes_written); - - if (result < 0) - break; - - bytes_written += result; - } + s_AudioOutput->Write(sound_buffer, samples_to_write * 2); #endif } @@ -1365,6 +1365,12 @@ bool8 S9xOpenSoundDevice (void) return (FALSE); } + s_AudioOutput = new S9xAudioOutput( + so.sound_fd, + Settings.SoundPlaybackRate, + bool(unixSettings.ThreadSound) + ); + J = log2(unixSettings.SoundFragmentSize) | (4 << 16); if (ioctl(so.sound_fd, SNDCTL_DSP_SETFRAGMENT, &J) == -1) return (FALSE); @@ -1394,10 +1400,6 @@ bool8 S9xOpenSoundDevice (void) return (TRUE); } -#ifndef NOSOUND - - -#endif void S9xExit (void) { @@ -1411,6 +1413,10 @@ void S9xExit (void) S9xNPDisconnect(); #endif +#ifndef NOSOUND + delete s_AudioOutput; +#endif + Memory.SaveSRAM(S9xGetFilename(".srm", SRAM_DIR)); S9xResetSaveTimer(FALSE); S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); diff --git a/unix/x11.cpp b/unix/x11.cpp index 9810904d..5613d802 100644 --- a/unix/x11.cpp +++ b/unix/x11.cpp @@ -1793,9 +1793,4 @@ bool S9xDisplayPollPointer (uint32 id, int16 *x, int16 *y) *y = GUI.mouse_y; return (true); -} - -void S9xSetPalette (void) -{ - return; -} +} \ No newline at end of file diff --git a/win32/CSaveLoadWithPreviewDlg.cpp b/win32/CSaveLoadWithPreviewDlg.cpp new file mode 100644 index 00000000..5a25138c --- /dev/null +++ b/win32/CSaveLoadWithPreviewDlg.cpp @@ -0,0 +1,322 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +#include "CSaveLoadWithPreviewDlg.h" + +#include "wsnes9x.h" +#include "../snes9x.h" +#include "../ppu.h" +#include "../display.h" +#include +#include +#include + +CSaveLoadWithPreviewDlg::CSaveLoadWithPreviewDlg(bool is_save_dialog) +{ + for(int i = 0; i < NUM_DIALOG_SLOTS; i++) + { + previewHbmps[i] = NULL; + } + this->is_save_dialog = is_save_dialog; +} + + +CSaveLoadWithPreviewDlg::~CSaveLoadWithPreviewDlg() +{ + delete_preview_bmps(); +} + +bool CreatePreviewHbitmap(HBITMAP *hbmp) +{ + // create a HBITMAP to store the preview images in 32bit RGB + uint8_t* buffer = NULL; + BITMAPINFO *bm = (BITMAPINFO *)calloc(sizeof(BITMAPINFOHEADER), 1); + bm->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bm->bmiHeader.biWidth = PREVIEW_IMAGE_WIDTH; + bm->bmiHeader.biHeight = -PREVIEW_IMAGE_HEIGHT; // negative is top-down + bm->bmiHeader.biPlanes = 1; + bm->bmiHeader.biBitCount = 32; + bm->bmiHeader.biCompression = BI_RGB; + bm->bmiHeader.biSizeImage = 0; + *hbmp = CreateDIBSection(NULL, bm, DIB_RGB_COLORS, (void**)&buffer, 0, 0); + if(*hbmp == NULL) { + return false; + } + return true; +} + +void CSaveLoadWithPreviewDlg::delete_preview_bmps() +{ + for(int i = 0; i < NUM_DIALOG_SLOTS; i++) + { + if(previewHbmps[i]) + { + DeleteObject(previewHbmps[i]); + } + } +} + +bool CSaveLoadWithPreviewDlg::init_preview_bmps() +{ + for(int i = 0; i < NUM_DIALOG_SLOTS; i++) + { + if(!CreatePreviewHbitmap(&previewHbmps[i])) + return false; + } + return true; +} + +void CSaveLoadWithPreviewDlg::load_slot_image_text(int slot, int bank, HWND hDlg) +{ + uint16 *image_buffer; + int width, height; + + // load the saved screenshot from a snapshot + if(UnfreezeScreenshotSlot(bank * SAVE_SLOTS_PER_BANK + slot, &image_buffer, width, height)) + { + // create temporary bitmap storage for screenshot, 16bit RGB + uint8_t* buffer = NULL; + BITMAPINFO *bm = (BITMAPINFO *)calloc(sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD), 1); + bm->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bm->bmiHeader.biWidth = width; + bm->bmiHeader.biHeight = -height; // negative is top-down + bm->bmiHeader.biPlanes = 1; + bm->bmiHeader.biBitCount = 16; + bm->bmiHeader.biCompression = BI_BITFIELDS; + bm->bmiHeader.biSizeImage = width * height * 2; + *(unsigned long *)&bm->bmiColors[0] = FIRST_COLOR_MASK_RGB565; + *(unsigned long *)&bm->bmiColors[1] = SECOND_COLOR_MASK_RGB565; + *(unsigned long *)&bm->bmiColors[2] = THIRD_COLOR_MASK_RGB565; + HBITMAP imageBmp = CreateDIBSection(NULL, bm, DIB_RGB_COLORS, (void**)&buffer, 0, 0); + if(imageBmp == NULL) + { + free(bm); + return; + } + + int row_bytes = width * 2 / 4 * 4; // DIBs always have 4-byte aligned rows + if(width * 2 % 4) + row_bytes += 4; + + // copy saved screenshot into temporary bitmap + uint16 *screen = image_buffer; + for(int h = 0; h < height; h++, screen += width) + { + uint16_t *row_start = (uint16_t*)(buffer + (h * row_bytes)); + for(int w = 0; w < width; w++) + { + row_start[w] = screen[w]; + } + } + + // strech temporary bitmap into HBIMAP for button + HDC cdc = CreateCompatibleDC(GetDC(NULL)); + HGDIOBJ old = SelectObject(cdc, previewHbmps[slot]); + int ret = StretchDIBits(cdc, 0, 0, PREVIEW_IMAGE_WIDTH, PREVIEW_IMAGE_HEIGHT, 0, 0, width, height, buffer, bm, DIB_RGB_COLORS, SRCCOPY); + SelectObject(cdc, old); + DeleteDC(cdc); + DeleteObject(imageBmp); + + free(bm); + + // set image to button + SendMessage(GetDlgItem(hDlg, IDC_BUTTON_SLOT_1 + slot), BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)previewHbmps[slot]); + + char filename[_MAX_PATH + 1]; + GetSlotFilename(slot, filename); + Utf8ToWide filenameW(filename); + + // text with filename and last write time + std::wstring static_text(PathFindFileName(filenameW)); + + // get file time details + HANDLE file_handle = CreateFile(filenameW, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if(file_handle != INVALID_HANDLE_VALUE) + { + FILETIME ft; + SYSTEMTIME stUTC, stLocal; + // transform from file time to local time + if(GetFileTime(file_handle, NULL, NULL, &ft) && + FileTimeToSystemTime(&ft, &stUTC) && + SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal)) + { + // reserve space for date and time (both received individually) + std::vector date_string; + date_string.resize(max( + GetDateFormat(LOCALE_USER_DEFAULT, DATE_AUTOLAYOUT | DATE_LONGDATE, &stLocal, NULL, NULL, 0), + GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stLocal, NULL, NULL, 0) + )); + + GetDateFormat(LOCALE_USER_DEFAULT, DATE_AUTOLAYOUT | DATE_LONGDATE, &stLocal, NULL, &date_string[0], 100); + static_text.append(L"\n").append(&date_string[0]); + GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stLocal, NULL, &date_string[0], 100); + static_text.append(L" ").append(&date_string[0]); + } + } + + // set the description text + SetWindowText(GetDlgItem(hDlg, IDC_STATIC_SLOT_1 + slot), static_text.c_str()); + + free(image_buffer); + } + else + { + // clear image and text + SendMessage(GetDlgItem(hDlg, IDC_BUTTON_SLOT_1 + slot), BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, NULL); + SetWindowText(GetDlgItem(hDlg, IDC_STATIC_SLOT_1 + slot), _T("")); + } +} + +void CSaveLoadWithPreviewDlg::load_current_bank(HWND hDlg) +{ + int bank = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_COMBO_BANK)); + + for (int i = 0; i < NUM_DIALOG_SLOTS; i++) + { + // load one slot + load_slot_image_text(i, bank, hDlg); + } +} + +void CSaveLoadWithPreviewDlg::init_window(HWND hDlg) +{ + if(is_save_dialog) + SetWindowText(hDlg, L"Save with Preview"); + + int x_pos = 0; + int y_pos = 0; + for(int i = 0; i < NUM_DIALOG_SLOTS; i++) + { + // second row + if(i == NUM_DIALOG_SLOTS / 2) + { + x_pos = 0; + y_pos = PREVIEW_HEIGHT + PREVIEW_TEXT_STATIC_HEIGHT; + } + + // create button and static for one slot + CreateWindow(TEXT("BUTTON"), NULL, WS_CHILDWINDOW | WS_VISIBLE | BS_BITMAP, x_pos, y_pos, PREVIEW_WIDHT, PREVIEW_HEIGHT, hDlg, (HMENU)(UINT_PTR)(IDC_BUTTON_SLOT_1 + i), GUI.hInstance, NULL); + HWND hStatic = CreateWindow(TEXT("STATIC"), TEXT(""), WS_CHILDWINDOW | WS_VISIBLE | SS_CENTER, x_pos, y_pos + PREVIEW_HEIGHT, PREVIEW_WIDHT, PREVIEW_TEXT_STATIC_HEIGHT, hDlg, (HMENU)(UINT_PTR)(IDC_STATIC_SLOT_1 + i), GUI.hInstance, NULL); + x_pos += PREVIEW_WIDHT; + + // set dialog font to static + HFONT dlg_font = (HFONT)SendMessage(hDlg, WM_GETFONT, 0, 0); + SendMessage(hStatic, WM_SETFONT, (WPARAM)dlg_font, MAKELPARAM(FALSE, 0)); + } + + // resize dialog to fit all buttons and text + int dialog_width = NUM_DIALOG_SLOTS / 2 * PREVIEW_WIDHT; + int dialog_height = 2 * (PREVIEW_HEIGHT + PREVIEW_TEXT_STATIC_HEIGHT) + 40; // +40 for cancel button + + // reposition cancel button + RECT rect_cancel, rect_bank, client_rect; + GetWindowRect(GetDlgItem(hDlg, IDCANCEL), &rect_cancel); + POINT topleft = { rect_cancel.left, rect_cancel.top }; + ScreenToClient(hDlg, &topleft); + GetClientRect(hDlg, &client_rect); + MoveWindow(GetDlgItem(hDlg, IDCANCEL), dialog_width - (client_rect.right - topleft.x), dialog_height - 30, rect_cancel.right - rect_cancel.left, rect_cancel.bottom - rect_cancel.top, TRUE); + + // reposition dropdown + HWND combo_hwnd = GetDlgItem(hDlg, IDC_COMBO_BANK); + GetWindowRect(combo_hwnd, &rect_bank); + topleft.x = rect_bank.left; + topleft.y = rect_bank.top; + ScreenToClient(hDlg, &topleft); + MoveWindow(combo_hwnd, 10, dialog_height - 30, rect_bank.right - rect_bank.left, rect_bank.bottom - rect_bank.top, TRUE); + + // fill bank strings + TCHAR temp[20]; + for (int i = 0; i < NUM_SAVE_BANKS; i++) + { + _stprintf(temp, _T("Bank #%d"), i); + ComboBox_AddString(combo_hwnd, temp); + } + ComboBox_SetCurSel(combo_hwnd, GUI.CurrentSaveBank); + + // get monitor dimensions + HMONITOR hm; + MONITORINFO mi; + hm = MonitorFromWindow(GUI.hWnd, MONITOR_DEFAULTTONEAREST); + mi.cbSize = sizeof(mi); + GetMonitorInfo(hm, &mi); + + // get title bar and borders + RECT rcMargins = { 0,0,0,0 }; + AdjustWindowRectEx(&rcMargins, GetWindowStyle(hDlg), FALSE, GetWindowExStyle(hDlg)); + rcMargins.left = abs(rcMargins.left); + rcMargins.top = abs(rcMargins.top); + + // add margins to window dimensions and position window in center of screen + dialog_height += rcMargins.top + rcMargins.bottom; + dialog_width += rcMargins.left + rcMargins.right; + int left = (mi.rcWork.right - mi.rcWork.left - dialog_width) / 2; + int top = (mi.rcWork.bottom - mi.rcWork.top - dialog_height) / 2; + SetWindowPos(hDlg, NULL, left, top, dialog_width, dialog_height, SWP_NOZORDER); + + load_current_bank(hDlg); +} + +INT_PTR CALLBACK CSaveLoadWithPreviewDlg::DlgLoadWithPreview(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CSaveLoadWithPreviewDlg* dlg = (CSaveLoadWithPreviewDlg*)GetWindowLongPtr(hDlg, GWLP_USERDATA); + switch(msg) + { + case WM_INITDIALOG: + { + SetWindowLongPtr(hDlg, GWLP_USERDATA, lParam); + dlg = (CSaveLoadWithPreviewDlg*)lParam; + dlg->init_window(hDlg); + } + return true; + case WM_COMMAND: + { + // return which button was pressed, or -1 for cancel + int id = LOWORD(wParam); + if(id >= IDC_BUTTON_SLOT_1 && id < IDC_BUTTON_SLOT_1 + NUM_DIALOG_SLOTS) + { + int bank = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_COMBO_BANK)); + int slot = id - IDC_BUTTON_SLOT_1; + EndDialog(hDlg, bank * SAVE_SLOTS_PER_BANK + slot); + return true; + } + else if(id == IDCANCEL) + { + EndDialog(hDlg, -1); + return true; + } + else if (id == IDC_COMBO_BANK) + { + if (CBN_SELCHANGE == HIWORD(wParam)) + { + dlg->load_current_bank(hDlg); + } + } + } + default: + return false; + } +} + +int CSaveLoadWithPreviewDlg::show() +{ + // disable text and confirm for the duration of the dialog + uint32 save_timeout = Settings.InitialInfoStringTimeout; + bool save_confirm = GUI.ConfirmSaveLoad; + Settings.InitialInfoStringTimeout = 0; + GUI.ConfirmSaveLoad = false; + + int ret = -1; + delete_preview_bmps(); + if(init_preview_bmps()) + { + RedrawWindow(GUI.hWnd, 0, 0, RDW_INTERNALPAINT); // workaround to get the dialog to show in OpenGL fullscreen / emulated fullscreen + ret = DialogBoxParam(GUI.hInstance, MAKEINTRESOURCE(IDD_DIALOG_LOAD_PREVIEW), GUI.hWnd, DlgLoadWithPreview, (LPARAM)this); + } + + GUI.ConfirmSaveLoad = save_confirm; + Settings.InitialInfoStringTimeout = save_timeout; + return ret; +} diff --git a/win32/CSaveLoadWithPreviewDlg.h b/win32/CSaveLoadWithPreviewDlg.h new file mode 100644 index 00000000..60c81c07 --- /dev/null +++ b/win32/CSaveLoadWithPreviewDlg.h @@ -0,0 +1,38 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +#pragma once +#include "windows.h" + +#define NUM_DIALOG_SLOTS 10 + +#define PREVIEW_IMAGE_WIDTH SNES_WIDTH +#define PREVIEW_IMAGE_HEIGHT SNES_HEIGHT +#define PREVIEW_WIDHT (PREVIEW_IMAGE_WIDTH + 10) +#define PREVIEW_HEIGHT (PREVIEW_IMAGE_HEIGHT + 10) +#define PREVIEW_TEXT_STATIC_HEIGHT 50 + +class CSaveLoadWithPreviewDlg +{ +private: + static INT_PTR CALLBACK DlgLoadWithPreview(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + + HBITMAP previewHbmps[NUM_DIALOG_SLOTS]; + bool is_save_dialog; + + void delete_preview_bmps(); + bool init_preview_bmps(); + void load_current_bank(HWND hDlg); + void load_slot_image_text(int slot, int bank, HWND hDlg); + void init_window(HWND hDlg); + +public: + CSaveLoadWithPreviewDlg(bool is_save_dialog = false); + virtual ~CSaveLoadWithPreviewDlg(); + + int show(); +}; + diff --git a/win32/CShaderParamDlg.cpp b/win32/CShaderParamDlg.cpp index c62b28ce..33151a97 100644 --- a/win32/CShaderParamDlg.cpp +++ b/win32/CShaderParamDlg.cpp @@ -1,3 +1,9 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + #include "CShaderParamDlg.h" #include "wsnes9x.h" #include "display.h" diff --git a/win32/CShaderParamDlg.h b/win32/CShaderParamDlg.h index e2540bff..a3c84bf8 100644 --- a/win32/CShaderParamDlg.h +++ b/win32/CShaderParamDlg.h @@ -1,3 +1,9 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + #pragma once #include "windows.h" #include "../shaders/glsl.h" diff --git a/win32/InputCustom.cpp b/win32/InputCustom.cpp index 013fc54c..de74534f 100644 --- a/win32/InputCustom.cpp +++ b/win32/InputCustom.cpp @@ -488,16 +488,15 @@ int GetNumHotKeysAssignedTo (WORD Key, int modifiers) if(MATCHES_KEY(SlotMinus)) count++; if(MATCHES_KEY(SlotSave)) count++; if(MATCHES_KEY(SlotLoad)) count++; + if(MATCHES_KEY(DialogSave)) count++; + if(MATCHES_KEY(DialogLoad)) count++; if(MATCHES_KEY(BGL1)) count++; if(MATCHES_KEY(BGL2)) count++; if(MATCHES_KEY(BGL3)) count++; if(MATCHES_KEY(BGL4)) count++; if(MATCHES_KEY(BGL5)) count++; if(MATCHES_KEY(ClippingWindows)) count++; -// if(MATCHES_KEY(BGLHack)) count++; if(MATCHES_KEY(Transparency)) count++; -// if(MATCHES_KEY(GLCube)) count++; -// if(MATCHES_KEY(InterpMode7)) count++; if(MATCHES_KEY(JoypadSwap)) count++; if(MATCHES_KEY(SwitchControllers)) count++; if(MATCHES_KEY(TurboA)) count++; diff --git a/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj b/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj index 399ed4b3..95b0cd8e 100644 --- a/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj +++ b/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj @@ -412,8 +412,8 @@ - - + + diff --git a/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj.filters b/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj.filters index 9c8eacef..535c6b5d 100644 --- a/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj.filters +++ b/win32/glslang/OGLCompilersDLL/OGLCompiler.vcxproj.filters @@ -1,10 +1,10 @@  - + - + diff --git a/win32/glslang/SPIRV/SPIRV.vcxproj b/win32/glslang/SPIRV/SPIRV.vcxproj index ac36562e..9e188986 100644 --- a/win32/glslang/SPIRV/SPIRV.vcxproj +++ b/win32/glslang/SPIRV/SPIRV.vcxproj @@ -167,7 +167,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Debug/ EnableFastChecks CompileAsCpp @@ -185,10 +185,10 @@ WIN32;_DEBUG;_WINDOWS;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -201,7 +201,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Debug/ EnableFastChecks CompileAsCpp @@ -219,10 +219,10 @@ WIN32;_DEBUG;_WINDOWS;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -233,7 +233,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Release/ CompileAsCpp Sync @@ -251,10 +251,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -267,7 +267,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Release/ CompileAsCpp Sync @@ -285,10 +285,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -302,7 +302,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) MinSizeRel/ CompileAsCpp Sync @@ -320,10 +320,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -336,7 +336,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) MinSizeRel/ CompileAsCpp Sync @@ -354,10 +354,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -371,7 +371,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) RelWithDebInfo/ CompileAsCpp ProgramDatabase @@ -388,10 +388,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -404,7 +404,7 @@ - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) RelWithDebInfo/ CompileAsCpp ProgramDatabase @@ -421,10 +421,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\SPIRV\..;..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\SPIRV\..;..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -437,29 +437,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/glslang/SPIRV/SPIRV.vcxproj.filters b/win32/glslang/SPIRV/SPIRV.vcxproj.filters index 43027a07..84bab99a 100644 --- a/win32/glslang/SPIRV/SPIRV.vcxproj.filters +++ b/win32/glslang/SPIRV/SPIRV.vcxproj.filters @@ -1,31 +1,31 @@  - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/win32/glslang/SPIRV/SPVRemapper.vcxproj b/win32/glslang/SPIRV/SPVRemapper.vcxproj index 443b0ead..d87d0a5f 100644 --- a/win32/glslang/SPIRV/SPVRemapper.vcxproj +++ b/win32/glslang/SPIRV/SPVRemapper.vcxproj @@ -201,10 +201,10 @@ - - - - + + + + diff --git a/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj b/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj index 0ccefc09..ac2fee8e 100644 --- a/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj +++ b/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj @@ -412,8 +412,8 @@ - - + + diff --git a/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj.filters b/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj.filters index aa1e41e0..8972574d 100644 --- a/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj.filters +++ b/win32/glslang/glslang/OSDependent/Windows/OSDependent.vcxproj.filters @@ -1,10 +1,10 @@  - + - + diff --git a/win32/glslang/glslang/glslang.vcxproj b/win32/glslang/glslang/glslang.vcxproj index 4b052e01..df52f076 100644 --- a/win32/glslang/glslang/glslang.vcxproj +++ b/win32/glslang/glslang/glslang.vcxproj @@ -168,7 +168,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Debug/ EnableFastChecks CompileAsCpp @@ -186,10 +186,10 @@ WIN32;_DEBUG;_WINDOWS;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -202,7 +202,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Debug/ EnableFastChecks CompileAsCpp @@ -220,10 +220,10 @@ WIN32;_DEBUG;_WINDOWS;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -234,7 +234,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Release/ CompileAsCpp Sync @@ -252,10 +252,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -268,7 +268,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) Release/ CompileAsCpp Sync @@ -287,10 +287,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -301,7 +301,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) MinSizeRel/ CompileAsCpp Sync @@ -319,10 +319,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -335,7 +335,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) MinSizeRel/ CompileAsCpp Sync @@ -353,10 +353,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -367,7 +367,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) RelWithDebInfo/ CompileAsCpp ProgramDatabase @@ -384,10 +384,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -400,7 +400,7 @@ - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) RelWithDebInfo/ CompileAsCpp ProgramDatabase @@ -417,10 +417,10 @@ WIN32;_WINDOWS;NDEBUG;AMD_EXTENSIONS;NV_EXTENSIONS;ENABLE_HLSL;GLSLANG_OSINCLUDE_WIN32;ENABLE_OPT=0;CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) - ..\src\glslang\..;%(AdditionalIncludeDirectories) + ..\..\..\shaders\glslang\glslang\..;%(AdditionalIncludeDirectories) $(ProjectDir)/$(IntDir) %(Filename).h %(Filename).tlb @@ -430,8 +430,8 @@ - - + + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -473,7 +473,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -515,7 +515,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -557,7 +557,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -599,7 +599,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -641,7 +641,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -683,7 +683,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -725,7 +725,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -767,7 +767,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -809,7 +809,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -851,7 +851,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -893,7 +893,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -935,7 +935,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -977,7 +977,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1019,7 +1019,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1061,7 +1061,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1103,7 +1103,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1145,7 +1145,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1187,7 +1187,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1229,7 +1229,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1271,7 +1271,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1313,7 +1313,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1355,7 +1355,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1397,7 +1397,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1439,7 +1439,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1481,7 +1481,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1523,7 +1523,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1565,7 +1565,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1607,7 +1607,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -1649,7 +1649,49 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + + %(AdditionalOptions) /Zm300 + %(AdditionalOptions) /Zm300 + pch.h + pch.h + Use + Use + pch.h + pch.h + $(IntDir)\pch.pch + $(IntDir)\pch.pch + %(AdditionalOptions) /Zm300 + %(AdditionalOptions) /Zm300 + pch.h + pch.h + Use + Use + pch.h + pch.h + $(IntDir)\pch.pch + $(IntDir)\pch.pch + %(AdditionalOptions) /Zm300 + %(AdditionalOptions) /Zm300 + pch.h + pch.h + Use + Use + pch.h + pch.h + $(IntDir)\pch.pch + $(IntDir)\pch.pch + %(AdditionalOptions) /Zm300 + %(AdditionalOptions) /Zm300 + pch.h + pch.h + Use + Use + pch.h + pch.h + $(IntDir)\pch.pch + $(IntDir)\pch.pch + + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 Create @@ -1683,37 +1725,37 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/glslang/glslang/glslang.vcxproj.filters b/win32/glslang/glslang/glslang.vcxproj.filters index 8ad66d7f..f0f29ce3 100644 --- a/win32/glslang/glslang/glslang.vcxproj.filters +++ b/win32/glslang/glslang/glslang.vcxproj.filters @@ -1,72 +1,72 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/win32/glslang/hlsl/HLSL.vcxproj b/win32/glslang/hlsl/HLSL.vcxproj index 017725b0..e1240424 100644 --- a/win32/glslang/hlsl/HLSL.vcxproj +++ b/win32/glslang/hlsl/HLSL.vcxproj @@ -412,7 +412,7 @@ - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -454,7 +454,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -496,7 +496,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -538,7 +538,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -580,7 +580,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -622,7 +622,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -664,7 +664,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 pch.h @@ -706,7 +706,7 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - + %(AdditionalOptions) /Zm300 %(AdditionalOptions) /Zm300 Create @@ -740,14 +740,14 @@ $(IntDir)\pch.pch $(IntDir)\pch.pch - - - - - - - - + + + + + + + + diff --git a/win32/glslang/hlsl/HLSL.vcxproj.filters b/win32/glslang/hlsl/HLSL.vcxproj.filters index 3b017e7e..18d82d98 100644 --- a/win32/glslang/hlsl/HLSL.vcxproj.filters +++ b/win32/glslang/hlsl/HLSL.vcxproj.filters @@ -1,24 +1,24 @@  - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/win32/glslang/src b/win32/glslang/src deleted file mode 160000 index 0527c9db..00000000 --- a/win32/glslang/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0527c9db8148ce37442fa4a9c99a2a23ad50b0b7 diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index 8bbce310..657aeda9 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -45,6 +45,7 @@ #define IDI_ICON3 161 #define IDI_ICON4 162 #define IDD_DIALOG_HACKS 164 +#define IDD_DIALOG_LOAD_PREVIEW 167 #define IDC_DRIVER 1001 #define IDC_BUFLEN 1002 #define IDC_RATE 1003 @@ -206,6 +207,7 @@ #define IDC_C_LOADWATCH 1155 #define IDC_OUTPUTMETHOD 1155 #define IDC_CPU_OVERCLOCK 1155 +#define IDC_COMBO_BANK 1155 #define IDC_NC_ADDRESS 1156 #define IDC_C_SAVEWATCH 1156 #define IDC_ASPECTDROP 1156 @@ -280,10 +282,13 @@ #define IDC_LABEL_UP19 1198 #define IDC_ASPECT 1199 #define IDC_LABEL_UP26 1199 +#define IDC_LABEL_UP27 1200 #define IDC_MESSAGES_IN_IMAGE 1200 #define IDC_RECORD_NOW 1201 #define IDC_MESSAGES_SCALE 1201 +#define IDC_LABEL_UP28 1201 #define IDC_RECORD_RESET 1202 +#define IDC_LABEL_UP29 1202 #define IDC_JOY1 1203 #define IDC_JOY2 1204 #define IDC_JOY3 1205 @@ -308,6 +313,7 @@ #define IDC_MOVIEROMINFO 1216 #define IDC_SAVE10 1217 #define IDC_CURRENTROMINFO 1217 +#define IDC_DIALOGSAVE 1218 #define IDC_SAVE11 1219 #define IDC_DISPLAY_INPUT 1220 #define IDC_SAVE12 1220 @@ -321,6 +327,9 @@ #define IDC_SAVE20 1228 #define IDC_LABEL_UP20 1229 #define IDC_LABEL_UP21 1230 +#define IDC_DIALOGLOAD 1231 +#define IDC_BANKMINUS 1232 +#define IDC_BANKPLUS 1233 #define IDC_LABEL_UP22 1234 #define IDC_SLOTMINUS 1235 #define IDC_LABEL_UP23 1236 @@ -345,6 +354,7 @@ #define IDC_LABEL_HK12 1255 #define IDC_LABEL_HK13 1256 #define IDC_PLAYWARN 1257 +#define IDC_LABEL_HK14 1257 #define IDC_REDUCEINPUTLAG 1258 #define IDC_INTEGERSCALING 1259 #define IDC_NTSCSCANLINES 1260 @@ -361,6 +371,7 @@ #define IDC_HOTKEY11 2010 #define IDC_HOTKEY12 2011 #define IDC_HOTKEY13 2012 +#define IDC_HOTKEY14 2013 #define IDC_PREV 2147 #define IDC_ENTERED 2148 #define IDC_ENTEREDADDRESS 2157 @@ -404,6 +415,8 @@ #define IDC_SFX_CLOCK_SPEED_SPIN 3036 #define IDC_NO_SPRITE_LIMIT 3037 #define IDC_SET_DEFAULTS 3038 +#define IDC_BUTTON_SLOT_1 3039 +#define IDC_STATIC_SLOT_1 3059 #define ID_FILE_EXIT 40001 #define ID_WINDOW_HIDEMENUBAR 40004 #define ID_FILE_AVI_RECORDING 40005 @@ -520,39 +533,27 @@ #define ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS 40176 #define ID_INPUT_DETECTGAMEPADCHANGES 40177 #define ID_EMULATION_HACKS 40178 +#define ID_FILE_LOAD_PREVIEW 40179 +#define ID_FILE_SAVE_PREVIEW 40180 +#define ID_FILE_SAVE_POPUP 40181 +#define ID_FILE_LOAD_POPUP 40182 #define ID_FILE_SAVE0 44000 -#define ID_FILE_SAVE1 44001 -#define ID_FILE_SAVE2 44002 -#define ID_FILE_SAVE3 44003 -#define ID_FILE_SAVE4 44004 -#define ID_FILE_SAVE5 44005 -#define ID_FILE_SAVE6 44006 -#define ID_FILE_SAVE7 44007 -#define ID_FILE_SAVE8 44008 -#define ID_FILE_SAVE9 44009 -#define ID_FILE_SAVE_FILE 44010 -#define ID_FILE_LOAD0 44020 -#define ID_FILE_LOAD1 44021 -#define ID_FILE_LOAD2 44022 -#define ID_FILE_LOAD3 44023 -#define ID_FILE_LOAD4 44024 -#define ID_FILE_LOAD5 44025 -#define ID_FILE_LOAD6 44026 -#define ID_FILE_LOAD7 44027 -#define ID_FILE_LOAD8 44028 -#define ID_FILE_LOAD9 44029 -#define ID_FILE_LOAD_OOPS 44030 -#define ID_FILE_LOAD_FILE 44031 -#define IDM_MACSRIFLE_TOGGLE 44032 +#define ID_FILE_SAVE_LAST 44100 +#define ID_FILE_LOAD0 44200 +#define ID_FILE_LOAD_LAST 44300 +#define ID_FILE_SAVE_FILE 44310 +#define ID_FILE_LOAD_OOPS 44330 +#define ID_FILE_LOAD_FILE 44331 +#define IDM_MACSRIFLE_TOGGLE 44332 #define IDC_STATIC -1 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 167 -#define _APS_NEXT_COMMAND_VALUE 40179 -#define _APS_NEXT_CONTROL_VALUE 3039 +#define _APS_NEXT_RESOURCE_VALUE 169 +#define _APS_NEXT_COMMAND_VALUE 40181 +#define _APS_NEXT_CONTROL_VALUE 3040 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/win32/rsrc/snes9x.rc b/win32/rsrc/snes9x.rc index 27bd2ecb..d8cd3f34 100644 --- a/win32/rsrc/snes9x.rc +++ b/win32/rsrc/snes9x.rc @@ -26,6 +26,15 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog // +IDD_DIALOG_LOAD_PREVIEW DIALOGEX 0, 0, 567, 247 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Load with Preview" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Cancel",IDCANCEL,510,226,50,14 + COMBOBOX IDC_COMBO_BANK,7,226,48,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP +END + IDD_SOUND_OPTS DIALOGEX 0, 0, 414, 158 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU CAPTION "Sound Settings" @@ -418,91 +427,101 @@ BEGIN CONTROL "Clear SRAM",IDC_CLEARSRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,96,70,10 END -IDD_KEYCUSTOM DIALOGEX 0, 0, 408, 206 +IDD_KEYCUSTOM DIALOGEX 0, 0, 409, 296 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION CAPTION "Customize Special Keys" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - PUSHBUTTON "Cancel",IDCANCEL,354,186,48,14 - PUSHBUTTON "OK",IDOK,300,186,48,14 + PUSHBUTTON "Cancel",IDCANCEL,354,276,48,14 + PUSHBUTTON "OK",IDOK,300,276,48,14 RTEXT "Speed +:",IDC_LABEL_HK1,12,30,72,12 - RTEXT "Frame advance:",IDC_LABEL_HK4,12,66,72,12 - RTEXT "Speed -:",IDC_LABEL_HK2,12,42,72,12 - RTEXT "Pause:",IDC_LABEL_HK3,12,54,72,12 - RTEXT "Frameskip +:",IDC_LABEL_HK6,12,90,72,12 - RTEXT "Movie frame count:",IDC_LABEL_HK11,12,150,72,12 - RTEXT "SuperScope turbo:",IDC_LABEL_HK8,12,114,72,12 - RTEXT "Movie read-only:",IDC_LABEL_HK12,12,162,72,12 - RTEXT "SuperScope pause:",IDC_LABEL_HK9,12,126,72,12 - RTEXT "Frameskip -:",IDC_LABEL_HK7,12,102,72,12 - CONTROL "",IDC_HOTKEY1,"InputCustomHot",WS_TABSTOP,90,30,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY2,"InputCustomHot",WS_TABSTOP,90,42,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY3,"InputCustomHot",WS_TABSTOP,90,54,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY4,"InputCustomHot",WS_TABSTOP,90,66,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY5,"InputCustomHot",WS_TABSTOP,90,78,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY6,"InputCustomHot",WS_TABSTOP,90,90,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY7,"InputCustomHot",WS_TABSTOP,90,102,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY8,"InputCustomHot",WS_TABSTOP,90,114,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY9,"InputCustomHot",WS_TABSTOP,90,126,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY10,"InputCustomHot",WS_TABSTOP,90,138,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY11,"InputCustomHot",WS_TABSTOP,90,150,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY12,"InputCustomHot",WS_TABSTOP,90,162,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_HOTKEY13,"InputCustomHot",WS_TABSTOP,90,174,90,11,WS_EX_CLIENTEDGE - CONTROL "",IDC_SAVE1,"InputCustomHot",WS_TABSTOP,234,18,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 1:",IDC_LABEL_UP2,198,30,30,12 - CONTROL "",IDC_SAVE2,"InputCustomHot",WS_TABSTOP,234,30,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 2:",IDC_LABEL_UP3,198,42,30,12 - CONTROL "",IDC_SAVE3,"InputCustomHot",WS_TABSTOP,234,42,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 3:",IDC_LABEL_UP4,198,54,30,12 - CONTROL "",IDC_SAVE4,"InputCustomHot",WS_TABSTOP,234,54,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 4:",IDC_LABEL_UP5,198,66,30,12 - CONTROL "",IDC_SAVE5,"InputCustomHot",WS_TABSTOP,234,66,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 5:",IDC_LABEL_UP6,198,78,30,12 - CONTROL "",IDC_SAVE6,"InputCustomHot",WS_TABSTOP,234,78,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 6:",IDC_LABEL_UP7,198,90,30,12 - CONTROL "",IDC_SAVE7,"InputCustomHot",WS_TABSTOP,234,90,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 7:",IDC_LABEL_UP8,198,102,30,12 - CONTROL "",IDC_SAVE8,"InputCustomHot",WS_TABSTOP,234,102,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 8:",IDC_LABEL_UP9,198,114,30,12 - CONTROL "",IDC_SAVE9,"InputCustomHot",WS_TABSTOP,234,114,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 9:",IDC_LABEL_UP10,198,126,30,12 - CONTROL "",IDC_SAVE10,"InputCustomHot",WS_TABSTOP,234,126,60,11,WS_EX_CLIENTEDGE - RTEXT "Save 0:",IDC_LABEL_UP11,198,18,30,12 - CONTROL "",IDC_SAVE11,"InputCustomHot",WS_TABSTOP,336,18,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 1:",IDC_LABEL_UP12,300,30,30,12 - CONTROL "",IDC_SAVE12,"InputCustomHot",WS_TABSTOP,336,30,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 2:",IDC_LABEL_UP13,300,42,30,12 - CONTROL "",IDC_SAVE13,"InputCustomHot",WS_TABSTOP,336,42,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 3:",IDC_LABEL_UP14,300,54,30,12 - CONTROL "",IDC_SAVE14,"InputCustomHot",WS_TABSTOP,336,54,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 4:",IDC_LABEL_UP15,300,66,30,12 - CONTROL "",IDC_SAVE15,"InputCustomHot",WS_TABSTOP,336,66,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 5:",IDC_LABEL_UP16,300,78,30,12 - CONTROL "",IDC_SAVE16,"InputCustomHot",WS_TABSTOP,336,78,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 6:",IDC_LABEL_UP17,300,90,30,12 - CONTROL "",IDC_SAVE17,"InputCustomHot",WS_TABSTOP,336,90,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 7:",IDC_LABEL_UP18,300,102,30,12 - CONTROL "",IDC_SAVE18,"InputCustomHot",WS_TABSTOP,336,102,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 8:",IDC_LABEL_UP19,300,114,30,12 - CONTROL "",IDC_SAVE19,"InputCustomHot",WS_TABSTOP,336,114,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 9:",IDC_LABEL_UP20,300,126,30,12 - CONTROL "",IDC_SAVE20,"InputCustomHot",WS_TABSTOP,336,126,60,11,WS_EX_CLIENTEDGE - RTEXT "Load 0:",IDC_LABEL_UP21,300,18,30,12 - RTEXT "Fast-forward:",IDC_LABEL_HK5,12,78,72,12 - RTEXT "Show pressed keys:",IDC_LABEL_HK10,12,138,72,12 - RTEXT "Save screenshot:",IDC_LABEL_HK13,12,174,72,12 - RTEXT "Slot -:",IDC_LABEL_UP22,198,150,30,12 - CONTROL "",IDC_SLOTMINUS,"InputCustomHot",WS_TABSTOP,234,150,60,11,WS_EX_CLIENTEDGE - RTEXT "Slot +:",IDC_LABEL_UP23,300,150,30,12 - CONTROL "",IDC_SLOTPLUS,"InputCustomHot",WS_TABSTOP,336,150,60,11,WS_EX_CLIENTEDGE - RTEXT "Save #:",IDC_LABEL_UP24,198,162,30,12 - CONTROL "",IDC_SLOTSAVE,"InputCustomHot",WS_TABSTOP,234,162,60,11,WS_EX_CLIENTEDGE - RTEXT "Load #:",IDC_LABEL_UP25,300,162,30,12 - CONTROL "",IDC_SLOTLOAD,"InputCustomHot",WS_TABSTOP,336,162,60,11,WS_EX_CLIENTEDGE - LTEXT "Blue means the hotkey is already mapped. Pink means it conflicts with a game button. Red means it's reserved by Windows. A hotkey can be disabled using Escape.",IDC_LABEL_BLUE,192,186,78,12,NOT WS_VISIBLE + RTEXT "Frame advance:",IDC_LABEL_HK4,12,75,72,12 + RTEXT "Speed -:",IDC_LABEL_HK2,12,45,72,12 + RTEXT "Pause:",IDC_LABEL_HK3,12,60,72,12 + RTEXT "Frameskip +:",IDC_LABEL_HK6,12,105,72,12 + RTEXT "Movie frame count:",IDC_LABEL_HK11,12,180,72,12 + RTEXT "SuperScope turbo:",IDC_LABEL_HK8,12,135,72,12 + RTEXT "Movie read-only:",IDC_LABEL_HK12,12,195,72,12 + RTEXT "SuperScope pause:",IDC_LABEL_HK9,12,150,72,12 + RTEXT "Frameskip -:",IDC_LABEL_HK7,12,120,72,12 + CONTROL "",IDC_HOTKEY1,"InputCustomHot",WS_TABSTOP,90,30,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY2,"InputCustomHot",WS_TABSTOP,90,45,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY3,"InputCustomHot",WS_TABSTOP,90,60,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY4,"InputCustomHot",WS_TABSTOP,90,75,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY5,"InputCustomHot",WS_TABSTOP,90,90,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY6,"InputCustomHot",WS_TABSTOP,90,105,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY7,"InputCustomHot",WS_TABSTOP,90,120,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY8,"InputCustomHot",WS_TABSTOP,90,135,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY9,"InputCustomHot",WS_TABSTOP,90,150,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY10,"InputCustomHot",WS_TABSTOP,90,165,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY11,"InputCustomHot",WS_TABSTOP,90,180,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY12,"InputCustomHot",WS_TABSTOP,90,195,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_HOTKEY13,"InputCustomHot",WS_TABSTOP,90,210,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_SAVE1,"InputCustomHot",WS_TABSTOP,217,30,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 1:",IDC_LABEL_UP2,181,45,30,12 + CONTROL "",IDC_SAVE2,"InputCustomHot",WS_TABSTOP,217,45,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 2:",IDC_LABEL_UP3,181,60,30,12 + CONTROL "",IDC_SAVE3,"InputCustomHot",WS_TABSTOP,217,60,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 3:",IDC_LABEL_UP4,181,75,30,12 + CONTROL "",IDC_SAVE4,"InputCustomHot",WS_TABSTOP,217,75,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 4:",IDC_LABEL_UP5,181,90,30,12 + CONTROL "",IDC_SAVE5,"InputCustomHot",WS_TABSTOP,217,90,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 5:",IDC_LABEL_UP6,181,105,30,12 + CONTROL "",IDC_SAVE6,"InputCustomHot",WS_TABSTOP,217,105,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 6:",IDC_LABEL_UP7,181,120,30,12 + CONTROL "",IDC_SAVE7,"InputCustomHot",WS_TABSTOP,217,120,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 7:",IDC_LABEL_UP8,181,135,30,12 + CONTROL "",IDC_SAVE8,"InputCustomHot",WS_TABSTOP,217,135,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 8:",IDC_LABEL_UP9,181,150,30,12 + CONTROL "",IDC_SAVE9,"InputCustomHot",WS_TABSTOP,217,150,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 9:",IDC_LABEL_UP10,181,165,30,12 + CONTROL "",IDC_SAVE10,"InputCustomHot",WS_TABSTOP,217,165,60,12,WS_EX_CLIENTEDGE + RTEXT "Save 0:",IDC_LABEL_UP11,181,30,30,12 + CONTROL "",IDC_SAVE11,"InputCustomHot",WS_TABSTOP,336,30,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 1:",IDC_LABEL_UP12,300,45,30,12 + CONTROL "",IDC_SAVE12,"InputCustomHot",WS_TABSTOP,336,45,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 2:",IDC_LABEL_UP13,300,60,30,12 + CONTROL "",IDC_SAVE13,"InputCustomHot",WS_TABSTOP,336,60,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 3:",IDC_LABEL_UP14,300,75,30,12 + CONTROL "",IDC_SAVE14,"InputCustomHot",WS_TABSTOP,336,75,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 4:",IDC_LABEL_UP15,300,90,30,12 + CONTROL "",IDC_SAVE15,"InputCustomHot",WS_TABSTOP,336,90,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 5:",IDC_LABEL_UP16,300,105,30,12 + CONTROL "",IDC_SAVE16,"InputCustomHot",WS_TABSTOP,336,105,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 6:",IDC_LABEL_UP17,300,120,30,12 + CONTROL "",IDC_SAVE17,"InputCustomHot",WS_TABSTOP,336,120,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 7:",IDC_LABEL_UP18,300,135,30,12 + CONTROL "",IDC_SAVE18,"InputCustomHot",WS_TABSTOP,336,135,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 8:",IDC_LABEL_UP19,300,150,30,12 + CONTROL "",IDC_SAVE19,"InputCustomHot",WS_TABSTOP,336,150,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 9:",IDC_LABEL_UP20,300,165,30,12 + CONTROL "",IDC_SAVE20,"InputCustomHot",WS_TABSTOP,336,165,60,12,WS_EX_CLIENTEDGE + RTEXT "Load 0:",IDC_LABEL_UP21,300,30,30,12 + RTEXT "Fast-forward:",IDC_LABEL_HK5,12,90,72,12 + RTEXT "Show pressed keys:",IDC_LABEL_HK10,12,165,72,12 + RTEXT "Save screenshot:",IDC_LABEL_HK13,12,210,72,12 + RTEXT "Slot -:",IDC_LABEL_UP22,181,210,30,12 + CONTROL "",IDC_SLOTMINUS,"InputCustomHot",WS_TABSTOP,217,210,60,12,WS_EX_CLIENTEDGE + RTEXT "Slot +:",IDC_LABEL_UP23,300,210,30,12 + CONTROL "",IDC_SLOTPLUS,"InputCustomHot",WS_TABSTOP,336,210,60,12,WS_EX_CLIENTEDGE + RTEXT "Save #:",IDC_LABEL_UP24,181,225,30,12 + CONTROL "",IDC_SLOTSAVE,"InputCustomHot",WS_TABSTOP,217,225,60,12,WS_EX_CLIENTEDGE + RTEXT "Load #:",IDC_LABEL_UP25,300,225,30,12 + CONTROL "",IDC_SLOTLOAD,"InputCustomHot",WS_TABSTOP,336,225,60,12,WS_EX_CLIENTEDGE + LTEXT "Blue means the hotkey is already mapped. Pink means it conflicts with a game button. Red means it's reserved by Windows. A hotkey can be disabled using Escape.",IDC_LABEL_BLUE,7,256,269,34 COMBOBOX IDC_HKCOMBO,6,6,60,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "",IDC_STATIC,6,18,180,174,0,WS_EX_TRANSPARENT - GROUPBOX "Save States",IDC_STATIC,192,6,210,174,0,WS_EX_TRANSPARENT + GROUPBOX "",IDC_STATIC,6,21,149,226,0,WS_EX_TRANSPARENT + GROUPBOX "Save States",IDC_STATIC,161,21,241,226,0,WS_EX_TRANSPARENT + RTEXT "Save Dialog:",IDC_LABEL_UP26,165,195,46,12 + CONTROL "",IDC_DIALOGSAVE,"InputCustomHot",WS_TABSTOP,217,195,60,12,WS_EX_CLIENTEDGE + CONTROL "",IDC_DIALOGLOAD,"InputCustomHot",WS_TABSTOP,336,195,60,12,WS_EX_CLIENTEDGE + RTEXT "Load Dialog:",IDC_LABEL_UP27,284,195,46,12 + CONTROL "",IDC_BANKMINUS,"InputCustomHot",WS_TABSTOP,217,180,60,12,WS_EX_CLIENTEDGE + RTEXT "Bank -:",IDC_LABEL_UP28,165,180,46,12 + CONTROL "",IDC_BANKPLUS,"InputCustomHot",WS_TABSTOP,336,180,60,12,WS_EX_CLIENTEDGE + RTEXT "Bank +:",IDC_LABEL_UP29,284,180,46,12 + CONTROL "",IDC_HOTKEY14,"InputCustomHot",WS_TABSTOP,89,225,60,12,WS_EX_CLIENTEDGE + RTEXT "Save screenshot:",IDC_LABEL_HK14,11,225,72,12 END IDD_MULTICART DIALOGEX 0, 0, 390, 90 @@ -592,6 +611,14 @@ END #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN + IDD_DIALOG_LOAD_PREVIEW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 560 + TOPMARGIN, 7 + BOTTOMMARGIN, 240 + END + IDD_SOUND_OPTS, DIALOG BEGIN LEFTMARGIN, 7 @@ -711,10 +738,9 @@ BEGIN IDD_KEYCUSTOM, DIALOG BEGIN - RIGHTMARGIN, 406 - VERTGUIDE, 72 - VERTGUIDE, 92 - BOTTOMMARGIN, 200 + RIGHTMARGIN, 407 + VERTGUIDE, 90 + BOTTOMMARGIN, 290 END IDD_MULTICART, DIALOG @@ -903,186 +929,169 @@ END // Menu // -IDR_MENU_US MENU +IDR_MENU_US MENUEX BEGIN - POPUP "&File" + POPUP "&File", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "L&oad Game...\tCtrl+O", ID_FILE_LOAD_GAME - POPUP "Recent &Games" + MENUITEM "L&oad Game...\tCtrl+O", ID_FILE_LOAD_GAME,MFT_STRING,MFS_ENABLED + POPUP "Recent &Games", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "Dummy", ID_RECENT_DUMMY, INACTIVE + MENUITEM "Dummy", ID_RECENT_DUMMY,MFT_STRING,MFS_GRAYED END - POPUP "&Save Game Position" + MENUITEM "Load MultiCart...", ID_FILE_LOADMULTICART,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + POPUP "&Save Game Position", ID_FILE_SAVE_POPUP,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "Slot #&0", ID_FILE_SAVE0 - MENUITEM "Slot #&1", ID_FILE_SAVE1 - MENUITEM "Slot #&2", ID_FILE_SAVE2 - MENUITEM "Slot #&3", ID_FILE_SAVE3 - MENUITEM "Slot #&4", ID_FILE_SAVE4 - MENUITEM "Slot #&5", ID_FILE_SAVE5 - MENUITEM "Slot #&6", ID_FILE_SAVE6 - MENUITEM "Slot #&7", ID_FILE_SAVE7 - MENUITEM "Slot #&8", ID_FILE_SAVE8 - MENUITEM "Slot #&9", ID_FILE_SAVE9 - MENUITEM SEPARATOR - MENUITEM "&Select File", ID_FILE_SAVE_FILE + MENUITEM MFT_SEPARATOR + MENUITEM "&Select File", ID_FILE_SAVE_FILE,MFT_STRING,MFS_ENABLED END - POPUP "&Load Game Position" + POPUP "&Load Game Position", ID_FILE_LOAD_POPUP,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "Slot #&0", ID_FILE_LOAD0 - MENUITEM "Slot #&1", ID_FILE_LOAD1 - MENUITEM "Slot #&2", ID_FILE_LOAD2 - MENUITEM "Slot #&3", ID_FILE_LOAD3 - MENUITEM "Slot #&4", ID_FILE_LOAD4 - MENUITEM "Slot #&5", ID_FILE_LOAD5 - MENUITEM "Slot #&6", ID_FILE_LOAD6 - MENUITEM "Slot #&7", ID_FILE_LOAD7 - MENUITEM "Slot #&8", ID_FILE_LOAD8 - MENUITEM "Slot #&9", ID_FILE_LOAD9 - MENUITEM SEPARATOR - MENUITEM "Oops File", ID_FILE_LOAD_OOPS - MENUITEM SEPARATOR - MENUITEM "&Select File", ID_FILE_LOAD_FILE + MENUITEM MFT_SEPARATOR + MENUITEM "Oops File", ID_FILE_LOAD_OOPS,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "&Select File", ID_FILE_LOAD_FILE,MFT_STRING,MFS_ENABLED END - MENUITEM "Load MultiCart...", ID_FILE_LOADMULTICART - MENUITEM SEPARATOR - POPUP "Save Other" + MENUITEM "&Save with Preview", ID_FILE_SAVE_PREVIEW,MFT_STRING,MFS_ENABLED + MENUITEM "&Load with Preview", ID_FILE_LOAD_PREVIEW,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + POPUP "Save Other", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "S&ave SPC Data", ID_FILE_SAVE_SPC_DATA - MENUITEM "Save Screenshot", ID_SAVESCREENSHOT - MENUITEM "Sa&ve S-RAM Data", ID_FILE_SAVE_SRAM_DATA - MENUITEM "Save Memory Pack", ID_SAVEMEMPACK + MENUITEM "S&ave SPC Data", ID_FILE_SAVE_SPC_DATA,MFT_STRING,MFS_ENABLED + MENUITEM "Save Screenshot", ID_SAVESCREENSHOT,MFT_STRING,MFS_ENABLED + MENUITEM "Sa&ve S-RAM Data", ID_FILE_SAVE_SRAM_DATA,MFT_STRING,MFS_ENABLED + MENUITEM "Save Memory Pack", ID_SAVEMEMPACK,MFT_STRING,MFS_ENABLED END - MENUITEM "ROM Information...", IDM_ROM_INFO - MENUITEM SEPARATOR - MENUITEM "Movie Play...", ID_FILE_MOVIE_PLAY - MENUITEM "Movie Record...", ID_FILE_MOVIE_RECORD - MENUITEM "Movie Stop", ID_FILE_MOVIE_STOP - MENUITEM SEPARATOR - MENUITEM "AVI Recording", ID_FILE_AVI_RECORDING - MENUITEM SEPARATOR - MENUITEM "&Reset Game", ID_FILE_RESET - MENUITEM "E&xit\tAlt+F4", ID_FILE_EXIT + MENUITEM "ROM Information...", IDM_ROM_INFO,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Movie Play...", ID_FILE_MOVIE_PLAY,MFT_STRING,MFS_ENABLED + MENUITEM "Movie Record...", ID_FILE_MOVIE_RECORD,MFT_STRING,MFS_ENABLED + MENUITEM "Movie Stop", ID_FILE_MOVIE_STOP,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "AVI Recording", ID_FILE_AVI_RECORDING,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "&Reset Game", ID_FILE_RESET,MFT_STRING,MFS_ENABLED + MENUITEM "E&xit\tAlt+F4", ID_FILE_EXIT,MFT_STRING,MFS_ENABLED END - POPUP "&Emulation" + POPUP "&Emulation", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Pause", ID_FILE_PAUSE - MENUITEM "Pause &When Inactive", ID_EMULATION_PAUSEWHENINACTIVE - MENUITEM "&Frame Advance", ID_FRAME_ADVANCE - MENUITEM SEPARATOR - MENUITEM "&Hacks...", ID_EMULATION_HACKS - MENUITEM "&Settings...\tAlt+F8", ID_OPTIONS_SETTINGS + MENUITEM "&Pause", ID_FILE_PAUSE,MFT_STRING,MFS_ENABLED + MENUITEM "Pause &When Inactive", ID_EMULATION_PAUSEWHENINACTIVE,MFT_STRING,MFS_ENABLED + MENUITEM "&Frame Advance", ID_FRAME_ADVANCE,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "&Hacks...", ID_EMULATION_HACKS,MFT_STRING,MFS_ENABLED + MENUITEM "&Settings...\tAlt+F8", ID_OPTIONS_SETTINGS,MFT_STRING,MFS_ENABLED END - POPUP "&Input" + POPUP "&Input", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Input Configuration...\tAlt+F7", 40022 - MENUITEM "&Customize Hotkeys...\tAlt+F9", ID_OPTIONS_KEYCUSTOM - MENUITEM SEPARATOR - MENUITEM "Enable Background Input", ID_EMULATION_BACKGROUNDINPUT - MENUITEM "Background Keyboard Hotkeys", ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS - MENUITEM SEPARATOR - MENUITEM "Detect gamepad changes", ID_INPUT_DETECTGAMEPADCHANGES - MENUITEM SEPARATOR - MENUITEM "Use SNES Joypad(s)", IDM_SNES_JOYPAD - MENUITEM "Use SNES Mouse", IDM_MOUSE_TOGGLE - MENUITEM "Use Super Scope", IDM_SCOPE_TOGGLE - MENUITEM "Use Super Multitap (5-player)", IDM_ENABLE_MULTITAP - MENUITEM "Use Konami Justifier", IDM_JUSTIFIER - MENUITEM "Use Mouse in alternate port", IDM_MOUSE_SWAPPED - MENUITEM "Use Multitaps (8-player)", IDM_MULTITAP8 - MENUITEM "Use Dual Justifiers", IDM_JUSTIFIERS - MENUITEM "Use M.A.C.S. Rifle", IDM_MACSRIFLE_TOGGLE + MENUITEM "&Input Configuration...\tAlt+F7", 40022,MFT_STRING,MFS_ENABLED + MENUITEM "&Customize Hotkeys...\tAlt+F9", ID_OPTIONS_KEYCUSTOM,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Enable Background Input", ID_EMULATION_BACKGROUNDINPUT,MFT_STRING,MFS_ENABLED + MENUITEM "Background Keyboard Hotkeys", ID_INPUT_BACKGROUNDKEYBOARDHOTKEYS,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Detect gamepad changes", ID_INPUT_DETECTGAMEPADCHANGES,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Use SNES Joypad(s)", IDM_SNES_JOYPAD,MFT_STRING,MFS_ENABLED + MENUITEM "Use SNES Mouse", IDM_MOUSE_TOGGLE,MFT_STRING,MFS_ENABLED + MENUITEM "Use Super Scope", IDM_SCOPE_TOGGLE,MFT_STRING,MFS_ENABLED + MENUITEM "Use Super Multitap (5-player)", IDM_ENABLE_MULTITAP,MFT_STRING,MFS_ENABLED + MENUITEM "Use Konami Justifier", IDM_JUSTIFIER,MFT_STRING,MFS_ENABLED + MENUITEM "Use Mouse in alternate port", IDM_MOUSE_SWAPPED,MFT_STRING,MFS_ENABLED + MENUITEM "Use Multitaps (8-player)", IDM_MULTITAP8,MFT_STRING,MFS_ENABLED + MENUITEM "Use Dual Justifiers", IDM_JUSTIFIERS,MFT_STRING,MFS_ENABLED + MENUITEM "Use M.A.C.S. Rifle", IDM_MACSRIFLE_TOGGLE,MFT_STRING,MFS_ENABLED END - POPUP "&Sound" + POPUP "&Sound", 0,MFT_STRING,MFS_ENABLED BEGIN - POPUP "&Playback Rate" + POPUP "&Playback Rate", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Mute Sound", ID_SOUND_NOSOUND - MENUITEM "8KHz", ID_SOUND_8000HZ - MENUITEM "11KHz", ID_SOUND_11025HZ - MENUITEM "16KHz", ID_SOUND_16000HZ - MENUITEM "22KHz", ID_SOUND_22050HZ - MENUITEM "30KHz", ID_SOUND_30000HZ - MENUITEM "32KHz", ID_SOUND_32000HZ - MENUITEM "35KHz", ID_SOUND_35000HZ - MENUITEM "44KHz", ID_SOUND_44100HZ - MENUITEM "48KHz", ID_SOUND_48000HZ + MENUITEM "&Mute Sound", ID_SOUND_NOSOUND,MFT_STRING,MFS_ENABLED + MENUITEM "8KHz", ID_SOUND_8000HZ,MFT_STRING,MFS_ENABLED + MENUITEM "11KHz", ID_SOUND_11025HZ,MFT_STRING,MFS_ENABLED + MENUITEM "16KHz", ID_SOUND_16000HZ,MFT_STRING,MFS_ENABLED + MENUITEM "22KHz", ID_SOUND_22050HZ,MFT_STRING,MFS_ENABLED + MENUITEM "30KHz", ID_SOUND_30000HZ,MFT_STRING,MFS_ENABLED + MENUITEM "32KHz", ID_SOUND_32000HZ,MFT_STRING,MFS_ENABLED + MENUITEM "35KHz", ID_SOUND_35000HZ,MFT_STRING,MFS_ENABLED + MENUITEM "44KHz", ID_SOUND_44100HZ,MFT_STRING,MFS_ENABLED + MENUITEM "48KHz", ID_SOUND_48000HZ,MFT_STRING,MFS_ENABLED END - POPUP "&Buffer Length" + POPUP "&Buffer Length", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "16ms", ID_SOUND_16MS - MENUITEM "32ms", ID_SOUND_32MS - MENUITEM "48ms", ID_SOUND_48MS - MENUITEM "64ms", ID_SOUND_64MS - MENUITEM "80ms", ID_SOUND_80MS - MENUITEM "96ms", ID_SOUND_96MS - MENUITEM "112ms", ID_SOUND_112MS - MENUITEM "128ms", ID_SOUND_128MS - MENUITEM "144ms", ID_SOUND_144MS - MENUITEM "160ms", ID_SOUND_160MS - MENUITEM "176ms", ID_SOUND_176MS - MENUITEM "192ms", ID_SOUND_192MS - MENUITEM "208ms", ID_SOUND_208MS + MENUITEM "16ms", ID_SOUND_16MS,MFT_STRING,MFS_ENABLED + MENUITEM "32ms", ID_SOUND_32MS,MFT_STRING,MFS_ENABLED + MENUITEM "48ms", ID_SOUND_48MS,MFT_STRING,MFS_ENABLED + MENUITEM "64ms", ID_SOUND_64MS,MFT_STRING,MFS_ENABLED + MENUITEM "80ms", ID_SOUND_80MS,MFT_STRING,MFS_ENABLED + MENUITEM "96ms", ID_SOUND_96MS,MFT_STRING,MFS_ENABLED + MENUITEM "112ms", ID_SOUND_112MS,MFT_STRING,MFS_ENABLED + MENUITEM "128ms", ID_SOUND_128MS,MFT_STRING,MFS_ENABLED + MENUITEM "144ms", ID_SOUND_144MS,MFT_STRING,MFS_ENABLED + MENUITEM "160ms", ID_SOUND_160MS,MFT_STRING,MFS_ENABLED + MENUITEM "176ms", ID_SOUND_176MS,MFT_STRING,MFS_ENABLED + MENUITEM "192ms", ID_SOUND_192MS,MFT_STRING,MFS_ENABLED + MENUITEM "208ms", ID_SOUND_208MS,MFT_STRING,MFS_ENABLED END - POPUP "&Channels" + POPUP "&Channels", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "Channel &1", ID_CHANNELS_CHANNEL1 - MENUITEM "Channel &2", ID_CHANNELS_CHANNEL2 - MENUITEM "Channel &3", ID_CHANNELS_CHANNEL3 - MENUITEM "Channel &4", ID_CHANNELS_CHANNEL4 - MENUITEM "Channel &5", ID_CHANNELS_CHANNEL5 - MENUITEM "Channel &6", ID_CHANNELS_CHANNEL6 - MENUITEM "Channel &7", ID_CHANNELS_CHANNEL7 - MENUITEM "Channel &8", ID_CHANNELS_CHANNEL8 - MENUITEM SEPARATOR - MENUITEM "Enable All", ID_CHANNELS_ENABLEALL + MENUITEM "Channel &1", ID_CHANNELS_CHANNEL1,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &2", ID_CHANNELS_CHANNEL2,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &3", ID_CHANNELS_CHANNEL3,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &4", ID_CHANNELS_CHANNEL4,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &5", ID_CHANNELS_CHANNEL5,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &6", ID_CHANNELS_CHANNEL6,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &7", ID_CHANNELS_CHANNEL7,MFT_STRING,MFS_ENABLED + MENUITEM "Channel &8", ID_CHANNELS_CHANNEL8,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "Enable All", ID_CHANNELS_ENABLEALL,MFT_STRING,MFS_ENABLED END - MENUITEM SEPARATOR - MENUITEM "S&ync Sound\tAlt+]", ID_SOUND_SYNC - MENUITEM "&Settings...\tAlt+T", ID_SOUND_OPTIONS + MENUITEM MFT_SEPARATOR + MENUITEM "S&ync Sound\tAlt+]", ID_SOUND_SYNC,MFT_STRING,MFS_ENABLED + MENUITEM "&Settings...\tAlt+T", ID_SOUND_OPTIONS,MFT_STRING,MFS_ENABLED END - POPUP "&Video" + POPUP "&Video", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Hide Menubar\tEsc", ID_WINDOW_HIDEMENUBAR - MENUITEM "&Full Screen\tAlt+Enter", ID_WINDOW_FULLSCREEN - POPUP "&Window Size" + MENUITEM "&Hide Menubar\tEsc", ID_WINDOW_HIDEMENUBAR,MFT_STRING,MFS_ENABLED + MENUITEM "&Full Screen\tAlt+Enter", ID_WINDOW_FULLSCREEN,MFT_STRING,MFS_ENABLED + POPUP "&Window Size", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&1x", ID_WINDOW_SIZE_1X - MENUITEM "&2x", ID_WINDOW_SIZE_2X - MENUITEM "&3x", ID_WINDOW_SIZE_3X - MENUITEM "&4x", ID_WINDOW_SIZE_4X + MENUITEM "&1x", ID_WINDOW_SIZE_1X,MFT_STRING,MFS_ENABLED + MENUITEM "&2x", ID_WINDOW_SIZE_2X,MFT_STRING,MFS_ENABLED + MENUITEM "&3x", ID_WINDOW_SIZE_3X,MFT_STRING,MFS_ENABLED + MENUITEM "&4x", ID_WINDOW_SIZE_4X,MFT_STRING,MFS_ENABLED END - MENUITEM SEPARATOR - MENUITEM "&Stretch Image\tAlt+Backspace", ID_WINDOW_STRETCH - MENUITEM "&Maintain Aspect Ratio", ID_WINDOW_ASPECTRATIO - MENUITEM "&Bilinear Filtering", ID_WINDOW_BILINEAR - MENUITEM "Show Frame &Rate", ID_VIDEO_SHOWFRAMERATE - MENUITEM SEPARATOR - MENUITEM "&Display Configuration...\tAlt+F5", ID_OPTIONS_DISPLAY + MENUITEM MFT_SEPARATOR + MENUITEM "&Stretch Image\tAlt+Backspace", ID_WINDOW_STRETCH,MFT_STRING,MFS_ENABLED + MENUITEM "&Maintain Aspect Ratio", ID_WINDOW_ASPECTRATIO,MFT_STRING,MFS_ENABLED + MENUITEM "&Bilinear Filtering", ID_WINDOW_BILINEAR,MFT_STRING,MFS_ENABLED + MENUITEM "Show Frame &Rate", ID_VIDEO_SHOWFRAMERATE,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "&Display Configuration...\tAlt+F5", ID_OPTIONS_DISPLAY,MFT_STRING,MFS_ENABLED END - POPUP "&Cheat" + POPUP "&Cheat", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Game Genie, Pro-Action Replay Codes\tAlt+G", ID_CHEAT_ENTER - MENUITEM "&Search for New Cheats", ID_CHEAT_SEARCH_MODAL - MENUITEM "Search for New Cheats (active)\tAlt+A", 40064 - MENUITEM "&Apply Cheats", ID_CHEAT_APPLY, CHECKED + MENUITEM "&Game Genie, Pro-Action Replay Codes\tAlt+G", ID_CHEAT_ENTER,MFT_STRING,MFS_ENABLED + MENUITEM "&Search for New Cheats", ID_CHEAT_SEARCH_MODAL,MFT_STRING,MFS_ENABLED + MENUITEM "Search for New Cheats (active)\tAlt+A", 40064,MFT_STRING,MFS_ENABLED + MENUITEM "&Apply Cheats", ID_CHEAT_APPLY,MFT_STRING,MFS_CHECKED END - POPUP "&Netplay" + POPUP "&Netplay", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&Connect to Server...", ID_NETPLAY_CONNECT - MENUITEM "&Disconnect from Server", ID_NETPLAY_DISCONNECT - MENUITEM SEPARATOR - MENUITEM "&Act as Server", ID_NETPLAY_SERVER - MENUITEM "&Re-sync all Clients Using Freeze File Now", ID_NETPLAY_SYNC - MENUITEM "&Send ROM Image to Clients Now", ID_NETPLAY_ROM - MENUITEM "S&end ROM Image to Clients", ID_NETPLAY_SEND_ROM_ON_CONNECT - MENUITEM "S&ync Using Reset Game", ID_NETPLAY_SYNC_BY_RESET, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Options...", ID_NETPLAY_OPTIONS + MENUITEM "&Connect to Server...", ID_NETPLAY_CONNECT,MFT_STRING,MFS_ENABLED + MENUITEM "&Disconnect from Server", ID_NETPLAY_DISCONNECT,MFT_STRING,MFS_ENABLED + MENUITEM MFT_SEPARATOR + MENUITEM "&Act as Server", ID_NETPLAY_SERVER,MFT_STRING,MFS_ENABLED + MENUITEM "&Re-sync all Clients Using Freeze File Now", ID_NETPLAY_SYNC,MFT_STRING,MFS_ENABLED + MENUITEM "&Send ROM Image to Clients Now", ID_NETPLAY_ROM,MFT_STRING,MFS_ENABLED + MENUITEM "S&end ROM Image to Clients", ID_NETPLAY_SEND_ROM_ON_CONNECT,MFT_STRING,MFS_ENABLED + MENUITEM "S&ync Using Reset Game", ID_NETPLAY_SYNC_BY_RESET,MFT_STRING,MFS_CHECKED + MENUITEM MFT_SEPARATOR + MENUITEM "&Options...", ID_NETPLAY_OPTIONS,MFT_STRING,MFS_ENABLED END - POPUP "&Help" + POPUP "&Help", 0,MFT_STRING,MFS_ENABLED BEGIN - MENUITEM "&About...", ID_HELP_ABOUT + MENUITEM "&About...", ID_HELP_ABOUT,MFT_STRING,MFS_ENABLED END END @@ -1182,6 +1191,11 @@ BEGIN 0 END +IDD_DIALOG_LOAD_PREVIEW AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // diff --git a/win32/snes9xw.vcxproj b/win32/snes9xw.vcxproj index 8ae8d6ea..c4810078 100644 --- a/win32/snes9xw.vcxproj +++ b/win32/snes9xw.vcxproj @@ -117,7 +117,7 @@ Disabled - $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)glslang\src + $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\shaders\glslang _DEBUG;ALLOW_CPU_OVERCLOCK;HAVE_LIBPNG;JMA_SUPPORT;ZLIB;UNZIP_SUPPORT;__WIN32__;NETPLAY_SUPPORT;D3D_DEBUG_INFO;DIRECTDRAW_SUPPORT;USE_SLANG;%(PreprocessorDefinitions) MultiThreadedDebug Default @@ -166,7 +166,7 @@ Disabled - $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)glslang\src + $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\shaders\glslang _DEBUG;ALLOW_CPU_OVERCLOCK;HAVE_LIBPNG;JMA_SUPPORT;ZLIB;UNZIP_SUPPORT;__WIN32__;NETPLAY_SUPPORT;D3D_DEBUG_INFO;DIRECTDRAW_SUPPORT;USE_SLANG;%(PreprocessorDefinitions) MultiThreadedDebug Default @@ -220,7 +220,7 @@ Speed true true - $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)glslang\src;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\shaders\glslang;%(AdditionalIncludeDirectories) NDEBUG;ALLOW_CPU_OVERCLOCK;HAVE_LIBPNG;JMA_SUPPORT;ZLIB;UNZIP_SUPPORT;__WIN32__;NETPLAY_SUPPORT;DIRECTDRAW_SUPPORT;USE_SLANG;%(PreprocessorDefinitions) true MultiThreaded @@ -273,7 +273,7 @@ Speed true true - $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)glslang\src;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\;$(ProjectDir)..\..\;$(ProjectDir)zlib\src;$(ProjectDir)..\unzip;$(ProjectDir)libpng\src;$(ProjectDir)..\apu\bapu;$(ProjectDir)..\shaders\glslang;%(AdditionalIncludeDirectories) NDEBUG;ALLOW_CPU_OVERCLOCK;HAVE_LIBPNG;JMA_SUPPORT;ZLIB;UNZIP_SUPPORT;__WIN32__;NETPLAY_SUPPORT;DIRECTDRAW_SUPPORT;USE_SLANG;%(PreprocessorDefinitions) true MultiThreaded @@ -438,6 +438,7 @@ + @@ -582,6 +583,7 @@ + diff --git a/win32/snes9xw.vcxproj.filters b/win32/snes9xw.vcxproj.filters index 6d61a587..fa98da5b 100644 --- a/win32/snes9xw.vcxproj.filters +++ b/win32/snes9xw.vcxproj.filters @@ -285,6 +285,9 @@ Filter + + GUI + @@ -626,6 +629,9 @@ Filter + + GUI + @@ -886,4 +892,4 @@ - + \ No newline at end of file diff --git a/win32/wconfig.cpp b/win32/wconfig.cpp index 61b68bfc..e04c5ae5 100644 --- a/win32/wconfig.cpp +++ b/win32/wconfig.cpp @@ -118,6 +118,7 @@ void WinSetDefaultValues () GUI.Language=0; GUI.AllowSoundSync = true; + GUI.CurrentSaveBank = 0; } @@ -276,6 +277,13 @@ const TCHAR* WinParseCommandLineAndLoadConfigFile (TCHAR *line) ReleaseMutex(configMutex); CloseHandle(configMutex); + // check some additional common help switches + for (int i = 0; i < count; i++) + { + if(!strcasecmp(parameters[i], "/?") || !strcasecmp(parameters[i], "-h")) + S9xUsage(); + } + const char* rf = S9xParseArgs (parameters, count); if(rf) // save rom_filename as TCHAR if available @@ -917,7 +925,7 @@ void WinRegisterConfigItems() ADDN(Save[0],SaveSlot0); ADDN(Save[1],SaveSlot1); ADDN(Save[2],SaveSlot2); ADDN(Save[3],SaveSlot3); ADDN(Save[4],SaveSlot4); ADDN(Save[5],SaveSlot5); ADDN(Save[6],SaveSlot6); ADDN(Save[7],SaveSlot7); ADDN(Save[8],SaveSlot8); ADDN(Save[9],SaveSlot9); ADDN(Load[0],LoadSlot0); ADDN(Load[1],LoadSlot1); ADDN(Load[2],LoadSlot2); ADDN(Load[3],LoadSlot3); ADDN(Load[4],LoadSlot4); ADDN(Load[5],LoadSlot5); ADDN(Load[6],LoadSlot6); ADDN(Load[7],LoadSlot7); ADDN(Load[8],LoadSlot8); ADDN(Load[9],LoadSlot9); ADDN(SelectSave[0],SelectSlot0); ADDN(SelectSave[1],SelectSlot1); ADDN(SelectSave[2],SelectSlot2); ADDN(SelectSave[3],SelectSlot3); ADDN(SelectSave[4],SelectSlot4); ADDN(SelectSave[5],SelectSlot5); ADDN(SelectSave[6],SelectSlot6); ADDN(SelectSave[7],SelectSlot7); ADDN(SelectSave[8],SelectSlot8); ADDN(SelectSave[9],SelectSlot9); - ADD(SaveScreenShot); ADD(SlotPlus); ADD(SlotMinus); ADD(SlotSave); ADD(SlotLoad); + ADD(SaveScreenShot); ADD(SlotPlus); ADD(SlotMinus); ADD(SlotSave); ADD(SlotLoad); ADD(DialogSave); ADD(DialogLoad); ADD(BGL1); ADD(BGL2); ADD(BGL3); ADD(BGL4); ADD(BGL5); ADD(ClippingWindows); /*ADD(BGLHack);*/ ADD(Transparency); /*ADD(HDMA)*/; /*ADD(GLCube);*/ /*ADD(InterpMode7);*/ ADD(JoypadSwap); ADD(SwitchControllers); ADD(ResetGame); ADD(ToggleCheats); diff --git a/win32/win32_display.cpp b/win32/win32_display.cpp index cb6b2c24..c4448ef1 100644 --- a/win32/win32_display.cpp +++ b/win32/win32_display.cpp @@ -211,12 +211,6 @@ RECT CalculateDisplayRect(unsigned int sourceWidth,unsigned int sourceHeight, return drawRect; } -// we no longer support 8bit modes - no palette necessary -void S9xSetPalette( void) -{ - return; -} - bool8 S9xInitUpdate (void) { return (TRUE); diff --git a/win32/win32_sound.cpp b/win32/win32_sound.cpp index f59f1a63..d6adccd9 100644 --- a/win32/win32_sound.cpp +++ b/win32/win32_sound.cpp @@ -22,6 +22,8 @@ CWaveOut S9xWaveOut; // Interface used to access the sound output IS9xSoundOutput *S9xSoundOutput = &S9xXAudio2; +static double last_volume = 1.0; + /* ReInitSound reinitializes the sound core with current settings IN: @@ -51,6 +53,7 @@ bool ReInitSound() if(S9xSoundOutput) S9xSoundOutput->DeInitSoundOutput(); + last_volume = 1.0; return S9xInitSound(0); } @@ -95,8 +98,6 @@ called by the sound core to process generated samples */ void S9xSoundCallback(void *data) { - static double last_volume = 1.0; - // only try to change volume if we actually need to switch it double current_volume = ((Settings.TurboMode || Settings.Rewinding) ? GUI.VolumeTurbo : GUI.VolumeRegular) / 100.; if (last_volume != current_volume) { diff --git a/win32/wlanguage.h b/win32/wlanguage.h index 8657bdad..8b751f61 100644 --- a/win32/wlanguage.h +++ b/win32/wlanguage.h @@ -81,16 +81,18 @@ Nintendo is a trademark.") #define HOTKEYS_LABEL_1_1 TEXT("Speed +:") #define HOTKEYS_LABEL_1_2 TEXT("Speed -:") #define HOTKEYS_LABEL_1_3 TEXT("Pause:") -#define HOTKEYS_LABEL_1_4 TEXT("Frame advance:") +#define HOTKEYS_LABEL_1_4 TEXT("Fast-forward toggle:") #define HOTKEYS_LABEL_1_5 TEXT("Fast forward:") -#define HOTKEYS_LABEL_1_6 TEXT("Skip frames +:") -#define HOTKEYS_LABEL_1_7 TEXT("Skip frames -:") -#define HOTKEYS_LABEL_1_8 TEXT("SuperScope turbo:") -#define HOTKEYS_LABEL_1_9 TEXT("SuperScope pause:") -#define HOTKEYS_LABEL_1_10 TEXT("Show pressed keys:") -#define HOTKEYS_LABEL_1_11 TEXT("Movie frame count:") -#define HOTKEYS_LABEL_1_12 TEXT("Movie read-only:") +#define HOTKEYS_LABEL_1_6 TEXT("Rewind:") +#define HOTKEYS_LABEL_1_7 TEXT("Skip frames +:") +#define HOTKEYS_LABEL_1_8 TEXT("Skip frames -:") +#define HOTKEYS_LABEL_1_9 TEXT("Toggle mute:") +#define HOTKEYS_LABEL_1_10 TEXT("Toggle cheats:") +#define HOTKEYS_LABEL_1_11 TEXT("Quit Snes9x:") +#define HOTKEYS_LABEL_1_12 TEXT("Reset game:") #define HOTKEYS_LABEL_1_13 TEXT("Save screenshot") +#define HOTKEYS_LABEL_1_14 TEXT("Frame advance:") + #define HOTKEYS_LABEL_2_1 TEXT("Graphics layer 1:") #define HOTKEYS_LABEL_2_2 TEXT("Graphics layer 2:") #define HOTKEYS_LABEL_2_3 TEXT("Graphics layer 3:") @@ -98,12 +100,14 @@ Nintendo is a trademark.") #define HOTKEYS_LABEL_2_5 TEXT("Sprites layer:") #define HOTKEYS_LABEL_2_6 TEXT("Clipping Windows:") #define HOTKEYS_LABEL_2_7 TEXT("Transparency:") -#define HOTKEYS_LABEL_2_8 TEXT("Fast-forward toggle:") -#define HOTKEYS_LABEL_2_9 TEXT("Rewind:") +#define HOTKEYS_LABEL_2_8 TEXT("SuperScope turbo:") +#define HOTKEYS_LABEL_2_9 TEXT("SuperScope pause:") #define HOTKEYS_LABEL_2_10 TEXT("Switch controllers:") #define HOTKEYS_LABEL_2_11 TEXT("Joypad swap:") -#define HOTKEYS_LABEL_2_12 TEXT("Reset game:") -#define HOTKEYS_LABEL_2_13 TEXT("Toggle cheats:") +#define HOTKEYS_LABEL_2_12 TEXT("Show pressed keys:") +#define HOTKEYS_LABEL_2_13 TEXT("Movie frame count:") +#define HOTKEYS_LABEL_2_14 TEXT("Movie read-only:") + #define HOTKEYS_LABEL_3_1 TEXT("Turbo A mode:") #define HOTKEYS_LABEL_3_2 TEXT("Turbo B mode:") #define HOTKEYS_LABEL_3_3 TEXT("Turbo Y mode:") @@ -116,10 +120,22 @@ Nintendo is a trademark.") #define HOTKEYS_LABEL_3_10 TEXT("Turbo Up mode:") #define HOTKEYS_LABEL_3_11 TEXT("Turbo Right mode:") #define HOTKEYS_LABEL_3_12 TEXT("Turbo Down mode:") -#define HOTKEYS_LABEL_3_13 TEXT("Toggle mute:") + + +#define HOTKEYS_LABEL_4_1 TEXT("Select Slot 0:") +#define HOTKEYS_LABEL_4_2 TEXT("Select Slot 1:") +#define HOTKEYS_LABEL_4_3 TEXT("Select Slot 2:") +#define HOTKEYS_LABEL_4_4 TEXT("Select Slot 3:") +#define HOTKEYS_LABEL_4_5 TEXT("Select Slot 4:") +#define HOTKEYS_LABEL_4_6 TEXT("Select Slot 5:") +#define HOTKEYS_LABEL_4_7 TEXT("Select Slot 6:") +#define HOTKEYS_LABEL_4_8 TEXT("Select Slot 7:") +#define HOTKEYS_LABEL_4_9 TEXT("Select Slot 8:") +#define HOTKEYS_LABEL_4_10 TEXT("Select Slot 9:") #define HOTKEYS_LABEL_4_11 TEXT("Save to file:") #define HOTKEYS_LABEL_4_12 TEXT("Load from file:") -#define HOTKEYS_LABEL_4_13 TEXT("Quit Snes9x:") + + // gaming buttons and axes #define GAMEDEVICE_JOYNUMPREFIX "(J%x)" // don't change this @@ -345,7 +361,8 @@ Nintendo is a trademark.") // Save Messages -#define FREEZE_INFO_SET_SLOT_N "set slot 00%d" +#define FREEZE_INFO_SET_SLOT_N "Set save slot %03d" +#define FREEZE_INFO_SET_BANK_N "Set save bank %03d" // AVI Messages diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 1c8834d5..29e6f83a 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -35,6 +35,7 @@ #include "CCGShader.h" #include "../shaders/glsl.h" #include "CShaderParamDlg.h" +#include "CSaveLoadWithPreviewDlg.h" #include "../snes9x.h" #include "../memmap.h" #include "../cpuexec.h" @@ -115,6 +116,8 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO void S9xDetectJoypads(); +void S9xWinScanJoypads(); + #define NOTKNOWN "Unknown Company " #define HEADER_SIZE 512 #define INFO_LEN (0xFF - 0xC0) @@ -125,6 +128,8 @@ void S9xDetectJoypads(); #define TIMER_SCANJOYPADS (99999) #define NC_SEARCHDB 0x8000 +#define MAX_SWITCHABLE_HOTKEY_DIALOG_ITEMS 14 + #ifdef UNICODE #define S9XW_SHARD_PATH SHARD_PATHW #else @@ -367,16 +372,17 @@ struct SCustomKeys CustomKeys = { {0,0}, // slot minus (disabled by default) {0,0}, // slot save (disabled by default) {0,0}, // slot load (disabled by default) + {0,0}, // bank plus (disabled by default) + {0,0}, // bank minus (disabled by default) + {VK_F11,CUSTKEY_SHIFT_MASK}, // dialog save + {VK_F11,0}, // dialog load {0,0}, // background layer 1 {0,0}, // background layer 2 {0,0}, // background layer 3 {0,0}, // background layer 4 {0,0}, // sprite layer {0,0}, // Clipping Windows -// {'8',0}, // BG Layering hack {0,0}, // Transparency -// {'6',CUSTKEY_SHIFT_MASK}, // GLCube Mode -// {'9',CUSTKEY_SHIFT_MASK}, // Interpolate Mode 7 {'6',0}, // Joypad Swap {'7',0}, // Switch Controllers {VK_NEXT,CUSTKEY_SHIFT_MASK}, // Turbo A @@ -401,7 +407,7 @@ struct SCustomKeys CustomKeys = { {0,0}, // Select save slot 7 {0,0}, // Select save slot 8 {0,0}}, // Select save slot 9 - {'R',CUSTKEY_CTRL_MASK|CUSTKEY_SHIFT_MASK}, // Reset Game + {'R',CUSTKEY_CTRL_MASK|CUSTKEY_ALT_MASK}, // Reset Game {0,0}, // Toggle Cheats {0,0}, {'R',0}, // Rewind @@ -450,7 +456,8 @@ struct OpenMovieParams wchar_t Metadata[MOVIE_MAX_METADATA]; }; - +TCHAR g_bankMenuItemStrings[NUM_SAVE_BANKS][20]; +TCHAR g_saveMenuItemStrings[NUM_SAVE_BANKS * SAVE_SLOTS_PER_BANK][20]; StateManager stateMan; @@ -462,9 +469,6 @@ void DoAVIOpen(const TCHAR* filename); void DoAVIClose(int reason); void RestoreGUIDisplay (); void RestoreSNESDisplay (); -void FreezeUnfreezeDialog(bool8 freeze); -void FreezeUnfreezeSlot(int slot, bool8 freeze); -void FreezeUnfreeze (const char *filename, bool8 freeze); void CheckDirectoryIsWritable (const char *filename); static void CheckMenuStates (); static void ResetFrameTimer (); @@ -536,6 +540,17 @@ BOOL PostMenuCommand (UINT uID) return FALSE; } +HMENU GetSubMenuById(UINT uID) +{ + MENUITEMINFO mii; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_SUBMENU; + if (!GetMenuItemInfo(GUI.hMenu, uID, FALSE, &mii)) + return NULL; + return mii.hSubMenu; +} + void S9xMouseOn () { if(Settings.StopEmulation) @@ -830,18 +845,18 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) modifiers |= CUSTKEY_SHIFT_MASK; { - for(int i = 0 ; i < 10 ; i++) + for(int i = 0 ; i < SAVE_SLOTS_PER_BANK; i++) { if(wParam == CustomKeys.Save[i].key && modifiers == CustomKeys.Save[i].modifiers) { - FreezeUnfreezeSlot (i, true); + FreezeUnfreezeSlot (GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + i, true); hitHotKey = true; } if(wParam == CustomKeys.Load[i].key && modifiers == CustomKeys.Load[i].modifiers) { - FreezeUnfreezeSlot (i, false); + FreezeUnfreezeSlot (GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + i, false); hitHotKey = true; } } @@ -858,11 +873,23 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) FreezeUnfreezeSlot (GUI.CurrentSaveSlot, false); hitHotKey = true; } + if(wParam == CustomKeys.DialogSave.key + && modifiers == CustomKeys.DialogSave.modifiers) + { + FreezeUnfreezeDialogPreview(true); + hitHotKey = true; + } + if(wParam == CustomKeys.DialogLoad.key + && modifiers == CustomKeys.DialogLoad.modifiers) + { + FreezeUnfreezeDialogPreview(false); + hitHotKey = true; + } if(wParam == CustomKeys.SlotPlus.key && modifiers == CustomKeys.SlotPlus.modifiers) { GUI.CurrentSaveSlot++; - if(GUI.CurrentSaveSlot > 9) + if(GUI.CurrentSaveSlot > LAST_SAVE_SLOT_IN_BANK) GUI.CurrentSaveSlot = 0; static char str [64]; @@ -882,6 +909,32 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot); S9xSetInfoString(str); + hitHotKey = true; + } + if (wParam == CustomKeys.BankPlus.key + && modifiers == CustomKeys.BankPlus.modifiers) + { + GUI.CurrentSaveBank++; + if (GUI.CurrentSaveBank > LAST_SAVE_BANK) + GUI.CurrentSaveBank = 0; + + static char str[64]; + sprintf(str, FREEZE_INFO_SET_BANK_N, GUI.CurrentSaveBank); + S9xSetInfoString(str); + + hitHotKey = true; + } + if (wParam == CustomKeys.BankMinus.key + && modifiers == CustomKeys.BankMinus.modifiers) + { + GUI.CurrentSaveBank--; + if (GUI.CurrentSaveBank < 0) + GUI.CurrentSaveBank = 9; + + static char str[64]; + sprintf(str, FREEZE_INFO_SET_BANK_N, GUI.CurrentSaveBank); + S9xSetInfoString(str); + hitHotKey = true; } } @@ -1207,11 +1260,11 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) if(wParam == CustomKeys.TurboDown.key && modifiers == CustomKeys.TurboDown.modifiers) PostMessage(GUI.hWnd, WM_COMMAND, (WPARAM)(ID_TURBO_DOWN),(LPARAM)(NULL)); - for(int i = 0 ; i < 10 ; i++) + for(int i = 0 ; i < SAVE_SLOTS_PER_BANK; i++) { if(wParam == CustomKeys.SelectSave[i].key && modifiers == CustomKeys.SelectSave[i].modifiers) { - GUI.CurrentSaveSlot = i; + GUI.CurrentSaveSlot = GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + i; static char str [64]; sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot); @@ -1518,7 +1571,19 @@ LRESULT CALLBACK WinProc( return 0; case WM_COMMAND: - switch (wParam & 0xffff) + { + int cmd_id = wParam & 0xffff; + if (cmd_id >= ID_FILE_SAVE0 && cmd_id < ID_FILE_SAVE0 + NUM_SAVE_BANKS * SAVE_SLOTS_PER_BANK) + { + FreezeUnfreezeSlot(cmd_id - ID_FILE_SAVE0, TRUE); + break; + } + else if (cmd_id >= ID_FILE_LOAD0 && cmd_id < ID_FILE_LOAD0 + NUM_SAVE_BANKS * SAVE_SLOTS_PER_BANK) + { + FreezeUnfreezeSlot(cmd_id - ID_FILE_LOAD0, FALSE); + break; + } + switch (cmd_id) { case ID_FILE_AVI_RECORDING: if (!GUI.AVIOut) @@ -2112,74 +2177,20 @@ LRESULT CALLBACK WinProc( Settings.FrameAdvance = false; GUI.FrameAdvanceJustPressed = 0; break; - case ID_FILE_LOAD0: - FreezeUnfreezeSlot (0, FALSE); - break; - case ID_FILE_LOAD1: - FreezeUnfreezeSlot (1, FALSE); - break; - case ID_FILE_LOAD2: - FreezeUnfreezeSlot (2, FALSE); - break; - case ID_FILE_LOAD3: - FreezeUnfreezeSlot (3, FALSE); - break; - case ID_FILE_LOAD4: - FreezeUnfreezeSlot (4, FALSE); - break; - case ID_FILE_LOAD5: - FreezeUnfreezeSlot (5, FALSE); - break; - case ID_FILE_LOAD6: - FreezeUnfreezeSlot (6, FALSE); - break; - case ID_FILE_LOAD7: - FreezeUnfreezeSlot (7, FALSE); - break; - case ID_FILE_LOAD8: - FreezeUnfreezeSlot (8, FALSE); - break; - case ID_FILE_LOAD9: - FreezeUnfreezeSlot (9, FALSE); - break; case ID_FILE_LOAD_OOPS: FreezeUnfreezeSlot(-1, FALSE); break; case ID_FILE_LOAD_FILE: FreezeUnfreezeDialog(FALSE); break; - case ID_FILE_SAVE0: - FreezeUnfreezeSlot (0, TRUE); - break; - case ID_FILE_SAVE1: - FreezeUnfreezeSlot (1, TRUE); - break; - case ID_FILE_SAVE2: - FreezeUnfreezeSlot (2, TRUE); - break; - case ID_FILE_SAVE3: - FreezeUnfreezeSlot (3, TRUE); - break; - case ID_FILE_SAVE4: - FreezeUnfreezeSlot (4, TRUE); - break; - case ID_FILE_SAVE5: - FreezeUnfreezeSlot (5, TRUE); - break; - case ID_FILE_SAVE6: - FreezeUnfreezeSlot (6, TRUE); - break; - case ID_FILE_SAVE7: - FreezeUnfreezeSlot (7, TRUE); - break; - case ID_FILE_SAVE8: - FreezeUnfreezeSlot (8, TRUE); - break; - case ID_FILE_SAVE9: - FreezeUnfreezeSlot (9, TRUE); - break; + case ID_FILE_LOAD_PREVIEW: + FreezeUnfreezeDialogPreview(FALSE); + break; case ID_FILE_SAVE_FILE: FreezeUnfreezeDialog(TRUE); + break; + case ID_FILE_SAVE_PREVIEW: + FreezeUnfreezeDialogPreview(TRUE); break; case ID_CHEAT_ENTER: RestoreGUIDisplay (); @@ -2299,7 +2310,7 @@ LRESULT CALLBACK WinProc( break; } break; - + } case WM_EXITMENULOOP: UpdateWindow(GUI.hWnd); DrawMenuBar(GUI.hWnd); @@ -2618,6 +2629,40 @@ BOOL WinInit( HINSTANCE hInstance) MessageBox (NULL, TEXT("Failed to initialize the menu.\nThis could indicate a failure of your operating system;\ntry closing some other windows or programs, or restart your computer, before opening Snes9x again.\nOr, if you compiled this program yourself, ensure that Snes9x was built with the proper resource files."), TEXT("Snes9x - Menu Initialization Failure"), MB_OK | MB_ICONSTOP); // return FALSE; // disabled: try to function without the menu } + + // insert bank and slot submenus / menu items + HMENU parent_menu_save = GetSubMenuById(ID_FILE_SAVE_POPUP); + HMENU parent_menu_load = GetSubMenuById(ID_FILE_LOAD_POPUP); + MENUITEMINFO mii; + mii.cbSize = sizeof(mii); + + for (int i = 0; i < NUM_SAVE_BANKS; i++) + { + // one bank sub each for save and load + HMENU bank_menu_save = CreatePopupMenu(); + HMENU bank_menu_load = CreatePopupMenu(); + // fill the slot entries into the sub menus + for (int j = 0; j < SAVE_SLOTS_PER_BANK; j++) + { + TCHAR *slot_string = g_saveMenuItemStrings[i * SAVE_SLOTS_PER_BANK + j]; + _stprintf(slot_string, _T("Slot #&%d"), j); + mii.fMask = MIIM_STRING | MIIM_ID; + mii.dwTypeData = slot_string; + mii.wID = ID_FILE_SAVE0 + i * SAVE_SLOTS_PER_BANK + j; + InsertMenuItem(bank_menu_save, j, TRUE, &mii); + mii.wID = ID_FILE_LOAD0 + i * SAVE_SLOTS_PER_BANK + j; + InsertMenuItem(bank_menu_load, j, TRUE, &mii); + } + + // add the bank menus to save and load + _stprintf(g_bankMenuItemStrings[i], _T("Bank #&%d"), i); + mii.fMask = MIIM_STRING | MIIM_SUBMENU; + mii.dwTypeData = g_bankMenuItemStrings[i]; + mii.hSubMenu = bank_menu_save; + InsertMenuItem(parent_menu_save, i, TRUE, &mii); + mii.hSubMenu = bank_menu_load; + InsertMenuItem(parent_menu_load, i, TRUE, &mii); + } #ifdef DEBUGGER if(GUI.hMenu) { InsertMenu(GUI.hMenu,ID_OPTIONS_SETTINGS,MF_BYCOMMAND | MF_STRING | MF_ENABLED,ID_DEBUG_FRAME_ADVANCE,TEXT("&Debug Frame Advance")); @@ -2673,6 +2718,12 @@ BOOL WinInit( HINSTANCE hInstance) void S9xExtraUsage () { + S9xMessage(S9X_INFO, S9X_USAGE, "Windows port specific:"); + S9xMessage(S9X_INFO, S9X_USAGE, "-fullscreen Start in fullscreen mode"); + S9xMessage(S9X_INFO, S9X_USAGE, "-hidemenu Initially hide the GUI menu"); + S9xMessage(S9X_INFO, S9X_USAGE, "-restore Reset all settings to default"); + S9xMessage(S9X_INFO, S9X_USAGE, "-cartb Specify the second cart for multicart, also triggers multicart"); + MessageBox(NULL, _T("Snes9x command line options have been written to stdout.txt in the same folder as snes9x.exe"), _T("Command line options"), MB_OK | MB_ICONINFORMATION); } // handles joystick hotkey presses @@ -2685,6 +2736,10 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO if(GUI.JoystickHotkeys) { + if (Settings.StopEmulation || (Settings.Paused && !Settings.FrameAdvance) || Settings.ForcedPause) + { + S9xWinScanJoypads(); + } static int counter = 0; static uint32 joyState[6][53]; for(int j = 0 ; j < 6 ; j++) @@ -3224,7 +3279,6 @@ void ControlPadFlagsToS9xPseudoPointer(uint32 p) static void ProcessInput(void) { - extern void S9xWinScanJoypads (); #ifdef NETPLAY_SUPPORT if (!Settings.NetPlay) #endif @@ -3608,16 +3662,32 @@ void FreezeUnfreezeDialog(bool8 freeze) } } +void FreezeUnfreezeDialogPreview(bool8 freeze) +{ + if(Settings.StopEmulation) + return; + + CSaveLoadWithPreviewDlg dlg(freeze); + int slot = dlg.show(); + if(slot >= 0) + FreezeUnfreezeSlot(slot, freeze); +} + +void GetSlotFilename(int slot, char filename[_MAX_PATH + 1]) +{ + char ext[_MAX_EXT + 1]; + + if(slot == -1) + strcpy(ext, ".oops"); + else + snprintf(ext, _MAX_EXT, ".%03d", slot); + strcpy(filename, S9xGetFilename(ext, SNAPSHOT_DIR)); +} + void FreezeUnfreezeSlot(int slot, bool8 freeze) { char filename[_MAX_PATH + 1]; - char ext[_MAX_EXT + 1]; - - if (slot == -1) - strcpy(ext, ".oops"); - else - snprintf(ext, _MAX_EXT, ".%03d", slot); - strcpy(filename, S9xGetFilename(ext, SNAPSHOT_DIR)); + GetSlotFilename(slot, filename); FreezeUnfreeze(filename, freeze); } @@ -3633,6 +3703,9 @@ void FreezeUnfreeze (const char *filename, bool8 freeze) } #endif + if(Settings.StopEmulation) + return; + if (GUI.ConfirmSaveLoad) { std::string msg, title; @@ -3684,6 +3757,14 @@ void FreezeUnfreeze (const char *filename, bool8 freeze) S9xClearPause (PAUSE_FREEZE_FILE); } +bool UnfreezeScreenshotSlot(int slot, uint16 **image_buffer, int &width, int &height) +{ + char filename[_MAX_PATH + 1]; + GetSlotFilename(slot, filename); + + return S9xUnfreezeScreenshot(filename, image_buffer, width, height); +} + void CheckDirectoryIsWritable (const char *filename) { FILE *fs = fopen (filename, "w+"); @@ -3743,6 +3824,9 @@ static void CheckMenuStates () for (int i = ID_FILE_LOAD0; i <= ID_FILE_LOAD_FILE; i++) SetMenuItemInfo(GUI.hMenu, i, FALSE, &mii); + SetMenuItemInfo(GUI.hMenu, ID_FILE_SAVE_PREVIEW, FALSE, &mii); + SetMenuItemInfo(GUI.hMenu, ID_FILE_LOAD_PREVIEW, FALSE, &mii); + SetMenuItemInfo (GUI.hMenu, ID_FILE_RESET, FALSE, &mii); SetMenuItemInfo (GUI.hMenu, ID_CHEAT_ENTER, FALSE, &mii); SetMenuItemInfo (GUI.hMenu, ID_CHEAT_SEARCH_MODAL, FALSE, &mii); @@ -4706,7 +4790,7 @@ INT_PTR CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) strcat(romtext, "\r\nHeader Checksum: "); sprintf(temp, "%04X", Memory.ROMChecksum); strcat(romtext, temp); - strcat(romtext, "\r\nHeader Checksum Compliment: "); + strcat(romtext, "\r\nHeader Checksum Complement: "); sprintf(temp, "%04X", Memory.ROMComplementChecksum); strcat(romtext, temp); strcat(romtext, "\r\nOutput: "); @@ -5035,8 +5119,10 @@ INT_PTR CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) case 13: strcat(romtext, "South Korea"); break; - case 14:strcat(romtext, "Unknown region 14");break; - default:strcat(romtext, "Unknown region 15");break; + default: + sprintf(temp, "Unknown region %d", Memory.ROMRegion); + strcat(romtext, temp); + break; } SendDlgItemMessage(hDlg, IDC_ROM_DATA, WM_SETTEXT, 0, (LPARAM)((TCHAR *)_tFromMS932(romtext))); break; @@ -8301,138 +8387,111 @@ switch(msg) return FALSE; } +struct hotkey_dialog_item { + SCustomKey *key_entry; + TCHAR *description; +}; + +// this structure defines the four sub pages in the hotkey config dialog +// to keep an entry blank, set the SCustomKey pointer to NULL and the text to an empty string +static hotkey_dialog_item hotkey_dialog_items[4][MAX_SWITCHABLE_HOTKEY_DIALOG_ITEMS] = { + { + { &CustomKeys.SpeedUp, HOTKEYS_LABEL_1_1 }, + { &CustomKeys.SpeedDown, HOTKEYS_LABEL_1_2 }, + { &CustomKeys.Pause, HOTKEYS_LABEL_1_3 }, + { &CustomKeys.FastForwardToggle, HOTKEYS_LABEL_1_4 }, + { &CustomKeys.FastForward, HOTKEYS_LABEL_1_5 }, + { &CustomKeys.Rewind, HOTKEYS_LABEL_1_6 }, + { &CustomKeys.SkipUp, HOTKEYS_LABEL_1_7 }, + { &CustomKeys.SkipDown, HOTKEYS_LABEL_1_8 }, + { &CustomKeys.Mute, HOTKEYS_LABEL_1_9 }, + { &CustomKeys.ToggleCheats, HOTKEYS_LABEL_1_10 }, + { &CustomKeys.QuitS9X, HOTKEYS_LABEL_1_11 }, + { &CustomKeys.ResetGame, HOTKEYS_LABEL_1_12 }, + { &CustomKeys.SaveScreenShot, HOTKEYS_LABEL_1_13 }, + { &CustomKeys.FrameAdvance, HOTKEYS_LABEL_1_14 }, + }, + { + { &CustomKeys.BGL1, HOTKEYS_LABEL_2_1 }, + { &CustomKeys.BGL2, HOTKEYS_LABEL_2_2 }, + { &CustomKeys.BGL3, HOTKEYS_LABEL_2_3 }, + { &CustomKeys.BGL4, HOTKEYS_LABEL_2_4 }, + { &CustomKeys.BGL5, HOTKEYS_LABEL_2_5 }, + { &CustomKeys.ClippingWindows, HOTKEYS_LABEL_2_6 }, + { &CustomKeys.Transparency, HOTKEYS_LABEL_2_7 }, + { &CustomKeys.ScopeTurbo, HOTKEYS_LABEL_2_8 }, + { &CustomKeys.ScopePause, HOTKEYS_LABEL_2_9 }, + { &CustomKeys.SwitchControllers, HOTKEYS_LABEL_2_10 }, + { &CustomKeys.JoypadSwap, HOTKEYS_LABEL_2_11 }, + { &CustomKeys.ShowPressed, HOTKEYS_LABEL_2_12 }, + { &CustomKeys.FrameCount, HOTKEYS_LABEL_2_13 }, + { &CustomKeys.ReadOnly, HOTKEYS_LABEL_2_14 }, + }, + { + { &CustomKeys.TurboA, HOTKEYS_LABEL_3_1 }, + { &CustomKeys.TurboB, HOTKEYS_LABEL_3_2 }, + { &CustomKeys.TurboY, HOTKEYS_LABEL_3_3 }, + { &CustomKeys.TurboX, HOTKEYS_LABEL_3_4 }, + { &CustomKeys.TurboL, HOTKEYS_LABEL_3_5 }, + { &CustomKeys.TurboR, HOTKEYS_LABEL_3_6 }, + { &CustomKeys.TurboStart, HOTKEYS_LABEL_3_7 }, + { &CustomKeys.TurboSelect, HOTKEYS_LABEL_3_8 }, + { &CustomKeys.TurboLeft, HOTKEYS_LABEL_3_9 }, + { &CustomKeys.TurboUp, HOTKEYS_LABEL_3_10 }, + { &CustomKeys.TurboRight, HOTKEYS_LABEL_3_11 }, + { &CustomKeys.TurboDown, HOTKEYS_LABEL_3_12 }, + { NULL, _T("") }, + { NULL, _T("") }, + }, + { + { &CustomKeys.SelectSave[0], HOTKEYS_LABEL_4_1 }, + { &CustomKeys.SelectSave[1], HOTKEYS_LABEL_4_2 }, + { &CustomKeys.SelectSave[2], HOTKEYS_LABEL_4_3 }, + { &CustomKeys.SelectSave[3], HOTKEYS_LABEL_4_4 }, + { &CustomKeys.SelectSave[4], HOTKEYS_LABEL_4_5 }, + { &CustomKeys.SelectSave[5], HOTKEYS_LABEL_4_6 }, + { &CustomKeys.SelectSave[6], HOTKEYS_LABEL_4_7 }, + { &CustomKeys.SelectSave[7], HOTKEYS_LABEL_4_8 }, + { &CustomKeys.SelectSave[8], HOTKEYS_LABEL_4_9 }, + { &CustomKeys.SelectSave[9], HOTKEYS_LABEL_4_10 }, + { &CustomKeys.SaveFileSelect, HOTKEYS_LABEL_4_11 }, + { &CustomKeys.LoadFileSelect, HOTKEYS_LABEL_4_12 }, + { NULL, _T("") }, + { NULL, _T("") }, + }, +}; static void set_hotkeyinfo(HWND hDlg) { int index = SendDlgItemMessage(hDlg,IDC_HKCOMBO,CB_GETCURSEL,0,0); - switch(index) - { - case 0: - // set page 1 fields - SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.SpeedUp.key,CustomKeys.SpeedUp.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.SpeedDown.key,CustomKeys.SpeedDown.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.Pause.key,CustomKeys.Pause.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.FrameAdvance.key,CustomKeys.FrameAdvance.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.FastForward.key,CustomKeys.FastForward.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.SkipUp.key,CustomKeys.SkipUp.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.SkipDown.key,CustomKeys.SkipDown.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.ScopeTurbo.key,CustomKeys.ScopeTurbo.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.ScopePause.key,CustomKeys.ScopePause.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.ShowPressed.key,CustomKeys.ShowPressed.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.FrameCount.key,CustomKeys.FrameCount.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.ReadOnly.key,CustomKeys.ReadOnly.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.SaveScreenShot.key,CustomKeys.SaveScreenShot.modifiers); - break; - case 1: - SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.BGL1.key,CustomKeys.BGL1.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.BGL2.key,CustomKeys.BGL2.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.BGL3.key,CustomKeys.BGL3.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.BGL4.key,CustomKeys.BGL4.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.BGL5.key,CustomKeys.BGL5.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.ClippingWindows.key,CustomKeys.ClippingWindows.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.Transparency.key,CustomKeys.Transparency.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.FastForwardToggle.key,CustomKeys.FastForwardToggle.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.Rewind.key,CustomKeys.Rewind.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.SwitchControllers.key,CustomKeys.SwitchControllers.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.JoypadSwap.key,CustomKeys.JoypadSwap.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.ResetGame.key,CustomKeys.ResetGame.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.ToggleCheats.key,CustomKeys.ToggleCheats.modifiers); - break; - case 2: - SendDlgItemMessage(hDlg,IDC_HOTKEY1,WM_USER+44,CustomKeys.TurboA.key,CustomKeys.TurboA.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY2,WM_USER+44,CustomKeys.TurboB.key,CustomKeys.TurboB.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY3,WM_USER+44,CustomKeys.TurboY.key,CustomKeys.TurboY.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY4,WM_USER+44,CustomKeys.TurboX.key,CustomKeys.TurboX.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.TurboL.key,CustomKeys.TurboL.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.TurboR.key,CustomKeys.TurboR.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.TurboStart.key,CustomKeys.TurboStart.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.TurboSelect.key,CustomKeys.TurboSelect.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,CustomKeys.TurboLeft.key,CustomKeys.TurboLeft.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.TurboUp.key,CustomKeys.TurboUp.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.TurboRight.key,CustomKeys.TurboRight.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.TurboDown.key,CustomKeys.TurboDown.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44, CustomKeys.Mute.key, CustomKeys.Mute.modifiers); - break; - case 3: - for(int i = 0 ; i < 10 ; i++) - SendDlgItemMessage(hDlg,IDC_HOTKEY1+i,WM_USER+44,CustomKeys.SelectSave[i].key,CustomKeys.SelectSave[i].modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44, CustomKeys.SaveFileSelect.key, CustomKeys.SaveFileSelect.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44, CustomKeys.LoadFileSelect.key, CustomKeys.LoadFileSelect.modifiers); - SendDlgItemMessage(hDlg,IDC_HOTKEY13,WM_USER+44,CustomKeys.QuitS9X.key,CustomKeys.QuitS9X.modifiers); - break; - } + for(int i = 0; i < MAX_SWITCHABLE_HOTKEY_DIALOG_ITEMS; i++) + { + int wParam = 0, lParam = 0; + if(hotkey_dialog_items[index][i].key_entry) + { + wParam = hotkey_dialog_items[index][i].key_entry->key; + lParam = hotkey_dialog_items[index][i].key_entry->modifiers; + } + SendDlgItemMessage(hDlg, IDC_HOTKEY1 + i, WM_USER + 44, wParam, lParam); + } SendDlgItemMessage(hDlg,IDC_SLOTPLUS,WM_USER+44,CustomKeys.SlotPlus.key,CustomKeys.SlotPlus.modifiers); SendDlgItemMessage(hDlg,IDC_SLOTMINUS,WM_USER+44,CustomKeys.SlotMinus.key,CustomKeys.SlotMinus.modifiers); SendDlgItemMessage(hDlg,IDC_SLOTSAVE,WM_USER+44,CustomKeys.SlotSave.key,CustomKeys.SlotSave.modifiers); SendDlgItemMessage(hDlg,IDC_SLOTLOAD,WM_USER+44,CustomKeys.SlotLoad.key,CustomKeys.SlotLoad.modifiers); + SendDlgItemMessage(hDlg, IDC_DIALOGSAVE, WM_USER + 44, CustomKeys.DialogSave.key, CustomKeys.DialogSave.modifiers); + SendDlgItemMessage(hDlg, IDC_DIALOGLOAD, WM_USER + 44, CustomKeys.DialogLoad.key, CustomKeys.DialogLoad.modifiers); + SendDlgItemMessage(hDlg, IDC_BANKPLUS, WM_USER + 44, CustomKeys.BankPlus.key, CustomKeys.BankPlus.modifiers); + SendDlgItemMessage(hDlg, IDC_BANKMINUS, WM_USER + 44, CustomKeys.BankMinus.key, CustomKeys.BankMinus.modifiers); int i; - for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE1+i,WM_USER+44,CustomKeys.Save[i].key,CustomKeys.Save[i].modifiers); - for(i = 0 ; i < 10 ; i++) SendDlgItemMessage(hDlg,IDC_SAVE11+i,WM_USER+44,CustomKeys.Load[i].key,CustomKeys.Load[i].modifiers); + for(i = 0 ; i < SAVE_SLOTS_PER_BANK; i++) SendDlgItemMessage(hDlg,IDC_SAVE1+i,WM_USER+44,CustomKeys.Save[i].key,CustomKeys.Save[i].modifiers); + for(i = 0 ; i < SAVE_SLOTS_PER_BANK; i++) SendDlgItemMessage(hDlg,IDC_SAVE11+i,WM_USER+44,CustomKeys.Load[i].key,CustomKeys.Load[i].modifiers); - switch(index) - { - case 0: - // set page 1 label text - SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_1_1); - SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_1_2); - SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_1_3); - SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_1_4); - SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_1_5); - SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_1_6); - SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_1_7); - SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_1_8); - SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_1_9); - SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_1_10); - SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_1_11); - SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_1_12); - SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_1_13); - break; - case 1: - SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_2_1); - SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_2_2); - SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_2_3); - SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_2_4); - SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_2_5); - SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_2_6); - SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_2_7); - SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_2_8); - SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_2_9); - SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_2_10); - SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_2_11); - SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_2_12); - SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_2_13); - break; - case 2: - SetDlgItemText(hDlg,IDC_LABEL_HK1,HOTKEYS_LABEL_3_1); - SetDlgItemText(hDlg,IDC_LABEL_HK2,HOTKEYS_LABEL_3_2); - SetDlgItemText(hDlg,IDC_LABEL_HK3,HOTKEYS_LABEL_3_3); - SetDlgItemText(hDlg,IDC_LABEL_HK4,HOTKEYS_LABEL_3_4); - SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_3_5); - SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_3_6); - SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_3_7); - SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_3_8); - SetDlgItemText(hDlg,IDC_LABEL_HK9,HOTKEYS_LABEL_3_9); - SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_3_10); - SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_3_11); - SetDlgItemText(hDlg,IDC_LABEL_HK12,HOTKEYS_LABEL_3_12); - SetDlgItemText(hDlg,IDC_LABEL_HK13, HOTKEYS_LABEL_3_13); - - break; - case 3: - for(int i = 0 ; i < 10 ; i++) - { - TCHAR temp [64]; - _stprintf(temp, TEXT("Select Slot %d"), i); - SetDlgItemText(hDlg,IDC_LABEL_HK1+i,temp); - } - SetDlgItemText(hDlg, IDC_LABEL_HK11, HOTKEYS_LABEL_4_11); - SetDlgItemText(hDlg, IDC_LABEL_HK12, HOTKEYS_LABEL_4_12); - SetDlgItemText(hDlg,IDC_LABEL_HK13,HOTKEYS_LABEL_4_13); - - break; - } + for(int i = 0; i < MAX_SWITCHABLE_HOTKEY_DIALOG_ITEMS; i++) + { + SetDlgItemText(hDlg, IDC_LABEL_HK1 + i, hotkey_dialog_items[index][i].description); + } } // DlgHotkeyConfig @@ -8513,85 +8572,6 @@ switch(msg) switch(which) { - case IDC_HOTKEY1: - if(index == 0) CustomKeys.SpeedUp.key = wParam, CustomKeys.SpeedUp.modifiers = modifiers; - if(index == 1) CustomKeys.BGL1.key = wParam, CustomKeys.BGL1.modifiers = modifiers; - if(index == 2) CustomKeys.TurboA.key = wParam, CustomKeys.TurboA.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[0].key = wParam, CustomKeys.SelectSave[0].modifiers = modifiers; - break; - case IDC_HOTKEY2: - if(index == 0) CustomKeys.SpeedDown.key = wParam, CustomKeys.SpeedDown.modifiers = modifiers; - if(index == 1) CustomKeys.BGL2.key = wParam, CustomKeys.BGL2.modifiers = modifiers; - if(index == 2) CustomKeys.TurboB.key = wParam, CustomKeys.TurboB.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[1].key = wParam, CustomKeys.SelectSave[1].modifiers = modifiers; - break; - case IDC_HOTKEY3: - if(index == 0) CustomKeys.Pause.key = wParam, CustomKeys.Pause.modifiers = modifiers; - if(index == 1) CustomKeys.BGL3.key = wParam, CustomKeys.BGL3.modifiers = modifiers; - if(index == 2) CustomKeys.TurboY.key = wParam, CustomKeys.TurboY.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[2].key = wParam, CustomKeys.SelectSave[2].modifiers = modifiers; - break; - case IDC_HOTKEY4: - if(index == 0) CustomKeys.FrameAdvance.key = wParam, CustomKeys.FrameAdvance.modifiers = modifiers; - if(index == 1) CustomKeys.BGL4.key = wParam, CustomKeys.BGL4.modifiers = modifiers; - if(index == 2) CustomKeys.TurboX.key = wParam, CustomKeys.TurboX.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[3].key = wParam, CustomKeys.SelectSave[3].modifiers = modifiers; - break; - case IDC_HOTKEY5: - if(index == 0) CustomKeys.FastForward.key = wParam, CustomKeys.FastForward.modifiers = modifiers; - if(index == 1) CustomKeys.BGL5.key = wParam, CustomKeys.BGL5.modifiers = modifiers; - if(index == 2) CustomKeys.TurboL.key = wParam, CustomKeys.TurboL.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[4].key = wParam, CustomKeys.SelectSave[4].modifiers = modifiers; - break; - case IDC_HOTKEY6: - if(index == 0) CustomKeys.SkipUp.key = wParam, CustomKeys.SkipUp.modifiers = modifiers; - if(index == 1) CustomKeys.ClippingWindows.key = wParam, CustomKeys.ClippingWindows.modifiers = modifiers; - if(index == 2) CustomKeys.TurboR.key = wParam, CustomKeys.TurboR.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[5].key = wParam, CustomKeys.SelectSave[5].modifiers = modifiers; - break; - case IDC_HOTKEY7: - if(index == 0) CustomKeys.SkipDown.key = wParam, CustomKeys.SkipDown.modifiers = modifiers; - if(index == 1) CustomKeys.Transparency.key = wParam, CustomKeys.Transparency.modifiers = modifiers; - if(index == 2) CustomKeys.TurboStart.key = wParam, CustomKeys.TurboStart.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[6].key = wParam, CustomKeys.SelectSave[6].modifiers = modifiers; - break; - case IDC_HOTKEY8: - if(index == 0) CustomKeys.ScopeTurbo.key = wParam, CustomKeys.ScopeTurbo.modifiers = modifiers; - if(index == 1) CustomKeys.FastForwardToggle.key = wParam, CustomKeys.FastForwardToggle.modifiers = modifiers; - if(index == 2) CustomKeys.TurboSelect.key = wParam, CustomKeys.TurboSelect.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[7].key = wParam, CustomKeys.SelectSave[7].modifiers = modifiers; - break; - case IDC_HOTKEY9: - if(index == 0) CustomKeys.ScopePause.key = wParam, CustomKeys.ScopePause.modifiers = modifiers; - if(index == 1) CustomKeys.Rewind.key = wParam, CustomKeys.Rewind.modifiers = modifiers; - if(index == 2) CustomKeys.TurboLeft.key = wParam, CustomKeys.TurboLeft.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[8].key = wParam, CustomKeys.SelectSave[8].modifiers = modifiers; - break; - case IDC_HOTKEY10: - if(index == 0) CustomKeys.ShowPressed.key = wParam, CustomKeys.ShowPressed.modifiers = modifiers; - if(index == 1) CustomKeys.SwitchControllers.key = wParam, CustomKeys.SwitchControllers.modifiers = modifiers; - if(index == 2) CustomKeys.TurboUp.key = wParam, CustomKeys.TurboUp.modifiers = modifiers; - if(index == 3) CustomKeys.SelectSave[9].key = wParam, CustomKeys.SelectSave[9].modifiers = modifiers; - break; - case IDC_HOTKEY11: - if(index == 0) CustomKeys.FrameCount.key = wParam, CustomKeys.FrameCount.modifiers = modifiers; - if(index == 1) CustomKeys.JoypadSwap.key = wParam, CustomKeys.JoypadSwap.modifiers = modifiers; - if(index == 2) CustomKeys.TurboRight.key = wParam, CustomKeys.TurboRight.modifiers = modifiers; - if(index == 3) CustomKeys.SaveFileSelect.key = wParam, CustomKeys.SaveFileSelect.modifiers = modifiers; - break; - case IDC_HOTKEY12: - if(index == 0) CustomKeys.ReadOnly.key = wParam, CustomKeys.ReadOnly.modifiers = modifiers; - if(index == 1) CustomKeys.ResetGame.key = wParam, CustomKeys.ResetGame.modifiers = modifiers; - if(index == 2) CustomKeys.TurboDown.key = wParam, CustomKeys.TurboDown.modifiers = modifiers; - if(index == 3) CustomKeys.LoadFileSelect.key = wParam, CustomKeys.LoadFileSelect.modifiers = modifiers; - break; - case IDC_HOTKEY13: - if(index == 0) CustomKeys.SaveScreenShot.key = wParam, CustomKeys.SaveScreenShot.modifiers = modifiers; - if(index == 1) CustomKeys.ToggleCheats.key = wParam, CustomKeys.ToggleCheats.modifiers = modifiers; - if(index == 2) CustomKeys.Mute.key = wParam, CustomKeys.Mute.modifiers = modifiers; - if(index == 3) CustomKeys.QuitS9X.key = wParam, CustomKeys.QuitS9X.modifiers = modifiers; - break; - case IDC_SLOTPLUS: CustomKeys.SlotPlus.key = wParam; CustomKeys.SlotPlus.modifiers = modifiers; @@ -8611,8 +8591,35 @@ switch(msg) CustomKeys.SlotSave.key = wParam; CustomKeys.SlotSave.modifiers = modifiers; break; + + case IDC_DIALOGSAVE: + CustomKeys.DialogSave.key = wParam; + CustomKeys.DialogSave.modifiers = modifiers; + break; + + case IDC_DIALOGLOAD: + CustomKeys.DialogLoad.key = wParam; + CustomKeys.DialogLoad.modifiers = modifiers; + break; + + case IDC_BANKPLUS: + CustomKeys.BankPlus.key = wParam; + CustomKeys.BankPlus.modifiers = modifiers; + break; + + case IDC_BANKMINUS: + CustomKeys.BankMinus.key = wParam; + CustomKeys.BankMinus.modifiers = modifiers; + break; } + if(which >= IDC_HOTKEY1 && which <= IDC_HOTKEY13) + { + int offset = which - IDC_HOTKEY1; + hotkey_dialog_items[index][offset].key_entry->key = wParam; + hotkey_dialog_items[index][offset].key_entry->modifiers = modifiers; + } + if(which >= IDC_SAVE1 && which <= IDC_SAVE10) { CustomKeys.Save[which-IDC_SAVE1].key = wParam; @@ -10841,19 +10848,6 @@ void S9xHandlePortCommand(s9xcommand_t cmd, int16 data1, int16 data2) return; } -// NYI -const char *S9xChooseFilename (bool8 read_only) -{ - return NULL; -} - -// NYI -const char *S9xChooseMovieFilename (bool8 read_only) -{ - return NULL; -} - - const char * S9xStringInput(const char *msg) { return NULL; diff --git a/win32/wsnes9x.h b/win32/wsnes9x.h index cb09e3cf..8d8c731b 100644 --- a/win32/wsnes9x.h +++ b/win32/wsnes9x.h @@ -26,6 +26,7 @@ #include #endif #include "rsrc/resource.h" +#include "port.h" #define COUNT(a) (sizeof (a) / sizeof (a[0])) #define MAX_AUDIO_NAME_LENGTH 1024 @@ -33,6 +34,11 @@ #define MAX_RECENT_GAMES_LIST_SIZE 32 #define MAX_RECENT_HOSTS_LIST_SIZE 16 +#define SAVE_SLOTS_PER_BANK 10 +#define LAST_SAVE_SLOT_IN_BANK (SAVE_SLOTS_PER_BANK - 1) +#define NUM_SAVE_BANKS 10 +#define LAST_SAVE_BANK (NUM_SAVE_BANKS - 1) + #include "_tfwopen.h" #ifdef UNICODE #define _tToChar WideToUtf8 @@ -196,6 +202,7 @@ struct sGUI { int BlueShift; int ControlForced; int CurrentSaveSlot; + int CurrentSaveBank; int MaxRecentGames; int ControllerOption; int ValidControllerOptions; @@ -297,8 +304,8 @@ struct SCustomKeys { SCustomKey ScopePause; SCustomKey FrameCount; SCustomKey ReadOnly; - SCustomKey Save [10]; - SCustomKey Load [10]; + SCustomKey Save [SAVE_SLOTS_PER_BANK]; + SCustomKey Load [SAVE_SLOTS_PER_BANK]; SCustomKey FastForward; SCustomKey FastForwardToggle; SCustomKey ShowPressed; @@ -307,21 +314,21 @@ struct SCustomKeys { SCustomKey SlotMinus; SCustomKey SlotSave; SCustomKey SlotLoad; + SCustomKey BankPlus; + SCustomKey BankMinus; + SCustomKey DialogSave; + SCustomKey DialogLoad; SCustomKey BGL1; SCustomKey BGL2; SCustomKey BGL3; SCustomKey BGL4; SCustomKey BGL5; SCustomKey ClippingWindows; -// SCustomKey BGLHack; SCustomKey Transparency; -// SCustomKey GLCube; -// SCustomKey HDMA; -// SCustomKey InterpMode7; SCustomKey JoypadSwap; SCustomKey SwitchControllers; SCustomKey TurboA, TurboB, TurboY, TurboX, TurboL, TurboR, TurboStart, TurboSelect, TurboLeft, TurboUp, TurboRight, TurboDown; - SCustomKey SelectSave [10]; + SCustomKey SelectSave [SAVE_SLOTS_PER_BANK]; SCustomKey ResetGame; SCustomKey ToggleCheats; SCustomKey QuitS9X; @@ -458,5 +465,11 @@ int GetFilterScale(RenderFilter filterID); bool GetFilterHiResSupport(RenderFilter filterID); const TCHAR * S9xGetDirectoryT (enum s9x_getdirtype); RECT GetWindowMargins(HWND hwnd, UINT width); +void GetSlotFilename(int slot, char filename[_MAX_PATH + 1]); +void FreezeUnfreezeSlot(int slot, bool8 freeze); +void FreezeUnfreezeDialog(bool8 freeze); +void FreezeUnfreezeDialogPreview(bool8 freeze); +void FreezeUnfreeze(const char *filename, bool8 freeze); +bool UnfreezeScreenshotSlot(int slot, uint16 **image_buffer, int &width, int &height); #endif // !defined(SNES9X_H_INCLUDED)