debian/0000755000000000000000000000000012252624337007174 5ustar debian/changelog0000644000000000000000000006321512252624000011040 0ustar mupen64plus-core (2.0-4) unstable; urgency=low * Fix version number of the unicode FTBFS bug in the changelog * Upgraded to policy 3.9.5, no changes required * debian/patches: - Add oot_subscreen_delay_fix.patch, Add Missing Subscreen Delay Fix for Ocarina of Time - Add counter_per_op.patch, Allow to overwrite the cycles per instruction - Add two_events_interrupt.patch, Don't insert a second interrupt event from same type - Add delay_si.patch, Allow to disable interrupt delay after DMA SI read/write - Add config_currentstateslot.patch, Use correct config parameter string (CurrentSaveSlot->CurrentStateSlot) - Add obsolete_variable.patch, Remove obsolete variable; caused crashes in PD/Goldeneye in Android Ed. -- Sven Eckelmann Fri, 13 Dec 2013 16:30:01 +0100 mupen64plus-core (2.0-3) unstable; urgency=low * debian/patches: - Add sdl2_no_unicode.patch, Remove SDL unicode keycode compat code (Closes: #720815) -- Sven Eckelmann Sun, 25 Aug 2013 16:27:13 +0200 mupen64plus-core (2.0-2) unstable; urgency=low * debian/patches: - Add n64_cic_nus_6105_reset.patch, Reset PIF_RAMb 46,47 after the n64_cic_nus_6105 challenge - Add sdl2_select_saveslot.patch, Fix saveslot selection for SDL2 (Closes: #717801) -- Sven Eckelmann Thu, 25 Jul 2013 13:25:47 +0200 mupen64plus-core (2.0-1) unstable; urgency=low * New Upstream Version * Upload to unstable * debian/patches: - Add multiple_main.patch, Fix multiple definitions of main in same namespace - Remove dejavu-font.patch, Don't use Dejavu fonts because upstream uses other font - Add bitstream-font.patch, Use font from ttf-bitstream-vera instead of installing own copy with libmupen64plus2 - Remove upstream merged country_code_bits.patch, sdl2_joystick_events.patch, sdl2_keyrepeat.patch and sdl2_resize.patch * debian/control: - Build-Depend on debhelper 9.20130604 for support of parameters when detecting targets in dh_auto_* - Replace dependency to ttf-dejavu-core with ttf-bitstream-vera * debian/rules: - Work around new debhelper 9.20130624 dh_auto_{clean,test} behavior which is causing a FTBFS by adding an explicit override_dh_auto_{clean,test} rule * debian/watch: - Verify new upstream versions using GPG key 954F81B094AA5BB226F5 -- Sven Eckelmann Fri, 05 Jul 2013 22:52:30 +0200 mupen64plus-core (2.0~rc3+3+5d46baa3dd76-2) experimental; urgency=low * debian/rules: - Switch from SDL 1.2 to SDL 2.0 * debian/control: - Depend on libsdl2-dev instead of libsdl1.2-dev - Add Breaks for pre-SDL2 plugins * debian/patches: - Add sdl2_resize.patch, Fix compiling against SDL2 - Add country_code_bits.patch, Ignore upper 8 bit of countrycode when checking for PAL/NTSC system - Add sdl2_keyrepeat.patch, Ignore key repeats caused by the OS keyrepeat - Add sdl2_joystick_events.patch, Simply open joystick when needed in SDL2 - Add sdl2_keysym.patch, Use SDL1.2 keysym in the config when using SDL2 * Update debian/copyright -- Sven Eckelmann Sun, 23 Jun 2013 13:24:06 +0200 mupen64plus-core (2.0~rc3+3+5d46baa3dd76-1) experimental; urgency=low * New Upstream Snapshot from 5d46baa3dd7660365183e16596b288f824903007 * debian/control: - Provide mupen64plus-frontend-abi-2.1.1 - Remove old mupen64plus-frontend-abi-2.0.1/2.0.2 - Provide mupen64plus-gfx-abi-2.2 - Provide mupen64plus-vidext-abi-3 - Remove old mupen64plus-vidext-abi-2 * Enable link-time optimization in debian/rules similar to upstream * Add VidExt_ResizeWindow@Base to libmupen64plus2 symbols * debian/patches: - Rebase dejavu-font.patch, disable_recompiler_disassembler.patch and printf_fixup.patch on top of 2.0~rc3+3+5d46baa3dd76 -- Sven Eckelmann Wed, 05 Jun 2013 13:24:51 +0200 mupen64plus-core (1.99.5+178+cbd1bb2a5d6a-1) experimental; urgency=low * New Upstream Snapshot from cbd1bb2a5d6a9a04595a76412f89703d220981ed * Disable extra debug code in release builds with -DNDEBUG in debian/rules * debian/patches: - Rebase dejavu-font.patch and disable_recompiler_disassembler.patch on top of 1.99.5+178+cbd1bb2a5d6a -- Sven Eckelmann Fri, 08 Feb 2013 10:15:13 +0100 mupen64plus-core (1.99.5+148+f259cbe4c1cd-1) experimental; urgency=low * New Upstream Snapshot from f259cbe4c1cd69f76aac9f8726c88993e3a96b70 * Remove obsolete DM-Upload-Allowed in debian/control * debian/patches: - Rebase dejavu-font.patch, disable_recompiler_disassembler.patch and printf_fixup.patch on top of 1.99.5+148+f259cbe4c1cd -- Sven Eckelmann Sun, 02 Dec 2012 22:32:11 +0100 mupen64plus-core (1.99.5+129+c7764c244288-1) experimental; urgency=low * New Upstream Snapshot from c7764c2442889c9dc19648df11a89ca88fb2d8fa * debian/patches: - Remove upstream merged dynarec_amd64_nostackreg.patch -- Sven Eckelmann Tue, 30 Oct 2012 18:22:22 +0100 mupen64plus-core (1.99.5+117+a5698f5f67c1-1) experimental; urgency=low * New Upstream Snapshot from a5698f5f67c134bdaac66c04c09c2540cc62d606 * Upgraded to policy 3.9.4, no changes required * debian/patches: - Add dynarec_amd64_nostackreg.patch, Don't store mapped host registers on stack before dynarec call -- Sven Eckelmann Sun, 07 Oct 2012 14:23:26 +0200 mupen64plus-core (1.99.5+115+5afdc1c5e077-1) experimental; urgency=low * New Upstream Snapshot from 5afdc1c5e07718865400ff038a5dc3660e86d7a4 * debian/patches: - Remove upstream merged config_type_switch_invalid_free.patch -- Sven Eckelmann Sun, 16 Sep 2012 20:00:51 +0200 mupen64plus-core (1.99.5+113+481cdd269905-1) experimental; urgency=low * New Upstream Snapshot from 481cdd2699058351684be9415228fe7a156de464 * debian/patches: - Add config_type_switch_invalid_free.patch, Don't free random memory on config option type change -- Sven Eckelmann Tue, 11 Sep 2012 19:49:48 +0200 mupen64plus-core (1.99.5+14+99517e4bc1b8-1) experimental; urgency=low * New Upstream Snapshot from 99517e4bc1b80c0501fa2e50ba2024331e542f3c * debian/patches: - Remove upstream merged debugger_api.patch, debugger_memory_breakpoints.patch, floatingpoint_config.patch, gcc_lto.patch, printf_function_pointer.patch, rjump_gcc47.patch, unused_bdslot.patch - Rebase dejavu-font.patch, disable_recompiler_disassembler.patch, printf_fixup.patch -- Sven Eckelmann Sun, 17 Jun 2012 00:39:37 +0200 mupen64plus-core (1.99.5-6) unstable; urgency=low * debian/patches: - Add unused_bdslot.patch, Remove unused variable bdslot - Add printf_function_pointer.patch, Print function pointer using %p instead of %x - Add gcc_lto.patch, Enable support for link-time optimization -- Sven Eckelmann Sat, 09 Jun 2012 00:36:43 +0200 mupen64plus-core (1.99.5-5) unstable; urgency=low * debian/patches: - Add debugger_api.patch, Move breakpoint typedef and BPT_* macros to api headers - Add disable_recompiler_disassembler.patch, Disable the disassembler of the recompiled code * Enable debugger interface of the core -- Sven Eckelmann Mon, 28 May 2012 14:19:15 +0200 mupen64plus-core (1.99.5-4) unstable; urgency=low * debian/patches: - Add rjump_gcc47.patch, Fix name of PIC thunks with gcc 4.7 (Closes: #672991) -- Sven Eckelmann Tue, 15 May 2012 23:07:14 +0200 mupen64plus-core (1.99.5-3) unstable; urgency=low * Add mupen64plus-data binary package for the rom catalog and cheat database * Install architecture independent files into /usr/share/games/mupen64plus -- Sven Eckelmann Tue, 01 May 2012 11:04:30 +0200 mupen64plus-core (1.99.5-2) unstable; urgency=low [ Simon Ruderich ] * Let debhelper set the buildflags implicitly [ Sven Eckelmann ] * debian/patches: - Add floatingpoint_config.patch, Support locales with commas instead of periods for decimal separator - Add debugger_memory_breakpoints.patch, Fix off-by-one error of memory in memory debugger -- Sven Eckelmann Sat, 28 Apr 2012 14:49:16 +0200 mupen64plus-core (1.99.5-1) unstable; urgency=low * New Upstream Version * Enable all hardening flags in debian/rules * Upgrade debhelper compat to v9 * debian/patches: - Rebase dejavu-font.patch and printf_fixup.patch on top of 1.99.5 * debian/control: - Update ABI versions - Upgraded to policy 3.9.3, no changes required * Update debian/copyright * Use buildflags.mk to set security flags in debian/rules -- Sven Eckelmann Sat, 17 Mar 2012 20:18:35 +0100 mupen64plus-core (1.99.4+99+7f1880795b02-2) experimental; urgency=low * Fix freetype initialization in debian/patches/dejavu-font.patch -- Sven Eckelmann Sun, 13 Nov 2011 09:42:34 +0100 mupen64plus-core (1.99.4+99+7f1880795b02-1) experimental; urgency=low * New upstream snapshot from revision 7f1880795b0235062a466c973d76333d258c2241 * debian/patches: - Rebase dejavu-font.patch and printf_fixup.patch on top of 1.99.4+99+7f1880795b02 - Remove upstream merged double_percentage.patch, new_minizip.patch and savestatepath_config.patch - Remove ftgl_fontrendering.patch which was rejected by upstream * Remove unnecessary --as-needed from linker flags in debian/rules -- Sven Eckelmann Sun, 13 Nov 2011 01:46:58 +0100 mupen64plus-core (1.99.4+77+8bb0e6b3ae3a-1) experimental; urgency=low * New upstream snapshot from revision 8bb0e6b3ae3a4020c12e601cfddf028fbb44a6ea * debian/control: - Depend on mupen64plus-*-abi-2 * Don't mix implicit and explicit rules to prevent FTBFS with make 3.82 * debian/patches: - Remove upstream merged patches: allocate_mmap.patch, api_header.patch, big_endian_conflict.patch, conflicting_symbol.patch, info_configuration_failure.patch, interpreter_fpu_modes.patch, interpreter_rw_memory.patch, mipmapping_doc.patch, n64_cic_nus_6105.patch, n64_romswap.patch, osd_memory_corruption.patch, privilege_segfault.patch, rewrite_makefile.patch, rjump_globber.patch, rtc.patch - Rebase dejavu-font.patch and printf_fixup.patch against 1.99.4+77+8bb0e6b3ae3a * Add new files to debian/copyright * Add debian/get-orig-source.sh for snapshots -- Sven Eckelmann Mon, 29 Aug 2011 17:05:24 +0200 mupen64plus-core (1.99.4-5) unstable; urgency=low * Update copyright years in debian/copyright * Change dependency libpng12-dev to new name libpng-dev (Closes: #662439) -- Sven Eckelmann Mon, 05 Mar 2012 09:34:19 +0100 mupen64plus-core (1.99.4-4) unstable; urgency=low * debian/control: - Add virtual package libsdl-dev as alternative build dependency * Don't mix implicit and explicit rules to prevent FTBFS with make 3.82 * debian/patches: - Add new_minizip.patch, Import minizip from zlib 1.2.5 - Add savestatepath_config.patch, Read option SaveStatePath from config when set - Update rewrite_makefile.patch and dejavu-font.patch; Fix installation of cheat database - Add double_percentage.patch, Don't print '%' twice in volume string - Add ftgl_fontrendering.patch, Replace builtin OGLFT with FTGL font rendering library * Remove hardening-includes which are now integrated in dpkg- buildflags * Use debian packaging manual URL as format identifier in debian/copyright -- Sven Eckelmann Mon, 31 Oct 2011 12:48:50 +0100 mupen64plus-core (1.99.4-3) unstable; urgency=low * Upload to unstable * debian/control: - Fix spelling of "Flexible" (Closes: #633693) - Depend on pkg-config for new Makefile * debian/rules: - Mark all targets as phony - Force PIC using Makefile option - Remove unintended optimization flags - Automatically create the libmupen64plus.so.2 symlink * debian/patches: - Remove obsolete default-optimisations.patch - Rebase debian/patches/dejavu-font.patch - Add rewrite_makefile.patch, Rewrite Makefile to fix flags and linking - Add big_endian_conflict.patch, Don't use _BIG_ENDIAN to check for endianness - Add privilege_segfault.patch, Prevent segfault when .local/share/mupen64plus/ owned by root - Add info_configuration_failure.patch, Changed warning to info message when core can not open config - Add conflicting_symbol.patch, Don't define variable isGoldeneyeRom in each file - Add osd_memory_corruption.patch, Prevent data corruption with caller managed OSD text - Add allocate_mmap.patch, Allocate exec memory using mmap - Add interpreter_fpu_modes.patch, Use common fpu implementation for interpreter modes to fix missing round/trunc/ceil/floor/set_rounding - Add interpreter_rw_memory.patch, Don't require executable memory for cached interpreter - Add n64_cic_nus_6105.patch, use X-Scale's PIF-CIC algorithm instead of the hard-coded challenge-response pairs - Add mipmapping_doc.patch, Synchronize MipMapping options in Arachnoid and Rice -- Sven Eckelmann Sun, 24 Jul 2011 14:23:31 +0200 mupen64plus-core (1.99.4-2) experimental; urgency=low * debian/patches: - Add rtc.patch, Add support for n64 internal clock - Add n64_romswap.patch, Fix swapping of n64 images - Add rjump_globber.patch. Prevent over-optimization of rjump related data * Upgraded to policy 3.9.2, no changes required * Update Vcs-* fields to new anonscm.debian.org URLs in debian/control * Add multiarch support (Closes: #623765) -- Sven Eckelmann Sat, 11 Jun 2011 17:28:34 +0200 mupen64plus-core (1.99.4-1) experimental; urgency=low * New Upstream Version * Updated my maintainer e-mail address * Split source package to match upstreams modular release packages * debian/copyright: - Update to DEP5 revision 164 - Update copyright years * debian/patches: - Add printf_fixup.patch, Correct usage of printf format strings - Add api_header.patch, Ensure all definition for front-ends is in public headers - Rebase default-optimisations.patch and dejavu-font.patch against 1.99.4 - Remove upstream merged patches: as-needed.patch, correct_fpr32_mapping.patch, correct_security_printf.patch, debian-archs.patch, destdir.patch, dont-install-unneeded.patch, fix-7z-subfolder.patch, fix-desktop-file.patch, fix_r0_override.patch, fix_readpng.patch, ftbfs-debugger.patch, ftbfs-dynarec.patch, ftbfs-glibc210.patch, ftbfs-gvariant-type-conflicts.patch, ftbfs-kfreebsd.patch, glide64_hurd.patch, glide64-noasm.patch, gtk-open-filter.patch, interpreter_x86_fldcw.patch, jttl_fix_romclosed.patch, link_gdk.patch, load_aidacrate.patch, load_vistatus.patch, noexecstack.patch, optional_signinfo.patch, osd-pause-crash.patch, path_max.patch, pie_support.patch, plugin-searchpath.patch, remove-gln64.patch, remove-nondfsg-icons.patch, resume_on_start.patch, rice-ati-symbols.patch, rice-crash-vendorstring.patch, rice_fog.patch, rice_nodebug.patch, rice-screenflickering.patch, rice-texturepack-crash.patch, rsp_hle_bigendian.patch, rsp_ucode2_reset.patch, static-binutils-libs.patch, system-libbz2.patch, system-liblzma.patch, system-libpng.patch, system-zlib.patch, version-string.patch, xdg-basedir.patch -- Sven Eckelmann Sat, 22 Jan 2011 11:05:28 +0100 mupen64plus (1.5+dfsg1-14) experimental; urgency=low * Upgraded to policy 3.9.1, no changes required * Upgrade debhelper compat to v8 * debian/rules: - set *FLAGS using dpkg-buildflags in debian/rules to work like dpkg-buildpackage when called directly - Use hardening-includes for CFLAGS and LDFLAGS hardened builds - Use externally provided LDFLAGS - Disable support for debugger due to missing pic/pie support of libopcodes.a * debian/patches: - Add correct_security_printf.patch, Correct possible printf format string vulnerability - Add pie_support.patch, Add support for PIE/PIC -- Sven Eckelmann Thu, 23 Sep 2010 13:52:32 +0200 mupen64plus (1.5+dfsg1-13) unstable; urgency=low * debian/patches: - Add path_max.patch, Add dummy PATH_MAX on systems without it (Closes: #588066) - Add optional_signinfo.patch, Only use siginfo subsystem if system offers it (Closes: #588066) - Add glide64_hurd.patch, Define GNU/Hurd as UNIX system for glide64 (Closes: #588066) -- Sven Eckelmann Mon, 12 Jul 2010 23:20:02 +0200 mupen64plus (1.5+dfsg1-12) unstable; urgency=low * Use googlecode.debian.net instead of complex own filters for debian/watch * Upgraded to policy 3.9.0, no changes required * Build only on i386/amd64 because upstream doesn't to support more * debian/patches: - Add link_gdk.patch, Link directly against gdk-2.0 instead indirectly through gtk+-2.0 -- Sven Eckelmann Mon, 28 Jun 2010 21:31:48 +0200 mupen64plus (1.5+dfsg1-11) unstable; urgency=low * debian/patches: - Rename ftbfs-gvariant-type-conflicts.path to ftbfs-gvariant-type-conflicts.patch - Add rice-ati-symbols.patch, Allow to load rice on systems with missing opengl extensions -- Sven Eckelmann Sun, 23 May 2010 11:55:23 +0200 mupen64plus (1.5+dfsg1-10) unstable; urgency=low [ Sven Eckelmann ] * debian/patches: - Add rsp_ucode2_reset.patch, Reset status of specific ucode2 hacks after starting again - Add rsp_hle_bigendian.patch, Fix wrong high level emulation of rsp on big endian systems - Add rice-crash-vendorstring.patch, Don't crash on long OpenGL vendor string (Closes: #580480, LP: #575968) [ Piotr Ożarowski ] * DMUA flag set to yes -- Sven Eckelmann Thu, 06 May 2010 11:34:46 +0200 mupen64plus (1.5+dfsg1-9) unstable; urgency=low * debian/patches: - Add ftbfs-gvariant-type-conflicts.path, Fix FTBFS due to glib's gvariant.h type definitions (Closes: #577329) - Add dont-install-unneeded.patch, Don't install files which aren't used by us * debian/rules: - Enable parallel builds using dh's --parallel - Inform about missing installed files using dh's --list-missing - Share options between dh_auto_build and dh_auto_install * debian/control: - Depend on debhelper 7.4.10 for --parallel and --list-missing -- Sven Eckelmann Sun, 11 Apr 2010 12:23:04 +0200 mupen64plus (1.5+dfsg1-8) unstable; urgency=low * debian/patches: - Add rice_fog.patch, Reduce flickering when enabling fog in rice - Update fix_readpng.patch, Fix FTBFS with libpng14 and remove coding style only changes * Convert to 3.0 (quilt) source format * Remove outdated README.source * debian/control: - Remove shlibs:Depends for binary packages without shared libs dependencies - Remove unneeded build dependency to quilt - Upgraded to policy 3.8.4, no changes required * Correct spelling errors found by lintian * debian/copyright: Update copyright years * Check all files ever published on the download page in debian/watch -- Sven Eckelmann Mon, 15 Mar 2010 16:22:03 +0100 mupen64plus (1.5+dfsg1-7) unstable; urgency=low * debian/patches: - Correct minor dep3 patch tagging format problems - Update correct_fpr32_mapping.patch, prevent corruption of upper registers in a register pair due to sign extension - Add system-liblzma.patch, use liblzma from debian instead of buildin (Closes: #543552) * debian/control: - Depend on liblzma-dev for lzma and xz support -- Sven Eckelmann Mon, 19 Oct 2009 12:38:26 +0200 mupen64plus (1.5+dfsg1-6) unstable; urgency=low * debian/patches: - Add Origin information to patches - Update fix_readpng.patch, Backport actual commit from upstream - Update ftbfs-glibc210.patch, Backport actual commit from upstream - Update noexecstack.patch, Backport actual commit from upstream - Update jttl_fix_romclosed.patch, Backport actual commit from upstream - Add correct_fpr32_mapping.patch, Correct emulation of shared 32 bit wide and 64 bit wide FPR in MIPS I and MIPS III mode - Remove load-fpr-location.patch which is replaced by correct_fpr32_mapping.patch - Add load_aidacrate.patch, Set aiDacrate during savestate load to fix slowdowns after savestate load - Add load_vistatus.patch, Set video width and status during savestate load - Add fix_r0_override.patch, Don't allow to override r0 register - Add resume_on_start.patch, Resume when pressing on start when in pause mode to prevent corruption - Add osd-pause-crash.patch, Fix OSD crash after pause-stop-start-pause of emulator -- Sven Eckelmann Thu, 08 Oct 2009 13:29:25 +0200 mupen64plus (1.5+dfsg1-5) unstable; urgency=low * debian/patches: - Change to dep3 patch tagging guidelines - Remove number before patches as order is given by debian/patches/series - Add gtk-open-filter.patch, Show files with .n64 and .v64 extension in filtered open file dialog (Closes: #546046) - Add noexecstack.patch, Don't enable executable stack by default (Closes: #547644) - Add fix_readpng.patch, Fix crash when loading png due to reordering optimizer - Add jttl_fix_romclosed.patch, Stop audio processing thread before freeing buffers to fix segfault during stop of emulation - Add rice_nodebug.patch, Don't enable excessive debug functionality in rice_video - Add interpreter_x86_fldcw.patch, Correctly set floating point control word - Add load-fpr-location.patch, Set register bank location when loading savestate -- Sven Eckelmann Mon, 28 Sep 2009 15:23:17 +0200 mupen64plus (1.5+dfsg1-4) unstable; urgency=low * debian/patches; - Update 119-debian-archs.patch, Correct detection of armel cpu endianness (Closes: #545463) - Add 120-ftbfs-glibc210, Fix FTBFS using g++-4.4 and glibc 2.10 due to missing const keywords (Closes: #545462) - Add 121-version-string.patch, remove misleading "-development" in version string - Add 122-default-optimisations.patch, Don't override optimisations set by debian build environment -- Sven Eckelmann Tue, 08 Sep 2009 22:17:00 +0200 mupen64plus (1.5+dfsg1-3) unstable; urgency=low * debian/rules: - Set host architecture to support build of i386 running on x86_64 kernel (Closes: #544670) - Don't set NO_ASM parameter anymore as it is handled by 119-debian-archs.patch * debian/patches: - Add 119-debian-archs.patch, Define wordsize and endianness of architectures supported by debian (Closes: #544673) - Update 118-ftbfs-debugger.patch, define dummy functions to decompile recompiled code on non-x86 architectures (Closes: #544662) -- Sven Eckelmann Wed, 02 Sep 2009 23:18:11 +0200 mupen64plus (1.5+dfsg1-2) unstable; urgency=low * debian/patches - Add 114-fix-7z-subfolder.patch, fix crash in romcache when reading 7zip archive with subfolders - Add 115-xdg-basedir.patch, Use "XDG Base Directory" compliant directories for files for each user (Closes: #544428) - Add 116-ftbfs-dynarec.patch, Don't try to compile dynarec on architectures without support (Closes: #544548) - Add 117-ftbfs-kfreebsd.patch, Don't stop compilation due to unknown OS kFreeBSD (Closes: #544550) - Add 118-ftbfs-debugger.patch, Define CHECK_MEM for non-x86 systems to prevent FTBFS due to dynarec checks (Closes: #544549) * debian/control: - Depend on libxdg-basedir-dev and pkg-config to support xdg-basedir specification * debian/rules: - Disable assembler optimized parts on unsupported architectures * Add README.source with information about patch management * Add NEWS.Debian with information about migration of old data and configuration to new xdg compliant directories -- Sven Eckelmann Tue, 01 Sep 2009 20:40:30 +0200 mupen64plus (1.5+dfsg1-1) unstable; urgency=low * Initial release (Closes: #513322) * debian/patches: - Add 100-fix-desktop-file.patch, fix desktop file - Add 101-destdir.patch, fix usage of DESTDIR in install target - Add 102-plugin-searchpath.patch, add search path for plugins - Add 103-dejavu-font.patch, use font from ttf-dejavu-core package - Add 104-as-needed.patch, allow --as-needed to reduce number of linked libraries - Add 105-system-libpng.patch, use libpng from debian instead of buildin - Add 106-system-zlib.patch, use zlib from debian instead of buildin - Add 107-system-libbz2.patch, use libbz2 from debian instead of buildin - Add 108-remove-gln64.patch, don't try to build glN64 removed from dfsg tar - Add 109-remove-nondfsg-icons.patch, don't include non-dfsg icons which are removed from dfsg tarball - Add 110-glide64-noasm.patch, don't use x86-asm on non-x86 plattforms in glide64 - Add 111-rice-texturepack-crash.patch, Fix crash when loading textures from texturepacks with rice_video - Add 112-rice-screenflickering.patch, Reduce screenflickering in some games when using rice_video - Add 113-static-binutils-libs.patch, Link static against binutils libraries with unstable abi -- Sven Eckelmann Mon, 17 Aug 2009 10:18:49 +0200 debian/compat0000644000000000000000000000000212252624000010355 0ustar 9 debian/control0000644000000000000000000000716112252624000010567 0ustar Source: mupen64plus-core Section: games Priority: optional Maintainer: Tobias Loose Uploaders: Sven Eckelmann Standards-Version: 3.9.5 Homepage: http://code.google.com/p/mupen64plus/ Vcs-Git: git://anonscm.debian.org/collab-maint/mupen64plus-core.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/mupen64plus-core.git Build-Depends: debhelper (>= 9.20130604), dpkg-dev (>= 1.16.1.1), libfreetype6-dev, libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libpng-dev, libsdl2-dev, pkg-config, zlib1g-dev | libz-dev, Package: libmupen64plus2 Section: libs Architecture: any-i386 any-amd64 Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, ${shlibs:Depends}, mupen64plus-data, ttf-bitstream-vera, Provides: mupen64plus-audio-abi-2, mupen64plus-config-abi-2.2, mupen64plus-debug-abi-2, mupen64plus-frontend-abi-2.1.1, mupen64plus-gfx-abi-2.1, mupen64plus-gfx-abi-2.2, mupen64plus-input-abi-2, mupen64plus-rsp-abi-2, mupen64plus-vidext-abi-3, Breaks: mupen64plus-audio-sdl (<< 2.0), mupen64plus-input-sdl (<< 2.0), mupen64plus-video-glide64 (<< 2.0.0), mupen64plus-video-glide64mk2 (<< 2.0), mupen64plus-video-rice (<< 2.0), mupen64plus-video-z64 (<< 2.0.0), Description: plugin-based Nintendo 64 emulator, core library Flexible N64 Emulator for Linux that works with many ROMs that are publically available. It consists of separate components to provide an user interface, audio and graphics output, controller input, co-processor emulation and an emulator core. . It has the following features: * cheat system * exchangeable plugins for graphics, sound and input emulation * multiple save states * common configuration system for all components . This package contains the actual emulator which must be loaded by a frontend. Package: libmupen64plus2-dbg Section: debug Priority: extra Architecture: any-i386 any-amd64 Multi-Arch: same Pre-Depends: ${misc:Pre-Depends}, Depends: ${misc:Depends}, libmupen64plus2 (= ${binary:Version}), Description: mupen64plus debug symbols package Flexible N64 Emulator for Linux that works with many ROMs that are publically available. It consists of separate components to provide an user interface, audio and graphics output, controller input, co-processor emulation and an emulator core. . This package contains the debug files. Package: libmupen64plus-dev Section: libdevel Architecture: all Depends: ${misc:Depends}, Description: mupen64plus development package Flexible N64 Emulator for Linux that works with many ROMs that are publically available. It consists of separate components to provide an user interface, audio and graphics output, controller input, co-processor emulation and an emulator core. . This package contains everything which is needed to build plugins or frontends against the mupen64plus API. Package: mupen64plus-data Architecture: all Multi-Arch: foreign Depends: ${misc:Depends}, Breaks: mupen64plus (<< 1.99.1), libmupen64plus2 (<< 1.99.5-3), Replaces: mupen64plus (<< 1.99.1), libmupen64plus2 (<< 1.99.5-3), Description: plugin-based Nintendo 64 emulator, data files Flexible N64 Emulator for Linux that works with many ROMs that are publically available. It consists of separate components to provide an user interface, audio and graphics output, controller input, co-processor emulation and an emulator core. . It has the following features: * cheat system * exchangeable plugins for graphics, sound and input emulation * multiple save states * common configuration system for all components . This package contains the rom catalog and cheat database. debian/copyright0000644000000000000000000003040712252624000011116 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: mupen64plus-core Upstream-Contact: Richard 'Richard42' Goedeken Source: http://bitbucket.org/richard42/mupen64plus-core/ Files: * Copyright: 2008-2013, Richard 'Richard42' Goedeken License: GPL-2+ Files: data/mupen64plus.cht Copyright: 2008, Gent License: GPL-2+ Files: tools/*install_binary_bundle.sh Copyright: 2007-2013, The Mupen64Plus Development Team License: GPL-2+ Files: src/api/* Copyright: 2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/api/m64p_plugin.h Copyright: 2002, Hacktarux 2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/api/frontend.c src/api/m64p_types.h Copyright: 2009, Richard 'Richard42' Goedeken 2012, CasualJames License: GPL-2+ Files: src/api/vidext_sdl2_compat.h Copyright: 1997-2012, Sam Lantinga License: Zlib Files: src/debugger/* Copyright: 2002, davFr 2008, DarkJeztr License: GPL-2+ Files: src/debugger/dbg_types.h Copyright: 2002, davFr License: GPL-2+ Files: src/debugger/dbg_breakpoints.* Copyright: 2008, DarkJeztr 2008, HyperHacker License: GPL-2+ Files: src/debugger/dbg_breakpoints.* Copyright: 2008, ZZT32 License: GPL-2+ Files: src/debugger/dbg_decoder.c src/debugger/dbg_decoder_local.h Copyright: 1991-1993, The Regents of the University of California 2010, Marshall B. Rogers License: GPL-2+ Files: src/debugger/decoder.h Copyright: 2010, Marshall B. Rogers License: GPL-2+ Files: src/debugger/dbg_memory.c Copyright: 2002, Gregor 'Blight' Anich 2008, DarkJeztr License: GPL-2+ Files: src/main/md5.* Copyright: 1999, 2000, 2002 Aladdin Enterprises License: Zlib Files: src/main/cheat.c Copyright: 2008, Scott 'okaygo' Gorman 2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/main/cheat.h Copyright: 2008, Scott 'okaygo' Gorman License: GPL-2+ Files: src/main/eventloop.c Copyright: 2008, James 'Ebenblues' Hood 2008, John 'NMN' Chadwick 2008, Scott 'okaygo' Gorman 2008, Scott 'Tillin9' Knauert 2008-2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/main/lirc.* Copyright: 2008, Jesse 'DarkJezter' Dean License: GPL-2+ Files: src/main/zip/crypt.h Copyright: 1998-2005, Gilles Vollant License: Zlib Files: src/main/zip/ioapi.* src/main/zip/zip.* Copyright: 1998-2010, Gilles Vollant 2009-2010, Mathias Svensson License: Zlib Files: src/main/zip/unzip.* Copyright: 1998-2010, Gilles Vollant 2007-2008, Even Rouault 2009-2010, Mathias Svensson License: Zlib Files: src/main/main.c Copyright: 2002, Hacktarux 2008, James 'Ebenblues' Hood 2008, John 'NMN' Chadwick 2008, Scott 'okaygo' Gorman 2008, Scott 'Tillin9' Knauert 2008-2009, Richard 'Richard42' Goedeken 2012, CasualJames License: GPL-2+ Files: src/main/main.h Copyright: 2002, Gregor 'Blight' Anich 2012, CasualJames License: GPL-2+ Files: src/main/rom.* Copyright: 2002, Hacktarux 2008, Scott 'Tillin9' Knauert License: GPL-2+ Files: src/main/savestates.* Copyright: 2002, Hacktarux 2008, Richard 'Richard42' Goedeken 2008-2009, Scott 'Tillin9' Knauert 2009, Olejl 2012, CasualJames License: GPL-2+ Files: src/main/util.* src/memory/* Copyright: 2002, Hacktarux 2012, CasualJames License: GPL-2+ Files: src/main/version.h Copyright: 2008-2012, DarkJeztr 2008-2012, Scott 'Tillin9' Knauert 2008-2012, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/memory/n64_cic_nus_6105.* Copyright: 2011, X-Scale License: BSD-2-clause Files: src/memory/pif2.h Copyright: 2002, Zilmar License: GPL-2+ Files: src/r4300/x86_64/* src/plugin/plugin.* src/r4300/* Copyright: 2002, Hacktarux 2007-2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/r4300/profile.c Copyright: 2002, Hacktarux 2007-2009, CasualJames License: GPL-2+ Files: src/r4300/reset.* Copyright: 2008, James 'Ebenblues' Hood 2008, John 'NMN' Chadwick 2008, Scott 'okaygo' Gorman 2008, Scott 'Tillin9' Knauert 2008-2009, Richard 'Richard42' Goedeken 2011, CasualJames License: GPL-2+ Files: src/r4300/new_dynarec/* Copyright: 2002, Hacktarux 2009-2011, Ari64 License: GPL-2+ Files: src/osd/osd.* Copyright: 2008, John 'NMN' Chadwick 2008, James 'Ebenblues' Hood License: GPL-2+ Files: src/plugin/dummy_input.c Copyright: 2008, Scott 'okaygo' Gorman 2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/plugin/dummy_video.c Copyright: 2002, John 'NMN' Chadwick 2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/osd/OGLFT* Copyright: 2002, lignum Computing, Inc. License: LGPL-2.1+ Files: src/r4300/empty_dynarec.c Copyright: 2002, Hacktarux 2002, John 'NMN' Chadwick 2002, Richard 'Richard42' Goedeken License: GPL-2+ Files: src/r4300/fpu.h Copyright: 2010, Ari64 License: GPL-2+ Files: src/r4300/new_dynarec/* Copyright: 2009-2011, Ari64 License: GPL-2+ Files: data/font.ttf Copyright: 2003 Bitstream, Inc. License: other Copyright (C) 2003 Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc. . Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: . The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces. . The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera". . This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names. . The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. . THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. . Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: . Files: projects/unix/Makefile Copyright: 2007-2008, Jesse 'DarkJezter' Dean 2007-2008, Scott 'Tillin9' Knauert 2008-2009, Richard 'Richard42' Goedeken License: GPL-2+ Files: debian/* Copyright: 2009-2012, Sven Eckelmann 2009-2012, Tobias Loose License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems the full text of the GNU Lesser General Public License, version 2.1 or later, can be found in the `/usr/share/common-licenses/LGPL-2.1' file. License: Zlib Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: . 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. . This code is a modified version of crypting code in Infozip distribution License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY X-Scale ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL X-Scale OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/gbp.conf0000644000000000000000000000005712252624000010600 0ustar [DEFAULT] pristine-tar = True sign-tags = True debian/get-orig-source.sh0000755000000000000000000000145512252624000012536 0ustar #! /bin/sh set -e if [ -z "$DIR" ]; then DIR=mupen64plus-core fi if [ -z "$OWNER" ]; then OWNER=richard42 fi # try to download source package if [ "$1" != "snapshot" ]; then uscan --verbose --force-download else MODULE="${OWNER}/${DIR}" TMP="`mktemp -t -d`" hg clone --noupdate "http://bitbucket.org/${MODULE}" "${TMP}" REV="`hg --repository "${TMP}" log -r tip --template '{latesttag}+{latesttagdistance}+{node|short}\n'`" LONGREV="`hg --repository "${TMP}" log -r tip --template '{node}\n'`" TARNAME="${DIR}_${REV}.orig.tar" echo "${LONGREV}" EXCLUDE="--exclude ${TMP}/.hgtags --exclude ${TMP}/.hg_archival.txt --exclude ${TMP}/.hgignore" hg --repository "${TMP}" archive --no-decode --type tar --prefix "${DIR}-${REV}/" ${EXCLUDE} -r tip "${TARNAME}" gzip -n -f "${TARNAME}" rm -rf "${TMP}" fi debian/libmupen64plus-dev.install0000644000000000000000000000003112252624000014206 0ustar usr/include/mupen64plus/ debian/libmupen64plus2.docs0000644000000000000000000000000712252624000013001 0ustar README debian/libmupen64plus2.install0000644000000000000000000000001112252624000013512 0ustar usr/lib/ debian/libmupen64plus2.symbols0000644000000000000000000000417412252624000013552 0ustar libmupen64plus.so.2 libmupen64plus2 #MINVER# ConfigDeleteSection@Base 1.99.1 ConfigGetParamBool@Base 1.99.1 ConfigGetParamFloat@Base 1.99.1 ConfigGetParamInt@Base 1.99.1 ConfigGetParamString@Base 1.99.1 ConfigGetParameter@Base 1.99.1 ConfigGetParameterHelp@Base 1.99.1 ConfigGetParameterType@Base 1.99.3 ConfigGetSharedDataFilepath@Base 1.99.1 ConfigGetUserCachePath@Base 1.99.1 ConfigGetUserConfigPath@Base 1.99.1 ConfigGetUserDataPath@Base 1.99.1 ConfigHasUnsavedChanges@Base 1.99.5 ConfigListParameters@Base 1.99.1 ConfigListSections@Base 1.99.1 ConfigOpenSection@Base 1.99.1 ConfigRevertChanges@Base 1.99.5 ConfigSaveFile@Base 1.99.1 ConfigSaveSection@Base 1.99.5 ConfigSetDefaultBool@Base 1.99.1 ConfigSetDefaultFloat@Base 1.99.1 ConfigSetDefaultInt@Base 1.99.1 ConfigSetDefaultString@Base 1.99.1 ConfigSetParameter@Base 1.99.1 CoreAddCheat@Base 1.99.1 CoreAttachPlugin@Base 1.99.1 CoreCheatEnabled@Base 1.99.1 CoreDetachPlugin@Base 1.99.1 CoreDoCommand@Base 1.99.1 CoreErrorMessage@Base 1.99.1 CoreGetAPIVersions@Base 1.99.5 CoreGetRomSettings@Base 1.99.4 CoreOverrideVidExt@Base 1.99.1 CoreShutdown@Base 1.99.1 CoreStartup@Base 1.99.1 DebugBreakpointCommand@Base 1.99.1 DebugBreakpointLookup@Base 1.99.1 DebugDecodeOp@Base 1.99.1 DebugGetCPUDataPtr@Base 1.99.1 DebugGetState@Base 1.99.1 DebugMemGetMemInfo@Base 1.99.1 DebugMemGetPointer@Base 1.99.1 DebugMemGetRecompInfo@Base 1.99.1 DebugMemRead16@Base 1.99.1 DebugMemRead32@Base 1.99.1 DebugMemRead64@Base 1.99.1 DebugMemRead8@Base 1.99.1 DebugMemWrite16@Base 1.99.1 DebugMemWrite32@Base 1.99.1 DebugMemWrite64@Base 1.99.1 DebugMemWrite8@Base 1.99.1 DebugSetCallbacks@Base 1.99.1 DebugSetCoreCompare@Base 1.99.1 DebugSetRunState@Base 1.99.1 DebugStep@Base 1.99.1 PluginGetVersion@Base 1.99.1 VidExt_GL_GetAttribute@Base 1.99.5 VidExt_GL_GetProcAddress@Base 1.99.2 VidExt_GL_SetAttribute@Base 1.99.1 VidExt_GL_SwapBuffers@Base 1.99.1 VidExt_Init@Base 1.99.1 VidExt_ListFullscreenModes@Base 1.99.1 VidExt_Quit@Base 1.99.1 VidExt_ResizeWindow@Base 2.0 VidExt_SetCaption@Base 1.99.1 VidExt_SetVideoMode@Base 1.99.1 VidExt_ToggleFullScreen@Base 1.99.1 debian/mupen64plus-data.install0000644000000000000000000000003512252624000013656 0ustar usr/share/games/mupen64plus/ debian/patches/0000755000000000000000000000000012252624000010606 5ustar debian/patches/bitstream-font.patch0000644000000000000000000000274412252624000014574 0ustar Description: Use font from ttf-bitstream-vera Forwarded: not-needed Author: Sven Eckelmann --- diff --git a/projects/unix/Makefile b/projects/unix/Makefile index 038e836c64e7d4fee17236e88e465417304ef0c8..08d0eb49c9f38fe15451ab20d1a6ebf2080b042e 100644 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -550,6 +550,7 @@ install: $(TARGET) $(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(LIBDIR)" $(INSTALL) -d "$(DESTDIR)$(SHAREDIR)" $(INSTALL) -m 0644 ../../data/* "$(DESTDIR)$(SHAREDIR)" + $(RM) "$(DESTDIR)$(SHAREDIR)"/font.ttf $(INSTALL) -d "$(DESTDIR)$(INCDIR)" $(INSTALL) -m 0644 ../../src/api/m64p_*.h "$(DESTDIR)$(INCDIR)" -$(LDCONFIG) "$(DESTDIR)$(LIBDIR)" diff --git a/src/osd/osd.cpp b/src/osd/osd.cpp index c06b9bbea43d8a878c0e66bfa6829a75bd4377af..bbb2b1b2cb01c9bf032b62edacaa21e5e1f96390 100644 --- a/src/osd/osd.cpp +++ b/src/osd/osd.cpp @@ -40,7 +40,7 @@ extern "C" { #include "plugin/plugin.h" } -#define FONT_FILENAME "font.ttf" +#define FONT_FILENAME "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf" typedef void (APIENTRYP PTRGLACTIVETEXTURE)(GLenum texture); static PTRGLACTIVETEXTURE pglActiveTexture = NULL; @@ -231,7 +231,7 @@ void osd_init(int width, int height) return; } - fontpath = ConfigGetSharedDataFilepath(FONT_FILENAME); + fontpath = FONT_FILENAME; l_font = new OGLFT::Monochrome(fontpath, (float) height / 35.0f); // make font size proportional to screen height debian/patches/config_currentstateslot.patch0000644000000000000000000000135412252624000016604 0ustar Description: Use correct config parameter string (CurrentSaveSlot->CurrentStateSlot) Author: littleguy77 --- diff --git a/src/main/savestates.c b/src/main/savestates.c index ff03f99ce579e90902455a49487fd05448e11aba..de51f3a84beab32ce54ff98e77c366dcf47db22e 100644 --- a/src/main/savestates.c +++ b/src/main/savestates.c @@ -118,7 +118,7 @@ void savestates_select_slot(unsigned int s) if(s>9||s==slot) return; slot = s; - ConfigSetParameter(g_CoreConfig, "CurrentSaveSlot", M64TYPE_INT, &s); + ConfigSetParameter(g_CoreConfig, "CurrentStateSlot", M64TYPE_INT, &s); StateChanged(M64CORE_SAVESTATE_SLOT, slot); main_message(M64MSG_STATUS, OSD_BOTTOM_LEFT, "Selected state slot: %d", slot); debian/patches/counter_per_op.patch0000644000000000000000000002133712252624000014660 0ustar Description: Allow to overwrite the cycles per instruction Some ROMs require a different average cycles per instruction count than the default one (2 per emulated instruction). This setting is necessary because mupen64plus is not cycle accurate. A complete simulation of pipeline, cache, bus and so on is necessary to get it perfectly without this workaround. . Known titles which require a CounterPerOp of 1 are * 64 de Hakken!! Tamagotchi - Minna de Tamagotchi World * 64 Oozumou * A Bug's Life * Airboarder 64 * Bass Hunter 64 * Bass Rush - ECOGEAR PowerWorm Championship * Bassmasters 2000 * Biohazard 2 * Body Harvest * California Speed * Carmageddon 64 * Charlie Blast's Territory * City Tour Grandprix - Zennihon GT Senshuken * Destruction Derby 64 * Disney's Tarzan * Donkey Kong 64 * Duck Dodgers Starring Daffy Duck * Duke Nukem - ZER0 H0UR * Excitebike 64 * Fighting Force 64 * Flying Dragon * Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou! * GT 64 - Championship Edition * Hamster Monogatari 64 * Harvest Moon 64 * Hercules - The Legendary Journeys * Hexen * Hiryuu no Ken Twin * In-Fisherman Bass Hunter 64 * International Superstar Soccer 64 * Itoi Shigesato no Bass Tsuri No. 1 Kettei Ban! * Jikkyou G1 Stable * Jikkyou World Soccer 3 * Madden NFL 2000 * Madden NFL 2001 * Madden NFL 2002 * Madden NFL 99 * Mario Party * Mario Party 2 * Mario Party 3 * Mario Story * Monopoly * Mystical Ninja 2 Starring Goemon * NBA In the Zone '99 * NBA Showtime - NBA on NBC * Nightmare Creatures * Nintama Rantarou 64 Game Gallery * Nuclear Strike 64 * Nushi Duri 64 * Nushi Duri 64 - Shiokaze ni Notte * Paper Mario * Pro Mahjong Kiwame 64 * Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen * Quake II * Razor Freestyle Scooter * Ready 2 Rumble Boxing Round 2 * Resident Evil 2 * Roadsters Trophy * Rush 2 - Extreme Racing USA * San Francisco Rush 2049 * Shadow Man * Tigger's Honey Hunt * Toy Story 2 * Triple Play 2000 * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou * Vigilante 8 * Vigilante 8 - 2nd Offence * Virtual Pool 64 * War Gods * WCW-nWo Revenge * Wipeout 64 * HardCoded by Iceage * Spacer by Memir (POM '99) . Known titles which require a CounterPerOp of 3 are * BattleTanx * BattleTanx - Global Assault * Beetle Adventure Racing! * Disney's Donald Duck - Goin' Quackers * Donald Duck - Quack Attack * HSV Adventure Racing * Jikkyou Powerful Pro Yakyuu Basic Ban 2001 * LEGO Racers * Monster Truck Madness 64 * Pilotwings 64 * Road Rash 64 * Wave Race 64 - Shindou Edition * WCW Nitro * Wetrix Author: Sven Eckelmann --- diff --git a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt index cc0876b92b510f07cb2a392cd79c2817685d5c5b..a5f49f6f4827c469d94d607c75eaa492e0457d26 100644 --- a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt +++ b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt @@ -55,6 +55,10 @@ These are standard parameters which are used by the Mupen64Plus Core library. T |M64TYPE_STRING |Path to a directory to search when looking for shared data files in the ConfigGetSharedDataFilepath() function. |- +|CountPerOp +|M64TYPE_INT +|Force number of cycles per emulated instruction when set greater than 0. +|- |} These configuration parameters are used in the Core's event loop to detect keyboard and joystick commands. They are stored in a configuration section called "CoreEvents" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately. The Keysym value stored is actually (SDLMod << 16) || SDLKey, so that keypresses with modifiers like shift, control, or alt may be used. diff --git a/src/main/main.c b/src/main/main.c index 0929fe718fcc9d55d7657edacc689d2f8c324780..a101782fd3eeeca3208d8cc580f338929d790cf3 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -194,6 +194,7 @@ int main_set_core_defaults(void) ConfigSetDefaultString(g_CoreConfig, "SaveStatePath", "", "Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of ${UserConfigPath}/save will be used"); ConfigSetDefaultString(g_CoreConfig, "SaveSRAMPath", "", "Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of ${UserConfigPath}/save will be used"); ConfigSetDefaultString(g_CoreConfig, "SharedDataPath", "", "Path to a directory to search when looking for shared data files"); + ConfigSetDefaultInt(g_CoreConfig, "CountPerOp", 0, "Force number of cycles per emulated instruction"); /* handle upgrades */ if (bUpgrade) @@ -734,6 +735,9 @@ m64p_error main_run(void) savestates_set_autoinc_slot(ConfigGetParamBool(g_CoreConfig, "AutoStateSlotIncrement")); savestates_select_slot(ConfigGetParamInt(g_CoreConfig, "CurrentStateSlot")); no_compiled_jump = ConfigGetParamBool(g_CoreConfig, "NoCompiledJump"); + count_per_op = ConfigGetParamInt(g_CoreConfig, "CountPerOp"); + if (count_per_op <= 0) + count_per_op = 2; // initialize memory, and do byte-swapping if it's not been done yet if (g_MemHasBeenBSwapped == 0) diff --git a/src/r4300/interupt.c b/src/r4300/interupt.c index 32255597cdd54dc65b8cc5eb68e94b3f50be7a67..b7d2e5094c0bd01465dcbbce8ac6005761923ef1 100644 --- a/src/r4300/interupt.c +++ b/src/r4300/interupt.c @@ -423,9 +423,9 @@ void gen_interupt(void) case COMPARE_INT: remove_interupt_event(); - Count+=2; + Count+=count_per_op; add_interupt_event_count(COMPARE_INT, Compare); - Count-=2; + Count-=count_per_op; Cause = (Cause | 0x8000) & 0xFFFFFF83; if ((Status & 7) != 1) return; diff --git a/src/r4300/r4300.c b/src/r4300/r4300.c index 9a64fdb480602359359ba7e41fc6f7945fe1852a..200722ed811803bdad17bf7d7fc1662c6b98d24d 100644 --- a/src/r4300/r4300.c +++ b/src/r4300/r4300.c @@ -45,6 +45,7 @@ unsigned int r4300emu = 0; int no_compiled_jump = 0; +unsigned int count_per_op = 2; int llbit, rompause; #if NEW_DYNAREC != NEW_DYNAREC_ARM int stop; @@ -705,7 +706,7 @@ void update_count(void) if (r4300emu != CORE_DYNAREC) { #endif - Count = Count + (PC->addr - last_addr)/2; + Count += ((PC->addr - last_addr) >> 2) * count_per_op; last_addr = PC->addr; #ifdef NEW_DYNAREC } diff --git a/src/r4300/r4300.h b/src/r4300/r4300.h index 399a9fbaa1460d02cff831b2d7c5a1efd0471edc..7c0b9488424638199cd876f05f67208c119b9878 100644 --- a/src/r4300/r4300.h +++ b/src/r4300/r4300.h @@ -47,6 +47,7 @@ extern unsigned int last_addr; extern char invalid_code[0x100000]; extern unsigned int jump_to_address; extern int no_compiled_jump; +extern unsigned int count_per_op; void init_blocks(void); void free_blocks(void); diff --git a/src/r4300/x86/gr4300.c b/src/r4300/x86/gr4300.c index d2ed999728842ca39e299cbd039338b1d5aee39e..30484a563641381fee8799070fe60a34ba221aa0 100644 --- a/src/r4300/x86/gr4300.c +++ b/src/r4300/x86/gr4300.c @@ -44,25 +44,20 @@ static int eax, ebx, ecx, edx, esp, ebp, esi, edi; int branch_taken; /* static functions */ - static void genupdate_count(unsigned int addr) { -#ifndef COMPARE_CORE -#ifndef DBG +#if !defined(COMPARE_CORE) && !defined(DBG) mov_reg32_imm32(EAX, addr); sub_reg32_m32(EAX, (unsigned int*)(&last_addr)); - shr_reg32_imm8(EAX, 1); + shr_reg32_imm8(EAX, 2); + mov_reg32_m32(EDX, &count_per_op); + mul_reg32(EDX); add_m32_reg32((unsigned int*)(&Count), EAX); #else mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); mov_reg32_imm32(EAX, (unsigned int)update_count); call_reg32(EAX); #endif -#else - mov_m32_imm32((unsigned int*)(&PC), (unsigned int)(dst+1)); - mov_reg32_imm32(EAX, (unsigned int)update_count); - call_reg32(EAX); -#endif } static void gencheck_interupt(unsigned int instr_structure) diff --git a/src/r4300/x86_64/gr4300.c b/src/r4300/x86_64/gr4300.c index 15db43fd54563a8e2197b60ad03e3b445cf62bdc..0354fde3556a1bf58b6b37b9944ef0f661d722f4 100644 --- a/src/r4300/x86_64/gr4300.c +++ b/src/r4300/x86_64/gr4300.c @@ -84,13 +84,14 @@ static long long debug_reg_storage[8]; int branch_taken = 0; /* static functions */ - static void genupdate_count(unsigned int addr) { -#if !defined(COMPARE_CORE) && !defined(DBG) +#if !defined(COMPARE_CORE) && !defined(DBG) && 0 mov_reg32_imm32(EAX, addr); sub_xreg32_m32rel(EAX, (unsigned int*)(&last_addr)); - shr_reg32_imm8(EAX, 1); + shr_reg32_imm8(EAX, 2); + mov_xreg32_m32rel(EDX, (void*)&count_per_op); + mul_reg32(EDX); add_m32rel_xreg32((unsigned int*)(&Count), EAX); #else mov_reg64_imm64(RAX, (unsigned long long) (dst+1)); debian/patches/delay_si.patch0000644000000000000000000001074512252624000013427 0ustar Description: Allow to disable interrupt delay after DMA SI read/write Titles like Banjo Tooie are known to hang because the interrupt after the SI read/write is delayed. But there are also titles which are known to have problems when delay is enabled. Examples are * Body Harvest * City Tour Grandprix - Zennihon GT Senshuken * Cruis'n USA * GT 64 - Championship Edition * Nightmare Creatures * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou Author: Sven Eckelmann --- diff --git a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt index a5f49f6f4827c469d94d607c75eaa492e0457d26..bf90febd563edb1bfd141a76e92d49116b6c8bd9 100644 --- a/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt +++ b/doc/emuwiki-api-doc/Mupen64Plus_Core_Parameters.txt @@ -59,6 +59,10 @@ These are standard parameters which are used by the Mupen64Plus Core library. T |M64TYPE_INT |Force number of cycles per emulated instruction when set greater than 0. |- +|DelaySI +|M64TYPE_BOOL +|Delay interrupt after DMA SI read/write. +|- |} These configuration parameters are used in the Core's event loop to detect keyboard and joystick commands. They are stored in a configuration section called "CoreEvents" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately. The Keysym value stored is actually (SDLMod << 16) || SDLKey, so that keypresses with modifiers like shift, control, or alt may be used. diff --git a/src/main/main.c b/src/main/main.c index a101782fd3eeeca3208d8cc580f338929d790cf3..2dd11eff54416bdcded7aab5884396d37088e9fd 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -194,6 +194,7 @@ int main_set_core_defaults(void) ConfigSetDefaultString(g_CoreConfig, "SaveStatePath", "", "Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of ${UserConfigPath}/save will be used"); ConfigSetDefaultString(g_CoreConfig, "SaveSRAMPath", "", "Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of ${UserConfigPath}/save will be used"); ConfigSetDefaultString(g_CoreConfig, "SharedDataPath", "", "Path to a directory to search when looking for shared data files"); + ConfigSetDefaultBool(g_CoreConfig, "DelaySI", 1, "Delay interrupt after DMA SI read/write"); ConfigSetDefaultInt(g_CoreConfig, "CountPerOp", 0, "Force number of cycles per emulated instruction"); /* handle upgrades */ @@ -735,6 +736,7 @@ m64p_error main_run(void) savestates_set_autoinc_slot(ConfigGetParamBool(g_CoreConfig, "AutoStateSlotIncrement")); savestates_select_slot(ConfigGetParamInt(g_CoreConfig, "CurrentStateSlot")); no_compiled_jump = ConfigGetParamBool(g_CoreConfig, "NoCompiledJump"); + delay_si = ConfigGetParamBool(g_CoreConfig, "DelaySI"); count_per_op = ConfigGetParamInt(g_CoreConfig, "CountPerOp"); if (count_per_op <= 0) count_per_op = 2; diff --git a/src/main/main.h b/src/main/main.h index 1ffaccdd985f2a995e8faeee1b81c11a959a6c30..9c24a0e4ae8ea33b414199727a0aac0eaf2ebccd 100644 --- a/src/main/main.h +++ b/src/main/main.h @@ -33,6 +33,8 @@ extern int g_EmulatorRunning; extern m64p_frame_callback g_FrameCallback; +extern int delay_si; + const char* get_savestatepath(void); const char* get_savesrampath(void); diff --git a/src/memory/dma.c b/src/memory/dma.c index 8d606d40e4d430f704ea99055ea42adabab1ee54..4e08878cc118f64993b43444b30334f9f7277c55 100644 --- a/src/memory/dma.c +++ b/src/memory/dma.c @@ -45,6 +45,7 @@ #include "main/util.h" static unsigned char sram[0x8000]; +int delay_si = 0; static char *get_sram_path(void) { @@ -354,7 +355,14 @@ void dma_si_write(void) update_pif_write(); update_count(); - add_interupt_event(SI_INT, /*0x100*/0x900); + + if (delay_si) { + add_interupt_event(SI_INT, /*0x100*/0x900); + } else { + MI_register.mi_intr_reg |= 0x02; // SI + si_register.si_stat |= 0x1000; // INTERRUPT + check_interupt(); + } } void dma_si_read(void) @@ -375,6 +383,13 @@ void dma_si_read(void) } update_count(); - add_interupt_event(SI_INT, /*0x100*/0x900); + + if (delay_si) { + add_interupt_event(SI_INT, /*0x100*/0x900); + } else { + MI_register.mi_intr_reg |= 0x02; // SI + si_register.si_stat |= 0x1000; // INTERRUPT + check_interupt(); + } } debian/patches/disable_recompiler_disassembler.patch0000644000000000000000000000271112252624000020211 0ustar Description: Disable the disassembler of the recompiled code The interface of libopcode.so and libbfd.so is not stable and therefore not allowed to use in Debian. The libopcode.a and libbfd.a don't provide PIC object files and therefore cannot be linked to the PIC shared object. . This part of the debugging interface can be disabled because their is no known user interface that has support for it. Author: Sven Eckelmann --- diff --git a/projects/unix/Makefile b/projects/unix/Makefile index 08d0eb49c9f38fe15451ab20d1a6ebf2080b042e..63ce323e025798e84a406d1b4434d38e7e3648b7 100644 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -497,7 +497,7 @@ ifeq ($(DEBUGGER), 1) $(SRCDIR)/debugger/dbg_decoder.c \ $(SRCDIR)/debugger/dbg_memory.c \ $(SRCDIR)/debugger/dbg_breakpoints.c - LDLIBS += -lopcodes -lbfd +# LDLIBS += -lopcodes -lbfd endif # generate a list of object files to build, make a temporary directory for them diff --git a/src/debugger/dbg_memory.c b/src/debugger/dbg_memory.c index c8988bf867763fb69d27626bd82e8b2895a879af..93510c30b3ec4499ba28b3707a1020e1f7868412 100644 --- a/src/debugger/dbg_memory.c +++ b/src/debugger/dbg_memory.c @@ -73,7 +73,7 @@ static MEMBREAKREAD(read_romd, 8); static MEMBREAKWRITE(write_rom, 8); -#if !defined(NO_ASM) && (defined(__i386__) || defined(__x86_64__)) +#if !defined(NO_ASM) && (defined(__i386__) || defined(__x86_64__)) && 0 #include #include debian/patches/multiple_main.patch0000644000000000000000000000105412252624000014466 0ustar Description: Fix multiple definitions of main in same namespace Author: Sven Eckelmann --- diff --git a/src/main/main.c b/src/main/main.c index a710bc1d5ad02bb73097da509ce709e533a3f74d..0929fe718fcc9d55d7657edacc689d2f8c324780 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -859,12 +859,3 @@ void main_stop(void) } #endif } - -/********************************************************************************************************* -* main function -*/ -int main(int argc, char *argv[]) -{ - return 1; -} - debian/patches/n64_cic_nus_6105_reset.patch0000644000000000000000000000160212252624000015615 0ustar Description: Reset PIF_RAMb 46,47 after the n64_cic_nus_6105 challenge Response check fails when the PIF RAM is is not set to zero for byte 46+47 Origin: upstream, https://bitbucket.org/richard42/mupen64plus-core/commits/9b7c7758d2bf0b20ff7440659f26a8695fb7d1cb Author: Sven Eckelmann --- diff --git a/src/memory/pif.c b/src/memory/pif.c index b20c4e7e87abef19bba6c5a398c0207c5adf15a1..9bec74f5022e8c3bce3b2cb68af405716ff75af5 100644 --- a/src/memory/pif.c +++ b/src/memory/pif.c @@ -492,6 +492,8 @@ void update_pif_write(void) } // calculate the proper response for the given challenge (X-Scale's algorithm) n64_cic_nus_6105(challenge, response, CHL_LEN - 2); + PIF_RAMb[46] = 0; + PIF_RAMb[47] = 0; // re-format the 'response' into a byte stream for (i = 0; i < 15; i++) { debian/patches/obsolete_variable.patch0000644000000000000000000000423512252624000015314 0ustar Description: Remove obsolete variable; caused crashes in PD/Goldeneye in Android Ed. Author: littleguy77 --- diff --git a/src/r4300/interpreter_cop0.def b/src/r4300/interpreter_cop0.def index 313ec9db440b7c367dfbe95ce81e2bc0635ac1d4..98f8eaa597b0b7fd936e3c5c444ed5ec998f05a5 100644 --- a/src/r4300/interpreter_cop0.def +++ b/src/r4300/interpreter_cop0.def @@ -72,10 +72,8 @@ DECLARE_INSTRUCTION(MTC0) interupt_unsafe_state = 1; if (next_interupt <= Count) gen_interupt(); interupt_unsafe_state = 0; - debug_count += Count; translate_event_queue((unsigned int) rrt & 0xFFFFFFFF); Count = (unsigned int) rrt & 0xFFFFFFFF; - debug_count -= Count; break; case 10: // EntryHi EntryHi = (unsigned int) rrt & 0xFFFFE0FF; diff --git a/src/r4300/r4300.c b/src/r4300/r4300.c index 200722ed811803bdad17bf7d7fc1662c6b98d24d..5b57ce694d17aaabe18e864eef379f2e024c396d 100644 --- a/src/r4300/r4300.c +++ b/src/r4300/r4300.c @@ -61,7 +61,6 @@ long long int local_rs; long long int reg_cop1_fgr_64[32]; tlb tlb_e[32]; unsigned int delay_slot, skip_jump = 0, dyna_interp = 0, last_addr; -unsigned long long int debug_count = 0; unsigned int CIC_Chip; char invalid_code[0x100000]; @@ -983,7 +982,6 @@ void r4300_execute(void) current_instruction_table = cached_interpreter_table; - debug_count = 0; delay_slot=0; stop = 0; rompause = 0; @@ -1067,7 +1065,6 @@ void r4300_execute(void) free_blocks(); } - debug_count+= Count; DebugMessage(M64MSG_INFO, "R4300 emulator finished."); /* print instruction counts */ diff --git a/src/r4300/r4300.h b/src/r4300/r4300.h index 7c0b9488424638199cd876f05f67208c119b9878..679690351a0fd467087afde3ea4e2ad3ad5487a7 100644 --- a/src/r4300/r4300.h +++ b/src/r4300/r4300.h @@ -39,7 +39,6 @@ extern long long int reg_cop1_fgr_64[32]; extern int FCR0, FCR31; extern tlb tlb_e[32]; extern unsigned int delay_slot, skip_jump, dyna_interp, op; -extern unsigned long long int debug_count; extern unsigned int r4300emu; extern unsigned int next_interupt, CIC_Chip; extern int rounding_mode, trunc_mode, round_mode, ceil_mode, floor_mode; debian/patches/oot_subscreen_delay_fix.patch0000644000000000000000000001406112252624000016527 0ustar Description: Add Missing Subscreen Delay Fix for Ocarina of Time Mupen64plus contains built-in cheats for Ocarina of Time, which activates the essential subscreen delay fix. However, the built-in code for Master Quest only works for the (E) version of Master Quest, and not the (U) version. The file also does not include the (U) (GC) version of Ocarina of Time. Master Quest and the GC versions of Ocarina of Time also need the End Credits Fix, otherwise these games will crash when the credits are displayed. Author: Joel 'iLag' Hammond --- diff --git a/src/main/cheat.c b/src/main/cheat.c index 52551ce0a0185b4c165402b3ba0f49563e0073f0..7266762fda1d063c89f6b671ddcfeef9039c37e1 100644 --- a/src/main/cheat.c +++ b/src/main/cheat.c @@ -205,25 +205,87 @@ void cheat_apply_cheats(int entry) int execute_next; // If game is Zelda OOT, apply subscreen delay fix - if (strncmp((char *)ROM_HEADER.Name, "THE LEGEND OF ZELDA", 19) == 0 && entry == ENTRY_VI) { + if (entry == ENTRY_VI && strncmp((char *)ROM_HEADER.Name, "THE LEGEND OF ZELDA", 19) == 0) { + uint32_t subscreen_address = 0; + uint32_t credits_address[4]; + credits_address[0] = 0; if (sl(ROM_HEADER.CRC1) == 0xEC7011B7 && sl(ROM_HEADER.CRC2) == 0x7616D72B) { // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.0) - execute_cheat(0x801DA5CB, 0x0002, NULL); + subscreen_address = 0x801DA5CB; } else if (sl(ROM_HEADER.CRC1) == 0xD43DA81F && sl(ROM_HEADER.CRC2) == 0x021E1E19) { // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.1) - execute_cheat(0x801DA78B, 0x0002, NULL); + subscreen_address = 0x801DA78B; } else if (sl(ROM_HEADER.CRC1) == 0x693BA2AE && sl(ROM_HEADER.CRC2) == 0xB7F14E9F) { // Legend of Zelda, The - Ocarina of Time (U) + (J) (V1.2) - execute_cheat(0x801DAE8B, 0x0002, NULL); + subscreen_address = 0x801DAE8B; } else if (sl(ROM_HEADER.CRC1) == 0xB044B569 && sl(ROM_HEADER.CRC2) == 0x373C1985) { // Legend of Zelda, The - Ocarina of Time (E) (V1.0) - execute_cheat(0x801D860B, 0x0002, NULL); + subscreen_address = 0x801D860B; } else if (sl(ROM_HEADER.CRC1) == 0xB2055FBD && sl(ROM_HEADER.CRC2) == 0x0BAB4E0C) { // Legend of Zelda, The - Ocarina of Time (E) (V1.1) - execute_cheat(0x801D864B, 0x0002, NULL); + subscreen_address = 0x801D864B; + // GC Versions such as Master Quest also require the End Credits Fix. + } else if (sl(ROM_HEADER.CRC1) == 0x1D4136F3 && sl(ROM_HEADER.CRC2) == 0xAF63EEA9) { + // Legend of Zelda, The - Ocarina of Time - Master Quest (E) (GC Version) + subscreen_address = 0x801D8F4B; + credits_address[0] = 0xD109A8C4; + credits_address[1] = 0x8109A8C4; + credits_address[2] = 0xD109A8C6; + credits_address[3] = 0x8109A8C6; + } else if (sl(ROM_HEADER.CRC1) == 0x09465AC3 && sl(ROM_HEADER.CRC2) == 0xF8CB501B) { + // Legend of Zelda, The - Ocarina of Time (E) (GC Version) + subscreen_address = 0x801D8F8B; + credits_address[0] = 0xD109A8E4; + credits_address[1] = 0x8109A8E4; + credits_address[2] = 0xD109A8E6; + credits_address[3] = 0x8109A8E6; + } else if (sl(ROM_HEADER.CRC1) == 0xF3DD35BA && sl(ROM_HEADER.CRC2) == 0x4152E075) { + // Legend of Zelda, The - Ocarina of Time (U) (GC Version) + subscreen_address = 0x801DB78B; + credits_address[0] = 0xD109A814; + credits_address[1] = 0x8109A814; + credits_address[2] = 0xD109A816; + credits_address[3] = 0x8109A816; + } else if (sl(ROM_HEADER.CRC1) == 0xF034001A && sl(ROM_HEADER.CRC2) == 0xAE47ED06) { + // Legend of Zelda, The - Ocarina of Time - Master Quest (U) (GC Version) + subscreen_address = 0x801DB74B; + credits_address[0] = 0xD109A7F4; + credits_address[1] = 0x8109A7F4; + credits_address[2] = 0xD109A7F6; + credits_address[3] = 0x8109A7F6; + } else if (sl(ROM_HEADER.CRC1) == 0xF7F52DB8 && sl(ROM_HEADER.CRC2) == 0x2195E636) { + // Zelda no Densetsu - Toki no Ocarina - Zelda Collection Version (J) (GC Version) + subscreen_address = 0x801DB78B; + credits_address[0] = 0xD109A814; + credits_address[1] = 0x8109A814; + credits_address[2] = 0xD109A816; + credits_address[3] = 0x8109A816; + } else if (sl(ROM_HEADER.CRC1) == 0xF611F4BA && sl(ROM_HEADER.CRC2) == 0xC584135C) { + // Zelda no Densetsu - Toki no Ocarina GC (J) (GC Version) + subscreen_address = 0x801DB78B; + credits_address[0] = 0xD109A834; + credits_address[1] = 0x8109A834; + credits_address[2] = 0xD109A836; + credits_address[3] = 0x8109A836; + } else if (sl(ROM_HEADER.CRC1) == 0xF43B45BA && sl(ROM_HEADER.CRC2) == 0x2F0E9B6F) { + // Zelda no Densetsu - Toki no Ocarina GC Ura (J) (GC Version) + subscreen_address = 0x801DB78B; + credits_address[0] = 0xD109A814; + credits_address[1] = 0x8109A814; + credits_address[2] = 0xD109A816; + credits_address[3] = 0x8109A816; } else { - // Legend of Zelda, The - Ocarina of Time Master Quest - execute_cheat(0x801D8F4B, 0x0002, NULL); + // UNKNOWN VERSION + DebugMessage(M64MSG_WARNING, "Warning: Ocarina of Time version could not be determined. No fixes applied."); + } + if (subscreen_address) { + execute_cheat(subscreen_address, 0x0002, NULL); + if (credits_address[0]){ + if (execute_cheat(credits_address[0], 0x0320, NULL)); + execute_cheat(credits_address[1], 0x0000, NULL); + if (execute_cheat(credits_address[2], 0xF809, NULL)); + execute_cheat(credits_address[3], 0x0000, NULL); + } } } debian/patches/printf_fixup.patch0000644000000000000000000000553712252624000014356 0ustar Description: Add printf-format attribute The compiler needs to get more information for function declaration to help to find printf specific format attacks. Forwarded: not-needed Author: Sven Eckelmann --- diff --git a/src/api/callbacks.h b/src/api/callbacks.h index 50b67a661b64642041de6042a87a19894ca2876f..55a84bcb9c61339b2795a0c91add3f04d83c0ab8 100644 --- a/src/api/callbacks.h +++ b/src/api/callbacks.h @@ -32,7 +32,7 @@ /* Functions for use by the Core, to send information back to the front-end app */ extern m64p_error SetDebugCallback(ptr_DebugCallback pFunc, void *Context); extern m64p_error SetStateCallback(ptr_StateCallback pFunc, void *Context); -extern void DebugMessage(int level, const char *message, ...); +extern void DebugMessage(int level, const char *message, ...) __attribute__ ((format (printf, 2, 3))); extern void StateChanged(m64p_core_param param_type, int new_value); #endif /* API_CALLBACKS_H */ diff --git a/src/debugger/dbg_decoder.c b/src/debugger/dbg_decoder.c index 6cd56ba7bac99e08b81374c5c2cdc900d2fb127d..99ff7a92b62a8dde15124abc7eaa070d59daa90b 100644 --- a/src/debugger/dbg_decoder.c +++ b/src/debugger/dbg_decoder.c @@ -228,6 +228,11 @@ lookup_rel_lo16 ( struct r4k_dis_t * state, static int db_printf ( struct r4k_dis_t * state, char * fmt, + ... ) __attribute__ ((format (printf, 2, 3))); + +static int +db_printf ( struct r4k_dis_t * state, + char * fmt, ... ) { int l; diff --git a/src/main/main.h b/src/main/main.h index d034c909e469d0c2164791730cc77b3447a834b7..1ffaccdd985f2a995e8faeee1b81c11a959a6c30 100644 --- a/src/main/main.h +++ b/src/main/main.h @@ -40,7 +40,7 @@ void new_frame(void); void new_vi(void); int main_set_core_defaults(void); -void main_message(m64p_msg_level level, unsigned int osd_corner, const char *format, ...); +void main_message(m64p_msg_level level, unsigned int osd_corner, const char *format, ...) __attribute__ ((format (printf, 3, 4))); m64p_error main_run(void); void main_stop(void); diff --git a/src/osd/osd.h b/src/osd/osd.h index bbdd699ed8c49fa869e37cd931fc4d1dba62da70..8779ffb9ebf3b0dbcbc06d548a4951866198454d 100644 --- a/src/osd/osd.h +++ b/src/osd/osd.h @@ -93,8 +93,8 @@ extern "C" { void osd_init(int width, int height); void osd_exit(void); void osd_render(void); -osd_message_t * osd_new_message(enum osd_corner, const char *, ...); -void osd_update_message(osd_message_t *, const char *, ...); +osd_message_t * osd_new_message(enum osd_corner, const char *, ...) __attribute__ ((format (printf, 2, 3))); +void osd_update_message(osd_message_t *, const char *, ...) __attribute__ ((format (printf, 2, 3))); void osd_delete_message(osd_message_t *); void osd_message_set_static(osd_message_t *); void osd_message_set_user_managed(osd_message_t *); debian/patches/sdl2_keysym.patch0000644000000000000000000021177512252624000014111 0ustar Description: Use SDL1.2 keysym in the config when using SDL2 It is easier for a user to keep the old SDL1.2 values for the keys in the config instead of converting them by hand. This is extreme important when the default (automatic) config is used. Author: Sven Eckelmann --- diff --git a/projects/unix/Makefile b/projects/unix/Makefile index 63ce323e025798e84a406d1b4434d38e7e3648b7..190a0a3756ca439eec8369160b8f8e98d5b95acd 100644 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -383,6 +383,7 @@ SOURCE = \ $(SRCDIR)/main/md5.c \ $(SRCDIR)/main/rom.c \ $(SRCDIR)/main/savestates.c \ + $(SRCDIR)/main/sdl_key_converter.c \ $(SRCDIR)/main/workqueue.c \ $(SRCDIR)/memory/dma.c \ $(SRCDIR)/memory/flashram.c \ diff --git a/src/main/eventloop.c b/src/main/eventloop.c index 85a06d77d09f2cbca9b1e15cf18e0ede89be0e75..a79d64b54c066835a6e24e7aa37c6bf1fb9d0896 100644 --- a/src/main/eventloop.c +++ b/src/main/eventloop.c @@ -42,6 +42,7 @@ #define SDL_SCANCODE_RETURN SDLK_RETURN #define SDL_SCANCODE_0 SDLK_0 #define SDL_SCANCODE_9 SDLK_9 +#define SDL_SCANCODE_UNKNOWN SDLK_UNKNOWN #define SDL_SetEventFilter(func, data) SDL_SetEventFilter(func) #define event_sdl_filter(userdata, event) event_sdl_filter(const event) @@ -51,6 +52,7 @@ #define M64P_CORE_PROTOTYPES 1 #include "main.h" #include "eventloop.h" +#include "sdl_key_converter.h" #include "util.h" #include "api/callbacks.h" #include "api/config.h" @@ -407,22 +409,22 @@ int event_set_core_defaults(void) ConfigSetDefaultFloat(l_CoreEventsConfig, "Version", CONFIG_PARAM_VERSION, "Mupen64Plus CoreEvents config parameter set version number. Please don't change this version number."); /* Keyboard presses mapped to core functions */ - ConfigSetDefaultInt(l_CoreEventsConfig, kbdStop, SDL_SCANCODE_ESCAPE, "SDL keysym for stopping the emulator"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdFullscreen, SDL_NUM_SCANCODES, "SDL keysym for switching between fullscreen/windowed modes"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdSave, SDL_SCANCODE_F5, "SDL keysym for saving the emulator state"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdLoad, SDL_SCANCODE_F7, "SDL keysym for loading the emulator state"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrement, 0, "SDL keysym for advancing the save state slot"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdReset, SDL_SCANCODE_F9, "SDL keysym for resetting the emulator"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeeddown, SDL_SCANCODE_F10, "SDL keysym for slowing down the emulator"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeedup, SDL_SCANCODE_F11, "SDL keysym for speeding up the emulator"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdScreenshot, SDL_SCANCODE_F12, "SDL keysym for taking a screenshot"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdPause, SDL_SCANCODE_P, "SDL keysym for pausing the emulator"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdMute, SDL_SCANCODE_M, "SDL keysym for muting/unmuting the sound"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrease, SDL_SCANCODE_RIGHTBRACKET,"SDL keysym for increasing the volume"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdDecrease, SDL_SCANCODE_LEFTBRACKET, "SDL keysym for decreasing the volume"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdForward, SDL_SCANCODE_F, "SDL keysym for temporarily going really fast"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdAdvance, SDL_SCANCODE_SLASH, "SDL keysym for advancing by one frame when paused"); - ConfigSetDefaultInt(l_CoreEventsConfig, kbdGameshark, SDL_SCANCODE_G, "SDL keysym for pressing the game shark button"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdStop, sdl_native2keysym(SDL_SCANCODE_ESCAPE), "SDL keysym for stopping the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdFullscreen, sdl_native2keysym(SDL_NUM_SCANCODES), "SDL keysym for switching between fullscreen/windowed modes"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSave, sdl_native2keysym(SDL_SCANCODE_F5), "SDL keysym for saving the emulator state"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdLoad, sdl_native2keysym(SDL_SCANCODE_F7), "SDL keysym for loading the emulator state"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrement, sdl_native2keysym(SDL_SCANCODE_UNKNOWN), "SDL keysym for advancing the save state slot"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdReset, sdl_native2keysym(SDL_SCANCODE_F9), "SDL keysym for resetting the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeeddown, sdl_native2keysym(SDL_SCANCODE_F10), "SDL keysym for slowing down the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdSpeedup, sdl_native2keysym(SDL_SCANCODE_F11), "SDL keysym for speeding up the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdScreenshot, sdl_native2keysym(SDL_SCANCODE_F12), "SDL keysym for taking a screenshot"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdPause, sdl_native2keysym(SDL_SCANCODE_P), "SDL keysym for pausing the emulator"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdMute, sdl_native2keysym(SDL_SCANCODE_M), "SDL keysym for muting/unmuting the sound"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdIncrease, sdl_native2keysym(SDL_SCANCODE_RIGHTBRACKET),"SDL keysym for increasing the volume"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdDecrease, sdl_native2keysym(SDL_SCANCODE_LEFTBRACKET), "SDL keysym for decreasing the volume"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdForward, sdl_native2keysym(SDL_SCANCODE_F), "SDL keysym for temporarily going really fast"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdAdvance, sdl_native2keysym(SDL_SCANCODE_SLASH), "SDL keysym for advancing by one frame when paused"); + ConfigSetDefaultInt(l_CoreEventsConfig, kbdGameshark, sdl_native2keysym(SDL_SCANCODE_G), "SDL keysym for pressing the game shark button"); /* Joystick events mapped to core functions */ ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyStop], "", "Joystick event string for stopping the emulator"); ConfigSetDefaultString(l_CoreEventsConfig, JoyCmdName[joyFullscreen], "", "Joystick event string for switching between fullscreen/windowed modes"); @@ -455,37 +457,37 @@ void event_sdl_keydown(int keysym, int keymod) else if (keysym >= SDL_SCANCODE_0 && keysym <= SDL_SCANCODE_9) main_state_set_slot(keysym - SDL_SCANCODE_0); /* check all of the configurable commands */ - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdStop)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdStop))) main_stop(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdFullscreen)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdFullscreen))) gfx.changeWindow(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSave)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdSave))) main_state_save(0, NULL); /* save in mupen64plus format using current slot */ - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdLoad)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdLoad))) main_state_load(NULL); /* load using current slot */ - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdIncrement)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdIncrement))) main_state_inc_slot(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdReset)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdReset))) reset_soft(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSpeeddown)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdSpeeddown))) main_speeddown(5); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdSpeedup)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdSpeedup))) main_speedup(5); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdScreenshot)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdScreenshot))) main_take_next_screenshot(); /* screenshot will be taken at the end of frame rendering */ - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdPause)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdPause))) main_toggle_pause(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdMute)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdMute))) main_volume_mute(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdIncrease)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdIncrease))) main_volume_up(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdDecrease)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdDecrease))) main_volume_down(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdForward)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdForward))) main_set_fastforward(1); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdAdvance)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdAdvance))) main_advance_one(); - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark))) event_set_gameshark(1); else { @@ -497,15 +499,15 @@ void event_sdl_keydown(int keysym, int keymod) void event_sdl_keyup(int keysym, int keymod) { - if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdStop)) + if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdStop))) { return; } - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdForward)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdForward))) { main_set_fastforward(0); } - else if (keysym == ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark)) + else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdGameshark))) { event_set_gameshark(0); } diff --git a/src/main/sdl_key_converter.c b/src/main/sdl_key_converter.c new file mode 100644 index 0000000000000000000000000000000000000000..a07490537214814317772bb76a084cc277af1418 --- /dev/null +++ b/src/main/sdl_key_converter.c @@ -0,0 +1,652 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - sdl_key_converter.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2013 Mupen64plus development team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "sdl_key_converter.h" +#include +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + +uint16_t sdl_keysym2scancode(uint16_t keysym) +{ + static const uint16_t keysym2scancode[323] = { + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x002au, /* SDLK_BACKSPACE -> SDL_SCANCODE_BACKSPACE */ + 0x002bu, /* SDLK_TAB -> SDL_SCANCODE_TAB */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x009cu, /* SDLK_CLEAR -> SDL_SCANCODE_CLEAR */ + 0x0028u, /* SDLK_RETURN -> SDL_SCANCODE_RETURN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0048u, /* SDLK_PAUSE -> SDL_SCANCODE_PAUSE */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0029u, /* SDLK_ESCAPE -> SDL_SCANCODE_ESCAPE */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x002cu, /* SDLK_SPACE -> SDL_SCANCODE_SPACE */ + 0x0000u, /* SDLK_EXCLAIM -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_QUOTEDBL -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_HASH -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_DOLLAR -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_AMPERSAND -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_QUOTE -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_LEFTPAREN -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_RIGHTPAREN -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_ASTERISK -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_PLUS -> SDL_SCANCODE_UNKNOWN */ + 0x0036u, /* SDLK_COMMA -> SDL_SCANCODE_COMMA */ + 0x002du, /* SDLK_MINUS -> SDL_SCANCODE_MINUS */ + 0x0037u, /* SDLK_PERIOD -> SDL_SCANCODE_PERIOD */ + 0x0038u, /* SDLK_SLASH -> SDL_SCANCODE_SLASH */ + 0x0027u, /* SDLK_0 -> SDL_SCANCODE_0 */ + 0x001eu, /* SDLK_1 -> SDL_SCANCODE_1 */ + 0x001fu, /* SDLK_2 -> SDL_SCANCODE_2 */ + 0x0020u, /* SDLK_3 -> SDL_SCANCODE_3 */ + 0x0021u, /* SDLK_4 -> SDL_SCANCODE_4 */ + 0x0022u, /* SDLK_5 -> SDL_SCANCODE_5 */ + 0x0023u, /* SDLK_6 -> SDL_SCANCODE_6 */ + 0x0024u, /* SDLK_7 -> SDL_SCANCODE_7 */ + 0x0025u, /* SDLK_8 -> SDL_SCANCODE_8 */ + 0x0026u, /* SDLK_9 -> SDL_SCANCODE_9 */ + 0x0000u, /* SDLK_COLON -> SDL_SCANCODE_UNKNOWN */ + 0x0033u, /* SDLK_SEMICOLON -> SDL_SCANCODE_SEMICOLON */ + 0x0000u, /* SDLK_LESS -> SDL_SCANCODE_UNKNOWN */ + 0x002eu, /* SDLK_EQUALS -> SDL_SCANCODE_EQUALS */ + 0x0000u, /* SDLK_GREATER -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_QUESTION -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_AT -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x002fu, /* SDLK_LEFTBRACKET -> SDL_SCANCODE_LEFTBRACKET */ + 0x0031u, /* SDLK_BACKSLASH -> SDL_SCANCODE_BACKSLASH */ + 0x0030u, /* SDLK_RIGHTBRACKET -> SDL_SCANCODE_RIGHTBRACKET */ + 0x0000u, /* SDLK_CARET -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_UNDERSCORE -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_BACKQUOTE -> SDL_SCANCODE_UNKNOWN */ + 0x0004u, /* SDLK_a -> SDL_SCANCODE_A */ + 0x0005u, /* SDLK_b -> SDL_SCANCODE_B */ + 0x0006u, /* SDLK_c -> SDL_SCANCODE_C */ + 0x0007u, /* SDLK_d -> SDL_SCANCODE_D */ + 0x0008u, /* SDLK_e -> SDL_SCANCODE_E */ + 0x0009u, /* SDLK_f -> SDL_SCANCODE_F */ + 0x000au, /* SDLK_g -> SDL_SCANCODE_G */ + 0x000bu, /* SDLK_h -> SDL_SCANCODE_H */ + 0x000cu, /* SDLK_i -> SDL_SCANCODE_I */ + 0x000du, /* SDLK_j -> SDL_SCANCODE_J */ + 0x000eu, /* SDLK_k -> SDL_SCANCODE_K */ + 0x000fu, /* SDLK_l -> SDL_SCANCODE_L */ + 0x0010u, /* SDLK_m -> SDL_SCANCODE_M */ + 0x0011u, /* SDLK_n -> SDL_SCANCODE_N */ + 0x0012u, /* SDLK_o -> SDL_SCANCODE_O */ + 0x0013u, /* SDLK_p -> SDL_SCANCODE_P */ + 0x0014u, /* SDLK_q -> SDL_SCANCODE_Q */ + 0x0015u, /* SDLK_r -> SDL_SCANCODE_R */ + 0x0016u, /* SDLK_s -> SDL_SCANCODE_S */ + 0x0017u, /* SDLK_t -> SDL_SCANCODE_T */ + 0x0018u, /* SDLK_u -> SDL_SCANCODE_U */ + 0x0019u, /* SDLK_v -> SDL_SCANCODE_V */ + 0x001au, /* SDLK_w -> SDL_SCANCODE_W */ + 0x001bu, /* SDLK_x -> SDL_SCANCODE_X */ + 0x001cu, /* SDLK_y -> SDL_SCANCODE_Y */ + 0x001du, /* SDLK_z -> SDL_SCANCODE_Z */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x004cu, /* SDLK_DELETE -> SDL_SCANCODE_DELETE */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_0 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_1 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_2 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_3 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_4 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_5 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_6 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_7 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_8 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_9 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_10 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_11 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_12 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_13 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_14 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_15 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_16 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_17 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_18 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_19 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_20 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_21 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_22 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_23 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_24 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_25 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_26 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_27 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_28 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_29 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_30 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_31 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_32 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_33 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_34 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_35 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_36 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_37 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_38 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_39 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_40 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_41 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_42 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_43 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_44 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_45 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_46 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_47 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_48 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_49 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_50 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_51 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_52 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_53 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_54 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_55 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_56 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_57 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_58 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_59 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_60 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_61 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_62 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_63 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_64 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_65 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_66 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_67 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_68 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_69 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_70 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_71 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_72 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_73 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_74 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_75 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_76 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_77 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_78 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_79 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_80 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_81 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_82 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_83 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_84 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_85 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_86 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_87 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_88 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_89 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_90 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_91 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_92 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_93 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_94 -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_WORLD_95 -> SDL_SCANCODE_UNKNOWN */ + 0x0062u, /* SDLK_KP0 -> SDL_SCANCODE_KP_0 */ + 0x0059u, /* SDLK_KP1 -> SDL_SCANCODE_KP_1 */ + 0x005au, /* SDLK_KP2 -> SDL_SCANCODE_KP_2 */ + 0x005bu, /* SDLK_KP3 -> SDL_SCANCODE_KP_3 */ + 0x005cu, /* SDLK_KP4 -> SDL_SCANCODE_KP_4 */ + 0x005du, /* SDLK_KP5 -> SDL_SCANCODE_KP_5 */ + 0x005eu, /* SDLK_KP6 -> SDL_SCANCODE_KP_6 */ + 0x005fu, /* SDLK_KP7 -> SDL_SCANCODE_KP_7 */ + 0x0060u, /* SDLK_KP8 -> SDL_SCANCODE_KP_8 */ + 0x0061u, /* SDLK_KP9 -> SDL_SCANCODE_KP_9 */ + 0x0063u, /* SDLK_KP_PERIOD -> SDL_SCANCODE_KP_PERIOD */ + 0x0054u, /* SDLK_KP_DIVIDE -> SDL_SCANCODE_KP_DIVIDE */ + 0x0055u, /* SDLK_KP_MULTIPLY -> SDL_SCANCODE_KP_MULTIPLY */ + 0x0056u, /* SDLK_KP_MINUS -> SDL_SCANCODE_KP_MINUS */ + 0x0057u, /* SDLK_KP_PLUS -> SDL_SCANCODE_KP_PLUS */ + 0x0058u, /* SDLK_KP_ENTER -> SDL_SCANCODE_KP_ENTER */ + 0x0067u, /* SDLK_KP_EQUALS -> SDL_SCANCODE_KP_EQUALS */ + 0x0052u, /* SDLK_UP -> SDL_SCANCODE_UP */ + 0x0051u, /* SDLK_DOWN -> SDL_SCANCODE_DOWN */ + 0x004fu, /* SDLK_RIGHT -> SDL_SCANCODE_RIGHT */ + 0x0050u, /* SDLK_LEFT -> SDL_SCANCODE_LEFT */ + 0x0049u, /* SDLK_INSERT -> SDL_SCANCODE_INSERT */ + 0x004au, /* SDLK_HOME -> SDL_SCANCODE_HOME */ + 0x004du, /* SDLK_END -> SDL_SCANCODE_END */ + 0x004bu, /* SDLK_PAGEUP -> SDL_SCANCODE_PAGEUP */ + 0x004eu, /* SDLK_PAGEDOWN -> SDL_SCANCODE_PAGEDOWN */ + 0x003au, /* SDLK_F1 -> SDL_SCANCODE_F1 */ + 0x003bu, /* SDLK_F2 -> SDL_SCANCODE_F2 */ + 0x003cu, /* SDLK_F3 -> SDL_SCANCODE_F3 */ + 0x003du, /* SDLK_F4 -> SDL_SCANCODE_F4 */ + 0x003eu, /* SDLK_F5 -> SDL_SCANCODE_F5 */ + 0x003fu, /* SDLK_F6 -> SDL_SCANCODE_F6 */ + 0x0040u, /* SDLK_F7 -> SDL_SCANCODE_F7 */ + 0x0041u, /* SDLK_F8 -> SDL_SCANCODE_F8 */ + 0x0042u, /* SDLK_F9 -> SDL_SCANCODE_F9 */ + 0x0043u, /* SDLK_F10 -> SDL_SCANCODE_F10 */ + 0x0044u, /* SDLK_F11 -> SDL_SCANCODE_F11 */ + 0x0045u, /* SDLK_F12 -> SDL_SCANCODE_F12 */ + 0x0068u, /* SDLK_F13 -> SDL_SCANCODE_F13 */ + 0x0069u, /* SDLK_F14 -> SDL_SCANCODE_F14 */ + 0x006au, /* SDLK_F15 -> SDL_SCANCODE_F15 */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* unassigned -> SDL_SCANCODE_UNKNOWN */ + 0x0053u, /* SDLK_NUMLOCK -> SDL_SCANCODE_NUMLOCKCLEAR */ + 0x0039u, /* SDLK_CAPSLOCK -> SDL_SCANCODE_CAPSLOCK */ + 0x0000u, /* SDLK_SCROLLOCK -> SDL_SCANCODE_UNKNOWN */ + 0x00e5u, /* SDLK_RSHIFT -> SDL_SCANCODE_RSHIFT */ + 0x00e1u, /* SDLK_LSHIFT -> SDL_SCANCODE_LSHIFT */ + 0x00e4u, /* SDLK_RCTRL -> SDL_SCANCODE_RCTRL */ + 0x00e0u, /* SDLK_LCTRL -> SDL_SCANCODE_LCTRL */ + 0x00e6u, /* SDLK_RALT -> SDL_SCANCODE_RALT */ + 0x00e2u, /* SDLK_LALT -> SDL_SCANCODE_LALT */ + 0x0000u, /* SDLK_RMETA -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_LMETA -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_LSUPER -> SDL_SCANCODE_UNKNOWN */ + 0x0000u, /* SDLK_RSUPER -> SDL_SCANCODE_UNKNOWN */ + 0x0101u, /* SDLK_MODE -> SDL_SCANCODE_MODE */ + 0x0000u, /* SDLK_COMPOSE -> SDL_SCANCODE_UNKNOWN */ + 0x0075u, /* SDLK_HELP -> SDL_SCANCODE_HELP */ + 0x0000u, /* SDLK_PRINT -> SDL_SCANCODE_UNKNOWN */ + 0x009au, /* SDLK_SYSREQ -> SDL_SCANCODE_SYSREQ */ + 0x0000u, /* SDLK_BREAK -> SDL_SCANCODE_UNKNOWN */ + 0x0076u, /* SDLK_MENU -> SDL_SCANCODE_MENU */ + 0x0066u, /* SDLK_POWER -> SDL_SCANCODE_POWER */ + 0x0000u, /* SDLK_EURO -> SDL_SCANCODE_UNKNOWN */ + 0x007au, /* SDLK_UNDO -> SDL_SCANCODE_UNDO */ + }; + + if (keysym >= ARRAY_SIZE(keysym2scancode)) + return 0; + return keysym2scancode[keysym]; +} + +uint16_t sdl_scancode2keysym(uint16_t scancode) +{ + static const uint16_t scancode2keysym[285] = { + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0061u, /* SDL_SCANCODE_A -> SDLK_a */ + 0x0062u, /* SDL_SCANCODE_B -> SDLK_b */ + 0x0063u, /* SDL_SCANCODE_C -> SDLK_c */ + 0x0064u, /* SDL_SCANCODE_D -> SDLK_d */ + 0x0065u, /* SDL_SCANCODE_E -> SDLK_e */ + 0x0066u, /* SDL_SCANCODE_F -> SDLK_f */ + 0x0067u, /* SDL_SCANCODE_G -> SDLK_g */ + 0x0068u, /* SDL_SCANCODE_H -> SDLK_h */ + 0x0069u, /* SDL_SCANCODE_I -> SDLK_i */ + 0x006au, /* SDL_SCANCODE_J -> SDLK_j */ + 0x006bu, /* SDL_SCANCODE_K -> SDLK_k */ + 0x006cu, /* SDL_SCANCODE_L -> SDLK_l */ + 0x006du, /* SDL_SCANCODE_M -> SDLK_m */ + 0x006eu, /* SDL_SCANCODE_N -> SDLK_n */ + 0x006fu, /* SDL_SCANCODE_O -> SDLK_o */ + 0x0070u, /* SDL_SCANCODE_P -> SDLK_p */ + 0x0071u, /* SDL_SCANCODE_Q -> SDLK_q */ + 0x0072u, /* SDL_SCANCODE_R -> SDLK_r */ + 0x0073u, /* SDL_SCANCODE_S -> SDLK_s */ + 0x0074u, /* SDL_SCANCODE_T -> SDLK_t */ + 0x0075u, /* SDL_SCANCODE_U -> SDLK_u */ + 0x0076u, /* SDL_SCANCODE_V -> SDLK_v */ + 0x0077u, /* SDL_SCANCODE_W -> SDLK_w */ + 0x0078u, /* SDL_SCANCODE_X -> SDLK_x */ + 0x0079u, /* SDL_SCANCODE_Y -> SDLK_y */ + 0x007au, /* SDL_SCANCODE_Z -> SDLK_z */ + 0x0031u, /* SDL_SCANCODE_1 -> SDLK_1 */ + 0x0032u, /* SDL_SCANCODE_2 -> SDLK_2 */ + 0x0033u, /* SDL_SCANCODE_3 -> SDLK_3 */ + 0x0034u, /* SDL_SCANCODE_4 -> SDLK_4 */ + 0x0035u, /* SDL_SCANCODE_5 -> SDLK_5 */ + 0x0036u, /* SDL_SCANCODE_6 -> SDLK_6 */ + 0x0037u, /* SDL_SCANCODE_7 -> SDLK_7 */ + 0x0038u, /* SDL_SCANCODE_8 -> SDLK_8 */ + 0x0039u, /* SDL_SCANCODE_9 -> SDLK_9 */ + 0x0030u, /* SDL_SCANCODE_0 -> SDLK_0 */ + 0x000du, /* SDL_SCANCODE_RETURN -> SDLK_RETURN */ + 0x001bu, /* SDL_SCANCODE_ESCAPE -> SDLK_ESCAPE */ + 0x0008u, /* SDL_SCANCODE_BACKSPACE -> SDLK_BACKSPACE */ + 0x0009u, /* SDL_SCANCODE_TAB -> SDLK_TAB */ + 0x0020u, /* SDL_SCANCODE_SPACE -> SDLK_SPACE */ + 0x002du, /* SDL_SCANCODE_MINUS -> SDLK_MINUS */ + 0x003du, /* SDL_SCANCODE_EQUALS -> SDLK_EQUALS */ + 0x005bu, /* SDL_SCANCODE_LEFTBRACKET -> SDLK_LEFTBRACKET */ + 0x005du, /* SDL_SCANCODE_RIGHTBRACKET -> SDLK_RIGHTBRACKET */ + 0x005cu, /* SDL_SCANCODE_BACKSLASH -> SDLK_BACKSLASH */ + 0x0000u, /* SDL_SCANCODE_NONUSHASH -> SDLK_UNKNOWN */ + 0x003bu, /* SDL_SCANCODE_SEMICOLON -> SDLK_SEMICOLON */ + 0x0000u, /* SDL_SCANCODE_APOSTROPHE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_GRAVE -> SDLK_UNKNOWN */ + 0x002cu, /* SDL_SCANCODE_COMMA -> SDLK_COMMA */ + 0x002eu, /* SDL_SCANCODE_PERIOD -> SDLK_PERIOD */ + 0x002fu, /* SDL_SCANCODE_SLASH -> SDLK_SLASH */ + 0x012du, /* SDL_SCANCODE_CAPSLOCK -> SDLK_CAPSLOCK */ + 0x011au, /* SDL_SCANCODE_F1 -> SDLK_F1 */ + 0x011bu, /* SDL_SCANCODE_F2 -> SDLK_F2 */ + 0x011cu, /* SDL_SCANCODE_F3 -> SDLK_F3 */ + 0x011du, /* SDL_SCANCODE_F4 -> SDLK_F4 */ + 0x011eu, /* SDL_SCANCODE_F5 -> SDLK_F5 */ + 0x011fu, /* SDL_SCANCODE_F6 -> SDLK_F6 */ + 0x0120u, /* SDL_SCANCODE_F7 -> SDLK_F7 */ + 0x0121u, /* SDL_SCANCODE_F8 -> SDLK_F8 */ + 0x0122u, /* SDL_SCANCODE_F9 -> SDLK_F9 */ + 0x0123u, /* SDL_SCANCODE_F10 -> SDLK_F10 */ + 0x0124u, /* SDL_SCANCODE_F11 -> SDLK_F11 */ + 0x0125u, /* SDL_SCANCODE_F12 -> SDLK_F12 */ + 0x0000u, /* SDL_SCANCODE_PRINTSCREEN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_SCROLLLOCK -> SDLK_UNKNOWN */ + 0x0013u, /* SDL_SCANCODE_PAUSE -> SDLK_PAUSE */ + 0x0115u, /* SDL_SCANCODE_INSERT -> SDLK_INSERT */ + 0x0116u, /* SDL_SCANCODE_HOME -> SDLK_HOME */ + 0x0118u, /* SDL_SCANCODE_PAGEUP -> SDLK_PAGEUP */ + 0x007fu, /* SDL_SCANCODE_DELETE -> SDLK_DELETE */ + 0x0117u, /* SDL_SCANCODE_END -> SDLK_END */ + 0x0119u, /* SDL_SCANCODE_PAGEDOWN -> SDLK_PAGEDOWN */ + 0x0113u, /* SDL_SCANCODE_RIGHT -> SDLK_RIGHT */ + 0x0114u, /* SDL_SCANCODE_LEFT -> SDLK_LEFT */ + 0x0112u, /* SDL_SCANCODE_DOWN -> SDLK_DOWN */ + 0x0111u, /* SDL_SCANCODE_UP -> SDLK_UP */ + 0x012cu, /* SDL_SCANCODE_NUMLOCKCLEAR -> SDLK_NUMLOCK */ + 0x010bu, /* SDL_SCANCODE_KP_DIVIDE -> SDLK_KP_DIVIDE */ + 0x010cu, /* SDL_SCANCODE_KP_MULTIPLY -> SDLK_KP_MULTIPLY */ + 0x010du, /* SDL_SCANCODE_KP_MINUS -> SDLK_KP_MINUS */ + 0x010eu, /* SDL_SCANCODE_KP_PLUS -> SDLK_KP_PLUS */ + 0x010fu, /* SDL_SCANCODE_KP_ENTER -> SDLK_KP_ENTER */ + 0x0101u, /* SDL_SCANCODE_KP_1 -> SDLK_KP1 */ + 0x0102u, /* SDL_SCANCODE_KP_2 -> SDLK_KP2 */ + 0x0103u, /* SDL_SCANCODE_KP_3 -> SDLK_KP3 */ + 0x0104u, /* SDL_SCANCODE_KP_4 -> SDLK_KP4 */ + 0x0105u, /* SDL_SCANCODE_KP_5 -> SDLK_KP5 */ + 0x0106u, /* SDL_SCANCODE_KP_6 -> SDLK_KP6 */ + 0x0107u, /* SDL_SCANCODE_KP_7 -> SDLK_KP7 */ + 0x0108u, /* SDL_SCANCODE_KP_8 -> SDLK_KP8 */ + 0x0109u, /* SDL_SCANCODE_KP_9 -> SDLK_KP9 */ + 0x0100u, /* SDL_SCANCODE_KP_0 -> SDLK_KP0 */ + 0x010au, /* SDL_SCANCODE_KP_PERIOD -> SDLK_KP_PERIOD */ + 0x0000u, /* SDL_SCANCODE_NONUSBACKSLASH -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_APPLICATION -> SDLK_UNKNOWN */ + 0x0140u, /* SDL_SCANCODE_POWER -> SDLK_POWER */ + 0x0110u, /* SDL_SCANCODE_KP_EQUALS -> SDLK_KP_EQUALS */ + 0x0126u, /* SDL_SCANCODE_F13 -> SDLK_F13 */ + 0x0127u, /* SDL_SCANCODE_F14 -> SDLK_F14 */ + 0x0128u, /* SDL_SCANCODE_F15 -> SDLK_F15 */ + 0x0000u, /* SDL_SCANCODE_F16 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F17 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F18 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F19 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F20 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F21 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F22 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F23 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_F24 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_EXECUTE -> SDLK_UNKNOWN */ + 0x013bu, /* SDL_SCANCODE_HELP -> SDLK_HELP */ + 0x013fu, /* SDL_SCANCODE_MENU -> SDLK_MENU */ + 0x0000u, /* SDL_SCANCODE_SELECT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_STOP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AGAIN -> SDLK_UNKNOWN */ + 0x0142u, /* SDL_SCANCODE_UNDO -> SDLK_UNDO */ + 0x0000u, /* SDL_SCANCODE_CUT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_COPY -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_PASTE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_FIND -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_MUTE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_VOLUMEUP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_VOLUMEDOWN -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_COMMA -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_EQUALSAS400 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL1 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL2 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL3 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL4 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL5 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL6 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL7 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL8 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_INTERNATIONAL9 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG1 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG2 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG3 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG4 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG5 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG6 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG7 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG8 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_LANG9 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_ALTERASE -> SDLK_UNKNOWN */ + 0x013du, /* SDL_SCANCODE_SYSREQ -> SDLK_SYSREQ */ + 0x0000u, /* SDL_SCANCODE_CANCEL -> SDLK_UNKNOWN */ + 0x000cu, /* SDL_SCANCODE_CLEAR -> SDLK_CLEAR */ + 0x0000u, /* SDL_SCANCODE_PRIOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_RETURN2 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_SEPARATOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_OUT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_OPER -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_CLEARAGAIN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_CRSEL -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_EXSEL -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_00 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_000 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_THOUSANDSSEPARATOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_DECIMALSEPARATOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_CURRENCYUNIT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_CURRENCYSUBUNIT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_LEFTPAREN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_RIGHTPAREN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_LEFTBRACE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_RIGHTBRACE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_TAB -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_BACKSPACE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_A -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_B -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_C -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_D -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_E -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_F -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_XOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_POWER -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_PERCENT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_LESS -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_GREATER -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_AMPERSAND -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_DBLAMPERSAND -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_VERTICALBAR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_DBLVERTICALBAR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_COLON -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_HASH -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_SPACE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_AT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_EXCLAM -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMSTORE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMRECALL -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMCLEAR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMADD -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMSUBTRACT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMMULTIPLY -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_MEMDIVIDE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_PLUSMINUS -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_CLEAR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_CLEARENTRY -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_BINARY -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_OCTAL -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_DECIMAL -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KP_HEXADECIMAL -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0132u, /* SDL_SCANCODE_LCTRL -> SDLK_LCTRL */ + 0x0130u, /* SDL_SCANCODE_LSHIFT -> SDLK_LSHIFT */ + 0x0134u, /* SDL_SCANCODE_LALT -> SDLK_LALT */ + 0x0000u, /* SDL_SCANCODE_LGUI -> SDLK_UNKNOWN */ + 0x0131u, /* SDL_SCANCODE_RCTRL -> SDLK_RCTRL */ + 0x012fu, /* SDL_SCANCODE_RSHIFT -> SDLK_RSHIFT */ + 0x0133u, /* SDL_SCANCODE_RALT -> SDLK_RALT */ + 0x0000u, /* SDL_SCANCODE_RGUI -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0000u, /* unassigned -> SDLK_UNKNOWN */ + 0x0139u, /* SDL_SCANCODE_MODE -> SDLK_MODE */ + 0x0000u, /* SDL_SCANCODE_AUDIONEXT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AUDIOPREV -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AUDIOSTOP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AUDIOPLAY -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AUDIOMUTE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_MEDIASELECT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_WWW -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_MAIL -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_CALCULATOR -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_COMPUTER -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_SEARCH -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_HOME -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_BACK -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_FORWARD -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_STOP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_REFRESH -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_AC_BOOKMARKS -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_BRIGHTNESSDOWN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_BRIGHTNESSUP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_DISPLAYSWITCH -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KBDILLUMTOGGLE -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KBDILLUMDOWN -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_KBDILLUMUP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_EJECT -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_SLEEP -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_APP1 -> SDLK_UNKNOWN */ + 0x0000u, /* SDL_SCANCODE_APP2 -> SDLK_UNKNOWN */ + }; + + if (scancode >= ARRAY_SIZE(scancode2keysym)) + return 0; + return scancode2keysym[scancode]; +} diff --git a/src/main/sdl_key_converter.h b/src/main/sdl_key_converter.h new file mode 100644 index 0000000000000000000000000000000000000000..e8d419bfda65d9f27d2164198d7273b26f2849fa --- /dev/null +++ b/src/main/sdl_key_converter.h @@ -0,0 +1,52 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - sdl_key_converter.h * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2013 Mupen64plus development team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "osal/preproc.h" +#include + +uint16_t sdl_keysym2scancode(uint16_t keysym); +uint16_t sdl_scancode2keysym(uint16_t scancode); + +#if SDL_VERSION_ATLEAST(1,3,0) + +static osal_inline uint16_t sdl_keysym2native(uint16_t keysym) +{ + return sdl_keysym2scancode(keysym); +} + +static osal_inline uint16_t sdl_native2keysym(uint16_t native) +{ + return sdl_scancode2keysym(native); +} + +#else + +static osal_inline uint16_t sdl_keysym2native(uint16_t keysym) +{ + return keysym; +} + +static osal_inline uint16_t sdl_native2keysym(uint16_t native) +{ + return native; +} + +#endif diff --git a/tools/gen_sdl_key_converter.c b/tools/gen_sdl_key_converter.c new file mode 100644 index 0000000000000000000000000000000000000000..85d5b13f1ab09c16fb3c4b2f5f7c2f9e02759591 --- /dev/null +++ b/tools/gen_sdl_key_converter.c @@ -0,0 +1,498 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Mupen64plus - gen_sdl_key_converter.c * + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ * + * Copyright (C) 2013 Mupen64plus development team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* gcc -E `sdl2-config --cflags --libs` `sdl-config --cflags --libs` gen_sdl_key_converter.c -o gen_sdl_key_converter */ + +#include +#include +#include +#include + +struct keycode2scancode { + const char *keysym_name; + uint32_t keysym; + const char *scancode_name; + uint32_t scancode; +}; + +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +#define _XSTR(x) #x +#define KEYSYM2SCANCODE(k, s) { \ + .keysym_name = _XSTR(SDLK_##k), \ + .keysym = SDLK_##k, \ + .scancode_name = _XSTR(SDL_SCANCODE_##s), \ + .scancode = SDL_SCANCODE_##s, \ + } + +/* Table from SDL 1.2.5 to SDL2 2.0-rc1 */ +static const struct keycode2scancode keycode2scancode[] = { + KEYSYM2SCANCODE(BACKSPACE, BACKSPACE), + KEYSYM2SCANCODE(TAB, TAB), + KEYSYM2SCANCODE(CLEAR, CLEAR), + KEYSYM2SCANCODE(RETURN, RETURN), + KEYSYM2SCANCODE(PAUSE, PAUSE), + KEYSYM2SCANCODE(ESCAPE, ESCAPE), + KEYSYM2SCANCODE(SPACE, SPACE), + KEYSYM2SCANCODE(EXCLAIM, UNKNOWN), + KEYSYM2SCANCODE(QUOTEDBL, UNKNOWN), + KEYSYM2SCANCODE(HASH, UNKNOWN), + KEYSYM2SCANCODE(DOLLAR, UNKNOWN), + KEYSYM2SCANCODE(AMPERSAND, UNKNOWN), + KEYSYM2SCANCODE(QUOTE, UNKNOWN), + KEYSYM2SCANCODE(LEFTPAREN, UNKNOWN), + KEYSYM2SCANCODE(RIGHTPAREN, UNKNOWN), + KEYSYM2SCANCODE(ASTERISK, UNKNOWN), + KEYSYM2SCANCODE(PLUS, UNKNOWN), + KEYSYM2SCANCODE(COMMA, COMMA), + KEYSYM2SCANCODE(MINUS, MINUS), + KEYSYM2SCANCODE(PERIOD, PERIOD), + KEYSYM2SCANCODE(SLASH, SLASH), + KEYSYM2SCANCODE(0, 0), + KEYSYM2SCANCODE(1, 1), + KEYSYM2SCANCODE(2, 2), + KEYSYM2SCANCODE(3, 3), + KEYSYM2SCANCODE(4, 4), + KEYSYM2SCANCODE(5, 5), + KEYSYM2SCANCODE(6, 6), + KEYSYM2SCANCODE(7, 7), + KEYSYM2SCANCODE(8, 8), + KEYSYM2SCANCODE(9, 9), + KEYSYM2SCANCODE(COLON, UNKNOWN), + KEYSYM2SCANCODE(SEMICOLON, SEMICOLON), + KEYSYM2SCANCODE(LESS, UNKNOWN), + KEYSYM2SCANCODE(EQUALS, EQUALS), + KEYSYM2SCANCODE(GREATER, UNKNOWN), + KEYSYM2SCANCODE(QUESTION, UNKNOWN), + KEYSYM2SCANCODE(AT, UNKNOWN), + KEYSYM2SCANCODE(LEFTBRACKET, LEFTBRACKET), + KEYSYM2SCANCODE(BACKSLASH, BACKSLASH), + KEYSYM2SCANCODE(RIGHTBRACKET, RIGHTBRACKET), + KEYSYM2SCANCODE(CARET, UNKNOWN), + KEYSYM2SCANCODE(UNDERSCORE, UNKNOWN), + KEYSYM2SCANCODE(BACKQUOTE, UNKNOWN), + KEYSYM2SCANCODE(a, A), + KEYSYM2SCANCODE(b, B), + KEYSYM2SCANCODE(c, C), + KEYSYM2SCANCODE(d, D), + KEYSYM2SCANCODE(e, E), + KEYSYM2SCANCODE(f, F), + KEYSYM2SCANCODE(g, G), + KEYSYM2SCANCODE(h, H), + KEYSYM2SCANCODE(i, I), + KEYSYM2SCANCODE(j, J), + KEYSYM2SCANCODE(k, K), + KEYSYM2SCANCODE(l, L), + KEYSYM2SCANCODE(m, M), + KEYSYM2SCANCODE(n, N), + KEYSYM2SCANCODE(o, O), + KEYSYM2SCANCODE(p, P), + KEYSYM2SCANCODE(q, Q), + KEYSYM2SCANCODE(r, R), + KEYSYM2SCANCODE(s, S), + KEYSYM2SCANCODE(t, T), + KEYSYM2SCANCODE(u, U), + KEYSYM2SCANCODE(v, V), + KEYSYM2SCANCODE(w, W), + KEYSYM2SCANCODE(x, X), + KEYSYM2SCANCODE(y, Y), + KEYSYM2SCANCODE(z, Z), + KEYSYM2SCANCODE(DELETE, DELETE), + KEYSYM2SCANCODE(WORLD_0, UNKNOWN), + KEYSYM2SCANCODE(WORLD_1, UNKNOWN), + KEYSYM2SCANCODE(WORLD_2, UNKNOWN), + KEYSYM2SCANCODE(WORLD_3, UNKNOWN), + KEYSYM2SCANCODE(WORLD_4, UNKNOWN), + KEYSYM2SCANCODE(WORLD_5, UNKNOWN), + KEYSYM2SCANCODE(WORLD_6, UNKNOWN), + KEYSYM2SCANCODE(WORLD_7, UNKNOWN), + KEYSYM2SCANCODE(WORLD_8, UNKNOWN), + KEYSYM2SCANCODE(WORLD_9, UNKNOWN), + KEYSYM2SCANCODE(WORLD_10, UNKNOWN), + KEYSYM2SCANCODE(WORLD_11, UNKNOWN), + KEYSYM2SCANCODE(WORLD_12, UNKNOWN), + KEYSYM2SCANCODE(WORLD_13, UNKNOWN), + KEYSYM2SCANCODE(WORLD_14, UNKNOWN), + KEYSYM2SCANCODE(WORLD_15, UNKNOWN), + KEYSYM2SCANCODE(WORLD_16, UNKNOWN), + KEYSYM2SCANCODE(WORLD_17, UNKNOWN), + KEYSYM2SCANCODE(WORLD_18, UNKNOWN), + KEYSYM2SCANCODE(WORLD_19, UNKNOWN), + KEYSYM2SCANCODE(WORLD_20, UNKNOWN), + KEYSYM2SCANCODE(WORLD_21, UNKNOWN), + KEYSYM2SCANCODE(WORLD_22, UNKNOWN), + KEYSYM2SCANCODE(WORLD_23, UNKNOWN), + KEYSYM2SCANCODE(WORLD_24, UNKNOWN), + KEYSYM2SCANCODE(WORLD_25, UNKNOWN), + KEYSYM2SCANCODE(WORLD_26, UNKNOWN), + KEYSYM2SCANCODE(WORLD_27, UNKNOWN), + KEYSYM2SCANCODE(WORLD_28, UNKNOWN), + KEYSYM2SCANCODE(WORLD_29, UNKNOWN), + KEYSYM2SCANCODE(WORLD_30, UNKNOWN), + KEYSYM2SCANCODE(WORLD_31, UNKNOWN), + KEYSYM2SCANCODE(WORLD_32, UNKNOWN), + KEYSYM2SCANCODE(WORLD_33, UNKNOWN), + KEYSYM2SCANCODE(WORLD_34, UNKNOWN), + KEYSYM2SCANCODE(WORLD_35, UNKNOWN), + KEYSYM2SCANCODE(WORLD_36, UNKNOWN), + KEYSYM2SCANCODE(WORLD_37, UNKNOWN), + KEYSYM2SCANCODE(WORLD_38, UNKNOWN), + KEYSYM2SCANCODE(WORLD_39, UNKNOWN), + KEYSYM2SCANCODE(WORLD_40, UNKNOWN), + KEYSYM2SCANCODE(WORLD_41, UNKNOWN), + KEYSYM2SCANCODE(WORLD_42, UNKNOWN), + KEYSYM2SCANCODE(WORLD_43, UNKNOWN), + KEYSYM2SCANCODE(WORLD_44, UNKNOWN), + KEYSYM2SCANCODE(WORLD_45, UNKNOWN), + KEYSYM2SCANCODE(WORLD_46, UNKNOWN), + KEYSYM2SCANCODE(WORLD_47, UNKNOWN), + KEYSYM2SCANCODE(WORLD_48, UNKNOWN), + KEYSYM2SCANCODE(WORLD_49, UNKNOWN), + KEYSYM2SCANCODE(WORLD_50, UNKNOWN), + KEYSYM2SCANCODE(WORLD_51, UNKNOWN), + KEYSYM2SCANCODE(WORLD_52, UNKNOWN), + KEYSYM2SCANCODE(WORLD_53, UNKNOWN), + KEYSYM2SCANCODE(WORLD_54, UNKNOWN), + KEYSYM2SCANCODE(WORLD_55, UNKNOWN), + KEYSYM2SCANCODE(WORLD_56, UNKNOWN), + KEYSYM2SCANCODE(WORLD_57, UNKNOWN), + KEYSYM2SCANCODE(WORLD_58, UNKNOWN), + KEYSYM2SCANCODE(WORLD_59, UNKNOWN), + KEYSYM2SCANCODE(WORLD_60, UNKNOWN), + KEYSYM2SCANCODE(WORLD_61, UNKNOWN), + KEYSYM2SCANCODE(WORLD_62, UNKNOWN), + KEYSYM2SCANCODE(WORLD_63, UNKNOWN), + KEYSYM2SCANCODE(WORLD_64, UNKNOWN), + KEYSYM2SCANCODE(WORLD_65, UNKNOWN), + KEYSYM2SCANCODE(WORLD_66, UNKNOWN), + KEYSYM2SCANCODE(WORLD_67, UNKNOWN), + KEYSYM2SCANCODE(WORLD_68, UNKNOWN), + KEYSYM2SCANCODE(WORLD_69, UNKNOWN), + KEYSYM2SCANCODE(WORLD_70, UNKNOWN), + KEYSYM2SCANCODE(WORLD_71, UNKNOWN), + KEYSYM2SCANCODE(WORLD_72, UNKNOWN), + KEYSYM2SCANCODE(WORLD_73, UNKNOWN), + KEYSYM2SCANCODE(WORLD_74, UNKNOWN), + KEYSYM2SCANCODE(WORLD_75, UNKNOWN), + KEYSYM2SCANCODE(WORLD_76, UNKNOWN), + KEYSYM2SCANCODE(WORLD_77, UNKNOWN), + KEYSYM2SCANCODE(WORLD_78, UNKNOWN), + KEYSYM2SCANCODE(WORLD_79, UNKNOWN), + KEYSYM2SCANCODE(WORLD_80, UNKNOWN), + KEYSYM2SCANCODE(WORLD_81, UNKNOWN), + KEYSYM2SCANCODE(WORLD_82, UNKNOWN), + KEYSYM2SCANCODE(WORLD_83, UNKNOWN), + KEYSYM2SCANCODE(WORLD_84, UNKNOWN), + KEYSYM2SCANCODE(WORLD_85, UNKNOWN), + KEYSYM2SCANCODE(WORLD_86, UNKNOWN), + KEYSYM2SCANCODE(WORLD_87, UNKNOWN), + KEYSYM2SCANCODE(WORLD_88, UNKNOWN), + KEYSYM2SCANCODE(WORLD_89, UNKNOWN), + KEYSYM2SCANCODE(WORLD_90, UNKNOWN), + KEYSYM2SCANCODE(WORLD_91, UNKNOWN), + KEYSYM2SCANCODE(WORLD_92, UNKNOWN), + KEYSYM2SCANCODE(WORLD_93, UNKNOWN), + KEYSYM2SCANCODE(WORLD_94, UNKNOWN), + KEYSYM2SCANCODE(WORLD_95, UNKNOWN), + KEYSYM2SCANCODE(KP0, KP_0), + KEYSYM2SCANCODE(KP1, KP_1), + KEYSYM2SCANCODE(KP2, KP_2), + KEYSYM2SCANCODE(KP3, KP_3), + KEYSYM2SCANCODE(KP4, KP_4), + KEYSYM2SCANCODE(KP5, KP_5), + KEYSYM2SCANCODE(KP6, KP_6), + KEYSYM2SCANCODE(KP7, KP_7), + KEYSYM2SCANCODE(KP8, KP_8), + KEYSYM2SCANCODE(KP9, KP_9), + KEYSYM2SCANCODE(KP_PERIOD, KP_PERIOD), + KEYSYM2SCANCODE(KP_DIVIDE, KP_DIVIDE), + KEYSYM2SCANCODE(KP_MULTIPLY, KP_MULTIPLY), + KEYSYM2SCANCODE(KP_MINUS, KP_MINUS), + KEYSYM2SCANCODE(KP_PLUS, KP_PLUS), + KEYSYM2SCANCODE(KP_ENTER, KP_ENTER), + KEYSYM2SCANCODE(KP_EQUALS, KP_EQUALS), + KEYSYM2SCANCODE(UP, UP), + KEYSYM2SCANCODE(DOWN, DOWN), + KEYSYM2SCANCODE(RIGHT, RIGHT), + KEYSYM2SCANCODE(LEFT, LEFT), + KEYSYM2SCANCODE(INSERT, INSERT), + KEYSYM2SCANCODE(HOME, HOME), + KEYSYM2SCANCODE(END, END), + KEYSYM2SCANCODE(PAGEUP, PAGEUP), + KEYSYM2SCANCODE(PAGEDOWN, PAGEDOWN), + KEYSYM2SCANCODE(F1, F1), + KEYSYM2SCANCODE(F2, F2), + KEYSYM2SCANCODE(F3, F3), + KEYSYM2SCANCODE(F4, F4), + KEYSYM2SCANCODE(F5, F5), + KEYSYM2SCANCODE(F6, F6), + KEYSYM2SCANCODE(F7, F7), + KEYSYM2SCANCODE(F8, F8), + KEYSYM2SCANCODE(F9, F9), + KEYSYM2SCANCODE(F10, F10), + KEYSYM2SCANCODE(F11, F11), + KEYSYM2SCANCODE(F12, F12), + KEYSYM2SCANCODE(F13, F13), + KEYSYM2SCANCODE(F14, F14), + KEYSYM2SCANCODE(F15, F15), + KEYSYM2SCANCODE(NUMLOCK, NUMLOCKCLEAR), + KEYSYM2SCANCODE(CAPSLOCK, CAPSLOCK), + KEYSYM2SCANCODE(SCROLLOCK, UNKNOWN), + KEYSYM2SCANCODE(RSHIFT, RSHIFT), + KEYSYM2SCANCODE(LSHIFT, LSHIFT), + KEYSYM2SCANCODE(RCTRL, RCTRL), + KEYSYM2SCANCODE(LCTRL, LCTRL), + KEYSYM2SCANCODE(RALT, RALT), + KEYSYM2SCANCODE(LALT, LALT), + KEYSYM2SCANCODE(RMETA, UNKNOWN), + KEYSYM2SCANCODE(LMETA, UNKNOWN), + KEYSYM2SCANCODE(LSUPER, UNKNOWN), + KEYSYM2SCANCODE(RSUPER, UNKNOWN), + KEYSYM2SCANCODE(MODE, MODE), + KEYSYM2SCANCODE(COMPOSE, UNKNOWN), + KEYSYM2SCANCODE(HELP, HELP), + KEYSYM2SCANCODE(PRINT, UNKNOWN), + KEYSYM2SCANCODE(SYSREQ, SYSREQ), + KEYSYM2SCANCODE(BREAK, UNKNOWN), + KEYSYM2SCANCODE(MENU, MENU), + KEYSYM2SCANCODE(POWER, POWER), + KEYSYM2SCANCODE(EURO, UNKNOWN), + KEYSYM2SCANCODE(UNDO, UNDO), + KEYSYM2SCANCODE(UNKNOWN, NONUSHASH), + KEYSYM2SCANCODE(UNKNOWN, APOSTROPHE), + KEYSYM2SCANCODE(UNKNOWN, GRAVE), + KEYSYM2SCANCODE(UNKNOWN, PRINTSCREEN), + KEYSYM2SCANCODE(UNKNOWN, SCROLLLOCK), + KEYSYM2SCANCODE(UNKNOWN, NONUSBACKSLASH), + KEYSYM2SCANCODE(UNKNOWN, APPLICATION), + KEYSYM2SCANCODE(UNKNOWN, F16), + KEYSYM2SCANCODE(UNKNOWN, F17), + KEYSYM2SCANCODE(UNKNOWN, F18), + KEYSYM2SCANCODE(UNKNOWN, F19), + KEYSYM2SCANCODE(UNKNOWN, F20), + KEYSYM2SCANCODE(UNKNOWN, F21), + KEYSYM2SCANCODE(UNKNOWN, F22), + KEYSYM2SCANCODE(UNKNOWN, F23), + KEYSYM2SCANCODE(UNKNOWN, F24), + KEYSYM2SCANCODE(UNKNOWN, EXECUTE), + KEYSYM2SCANCODE(UNKNOWN, SELECT), + KEYSYM2SCANCODE(UNKNOWN, STOP), + KEYSYM2SCANCODE(UNKNOWN, AGAIN), + KEYSYM2SCANCODE(UNKNOWN, CUT), + KEYSYM2SCANCODE(UNKNOWN, COPY), + KEYSYM2SCANCODE(UNKNOWN, PASTE), + KEYSYM2SCANCODE(UNKNOWN, FIND), + KEYSYM2SCANCODE(UNKNOWN, MUTE), + KEYSYM2SCANCODE(UNKNOWN, VOLUMEUP), + KEYSYM2SCANCODE(UNKNOWN, VOLUMEDOWN), + KEYSYM2SCANCODE(UNKNOWN, KP_COMMA), + KEYSYM2SCANCODE(UNKNOWN, KP_EQUALSAS400), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL1), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL2), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL3), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL4), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL5), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL6), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL7), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL8), + KEYSYM2SCANCODE(UNKNOWN, INTERNATIONAL9), + KEYSYM2SCANCODE(UNKNOWN, LANG1), + KEYSYM2SCANCODE(UNKNOWN, LANG2), + KEYSYM2SCANCODE(UNKNOWN, LANG3), + KEYSYM2SCANCODE(UNKNOWN, LANG4), + KEYSYM2SCANCODE(UNKNOWN, LANG5), + KEYSYM2SCANCODE(UNKNOWN, LANG6), + KEYSYM2SCANCODE(UNKNOWN, LANG7), + KEYSYM2SCANCODE(UNKNOWN, LANG8), + KEYSYM2SCANCODE(UNKNOWN, LANG9), + KEYSYM2SCANCODE(UNKNOWN, ALTERASE), + KEYSYM2SCANCODE(UNKNOWN, CANCEL), + KEYSYM2SCANCODE(UNKNOWN, PRIOR), + KEYSYM2SCANCODE(UNKNOWN, RETURN2), + KEYSYM2SCANCODE(UNKNOWN, SEPARATOR), + KEYSYM2SCANCODE(UNKNOWN, OUT), + KEYSYM2SCANCODE(UNKNOWN, OPER), + KEYSYM2SCANCODE(UNKNOWN, CLEARAGAIN), + KEYSYM2SCANCODE(UNKNOWN, CRSEL), + KEYSYM2SCANCODE(UNKNOWN, EXSEL), + KEYSYM2SCANCODE(UNKNOWN, KP_00), + KEYSYM2SCANCODE(UNKNOWN, KP_000), + KEYSYM2SCANCODE(UNKNOWN, THOUSANDSSEPARATOR), + KEYSYM2SCANCODE(UNKNOWN, DECIMALSEPARATOR), + KEYSYM2SCANCODE(UNKNOWN, CURRENCYUNIT), + KEYSYM2SCANCODE(UNKNOWN, CURRENCYSUBUNIT), + KEYSYM2SCANCODE(UNKNOWN, KP_LEFTPAREN), + KEYSYM2SCANCODE(UNKNOWN, KP_RIGHTPAREN), + KEYSYM2SCANCODE(UNKNOWN, KP_LEFTBRACE), + KEYSYM2SCANCODE(UNKNOWN, KP_RIGHTBRACE), + KEYSYM2SCANCODE(UNKNOWN, KP_TAB), + KEYSYM2SCANCODE(UNKNOWN, KP_BACKSPACE), + KEYSYM2SCANCODE(UNKNOWN, KP_A), + KEYSYM2SCANCODE(UNKNOWN, KP_B), + KEYSYM2SCANCODE(UNKNOWN, KP_C), + KEYSYM2SCANCODE(UNKNOWN, KP_D), + KEYSYM2SCANCODE(UNKNOWN, KP_E), + KEYSYM2SCANCODE(UNKNOWN, KP_F), + KEYSYM2SCANCODE(UNKNOWN, KP_XOR), + KEYSYM2SCANCODE(UNKNOWN, KP_POWER), + KEYSYM2SCANCODE(UNKNOWN, KP_PERCENT), + KEYSYM2SCANCODE(UNKNOWN, KP_LESS), + KEYSYM2SCANCODE(UNKNOWN, KP_GREATER), + KEYSYM2SCANCODE(UNKNOWN, KP_AMPERSAND), + KEYSYM2SCANCODE(UNKNOWN, KP_DBLAMPERSAND), + KEYSYM2SCANCODE(UNKNOWN, KP_VERTICALBAR), + KEYSYM2SCANCODE(UNKNOWN, KP_DBLVERTICALBAR), + KEYSYM2SCANCODE(UNKNOWN, KP_COLON), + KEYSYM2SCANCODE(UNKNOWN, KP_HASH), + KEYSYM2SCANCODE(UNKNOWN, KP_SPACE), + KEYSYM2SCANCODE(UNKNOWN, KP_AT), + KEYSYM2SCANCODE(UNKNOWN, KP_EXCLAM), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMSTORE), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMRECALL), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMCLEAR), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMADD), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMSUBTRACT), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMMULTIPLY), + KEYSYM2SCANCODE(UNKNOWN, KP_MEMDIVIDE), + KEYSYM2SCANCODE(UNKNOWN, KP_PLUSMINUS), + KEYSYM2SCANCODE(UNKNOWN, KP_CLEAR), + KEYSYM2SCANCODE(UNKNOWN, KP_CLEARENTRY), + KEYSYM2SCANCODE(UNKNOWN, KP_BINARY), + KEYSYM2SCANCODE(UNKNOWN, KP_OCTAL), + KEYSYM2SCANCODE(UNKNOWN, KP_DECIMAL), + KEYSYM2SCANCODE(UNKNOWN, KP_HEXADECIMAL), + KEYSYM2SCANCODE(UNKNOWN, LGUI), + KEYSYM2SCANCODE(UNKNOWN, RGUI), + KEYSYM2SCANCODE(UNKNOWN, AUDIONEXT), + KEYSYM2SCANCODE(UNKNOWN, AUDIOPREV), + KEYSYM2SCANCODE(UNKNOWN, AUDIOSTOP), + KEYSYM2SCANCODE(UNKNOWN, AUDIOPLAY), + KEYSYM2SCANCODE(UNKNOWN, AUDIOMUTE), + KEYSYM2SCANCODE(UNKNOWN, MEDIASELECT), + KEYSYM2SCANCODE(UNKNOWN, WWW), + KEYSYM2SCANCODE(UNKNOWN, MAIL), + KEYSYM2SCANCODE(UNKNOWN, CALCULATOR), + KEYSYM2SCANCODE(UNKNOWN, COMPUTER), + KEYSYM2SCANCODE(UNKNOWN, AC_SEARCH), + KEYSYM2SCANCODE(UNKNOWN, AC_HOME), + KEYSYM2SCANCODE(UNKNOWN, AC_BACK), + KEYSYM2SCANCODE(UNKNOWN, AC_FORWARD), + KEYSYM2SCANCODE(UNKNOWN, AC_STOP), + KEYSYM2SCANCODE(UNKNOWN, AC_REFRESH), + KEYSYM2SCANCODE(UNKNOWN, AC_BOOKMARKS), + KEYSYM2SCANCODE(UNKNOWN, BRIGHTNESSDOWN), + KEYSYM2SCANCODE(UNKNOWN, BRIGHTNESSUP), + KEYSYM2SCANCODE(UNKNOWN, DISPLAYSWITCH), + KEYSYM2SCANCODE(UNKNOWN, KBDILLUMTOGGLE), + KEYSYM2SCANCODE(UNKNOWN, KBDILLUMDOWN), + KEYSYM2SCANCODE(UNKNOWN, KBDILLUMUP), + KEYSYM2SCANCODE(UNKNOWN, EJECT), + KEYSYM2SCANCODE(UNKNOWN, SLEEP), + KEYSYM2SCANCODE(UNKNOWN, APP1), + KEYSYM2SCANCODE(UNKNOWN, APP2), +}; + +int main(void) +{ + size_t i, j; + int found; + uint16_t max_keysym = 0, max_scancode = 0; + + for (i = 0; i < ARRAY_SIZE(keycode2scancode); i++) { + if (max_keysym < keycode2scancode[i].keysym) + max_keysym = keycode2scancode[i].keysym; + + if (max_scancode < keycode2scancode[i].scancode) + max_scancode = keycode2scancode[i].scancode; + } + + puts("#include "); + puts("#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))\n"); + + puts("uint16_t sdl_keysym2scancode(uint16_t keysym)\n{"); + + printf(" static const uint16_t keysym2scancode[%"PRIu16"] = {\n", + max_keysym + 1); + for (i = 0; i < (max_keysym + 1); i++) { + found = 0; + for (j = 0; j < ARRAY_SIZE(keycode2scancode); j++) { + if (i != 0 && keycode2scancode[j].keysym == i) { + printf(" 0x%04xu, /* %s -> %s */\n", + keycode2scancode[j].scancode, + keycode2scancode[j].keysym_name, + keycode2scancode[j].scancode_name); + + if (found) + fprintf(stderr, + "Multiple entry with keysym %zu, %s -> %s\n", + i, keycode2scancode[j].keysym_name, + keycode2scancode[j].scancode_name); + found = 1; + } + } + + if (!found) + printf(" 0x%04xu, /* %s -> %s */\n", + 0, + "unassigned", + "SDL_SCANCODE_UNKNOWN"); + } + puts(" };\n"); + puts(" if (keysym >= ARRAY_SIZE(keysym2scancode))"); + puts(" return 0;"); + puts(" return keysym2scancode[keysym];\n}\n"); + + + + puts("uint16_t sdl_scancode2keysym(uint16_t scancode)\n{"); + + printf(" static const uint16_t scancode2keysym[%"PRIu16"] = {\n", + max_scancode + 1); + for (i = 0; i < (max_scancode + 1); i++) { + found = 0; + for (j = 0; j < ARRAY_SIZE(keycode2scancode); j++) { + if (i != 0 && keycode2scancode[j].scancode == i) { + printf(" 0x%04xu, /* %s -> %s */\n", + keycode2scancode[j].keysym, + keycode2scancode[j].scancode_name, + keycode2scancode[j].keysym_name); + + if (found) + fprintf(stderr, + "Multiple entry with scancode %zu, %s -> %s\n", + i, keycode2scancode[j].scancode_name, + keycode2scancode[j].keysym_name); + found = 1; + } + } + + if (!found) + printf(" 0x%04xu, /* %s -> %s */\n", + 0, + "unassigned", + "SDLK_UNKNOWN"); + } + puts(" };\n"); + puts(" if (scancode >= ARRAY_SIZE(scancode2keysym))"); + puts(" return 0;"); + puts(" return scancode2keysym[scancode];\n}"); + + return 0; +} debian/patches/sdl2_no_unicode.patch0000644000000000000000000000271412252624000014701 0ustar Description: Remove SDL unicode keycode compat code SDL 2.0 cannot store unicode anymore. Pre-2.0 versions provided this field but it was removed right before the 2.0 release. Still using it makes the compile fail. Author: Sven Eckelmann --- diff --git a/src/api/vidext_sdl2_compat.h b/src/api/vidext_sdl2_compat.h index 7c6ad8b4d74122f9d4f206d007bc9770c64f1dcb..9c6804082796c250651a94c60cacf7d44e381339 100644 --- a/src/api/vidext_sdl2_compat.h +++ b/src/api/vidext_sdl2_compat.h @@ -529,25 +529,6 @@ SDL_CompatEventFilter(void *userdata, SDL_Event * event) SDL_PushEvent(&fake); break; } - case SDL_KEYDOWN: - case SDL_KEYUP: - { - Uint32 unicode = 0; - if (event->key.type == SDL_KEYDOWN && event->key.keysym.sym < 256) { - unicode = event->key.keysym.sym; - if (unicode >= 'a' && unicode <= 'z') { - int shifted = !!(event->key.keysym.mod & KMOD_SHIFT); - int capslock = !!(event->key.keysym.mod & KMOD_CAPS); - if ((shifted ^ capslock) != 0) { - unicode = SDL_toupper(unicode); - } - } - } - if (unicode) { - event->key.keysym.unicode = unicode; - } - break; - } case SDL_TEXTINPUT: { /* FIXME: Generate an old style key repeat event if needed */ debian/patches/sdl2_select_saveslot.patch0000644000000000000000000000473612252624000015764 0ustar Description: Fix saveslot selection for SDL2 The IDs for SDL scancodes don't start from SDL_SCANCODE_0 and end at SDL_SCANCODE_9. Therefore, SDL_SCANCODE_9 is bigger than SDL_SCANCODE_0 (which violates a precondition of the key check) and this makes it impossible to select a saveslot using the numbers on the keyboard. Bug-Debian: http://bugs.debian.org/717801 Author: Sven Eckelmann --- diff --git a/src/main/eventloop.c b/src/main/eventloop.c index a79d64b54c066835a6e24e7aa37c6bf1fb9d0896..e69af01f6ca244c07ae110ac341f1ca77895dd1e 100644 --- a/src/main/eventloop.c +++ b/src/main/eventloop.c @@ -41,6 +41,14 @@ #define SDL_SCANCODE_G SDLK_g #define SDL_SCANCODE_RETURN SDLK_RETURN #define SDL_SCANCODE_0 SDLK_0 +#define SDL_SCANCODE_1 SDLK_1 +#define SDL_SCANCODE_2 SDLK_2 +#define SDL_SCANCODE_3 SDLK_3 +#define SDL_SCANCODE_4 SDLK_4 +#define SDL_SCANCODE_5 SDLK_5 +#define SDL_SCANCODE_6 SDLK_6 +#define SDL_SCANCODE_7 SDLK_7 +#define SDL_SCANCODE_8 SDLK_8 #define SDL_SCANCODE_9 SDLK_9 #define SDL_SCANCODE_UNKNOWN SDLK_UNKNOWN @@ -445,17 +453,47 @@ int event_set_core_defaults(void) return 1; } +static int get_saveslot_from_keysym(int keysym) +{ + switch (keysym) { + case SDL_SCANCODE_0: + return 0; + case SDL_SCANCODE_1: + return 1; + case SDL_SCANCODE_2: + return 2; + case SDL_SCANCODE_3: + return 3; + case SDL_SCANCODE_4: + return 4; + case SDL_SCANCODE_5: + return 5; + case SDL_SCANCODE_6: + return 6; + case SDL_SCANCODE_7: + return 7; + case SDL_SCANCODE_8: + return 8; + case SDL_SCANCODE_9: + return 9; + default: + return -1; + } +} + /********************************************************************************************************* * sdl keyup/keydown handlers */ void event_sdl_keydown(int keysym, int keymod) { + int slot; + /* check for the only 2 hard-coded key commands: Alt-enter for fullscreen and 0-9 for save state slot */ if (keysym == SDL_SCANCODE_RETURN && keymod & (KMOD_LALT | KMOD_RALT)) gfx.changeWindow(); - else if (keysym >= SDL_SCANCODE_0 && keysym <= SDL_SCANCODE_9) - main_state_set_slot(keysym - SDL_SCANCODE_0); + else if ((slot = get_saveslot_from_keysym(keysym)) >= 0) + main_state_set_slot(slot); /* check all of the configurable commands */ else if (keysym == sdl_keysym2native(ConfigGetParamInt(l_CoreEventsConfig, kbdStop))) main_stop(); debian/patches/series0000644000000000000000000000052512252624000012025 0ustar bitstream-font.patch printf_fixup.patch disable_recompiler_disassembler.patch sdl2_keysym.patch multiple_main.patch n64_cic_nus_6105_reset.patch sdl2_select_saveslot.patch sdl2_no_unicode.patch oot_subscreen_delay_fix.patch counter_per_op.patch two_events_interrupt.patch delay_si.patch config_currentstateslot.patch obsolete_variable.patch debian/patches/two_events_interrupt.patch0000644000000000000000000000113412252624000016137 0ustar Description: Don't insert a second interrupt event from same type Author: Sven Eckelmann --- diff --git a/src/r4300/interupt.c b/src/r4300/interupt.c index b7d2e5094c0bd01465dcbbce8ac6005761923ef1..208f7a8627574a0fa9cc2e94022b0cf181959789 100644 --- a/src/r4300/interupt.c +++ b/src/r4300/interupt.c @@ -127,6 +127,8 @@ void add_interupt_event(int type, unsigned int delay) if (get_event(type)) { DebugMessage(M64MSG_WARNING, "two events of type 0x%x in interrupt queue", type); + /* Hack for Wipeout and Perfect Dark */ + return; } if (q == NULL) debian/rules0000755000000000000000000000305012252624000010235 0ustar #!/usr/bin/make -f # -*- makefile -*- export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie export DEB_CFLAGS_MAINT_APPEND=-flto DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) MAKEOPTIONS = V=1 UNAME='$(DEB_HOST_ARCH_OS)' HOST_CPU='$(DEB_HOST_GNU_CPU)' APIDIR=/usr/include/mupen64plus/ DEBUG=1 DEBUGGER=1 PREFIX=/usr/ LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)" PIC=1 OPTFLAGS="-DNDEBUG" SHAREDIR="/usr/share/games/mupen64plus/" SDL_CONFIG=sdl2-config DBG_PACKAGE=$(shell dpkg-parsechangelog|grep '^Source: '|sed 's/^Source:\s*//')-dbg binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep: dh $@ --sourcedirectory="projects/unix" --parallel --list-missing get-orig-source: $(CURDIR)/debian/get-orig-source.sh override_dh_auto_test: # otherwise dh_auto_test fails with debhelper 9.20130624 override_dh_auto_clean: dh_auto_clean -- $(MAKEOPTIONS) override_dh_auto_build: dh_auto_build -- all $(MAKEOPTIONS) override_dh_auto_install: dh_auto_install -- $(MAKEOPTIONS) override_dh_strip: dh_strip -a --dbg-package=libmupen64plus2-dbg override_dh_installchangelogs: dh_installchangelogs RELEASE .PHONY: binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep \ get-orig-source override_dh_auto_clean override_dh_auto_test override_dh_auto_build override_dh_auto_install override_dh_strip override_dh_installchangelogs debian/source/0000755000000000000000000000000012252624000010457 5ustar debian/source/format0000644000000000000000000000001412252624000011665 0ustar 3.0 (quilt) debian/source/include-binaries0000644000000000000000000000004012252624000013611 0ustar debian/upstream-signing-key.pgp debian/upstream-signing-key.pgp0000644000000000000000000000220212252624000013745 0ustar  Q$u!l r@a `d0\k#͸>æl_qͩVWD㉯w(Ra =ؠz;s=CawtBEj8,1!KZ\WIC\TzRY'ݵC–I2 (m.Taq5J\3!]W|mWhgLtg{mgk'!E(Ǟi"Mz>_l]4QLh ub3,=dbSvڟ9(rO``QY2Richard Goedeken 7!Q$u    [&zHfZ