m64p: Upgraded to v2.0
This commit is contained in:
parent
4e12f54897
commit
dc0ba1bc69
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,8 +3,9 @@ Mupen64Plus-Core LICENSES
|
|||
|
||||
Mupen64Plus-Core is licensed under the GNU General Public License version 2. Please see the
|
||||
included doc/gpl-license file for the terms and conditions of the GNU General Public License.
|
||||
The authors of Mupen64Plus are:
|
||||
The authors of Mupen64Plus-Core are:
|
||||
* Richard Goedeken (Richard42)
|
||||
* Sven Eckelmann (ecsv)
|
||||
* John Chadwick (NMN)
|
||||
* James Hood (Ebenblues)
|
||||
* Scott Gorman (okaygo)
|
||||
|
|
|
@ -63,6 +63,9 @@ Type 'make' by itself to view all available build options:
|
|||
SHAREDIR=path == extra path to search for shared data files
|
||||
OPTFLAGS=flag == compiler optimization (default: -O3)
|
||||
PIC=(1|0) == Force enable/disable of position independent code
|
||||
OSD=(1|0) == Enable/disable build of OpenGL On-screen display
|
||||
NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec
|
||||
POSTFIX=name == String added to the name of the the build (default: '')
|
||||
Install Options:
|
||||
PREFIX=path == install/uninstall prefix (default: /usr/local/)
|
||||
SHAREDIR=path == path to install shared data (default: PREFIX/share/mupen64plus/)
|
||||
|
@ -76,6 +79,7 @@ Type 'make' by itself to view all available build options:
|
|||
DBG_CORE=1 == print debugging info in r4300 core
|
||||
DBG_COUNT=1 == print R4300 instruction count totals (64-bit dynarec only)
|
||||
DBG_COMPARE=1 == enable core-synchronized r4300 debugging
|
||||
DBG_TIMING=1 == print timing data
|
||||
DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file
|
||||
V=1 == show verbose compiler output
|
||||
|
||||
|
@ -99,10 +103,13 @@ files used by mupen64plus.
|
|||
NOTE: By default, install.sh uses /usr/local for the install prefix. Although
|
||||
the user can specify an alternate prefix to install.sh at the commandline, the
|
||||
mupen64plus binary was compiled to look for the install directory in /usr/local,
|
||||
so specifying an alternate prefix to install.sh will cause problems (mupen64plus
|
||||
will not find the install directory). If you want to use a prefix other than
|
||||
/usr/local, you will have to download the source package and build with the
|
||||
PREFIX option (see below).
|
||||
so specifying an alternate prefix to install.sh will cause problems (the
|
||||
mupen64plus front-end application will not find the directory containing the
|
||||
core library) unless the directory to which you install it is known by your
|
||||
dynamic library loader (ie, included in /etc/ld.conf.so)
|
||||
|
||||
If you want to use a prefix other than /usr/local, you may also download the
|
||||
source code package and build with the PREFIX option (see below).
|
||||
|
||||
*Source Distribution*
|
||||
|
||||
|
@ -114,7 +121,7 @@ to /usr/local. This can be changed by passing the PREFIX option to make. NOTE:
|
|||
you must pass the prefix, when building AND installing. For example, to install
|
||||
mupen64plus to /usr, do this:
|
||||
|
||||
$ make all
|
||||
$ make PREFIX=/usr all
|
||||
$ sudo make PREFIX=/usr install
|
||||
$
|
||||
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
Mupen64Plus-Core Emulator Library RELEASE
|
||||
-----------------------------------------
|
||||
|
||||
Mupen64Plus v2.0 - July 4th, 2013
|
||||
---------------------------------
|
||||
- Fixes for various games (DK64, Zelda, Blast Corps)
|
||||
- add Ari64's dynamic recompiler for x86 (32-bit) and ARM
|
||||
- improved PJ64 savestate loading
|
||||
- support video window resizing (with help from video plugin and front-end application)
|
||||
- Auto-detect savestate type (Mupen64Plus or PJ64) when loading from a slot
|
||||
- many various code cleanups in core from casualjames
|
||||
- support to build against SDL2
|
||||
- debugger code cleanup
|
||||
- Project files for Visual Studio 2012
|
||||
- Makefile changes
|
||||
- add support for PowerPC and MinGW32 builds
|
||||
- add cross-compiling support to build Win32 executables (MXE) under Linux
|
||||
|
||||
Mupen64Plus v1.99.5 - March 10, 2012
|
||||
------------------------------------
|
||||
- New feature: support for N64 internal real-time clock
|
||||
|
|
|
@ -229,10 +229,22 @@ The Mupen64Plus-Input-SDL plugin uses a separate config section for each simulat
|
|||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Version
|
||||
|version
|
||||
|M64TYPE_FLOAT
|
||||
|Mupen64Plus Input-SDL config parameter set version number. Please don't change.
|
||||
|-
|
||||
|mode
|
||||
|M64TYPE_INT
|
||||
|Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic
|
||||
|-
|
||||
|device
|
||||
|M64TYPE_INT
|
||||
|Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number
|
||||
|-
|
||||
|name
|
||||
|M64TYPE_STRING
|
||||
|SDL joystick name (or Keyboard)
|
||||
|-
|
||||
|plugged
|
||||
|M64TYPE_BOOL
|
||||
|Specifies whether this controller is 'plugged in' to the simulated N64
|
||||
|
@ -245,10 +257,6 @@ The Mupen64Plus-Input-SDL plugin uses a separate config section for each simulat
|
|||
|M64TYPE_BOOL
|
||||
|If True, then mouse buttons may be used with this controller, and mouse movement will map to X/Y analog stick
|
||||
|-
|
||||
|device
|
||||
|M64TYPE_INT
|
||||
|Specifies which joystick is bound to this controller: -2=Keyboard/mouse, -1=Auto config, 0 or more= SDL Joystick number
|
||||
|-
|
||||
|MouseSensitivity
|
||||
|M64TYPE_STRING
|
||||
|The sensitivity coefficients for the mouse to move the N64 controller axis value from 0. For X, Y axes. Values must be positive.
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 API Versioning =
|
||||
|
||||
== Goal ==
|
||||
|
||||
The Mupen64Plus API versioning scheme was invented to give a more friendly and less confusing experience for users as the various components evolve over time. There are 6 basic components to the Mupen64Plus system, which may be independently built and installed:
|
||||
|
||||
# The Front-end UI application
|
||||
# The Core emulator library
|
||||
# The Video plugin
|
||||
# The Audio plugin
|
||||
# The Input plugin
|
||||
# The RSP plugin
|
||||
|
||||
These components interact with each other in several different ways. The design goal of the versioning scheme is to gracefully handle all situations in which two components support different versions of their common API (due to one component being newer than the other). In particular, each pair of components sharing a common API must discover whether or not they are compatible with each other. They must make this determination early enough in the startup process to inform the user of an incompatibility and gracefully exit the software if necessary without crashing. There are 2 different decisions that pertain to the compatibility determination:
|
||||
|
||||
# Major API version. The various API version numbers are 32-bit. The major version number is stored in the upper 16 bits, and the minor version number is in the lower 16 bits. If two components have different major API version numbers, then they are definitely incompatible.
|
||||
# Minor API version. If two components with a common API have different minor version numbers, then the newer component may decide whether or not it can interact with the older component based upon the older component's version number. The newer component may optionally disable new features and still retain backwards compatibility, or it may refuse to operate with the older component. This decision is left to the component author when new features are added.
|
||||
|
||||
== Basic Design ==
|
||||
|
||||
In mupen64plus-core/src/plugin/plugin.h, the following macros are defined:
|
||||
|
||||
#define RSP_API_MAJOR_VERSION 0x20000
|
||||
#define GFX_API_MAJOR_VERSION 0x20000
|
||||
#define AUDIO_API_MAJOR_VERSION 0x20000
|
||||
#define INPUT_API_MAJOR_VERSION 0x20000
|
||||
|
||||
In mupen64plus-core/src/main/version.h, the following macros are defined:
|
||||
|
||||
#define FRONTEND_API_VERSION 0x020000
|
||||
#define CONFIG_API_VERSION 0x020000
|
||||
#define DEBUG_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x020000
|
||||
|
||||
# When the front-end application calls the CoreStartup() function, it passes it's Core<-->Front-end API version to the core. If the API major version numbers for the core and front-end don't match, the core will return from this function with a failure code of M64ERR_INCOMPATIBLE.
|
||||
# The Console-UI front-end also checks for API compatibility, during the AttachCoreLib() function call. It is not strictly necessary for a front-end application to verify the API compatibility with the core, since the core will also check during CoreStartup(). However, by doing so, an updated front-end may detect a core library using a newer (but backwards-compatible) API, and enable some extra features as a result of the expanded API.
|
||||
# At the time each plugin is attached to the core (during CoreAttachPlugin function call), the core checks the version number of the plugin API by calling the PluginGetVersion function. If the major version number of the plugin's reported API (APIVersion & 0xffff0000) does not match the corresponding version number for that plugin type in the core (defined in plugin.h), then the plugin is incompatible and cannot be attached to the core. Currently the plugins have no way to request the major version number required for a particular plugin type in the core library.
|
||||
# The emulator core exports several different API groups which may be used by the front-end and plugin modules. Currently, these groups are: Front-end, Config, Debug, and Video Extension. A front-end application or any plugin may call the CoreGetAPIVersions() function to retrieve the API version numbers for these groups. Any plugin or front-end which can use any updated (not present in the original "2.0" API) functions in one of these groups should call the core's CoreGetAPIVersions() function (during PluginStartup for a plugin or at core attach time for a front-end) to check the version # of the API supported by the core, and react accordingly.
|
||||
# All front-ends and plugins should verify API version compatibility for the Config API.
|
||||
|
||||
== Handling Future Changes ==
|
||||
|
||||
=== New feature added to a plugin library ===
|
||||
If the feature is backwards-compatible with older cores, then plugin API minor version will be bumped. Otherwise, major version number will be bumped. If change is backwards-compatible, then newest core can test the plugin's API version and only enable the feature if present.
|
||||
|
||||
=== New feature added to Core<-->Front-end API ===
|
||||
Typically this will happen when a new function or a new feature of an existing function is added to the core. If the older front-ends will still be compatible with newer cores, then the minor version number of the front-end API will be bumped. Otherwise the major version number will be bumped. A newer front-end can check the version of the API supported by the core and choose whether to retain backwards-compatibility with older cores or refuse to interoperate.
|
||||
|
||||
=== New feature added to Core Config API ===
|
||||
If older plugins can still use the Core Config API with the new feature, then Config API minor version will be bumped. Otherwise, major version number will be bumped. Newer plugins should check the Core's Config API version and maintain backwards compatibility with older cores if possible.
|
||||
|
||||
=== New feature added to Core Debug API ===
|
||||
If older front-ends can still use the Core Debug API with the new feature, then Debug API minor version number will be bumped. Otherwise, major version number will be bumped. Newer front-end applications should check the Core's Debug API version and maintain backwards compatibility with older cores if possible.
|
||||
|
||||
=== New feature added to Video Extension API ===
|
||||
This is the most complicated interface, because it involves 3 components: the video plugin, the core, and the front-end application. If older video plugins can still use the newer Video Extension API with the core, *and* newer front-end applications can work with older cores, then the Video Extension API minor version number will be bumped. Otherwise, the major version number will be bumped. Newer video plugins can check the Core's Video Extension API version and maintain backwards compatibility with older cores if possible, otherwise they can refuse and give a compatibility error. Front-end applications (such as the default console-ui) which do not hook into the Video Extension do not need to check the Core's Video Extension API version. However, front-end applications which do hook into the Video Extension must check the API version. If the Core and Front-end have different API major version numbers, then they are incompatible. Also if the Core has a *newer* minor version than the front-end, then they are incompatible. This is a unique restriction, and it must be checked and verified by the front-end; the Core has no way to check this.
|
||||
|
||||
== Changelog ==
|
||||
* Version 2.0.0 is the base for all APIs
|
||||
* '''FRONTEND_API_VERSION''' version 2.0.1:
|
||||
** added "m64p_command" type "M64CMD_CORE_STATE_SET", handled by CoreDoCommand()
|
||||
** added "m64p_core_param" type "M64CORE_SPEED_LIMITER", handled by "M64CMD_CORE_STATE_QUERY" and "M64CMD_CORE_STATE_SET" commands
|
||||
* '''FRONTEND_API_VERSION''' version 2.0.2:
|
||||
** added "m64p_command" types:
|
||||
*** M64CMD_GET_SCREEN_WIDTH
|
||||
*** M64CMD_GET_SCREEN_HEIGHT
|
||||
*** M64CMD_READ_SCREEN
|
||||
*** M64CMD_VOLUME_UP
|
||||
*** M64CMD_VOLUME_DOWN
|
||||
*** M64CMD_VOLUME_GET_LEVEL
|
||||
*** M64CMD_VOLUME_SET_LEVEL
|
||||
*** M64CMD_VOLUME_MUTE
|
||||
*** M64CMD_RESET
|
||||
*** M64CMD_ADVANCE_FRAME
|
||||
** extend command M64CMD_STATE_SAVE to support saving uncompressed PJ64 savestate files as well as zip compressed
|
||||
* '''FRONTEND_API_VERSION''' version 2.1.0:
|
||||
** removed "m64p_command" types:
|
||||
*** M64CMD_GET_SCREEN_WIDTH
|
||||
*** M64CMD_GET_SCREEN_HEIGHT
|
||||
*** M64CMD_VOLUME_UP
|
||||
*** M64CMD_VOLUME_DOWN
|
||||
*** M64CMD_VOLUME_GET_LEVEL
|
||||
*** M64CMD_VOLUME_SET_LEVEL
|
||||
*** M64CMD_VOLUME_MUTE
|
||||
** added new "m64p_core_param" types:
|
||||
*** M64CORE_VIDEO_SIZE
|
||||
*** M64CORE_AUDIO_VOLUME
|
||||
*** M64CORE_AUDIO_MUTE
|
||||
*** M64CORE_INPUT_GAMESHARK
|
||||
*** M64CORE_STATE_LOADCOMPLETE
|
||||
*** M64CORE_STATE_SAVECOMPLETE
|
||||
* '''FRONTEND_API_VERSION''' version 2.1.1:
|
||||
** Core command M64CMD_CORE_STATE_SET will now accept M64CORE_VIDEO_SIZE parameter
|
||||
*** will call the video plugin function ResizeVideoOutput()
|
||||
* '''CONFIG_API_VERSION''' version 2.1.0:
|
||||
** add new function "ConfigSaveSection()" to save only a single config section to disk
|
||||
* '''CONFIG_API_VERSION''' version 2.2.0:
|
||||
** add new function "ConfigHasUnsavedChanges()" to determine if a given Section (or all sections) of the Mupen64Plus Core configuration file has been modified since it was last saved or loaded.
|
||||
** add new function "ConfigRevertChanges()" to revert changes previously made to one section of the configuration file, so that it will match with the configuration at the last time that it was loaded from or saved to disk.
|
||||
* '''VIDEO_API_VERSION''' version 2.1.0:
|
||||
** video render callback function now takes a boolean (int) parameter, which specifies whether the video frame has been re-drawn since the last time the render callback was called. This allows us to take screenshots without the On-Screen-Display text
|
||||
* '''VIDEO_API_VERSION''' version 2.2.0:
|
||||
** add (optional) ResizeVideoOutput function in video plugin. If this function is not present in video plugin, then resizing the output video window will not work.
|
||||
* '''VIDEXT_API_VERSION''' version 3.0.0:
|
||||
** add VidExt_ResizeWindow() function in video extension. This function is called by the video plugin to notify the window manager (SDL if no video extension is registered by the front-end) that the OpenGL render window size should change.
|
||||
** add m64p_video_flags parameter to the VidExt_SetVideoMode() function. Currently the flags are only used to notify the window manager that resizing is supported by the video plugin, and it should create a resizable window if possible. This may be extended in the future to support other features.
|
||||
|
|
@ -30,6 +30,10 @@ The expected sequence of operations which will be taken by the front-end applica
|
|||
#* Use <tt>CoreDoCommand</tt> to start emulation
|
||||
#* When emulation is finished, call <tt>CoreDetachPlugin</tt> on all plugins, then close the ROM
|
||||
|
||||
== Versioning ==
|
||||
=== [[Mupen64Plus v2.0 API Versioning|API Versioning Scheme]] ===
|
||||
Since the !Mupen64Plus emulator comprises 6 different software modules which can be mixed and matched (the front-end app, the core library, and 4 plugins), and the interfaces between these modules change over time, there are many hard-to-diagnose bugs which could show up due to incompatibilities between these different modules. For this reason, we use a comprehensive versioning scheme which allows any 2 components to determine whether or not they are compatible, and to support forward and backward compatibility as necessary. This scheme is described in detail in this document.
|
||||
|
||||
== Core API ==
|
||||
=== [[Mupen64Plus v2.0 Core Basic|Basic Core Functions]] ===
|
||||
|
||||
|
|
|
@ -227,9 +227,9 @@ These core parameters may be read and/or written using the M64CMD_CORE_STATE_QUE
|
|||
|-
|
||||
|M64CORE_VIDEO_SIZE
|
||||
|Yes
|
||||
|No
|
||||
|Yes
|
||||
|<tt>(ScreenWidth << 16) + ScreenHeight</tt>
|
||||
|This parameter is read-only.
|
||||
|This parameter can only be read or written when the emulator is running or paused. This parameter may be written by the front-end application in response to a window resizing event. Upon receiving this command, the core will pass the new width and height to the ResizeVideoOutput function in the video plugin (video API v2.2.0). If the video plugin supports resizing, it will update its viewport and then call the video extension function VidExt_ResizeWindow to update the window manager.
|
||||
|-
|
||||
|M64CORE_AUDIO_VOLUME
|
||||
|Yes
|
||||
|
@ -294,7 +294,7 @@ These core parameters may be read and/or written using the M64CMD_CORE_STATE_QUE
|
|||
|The Mupen64Plus library must already be initialized before calling this function. This function cannot be called while the emulator is running.
|
||||
|-
|
||||
|Usage
|
||||
|This function overrides the core's internal SDL-based OpenGL functions which are called from the video plugin to perform various basic tasks like opening the video window, toggling between windowed and fullscreen modes, and swapping frame buffers after a frame has been rendered. This override functionality allows a front-end to define its own video extension functions to be used instead of the SDL functions, such as for the purpose of embedding the emulator display window inside of a Qt GUI window. If any of the function pointers in the structure are NULL, the override function will be disabled and the core's internal SDL functions will be used. The v2.0 core expects the <tt>Functions</tt> struct member to be equal to 9 or more.
|
||||
|This function overrides the core's internal SDL-based OpenGL functions which are called from the video plugin to perform various basic tasks like opening the video window, toggling between windowed and fullscreen modes, and swapping frame buffers after a frame has been rendered. This override functionality allows a front-end to define its own video extension functions to be used instead of the SDL functions, such as for the purpose of embedding the emulator display window inside of a Qt GUI window. If any of the function pointers in the structure are NULL, the override function will be disabled and the core's internal SDL functions will be used. The core library with a Video Extension API v3.0 expects the <tt>Functions</tt> struct member to be equal to 11 or more.
|
||||
|}
|
||||
<br />
|
||||
|
||||
|
|
|
@ -51,13 +51,14 @@ All of these functions should only be called from within the video plugin; they
|
|||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode)</tt>'''
|
||||
|'''<tt>m64p_error VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode, m64p_video_flags Flags)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Width</tt>''' Horizontal resolution in pixels of desired video window<br />
|
||||
'''<tt>Height</tt>''' Vertical resolution in pixels of desired video window<br />
|
||||
'''<tt>BitsPerPixel</tt>''' Pixel color resolution of desired video window. This value must be 16, 24, or 32<br />
|
||||
'''<tt>ScreenMode</tt>''' Either <tt>M64VIDEO_WINDOWED</tt> or <tt>M64VIDEO_FULLSCREEN</tt>
|
||||
'''<tt>ScreenMode</tt>''' Either <tt>M64VIDEO_WINDOWED</tt> or <tt>M64VIDEO_FULLSCREEN</tt><br />
|
||||
'''<tt>Flags</tt>''' Logical-OR combination of flags which describes the video plugin's capabilities.
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function.
|
||||
|
@ -94,6 +95,44 @@ All of these functions should only be called from within the video plugin; they
|
|||
|This function toggles between fullscreen and windowed rendering modes.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_ResizeWindow(int Width, int Height)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Width</tt>''' Horizontal resolution of resized window in pixels<br />
|
||||
'''<tt>Height</tt>''' Vertical resolution of resized window in pixels
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function. The rendering window should already be created.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called when the video plugin has resized its OpenGL output viewport in response to a ResizeVideoOutput() call, and requests that the window manager update the OpenGL rendering window size to match. If a front-end application does not support resizable windows and never sets the M64CORE_VIDEO_SIZE core variable with the M64CMD_CORE_STATE_SET command, then this function should not be called.
|
||||
|}
|
||||
<br />
|
||||
|
||||
===Window Resizing===
|
||||
The window resizing functionality is particularly complicated, so here is a high-level description of the events which make it happen:
|
||||
|
||||
====Without video extension:====
|
||||
# In VidExt_SetVideoMode(), check if M64VIDEOFLAG_SUPPORT_RESIZING is set
|
||||
#* if True, create SDL window with RESIZABLE attribute
|
||||
# Core receives SDL_RESIZE messages in SDL event loop
|
||||
# If present, Core calls ResizeVideoOutput function in video plugin
|
||||
# Video Plugin calls ResizeWindow function in Video Extension
|
||||
#* Core calls SDL_SetVideoMode()
|
||||
# Core emits M64CORE_VIDEO_SIZE state changed callback
|
||||
|
||||
====With video extension:====
|
||||
# in Front-end SetVideoMode() callback
|
||||
#* if M64VIDEOFLAG_SUPPORT_RESIZING is set, create resizable window frame
|
||||
# Front-end GUI gets window resize notification
|
||||
# Front-end calls CoreDoCommand w/ M64CMD_CORE_STATE_SET, w/ M64CORE_VIDEO_SIZE
|
||||
# If present, Core calls ResizeVideoOutput function in video plugin
|
||||
# Video Plugin calls ResizeWindow function in Video Extension
|
||||
# Core emits M64CORE_VIDEO_SIZE state changed callback
|
||||
|
||||
In the Core Video Extension function ResizeWindow, the SDL function SetVideoMode() is called. This function will destroy the current OpenGL context and create a new one. For this reason, any video plugin which supports resizable windows must completely reset its OpenGL state including uploading any textures, FBOs, programs, etc after calling the VidExt_ResizeWindow function.
|
||||
|
||||
== OpenGL Functions ==
|
||||
{| border="1"
|
||||
|
|
|
@ -92,6 +92,9 @@ These functions are present in all of the plugins.
|
|||
|<tt>void SetRenderingCallback(void (*callback)(int bScreenRedrawn));</tt>
|
||||
|Allows the core to register a callback function that will be called by the graphics plugin just before the the frame buffers are swapped. '''***changed*** - as of video api v2.1.0, the callback function must take a single int (boolean) parameter, which tells the core whether or not the screen has been redrawn since the last time the callback was called. This is used to prevent screenshots from containing OSD text.'''
|
||||
|-
|
||||
|<tt>void ResizeVideoOutput(int width, int height);</tt>
|
||||
|'''***new*** function added in video api v2.2.0''' This function notifies the video plugin that the output video window has changed size. If resizing is supported, the video plugin should update its internal state to reflect the new window size, and then call the ResizeWindow function in the Video Extension API.
|
||||
|-
|
||||
|<tt>void FBRead(unsigned int addr)</tt>
|
||||
|Read data from frame buffer into emulated RAM space
|
||||
|-
|
||||
|
|
|
@ -94,6 +94,10 @@
|
|||
M64VIDEO_FULLSCREEN
|
||||
} m64p_video_mode;
|
||||
|
||||
typedef enum {
|
||||
M64VIDEOFLAG_SUPPORT_RESIZING = 1
|
||||
} m64p_video_flags;
|
||||
|
||||
typedef enum {
|
||||
M64CORE_EMU_STATE = 1,
|
||||
M64CORE_VIDEO_MODE,
|
||||
|
@ -311,12 +315,13 @@
|
|||
m64p_error (*VidExtFuncInit)(void);
|
||||
m64p_error (*VidExtFuncQuit)(void);
|
||||
m64p_error (*VidExtFuncListModes)(m64p_2d_size *, int *);
|
||||
m64p_error (*VidExtFuncSetMode)(int, int, int, int);
|
||||
m64p_error (*VidExtFuncSetMode)(int, int, int, int, int);
|
||||
void * (*VidExtFuncGLGetProc)(const char*);
|
||||
m64p_error (*VidExtFuncGLSetAttr)(m64p_GLattr, int);
|
||||
m64p_error (*VidExtFuncGLGetAttr)(m64p_GLattr, int *);
|
||||
m64p_error (*VidExtFuncGLSwapBuf)(void);
|
||||
m64p_error (*VidExtFuncSetCaption)(const char *);
|
||||
m64p_error (*VidExtFuncToggleFS)(void);
|
||||
m64p_error (*VidExtFuncResizeWindow)(int, int);
|
||||
} m64p_video_extension_functions;
|
||||
|
||||
|
|
|
@ -1,174 +0,0 @@
|
|||
Mupen64Plus API versions
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Goal:
|
||||
|
||||
The Mupen64Plus API versioning scheme was invented to give a more friendly and less confusing
|
||||
experience for users as the various components evolve over time. There are 6 basic components
|
||||
to the Mupen64Plus system, which may be independently built and installed:
|
||||
|
||||
1. The Front-end UI application
|
||||
2. The Core emulator library
|
||||
3. The Video plugin
|
||||
4. The Audio plugin
|
||||
5. The Input plugin
|
||||
6. The RSP plugin
|
||||
|
||||
These components interact with each other in several different ways. The design goal of the
|
||||
versioning scheme is to gracefully handle all situations in which two components support different
|
||||
versions of their common API (due to one component being newer than the other). In particular,
|
||||
each pair of components sharing a common API must discover whether or not they are compatible with
|
||||
each other. They must make this determination early enough in the startup process to inform the
|
||||
user of an incompatibility and gracefully exit the software if necessary without crashing. There
|
||||
are 2 different decisions that pertain to the compatibility determination:
|
||||
|
||||
1. Major API version. The various API version numbers are 32-bit. The major version number is
|
||||
stored in the upper 16 bits, and the minor version number is in the lower 16 bits. If two
|
||||
components have different major API version numbers, then they are definitely incompatible.
|
||||
2. Minor API version. If two components with a common API have different minor version numbers,
|
||||
then the newer component may decide whether or not it can interact with the older component
|
||||
based upon the older component's version number. The newer component may optionally disable
|
||||
new features and still retain backwards compatibility, or it may refuse to operate with the
|
||||
older component. This decision is left to the component author when new features are added.
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Basic Design:
|
||||
|
||||
In mupen64plus-core/src/plugin/plugin.h, the following macros are defined:
|
||||
|
||||
#define RSP_API_MAJOR_VERSION 0x20000
|
||||
#define GFX_API_MAJOR_VERSION 0x20000
|
||||
#define AUDIO_API_MAJOR_VERSION 0x20000
|
||||
#define INPUT_API_MAJOR_VERSION 0x20000
|
||||
|
||||
In mupen64plus-core/src/main/version.h, the following macros are defined:
|
||||
|
||||
#define FRONTEND_API_VERSION 0x020000
|
||||
#define CONFIG_API_VERSION 0x020000
|
||||
#define DEBUG_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x020000
|
||||
|
||||
1. When the front-end application calls the CoreStartup(), it passes it's Core<-->Front-end API
|
||||
version to the core. If the API major version numbers for the core and front-end don't match,
|
||||
the core return from this function with a failure code of M64ERR_INCOMPATIBLE.
|
||||
|
||||
2. The Console-UI front-end also checks for API compatibility, during the AttachCoreLib() function
|
||||
call. It is not strictly necessary for a front-end application to verify the API compatibility
|
||||
with the core, since the core will also check during CoreStartup(). However, by doing so, an
|
||||
updated front-end may detect a core library using a newer (but backwards-compatible) API, and
|
||||
enable some extra features as a result of the expanded API.
|
||||
|
||||
3. At the time each plugin is attached to the core (during CoreAttachPlugin function call), the
|
||||
core checks the version number of the plugin API by calling the PluginGetVersion function. If
|
||||
the major version number of the plugin's reported API (APIVersion & 0xffff0000) does not match
|
||||
the corresponding version number for that plugin type in the core (defined in plugin.h), then
|
||||
the plugin is incompatible and cannot be attached to the core. Currently the plugins have no
|
||||
way to request the major version number required for a particular plugin type in the core
|
||||
library.
|
||||
|
||||
4. The emulator core exports several different API groups which may be used by the front-end and
|
||||
plugin modules. Currently, these groups are: Front-end, Config, Debug, and Video Extension.
|
||||
A front-end application or any plugin may call the CoreGetAPIVersions() function to retrieve
|
||||
the API version numbers for these groups. Any plugin or front-end which can use any updated
|
||||
(not present in the original "2.0" API) functions in one of these groups should call the core's
|
||||
CoreGetAPIVersions() function (during PluginStartup for a plugin or at core attach time for a
|
||||
front-end) to check the version # of the API supported by the core, and react accordingly.
|
||||
|
||||
5. All front-ends and plugins should verify API version compatibility for the Config API.
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Handling Future Changes:
|
||||
|
||||
1. New feature added to a plugin library
|
||||
If the feature is backwards-compatible with older cores, then plugin API minor version will
|
||||
be bumped. Otherwise, major version number will be bumped. If change is backwards-compatible,
|
||||
then newest core can test the plugin's API version and only enable the feature if present.
|
||||
|
||||
2. New feature added to Core<-->Front-end API
|
||||
Typically this will happen when a new function or a new feature of an existing function is
|
||||
added to the core. If the older front-ends will still be compatible with newer cores, then the
|
||||
minor version number of the front-end API will be bumped. Otherwise the major version number
|
||||
will be bumped. A newer front-end can check the version of the API supported by the core and
|
||||
choose whether to retain backwards-compatibility with older cores or refuse to interoperate.
|
||||
|
||||
3. New feature added to Core Config API
|
||||
If older plugins can still use the Core Config API with the new feature, then Config API minor
|
||||
version will be bumped. Otherwise, major version number will be bumped. Newer plugins should
|
||||
check the Core's Config API version and maintain backwards compatibility with older cores if
|
||||
possible.
|
||||
|
||||
4. New feature added to Core Debug API
|
||||
If older front-ends can still use the Core Debug API with the new feature, then Debug API minor
|
||||
version number will be bumped. Otherwise, major version number will be bumped. Newer
|
||||
front-end applications should check the Core's Debug API version and maintain backwards
|
||||
compatibility with older cores if possible.
|
||||
|
||||
5. New feature added to Video Extension API
|
||||
This is the most complicated interface, because it involves 3 components: the video plugin, the
|
||||
core, and the front-end application. If older video plugins can still use the newer Video
|
||||
Extension API with the core, *and* newer front-end applications can work with older cores, then
|
||||
the Video Extension API minor version number will be bumped. Otherwise, the major version
|
||||
number will be bumped. Newer video plugins can check the Core's Video Extension API version
|
||||
and maintain backwards compatibility with older cores if possible, otherwise they can refuse
|
||||
and give a compatibility error. Front-end applications (such as the default console-ui) which
|
||||
do not hook into the Video Extension do not need to check the Core's Video Extension API
|
||||
version. However, front-end applications which do hook into the Video Extension must check the
|
||||
API version. If the Core and Front-end have different API major version numbers, then they are
|
||||
incompatible. Also if the Core has a *newer* minor version than the front-end, then they are
|
||||
incompatible. This is a unique restriction, and it must be checked and verified by the
|
||||
front-end; the Core has no way to check this.
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Changelog:
|
||||
- Version 2.0.0 is the base for all APIs
|
||||
|
||||
- FRONTEND_API_VERSION version 2.0.1:
|
||||
- added "m64p_command" type "M64CMD_CORE_STATE_SET", handled by CoreDoCommand()
|
||||
- added "m64p_core_param" type "M64CORE_SPEED_LIMITER", handled by "M64CMD_CORE_STATE_QUERY" and "M64CMD_CORE_STATE_SET" commands
|
||||
|
||||
- FRONTEND_API_VERSION version 2.0.2:
|
||||
- added "m64p_command" types:
|
||||
- M64CMD_GET_SCREEN_WIDTH
|
||||
- M64CMD_GET_SCREEN_HEIGHT
|
||||
- M64CMD_READ_SCREEN
|
||||
- M64CMD_VOLUME_UP
|
||||
- M64CMD_VOLUME_DOWN
|
||||
- M64CMD_VOLUME_GET_LEVEL
|
||||
- M64CMD_VOLUME_SET_LEVEL
|
||||
- M64CMD_VOLUME_MUTE
|
||||
- M64CMD_RESET
|
||||
- M64CMD_ADVANCE_FRAME
|
||||
- extend command M64CMD_STATE_SAVE to support saving uncompressed PJ64 savestate files as well as zip compressed
|
||||
|
||||
- FRONTEND_API_VERSION version 2.1.0:
|
||||
- removed "m64p_command" types:
|
||||
- M64CMD_GET_SCREEN_WIDTH
|
||||
- M64CMD_GET_SCREEN_HEIGHT
|
||||
- M64CMD_VOLUME_UP
|
||||
- M64CMD_VOLUME_DOWN
|
||||
- M64CMD_VOLUME_GET_LEVEL
|
||||
- M64CMD_VOLUME_SET_LEVEL
|
||||
- M64CMD_VOLUME_MUTE
|
||||
- added new "m64p_core_param" types:
|
||||
- M64CORE_VIDEO_SIZE
|
||||
- M64CORE_AUDIO_VOLUME
|
||||
- M64CORE_AUDIO_MUTE
|
||||
- M64CORE_INPUT_GAMESHARK
|
||||
- M64CORE_STATE_LOADCOMPLETE
|
||||
- M64CORE_STATE_SAVECOMPLETE
|
||||
|
||||
- CONFIG_API_VERSION version 2.1.0:
|
||||
- add new function "ConfigSaveSection()" to save only a single config section to disk
|
||||
|
||||
- CONFIG_API_VERSION version 2.2.0:
|
||||
- add new function "ConfigHasUnsavedChanges()" to determine if a given Section (or all sections)
|
||||
of the Mupen64Plus Core configuration file has been modified since it was last saved or loaded.
|
||||
- add new function "ConfigRevertChanges()" to revert changes previously made to one section of
|
||||
the configuration file, so that it will match with the configuration at the last time that it
|
||||
was loaded from or saved to disk.
|
||||
|
||||
- VIDEO_API_VERSION version 2.1.0:
|
||||
- video render callback function now takes a boolean (int) parameter, which specifies whether the
|
||||
video frame has been re-drawn since the last time the render callback was called. This allows
|
||||
us to take screenshots without the On-Screen-Display text
|
||||
|
|
@ -20,10 +20,12 @@
|
|||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@ -50,11 +52,17 @@
|
|||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>mupen64plus</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>mupen64plus</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;inline=__inline;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
|
@ -78,7 +86,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\src;..\..\..\mupen64plus-win32-deps\SDL-1.2.14\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.3\include;..\..\..\mupen64plus-win32-deps\libpng-1.2.37\include;..\..\..\mupen64plus-win32-deps\freetype-2.3.5-1\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;inline=__inline;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
|
@ -157,6 +165,7 @@
|
|||
<ClCompile Include="..\..\src\r4300\x86\rjump.c" />
|
||||
<ClCompile Include="..\..\src\main\rom.c" />
|
||||
<ClCompile Include="..\..\src\main\savestates.c" />
|
||||
<ClCompile Include="..\..\src\main\sdl_key_converter.c" />
|
||||
<ClCompile Include="..\..\src\osd\screenshot.cpp" />
|
||||
<ClCompile Include="..\..\src\memory\tlb.c" />
|
||||
<ClCompile Include="..\..\src\main\zip\unzip.c" />
|
||||
|
@ -217,6 +226,7 @@
|
|||
<ClInclude Include="..\..\src\r4300\reset.h" />
|
||||
<ClInclude Include="..\..\src\main\rom.h" />
|
||||
<ClInclude Include="..\..\src\main\savestates.h" />
|
||||
<ClInclude Include="..\..\src\main\sdl_key_converter.h" />
|
||||
<ClInclude Include="..\..\src\osd\screenshot.h" />
|
||||
<ClInclude Include="..\..\src\memory\tlb.h" />
|
||||
<ClInclude Include="..\..\src\main\zip\unzip.h" />
|
||||
|
@ -229,4 +239,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -408,6 +408,10 @@
|
|||
RelativePath="..\..\src\main\savestates.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\main\sdl_key_converter.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\osd\screenshot.cpp"
|
||||
>
|
||||
|
@ -646,6 +650,10 @@
|
|||
RelativePath="..\..\src\main\savestates.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\main\sdl_key_converter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\osd\screenshot.h"
|
||||
>
|
||||
|
|
|
@ -104,24 +104,18 @@ ifeq ("$(CPU)","NONE")
|
|||
endif
|
||||
|
||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
||||
OPTFLAGS ?= -O3
|
||||
OPTFLAGS ?= -O3 -flto
|
||||
WARNFLAGS ?= -Wall
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -DM64P_PARALLEL
|
||||
CXXFLAGS += -fvisibility-inlines-hidden
|
||||
LDLIBS += -lm
|
||||
|
||||
# default configuration programs
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
|
||||
# Since we are building a shared library, we must compile with -fPIC on some architectures
|
||||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
||||
ifeq ($(PIC), 1)
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS += -fPIC
|
||||
else
|
||||
CFLAGS += -fno-PIC
|
||||
LDFLAGS += -fno-PIC
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
|
@ -134,7 +128,7 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
|
|||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||
endif
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32 -Wl,-m,elf_i386
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
|
@ -153,28 +147,18 @@ ifeq ($(OS), LINUX)
|
|||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/api/api_export.ver
|
||||
endif
|
||||
ifeq ($(OS), OSX)
|
||||
# Select the proper SDK
|
||||
# Also, SDKs are stored in a different location since XCode 4.3
|
||||
OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .)
|
||||
OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .)
|
||||
OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .)
|
||||
OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`")
|
||||
ifeq ($(OSX_XCODEGE43), 11)
|
||||
OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
||||
else
|
||||
OSX_SYSROOT := /Developer/SDKs
|
||||
endif
|
||||
#xcode-select has been around since XCode 3.0, i.e. OS X 10.5
|
||||
OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs
|
||||
OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1)
|
||||
|
||||
TARGET = libmupen64plus$(POSTFIX).dylib
|
||||
LDFLAGS += -bundle -read_only_relocs suppress
|
||||
LDLIBS += -ldl
|
||||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -arch x86_64
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
else
|
||||
CFLAGS += -pipe -mmmx -msse -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -arch i686
|
||||
CFLAGS += -pipe -mmmx -msse -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
ifneq ($(PROFILE), 1)
|
||||
CFLAGS += -fomit-frame-pointer
|
||||
endif
|
||||
|
@ -203,60 +187,92 @@ endif
|
|||
endif
|
||||
|
||||
# test for essential build dependencies
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),)
|
||||
$(error No libpng development libraries found!)
|
||||
ifeq ($(origin PKG_CONFIG), undefined)
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS), OSX) # use system zlib on OSX
|
||||
LDLIBS += -lz
|
||||
else
|
||||
ZLIB_LDLIBS += -lz
|
||||
endif
|
||||
|
||||
ifeq ($(origin ZLIB_CFLAGS) $(origin ZLIB_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion zlib 2>/dev/null),)
|
||||
$(error No zlib development libraries found!)
|
||||
endif
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib)
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --libs zlib)
|
||||
ZLIB_CFLAGS += $(shell $(PKG_CONFIG) --cflags zlib)
|
||||
ZLIB_LDLIBS += $(shell $(PKG_CONFIG) --libs zlib)
|
||||
endif
|
||||
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --libs libpng)
|
||||
CFLAGS += $(ZLIB_CFLAGS)
|
||||
LDLIBS += $(ZLIB_LDLIBS)
|
||||
|
||||
ifeq ($(origin LIBPNG_CFLAGS) $(origin LIBPNG_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),)
|
||||
$(error No libpng development libraries found!)
|
||||
endif
|
||||
LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
||||
LIBPNG_LDLIBS += $(shell $(PKG_CONFIG) --libs libpng)
|
||||
endif
|
||||
CFLAGS += $(LIBPNG_CFLAGS)
|
||||
LDLIBS += $(LIBPNG_LDLIBS)
|
||||
|
||||
# test for presence of SDL
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
endif
|
||||
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
CFLAGS += $(SDL_CFLAGS)
|
||||
LDLIBS += $(SDL_LDLIBS)
|
||||
|
||||
OSD ?= 1
|
||||
ifeq ($(OSD), 1)
|
||||
CFLAGS += -DM64P_OSD
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion freetype2 2>/dev/null),)
|
||||
$(error No FreeType 2 development libraries found!)
|
||||
|
||||
ifeq ($(origin FREETYPE2_CFLAGS) $(origin FREETYPE2_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion freetype2 2>/dev/null),)
|
||||
$(error No freetype2 development libraries found!)
|
||||
endif
|
||||
FREETYPE2_CFLAGS += $(shell $(PKG_CONFIG) --cflags freetype2)
|
||||
FREETYPE2_LDLIBS += $(shell $(PKG_CONFIG) --libs freetype2)
|
||||
endif
|
||||
CFLAGS += $(FREETYPE2_CFLAGS)
|
||||
LDLIBS += $(FREETYPE2_LDLIBS)
|
||||
|
||||
# search for OpenGL libraries
|
||||
GL_LIBS=
|
||||
ifeq ($(OS), OSX)
|
||||
GL_LIBS = -framework OpenGL
|
||||
GL_LDLIBS = -framework OpenGL
|
||||
GLU_LDLIBS = -framework OpenGL
|
||||
endif
|
||||
ifeq ($(OS), MINGW)
|
||||
GL_LIBS = -lopengl32 -lglu32
|
||||
GL_LDLIBS = -lopengl32
|
||||
GLU_LDLIBS = -lglu32
|
||||
endif
|
||||
ifeq ("$(GL_LIBS)", "")
|
||||
|
||||
ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),)
|
||||
$(error No OpenGL development libraries found!)
|
||||
endif
|
||||
GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
||||
GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl)
|
||||
endif
|
||||
CFLAGS += $(GL_CFLAGS)
|
||||
LDLIBS += $(GL_LDLIBS)
|
||||
|
||||
ifeq ($(origin GLU_CFLAGS) $(origin GLU_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion glu 2>/dev/null),)
|
||||
$(error No OpenGL utility development libraries found!)
|
||||
endif
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags gl glu)
|
||||
GL_LIBS = $(shell $(PKG_CONFIG) --libs gl glu)
|
||||
GLU_CFLAGS += $(shell $(PKG_CONFIG) --cflags glu)
|
||||
GLU_LDLIBS += $(shell $(PKG_CONFIG) --libs glu)
|
||||
endif
|
||||
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags freetype2)
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --libs freetype2) $(GL_LIBS)
|
||||
CFLAGS += $(GLU_CFLAGS)
|
||||
LDLIBS += $(GLU_LDLIBS)
|
||||
endif
|
||||
|
||||
# set base program pointers and flags
|
||||
|
@ -267,7 +283,7 @@ INSTALL ?= install
|
|||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
ifeq ($(OS),OSX)
|
||||
LDCONFIG ?= true # no 'ldconfig' under OSX
|
||||
|
@ -288,7 +304,6 @@ endif
|
|||
# 2. variables for profiling and adding debugging symbols
|
||||
ifeq ($(PROFILE), 1)
|
||||
CFLAGS += -pg -g
|
||||
LDFLAGS += -pg
|
||||
INSTALL_STRIP_FLAG ?=
|
||||
else
|
||||
ifeq ($(DEBUG), 1)
|
||||
|
@ -360,6 +375,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 \
|
||||
|
@ -497,7 +513,7 @@ targets:
|
|||
@echo " LIRC=1 == enable LIRC support"
|
||||
@echo " NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code)"
|
||||
@echo " SHAREDIR=path == extra path to search for shared data files"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3)"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)"
|
||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
||||
@echo " PIC=(1|0) == Force enable/disable of position independent code"
|
||||
@echo " OSD=(1|0) == Enable/disable build of OpenGL On-screen display"
|
||||
|
@ -518,7 +534,6 @@ targets:
|
|||
@echo " DBG_COMPARE=1 == enable core-synchronized r4300 debugging"
|
||||
@echo " DBG_TIMING=1 == print timing data"
|
||||
@echo " DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file"
|
||||
@echo " LTO=1 == enable experimental build with link-time optimization"
|
||||
@echo " V=1 == show verbose compiler output"
|
||||
|
||||
all: $(TARGET)
|
||||
|
@ -550,11 +565,6 @@ CFLAGS += -MD
|
|||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += -fuse-linker-plugin $(CXXFLAGS)
|
||||
endif
|
||||
|
||||
# standard build rules
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.S
|
||||
|
|
|
@ -65,4 +65,5 @@ VidExt_Quit;
|
|||
VidExt_SetCaption;
|
||||
VidExt_SetVideoMode;
|
||||
VidExt_ToggleFullScreen;
|
||||
VidExt_ResizeWindow;
|
||||
local: *; };
|
||||
|
|
|
@ -1413,7 +1413,10 @@ EXPORT const char * CALL ConfigGetSharedDataFilepath(const char *filename)
|
|||
EXPORT const char * CALL ConfigGetUserConfigPath(void)
|
||||
{
|
||||
if (l_ConfigDirOverride != NULL)
|
||||
{
|
||||
osal_mkdirp(l_ConfigDirOverride, 0700);
|
||||
return l_ConfigDirOverride;
|
||||
}
|
||||
else
|
||||
return osal_get_user_configpath();
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ typedef void (*ptr_ViStatusChanged)(void);
|
|||
typedef void (*ptr_ViWidthChanged)(void);
|
||||
typedef void (*ptr_ReadScreen2)(void *dest, int *width, int *height, int front);
|
||||
typedef void (*ptr_SetRenderingCallback)(void (*callback)(int));
|
||||
typedef void (*ptr_ResizeVideoOutput)(int width, int height);
|
||||
#if defined(M64P_PLUGIN_PROTOTYPES)
|
||||
EXPORT void CALL ChangeWindow(void);
|
||||
EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info);
|
||||
|
@ -191,6 +192,7 @@ EXPORT void CALL ViStatusChanged(void);
|
|||
EXPORT void CALL ViWidthChanged(void);
|
||||
EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front);
|
||||
EXPORT void CALL SetRenderingCallback(void (*callback)(int));
|
||||
EXPORT void CALL ResizeVideoOutput(int width, int height);
|
||||
#endif
|
||||
|
||||
/* frame buffer plugin spec extension */
|
||||
|
|
|
@ -116,6 +116,10 @@ typedef enum {
|
|||
M64VIDEO_FULLSCREEN
|
||||
} m64p_video_mode;
|
||||
|
||||
typedef enum {
|
||||
M64VIDEOFLAG_SUPPORT_RESIZING = 1
|
||||
} m64p_video_flags;
|
||||
|
||||
typedef enum {
|
||||
M64CORE_EMU_STATE = 1,
|
||||
M64CORE_VIDEO_MODE,
|
||||
|
@ -340,13 +344,14 @@ typedef struct {
|
|||
m64p_error (*VidExtFuncInit)(void);
|
||||
m64p_error (*VidExtFuncQuit)(void);
|
||||
m64p_error (*VidExtFuncListModes)(m64p_2d_size *, int *);
|
||||
m64p_error (*VidExtFuncSetMode)(int, int, int, int);
|
||||
m64p_error (*VidExtFuncSetMode)(int, int, int, int, int);
|
||||
void * (*VidExtFuncGLGetProc)(const char*);
|
||||
m64p_error (*VidExtFuncGLSetAttr)(m64p_GLattr, int);
|
||||
m64p_error (*VidExtFuncGLGetAttr)(m64p_GLattr, int *);
|
||||
m64p_error (*VidExtFuncGLSwapBuf)(void);
|
||||
m64p_error (*VidExtFuncSetCaption)(const char *);
|
||||
m64p_error (*VidExtFuncToggleFS)(void);
|
||||
m64p_error (*VidExtFuncResizeWindow)(int, int);
|
||||
} m64p_video_extension_functions;
|
||||
|
||||
#endif /* define M64P_TYPES_H */
|
||||
|
|
|
@ -73,9 +73,18 @@ EXPORT m64p_error CALL VidExt_ListFullscreenModes(m64p_2d_size *, int *);
|
|||
* video mode. Any desired OpenGL attributes should be set before calling
|
||||
* this function.
|
||||
*/
|
||||
typedef m64p_error (*ptr_VidExt_SetVideoMode)(int, int, int, m64p_video_mode);
|
||||
typedef m64p_error (*ptr_VidExt_SetVideoMode)(int, int, int, m64p_video_mode, m64p_video_flags);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL VidExt_SetVideoMode(int, int, int, m64p_video_mode);
|
||||
EXPORT m64p_error CALL VidExt_SetVideoMode(int, int, int, m64p_video_mode, m64p_video_flags);
|
||||
#endif
|
||||
|
||||
/* VidExt_ResizeWindow()
|
||||
*
|
||||
* This function resizes the opengl rendering window to match the given size.
|
||||
*/
|
||||
typedef m64p_error (*ptr_VidExt_ResizeWindow)(int, int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL VidExt_ResizeWindow(int, int);
|
||||
#endif
|
||||
|
||||
/* VidExt_SetCaption()
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "m64p_vidext.h"
|
||||
#include "vidext.h"
|
||||
#include "callbacks.h"
|
||||
#include "../osd/osd.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,0)
|
||||
|
@ -51,7 +52,7 @@ m64p_error OverrideVideoFunctions(m64p_video_extension_functions *VideoFunctionS
|
|||
/* check input data */
|
||||
if (VideoFunctionStruct == NULL)
|
||||
return M64ERR_INPUT_ASSERT;
|
||||
if (VideoFunctionStruct->Functions < 10)
|
||||
if (VideoFunctionStruct->Functions < 11)
|
||||
return M64ERR_INPUT_INVALID;
|
||||
|
||||
/* disable video extension if any of the function pointers are NULL */
|
||||
|
@ -64,10 +65,11 @@ m64p_error OverrideVideoFunctions(m64p_video_extension_functions *VideoFunctionS
|
|||
VideoFunctionStruct->VidExtFuncGLGetAttr == NULL ||
|
||||
VideoFunctionStruct->VidExtFuncGLSwapBuf == NULL ||
|
||||
VideoFunctionStruct->VidExtFuncSetCaption == NULL ||
|
||||
VideoFunctionStruct->VidExtFuncToggleFS == NULL)
|
||||
VideoFunctionStruct->VidExtFuncToggleFS == NULL ||
|
||||
VideoFunctionStruct->VidExtFuncResizeWindow == NULL)
|
||||
{
|
||||
l_ExternalVideoFuncTable.Functions = 10;
|
||||
memset(&l_ExternalVideoFuncTable.VidExtFuncInit, 0, 10 * sizeof(void *));
|
||||
l_ExternalVideoFuncTable.Functions = 11;
|
||||
memset(&l_ExternalVideoFuncTable.VidExtFuncInit, 0, 11 * sizeof(void *));
|
||||
l_VideoExtensionActive = 0;
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
@ -180,7 +182,7 @@ EXPORT m64p_error CALL VidExt_ListFullscreenModes(m64p_2d_size *SizeArray, int *
|
|||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode)
|
||||
EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode, m64p_video_flags Flags)
|
||||
{
|
||||
const SDL_VideoInfo *videoInfo;
|
||||
int videoFlags = 0;
|
||||
|
@ -189,7 +191,7 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
|
|||
/* call video extension override if necessary */
|
||||
if (l_VideoExtensionActive)
|
||||
{
|
||||
m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncSetMode)(Width, Height, BitsPerPixel, ScreenMode);
|
||||
m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncSetMode)(Width, Height, BitsPerPixel, ScreenMode, Flags);
|
||||
l_Fullscreen = (rval == M64ERR_SUCCESS && ScreenMode == M64VIDEO_FULLSCREEN);
|
||||
l_VideoOutputActive = (rval == M64ERR_SUCCESS);
|
||||
if (l_VideoOutputActive)
|
||||
|
@ -205,11 +207,19 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
|
|||
|
||||
/* Get SDL video flags to use */
|
||||
if (ScreenMode == M64VIDEO_WINDOWED)
|
||||
{
|
||||
videoFlags = SDL_OPENGL;
|
||||
if (Flags & M64VIDEOFLAG_SUPPORT_RESIZING)
|
||||
videoFlags |= SDL_RESIZABLE;
|
||||
}
|
||||
else if (ScreenMode == M64VIDEO_FULLSCREEN)
|
||||
{
|
||||
videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
return M64ERR_INPUT_INVALID;
|
||||
}
|
||||
|
||||
if ((videoInfo = SDL_GetVideoInfo()) == NULL)
|
||||
{
|
||||
|
@ -252,6 +262,66 @@ EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPix
|
|||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
EXPORT m64p_error CALL VidExt_ResizeWindow(int Width, int Height)
|
||||
{
|
||||
const SDL_VideoInfo *videoInfo;
|
||||
int videoFlags = 0;
|
||||
|
||||
/* call video extension override if necessary */
|
||||
if (l_VideoExtensionActive)
|
||||
{
|
||||
m64p_error rval;
|
||||
// shut down the OSD
|
||||
osd_exit();
|
||||
// re-create the OGL context
|
||||
rval = (*l_ExternalVideoFuncTable.VidExtFuncResizeWindow)(Width, Height);
|
||||
if (rval == M64ERR_SUCCESS)
|
||||
{
|
||||
StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height);
|
||||
// re-create the On-Screen Display
|
||||
osd_init(Width, Height);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
if (!l_VideoOutputActive || !SDL_WasInit(SDL_INIT_VIDEO))
|
||||
return M64ERR_NOT_INIT;
|
||||
|
||||
if (l_Fullscreen)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "VidExt_ResizeWindow() called in fullscreen mode.");
|
||||
return M64ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
/* Get SDL video flags to use */
|
||||
videoFlags = SDL_OPENGL | SDL_RESIZABLE;
|
||||
if ((videoInfo = SDL_GetVideoInfo()) == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "SDL_GetVideoInfo query failed: %s", SDL_GetError());
|
||||
return M64ERR_SYSTEM_FAIL;
|
||||
}
|
||||
if (videoInfo->hw_available)
|
||||
videoFlags |= SDL_HWSURFACE;
|
||||
else
|
||||
videoFlags |= SDL_SWSURFACE;
|
||||
|
||||
// destroy the On-Screen Display
|
||||
osd_exit();
|
||||
|
||||
/* set the re-sizing the screen will create a new OpenGL context */
|
||||
l_pScreen = SDL_SetVideoMode(Width, Height, 0, videoFlags);
|
||||
if (l_pScreen == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "SDL_SetVideoMode failed: %s", SDL_GetError());
|
||||
return M64ERR_SYSTEM_FAIL;
|
||||
}
|
||||
|
||||
StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height);
|
||||
// re-create the On-Screen Display
|
||||
osd_init(Width, Height);
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
EXPORT m64p_error CALL VidExt_SetCaption(const char *Title)
|
||||
{
|
||||
/* call video extension override if necessary */
|
||||
|
|
|
@ -75,6 +75,8 @@ static MEMBREAKWRITE(write_rom, 8);
|
|||
|
||||
#if !defined(NO_ASM) && (defined(__i386__) || defined(__x86_64__))
|
||||
|
||||
/* we must define PACKAGE so that bfd.h (which is included from dis-asm.h) doesn't throw an error */
|
||||
#define PACKAGE "mupen64plus-core"
|
||||
#include <dis-asm.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
|
|
@ -41,7 +41,16 @@
|
|||
#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
|
||||
|
||||
#define SDL_SetEventFilter(func, data) SDL_SetEventFilter(func)
|
||||
#define event_sdl_filter(userdata, event) event_sdl_filter(const event)
|
||||
|
@ -51,6 +60,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"
|
||||
|
@ -246,6 +256,9 @@ static int SDLCALL event_sdl_filter(void *userdata, SDL_Event *event)
|
|||
|
||||
case SDL_KEYDOWN:
|
||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
||||
if (event->key.repeat)
|
||||
return 0;
|
||||
|
||||
event_sdl_keydown(event->key.keysym.scancode, event->key.keysym.mod);
|
||||
#else
|
||||
event_sdl_keydown(event->key.keysym.sym, event->key.keysym.mod);
|
||||
|
@ -259,6 +272,26 @@ static int SDLCALL event_sdl_filter(void *userdata, SDL_Event *event)
|
|||
#endif
|
||||
return 0;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,0)
|
||||
case SDL_WINDOWEVENT:
|
||||
switch (event->window.event) {
|
||||
case SDL_WINDOWEVENT_RESIZED:
|
||||
// call the video plugin. if the video plugin supports resizing, it will resize its viewport and call
|
||||
// VidExt_ResizeWindow to update the window manager handling our opengl output window
|
||||
gfx.resizeVideoOutput(event->window.data1, event->window.data2);
|
||||
return 0; // consumed the event
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#else
|
||||
case SDL_VIDEORESIZE:
|
||||
// call the video plugin. if the video plugin supports resizing, it will resize its viewport and call
|
||||
// VidExt_ResizeWindow to update the window manager handling our opengl output window
|
||||
gfx.resizeVideoOutput(event->resize.w, event->resize.h);
|
||||
return 0; // consumed the event
|
||||
break;
|
||||
#endif
|
||||
|
||||
// if joystick action is detected, check if it's mapped to a special function
|
||||
case SDL_JOYAXISMOTION:
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
|
@ -333,7 +366,7 @@ void event_initialize(void)
|
|||
if (!SDL_WasInit(SDL_INIT_JOYSTICK))
|
||||
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
|
||||
#if SDL_VERSION_ATLEAST(2,0,0)
|
||||
#warning SDL_JoystickOpened unsupported
|
||||
SDL_JoystickOpen(device);
|
||||
#else
|
||||
if (!SDL_JoystickOpened(device))
|
||||
SDL_JoystickOpen(device);
|
||||
|
@ -342,9 +375,7 @@ void event_initialize(void)
|
|||
}
|
||||
|
||||
/* set up SDL event filter and disable key repeat */
|
||||
#if SDL_VERSION_ATLEAST(2,0,0)
|
||||
#warning SDL_EnableKeyRepeat unsupported
|
||||
#else
|
||||
#if !SDL_VERSION_ATLEAST(2,0,0)
|
||||
SDL_EnableKeyRepeat(0, 0);
|
||||
#endif
|
||||
SDL_SetEventFilter(event_sdl_filter, NULL);
|
||||
|
@ -386,22 +417,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");
|
||||
|
@ -422,49 +453,79 @@ 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 == 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
|
||||
{
|
||||
|
@ -476,15 +537,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);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include "osal/preproc.h"
|
||||
|
||||
struct list_head {
|
||||
struct list_head *prev;
|
||||
|
@ -36,13 +37,13 @@ struct list_head {
|
|||
#define LIST_HEAD(list) \
|
||||
struct list_head list = { &(list), &(list) }
|
||||
|
||||
static inline void INIT_LIST_HEAD(struct list_head *head)
|
||||
static osal_inline void INIT_LIST_HEAD(struct list_head *head)
|
||||
{
|
||||
head->next = head;
|
||||
head->prev = head;
|
||||
}
|
||||
|
||||
static inline void list_add(struct list_head *new_item, struct list_head *head)
|
||||
static osal_inline void list_add(struct list_head *new_item, struct list_head *head)
|
||||
{
|
||||
struct list_head *next = head->next;
|
||||
|
||||
|
@ -52,7 +53,7 @@ static inline void list_add(struct list_head *new_item, struct list_head *head)
|
|||
head->next = new_item;
|
||||
}
|
||||
|
||||
static inline void list_add_tail(struct list_head *new_item, struct list_head *head)
|
||||
static osal_inline void list_add_tail(struct list_head *new_item, struct list_head *head)
|
||||
{
|
||||
struct list_head *prev = head->prev;
|
||||
|
||||
|
@ -62,7 +63,7 @@ static inline void list_add_tail(struct list_head *new_item, struct list_head *h
|
|||
head->prev = new_item;
|
||||
}
|
||||
|
||||
static inline void list_del(struct list_head *entry)
|
||||
static osal_inline void list_del(struct list_head *entry)
|
||||
{
|
||||
struct list_head *next = entry->next;
|
||||
struct list_head *prev = entry->prev;
|
||||
|
@ -71,13 +72,13 @@ static inline void list_del(struct list_head *entry)
|
|||
prev->next = next;
|
||||
}
|
||||
|
||||
static inline void list_del_init(struct list_head *entry)
|
||||
static osal_inline void list_del_init(struct list_head *entry)
|
||||
{
|
||||
list_del(entry);
|
||||
INIT_LIST_HEAD(entry);
|
||||
}
|
||||
|
||||
static inline int list_empty(const struct list_head *head)
|
||||
static osal_inline int list_empty(const struct list_head *head)
|
||||
{
|
||||
return (head->next == head);
|
||||
}
|
||||
|
|
|
@ -527,8 +527,19 @@ m64p_error main_core_state_set(m64p_core_param param, int val)
|
|||
main_set_speedlimiter(val);
|
||||
return M64ERR_SUCCESS;
|
||||
case M64CORE_VIDEO_SIZE:
|
||||
// you cannot force the screen size using this function
|
||||
return M64ERR_INPUT_INVALID;
|
||||
{
|
||||
// the front-end app is telling us that the user has resized the video output frame, and so
|
||||
// we should try to update the video plugin accordingly. First, check state
|
||||
int width, height;
|
||||
if (!g_EmulatorRunning)
|
||||
return M64ERR_INVALID_STATE;
|
||||
width = (val >> 16) & 0xffff;
|
||||
height = val & 0xffff;
|
||||
// then call the video plugin. if the video plugin supports resizing, it will resize its viewport and call
|
||||
// VidExt_ResizeWindow to update the window manager handling our opengl output window
|
||||
gfx.resizeVideoOutput(width, height);
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
case M64CORE_AUDIO_VOLUME:
|
||||
if (!g_EmulatorRunning)
|
||||
return M64ERR_INVALID_STATE;
|
||||
|
|
|
@ -59,7 +59,7 @@ m64p_rom_header ROM_HEADER;
|
|||
rom_params ROM_PARAMS;
|
||||
m64p_rom_settings ROM_SETTINGS;
|
||||
|
||||
static m64p_system_type rom_country_code_to_system_type(char country_code);
|
||||
static m64p_system_type rom_country_code_to_system_type(unsigned short country_code);
|
||||
static int rom_system_type_to_ai_dac_rate(m64p_system_type system_type);
|
||||
static int rom_system_type_to_vi_limit(m64p_system_type system_type);
|
||||
|
||||
|
@ -254,9 +254,9 @@ m64p_error close_rom(void)
|
|||
/* ROM utility functions */
|
||||
|
||||
// Get the system type associated to a ROM country code.
|
||||
static m64p_system_type rom_country_code_to_system_type(char country_code)
|
||||
static m64p_system_type rom_country_code_to_system_type(unsigned short country_code)
|
||||
{
|
||||
switch (country_code)
|
||||
switch (country_code & 0xFF)
|
||||
{
|
||||
// PAL codes
|
||||
case 0x44:
|
||||
|
|
|
@ -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 <stdint.h>
|
||||
#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];
|
||||
}
|
|
@ -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 <SDL.h>
|
||||
|
||||
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
|
|
@ -122,7 +122,7 @@ void to_big_endian_buffer(void *buffer, size_t length, size_t count)
|
|||
/**********************
|
||||
GUI utilities
|
||||
**********************/
|
||||
void countrycodestring(char countrycode, char *string)
|
||||
void countrycodestring(unsigned short countrycode, char *string)
|
||||
{
|
||||
switch (countrycode)
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include "osal/preproc.h"
|
||||
|
||||
/**********************
|
||||
File utilities
|
||||
|
@ -64,7 +65,7 @@ file_status_t write_to_file(const char *filename, const void *data, size_t size)
|
|||
* added in relatively recent versions. In addition, GCC can detect the byte
|
||||
* swap code and optimize it with a high enough optimization level. */
|
||||
|
||||
static inline unsigned short m64p_swap16(unsigned short x)
|
||||
static osal_inline unsigned short m64p_swap16(unsigned short x)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _byteswap_ushort(x);
|
||||
|
@ -74,7 +75,7 @@ static inline unsigned short m64p_swap16(unsigned short x)
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned int m64p_swap32(unsigned int x)
|
||||
static osal_inline unsigned int m64p_swap32(unsigned int x)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _byteswap_ulong(x); // long is always 32-bit in Windows
|
||||
|
@ -86,7 +87,7 @@ static inline unsigned int m64p_swap32(unsigned int x)
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned long long int m64p_swap64(unsigned long long int x)
|
||||
static osal_inline unsigned long long int m64p_swap64(unsigned long long int x)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _byteswap_uint64(x);
|
||||
|
@ -127,7 +128,7 @@ void to_big_endian_buffer(void *buffer, size_t length, size_t count);
|
|||
/**********************
|
||||
GUI utilities
|
||||
**********************/
|
||||
void countrycodestring(char countrycode, char *string);
|
||||
void countrycodestring(unsigned short countrycode, char *string);
|
||||
void imagestring(unsigned char imagetype, char *string);
|
||||
|
||||
/**********************
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
#define __VERSION_H__
|
||||
|
||||
#define MUPEN_CORE_NAME "Mupen64Plus Core"
|
||||
#define MUPEN_CORE_VERSION 0x016305
|
||||
#define MUPEN_CORE_VERSION 0x020000
|
||||
|
||||
#define FRONTEND_API_VERSION 0x020100
|
||||
#define FRONTEND_API_VERSION 0x020101
|
||||
#define CONFIG_API_VERSION 0x020200
|
||||
#define DEBUG_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x030000
|
||||
|
||||
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#define __WORKQUEUE_H__
|
||||
|
||||
#include "list.h"
|
||||
#include "osal/preproc.h"
|
||||
|
||||
struct work_struct *work;
|
||||
typedef void (*work_func_t)(struct work_struct *work);
|
||||
|
@ -31,7 +32,7 @@ struct work_struct {
|
|||
struct list_head list;
|
||||
};
|
||||
|
||||
static inline void init_work(struct work_struct *work, work_func_t func)
|
||||
static osal_inline void init_work(struct work_struct *work, work_func_t func)
|
||||
{
|
||||
INIT_LIST_HEAD(&work->list);
|
||||
work->func = func;
|
||||
|
@ -45,16 +46,16 @@ int queue_work(struct work_struct *work);
|
|||
|
||||
#else
|
||||
|
||||
static inline int workqueue_init(void)
|
||||
static osal_inline int workqueue_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void workqueue_shutdown(void)
|
||||
static osal_inline void workqueue_shutdown(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int queue_work(struct work_struct *work)
|
||||
static osal_inline int queue_work(struct work_struct *work)
|
||||
{
|
||||
work->func(work);
|
||||
return 0;
|
||||
|
|
|
@ -353,10 +353,6 @@ void dma_si_write(void)
|
|||
}
|
||||
|
||||
update_pif_write();
|
||||
|
||||
// TODO: under what circumstances should bits 1 or 3 be set?
|
||||
si_register.si_stat |= 1;
|
||||
|
||||
update_count();
|
||||
add_interupt_event(SI_INT, /*0x100*/0x900);
|
||||
}
|
||||
|
@ -378,9 +374,6 @@ void dma_si_read(void)
|
|||
rdram[si_register.si_dram_addr/4+i] = sl(PIF_RAM[i]);
|
||||
}
|
||||
|
||||
// TODO: under what circumstances should bits 1 or 3 be set?
|
||||
si_register.si_stat |= 1;
|
||||
|
||||
update_count();
|
||||
add_interupt_event(SI_INT, /*0x100*/0x900);
|
||||
}
|
||||
|
|
|
@ -497,6 +497,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++)
|
||||
{
|
||||
|
|
|
@ -77,42 +77,52 @@ static int search_dir_file(char *destpath, const char *path, const char *filenam
|
|||
|
||||
int osal_mkdirp(const char *dirpath, int mode)
|
||||
{
|
||||
char *mypath, *currpath;
|
||||
char *mypath, *currpath, *lastchar;
|
||||
struct _stat fileinfo;
|
||||
|
||||
// Terminate quickly if the path already exists
|
||||
if (_stat(dirpath, &fileinfo) == 0 && (fileinfo.st_mode & _S_IFDIR))
|
||||
return 0;
|
||||
|
||||
// Create partial paths
|
||||
mypath = currpath = strdup(dirpath);
|
||||
// Create a copy of the path, so we can modify it
|
||||
mypath = currpath = _strdup(dirpath);
|
||||
if (mypath == NULL)
|
||||
return 1;
|
||||
|
||||
// if the directory path ends with a separator, remove it
|
||||
lastchar = mypath + strlen(mypath) - 1;
|
||||
if (strchr(OSAL_DIR_SEPARATORS, *lastchar) != NULL)
|
||||
*lastchar = 0;
|
||||
|
||||
// Terminate quickly if the path already exists
|
||||
if (_stat(mypath, &fileinfo) == 0 && (fileinfo.st_mode & _S_IFDIR))
|
||||
goto goodexit;
|
||||
|
||||
while ((currpath = strpbrk(currpath + 1, OSAL_DIR_SEPARATORS)) != NULL)
|
||||
{
|
||||
// if slash is right after colon, then we are looking at drive name prefix (C:\) and should
|
||||
// just skip it, because _stat and _mkdir will both fail for "C:"
|
||||
if (currpath > mypath && currpath[-1] == ':')
|
||||
continue;
|
||||
*currpath = '\0';
|
||||
if (_stat(mypath, &fileinfo) != 0)
|
||||
{
|
||||
if (_mkdir(mypath) != 0)
|
||||
break;
|
||||
goto errorexit;
|
||||
}
|
||||
else
|
||||
else if (!(fileinfo.st_mode & _S_IFDIR))
|
||||
{
|
||||
if (!(fileinfo.st_mode & _S_IFDIR))
|
||||
break;
|
||||
goto errorexit;
|
||||
}
|
||||
*currpath = OSAL_DIR_SEPARATORS[0];
|
||||
}
|
||||
free(mypath);
|
||||
if (currpath != NULL)
|
||||
return 1;
|
||||
|
||||
// Create full path
|
||||
if (_stat(dirpath, &fileinfo) != 0 && _mkdir(dirpath) != 0)
|
||||
return 1;
|
||||
if (_mkdir(mypath) != 0)
|
||||
goto errorexit;
|
||||
|
||||
goodexit:
|
||||
free(mypath);
|
||||
return 0;
|
||||
errorexit:
|
||||
free(mypath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char * osal_get_shared_filepath(const char *filename, const char *firstsearch, const char *secondsearch)
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
// macros
|
||||
#define OSAL_BREAKPOINT_INTERRUPT __asm{ int 3 };
|
||||
#define ALIGN(BYTES,DATA) __declspec(align(BYTES)) DATA;
|
||||
#define osal_inline __inline
|
||||
|
||||
// string functions
|
||||
#define osal_insensitive_strcmp(x, y) _stricmp(x, y)
|
||||
|
@ -44,6 +45,7 @@
|
|||
// macros
|
||||
#define OSAL_BREAKPOINT_INTERRUPT asm(" int $3; ");
|
||||
#define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES)));
|
||||
#define osal_inline inline
|
||||
|
||||
// string functions
|
||||
#define osal_insensitive_strcmp(x, y) strcasecmp(x, y)
|
||||
|
|
|
@ -276,8 +276,9 @@ void osd_exit(void)
|
|||
// delete message queue
|
||||
SDL_LockMutex(osd_list_lock);
|
||||
list_for_each_entry_safe(msg, safe, &l_messageQueue, osd_message_t, list) {
|
||||
free(msg->text);
|
||||
free(msg);
|
||||
osd_remove_message(msg);
|
||||
if (!msg->user_managed)
|
||||
free(msg);
|
||||
}
|
||||
SDL_UnlockMutex(osd_list_lock);
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#define __OSD_H__
|
||||
|
||||
#include "main/list.h"
|
||||
#include "osal/preproc.h"
|
||||
|
||||
/******************************************************************
|
||||
osd_corner
|
||||
|
@ -100,36 +101,36 @@ void osd_message_set_user_managed(osd_message_t *);
|
|||
|
||||
#else
|
||||
|
||||
static inline void osd_init(int width, int height)
|
||||
static osal_inline void osd_init(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void osd_exit(void)
|
||||
static osal_inline void osd_exit(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void osd_render(void)
|
||||
static osal_inline void osd_render(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline osd_message_t * osd_new_message(enum osd_corner eCorner, const char *fmt, ...)
|
||||
static osal_inline osd_message_t * osd_new_message(enum osd_corner eCorner, const char *fmt, ...)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void osd_update_message(osd_message_t *msg, const char *fmt, ...)
|
||||
static osal_inline void osd_update_message(osd_message_t *msg, const char *fmt, ...)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void osd_delete_message(osd_message_t *msg)
|
||||
static osal_inline void osd_delete_message(osd_message_t *msg)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void osd_message_set_static(osd_message_t *msg)
|
||||
static osal_inline void osd_message_set_static(osd_message_t *msg)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void osd_message_set_user_managed(osd_message_t *msg)
|
||||
static osal_inline void osd_message_set_user_managed(osd_message_t *msg)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -123,3 +123,8 @@ void dummyvideo_FBGetFrameBufferInfo(void *p)
|
|||
{
|
||||
}
|
||||
|
||||
void dummyvideo_ResizeVideoOutput(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ extern void dummyvideo_ViStatusChanged(void);
|
|||
extern void dummyvideo_ViWidthChanged(void);
|
||||
extern void dummyvideo_ReadScreen2(void *dest, int *width, int *height, int front);
|
||||
extern void dummyvideo_SetRenderingCallback(void (*callback)(int));
|
||||
extern void dummyvideo_ResizeVideoOutput(int width, int height);
|
||||
|
||||
extern void dummyvideo_FBRead(unsigned int addr);
|
||||
extern void dummyvideo_FBWrite(unsigned int addr, unsigned int size);
|
||||
|
|
|
@ -64,6 +64,7 @@ static const gfx_plugin_functions dummy_gfx = {
|
|||
dummyvideo_ViWidthChanged,
|
||||
dummyvideo_ReadScreen2,
|
||||
dummyvideo_SetRenderingCallback,
|
||||
dummyvideo_ResizeVideoOutput,
|
||||
dummyvideo_FBRead,
|
||||
dummyvideo_FBWrite,
|
||||
dummyvideo_FBGetFrameBufferInfo
|
||||
|
@ -161,6 +162,7 @@ static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle)
|
|||
if (l_GfxAttached)
|
||||
return M64ERR_INVALID_STATE;
|
||||
|
||||
/* set function pointers for required functions */
|
||||
if (!GET_FUNC(ptr_PluginGetVersion, gfx.getVersion, "PluginGetVersion") ||
|
||||
!GET_FUNC(ptr_ChangeWindow, gfx.changeWindow, "ChangeWindow") ||
|
||||
!GET_FUNC(ptr_InitiateGFX, gfx.initiateGFX, "InitiateGFX") ||
|
||||
|
@ -184,6 +186,9 @@ static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle)
|
|||
return M64ERR_INPUT_INVALID;
|
||||
}
|
||||
|
||||
/* set function pointers for optional functions */
|
||||
gfx.resizeVideoOutput = (ptr_ResizeVideoOutput) osal_dynlib_getproc(plugin_handle, "ResizeVideoOutput");
|
||||
|
||||
/* check the version info */
|
||||
(*gfx.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL);
|
||||
if (PluginType != M64PLUGIN_GFX || (APIVersion & 0xffff0000) != (GFX_API_VERSION & 0xffff0000))
|
||||
|
@ -202,6 +207,11 @@ static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle)
|
|||
l_old1SetRenderingCallback = gfx.setRenderingCallback; // save this just for future use
|
||||
gfx.setRenderingCallback = (ptr_SetRenderingCallback) backcompat_setRenderCallbackIntercept;
|
||||
}
|
||||
if (APIVersion < 0x20200 || gfx.resizeVideoOutput == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_WARNING, "Fallback for Video plugin API (%02i.%02i.%02i) < 2.2.0. Resizable video will not work", VERSION_PRINTF_SPLIT(APIVersion));
|
||||
gfx.resizeVideoOutput = dummyvideo_ResizeVideoOutput;
|
||||
}
|
||||
|
||||
l_GfxAttached = 1;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ extern CONTROL Controls[4];
|
|||
|
||||
/*** Version requirement information ***/
|
||||
#define RSP_API_VERSION 0x20000
|
||||
#define GFX_API_VERSION 0x20100
|
||||
#define GFX_API_VERSION 0x20200
|
||||
#define AUDIO_API_VERSION 0x20000
|
||||
#define INPUT_API_VERSION 0x20000
|
||||
|
||||
|
@ -55,6 +55,7 @@ typedef struct _gfx_plugin_functions
|
|||
ptr_ViWidthChanged viWidthChanged;
|
||||
ptr_ReadScreen2 readScreen;
|
||||
ptr_SetRenderingCallback setRenderingCallback;
|
||||
ptr_ResizeVideoOutput resizeVideoOutput;
|
||||
|
||||
/* frame buffer plugin spec extension */
|
||||
ptr_FBRead fBRead;
|
||||
|
|
|
@ -447,7 +447,6 @@ void gen_interupt(void)
|
|||
remove_interupt_event();
|
||||
MI_register.mi_intr_reg |= 0x02;
|
||||
si_register.si_stat |= 0x1000;
|
||||
si_register.si_stat &= ~0x1;
|
||||
if (MI_register.mi_intr_reg & MI_register.mi_intr_mask_reg)
|
||||
Cause = (Cause | 0x400) & 0xFFFFFF83;
|
||||
else
|
||||
|
|
|
@ -95,7 +95,7 @@ static void prefetch(void);
|
|||
} \
|
||||
else name(); \
|
||||
}
|
||||
#define CHECK_MEMORY(x)
|
||||
#define CHECK_MEMORY()
|
||||
|
||||
#include "interpreter.def"
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "r4300/recomph.h"
|
||||
#include "api/callbacks.h"
|
||||
#include "osal/preproc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -64,7 +65,7 @@ void jump_start_rel32(void);
|
|||
void jump_end_rel32(void);
|
||||
void add_jump(unsigned int pc_addr, unsigned int mi_addr);
|
||||
|
||||
static inline void put8(unsigned char octet)
|
||||
static osal_inline void put8(unsigned char octet)
|
||||
{
|
||||
(*inst_pointer)[code_length] = octet;
|
||||
code_length++;
|
||||
|
@ -75,7 +76,7 @@ static inline void put8(unsigned char octet)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void put32(unsigned int dword)
|
||||
static osal_inline void put32(unsigned int dword)
|
||||
{
|
||||
if ((code_length+4) >= max_code_length)
|
||||
{
|
||||
|
@ -86,26 +87,26 @@ static inline void put32(unsigned int dword)
|
|||
code_length+=4;
|
||||
}
|
||||
|
||||
static inline void mov_eax_memoffs32(unsigned int *memoffs32)
|
||||
static osal_inline void mov_eax_memoffs32(unsigned int *memoffs32)
|
||||
{
|
||||
put8(0xA1);
|
||||
put32((unsigned int)(memoffs32));
|
||||
}
|
||||
|
||||
static inline void mov_memoffs32_eax(unsigned int *memoffs32)
|
||||
static osal_inline void mov_memoffs32_eax(unsigned int *memoffs32)
|
||||
{
|
||||
put8(0xA3);
|
||||
put32((unsigned int)(memoffs32));
|
||||
}
|
||||
|
||||
static inline void mov_m8_reg8(unsigned char *m8, int reg8)
|
||||
static osal_inline void mov_m8_reg8(unsigned char *m8, int reg8)
|
||||
{
|
||||
put8(0x88);
|
||||
put8((reg8 << 3) | 5);
|
||||
put32((unsigned int)(m8));
|
||||
}
|
||||
|
||||
static inline void mov_reg16_m16(int reg16, unsigned short *m16)
|
||||
static osal_inline void mov_reg16_m16(int reg16, unsigned short *m16)
|
||||
{
|
||||
put8(0x66);
|
||||
put8(0x8B);
|
||||
|
@ -113,7 +114,7 @@ static inline void mov_reg16_m16(int reg16, unsigned short *m16)
|
|||
put32((unsigned int)(m16));
|
||||
}
|
||||
|
||||
static inline void mov_m16_reg16(unsigned short *m16, int reg16)
|
||||
static osal_inline void mov_m16_reg16(unsigned short *m16, int reg16)
|
||||
{
|
||||
put8(0x66);
|
||||
put8(0x89);
|
||||
|
@ -121,27 +122,27 @@ static inline void mov_m16_reg16(unsigned short *m16, int reg16)
|
|||
put32((unsigned int)(m16));
|
||||
}
|
||||
|
||||
static inline void cmp_reg32_m32(int reg32, unsigned int *m32)
|
||||
static osal_inline void cmp_reg32_m32(int reg32, unsigned int *m32)
|
||||
{
|
||||
put8(0x3B);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void cmp_reg32_reg32(int reg1, int reg2)
|
||||
static osal_inline void cmp_reg32_reg32(int reg1, int reg2)
|
||||
{
|
||||
put8(0x39);
|
||||
put8((reg2 << 3) | reg1 | 0xC0);
|
||||
}
|
||||
|
||||
static inline void cmp_reg32_imm8(int reg32, unsigned char imm8)
|
||||
static osal_inline void cmp_reg32_imm8(int reg32, unsigned char imm8)
|
||||
{
|
||||
put8(0x83);
|
||||
put8(0xF8 + reg32);
|
||||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void cmp_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8)
|
||||
static osal_inline void cmp_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8)
|
||||
{
|
||||
put8(0x80);
|
||||
put8(0xB8 + reg32);
|
||||
|
@ -149,21 +150,21 @@ static inline void cmp_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned
|
|||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void cmp_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void cmp_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xF8 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void test_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void test_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xC0 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void test_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void test_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0x05);
|
||||
|
@ -171,131 +172,131 @@ static inline void test_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void add_m32_reg32(unsigned int *m32, int reg32)
|
||||
static osal_inline void add_m32_reg32(unsigned int *m32, int reg32)
|
||||
{
|
||||
put8(0x01);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void sub_reg32_m32(int reg32, unsigned int *m32)
|
||||
static osal_inline void sub_reg32_m32(int reg32, unsigned int *m32)
|
||||
{
|
||||
put8(0x2B);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void sub_reg32_reg32(int reg1, int reg2)
|
||||
static osal_inline void sub_reg32_reg32(int reg1, int reg2)
|
||||
{
|
||||
put8(0x29);
|
||||
put8((reg2 << 3) | reg1 | 0xC0);
|
||||
}
|
||||
|
||||
static inline void sbb_reg32_reg32(int reg1, int reg2)
|
||||
static osal_inline void sbb_reg32_reg32(int reg1, int reg2)
|
||||
{
|
||||
put8(0x19);
|
||||
put8((reg2 << 3) | reg1 | 0xC0);
|
||||
}
|
||||
|
||||
static inline void sub_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void sub_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xE8 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void sub_eax_imm32(unsigned int imm32)
|
||||
static osal_inline void sub_eax_imm32(unsigned int imm32)
|
||||
{
|
||||
put8(0x2D);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void jne_rj(unsigned char saut)
|
||||
static osal_inline void jne_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x75);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void je_rj(unsigned char saut)
|
||||
static osal_inline void je_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x74);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jb_rj(unsigned char saut)
|
||||
static osal_inline void jb_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x72);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jbe_rj(unsigned char saut)
|
||||
static osal_inline void jbe_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x76);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void ja_rj(unsigned char saut)
|
||||
static osal_inline void ja_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x77);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jae_rj(unsigned char saut)
|
||||
static osal_inline void jae_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x73);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jle_rj(unsigned char saut)
|
||||
static osal_inline void jle_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x7E);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jge_rj(unsigned char saut)
|
||||
static osal_inline void jge_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x7D);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jg_rj(unsigned char saut)
|
||||
static osal_inline void jg_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x7F);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jl_rj(unsigned char saut)
|
||||
static osal_inline void jl_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x7C);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void jp_rj(unsigned char saut)
|
||||
static osal_inline void jp_rj(unsigned char saut)
|
||||
{
|
||||
put8(0x7A);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void je_near_rj(unsigned int saut)
|
||||
static osal_inline void je_near_rj(unsigned int saut)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0x84);
|
||||
put32(saut);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void mov_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0xB8+reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void jmp_imm_short(char saut)
|
||||
static osal_inline void jmp_imm_short(char saut)
|
||||
{
|
||||
put8(0xEB);
|
||||
put8(saut);
|
||||
}
|
||||
|
||||
static inline void or_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void or_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0x0D);
|
||||
|
@ -303,19 +304,19 @@ static inline void or_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void or_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void or_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x09);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void and_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void and_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x21);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void and_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void and_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0x25);
|
||||
|
@ -323,13 +324,13 @@ static inline void and_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void xor_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void xor_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x31);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void sub_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void sub_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0x2D);
|
||||
|
@ -337,21 +338,21 @@ static inline void sub_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void add_reg32_imm32(unsigned int reg32, unsigned int imm32)
|
||||
static osal_inline void add_reg32_imm32(unsigned int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xC0+reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void inc_m32(unsigned int *m32)
|
||||
static osal_inline void inc_m32(unsigned int *m32)
|
||||
{
|
||||
put8(0xFF);
|
||||
put8(0x05);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void cmp_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void cmp_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0x3D);
|
||||
|
@ -359,13 +360,13 @@ static inline void cmp_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void cmp_eax_imm32(unsigned int imm32)
|
||||
static osal_inline void cmp_eax_imm32(unsigned int imm32)
|
||||
{
|
||||
put8(0x3D);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
static osal_inline void mov_m32_imm32(unsigned int *m32, unsigned int imm32)
|
||||
{
|
||||
put8(0xC7);
|
||||
put8(0x05);
|
||||
|
@ -373,64 +374,64 @@ static inline void mov_m32_imm32(unsigned int *m32, unsigned int imm32)
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void jmp(unsigned int mi_addr)
|
||||
static osal_inline void jmp(unsigned int mi_addr)
|
||||
{
|
||||
put8(0xE9);
|
||||
put32(0);
|
||||
add_jump(code_length-4, mi_addr);
|
||||
}
|
||||
|
||||
static inline void cdq(void)
|
||||
static osal_inline void cdq(void)
|
||||
{
|
||||
put8(0x99);
|
||||
}
|
||||
|
||||
static inline void mov_m32_reg32(unsigned int *m32, unsigned int reg32)
|
||||
static osal_inline void mov_m32_reg32(unsigned int *m32, unsigned int reg32)
|
||||
{
|
||||
put8(0x89);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void call_reg32(unsigned int reg32)
|
||||
static osal_inline void call_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xFF);
|
||||
put8(0xD0+reg32);
|
||||
}
|
||||
|
||||
static inline void shr_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
static osal_inline void shr_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
{
|
||||
put8(0xC1);
|
||||
put8(0xE8+reg32);
|
||||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void shr_reg32_cl(unsigned int reg32)
|
||||
static osal_inline void shr_reg32_cl(unsigned int reg32)
|
||||
{
|
||||
put8(0xD3);
|
||||
put8(0xE8+reg32);
|
||||
}
|
||||
|
||||
static inline void sar_reg32_cl(unsigned int reg32)
|
||||
static osal_inline void sar_reg32_cl(unsigned int reg32)
|
||||
{
|
||||
put8(0xD3);
|
||||
put8(0xF8+reg32);
|
||||
}
|
||||
|
||||
static inline void shl_reg32_cl(unsigned int reg32)
|
||||
static osal_inline void shl_reg32_cl(unsigned int reg32)
|
||||
{
|
||||
put8(0xD3);
|
||||
put8(0xE0+reg32);
|
||||
}
|
||||
|
||||
static inline void shld_reg32_reg32_cl(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void shld_reg32_reg32_cl(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xA5);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void shld_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8)
|
||||
static osal_inline void shld_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xA4);
|
||||
|
@ -438,21 +439,21 @@ static inline void shld_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, u
|
|||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void shrd_reg32_reg32_cl(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void shrd_reg32_reg32_cl(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xAD);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void sar_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
static osal_inline void sar_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
{
|
||||
put8(0xC1);
|
||||
put8(0xF8+reg32);
|
||||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void shrd_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8)
|
||||
static osal_inline void shrd_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, unsigned char imm8)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xAC);
|
||||
|
@ -460,82 +461,82 @@ static inline void shrd_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2, u
|
|||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void mul_m32(unsigned int *m32)
|
||||
static osal_inline void mul_m32(unsigned int *m32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0x25);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void imul_reg32(unsigned int reg32)
|
||||
static osal_inline void imul_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xE8+reg32);
|
||||
}
|
||||
|
||||
static inline void mul_reg32(unsigned int reg32)
|
||||
static osal_inline void mul_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xE0+reg32);
|
||||
}
|
||||
|
||||
static inline void idiv_reg32(unsigned int reg32)
|
||||
static osal_inline void idiv_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xF8+reg32);
|
||||
}
|
||||
|
||||
static inline void div_reg32(unsigned int reg32)
|
||||
static osal_inline void div_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xF0+reg32);
|
||||
}
|
||||
|
||||
static inline void add_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void add_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x01);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void adc_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void adc_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x11);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void add_reg32_m32(unsigned int reg32, unsigned int *m32)
|
||||
static osal_inline void add_reg32_m32(unsigned int reg32, unsigned int *m32)
|
||||
{
|
||||
put8(0x03);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void adc_reg32_imm32(unsigned int reg32, unsigned int imm32)
|
||||
static osal_inline void adc_reg32_imm32(unsigned int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xD0 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void jmp_reg32(unsigned int reg32)
|
||||
static osal_inline void jmp_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xFF);
|
||||
put8(0xE0 + reg32);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_preg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void mov_reg32_preg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
put8(0x8B);
|
||||
put8((reg1 << 3) | reg2);
|
||||
}
|
||||
|
||||
static inline void mov_preg32_reg32(int reg1, int reg2)
|
||||
static osal_inline void mov_preg32_reg32(int reg1, int reg2)
|
||||
{
|
||||
put8(0x89);
|
||||
put8((reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3, unsigned int imm32)
|
||||
static osal_inline void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3, unsigned int imm32)
|
||||
{
|
||||
put8(0x8B);
|
||||
put8((reg1 << 3) | 0x84);
|
||||
|
@ -543,14 +544,14 @@ static inline void mov_reg32_preg32preg32pimm32(int reg1, int reg2, int reg3, un
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
static osal_inline void mov_reg32_preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
{
|
||||
put8(0x8B);
|
||||
put8(0x80 | (reg1 << 3) | reg2);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_preg32x4pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
static osal_inline void mov_reg32_preg32x4pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
{
|
||||
put8(0x8B);
|
||||
put8((reg1 << 3) | 4);
|
||||
|
@ -558,14 +559,14 @@ static inline void mov_reg32_preg32x4pimm32(int reg1, int reg2, unsigned int imm
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_preg32pimm32_reg8(int reg32, unsigned int imm32, int reg8)
|
||||
static osal_inline void mov_preg32pimm32_reg8(int reg32, unsigned int imm32, int reg8)
|
||||
{
|
||||
put8(0x88);
|
||||
put8(0x80 | reg32 | (reg8 << 3));
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8)
|
||||
static osal_inline void mov_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8)
|
||||
{
|
||||
put8(0xC6);
|
||||
put8(0x80 + reg32);
|
||||
|
@ -573,7 +574,7 @@ static inline void mov_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned
|
|||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void mov_preg32pimm32_reg16(int reg32, unsigned int imm32, int reg16)
|
||||
static osal_inline void mov_preg32pimm32_reg16(int reg32, unsigned int imm32, int reg16)
|
||||
{
|
||||
put8(0x66);
|
||||
put8(0x89);
|
||||
|
@ -581,88 +582,88 @@ static inline void mov_preg32pimm32_reg16(int reg32, unsigned int imm32, int reg
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void mov_preg32pimm32_reg32(int reg1, unsigned int imm32, int reg2)
|
||||
static osal_inline void mov_preg32pimm32_reg32(int reg1, unsigned int imm32, int reg2)
|
||||
{
|
||||
put8(0x89);
|
||||
put8(0x80 | reg1 | (reg2 << 3));
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void add_eax_imm32(unsigned int imm32)
|
||||
static osal_inline void add_eax_imm32(unsigned int imm32)
|
||||
{
|
||||
put8(0x05);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void shl_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
static osal_inline void shl_reg32_imm8(unsigned int reg32, unsigned char imm8)
|
||||
{
|
||||
put8(0xC1);
|
||||
put8(0xE0 + reg32);
|
||||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_m32(unsigned int reg32, unsigned int* m32)
|
||||
static osal_inline void mov_reg32_m32(unsigned int reg32, unsigned int* m32)
|
||||
{
|
||||
put8(0x8B);
|
||||
put8((reg32 << 3) | 5);
|
||||
put32((unsigned int)(m32));
|
||||
}
|
||||
|
||||
static inline void mov_reg8_m8(int reg8, unsigned char *m8)
|
||||
static osal_inline void mov_reg8_m8(int reg8, unsigned char *m8)
|
||||
{
|
||||
put8(0x8A);
|
||||
put8((reg8 << 3) | 5);
|
||||
put32((unsigned int)(m8));
|
||||
}
|
||||
|
||||
static inline void and_eax_imm32(unsigned int imm32)
|
||||
static osal_inline void and_eax_imm32(unsigned int imm32)
|
||||
{
|
||||
put8(0x25);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void and_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void and_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xE0 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void or_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void or_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xC8 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void xor_reg32_imm32(int reg32, unsigned int imm32)
|
||||
static osal_inline void xor_reg32_imm32(int reg32, unsigned int imm32)
|
||||
{
|
||||
put8(0x81);
|
||||
put8(0xF0 + reg32);
|
||||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void xor_reg8_imm8(int reg8, unsigned char imm8)
|
||||
static osal_inline void xor_reg8_imm8(int reg8, unsigned char imm8)
|
||||
{
|
||||
put8(0x80);
|
||||
put8(0xF0 + reg8);
|
||||
put8(imm8);
|
||||
}
|
||||
|
||||
static inline void mov_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
static osal_inline void mov_reg32_reg32(unsigned int reg1, unsigned int reg2)
|
||||
{
|
||||
if (reg1 == reg2) return;
|
||||
put8(0x89);
|
||||
put8(0xC0 | (reg2 << 3) | reg1);
|
||||
}
|
||||
|
||||
static inline void not_reg32(unsigned int reg32)
|
||||
static osal_inline void not_reg32(unsigned int reg32)
|
||||
{
|
||||
put8(0xF7);
|
||||
put8(0xD0 + reg32);
|
||||
}
|
||||
|
||||
static inline void movsx_reg32_m8(int reg32, unsigned char *m8)
|
||||
static osal_inline void movsx_reg32_m8(int reg32, unsigned char *m8)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xBE);
|
||||
|
@ -670,7 +671,7 @@ static inline void movsx_reg32_m8(int reg32, unsigned char *m8)
|
|||
put32((unsigned int)(m8));
|
||||
}
|
||||
|
||||
static inline void movsx_reg32_8preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
static osal_inline void movsx_reg32_8preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xBE);
|
||||
|
@ -678,7 +679,7 @@ static inline void movsx_reg32_8preg32pimm32(int reg1, int reg2, unsigned int im
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void movsx_reg32_16preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
static osal_inline void movsx_reg32_16preg32pimm32(int reg1, int reg2, unsigned int imm32)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xBF);
|
||||
|
@ -686,7 +687,7 @@ static inline void movsx_reg32_16preg32pimm32(int reg1, int reg2, unsigned int i
|
|||
put32(imm32);
|
||||
}
|
||||
|
||||
static inline void movsx_reg32_m16(int reg32, unsigned short *m16)
|
||||
static osal_inline void movsx_reg32_m16(int reg32, unsigned short *m16)
|
||||
{
|
||||
put8(0x0F);
|
||||
put8(0xBF);
|
||||
|
@ -694,140 +695,140 @@ static inline void movsx_reg32_m16(int reg32, unsigned short *m16)
|
|||
put32((unsigned int)(m16));
|
||||
}
|
||||
|
||||
static inline void fldcw_m16(unsigned short *m16)
|
||||
static osal_inline void fldcw_m16(unsigned short *m16)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(0x2D);
|
||||
put32((unsigned int)(m16));
|
||||
}
|
||||
|
||||
static inline void fld_preg32_dword(int reg32)
|
||||
static osal_inline void fld_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(reg32);
|
||||
}
|
||||
|
||||
static inline void fdiv_preg32_dword(int reg32)
|
||||
static osal_inline void fdiv_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD8);
|
||||
put8(0x30 + reg32);
|
||||
}
|
||||
|
||||
static inline void fstp_preg32_dword(int reg32)
|
||||
static osal_inline void fstp_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(0x18 + reg32);
|
||||
}
|
||||
|
||||
static inline void fchs(void)
|
||||
static osal_inline void fchs(void)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(0xE0);
|
||||
}
|
||||
|
||||
static inline void fstp_preg32_qword(int reg32)
|
||||
static osal_inline void fstp_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDD);
|
||||
put8(0x18 + reg32);
|
||||
}
|
||||
|
||||
static inline void fadd_preg32_dword(int reg32)
|
||||
static osal_inline void fadd_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD8);
|
||||
put8(reg32);
|
||||
}
|
||||
|
||||
static inline void fsub_preg32_dword(int reg32)
|
||||
static osal_inline void fsub_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD8);
|
||||
put8(0x20 + reg32);
|
||||
}
|
||||
|
||||
static inline void fmul_preg32_dword(int reg32)
|
||||
static osal_inline void fmul_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xD8);
|
||||
put8(0x08 + reg32);
|
||||
}
|
||||
|
||||
static inline void fistp_preg32_dword(int reg32)
|
||||
static osal_inline void fistp_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xDB);
|
||||
put8(0x18 + reg32);
|
||||
}
|
||||
|
||||
static inline void fistp_preg32_qword(int reg32)
|
||||
static osal_inline void fistp_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDF);
|
||||
put8(0x38 + reg32);
|
||||
}
|
||||
|
||||
static inline void fld_preg32_qword(int reg32)
|
||||
static osal_inline void fld_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDD);
|
||||
put8(reg32);
|
||||
}
|
||||
|
||||
static inline void fild_preg32_qword(int reg32)
|
||||
static osal_inline void fild_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDF);
|
||||
put8(0x28+reg32);
|
||||
}
|
||||
|
||||
static inline void fild_preg32_dword(int reg32)
|
||||
static osal_inline void fild_preg32_dword(int reg32)
|
||||
{
|
||||
put8(0xDB);
|
||||
put8(reg32);
|
||||
}
|
||||
|
||||
static inline void fadd_preg32_qword(int reg32)
|
||||
static osal_inline void fadd_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDC);
|
||||
put8(reg32);
|
||||
}
|
||||
|
||||
static inline void fdiv_preg32_qword(int reg32)
|
||||
static osal_inline void fdiv_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDC);
|
||||
put8(0x30 + reg32);
|
||||
}
|
||||
|
||||
static inline void fsub_preg32_qword(int reg32)
|
||||
static osal_inline void fsub_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDC);
|
||||
put8(0x20 + reg32);
|
||||
}
|
||||
|
||||
static inline void fmul_preg32_qword(int reg32)
|
||||
static osal_inline void fmul_preg32_qword(int reg32)
|
||||
{
|
||||
put8(0xDC);
|
||||
put8(0x08 + reg32);
|
||||
}
|
||||
|
||||
static inline void fsqrt(void)
|
||||
static osal_inline void fsqrt(void)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(0xFA);
|
||||
}
|
||||
|
||||
static inline void fabs_(void)
|
||||
static osal_inline void fabs_(void)
|
||||
{
|
||||
put8(0xD9);
|
||||
put8(0xE1);
|
||||
}
|
||||
|
||||
static inline void fcomip_fpreg(int fpreg)
|
||||
static osal_inline void fcomip_fpreg(int fpreg)
|
||||
{
|
||||
put8(0xDF);
|
||||
put8(0xF0 + fpreg);
|
||||
}
|
||||
|
||||
static inline void fucomip_fpreg(int fpreg)
|
||||
static osal_inline void fucomip_fpreg(int fpreg)
|
||||
{
|
||||
put8(0xDF);
|
||||
put8(0xE8 + fpreg);
|
||||
}
|
||||
|
||||
static inline void ffree_fpreg(int fpreg)
|
||||
static osal_inline void ffree_fpreg(int fpreg)
|
||||
{
|
||||
put8(0xDD);
|
||||
put8(0xC0 + fpreg);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
# * Mupen64plus - build_bundle_bin.sh *
|
||||
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
# * Copyright (C) 2009 Richard Goedeken *
|
||||
# * Copyright (C) 2009-2013 Richard Goedeken *
|
||||
# * *
|
||||
# * 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 *
|
||||
|
@ -42,6 +42,7 @@ hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-audio-sdl
|
|||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-input-sdl
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rsp-hle
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-rice
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-glide64mk2
|
||||
shift
|
||||
for dirname in ./mupen64plus-*; do rm -rf ${dirname}/.hg*; done
|
||||
|
||||
|
@ -52,7 +53,7 @@ echo "************************************ Building Mupen64Plus modules"
|
|||
cd ..
|
||||
tar xzvf source/mupen64plus-core/tools/m64p_helper_scripts.tar.gz
|
||||
|
||||
./m64p_build.sh $@
|
||||
./m64p_build.sh COREDIR=/usr/local/lib/ $@
|
||||
mv "test" "${OUTPUTDIR}"
|
||||
|
||||
echo "************************************ Creating archive"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
# * Mupen64plus - build_bundle_src.sh *
|
||||
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
# * Copyright (C) 2009 Richard Goedeken *
|
||||
# * Copyright (C) 2009-2013 Richard Goedeken *
|
||||
# * *
|
||||
# * 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 *
|
||||
|
@ -43,6 +43,7 @@ hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-audio-sdl
|
|||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-input-sdl
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-rsp-hle
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-rice
|
||||
hg clone -r $1 http://bitbucket.org/richard42/mupen64plus-video-glide64mk2
|
||||
for dirname in ./mupen64plus-*; do rm -rf ${dirname}/.hg*; done
|
||||
|
||||
# unzip the helper scripts and remove the Mercurial scripts
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
# * Mupen64plus - build_modules_src.sh *
|
||||
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
# * Copyright (C) 2009 Richard Goedeken *
|
||||
# * Copyright (C) 2009-2013 Richard Goedeken *
|
||||
# * *
|
||||
# * 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 *
|
||||
|
@ -28,7 +28,7 @@ if [ $# -lt 2 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
modules='mupen64plus-core mupen64plus-rom mupen64plus-ui-console mupen64plus-audio-sdl mupen64plus-input-sdl mupen64plus-rsp-hle mupen64plus-video-rice'
|
||||
modules='mupen64plus-core mupen64plus-rom mupen64plus-ui-console mupen64plus-audio-sdl mupen64plus-input-sdl mupen64plus-rsp-hle mupen64plus-video-rice mupen64plus-video-glide64mk2'
|
||||
for modname in ${modules}; do
|
||||
echo "************************************ Downloading and packaging module source code: ${modname}"
|
||||
rm -rf "tmp"
|
||||
|
|
|
@ -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 <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <SDL_scancode.h>
|
||||
#include <SDL_keysym.h>
|
||||
|
||||
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 <stdint.h>");
|
||||
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;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# mupen64plus binary bundle install script
|
||||
#
|
||||
# Copyright 2007-2009 The Mupen64Plus Development Team
|
||||
# Copyright 2007-2013 The 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
|
||||
|
@ -65,6 +65,28 @@ LIBDIR="${4:-${PREFIX}/lib}"
|
|||
PLUGINDIR="${5:-${PREFIX}/lib/mupen64plus}"
|
||||
MANDIR="${6:-${PREFIX}/share/man}"
|
||||
|
||||
# simple check for permissions
|
||||
if [ -d "${SHAREDIR}" -a ! -w "${SHAREDIR}" ]; then
|
||||
printf "Error: you do not have permission to install at: ${SHAREDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${BINDIR}" -a ! -w "${BINDIR}" ]; then
|
||||
printf "Error: you do not have permission to install at: ${BINDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${LIBDIR}" -a ! -w "${LIBDIR}" ]; then
|
||||
printf "Error: you do not have permission to install at: ${LIBDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${PLUGINDIR}" -a ! -w "${PLUGINDIR}" ]; then
|
||||
printf "Error: you do not have permission to install at: ${PLUGINDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${MANDIR}" -a ! -w "${MANDIR}" ]; then
|
||||
printf "Error: you do not have permission to install at: ${MANDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "Installing Mupen64Plus Binary Bundle to ${PREFIX}\n"
|
||||
# Mupen64Plus-Core
|
||||
$INSTALL -d -v "${LIBDIR}"
|
||||
|
@ -89,8 +111,10 @@ $INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-audio-sdl.so "${PLUGINDIR}"
|
|||
$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-input-sdl.so "${PLUGINDIR}"
|
||||
$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-rsp-hle.so "${PLUGINDIR}"
|
||||
$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-video-rice.so "${PLUGINDIR}"
|
||||
$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-video-glide64mk2.so "${PLUGINDIR}"
|
||||
$INSTALL -m 0644 RiceVideoLinux.ini "${SHAREDIR}"
|
||||
$INSTALL -m 0644 InputAutoCfg.ini "${SHAREDIR}"
|
||||
$INSTALL -m 0644 Glide64mk2.ini "${SHAREDIR}"
|
||||
|
||||
printf "Installation successful.\n"
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
./m64p_build.sh
|
||||
|
||||
mkdir -p mupen64plus.app/Contents/MacOS/
|
||||
|
||||
mv test/mupen64plus test/*.dylib mupen64plus.app/Contents/MacOS/
|
||||
|
||||
APP_CONTENTS="./mupen64plus.app/Contents"
|
||||
|
||||
FIX_LIST="-x $APP_CONTENTS/MacOS/mupen64plus \
|
||||
-x $APP_CONTENTS/MacOS/libmupen64plus.dylib \
|
||||
-x $APP_CONTENTS/MacOS/mupen64plus-audio-sdl.dylib \
|
||||
-x $APP_CONTENTS/MacOS/mupen64plus-input-sdl.dylib \
|
||||
-x $APP_CONTENTS/MacOS/mupen64plus-rsp-hle.dylib \
|
||||
-x $APP_CONTENTS/MacOS/mupen64plus-video-rice.dylib \
|
||||
-x $APP_CONTENTS/MacOS/mupen64plus-video-glide64mk2.dylib"
|
||||
|
||||
dylibbundler -od -b $FIX_LIST -d $APP_CONTENTS/libs/
|
||||
|
||||
rm -rf $APP_CONTENTS/Resources
|
||||
rm -rf $APP_CONTENTS/SharedSupport
|
||||
mkdir -p $APP_CONTENTS/Resources
|
||||
mkdir -p $APP_CONTENTS/Frameworks
|
||||
mv test/*.ini test/*.ttf $APP_CONTENTS/Resources
|
||||
mv test/mupen* $APP_CONTENTS/Resources
|
||||
mv test $APP_CONTENTS/SharedSupport
|
||||
cp -r /Library/Frameworks/SDL.framework $APP_CONTENTS/Frameworks
|
||||
|
||||
mv $APP_CONTENTS/SharedSupport/m64p_test_rom.v64 ./example.v64
|
||||
echo './mupen64plus.app/Contents/MacOS/mupen64plus --corelib ./mupen64plus.app/Contents/MacOS/libmupen64plus.dylib --plugindir ./mupen64plus.app/Contents/MacOS --gfx mupen64plus-video-rice "$@"' > run_rice.sh
|
||||
echo './mupen64plus.app/Contents/MacOS/mupen64plus --corelib ./mupen64plus.app/Contents/MacOS/libmupen64plus.dylib --plugindir ./mupen64plus.app/Contents/MacOS --gfx mupen64plus-video-glide64mk2 "$@"' > run_glide.sh
|
||||
echo -e "Note that Mupen64Plus requires an Intel mac and will not run on PPC macs.\nIt is known to run on OS X 10.8; and most likely also runs on 10.7.\n\nThis application can NOT be opened in the Finder by double-clicking.\n To use, launch the terminal, then cd into the directory that contains mupen64plus.app and use a command like :\n\n $ ./run_rice.sh example.v64 # for the Rice video plugin\n $ ./run_glide.sh example.v64 # for the Glide64mk2 video plugin\n\n Note that at this point, the only way to configure Mupen64Plus is to edit the config files in ~/.config/mupen64plus\n\n If you cannot follow the instructions above then this package is not meant for you =)\n" > Readme.txt
|
||||
chmod +x run_rice.sh run_glide.sh
|
||||
zip -r mupen64plus-bundle-osx-2.0rc4.zip mupen64plus.app Readme.txt run_rice.sh run_glide.sh example.v64
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
OSX build instructions (using OSX 10.8.3 and Xcode 4.6.2):
|
||||
|
||||
1. Install SDL framework
|
||||
- go to http://www.libsdl.org/download-1.2.php
|
||||
- download SDL-1.2.15.dmg
|
||||
- Open the DMG and copy SDL.framework to /Library/Frameworks
|
||||
- also, copy devel-lite to your desktop
|
||||
- Build SDLMain.m_o:
|
||||
- open terminal, cd ~/Desktop/devel-lite
|
||||
- run: gcc -c -O3 -I./ -I/Library/Frameworks/SDL.framework/Headers -o SDLMain.m_o SDLMain.m
|
||||
2. Install macports
|
||||
3. Install the following ports (sudo port install <name>):
|
||||
- bzip2
|
||||
- freetype
|
||||
- libpng
|
||||
- libsamplerate
|
||||
- speex
|
||||
- zlib
|
||||
4. Boost requires some special stuff. We must compile with clang and libc++.
|
||||
- edit your /opt/local/etc/macports/macports.conf
|
||||
- add to end: default_compiler clang
|
||||
- sudo port edit boost
|
||||
- change this line:
|
||||
write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags}\" ${compileflags} <linkflags>\"${configure.ldflags}\" : ;"
|
||||
- to this:
|
||||
write_jam "using darwin : : ${configure.cxx} : <cxxflags>\"${configure.cxxflags} -std=c++11 -stdlib=libc++\" ${compileflags} <linkflags>\"${configure.ldflags} -stdlib=libc++\" : ;"
|
||||
- if you have boost already installed in macports, remove it:
|
||||
- sudo port uninstall boost
|
||||
- reinstall boost from source:
|
||||
- sudo port -s install boost
|
||||
5. Download the Mupen64Plus source code:
|
||||
- Open terminal window, create build directory for Mupen64Plus
|
||||
- Download and unpack the latest m64p_helper_scripts.tar.gz from: https://code.google.com/p/mupen64plus/wiki/CompilingFromHg
|
||||
- run ./m64p_get.sh
|
||||
6. Hack your ui-console makefile to build against SDLMain.m_o:
|
||||
- edit source/mupen64plus-ui-console/projects/unix/Makefile
|
||||
- change line:
|
||||
CFLAGS += $(SDL_CFLAGS)
|
||||
- to:
|
||||
CFLAGS += $(SDL_CFLAGS) ~/devel-lite/SDLMain.m_o -framework Cocoa
|
||||
7. Hack your m64p_build.sh script to build under OSX:
|
||||
- change line:
|
||||
"$MAKE" -C source/mupen64plus-${component}/projects/unix all $@
|
||||
- to:
|
||||
if [ "${component}" = "ui-console" ]; then
|
||||
"$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3" LDFLAGS="-Wl,-rpath -Wl,@executable_path/../Frameworks"
|
||||
else
|
||||
"$MAKE" -C source/mupen64plus-${component}/projects/unix all -j4 V=1 CC=clang CXX=clang++ OSX_SDK=10.7 SDL_CFLAGS="-I/opt/local/include -D__APPLE__ -I/Library/Frameworks/SDL.framework/Headers" SDL_LDLIBS="-F/Library/Frameworks -framework SDL -framework Foundation" OPTFLAGS="-O3"
|
||||
fi
|
||||
8. Build it
|
||||
- copy osx_build_bundle.sh from source/mupen64plus-core/tools to current directory
|
||||
- run ./osx_build_bundle.sh
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# mupen64plus binary bundle uninstall script
|
||||
#
|
||||
# Copyright 2007-2009 The Mupen64Plus Development Team
|
||||
# Copyright 2007-2013 The 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
|
||||
|
@ -48,6 +48,28 @@ LIBDIR="${4:-${PREFIX}/lib}"
|
|||
PLUGINDIR="${5:-${PREFIX}/lib/mupen64plus}"
|
||||
MANDIR="${6:-${PREFIX}/share/man}"
|
||||
|
||||
# simple check for some permissions
|
||||
if [ -d "${SHAREDIR}" -a ! -w "${SHAREDIR}" ]; then
|
||||
printf "Error: you do not have permission to uninstall from: ${SHAREDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${BINDIR}" -a ! -w "${BINDIR}" ]; then
|
||||
printf "Error: you do not have permission to uninstall from: ${BINDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${LIBDIR}" -a ! -w "${LIBDIR}" ]; then
|
||||
printf "Error: you do not have permission to uninstall from: ${LIBDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${PLUGINDIR}" -a ! -w "${PLUGINDIR}" ]; then
|
||||
printf "Error: you do not have permission to uninstall from: ${PLUGINDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "${MANDIR}" -a ! -w "${MANDIR}" ]; then
|
||||
printf "Error: you do not have permission to uninstall from: ${MANDIR}\nMaybe you need to be root?\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "Uninstalling Mupen64Plus Binary Bundle from ${PREFIX}\n"
|
||||
# Mupen64Plus-Core
|
||||
rm -f "${LIBDIR}"/libmupen64plus.so*
|
||||
|
@ -66,16 +88,19 @@ rm -f "${PLUGINDIR}/mupen64plus-audio-sdl.so"
|
|||
rm -f "${PLUGINDIR}/mupen64plus-input-sdl.so"
|
||||
rm -f "${PLUGINDIR}/mupen64plus-rsp-hle.so"
|
||||
rm -f "${PLUGINDIR}/mupen64plus-video-rice.so"
|
||||
rm -f "${PLUGINDIR}/mupen64plus-video-glide64mk2.so"
|
||||
rm -f "${SHAREDIR}/RiceVideoLinux.ini"
|
||||
rm -f "${SHAREDIR}/InputAutoCfg.ini"
|
||||
rm -f "${SHAREDIR}/Glide64mk2.ini"
|
||||
# get rid of the empty dirs
|
||||
rmdir --ignore-fail-on-non-empty "${SHAREDIR}/doc"
|
||||
rmdir --ignore-fail-on-non-empty "${SHAREDIR}"
|
||||
rmdir --ignore-fail-on-non-empty "${BINDIR}"
|
||||
rmdir --ignore-fail-on-non-empty "${LIBDIR}"
|
||||
rmdir --ignore-fail-on-non-empty "${PLUGINDIR}"
|
||||
rmdir --ignore-fail-on-non-empty "${MANDIR}/man6"
|
||||
rmdir --ignore-fail-on-non-empty "${MANDIR}"
|
||||
# ignore directories if they are really symbolic links
|
||||
[ ! -L "${SHAREDIR}/doc" ] && rmdir --ignore-fail-on-non-empty "${SHAREDIR}/doc"
|
||||
[ ! -L "${SHAREDIR}" ] && rmdir --ignore-fail-on-non-empty "${SHAREDIR}"
|
||||
[ ! -L "${BINDIR}" ] && rmdir --ignore-fail-on-non-empty "${BINDIR}"
|
||||
[ ! -L "${LIBDIR}" ] && rmdir --ignore-fail-on-non-empty "${LIBDIR}"
|
||||
[ ! -L "${PLUGINDIR}" ] && rmdir --ignore-fail-on-non-empty "${PLUGINDIR}"
|
||||
[ ! -L "${MANDIR}/man6" ] && rmdir --ignore-fail-on-non-empty "${MANDIR}/man6"
|
||||
[ ! -L "${MANDIR}" ] && rmdir --ignore-fail-on-non-empty "${MANDIR}"
|
||||
|
||||
printf "Done.\n"
|
||||
printf "Uninstall successful.\n"
|
||||
|
||||
|
|
|
@ -3,8 +3,9 @@ Mupen64Plus-rsp-hle LICENSE
|
|||
|
||||
Mupen64Plus-rsp-hle is licensed under the GNU General Public License version 2.
|
||||
|
||||
The authors of Mupen64Plus are:
|
||||
The authors of Mupen64Plus-rsp-hle are:
|
||||
* Richard Goedeken (Richard42)
|
||||
* Bobby Smiles
|
||||
* John Chadwick (NMN)
|
||||
* James Hood (Ebenblues)
|
||||
* Scott Gorman (okaygo)
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
RSP High-Level Emulation plugin for Mupen64Plus
|
||||
-----------------------------------------------
|
||||
|
||||
Mupen64Plus-rsp-hle v2.0 - July 4, 2013
|
||||
-------------------------------------------------
|
||||
- Add support for MusyX ucode detection
|
||||
- support JPEG decoding used in Pokemon Stadium Japan
|
||||
- lots of refactoring to clean up code
|
||||
- Project files for Visual Studio 2012
|
||||
- Makefile changes
|
||||
- add support for PowerPC and MinGW32 builds
|
||||
- add cross-compiling support to build Win32 executables (MXE) under Linux
|
||||
|
||||
Mupen64Plus-rsp-hle v1.99.5 - March 10, 2012
|
||||
-------------------------------------------------
|
||||
- Handle JPEG decompression, used in Ogre Battle 64 and Pokemon Stadium
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@ -54,7 +56,7 @@
|
|||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
|
@ -76,7 +78,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
|
|
|
@ -116,7 +116,7 @@ ifeq ("$(CPU)","NONE")
|
|||
endif
|
||||
|
||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
||||
OPTFLAGS ?= -O3
|
||||
OPTFLAGS ?= -O3 -flto
|
||||
WARNFLAGS ?= -Wall
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src
|
||||
CXXFLAGS += -fvisibility-inlines-hidden
|
||||
|
@ -126,10 +126,8 @@ LDFLAGS += $(SHARED)
|
|||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
||||
ifeq ($(PIC), 1)
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS += -fPIC
|
||||
else
|
||||
CFLAGS += -fno-PIC
|
||||
LDFLAGS += -fno-PIC
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
|
@ -142,7 +140,7 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
|
|||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||
endif
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32 -Wl,-m,elf_i386
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
|
@ -151,25 +149,16 @@ ifeq ($(OS), LINUX)
|
|||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/rsp_api_export.ver
|
||||
endif
|
||||
ifeq ($(OS), OSX)
|
||||
# Select the proper SDK
|
||||
# Also, SDKs are stored in a different location since XCode 4.3
|
||||
OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .)
|
||||
OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .)
|
||||
OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .)
|
||||
OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`")
|
||||
ifeq ($(OSX_XCODEGE43), 11)
|
||||
OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
||||
else
|
||||
OSX_SYSROOT := /Developer/SDKs
|
||||
endif
|
||||
#xcode-select has been around since XCode 3.0, i.e. OS X 10.5
|
||||
OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs
|
||||
OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1)
|
||||
|
||||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -arch x86_64
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
else
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -arch i686 -read_only_relocs suppress
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
LDFLAGS += -read_only_relocs suppress
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
@ -213,7 +202,7 @@ INSTALL ?= install
|
|||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
# set special flags for given Makefile parameters
|
||||
ifeq ($(DEBUG),1)
|
||||
|
@ -270,7 +259,7 @@ targets:
|
|||
@echo " Options:"
|
||||
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
|
||||
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3)"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)"
|
||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
||||
@echo " PIC=(1|0) == Force enable/disable of position independent code"
|
||||
@echo " POSTFIX=name == String added to the name of the the build (default: '')"
|
||||
|
@ -281,7 +270,6 @@ targets:
|
|||
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
||||
@echo " Debugging Options:"
|
||||
@echo " DEBUG=1 == add debugging symbols"
|
||||
@echo " LTO=1 == enable experimental build with link-time optimization"
|
||||
@echo " V=1 == show verbose compiler output"
|
||||
|
||||
all: $(TARGET)
|
||||
|
@ -303,11 +291,6 @@ CFLAGS += -MD
|
|||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += -fuse-linker-plugin $(CXXFLAGS)
|
||||
endif
|
||||
|
||||
# standard build rules
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#define M64P_PLUGIN_PROTOTYPES 1
|
||||
#include "m64p_plugin.h"
|
||||
|
||||
#define RSP_HLE_VERSION 0x016305
|
||||
#define RSP_HLE_VERSION 0x020000
|
||||
#define RSP_PLUGIN_API_VERSION 0x020000
|
||||
|
||||
#ifdef M64P_BIG_ENDIAN
|
||||
|
|
|
@ -119,16 +119,12 @@ ifeq ("$(CPU)","NONE")
|
|||
endif
|
||||
|
||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
||||
OPTFLAGS ?= -O3
|
||||
OPTFLAGS ?= -O3 -flto
|
||||
WARNFLAGS ?= -Wall
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src -I../../src/wrapper -DGCC
|
||||
CXXFLAGS += -fvisibility-inlines-hidden
|
||||
LDFLAGS += $(SHARED)
|
||||
|
||||
# default configuration programs
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
|
||||
ifeq ($(CPU), X86)
|
||||
CFLAGS += -msse
|
||||
endif
|
||||
|
@ -137,10 +133,8 @@ endif
|
|||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
||||
ifeq ($(PIC), 1)
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS += -fPIC
|
||||
else
|
||||
CFLAGS += -fno-PIC
|
||||
LDFLAGS += -fno-PIC
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
|
@ -153,7 +147,7 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
|
|||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||
endif
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32 -Wl,-m,elf_i386
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
|
@ -178,11 +172,11 @@ ifeq ($(OS), OSX)
|
|||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -arch x86_64
|
||||
LDFLAGS += -bundle
|
||||
LDLIBS += -ldl
|
||||
else
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -arch i686
|
||||
LDFLAGS += -bundle
|
||||
LDLIBS += -ldl
|
||||
endif
|
||||
endif
|
||||
|
@ -192,47 +186,47 @@ ifeq ($(OS), FREEBSD)
|
|||
endif
|
||||
|
||||
# search for OpenGL libraries
|
||||
GL_LIBS=
|
||||
ifeq ($(OS), OSX)
|
||||
GL_LIBS = -framework OpenGL
|
||||
GL_LDLIBS = -framework OpenGL
|
||||
endif
|
||||
ifeq ($(OS), MINGW)
|
||||
GL_LIBS = -lopengl32
|
||||
GL_LDLIBS = -lopengl32
|
||||
endif
|
||||
ifeq ("$(GL_LIBS)", "")
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined)
|
||||
ifeq ($(origin PKG_CONFIG), undefined)
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),)
|
||||
$(error No OpenGL development libraries found!)
|
||||
endif
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
||||
GL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
|
||||
GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
||||
GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl)
|
||||
endif
|
||||
LDLIBS += $(GL_LIBS)
|
||||
CFLAGS += $(GL_CFLAGS)
|
||||
LDLIBS += $(GL_LDLIBS)
|
||||
|
||||
# test for presence of SDL
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
endif
|
||||
ifeq ($(OS),FREEBSD)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
ifeq ($(OS),OSX)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
endif
|
||||
ifeq ($(OS),OSX)
|
||||
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
# sdl-config on mac screws up when we're trying to build a library and not an executable
|
||||
# SDL 1.3 is supposed to fix that, if it's ever released
|
||||
LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa
|
||||
endif
|
||||
ifeq ($(OS),LINUX)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
ifeq ($(OS), MINGW)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
SDL_LDLIBS += -L/usr/local/lib -lSDL -Wl,-framework,Cocoa
|
||||
else
|
||||
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
endif
|
||||
CFLAGS += $(SDL_CFLAGS)
|
||||
LDLIBS += $(SDL_LDLIBS)
|
||||
|
||||
# set mupen64plus core API header path
|
||||
ifneq ("$(APIDIR)","")
|
||||
|
@ -273,7 +267,7 @@ INSTALL ?= install
|
|||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
# set special flags for given Makefile parameters
|
||||
ifeq ($(DEBUG),1)
|
||||
|
@ -356,7 +350,7 @@ targets:
|
|||
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
|
||||
@echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)"
|
||||
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3)"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)"
|
||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
||||
@echo " PIC=(1|0) == Force enable/disable of position independent code"
|
||||
@echo " POSTFIX=name == String added to the name of the the build (default: '')"
|
||||
|
@ -368,7 +362,6 @@ targets:
|
|||
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
||||
@echo " Debugging Options:"
|
||||
@echo " DEBUG=1 == add debugging symbols"
|
||||
@echo " LTO=1 == enable experimental build with link-time optimization"
|
||||
@echo " V=1 == show verbose compiler output"
|
||||
|
||||
all: $(TARGET)
|
||||
|
@ -393,11 +386,6 @@ CFLAGS += -MD
|
|||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto -ffunction-sections -fdata-sections
|
||||
CXXFLAGS += -flto -ffunction-sections -fdata-sections
|
||||
LDFLAGS += -fuse-linker-plugin -Wl,--gc-sections $(CXXFLAGS)
|
||||
endif
|
||||
|
||||
# standard build rules
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||||
|
|
|
@ -104,6 +104,7 @@ ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL;
|
|||
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
|
||||
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
|
||||
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
|
||||
ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
|
||||
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
|
||||
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
|
||||
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
|
||||
|
@ -1009,13 +1010,14 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
|
|||
CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode");
|
||||
CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption");
|
||||
CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen");
|
||||
CoreVideo_ResizeWindow = (ptr_VidExt_ResizeWindow) osal_dynlib_getproc(CoreLibHandle, "VidExt_ResizeWindow");
|
||||
CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress");
|
||||
CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute");
|
||||
CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers");
|
||||
|
||||
if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode ||
|
||||
!CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress ||
|
||||
!CoreVideo_GL_SetAttribute || !CoreVideo_GL_SwapBuffers)
|
||||
!CoreVideo_GL_SetAttribute || !CoreVideo_GL_SwapBuffers || !CoreVideo_ResizeWindow)
|
||||
{
|
||||
WriteLog(M64MSG_ERROR, "Couldn't connect to Core video functions");
|
||||
return M64ERR_INCOMPATIBLE;
|
||||
|
@ -1367,6 +1369,18 @@ EXPORT void CALL ProcessRDPList(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************
|
||||
Function: ResizeVideoOutput
|
||||
Purpose: This function is called to force us to resize our output OpenGL window.
|
||||
This is currently unsupported, and should never be called because we do
|
||||
not pass the RESIZABLE flag to VidExt_SetVideoMode when initializing.
|
||||
input: new width and height
|
||||
output: none
|
||||
*******************************************************************/
|
||||
EXPORT void CALL ResizeVideoOutput(int Width, int Height)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
Function: RomClosed
|
||||
Purpose: This function is called when a rom is closed.
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
DWORD LoadNone (unsigned char * dst, unsigned char * src, int wid_64, int height, int line, int real_width, int tile)
|
||||
{
|
||||
memset (texture, 0xFF, sizeof(texture));
|
||||
return GR_TEXFMT_ARGB_1555;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define PLUGIN_NAME "Glide64 Video Plugin"
|
||||
#define PLUGIN_VERSION 0x016305
|
||||
#define VIDEO_PLUGIN_API_VERSION 0x020100
|
||||
#define PLUGIN_VERSION 0x020000
|
||||
#define VIDEO_PLUGIN_API_VERSION 0x020200
|
||||
#define CONFIG_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x030000
|
||||
|
||||
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
|
||||
void WriteLog(m64p_msg_level level, const char *msg, ...);
|
||||
|
@ -80,6 +80,7 @@ extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes;
|
|||
extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
|
||||
extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
|
||||
extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen;
|
||||
extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow;
|
||||
extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress;
|
||||
extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
|
||||
extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers;
|
||||
|
|
|
@ -15,6 +15,7 @@ ViStatusChanged;
|
|||
ViWidthChanged;
|
||||
ReadScreen2;
|
||||
SetRenderingCallback;
|
||||
ResizeVideoOutput;
|
||||
FBRead;
|
||||
FBWrite;
|
||||
FBGetFrameBufferInfo;
|
||||
|
|
|
@ -425,7 +425,7 @@ grSstWinOpen(
|
|||
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, 0);
|
||||
|
||||
if (CoreVideo_SetVideoMode(width, height, 0, screen_mode) != M64ERR_SUCCESS)
|
||||
if (CoreVideo_SetVideoMode(width, height, 0, screen_mode, (m64p_video_flags) 0) != M64ERR_SUCCESS)
|
||||
{
|
||||
WriteLog(M64MSG_ERROR, "Could not set video mode.");
|
||||
return 0;
|
||||
|
|
|
@ -3,8 +3,9 @@ Mupen64Plus-video-rice LICENSE
|
|||
|
||||
Mupen64Plus-video-rice is licensed under the GNU General Public License version 2.
|
||||
|
||||
The authors of Mupen64Plus are:
|
||||
The authors of Mupen64Plus-video-rice are:
|
||||
* Richard Goedeken (Richard42)
|
||||
* Sven Eckelmann (ecsv)
|
||||
* John Chadwick (NMN)
|
||||
* James Hood (Ebenblues)
|
||||
* Scott Gorman (okaygo)
|
||||
|
@ -13,6 +14,9 @@ The authors of Mupen64Plus are:
|
|||
* Louai Al-Khanji (slougi)
|
||||
* Bob Forder (orbitaldecay)
|
||||
* Jason Espinosa (hasone)
|
||||
* Lioncash
|
||||
* Littleguy77
|
||||
* Metricity
|
||||
* HyperHacker
|
||||
* and others.
|
||||
|
||||
|
|
|
@ -1,114 +1,67 @@
|
|||
How to use high resolution textures in Rice Video 6.1.0 and after
|
||||
===============================================================================
|
||||
-------------------------------------------------------------------------------
|
||||
Mupen64plus-video-rice README v2.0
|
||||
-------------------------------------------------------------------------------
|
||||
===============================================================================
|
||||
|
||||
1. There are two new options added in Rice Video version 6.1.0 under the "Texture Filters" tab
|
||||
LOAD option: "Loading hi-res textures if available"
|
||||
DUMP option: "Dump textures to files"
|
||||
The latest version of this document can be found online at:
|
||||
https://code.google.com/p/mupen64plus/wiki/HighResolutionTextures
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
ABOUT
|
||||
-------------------------------------------------------------------------------
|
||||
Mupen64Plus's Rice Video plugin supports a very nice feature which allows the
|
||||
user to replace all of the original textures used for 3D rendering in a game
|
||||
with high-resolution replacement textures drawn by graphic artists.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Enable Hi-Res Texture Loading in Rice Video
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
In order to begin using the hi-resolution texture feature, you must enable it
|
||||
by editing the Mupen64Plus config file. One option is to find the file and edit
|
||||
it directly with a text editor. On Linux or OSX, this is located at: "~/.config/
|
||||
mupen64plus/", and on Windows it is in the "Application Data" sub-folder of
|
||||
your user folder. On Windows XP and prior, this is "C:\Documents and Settings\
|
||||
<username>\Application Data\Mupen64Plus\", while on Windows Vista and newer
|
||||
this is "C:\Users\<username>\AppData\Mupen64Plus". You should find a section in
|
||||
this file labeled [Video-Rice], and within this section is a parameter called
|
||||
LoadHiResTextures. Set this to True to enable searching for and loading high-
|
||||
resolution textures.
|
||||
|
||||
Another option to enable this feature is to use the --set option with the
|
||||
Mupen64Plus command-line user interface. To do this, run a game with a command
|
||||
similar to this:
|
||||
|
||||
./mupen64plus --set Video-Rice[LoadHiResTextures]=True --saveoptions m64p_test_rom.v64
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Installing Hi-Res Texture Files
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
To install a high-resolution texture pack for a game, all that you need to do
|
||||
is unzip the archive and put the extracted directory full of images into the
|
||||
right place. On Linux and OSX, this is usually "/home/<username>/.local/share/
|
||||
mupen64plus/hires_texture". On Windows it is in the "Application Data" sub-
|
||||
folder of your user folder. On Windows XP and prior, this is "C:\Documents and
|
||||
Settings\<username>\Application Data\Mupen64Plus\hires_texture", while on
|
||||
Windows Vista and newer this is "C:\Users\<username>\AppData\Mupen64Plus\
|
||||
hires_texture". If this directory doesn't exist, create it and copy the
|
||||
hi-res texture directory inside.
|
||||
|
||||
The folder containing hi-res textures must be named exactly the same as the
|
||||
ROM's name in the header of the ROM file. Usually this name is short with all
|
||||
capital letters, like "MARIOKART64" or "SMASH BROTHERS". The command-line UI
|
||||
prints out this ROM name when running a game, right after the Goodname and
|
||||
before the MD5.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Running
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
After setup, just run the game as usual. If using the command-line UI, you should
|
||||
see a line printed out which says:
|
||||
|
||||
Video: Texture loading option is enabled. Finding all hires textures
|
||||
|
||||
|
||||
2. Dumping textures
|
||||
a. If DUMP option is enabled, all textures used during the game play will be dumpped
|
||||
into a folder "[your_emulator_main_folder]\plugin\texture_dump\[current game name]\".
|
||||
|
||||
[current game name] refers to N64 game internal name.
|
||||
For example, name for Zelda OoT is "THE LEGEND OF ZELDA".
|
||||
|
||||
You can use your N64 emulator to check it. For 1964, the internal name is shown
|
||||
as one of the "Rom Information".
|
||||
|
||||
b. Textures from different games will be dumpped into different folders.
|
||||
The plugin will create the folder if the folder does not exist.
|
||||
|
||||
c. Textures are dumpped in either PNG or BMP format
|
||||
- RGBA, IA (intensity and alpha) textures are dumpped in 3 (or 2) files
|
||||
[filename part 1 - 4]_all.png
|
||||
[filename part 1 - 4]_rgb.png
|
||||
[filename part 1 - 4]_a.png if the alpha channel is not all 0xFF
|
||||
|
||||
Please read the later section regarding filenameing.
|
||||
*_all.png files are 32bit per pixel PNG files with RGBA channels
|
||||
*_rgb.png files are 24bit per pixel PNG files with RGB channels.
|
||||
*_a.png files are 24bit per pixel PNG files with alpha channel only as intensity.
|
||||
|
||||
- I (intensity only) textures are dumpped in 2 files, the alpha channel is not needed
|
||||
[filename part 1 - 4]_rgb.png
|
||||
[filename part 1 - 4]_all.png
|
||||
|
||||
- Color indexed textures are dumpped in 1 file
|
||||
[filename part 1 - 4]_ci.bmp
|
||||
ATTENTION here: the color indexed bmp image is palletted image. If you want to modify
|
||||
this image, you MUST NOT change the pallettes.
|
||||
These palletted BMP files could have either 16 pallettes or 256 pallettes, depending
|
||||
on the original texture format in the N64 game.
|
||||
|
||||
d. texture dump option can be enabled/disabled during the game play.
|
||||
|
||||
e. The plugin keeps tracking all dumpped textures of the current game. Textures
|
||||
will not be redumpped if the texture has been dumpped.
|
||||
|
||||
|
||||
3. Loading high resolution textures
|
||||
a. If LOAD option is enabled, the plugin will try to load it when corresponding texture is used
|
||||
in the game.
|
||||
|
||||
b. LOAD option can be enabled/disabled during the game play
|
||||
|
||||
c. All high resolution textures must be placed under folder:
|
||||
"[your_emulator_main_folder]\plugin\hires_texture\[current game name]\"
|
||||
|
||||
d. [current game name] must match the N64 game internal name
|
||||
|
||||
e. Under the [current game name] folder, subfolders can be created and textures can be placed
|
||||
into the subfolders. The plugin will search all the subfolders recursively. Subfolders can help
|
||||
to manage all the textures.
|
||||
|
||||
f. File files and format:
|
||||
In general, high resolution files to be loaded must follow the same filenames as dumpped.
|
||||
|
||||
- Color indexed textures must be still in palletted BMP format
|
||||
- For RGBA, IA and I textures, you can provide
|
||||
*_rgb.png, *_a.png or
|
||||
*_rgb.bmp, *_a.bmp or
|
||||
*_all.png
|
||||
- Don't provide duplicate files for the same textures. If you provide the *_rgb, *_a files
|
||||
and also *_all.png file, the actually loaded files are not determined.
|
||||
|
||||
4. File naming
|
||||
|
||||
Example: THE LEGEND OF ZELDA#0A74F78C#4#1_rgb.png
|
||||
|
||||
[part 1]#[part 2]#[part 3]#[part 4]_[part 5].[extension]
|
||||
|
||||
part 1: The N64 game internal name
|
||||
part 2: CRC32
|
||||
part 3: Texture format in N64 game
|
||||
0 = RGBA
|
||||
1 = YUV
|
||||
2 = CI
|
||||
3 = IA
|
||||
4 = I
|
||||
part 4: Texture size in N64 game
|
||||
0 = 4 bit
|
||||
1 = 8 bit
|
||||
2 = 16 bit
|
||||
3 = 32 bit
|
||||
part 5: dumpped texture format
|
||||
rgb = 24 bit RGB format
|
||||
a = 24 bit alpha channel only in 24 bit RGB intensity
|
||||
all = 32 bit RGB format
|
||||
ci = color indexed (BMP) format
|
||||
extension:
|
||||
PNG
|
||||
BMP
|
||||
|
||||
5. How to make your own hi-rez textures
|
||||
a. The hi-rez texture size could be 2, 3 or 4 times as the orginal N64 texture size
|
||||
b. Don't use other customerized texture sizes
|
||||
c. If the original texture has alpha channel, you MUST also provide the alpha channel by
|
||||
- Use *_all.png 32bit format
|
||||
- use both *_rgb and *_a files to provide RGB and alpha separately
|
||||
d. Color indexed textures must be prepared in color indexed format, not in RGB/A format
|
||||
e. Instead of *_rgb.png and *_a.png, you can provide your textures in *_rgb.bmp and *_a.bmp.
|
||||
BMP files are uncompressed, can be loaded faster
|
||||
f. *_rgb.png, *_a.png, *_rgb.bmp, *_a.bmp must be provided in 24 bit RGB format, not in other
|
||||
formats. Alpha *_a.* files must be 24 bit, only in 2 bit or 8 bit
|
||||
g. Filename must be kept the same as the original dumped texture filenames
|
||||
|
|
|
@ -1,6 +1,18 @@
|
|||
Mupen64Plus-Video-Rice RELEASE
|
||||
------------------------------
|
||||
|
||||
Mupen64Plus-Video-Rice v2.0 - July 4, 2013
|
||||
------------------------------------------
|
||||
- support for resizable video window
|
||||
- add support to build and run with OpenGL ES 2.0
|
||||
- improve hi-resolution texture loading support
|
||||
- fix texture CRC calculation for non-x86 (or NO_ASM) platforms
|
||||
- support to build against SDL2
|
||||
- Project files for Visual Studio 2012
|
||||
- Makefile changes
|
||||
- add support for PowerPC and MinGW32 builds
|
||||
- add cross-compiling support to build Win32 executables (MXE) under Linux
|
||||
|
||||
Mupen64Plus-Video-Rice v1.99.5 - March 10, 2012
|
||||
-----------------------------------------------
|
||||
- Hires texture loading: support for 8-bit PNG images
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
|
|
@ -119,16 +119,12 @@ ifeq ("$(CPU)","NONE")
|
|||
endif
|
||||
|
||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
||||
OPTFLAGS ?= -O3
|
||||
OPTFLAGS ?= -O3 -flto
|
||||
WARNFLAGS ?= -Wall
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src
|
||||
CXXFLAGS += -fvisibility-inlines-hidden
|
||||
LDFLAGS += $(SHARED)
|
||||
|
||||
# default configuration programs
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
|
||||
ifeq ($(CPU), X86)
|
||||
CFLAGS += -msse
|
||||
endif
|
||||
|
@ -137,10 +133,8 @@ endif
|
|||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
||||
ifeq ($(PIC), 1)
|
||||
CFLAGS += -fPIC
|
||||
LDFLAGS += -fPIC
|
||||
else
|
||||
CFLAGS += -fno-PIC
|
||||
LDFLAGS += -fno-PIC
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
|
@ -153,7 +147,7 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
|
|||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||
endif
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32 -Wl,-m,elf_i386
|
||||
LDFLAGS += -Wl,-m,elf_i386
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
|
@ -163,75 +157,69 @@ ifeq ($(OS), LINUX)
|
|||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver
|
||||
endif
|
||||
ifeq ($(OS), OSX)
|
||||
# Select the proper SDK
|
||||
# Also, SDKs are stored in a different location since XCode 4.3
|
||||
OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .)
|
||||
OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .)
|
||||
OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .)
|
||||
OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`")
|
||||
ifeq ($(OSX_XCODEGE43), 11)
|
||||
OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
||||
else
|
||||
OSX_SYSROOT := /Developer/SDKs
|
||||
endif
|
||||
#xcode-select has been around since XCode 3.0, i.e. OS X 10.5
|
||||
OSX_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs
|
||||
OSX_SDK_PATH = $(OSX_SDK_ROOT)/$(shell ls $(OSX_SDK_ROOT) | tail -1)
|
||||
|
||||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -arch x86_64
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
LDFLAGS += -bundle
|
||||
LDLIBS += -ldl
|
||||
else
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
||||
LDFLAGS += -bundle -arch i686
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
|
||||
LDFLAGS += -bundle
|
||||
LDLIBS += -ldl
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# test for essential build dependencies
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
ifeq ($(origin PKG_CONFIG), undefined)
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
endif
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
||||
LDLIBS += $(shell $(PKG_CONFIG) --libs libpng)
|
||||
|
||||
ifeq ($(origin LIBPNG_CFLAGS) $(origin LIBPNG_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion libpng 2>/dev/null),)
|
||||
$(error No libpng development libraries found!)
|
||||
endif
|
||||
LIBPNG_CFLAGS += $(shell $(PKG_CONFIG) --cflags libpng)
|
||||
LIBPNG_LDLIBS += $(shell $(PKG_CONFIG) --libs libpng)
|
||||
endif
|
||||
CFLAGS += $(LIBPNG_CFLAGS)
|
||||
LDLIBS += $(LIBPNG_LDLIBS)
|
||||
|
||||
# search for OpenGL libraries
|
||||
GL_LIBS=
|
||||
ifeq ($(OS), OSX)
|
||||
GL_LIBS = -framework OpenGL
|
||||
GL_LDLIBS = -framework OpenGL
|
||||
endif
|
||||
ifeq ($(OS), MINGW)
|
||||
GL_LIBS = -lopengl32
|
||||
GL_LDLIBS = -lopengl32
|
||||
endif
|
||||
ifeq ("$(GL_LIBS)", "")
|
||||
ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),)
|
||||
$(error No OpenGL development libraries found!)
|
||||
endif
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
||||
GL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
|
||||
GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
||||
GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl)
|
||||
endif
|
||||
LDLIBS += $(GL_LIBS)
|
||||
CFLAGS += $(GL_CFLAGS)
|
||||
LDLIBS += $(GL_LDLIBS)
|
||||
|
||||
# test for presence of SDL
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
endif
|
||||
ifeq ($(OS),FREEBSD)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
ifeq ($(OS),OSX)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
ifeq ($(OS),LINUX)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
ifeq ($(OS), MINGW)
|
||||
CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
|
||||
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
|
||||
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
|
||||
$(error No SDL development libraries found!)
|
||||
endif
|
||||
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
|
||||
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
|
||||
endif
|
||||
CFLAGS += $(SDL_CFLAGS)
|
||||
LDLIBS += $(SDL_LDLIBS)
|
||||
|
||||
# set mupen64plus core API header path
|
||||
ifneq ("$(APIDIR)","")
|
||||
|
@ -272,7 +260,7 @@ INSTALL ?= install
|
|||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CXX) $(LDFLAGS) $(TARGET_ARCH)
|
||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
# set special flags for given Makefile parameters
|
||||
ifeq ($(DEBUG),1)
|
||||
|
@ -382,7 +370,7 @@ targets:
|
|||
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
|
||||
@echo " NO_ASM=1 == build without inline assembly code (x86 MMX/SSE)"
|
||||
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3)"
|
||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)"
|
||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
||||
@echo " PIC=(1|0) == Force enable/disable of position independent code"
|
||||
@echo " POSTFIX=name == String added to the name of the the build (default: '')"
|
||||
|
@ -394,7 +382,6 @@ targets:
|
|||
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
||||
@echo " Debugging Options:"
|
||||
@echo " DEBUG=1 == add debugging symbols"
|
||||
@echo " LTO=1 == enable experimental build with link-time optimization"
|
||||
@echo " V=1 == show verbose compiler output"
|
||||
|
||||
all: $(TARGET)
|
||||
|
@ -419,11 +406,6 @@ CFLAGS += -MD
|
|||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
ifeq ($(LTO), 1)
|
||||
CFLAGS += -flto
|
||||
CXXFLAGS += -flto
|
||||
LDFLAGS += -fuse-linker-plugin $(CXXFLAGS)
|
||||
endif
|
||||
|
||||
# standard build rules
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||||
|
|
|
@ -261,18 +261,18 @@ CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender)
|
|||
if( pcontext->IsExtensionSupported("GL_ARB_fragment_program") )
|
||||
{
|
||||
m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Fragment Program");
|
||||
}
|
||||
else if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") ||
|
||||
pcontext->IsExtensionSupported("GL_NV_register_combiners") )
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombinerNvidia(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: NVidia");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: NVidia");
|
||||
}
|
||||
else if( pcontext->IsExtensionSupported("GL_NV_texture_env_combine4") )
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombinerTNT2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: TNT2");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: TNT2");
|
||||
}
|
||||
else if( pcontext->IsExtensionSupported("GL_EXT_texture_env_combine") ||
|
||||
pcontext->IsExtensionSupported("GL_ARB_texture_env_combine") )
|
||||
|
@ -282,12 +282,12 @@ CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender)
|
|||
if( maxUnit > 2 )
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombiner4v2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 version 2");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.4 version 2");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombiner4(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.4");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -295,19 +295,19 @@ CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender)
|
|||
if( maxUnit > 2 )
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombiner4v2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 version 2 (w/o env crossbar)");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.4 version 2 (w/o env crossbar)");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombiner2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.2/1.3");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.2/1.3");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pColorCombiner = new COGLColorCombiner(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Basic OGL");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Basic OGL");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -316,32 +316,32 @@ CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender)
|
|||
{
|
||||
case OGL_1_1_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombiner(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Basic OGL");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Basic OGL");
|
||||
break;
|
||||
case OGL_1_2_DEVICE:
|
||||
case OGL_1_3_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombiner2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.2/1.3");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.2/1.3");
|
||||
break;
|
||||
case OGL_1_4_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombiner4(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.4");
|
||||
break;
|
||||
case OGL_1_4_V2_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombiner4v2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: OGL 1.4 Version 2");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: OGL 1.4 Version 2");
|
||||
break;
|
||||
case OGL_TNT2_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombinerTNT2(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: TNT2");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: TNT2");
|
||||
break;
|
||||
case NVIDIA_OGL_DEVICE:
|
||||
m_pColorCombiner = new COGLColorCombinerNvidia(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Nvidia");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Nvidia");
|
||||
break;
|
||||
case OGL_FRAGMENT_PROGRAM:
|
||||
m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Fragment Program");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -350,7 +350,7 @@ CColorCombiner * OGLDeviceBuilder::CreateColorCombiner(CRender *pRender)
|
|||
|
||||
#elif SDL_VIDEO_OPENGL_ES2
|
||||
m_pColorCombiner = new COGL_FragmentProgramCombiner(pRender);
|
||||
DebugMessage(M64MSG_INFO, "OpenGL Combiner: Fragment Program");
|
||||
DebugMessage(M64MSG_VERBOSE, "OpenGL Combiner: Fragment Program");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -618,13 +618,13 @@ uint32 CalculateRDRAMCRC(void *pPhysicalAddress, uint32 left, uint32 top, uint32
|
|||
uint32* pStart = (uint32*)pPhysicalAddress;
|
||||
pStart += (top * pitch) + (((left<<size)+1)>>3);
|
||||
|
||||
uint32 y = dwAsmHeight;
|
||||
uint32 x,esi;
|
||||
int y = dwAsmHeight;
|
||||
|
||||
while((int)y >= 0)
|
||||
while(y >= 0)
|
||||
{
|
||||
x = dwAsmdwBytesPerLine - 4;
|
||||
while((int)x >= 0)
|
||||
uint32 esi = 0;
|
||||
int x = dwAsmdwBytesPerLine - 4;
|
||||
while(x >= 0)
|
||||
{
|
||||
esi = *(uint32*)(pAsmStart + x);
|
||||
esi ^= x;
|
||||
|
|
|
@ -65,6 +65,11 @@ bool CGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowe
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CGraphicsContext::ResizeInitialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CGraphicsContext::CleanUp()
|
||||
{
|
||||
m_bActive = false;
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
bool IsWindowed() {return m_bWindowed;}
|
||||
|
||||
virtual bool Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed );
|
||||
virtual bool ResizeInitialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed );
|
||||
virtual void CleanUp();
|
||||
|
||||
virtual void Clear(ClearFlag flags, uint32 color=0xFF000000, float depth=1.0f) = 0;
|
||||
|
|
|
@ -112,7 +112,8 @@ bool COGLGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWind
|
|||
|
||||
/* Set the video mode */
|
||||
m64p_video_mode ScreenMode = bWindowed ? M64VIDEO_WINDOWED : M64VIDEO_FULLSCREEN;
|
||||
if (CoreVideo_SetVideoMode(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, colorBufferDepth, ScreenMode) != M64ERR_SUCCESS)
|
||||
m64p_video_flags flags = M64VIDEOFLAG_SUPPORT_RESIZING;
|
||||
if (CoreVideo_SetVideoMode(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, colorBufferDepth, ScreenMode, flags) != M64ERR_SUCCESS)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Failed to set %i-bit video mode: %ix%i", colorBufferDepth, (int)windowSetting.uDisplayWidth, (int)windowSetting.uDisplayHeight);
|
||||
CoreVideo_Quit();
|
||||
|
@ -163,6 +164,59 @@ bool COGLGraphicsContext::Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWind
|
|||
return true;
|
||||
}
|
||||
|
||||
bool COGLGraphicsContext::ResizeInitialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed )
|
||||
{
|
||||
Lock();
|
||||
|
||||
CGraphicsContext::Initialize(dwWidth, dwHeight, bWindowed );
|
||||
|
||||
int depthBufferDepth = options.OpenglDepthBufferSetting;
|
||||
int colorBufferDepth = 32;
|
||||
int bVerticalSync = windowSetting.bVerticalSync;
|
||||
if( options.colorQuality == TEXTURE_FMT_A4R4G4B4 ) colorBufferDepth = 16;
|
||||
|
||||
/* hard-coded attribute values */
|
||||
const int iDOUBLEBUFFER = 1;
|
||||
|
||||
/* set opengl attributes */
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, iDOUBLEBUFFER);
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, bVerticalSync);
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_BUFFER_SIZE, colorBufferDepth);
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_DEPTH_SIZE, depthBufferDepth);
|
||||
|
||||
/* set multisampling */
|
||||
if (options.multiSampling > 0)
|
||||
{
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLEBUFFERS, 1);
|
||||
if (options.multiSampling <= 2)
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 2);
|
||||
else if (options.multiSampling <= 4)
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 4);
|
||||
else if (options.multiSampling <= 8)
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 8);
|
||||
else
|
||||
CoreVideo_GL_SetAttribute(M64P_GL_MULTISAMPLESAMPLES, 16);
|
||||
}
|
||||
|
||||
/* Call Mupen64plus core Video Extension to resize the window, which will create a new OpenGL Context under SDL */
|
||||
if (CoreVideo_ResizeWindow(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight) != M64ERR_SUCCESS)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Failed to set %i-bit video mode: %ix%i", colorBufferDepth, (int)windowSetting.uDisplayWidth, (int)windowSetting.uDisplayHeight);
|
||||
CoreVideo_Quit();
|
||||
return false;
|
||||
}
|
||||
|
||||
InitState();
|
||||
Unlock();
|
||||
|
||||
Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); // Clear buffers
|
||||
UpdateFrame();
|
||||
Clear(CLEAR_COLOR_AND_DEPTH_BUFFER);
|
||||
UpdateFrame();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void COGLGraphicsContext::InitState(void)
|
||||
{
|
||||
m_pRenderStr = glGetString(GL_RENDERER);
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
virtual ~COGLGraphicsContext();
|
||||
|
||||
bool Initialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed );
|
||||
bool ResizeInitialize(uint32 dwWidth, uint32 dwHeight, BOOL bWindowed );
|
||||
void CleanUp();
|
||||
void Clear(ClearFlag dwFlags, uint32 color=0xFF000000, float depth=1.0f);
|
||||
|
||||
|
|
|
@ -1723,6 +1723,8 @@ void DumpCachedTexture( TxtrCacheEntry &entry )
|
|||
newinfo.foldername = NULL;
|
||||
newinfo.filename = NULL;
|
||||
newinfo.filename_a = NULL;
|
||||
newinfo.type = NO_TEXTURE;
|
||||
newinfo.bSeparatedAlpha = false;
|
||||
|
||||
uint64 crc64 = newinfo.crc32;
|
||||
crc64 <<= 32;
|
||||
|
|
|
@ -95,6 +95,7 @@ ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL;
|
|||
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
|
||||
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
|
||||
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
|
||||
ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
|
||||
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
|
||||
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
|
||||
ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL;
|
||||
|
@ -125,6 +126,35 @@ static void ChangeWindowStep2()
|
|||
status.ToToggleFullScreen = FALSE;
|
||||
}
|
||||
|
||||
static void ResizeStep2(void)
|
||||
{
|
||||
g_CritialSection.Lock();
|
||||
|
||||
// Delete all OpenGL textures
|
||||
gTextureManager.CleanUp();
|
||||
RDP_Cleanup();
|
||||
// delete our opengl renderer
|
||||
CDeviceBuilder::GetBuilder()->DeleteRender();
|
||||
|
||||
// call video extension function with updated width, height (this creates a new OpenGL context)
|
||||
windowSetting.uDisplayWidth = status.gNewResizeWidth;
|
||||
windowSetting.uDisplayHeight = status.gNewResizeHeight;
|
||||
CoreVideo_ResizeWindow(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight);
|
||||
|
||||
// re-initialize our OpenGL graphics context state
|
||||
bool res = CGraphicsContext::Get()->ResizeInitialize(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, !windowSetting.bDisplayFullscreen);
|
||||
if (res)
|
||||
{
|
||||
// re-create the OpenGL renderer
|
||||
CDeviceBuilder::GetBuilder()->CreateRender();
|
||||
CRender::GetRender()->Initialize();
|
||||
DLParser_Init();
|
||||
}
|
||||
|
||||
g_CritialSection.Unlock();
|
||||
status.ToResize = false;
|
||||
}
|
||||
|
||||
static void UpdateScreenStep2 (void)
|
||||
{
|
||||
status.bVIOriginIsUpdated = false;
|
||||
|
@ -134,6 +164,11 @@ static void UpdateScreenStep2 (void)
|
|||
ChangeWindowStep2();
|
||||
return;
|
||||
}
|
||||
if (status.ToResize && status.gDlistCount > 0)
|
||||
{
|
||||
ResizeStep2();
|
||||
return;
|
||||
}
|
||||
|
||||
g_CritialSection.Lock();
|
||||
if( status.bHandleN64RenderTexture )
|
||||
|
@ -597,13 +632,14 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
|
|||
CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode");
|
||||
CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption");
|
||||
CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen");
|
||||
CoreVideo_ResizeWindow = (ptr_VidExt_ResizeWindow) osal_dynlib_getproc(CoreLibHandle, "VidExt_ResizeWindow");
|
||||
CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress");
|
||||
CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute");
|
||||
CoreVideo_GL_GetAttribute = (ptr_VidExt_GL_GetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetAttribute");
|
||||
CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers");
|
||||
|
||||
if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode ||
|
||||
!CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress ||
|
||||
!CoreVideo_ResizeWindow || !CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress ||
|
||||
!CoreVideo_GL_SetAttribute || !CoreVideo_GL_GetAttribute || !CoreVideo_GL_SwapBuffers)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Couldn't connect to Core video extension functions");
|
||||
|
@ -771,6 +807,7 @@ EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info)
|
|||
windowSetting.fViWidth = 320;
|
||||
windowSetting.fViHeight = 240;
|
||||
status.ToToggleFullScreen = FALSE;
|
||||
status.ToResize = false;
|
||||
status.bDisableFPS=false;
|
||||
|
||||
if (!InitConfiguration())
|
||||
|
@ -785,6 +822,14 @@ EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info)
|
|||
return(TRUE);
|
||||
}
|
||||
|
||||
EXPORT void CALL ResizeVideoOutput(int width, int height)
|
||||
{
|
||||
// save the new window resolution. actual resizing operation is asynchronous (it happens later)
|
||||
status.gNewResizeWidth = width;
|
||||
status.gNewResizeHeight = height;
|
||||
status.ToResize = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
||||
EXPORT void CALL ProcessRDPList(void)
|
||||
|
|
|
@ -98,6 +98,8 @@ typedef struct {
|
|||
uint32 gUcodeCount;
|
||||
uint32 gRDPTime;
|
||||
BOOL ToToggleFullScreen;
|
||||
bool ToResize;
|
||||
uint32 gNewResizeWidth, gNewResizeHeight;
|
||||
bool bDisableFPS;
|
||||
|
||||
bool bUseModifiedUcodeMap;
|
||||
|
@ -189,6 +191,7 @@ extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes;
|
|||
extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
|
||||
extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
|
||||
extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen;
|
||||
extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow;
|
||||
extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress;
|
||||
extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
|
||||
extern ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute;
|
||||
|
|
|
@ -398,14 +398,12 @@ BMGError WritePNG( const char *filename, struct BMGImageStruct img )
|
|||
png_structp png_ptr = NULL;
|
||||
png_infop info_ptr = NULL;
|
||||
png_colorp PNGPalette = NULL;
|
||||
int GrayScale;
|
||||
|
||||
unsigned char *bits, *p, *q;
|
||||
unsigned char **rows = NULL;
|
||||
int NumColors = 0;
|
||||
volatile int GrayScale, NumColors; // mark as volatile so GCC won't throw warning with -Wclobbered
|
||||
|
||||
int DIBScanWidth;
|
||||
int HasPalette;
|
||||
FILE *outfile = NULL;
|
||||
int i;
|
||||
BMGError tmp;
|
||||
|
@ -453,8 +451,9 @@ BMGError WritePNG( const char *filename, struct BMGImageStruct img )
|
|||
longjmp( err_jmp, (int)tmp );
|
||||
}
|
||||
|
||||
HasPalette = img.bits_per_pixel <= 8;
|
||||
if ( HasPalette )
|
||||
GrayScale = 0;
|
||||
NumColors = 0;
|
||||
if (img.bits_per_pixel <= 8) // has palette
|
||||
{
|
||||
NumColors = img.palette_size;
|
||||
/* if this is a grayscale image then set the flag and delete the palette*/
|
||||
|
@ -465,10 +464,8 @@ BMGError WritePNG( const char *filename, struct BMGImageStruct img )
|
|||
i++;
|
||||
bits += img.bytes_per_palette_entry;
|
||||
}
|
||||
GrayScale = i == NumColors;
|
||||
GrayScale = (i == NumColors);
|
||||
}
|
||||
else
|
||||
GrayScale = 0;
|
||||
|
||||
/* dimensions */
|
||||
DIBScanWidth = ( img.width * img.bits_per_pixel + 7 ) / 8;
|
||||
|
|
|
@ -36,6 +36,7 @@ extern "C" {
|
|||
#define PATH_MAX _MAX_PATH
|
||||
#define OSAL_DIR_SEPARATOR_STR "\\"
|
||||
#define OSAL_DIR_SEPARATOR_CHAR '\\'
|
||||
#define strdup _strdup
|
||||
#else /* Not WIN32 */
|
||||
#include <limits.h> // for PATH_MAX
|
||||
#define OSAL_DIR_SEPARATOR_STR "/"
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
#define VERSION_H
|
||||
|
||||
#define PLUGIN_NAME "Mupen64Plus OpenGL Video Plugin by Rice"
|
||||
#define PLUGIN_VERSION 0x016305
|
||||
#define VIDEO_PLUGIN_API_VERSION 0x020100
|
||||
#define PLUGIN_VERSION 0x020000
|
||||
#define VIDEO_PLUGIN_API_VERSION 0x020200
|
||||
#define CONFIG_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x020000
|
||||
#define VIDEXT_API_VERSION 0x030000
|
||||
|
||||
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ ViStatusChanged;
|
|||
ViWidthChanged;
|
||||
ReadScreen2;
|
||||
SetRenderingCallback;
|
||||
ResizeVideoOutput;
|
||||
FBRead;
|
||||
FBWrite;
|
||||
FBGetFrameBufferInfo;
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// boost aligned_storage.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2002-2003
|
||||
// Eric Friedman, Itay Maman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_ALIGNED_STORAGE_HPP
|
||||
#define BOOST_ALIGNED_STORAGE_HPP
|
||||
|
||||
#include <cstddef> // for std::size_t
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include "boost/detail/workaround.hpp"
|
||||
#include "boost/type_traits/alignment_of.hpp"
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
|
||||
#include "boost/mpl/eval_if.hpp"
|
||||
#include "boost/mpl/identity.hpp"
|
||||
|
||||
#include "boost/type_traits/detail/bool_trait_def.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail { namespace aligned_storage {
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, alignment_of_max_align = ::boost::alignment_of<max_align>::value
|
||||
);
|
||||
|
||||
//
|
||||
// To be TR1 conforming this must be a POD type:
|
||||
//
|
||||
template <
|
||||
std::size_t size_
|
||||
, std::size_t alignment_
|
||||
>
|
||||
struct aligned_storage_imp
|
||||
{
|
||||
union data_t
|
||||
{
|
||||
char buf[size_];
|
||||
|
||||
typename mpl::eval_if_c<
|
||||
alignment_ == std::size_t(-1)
|
||||
, mpl::identity<detail::max_align>
|
||||
, type_with_alignment<alignment_>
|
||||
>::type align_;
|
||||
} data_;
|
||||
void* address() const { return const_cast<aligned_storage_imp*>(this); }
|
||||
};
|
||||
|
||||
template< std::size_t alignment_ >
|
||||
struct aligned_storage_imp<0u,alignment_>
|
||||
{
|
||||
/* intentionally empty */
|
||||
void* address() const { return 0; }
|
||||
};
|
||||
|
||||
}} // namespace detail::aligned_storage
|
||||
|
||||
template <
|
||||
std::size_t size_
|
||||
, std::size_t alignment_ = std::size_t(-1)
|
||||
>
|
||||
class aligned_storage :
|
||||
#ifndef __BORLANDC__
|
||||
private
|
||||
#else
|
||||
public
|
||||
#endif
|
||||
detail::aligned_storage::aligned_storage_imp<size_, alignment_>
|
||||
{
|
||||
|
||||
public: // constants
|
||||
|
||||
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, size = size_
|
||||
);
|
||||
BOOST_STATIC_CONSTANT(
|
||||
std::size_t
|
||||
, alignment = (
|
||||
alignment_ == std::size_t(-1)
|
||||
? ::boost::detail::aligned_storage::alignment_of_max_align
|
||||
: alignment_
|
||||
)
|
||||
);
|
||||
|
||||
#if defined(__GNUC__) &&\
|
||||
(__GNUC__ > 3) ||\
|
||||
(__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
|
||||
(__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
|
||||
|
||||
private: // noncopyable
|
||||
|
||||
aligned_storage(const aligned_storage&);
|
||||
aligned_storage& operator=(const aligned_storage&);
|
||||
|
||||
#else // gcc less than 3.2.3
|
||||
|
||||
public: // _should_ be noncopyable, but GCC compiler emits error
|
||||
|
||||
aligned_storage(const aligned_storage&);
|
||||
aligned_storage& operator=(const aligned_storage&);
|
||||
|
||||
#endif // gcc < 3.2.3 workaround
|
||||
|
||||
public: // structors
|
||||
|
||||
aligned_storage()
|
||||
{
|
||||
}
|
||||
|
||||
~aligned_storage()
|
||||
{
|
||||
}
|
||||
|
||||
public: // accessors
|
||||
|
||||
void* address()
|
||||
{
|
||||
return static_cast<type*>(this)->address();
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
const void* address() const
|
||||
{
|
||||
return static_cast<const type*>(this)->address();
|
||||
}
|
||||
|
||||
#else // MSVC6
|
||||
|
||||
const void* address() const;
|
||||
|
||||
#endif // MSVC6 workaround
|
||||
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
|
||||
// MSVC6 seems not to like inline functions with const void* returns, so we
|
||||
// declare the following here:
|
||||
|
||||
template <std::size_t S, std::size_t A>
|
||||
const void* aligned_storage<S,A>::address() const
|
||||
{
|
||||
return const_cast< aligned_storage<S,A>* >(this)->address();
|
||||
}
|
||||
|
||||
#endif // MSVC6 workaround
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
//
|
||||
// Make sure that is_pod recognises aligned_storage<>::type
|
||||
// as a POD (Note that aligned_storage<> itself is not a POD):
|
||||
//
|
||||
template <std::size_t size_, std::size_t alignment_>
|
||||
struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
|
||||
BOOST_TT_AUX_BOOL_C_BASE(true)
|
||||
{
|
||||
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include "boost/type_traits/detail/bool_trait_undef.hpp"
|
||||
|
||||
#endif // BOOST_ALIGNED_STORAGE_HPP
|
|
@ -0,0 +1,253 @@
|
|||
// See http://www.boost.org/libs/any for Documentation.
|
||||
|
||||
#ifndef BOOST_ANY_INCLUDED
|
||||
#define BOOST_ANY_INCLUDED
|
||||
|
||||
// what: variant type boost::any
|
||||
// who: contributed by Kevlin Henney,
|
||||
// with features contributed and bugs found by
|
||||
// Ed Brey, Mark Rodgers, Peter Dimov, and James Curran
|
||||
// when: July 2001
|
||||
// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.95
|
||||
|
||||
#include <algorithm>
|
||||
#include <typeinfo>
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
// See boost/python/type_id.hpp
|
||||
// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp
|
||||
# if (defined(__GNUC__) && __GNUC__ >= 3) \
|
||||
|| defined(_AIX) \
|
||||
|| ( defined(__sgi) && defined(__host_mips)) \
|
||||
|| (defined(__hpux) && defined(__HP_aCC)) \
|
||||
|| (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC))
|
||||
# define BOOST_AUX_ANY_TYPE_ID_NAME
|
||||
#include <cstring>
|
||||
# endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
class any
|
||||
{
|
||||
public: // structors
|
||||
|
||||
any()
|
||||
: content(0)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
any(const ValueType & value)
|
||||
: content(new holder<ValueType>(value))
|
||||
{
|
||||
}
|
||||
|
||||
any(const any & other)
|
||||
: content(other.content ? other.content->clone() : 0)
|
||||
{
|
||||
}
|
||||
|
||||
~any()
|
||||
{
|
||||
delete content;
|
||||
}
|
||||
|
||||
public: // modifiers
|
||||
|
||||
any & swap(any & rhs)
|
||||
{
|
||||
std::swap(content, rhs.content);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
any & operator=(const ValueType & rhs)
|
||||
{
|
||||
any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
any & operator=(any rhs)
|
||||
{
|
||||
rhs.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
public: // queries
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return !content;
|
||||
}
|
||||
|
||||
const std::type_info & type() const
|
||||
{
|
||||
return content ? content->type() : typeid(void);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
private: // types
|
||||
#else
|
||||
public: // types (public so any_cast can be non-friend)
|
||||
#endif
|
||||
|
||||
class placeholder
|
||||
{
|
||||
public: // structors
|
||||
|
||||
virtual ~placeholder()
|
||||
{
|
||||
}
|
||||
|
||||
public: // queries
|
||||
|
||||
virtual const std::type_info & type() const = 0;
|
||||
|
||||
virtual placeholder * clone() const = 0;
|
||||
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
class holder : public placeholder
|
||||
{
|
||||
public: // structors
|
||||
|
||||
holder(const ValueType & value)
|
||||
: held(value)
|
||||
{
|
||||
}
|
||||
|
||||
public: // queries
|
||||
|
||||
virtual const std::type_info & type() const
|
||||
{
|
||||
return typeid(ValueType);
|
||||
}
|
||||
|
||||
virtual placeholder * clone() const
|
||||
{
|
||||
return new holder(held);
|
||||
}
|
||||
|
||||
public: // representation
|
||||
|
||||
ValueType held;
|
||||
|
||||
private: // intentionally left unimplemented
|
||||
holder & operator=(const holder &);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
|
||||
private: // representation
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType * any_cast(any *);
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType * unsafe_any_cast(any *);
|
||||
|
||||
#else
|
||||
|
||||
public: // representation (public so any_cast can be non-friend)
|
||||
|
||||
#endif
|
||||
|
||||
placeholder * content;
|
||||
|
||||
};
|
||||
|
||||
class bad_any_cast : public std::bad_cast
|
||||
{
|
||||
public:
|
||||
virtual const char * what() const throw()
|
||||
{
|
||||
return "boost::bad_any_cast: "
|
||||
"failed conversion using boost::any_cast";
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType * any_cast(any * operand)
|
||||
{
|
||||
return operand &&
|
||||
#ifdef BOOST_AUX_ANY_TYPE_ID_NAME
|
||||
std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0
|
||||
#else
|
||||
operand->type() == typeid(ValueType)
|
||||
#endif
|
||||
? &static_cast<any::holder<ValueType> *>(operand->content)->held
|
||||
: 0;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType * any_cast(const any * operand)
|
||||
{
|
||||
return any_cast<ValueType>(const_cast<any *>(operand));
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType any_cast(any & operand)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// If 'nonref' is still reference type, it means the user has not
|
||||
// specialized 'remove_reference'.
|
||||
|
||||
// Please use BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION macro
|
||||
// to generate specialization of remove_reference for your class
|
||||
// See type traits library documentation for details
|
||||
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
|
||||
#endif
|
||||
|
||||
nonref * result = any_cast<nonref>(&operand);
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast());
|
||||
return *result;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType any_cast(const any & operand)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// The comment in the above version of 'any_cast' explains when this
|
||||
// assert is fired and what to do.
|
||||
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
|
||||
#endif
|
||||
|
||||
return any_cast<const nonref &>(const_cast<any &>(operand));
|
||||
}
|
||||
|
||||
// Note: The "unsafe" versions of any_cast are not part of the
|
||||
// public interface and may be removed at any time. They are
|
||||
// required where we know what type is stored in the any and can't
|
||||
// use typeid() comparison, e.g., when our types may travel across
|
||||
// different shared libraries.
|
||||
template<typename ValueType>
|
||||
inline ValueType * unsafe_any_cast(any * operand)
|
||||
{
|
||||
return &static_cast<any::holder<ValueType> *>(operand->content)->held;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType * unsafe_any_cast(const any * operand)
|
||||
{
|
||||
return unsafe_any_cast<ValueType>(const_cast<any *>(operand));
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#endif
|
|
@ -0,0 +1,446 @@
|
|||
/* The following code declares class array,
|
||||
* an STL container (as wrapper) for arrays of constant size.
|
||||
*
|
||||
* See
|
||||
* http://www.boost.org/libs/array/
|
||||
* for documentation.
|
||||
*
|
||||
* The original author site is at: http://www.josuttis.com/
|
||||
*
|
||||
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* 14 Apr 2012 - (mtc) Added support for boost::hash
|
||||
* 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
|
||||
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
|
||||
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
|
||||
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
|
||||
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
|
||||
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
|
||||
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
|
||||
* 05 Aug 2001 - minor update (Nico Josuttis)
|
||||
* 20 Jan 2001 - STLport fix (Beman Dawes)
|
||||
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
|
||||
*
|
||||
* Jan 29, 2004
|
||||
*/
|
||||
#ifndef BOOST_ARRAY_HPP
|
||||
#define BOOST_ARRAY_HPP
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
|
||||
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
|
||||
# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <stdexcept>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
|
||||
// Handles broken standard libraries better than <iterator>
|
||||
#include <boost/detail/iterator.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
// FIXES for broken compilers
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T, std::size_t N>
|
||||
class array {
|
||||
public:
|
||||
T elems[N]; // fixed-size array of elements of type T
|
||||
|
||||
public:
|
||||
// type definitions
|
||||
typedef T value_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return elems; }
|
||||
const_iterator begin() const { return elems; }
|
||||
const_iterator cbegin() const { return elems; }
|
||||
|
||||
iterator end() { return elems+N; }
|
||||
const_iterator end() const { return elems+N; }
|
||||
const_iterator cend() const { return elems+N; }
|
||||
|
||||
// reverse iterator support
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
|
||||
// workaround for broken reverse_iterator in VC7
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
|
||||
reference, iterator, reference> > reverse_iterator;
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
|
||||
const_reference, iterator, reference> > const_reverse_iterator;
|
||||
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
|
||||
value_type, reference, iterator, difference_type> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
|
||||
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator crbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
const_reverse_iterator crend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
// operator[]
|
||||
reference operator[](size_type i)
|
||||
{
|
||||
BOOST_ASSERT_MSG( i < N, "out of range" );
|
||||
return elems[i];
|
||||
}
|
||||
|
||||
const_reference operator[](size_type i) const
|
||||
{
|
||||
BOOST_ASSERT_MSG( i < N, "out of range" );
|
||||
return elems[i];
|
||||
}
|
||||
|
||||
// at() with range check
|
||||
reference at(size_type i) { rangecheck(i); return elems[i]; }
|
||||
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
|
||||
|
||||
// front() and back()
|
||||
reference front()
|
||||
{
|
||||
return elems[0];
|
||||
}
|
||||
|
||||
const_reference front() const
|
||||
{
|
||||
return elems[0];
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return elems[N-1];
|
||||
}
|
||||
|
||||
const_reference back() const
|
||||
{
|
||||
return elems[N-1];
|
||||
}
|
||||
|
||||
// size is constant
|
||||
static size_type size() { return N; }
|
||||
static bool empty() { return false; }
|
||||
static size_type max_size() { return N; }
|
||||
enum { static_size = N };
|
||||
|
||||
// swap (note: linear complexity)
|
||||
void swap (array<T,N>& y) {
|
||||
for (size_type i = 0; i < N; ++i)
|
||||
boost::swap(elems[i],y.elems[i]);
|
||||
}
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return elems; }
|
||||
T* data() { return elems; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return elems; }
|
||||
|
||||
// assignment with type conversion
|
||||
template <typename T2>
|
||||
array<T,N>& operator= (const array<T2,N>& rhs) {
|
||||
std::copy(rhs.begin(),rhs.end(), begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assign one value to all elements
|
||||
void assign (const T& value) { fill ( value ); } // A synonym for fill
|
||||
void fill (const T& value)
|
||||
{
|
||||
std::fill_n(begin(),size(),value);
|
||||
}
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static void rangecheck (size_type i) {
|
||||
if (i >= size()) {
|
||||
std::out_of_range e("array<>: index out of range");
|
||||
boost::throw_exception(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
template< class T >
|
||||
class array< T, 0 > {
|
||||
|
||||
public:
|
||||
// type definitions
|
||||
typedef T value_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
|
||||
const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
|
||||
const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
|
||||
|
||||
iterator end() { return begin(); }
|
||||
const_iterator end() const { return begin(); }
|
||||
const_iterator cend() const { return cbegin(); }
|
||||
|
||||
// reverse iterator support
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
|
||||
// workaround for broken reverse_iterator in VC7
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
|
||||
reference, iterator, reference> > reverse_iterator;
|
||||
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
|
||||
const_reference, iterator, reference> > const_reverse_iterator;
|
||||
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
|
||||
value_type, reference, iterator, difference_type> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
|
||||
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator crbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
const_reverse_iterator crend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
// operator[]
|
||||
reference operator[](size_type /*i*/)
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference operator[](size_type /*i*/) const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// at() with range check
|
||||
reference at(size_type /*i*/) { return failed_rangecheck(); }
|
||||
const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
|
||||
|
||||
// front() and back()
|
||||
reference front()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference front() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
const_reference back() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// size is constant
|
||||
static size_type size() { return 0; }
|
||||
static bool empty() { return true; }
|
||||
static size_type max_size() { return 0; }
|
||||
enum { static_size = 0 };
|
||||
|
||||
void swap (array<T,0>& /*y*/) {
|
||||
}
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return 0; }
|
||||
T* data() { return 0; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return 0; }
|
||||
|
||||
// assignment with type conversion
|
||||
template <typename T2>
|
||||
array<T,0>& operator= (const array<T2,0>& ) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assign one value to all elements
|
||||
void assign (const T& value) { fill ( value ); }
|
||||
void fill (const T& ) {}
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static reference failed_rangecheck () {
|
||||
std::out_of_range e("attempt to access element of an empty array");
|
||||
boost::throw_exception(e);
|
||||
#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
|
||||
//
|
||||
// We need to return something here to keep
|
||||
// some compilers happy: however we will never
|
||||
// actually get here....
|
||||
//
|
||||
static T placeholder;
|
||||
return placeholder;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
// comparisons
|
||||
template<class T, std::size_t N>
|
||||
bool operator== (const array<T,N>& x, const array<T,N>& y) {
|
||||
return std::equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator< (const array<T,N>& x, const array<T,N>& y) {
|
||||
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator!= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(x==y);
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator> (const array<T,N>& x, const array<T,N>& y) {
|
||||
return y<x;
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator<= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(y<x);
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator>= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(x<y);
|
||||
}
|
||||
|
||||
// global swap()
|
||||
template<class T, std::size_t N>
|
||||
inline void swap (array<T,N>& x, array<T,N>& y) {
|
||||
x.swap(y);
|
||||
}
|
||||
|
||||
#if defined(__SUNPRO_CC)
|
||||
// Trac ticket #4757; the Sun Solaris compiler can't handle
|
||||
// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
|
||||
//
|
||||
// We can't just use this for all compilers, because the
|
||||
// borland compilers can't handle this form.
|
||||
namespace detail {
|
||||
template <typename T, std::size_t N> struct c_array
|
||||
{
|
||||
typedef T type[N];
|
||||
};
|
||||
}
|
||||
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
typename const detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
#else
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
T(&get_c_array(boost::array<T,N>& arg))[N]
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
|
||||
// Const version.
|
||||
template <typename T, std::size_t N>
|
||||
const T(&get_c_array(const boost::array<T,N>& arg))[N]
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// Overload for std::array, assuming that std::array will have
|
||||
// explicit conversion functions as discussed at the WG21 meeting
|
||||
// in Summit, March 2009.
|
||||
template <typename T, std::size_t N>
|
||||
T(&get_c_array(std::array<T,N>& arg))[N]
|
||||
{
|
||||
return static_cast<T(&)[N]>(arg);
|
||||
}
|
||||
|
||||
// Const version.
|
||||
template <typename T, std::size_t N>
|
||||
const T(&get_c_array(const std::array<T,N>& arg))[N]
|
||||
{
|
||||
return static_cast<T(&)[N]>(arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
template<class T, std::size_t N>
|
||||
std::size_t hash_value(const array<T,N>& arr)
|
||||
{
|
||||
return boost::hash_range(arr.begin(), arr.end());
|
||||
}
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif /*BOOST_ARRAY_HPP*/
|
|
@ -0,0 +1,112 @@
|
|||
//
|
||||
// asio.hpp
|
||||
// ~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See www.boost.org/libs/asio for documentation.
|
||||
//
|
||||
|
||||
#ifndef BOOST_ASIO_HPP
|
||||
#define BOOST_ASIO_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
|
||||
#include <boost/asio/basic_datagram_socket.hpp>
|
||||
#include <boost/asio/basic_deadline_timer.hpp>
|
||||
#include <boost/asio/basic_io_object.hpp>
|
||||
#include <boost/asio/basic_raw_socket.hpp>
|
||||
#include <boost/asio/basic_seq_packet_socket.hpp>
|
||||
#include <boost/asio/basic_serial_port.hpp>
|
||||
#include <boost/asio/basic_signal_set.hpp>
|
||||
#include <boost/asio/basic_socket_acceptor.hpp>
|
||||
#include <boost/asio/basic_socket_iostream.hpp>
|
||||
#include <boost/asio/basic_socket_streambuf.hpp>
|
||||
#include <boost/asio/basic_stream_socket.hpp>
|
||||
#include <boost/asio/basic_streambuf.hpp>
|
||||
#include <boost/asio/basic_waitable_timer.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/asio/buffered_read_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_read_stream.hpp>
|
||||
#include <boost/asio/buffered_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_stream.hpp>
|
||||
#include <boost/asio/buffered_write_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_write_stream.hpp>
|
||||
#include <boost/asio/buffers_iterator.hpp>
|
||||
#include <boost/asio/completion_condition.hpp>
|
||||
#include <boost/asio/connect.hpp>
|
||||
#include <boost/asio/datagram_socket_service.hpp>
|
||||
#include <boost/asio/deadline_timer_service.hpp>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
#include <boost/asio/error.hpp>
|
||||
#include <boost/asio/handler_alloc_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/asio/ip/address_v4.hpp>
|
||||
#include <boost/asio/ip/address_v6.hpp>
|
||||
#include <boost/asio/ip/basic_endpoint.hpp>
|
||||
#include <boost/asio/ip/basic_resolver.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_entry.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_iterator.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_query.hpp>
|
||||
#include <boost/asio/ip/host_name.hpp>
|
||||
#include <boost/asio/ip/icmp.hpp>
|
||||
#include <boost/asio/ip/multicast.hpp>
|
||||
#include <boost/asio/ip/resolver_query_base.hpp>
|
||||
#include <boost/asio/ip/resolver_service.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/ip/udp.hpp>
|
||||
#include <boost/asio/ip/unicast.hpp>
|
||||
#include <boost/asio/ip/v6_only.hpp>
|
||||
#include <boost/asio/is_read_buffered.hpp>
|
||||
#include <boost/asio/is_write_buffered.hpp>
|
||||
#include <boost/asio/local/basic_endpoint.hpp>
|
||||
#include <boost/asio/local/connect_pair.hpp>
|
||||
#include <boost/asio/local/datagram_protocol.hpp>
|
||||
#include <boost/asio/local/stream_protocol.hpp>
|
||||
#include <boost/asio/placeholders.hpp>
|
||||
#include <boost/asio/posix/basic_descriptor.hpp>
|
||||
#include <boost/asio/posix/basic_stream_descriptor.hpp>
|
||||
#include <boost/asio/posix/descriptor_base.hpp>
|
||||
#include <boost/asio/posix/stream_descriptor.hpp>
|
||||
#include <boost/asio/posix/stream_descriptor_service.hpp>
|
||||
#include <boost/asio/raw_socket_service.hpp>
|
||||
#include <boost/asio/read.hpp>
|
||||
#include <boost/asio/read_at.hpp>
|
||||
#include <boost/asio/read_until.hpp>
|
||||
#include <boost/asio/seq_packet_socket_service.hpp>
|
||||
#include <boost/asio/serial_port.hpp>
|
||||
#include <boost/asio/serial_port_base.hpp>
|
||||
#include <boost/asio/serial_port_service.hpp>
|
||||
#include <boost/asio/signal_set.hpp>
|
||||
#include <boost/asio/signal_set_service.hpp>
|
||||
#include <boost/asio/socket_acceptor_service.hpp>
|
||||
#include <boost/asio/socket_base.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/asio/stream_socket_service.hpp>
|
||||
#include <boost/asio/streambuf.hpp>
|
||||
#include <boost/asio/time_traits.hpp>
|
||||
#include <boost/asio/version.hpp>
|
||||
#include <boost/asio/wait_traits.hpp>
|
||||
#include <boost/asio/waitable_timer_service.hpp>
|
||||
#include <boost/asio/windows/basic_handle.hpp>
|
||||
#include <boost/asio/windows/basic_object_handle.hpp>
|
||||
#include <boost/asio/windows/basic_random_access_handle.hpp>
|
||||
#include <boost/asio/windows/basic_stream_handle.hpp>
|
||||
#include <boost/asio/windows/object_handle.hpp>
|
||||
#include <boost/asio/windows/object_handle_service.hpp>
|
||||
#include <boost/asio/windows/overlapped_ptr.hpp>
|
||||
#include <boost/asio/windows/random_access_handle.hpp>
|
||||
#include <boost/asio/windows/random_access_handle_service.hpp>
|
||||
#include <boost/asio/windows/stream_handle.hpp>
|
||||
#include <boost/asio/windows/stream_handle_service.hpp>
|
||||
#include <boost/asio/write.hpp>
|
||||
#include <boost/asio/write_at.hpp>
|
||||
|
||||
#endif // BOOST_ASIO_HPP
|
|
@ -0,0 +1,131 @@
|
|||
//
|
||||
// boost/assert.hpp - BOOST_ASSERT(expr)
|
||||
// BOOST_ASSERT_MSG(expr, msg)
|
||||
// BOOST_VERIFY(expr)
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2007 Peter Dimov
|
||||
// Copyright (c) Beman Dawes 2011
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Note: There are no include guards. This is intentional.
|
||||
//
|
||||
// See http://www.boost.org/libs/utility/assert.html for documentation.
|
||||
//
|
||||
|
||||
//
|
||||
// Stop inspect complaining about use of 'assert':
|
||||
//
|
||||
// boostinspect:naassert_macro
|
||||
//
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_ASSERT //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#undef BOOST_ASSERT
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS)
|
||||
|
||||
# define BOOST_ASSERT(expr) ((void)0)
|
||||
|
||||
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
void assertion_failed(char const * expr,
|
||||
char const * function, char const * file, long line); // user defined
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_ASSERT(expr) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
|
||||
#else
|
||||
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
|
||||
# define BOOST_ASSERT(expr) assert(expr)
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_ASSERT_MSG //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
# undef BOOST_ASSERT_MSG
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG)
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((void)0)
|
||||
|
||||
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
void assertion_failed_msg(char const * expr, char const * msg,
|
||||
char const * function, char const * file, long line); // user defined
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
|
||||
#else
|
||||
#ifndef BOOST_ASSERT_HPP
|
||||
#define BOOST_ASSERT_HPP
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
// IDE's like Visual Studio perform better if output goes to std::cout or
|
||||
// some other stream, so allow user to configure output stream:
|
||||
#ifndef BOOST_ASSERT_MSG_OSTREAM
|
||||
# define BOOST_ASSERT_MSG_OSTREAM std::cerr
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace assertion
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
inline void assertion_failed_msg(char const * expr, char const * msg, char const * function,
|
||||
char const * file, long line)
|
||||
{
|
||||
BOOST_ASSERT_MSG_OSTREAM
|
||||
<< "***** Internal Program Error - assertion (" << expr << ") failed in "
|
||||
<< function << ":\n"
|
||||
<< file << '(' << line << "): " << msg << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
} // detail
|
||||
} // assertion
|
||||
} // detail
|
||||
#endif
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \
|
||||
BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_VERIFY //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#undef BOOST_VERIFY
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
|
||||
|
||||
# define BOOST_VERIFY(expr) ((void)(expr))
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
|
||||
|
||||
#endif
|
|
@ -0,0 +1,24 @@
|
|||
// Boost.Assign library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/assign/
|
||||
//
|
||||
|
||||
|
||||
#ifndef BOOST_ASSIGN_HPP
|
||||
#define BOOST_ASSIGN_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/assign/std.hpp>
|
||||
#include <boost/assign/list_of.hpp>
|
||||
#include <boost/assign/list_inserter.hpp>
|
||||
#include <boost/assign/assignment_exception.hpp>
|
||||
|
||||
#endif
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef BOOST_ATOMIC_HPP
|
||||
#define BOOST_ATOMIC_HPP
|
||||
|
||||
// Copyright (c) 2011 Helge Bahmann
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// This header includes all Boost.Atomic public headers
|
||||
|
||||
#include <boost/atomic/atomic.hpp>
|
||||
|
||||
#ifdef BOOST_ATOMIC_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,19 @@
|
|||
// Boost.Bimap
|
||||
//
|
||||
// Copyright (c) 2006-2007 Matias Capeletto
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See www.boost.org/libs/bimap for documentation.
|
||||
|
||||
// Convenience header
|
||||
|
||||
#include <boost/bimap/bimap.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
using ::boost::bimaps::bimap;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef BOOST_BIND_HPP_INCLUDED
|
||||
#define BOOST_BIND_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// bind.hpp - binds function objects to arguments
|
||||
//
|
||||
// Copyright (c) 2009 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_BIND_HPP_INCLUDED
|
|
@ -0,0 +1,106 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// boost blank.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_BLANK_HPP
|
||||
#define BOOST_BLANK_HPP
|
||||
|
||||
#include "boost/blank_fwd.hpp"
|
||||
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
#include <iosfwd> // for std::basic_ostream forward declare
|
||||
#include "boost/detail/templated_streams.hpp"
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
#include "boost/mpl/bool.hpp"
|
||||
#include "boost/type_traits/is_empty.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
#include "boost/type_traits/is_stateless.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct blank
|
||||
{
|
||||
};
|
||||
|
||||
// type traits specializations
|
||||
//
|
||||
|
||||
template <>
|
||||
struct is_pod< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_empty< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_stateless< blank >
|
||||
: mpl::true_
|
||||
{
|
||||
};
|
||||
|
||||
// relational operators
|
||||
//
|
||||
|
||||
inline bool operator==(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator<=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator>=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator!=(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator<(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator>(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// streaming support
|
||||
//
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
|
||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
||||
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
||||
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
||||
, const blank&
|
||||
)
|
||||
{
|
||||
// (output nothing)
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_BLANK_HPP
|
|
@ -0,0 +1,22 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// boost blank_fwd.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_BLANK_FWD_HPP
|
||||
#define BOOST_BLANK_FWD_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct blank;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_BLANK_FWD_HPP
|
|
@ -0,0 +1,24 @@
|
|||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/utility for most recent version including documentation.
|
||||
|
||||
// See boost/detail/call_traits.hpp and boost/detail/ob_call_traits.hpp
|
||||
// for full copyright notices.
|
||||
|
||||
#ifndef BOOST_CALL_TRAITS_HPP
|
||||
#define BOOST_CALL_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
#include <boost/detail/ob_call_traits.hpp>
|
||||
#else
|
||||
#include <boost/detail/call_traits.hpp>
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CALL_TRAITS_HPP
|
|
@ -0,0 +1,107 @@
|
|||
// boost cast.hpp header file ----------------------------------------------//
|
||||
|
||||
// (C) Copyright Kevlin Henney and Dave Abrahams 1999.
|
||||
// Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/conversion for Documentation.
|
||||
|
||||
// Revision History
|
||||
// 23 JUn 05 numeric_cast removed and redirected to the new verion (Fernando Cacciola)
|
||||
// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included
|
||||
// <boost/limits.hpp> instead (the workaround did not
|
||||
// actually compile when BOOST_NO_LIMITS was defined in
|
||||
// any case, so we loose nothing). (John Maddock)
|
||||
// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never
|
||||
// worked with stock GCC; trying to get it to do that broke
|
||||
// vc-stlport.
|
||||
// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
|
||||
// Removed unused BOOST_EXPLICIT_TARGET macro. Moved
|
||||
// boost::detail::type to boost/type.hpp. Made it compile with
|
||||
// stock gcc again (Dave Abrahams)
|
||||
// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal
|
||||
// Review (Beman Dawes)
|
||||
// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams)
|
||||
// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC
|
||||
// (Dave Abrahams)
|
||||
// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams)
|
||||
// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes)
|
||||
// 27 Jun 00 More MSVC6 workarounds
|
||||
// 15 Jun 00 Add workarounds for MSVC6
|
||||
// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
|
||||
// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
|
||||
// 29 Dec 99 Change using declarations so usages in other namespaces work
|
||||
// correctly (Dave Abrahams)
|
||||
// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors
|
||||
// as suggested Darin Adler and improved by Valentin Bonnard.
|
||||
// 2 Sep 99 Remove controversial asserts, simplify, rename.
|
||||
// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast,
|
||||
// place in nested namespace.
|
||||
// 3 Aug 99 Initial version
|
||||
|
||||
#ifndef BOOST_CAST_HPP
|
||||
#define BOOST_CAST_HPP
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/assert.hpp>
|
||||
# include <typeinfo>
|
||||
# include <boost/type.hpp>
|
||||
# include <boost/limits.hpp>
|
||||
# include <boost/detail/select_type.hpp>
|
||||
|
||||
// It has been demonstrated numerous times that MSVC 6.0 fails silently at link
|
||||
// time if you use a template function which has template parameters that don't
|
||||
// appear in the function's argument list.
|
||||
//
|
||||
// TODO: Add this to config.hpp?
|
||||
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
|
||||
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
|
||||
# else
|
||||
# define BOOST_EXPLICIT_DEFAULT_TARGET
|
||||
# endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
// See the documentation for descriptions of how to choose between
|
||||
// static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
|
||||
|
||||
// polymorphic_cast --------------------------------------------------------//
|
||||
|
||||
// Runtime checked polymorphic downcasts and crosscasts.
|
||||
// Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
|
||||
// section 15.8 exercise 1, page 425.
|
||||
|
||||
template <class Target, class Source>
|
||||
inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
|
||||
{
|
||||
Target tmp = dynamic_cast<Target>(x);
|
||||
if ( tmp == 0 ) throw std::bad_cast();
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// polymorphic_downcast ----------------------------------------------------//
|
||||
|
||||
// BOOST_ASSERT() checked polymorphic downcast. Crosscasts prohibited.
|
||||
|
||||
// WARNING: Because this cast uses BOOST_ASSERT(), it violates
|
||||
// the One Definition Rule if used in multiple translation units
|
||||
// where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
|
||||
// NDEBUG are defined inconsistently.
|
||||
|
||||
// Contributed by Dave Abrahams
|
||||
|
||||
template <class Target, class Source>
|
||||
inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
|
||||
{
|
||||
BOOST_ASSERT( dynamic_cast<Target>(x) == x ); // detect logic error
|
||||
return static_cast<Target>(x);
|
||||
}
|
||||
|
||||
# undef BOOST_EXPLICIT_DEFAULT_TARGET
|
||||
|
||||
} // namespace boost
|
||||
|
||||
# include <boost/numeric/conversion/cast.hpp>
|
||||
|
||||
#endif // BOOST_CAST_HPP
|
|
@ -0,0 +1,331 @@
|
|||
// Boost cerrno.hpp header -------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2005.
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
#ifndef BOOST_CERRNO_HPP
|
||||
#define BOOST_CERRNO_HPP
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
// supply errno values likely to be missing, particularly on Windows
|
||||
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT 9901
|
||||
#endif
|
||||
|
||||
#ifndef EADDRINUSE
|
||||
#define EADDRINUSE 9902
|
||||
#endif
|
||||
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL 9903
|
||||
#endif
|
||||
|
||||
#ifndef EISCONN
|
||||
#define EISCONN 9904
|
||||
#endif
|
||||
|
||||
#ifndef EBADMSG
|
||||
#define EBADMSG 9905
|
||||
#endif
|
||||
|
||||
#ifndef ECONNABORTED
|
||||
#define ECONNABORTED 9906
|
||||
#endif
|
||||
|
||||
#ifndef EALREADY
|
||||
#define EALREADY 9907
|
||||
#endif
|
||||
|
||||
#ifndef ECONNREFUSED
|
||||
#define ECONNREFUSED 9908
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET 9909
|
||||
#endif
|
||||
|
||||
#ifndef EDESTADDRREQ
|
||||
#define EDESTADDRREQ 9910
|
||||
#endif
|
||||
|
||||
#ifndef EHOSTUNREACH
|
||||
#define EHOSTUNREACH 9911
|
||||
#endif
|
||||
|
||||
#ifndef EIDRM
|
||||
#define EIDRM 9912
|
||||
#endif
|
||||
|
||||
#ifndef EMSGSIZE
|
||||
#define EMSGSIZE 9913
|
||||
#endif
|
||||
|
||||
#ifndef ENETDOWN
|
||||
#define ENETDOWN 9914
|
||||
#endif
|
||||
|
||||
#ifndef ENETRESET
|
||||
#define ENETRESET 9915
|
||||
#endif
|
||||
|
||||
#ifndef ENETUNREACH
|
||||
#define ENETUNREACH 9916
|
||||
#endif
|
||||
|
||||
#ifndef ENOBUFS
|
||||
#define ENOBUFS 9917
|
||||
#endif
|
||||
|
||||
#ifndef ENOLINK
|
||||
#define ENOLINK 9918
|
||||
#endif
|
||||
|
||||
#ifndef ENODATA
|
||||
#define ENODATA 9919
|
||||
#endif
|
||||
|
||||
#ifndef ENOMSG
|
||||
#define ENOMSG 9920
|
||||
#endif
|
||||
|
||||
#ifndef ENOPROTOOPT
|
||||
#define ENOPROTOOPT 9921
|
||||
#endif
|
||||
|
||||
#ifndef ENOSR
|
||||
#define ENOSR 9922
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSOCK
|
||||
#define ENOTSOCK 9923
|
||||
#endif
|
||||
|
||||
#ifndef ENOSTR
|
||||
#define ENOSTR 9924
|
||||
#endif
|
||||
|
||||
#ifndef ENOTCONN
|
||||
#define ENOTCONN 9925
|
||||
#endif
|
||||
|
||||
#ifndef ENOTSUP
|
||||
#define ENOTSUP 9926
|
||||
#endif
|
||||
|
||||
#ifndef ECANCELED
|
||||
#define ECANCELED 9927
|
||||
#endif
|
||||
|
||||
#ifndef EINPROGRESS
|
||||
#define EINPROGRESS 9928
|
||||
#endif
|
||||
|
||||
#ifndef EOPNOTSUPP
|
||||
#define EOPNOTSUPP 9929
|
||||
#endif
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
#define EWOULDBLOCK 9930
|
||||
#endif
|
||||
|
||||
#ifndef EOWNERDEAD
|
||||
#define EOWNERDEAD 9931
|
||||
#endif
|
||||
|
||||
#ifndef EPROTO
|
||||
#define EPROTO 9932
|
||||
#endif
|
||||
|
||||
#ifndef EPROTONOSUPPORT
|
||||
#define EPROTONOSUPPORT 9933
|
||||
#endif
|
||||
|
||||
#ifndef ENOTRECOVERABLE
|
||||
#define ENOTRECOVERABLE 9934
|
||||
#endif
|
||||
|
||||
#ifndef ETIME
|
||||
#define ETIME 9935
|
||||
#endif
|
||||
|
||||
#ifndef ETXTBSY
|
||||
#define ETXTBSY 9936
|
||||
#endif
|
||||
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT 9938
|
||||
#endif
|
||||
|
||||
#ifndef ELOOP
|
||||
#define ELOOP 9939
|
||||
#endif
|
||||
|
||||
#ifndef EOVERFLOW
|
||||
#define EOVERFLOW 9940
|
||||
#endif
|
||||
|
||||
#ifndef EPROTOTYPE
|
||||
#define EPROTOTYPE 9941
|
||||
#endif
|
||||
|
||||
#ifndef ENOSYS
|
||||
#define ENOSYS 9942
|
||||
#endif
|
||||
|
||||
#ifndef EINVAL
|
||||
#define EINVAL 9943
|
||||
#endif
|
||||
|
||||
#ifndef ERANGE
|
||||
#define ERANGE 9944
|
||||
#endif
|
||||
|
||||
#ifndef EILSEQ
|
||||
#define EILSEQ 9945
|
||||
#endif
|
||||
|
||||
// Windows Mobile doesn't appear to define these:
|
||||
|
||||
#ifndef E2BIG
|
||||
#define E2BIG 9946
|
||||
#endif
|
||||
|
||||
#ifndef EDOM
|
||||
#define EDOM 9947
|
||||
#endif
|
||||
|
||||
#ifndef EFAULT
|
||||
#define EFAULT 9948
|
||||
#endif
|
||||
|
||||
#ifndef EBADF
|
||||
#define EBADF 9949
|
||||
#endif
|
||||
|
||||
#ifndef EPIPE
|
||||
#define EPIPE 9950
|
||||
#endif
|
||||
|
||||
#ifndef EXDEV
|
||||
#define EXDEV 9951
|
||||
#endif
|
||||
|
||||
#ifndef EBUSY
|
||||
#define EBUSY 9952
|
||||
#endif
|
||||
|
||||
#ifndef ENOTEMPTY
|
||||
#define ENOTEMPTY 9953
|
||||
#endif
|
||||
|
||||
#ifndef ENOEXEC
|
||||
#define ENOEXEC 9954
|
||||
#endif
|
||||
|
||||
#ifndef EEXIST
|
||||
#define EEXIST 9955
|
||||
#endif
|
||||
|
||||
#ifndef EFBIG
|
||||
#define EFBIG 9956
|
||||
#endif
|
||||
|
||||
#ifndef ENAMETOOLONG
|
||||
#define ENAMETOOLONG 9957
|
||||
#endif
|
||||
|
||||
#ifndef ENOTTY
|
||||
#define ENOTTY 9958
|
||||
#endif
|
||||
|
||||
#ifndef EINTR
|
||||
#define EINTR 9959
|
||||
#endif
|
||||
|
||||
#ifndef ESPIPE
|
||||
#define ESPIPE 9960
|
||||
#endif
|
||||
|
||||
#ifndef EIO
|
||||
#define EIO 9961
|
||||
#endif
|
||||
|
||||
#ifndef EISDIR
|
||||
#define EISDIR 9962
|
||||
#endif
|
||||
|
||||
#ifndef ECHILD
|
||||
#define ECHILD 9963
|
||||
#endif
|
||||
|
||||
#ifndef ENOLCK
|
||||
#define ENOLCK 9964
|
||||
#endif
|
||||
|
||||
#ifndef ENOSPC
|
||||
#define ENOSPC 9965
|
||||
#endif
|
||||
|
||||
#ifndef ENXIO
|
||||
#define ENXIO 9966
|
||||
#endif
|
||||
|
||||
#ifndef ENODEV
|
||||
#define ENODEV 9967
|
||||
#endif
|
||||
|
||||
#ifndef ENOENT
|
||||
#define ENOENT 9968
|
||||
#endif
|
||||
|
||||
#ifndef ESRCH
|
||||
#define ESRCH 9969
|
||||
#endif
|
||||
|
||||
#ifndef ENOTDIR
|
||||
#define ENOTDIR 9970
|
||||
#endif
|
||||
|
||||
#ifndef ENOMEM
|
||||
#define ENOMEM 9971
|
||||
#endif
|
||||
|
||||
#ifndef EPERM
|
||||
#define EPERM 9972
|
||||
#endif
|
||||
|
||||
#ifndef EACCES
|
||||
#define EACCES 9973
|
||||
#endif
|
||||
|
||||
#ifndef EROFS
|
||||
#define EROFS 9974
|
||||
#endif
|
||||
|
||||
#ifndef EDEADLK
|
||||
#define EDEADLK 9975
|
||||
#endif
|
||||
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN 9976
|
||||
#endif
|
||||
|
||||
#ifndef ENFILE
|
||||
#define ENFILE 9977
|
||||
#endif
|
||||
|
||||
#ifndef EMFILE
|
||||
#define EMFILE 9978
|
||||
#endif
|
||||
|
||||
#ifndef EMLINK
|
||||
#define EMLINK 9979
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
|
||||
#define BOOST_CHECKED_DELETE_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/checked_delete.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov
|
||||
// Copyright (c) 2003 Daniel Frey
|
||||
// Copyright (c) 2003 Howard Hinnant
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/utility/checked_delete.html for documentation.
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// verify that types are complete for increased safety
|
||||
|
||||
template<class T> inline void checked_delete(T * x)
|
||||
{
|
||||
// intentionally complex - simplification causes regressions
|
||||
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
|
||||
(void) sizeof(type_must_be_complete);
|
||||
delete x;
|
||||
}
|
||||
|
||||
template<class T> inline void checked_array_delete(T * x)
|
||||
{
|
||||
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
|
||||
(void) sizeof(type_must_be_complete);
|
||||
delete [] x;
|
||||
}
|
||||
|
||||
template<class T> struct checked_deleter
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef T * argument_type;
|
||||
|
||||
void operator()(T * x) const
|
||||
{
|
||||
// boost:: disables ADL
|
||||
boost::checked_delete(x);
|
||||
}
|
||||
};
|
||||
|
||||
template<class T> struct checked_array_deleter
|
||||
{
|
||||
typedef void result_type;
|
||||
typedef T * argument_type;
|
||||
|
||||
void operator()(T * x) const
|
||||
{
|
||||
boost::checked_array_delete(x);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue