mirror of
https://github.com/libretro/parallel-n64.git
synced 2026-11-07 18:37:22 -10:00
Remove unused code/files
This commit is contained in:
1 parent
4774b11fde
commit
525ffacb68
25 files changed
-4475
No files matched your search
@@ -1,26 +0,0 @@
|
||||
Mupen64Plus-Core INSTALL
|
||||
------------------------
|
||||
|
||||
This text file was written to explain the installation process of the
|
||||
Mupen64Plus-Core module.
|
||||
|
||||
If this module is part of a Mupen64Plus source code bundle, the user should run
|
||||
the "m64p_install.sh" script in the root of the unzipped bundle to install all
|
||||
of the included modules in the bundle.
|
||||
|
||||
If this module is a standalone source code release, you should build the library
|
||||
from source code and install it via the makefile, like this:
|
||||
|
||||
$ cd projects/unix
|
||||
$ make all
|
||||
$ sudo make install
|
||||
|
||||
If you want to build the Mupen64Plus-Core module for installation in a home
|
||||
folder for a single user, you may build it like this (replacing <my-folder>
|
||||
with your desired local installation path):
|
||||
|
||||
$ cd projects/unix
|
||||
$ make all SHAREDIR=<my-folder>
|
||||
$ make install LIBDIR=<my-folder> SHAREDIR=<my-folder>
|
||||
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
Mupen64Plus-Core README
|
||||
-----------------------
|
||||
|
||||
The most current version of this README and more documentation can be found on
|
||||
the Mupen64Plus wiki:
|
||||
|
||||
http://code.google.com/p/mupen64plus/wiki/README
|
||||
|
||||
Mupen64Plus is based off of mupen64, originally created by Hacktarux. This
|
||||
package contains the only the Mupen64Plus core library. For a fully functional
|
||||
emulator, the user must also install graphics, sound, input, and RSP plugins,
|
||||
as well as a user interface program (called a front-end).
|
||||
|
||||
README Sections
|
||||
1. Requirements for building or running Mupen64Plus
|
||||
2. Building From Source
|
||||
3. Installation
|
||||
4. Key Commands In Emulator
|
||||
|
||||
1. Requirements and Pre-requisites
|
||||
----------------------------------
|
||||
|
||||
*Binary Package Requirements*
|
||||
|
||||
- SDL 1.2
|
||||
- libpng
|
||||
- freetype 2
|
||||
- zlib
|
||||
|
||||
*Source Build Requirements*
|
||||
|
||||
In addition to the binary libraries, the following packages are required if you
|
||||
build Mupen64Plus from source:
|
||||
|
||||
- GNU C and C++ compiler, libraries, and headers
|
||||
- GNU make
|
||||
- Development packages for all the libraries above
|
||||
|
||||
2. Building From Source
|
||||
-----------------------
|
||||
|
||||
If you downloaded the binary distribution of Mupen64Plus, skip to the
|
||||
Installation section. To build the source distribution, unzip and cd into the
|
||||
projects/unix directory, then build using make:
|
||||
|
||||
$ unzip mupen64plus-core-x-y-z-src.zip
|
||||
$ cd mupen64plus-core-x-y-z-src/projects/unix
|
||||
$ make all
|
||||
|
||||
Type 'make' by itself to view all available build options:
|
||||
|
||||
$ make
|
||||
Mupen64Plus makefile.
|
||||
Targets:
|
||||
all == Build Mupen64Plus and all plugins
|
||||
clean == remove object files
|
||||
install == Install Mupen64Plus and all plugins
|
||||
uninstall == Uninstall Mupen64Plus and all plugins
|
||||
Options:
|
||||
BITS=32 == build 32-bit binaries on 64-bit machine
|
||||
LIRC=1 == enable LIRC support
|
||||
NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code)
|
||||
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
|
||||
Install Options:
|
||||
PREFIX=path == install/uninstall prefix (default: /usr/local/)
|
||||
SHAREDIR=path == path to install shared data (default: PREFIX/share/mupen64plus/)
|
||||
LIBDIR=path == path to install plugin libs (default: PREFIX/lib)
|
||||
INCDIR=path == path to install core header files (default: PREFIX/include/mupen64plus)
|
||||
DESTDIR=path == path to prepend to all installation paths (only for packagers)
|
||||
Debugging Options:
|
||||
PROFILE=1 == build gprof instrumentation into binaries for profiling
|
||||
DEBUG=1 == add debugging symbols to binaries
|
||||
DEBUGGER=1 == build graphical debugger
|
||||
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_PROFILE=1 == dump profiling data for r4300 dynarec to data file
|
||||
V=1 == show verbose compiler output
|
||||
|
||||
3. Installation
|
||||
---------------
|
||||
|
||||
*Binary Distribution*
|
||||
|
||||
To install the binary distribution of Mupen64Plus, su to root and run the
|
||||
provided install.sh script:
|
||||
|
||||
$ su
|
||||
# ./install.sh
|
||||
# exit
|
||||
$
|
||||
|
||||
The install script will copy the executable to /usr/local/bin and a directory
|
||||
called /usr/local/share/mupen64plus will be created to hold plugins and other
|
||||
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).
|
||||
|
||||
*Source Distribution*
|
||||
|
||||
After building mupen64plus and all plugins, su to root and type 'make install'
|
||||
to install Mupen64Plus. The install process will copy the executable to
|
||||
$PREFIX/bin and a directory called $PREFIX/share/mupen64plus will be created
|
||||
to hold plugins and other files used by mupen64plus. By default, PREFIX is set
|
||||
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
|
||||
$ sudo make PREFIX=/usr install
|
||||
$
|
||||
|
||||
4. Key Commands In Emulator
|
||||
---------------------------
|
||||
The keys or joystick/mouse inputs which will be mapped to the N64 controller
|
||||
for playing the games are determined by the input plugin. The emulator core
|
||||
also supports several key commands during emulation, which may be configured by
|
||||
editing the ~/.config/mupen64plus/mupen64plus.cfg file. They are:
|
||||
|
||||
Escape == Quit the emulator
|
||||
0-9 == Select virtual 'slot' for save/load state (F5 and F7) commands
|
||||
F5 == Save emulator state
|
||||
F7 == Load emulator state
|
||||
F9 == Reset emulator
|
||||
F10 == slow down emulator by 5%
|
||||
F11 == speed up emulator by 5%
|
||||
F12 == take screenshot
|
||||
Alt-Enter == Toggle between windowed and fullscreen (may not be supported by all video plugins)
|
||||
p or P == Pause on/off
|
||||
m or M == Mute/unmute sound
|
||||
g or G == Press "Game Shark" button (only if cheats are enabled)
|
||||
/ or ? == single frame advance while paused
|
||||
F == Fast Forward (playback at 250% normal speed while F key is pressed)
|
||||
[ == Decrease volume
|
||||
] == Increase volume
|
||||
|
||||
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Core Parameters =
|
||||
|
||||
These are standard parameters which are used by the Mupen64Plus Core library. They are stored in a configuration section called "Core" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately.
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Version
|
||||
|M64TYPE_FLOAT
|
||||
|Mupen64Plus Core config parameter set version number. Please don't change.
|
||||
|-
|
||||
|OnScreenDisplay
|
||||
|M64TYPE_BOOL
|
||||
|Draw on-screen display if True, otherwise don't draw OSD
|
||||
|-
|
||||
|R4300Emulator
|
||||
|M64TYPE_INT
|
||||
|Use Pure Interpreter if 0, Cached Interpreter if 1, or Dynamic Recompiler if 2 or more
|
||||
|-
|
||||
|NoCompiledJump
|
||||
|M64TYPE_BOOL
|
||||
|Disable compiled jump commands in dynamic recompiler (should be set to False)
|
||||
|-
|
||||
|DisableExtraMem
|
||||
|M64TYPE_BOOL
|
||||
|Disable 4MB expansion RAM pack. May be necessary for some games.
|
||||
|-
|
||||
|AutoStateSlotIncrement
|
||||
|M64TYPE_BOOL
|
||||
|Increment the save state slot after each save operation.
|
||||
|-
|
||||
|EnableDebugger
|
||||
|M64TYPE_BOOL
|
||||
|Activate the R4300 debugger when ROM execution begins, if core was built with Debugger support.
|
||||
|-
|
||||
|CurrentStateSlot
|
||||
|M64TYPE_INT
|
||||
|Save state slot (0-9) to use when saving/loading the emulator state
|
||||
|-
|
||||
|ScreenshotPath
|
||||
|M64TYPE_STRING
|
||||
|Path to directory where screenshots are saved. If this is blank, the default value of "<tt>GetConfigUserDataPath()</tt>"/screenshot will be used.
|
||||
|-
|
||||
|SaveStatePath
|
||||
|M64TYPE_STRING
|
||||
|Path to directory where emulator save states (snapshots) are saved. If this is blank, the default value of "<tt>GetConfigUserDataPath()</tt>"/save will be used.
|
||||
|-
|
||||
|SaveSRAMPath
|
||||
|M64TYPE_STRING
|
||||
|Path to directory where SRAM/EEPROM data (in-game saves) are stored. If this is blank, the default value of "<tt>GetConfigUserDataPath()</tt>"/save will be used.
|
||||
|-
|
||||
|SharedDataPath
|
||||
|M64TYPE_STRING
|
||||
|Path to a directory to search when looking for shared data files in the <tt>ConfigGetSharedDataFilepath()</tt> function.
|
||||
|-
|
||||
|CountPerOp
|
||||
|M64TYPE_INT
|
||||
|Force number of cycles per emulated instruction when set greater than 0.
|
||||
|-
|
||||
|DelaySI
|
||||
|M64TYPE_BOOL
|
||||
|Delay interrupt after DMA SI read/write.
|
||||
|-
|
||||
|}
|
||||
|
||||
These configuration parameters are used in the Core's event loop to detect keyboard and joystick commands. They are stored in a configuration section called "CoreEvents" and may be altered by the front-end in order to adjust the behaviour of the emulator. These may be adjusted at any time and the effect of the change should occur immediately. The Keysym value stored is actually <tt>(SDLMod << 16) || SDLKey</tt>, so that keypresses with modifiers like shift, control, or alt may be used.
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Kbd Mapping Stop
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for stopping the emulator
|
||||
|-
|
||||
|Kbd Mapping Fullscreen
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for switching between fullscreen/windowed modes
|
||||
|-
|
||||
|Kbd Mapping Save State
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for saving the emulator state
|
||||
|-
|
||||
|Kbd Mapping Load State
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for loading the emulator state
|
||||
|-
|
||||
|Kbd Mapping Increment Slot
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for advancing the save state slot
|
||||
|-
|
||||
|Kbd Mapping Reset
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for resetting the emulator
|
||||
|-
|
||||
|Kbd Mapping Speed Down
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for slowing down the emulator
|
||||
|-
|
||||
|Kbd Mapping Speed Up
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for speeding up the emulator
|
||||
|-
|
||||
|Kbd Mapping Screenshot
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for taking a screenshot
|
||||
|-
|
||||
|Kbd Mapping Pause
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for pausing the emulator
|
||||
|-
|
||||
|Kbd Mapping Mute
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for muting/unmuting the sound
|
||||
|-
|
||||
|Kbd Mapping Increase Volume
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for increasing the volume
|
||||
|-
|
||||
|Kbd Mapping Decrease Volume
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for decreasing the volume
|
||||
|-
|
||||
|Kbd Mapping Fast Forward
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for temporarily going really fast
|
||||
|-
|
||||
|Kbd Mapping Frame Advance
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for advancing by one frame when paused
|
||||
|-
|
||||
|Kbd Mapping Gameshark
|
||||
|M64TYPE_INT
|
||||
|SDL keysym for pressing the game shark button
|
||||
|-
|
||||
|}
|
||||
|
||||
These configuration parameters are used in the Core's event loop to detect joystick commands.
|
||||
|
||||
The command strings use a simple format described here. For commands activated by pressing a joystick axis, the format is "J'''x'''A'''y'''+" or "J'''x'''A'''y'''-", where '''x''' is the SDL joystick number (must be between 0 and 9) and '''y''' is the axis number. For the last character, '''+''' represents movement in the positive direction, while '''-''' represents movement in the negative direction. For commands activated by pressing a button, the format is "J'''x'''B'''y'''", where '''x''' is the SDL joystick number (must be between 0 and 9) and '''y''' is the button number. For commands activated by pressing a ''hat'' (a directional switch) on the joystick, the format is "J'''x'''H'''y'''V'''z'''", where '''x''' is the SDL joystick number (must be between 0 and 9), '''y''' is the hat number, and '''z''' is the hat value. The hat value corresponds with the SDL_HAT_ enumerated types: Up is 1, Right is 2, Down is 4, and Left is 8. For diagonal directions, these values may be ''or''d together.
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Version
|
||||
|M64TYPE_FLOAT
|
||||
|Mupen64Plus CoreEvents config parameter set version number. Please don't change.
|
||||
|-
|
||||
|Joy Mapping Stop
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for stopping the emulator
|
||||
|-
|
||||
|Joy Mapping Fullscreen
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for switching between fullscreen/windowed modes
|
||||
|-
|
||||
|Joy Mapping Save State
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for saving the emulator state
|
||||
|-
|
||||
|Joy Mapping Load State
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for loading the emulator state
|
||||
|-
|
||||
|Joy Mapping Increment Slot
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for advancing the save state slot
|
||||
|-
|
||||
|Joy Mapping Screenshot
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for taking a screenshot
|
||||
|-
|
||||
|Joy Mapping Pause
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for pausing or resuming the emulator
|
||||
|-
|
||||
|Joy Mapping Mute
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for muting/unmuting the sound
|
||||
|-
|
||||
|Joy Mapping Increase Volume
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for increasing the volume
|
||||
|-
|
||||
|Joy Mapping Decrease Volume
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for decreasing the volume
|
||||
|-
|
||||
|Joy Mapping Fast Forward
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for temporarily going really fast
|
||||
|-
|
||||
|Joy Mapping Gameshark
|
||||
|M64TYPE_STRING
|
||||
|Joystick event string for pressing the game shark button
|
||||
|-
|
||||
|}
|
||||
|
||||
@@ -1,403 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Plugin Parameters =
|
||||
|
||||
These are standard parameters which are used by the Mupen64Plus plugins. The behavior of the plugin library when these parameters are changed while the emulator is running is not defined here. Some plugins will load the parameters when starting and store internal copies of the parameters for use during emulation. Other plugins may read the value of the parameters while running.
|
||||
|
||||
=== Audio-SDL ===
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Version
|
||||
|M64TYPE_FLOAT
|
||||
|Mupen64Plus Audio SDL config parameter set version number. Please don't change.
|
||||
|-
|
||||
|DEFAULT_FREQUENCY
|
||||
|M64TYPE_INT
|
||||
|Frequency which is used if rom doesn't want to change it
|
||||
|-
|
||||
|SWAP_CHANNELS
|
||||
|M64TYPE_BOOL
|
||||
|Swaps left and right channels
|
||||
|-
|
||||
|PRIMARY_BUFFER_SIZE
|
||||
|M64TYPE_INT
|
||||
|Size of primary buffer in output samples. This is where audio is loaded after it's extracted from n64's memory.
|
||||
|-
|
||||
|PRIMARY_BUFFER_TARGET
|
||||
|M64TYPE_INT
|
||||
|Fullness level target for Primary audio buffer, in equivalent output samples.
|
||||
|-
|
||||
|SECONDARY_BUFFER_SIZE
|
||||
|M64TYPE_INT
|
||||
|Size of secondary buffer in samples. This is SDL's hardware buffer.
|
||||
|-
|
||||
|RESAMPLE
|
||||
|M64TYPE_STRING
|
||||
|Audio resampling algorithm. "trivial" for fastest, lowest-quality algorithm. If compiled with SPEEX support, this can be "speex-fixed-0" to "speex-fixed-10". If compiled with libsrc support, this can be "src-sinc-best-quality", "src-sinc-medium-quality", "src-sinc-fastest", "src-zero-order-hold", or "src-linear".
|
||||
|-
|
||||
|VOLUME_CONTROL_TYPE
|
||||
|M64TYPE_INT
|
||||
|Volume control type: 1 = SDL (only affects Mupen64Plus output) 2 = OSS mixer (adjusts master PC volume)
|
||||
|-
|
||||
|VOLUME_ADJUST
|
||||
|M64TYPE_INT
|
||||
|Percentage change each time the volume is increased or decreased
|
||||
|-
|
||||
|VOLUME_DEFAULT
|
||||
|M64TYPE_INT
|
||||
|Default volume when a game is started. Only used if VOLUME_CONTROL_TYPE is 1
|
||||
|-
|
||||
|}
|
||||
|
||||
=== Video-General ===
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Fullscreen
|
||||
|M64TYPE_BOOL
|
||||
|Use fullscreen mode if True, or windowed mode if False
|
||||
|-
|
||||
|ScreenWidth
|
||||
|M64TYPE_INT
|
||||
|Width of output window or fullscreen width
|
||||
|-
|
||||
|ScreenHeight
|
||||
|M64TYPE_INT
|
||||
|Height of output window or fullscreen height
|
||||
|-
|
||||
|}
|
||||
|
||||
=== Video-Rice ===
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|FrameBufferSetting
|
||||
|M64TYPE_INT
|
||||
|Frame Buffer Emulation (0=ROM default, 1=disable)
|
||||
|-
|
||||
|FrameBufferWriteBackControl
|
||||
|M64TYPE_INT
|
||||
|Frequency to write back the frame buffer (0=every frame, 1=every other frame, etc)
|
||||
|-
|
||||
|RenderToTexture
|
||||
|M64TYPE_INT
|
||||
|Render-to-texture emulation (0=none, 1=ignore, 2=normal, 3=write back, 4=write back and reload)
|
||||
|-
|
||||
|ScreenUpdateSetting
|
||||
|M64TYPE_INT
|
||||
|Control when the screen will be updated (0=ROM default, 1=VI origin update, 2=VI origin change, 3=CI change, 4=first CI change, 5=first primitive draw, 6=before screen clear, 7=after screen drawn)
|
||||
|-
|
||||
|NormalAlphaBlender
|
||||
|M64TYPE_BOOL
|
||||
|Force to use normal alpha blender
|
||||
|-
|
||||
|FastTextureLoading
|
||||
|M64TYPE_BOOL
|
||||
|Use a faster algorithm to speed up texture loading and CRC computation (may break hi-res texture loading)
|
||||
|-
|
||||
|AccurateTextureMapping
|
||||
|M64TYPE_BOOL
|
||||
|Use different texture coordinate clamping code
|
||||
|-
|
||||
|InN64Resolution
|
||||
|M64TYPE_BOOL
|
||||
|Force emulated frame buffers to be in N64 native resolution
|
||||
|-
|
||||
|SaveVRAM
|
||||
|M64TYPE_BOOL
|
||||
|Try to reduce Video RAM usage (should never be used)
|
||||
|-
|
||||
|DoubleSizeForSmallTxtrBuf
|
||||
|M64TYPE_BOOL
|
||||
|Enable this option to have better render-to-texture quality
|
||||
|-
|
||||
|DefaultCombinerDisable
|
||||
|M64TYPE_BOOL
|
||||
|Force to use normal color combiner
|
||||
|-
|
||||
|EnableHacks
|
||||
|M64TYPE_BOOL
|
||||
|Enable game-specific settings from INI file
|
||||
|-
|
||||
|EnableFog
|
||||
|M64TYPE_BOOL
|
||||
|Enable or disable fog generation
|
||||
|-
|
||||
|WinFrameMode
|
||||
|M64TYPE_BOOL
|
||||
|If enabled, graphics will be drawn in WinFrame mode instead of solid and texture mode
|
||||
|-
|
||||
|FullTMEMEmulation
|
||||
|M64TYPE_BOOL
|
||||
|N64 Texture Memory Full Emulation (may fix some games, may break others)
|
||||
|-
|
||||
|OpenGLVertexClipper
|
||||
|M64TYPE_BOOL
|
||||
|Enable vertex clipper for fog operations
|
||||
|-
|
||||
|EnableSSE
|
||||
|M64TYPE_BOOL
|
||||
|Enable SSE optimizations for capable CPUs
|
||||
|-
|
||||
|EnableVertexShader
|
||||
|M64TYPE_BOOL
|
||||
|Use GPU vertex shader
|
||||
|-
|
||||
|SkipFrame
|
||||
|M64TYPE_BOOL
|
||||
|If this option is enabled, the plugin will skip every other frame
|
||||
|-
|
||||
|TexRectOnly
|
||||
|M64TYPE_BOOL
|
||||
|If enabled, texture enhancement will be done only for TxtRect ucode
|
||||
|-
|
||||
|SmallTextureOnly
|
||||
|M64TYPE_BOOL
|
||||
|If enabled, texture enhancement will be done only for textures width+height<=128
|
||||
|-
|
||||
|LoadHiResTextures
|
||||
|M64TYPE_BOOL
|
||||
|Enable hi-resolution texture file loading
|
||||
|-
|
||||
|LoadHiResCRCOnly
|
||||
|M64TYPE_BOOL
|
||||
|Filter hi-resolution texture filenames based only on the CRC and ignore format+size tags (Glide64 compatibility)
|
||||
|-
|
||||
|DumpTexturesToFiles
|
||||
|M64TYPE_BOOL
|
||||
|Enable texture dumping
|
||||
|-
|
||||
|ShowFPS
|
||||
|M64TYPE_BOOL
|
||||
|Display On-screen FPS
|
||||
|-
|
||||
|FogMethod
|
||||
|M64TYPE_INT
|
||||
|Enable, Disable or Force fog generation (0=Disable, 1=Enable n64 choose, 2=Force Fog)
|
||||
|-
|
||||
|Mipmapping
|
||||
|M64TYPE_INT
|
||||
|Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear
|
||||
|-
|
||||
|MultiSampling
|
||||
|M64TYPE_INT
|
||||
|Enable/Disable MultiSampling (0=off, 2,4,8,16=quality)
|
||||
|-
|
||||
|TextureEnhancement
|
||||
|M64TYPE_INT
|
||||
|Primary texture filter (0=None, 1=2X, 2=2XSAI, 3=HQ2X, 4=LQ2X, 5=HQ4X, 6=Sharpen, 7=Sharpen More, 8=External, 9=Mirrored)
|
||||
|-
|
||||
|TextureEnhancementControl
|
||||
|M64TYPE_INT
|
||||
|Secondary texture filter (0 = none, 1-4 = filtered)
|
||||
|-
|
||||
|ForceTextureFilter
|
||||
|M64TYPE_INT
|
||||
|Force to use texture filtering or not (0=auto: n64 choose, 1=force no filtering, 2=force filtering)
|
||||
|-
|
||||
|TextureQuality
|
||||
|M64TYPE_INT
|
||||
|Color bit depth to use for textures (0=default, 1=32 bits, 2=16 bits
|
||||
|-
|
||||
|OpenGLDepthBufferSetting
|
||||
|M64TYPE_INT
|
||||
|Z-buffer depth (only 16 or 32)
|
||||
|-
|
||||
|ColorQuality
|
||||
|M64TYPE_INT
|
||||
|Color bit depth for rendering window (0=32 bits, 1=16 bits)
|
||||
|-
|
||||
|OpenGLRenderSetting
|
||||
|M64TYPE_INT
|
||||
|OpenGL rendering level to support (0=auto, 1=OGL_1.1, 2=OGL_1.2, 3=OGL_1.3, 4=OGL_1.4, 5=OGL_1.4_V2, 6=OGL_TNT2, 7=NVIDIA_OGL, 8=OGL_FRAGMENT_PROGRAM)
|
||||
|-
|
||||
|AnisotropicFiltering
|
||||
|M64TYPE_INT
|
||||
|Enable/Disable Anisotropic Filtering for Mipmapping (0=no filtering, 2-16=quality). This is uneffective if EnableMipmapping is false. If the given value is to high to be supported by your graphic card, the value will be the highest value your graphic card can support. Better result with Trilinear filtering
|
||||
|}
|
||||
|
||||
=== Input-SDL ===
|
||||
|
||||
The Mupen64Plus-Input-SDL plugin uses a separate config section for each simulated N64 controller. The sections are named: <tt>Input-SDL-Control1</tt>, <tt>Input-SDL-Control2</tt>, <tt>Input-SDL-Control3</tt>, and <tt>Input-SDL-Control4</tt>. The 4 sections all contain the same parameters.
|
||||
|
||||
<b>General-purpose Controller Configuration Parameters</b>
|
||||
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|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
|
||||
|-
|
||||
|plugin
|
||||
|M64TYPE_INT
|
||||
|Specifies which type of expansion pak is in the controller: 1=None, 2=Mem pak, 5=Rumble pak
|
||||
|-
|
||||
|mouse
|
||||
|M64TYPE_BOOL
|
||||
|If True, then mouse buttons may be used with this controller, and mouse movement will map to X/Y analog stick
|
||||
|-
|
||||
|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.
|
||||
|-
|
||||
|AnalogDeadzone
|
||||
|M64TYPE_STRING
|
||||
|The minimum absolute value of the SDL analog joystick axis to move the N64 controller axis value from 0. For X, Y axes.
|
||||
|-
|
||||
|AnalogPeak
|
||||
|M64TYPE_STRING
|
||||
|An absolute value of the SDL joystick axis >= AnalogPeak will saturate the N64 controller axis value (at 80). For X, Y axes. For each axis, this must be greater than the corresponding AnalogDeadzone value
|
||||
|-
|
||||
|}
|
||||
|
||||
<b>Digital Controller Configuration</b>
|
||||
These parameters are used to bind input events with N64 Controller button presses. There are 14 simulated buttons and 2 special buttons for switching between the Mem Pak and Rumble Pak expansion units. Each configuration parameter is a string which specifies input events which will map to the given N64 button. The configuration strings consist of zero or more input event words. A list of available input event words is given here:
|
||||
|
||||
{| border="1"
|
||||
!Input Event Word!!Usage
|
||||
|-
|
||||
|<tt>key(<keysym>)</tt>
|
||||
|<keysym> = SDLK_* key symbol enumerated type
|
||||
|-
|
||||
|<tt>button(<num>)</tt>
|
||||
|<num> = SDL Joystick Button Number (0 or greater)
|
||||
|-
|
||||
|<tt>axis(<num><dir>)</tt>
|
||||
|<num> = SDL Joystick Axis Number, <dir> = axis direction (+ = positive, - = negative)
|
||||
|-
|
||||
|<tt>axis(<num><dir>,<deadzone>)</tt>
|
||||
|<num> = SDL Joystick Axis Number, <dir> = axis direction (+ = positive, - = negative), <deadzone> = minimum axis value (max 32767) to activate button; default 6000
|
||||
|-
|
||||
|<tt>hat(<num> <dir>)</tt>
|
||||
|<num> = SDL Joystick Hat Number, <dir> = hat direction (Up, Down, Left, or Right)
|
||||
|-
|
||||
|<tt>mouse(<num>)</tt>
|
||||
|<num> = mouse button number (1 = left button, 2 = middle, 3 = right, etc)
|
||||
|-
|
||||
|}
|
||||
|
||||
<br>
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|DPad R
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Right button on the D-pad
|
||||
|-
|
||||
|DPad L
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Left button on the D-pad
|
||||
|-
|
||||
|DPad D
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Down button on the D-pad
|
||||
|-
|
||||
|DPad U
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Up button on the D-pad
|
||||
|-
|
||||
|Start
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Start button
|
||||
|-
|
||||
|Z Trig
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Z trigger
|
||||
|-
|
||||
|B Button
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the "B" button
|
||||
|-
|
||||
|A Button
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the "A" button
|
||||
|-
|
||||
|C Button R
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Right "C" button
|
||||
|-
|
||||
|C Button L
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Left "C" button
|
||||
|-
|
||||
|C Button D
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Down "C" button
|
||||
|-
|
||||
|C Button U
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Up "C" button
|
||||
|-
|
||||
|R Trig
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Right trigger
|
||||
|-
|
||||
|L Trig
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Left trigger
|
||||
|-
|
||||
|Mempak switch
|
||||
|M64TYPE_STRING
|
||||
|Input event string for toggling the Memory Pak unit
|
||||
|-
|
||||
|Rumblepak switch
|
||||
|M64TYPE_STRING
|
||||
|Input event string for toggling the Rumble Pak unit
|
||||
|-
|
||||
|}
|
||||
|
||||
<b>Analog Controller Configuration</b>
|
||||
These parameters are used to bind input events with N64 Controller analog stick movements. There are only 2 analog stick axes, X and Y. Each configuration parameter is a string which specifies input events which will map to the given N64 controller axis movement. The configuration strings consist of zero or more input event words. A list of available input event words is given here:
|
||||
|
||||
{| border="1"
|
||||
!Input Event Word!!Usage
|
||||
|-
|
||||
|<tt>key(<key_a>,<key_b>)</tt>
|
||||
|<key_a> = SDLK_* key symbol for up/left movement. <key_b> = SDLK_* key symbol for down/right movement. The strength of these movements can be modulated with the Left-Shift and Left-Control keys.
|
||||
|-
|
||||
|<tt>button(<num_a>,<num_b>)</tt>
|
||||
|<num_a> = SDL Joystick Button Number for up/left movement. <num_b> = SDL Joystick Button Number for down/right movement.
|
||||
|-
|
||||
|<tt>axis(<num_a><dir_a>,<num_b><dir_b>)</tt>
|
||||
|<num_a> = SDL Joystick Axis Number for up/left movement, <dir_a> = axis direction for up/left movement (+ = positive, - = negative). <num_b> = SDL Joystick Axis Number for down/right movement, <dir_b> = axis direction for down/right movement.
|
||||
|-
|
||||
|<tt>hat(<num> <dir_a> <dir_b>)</tt>
|
||||
|<num> = SDL Joystick Hat Number, <dir_a> = hat direction for up/left movement (Up, Down, Left, or Right), <dir_b> = hat direction for right/down movement
|
||||
|-
|
||||
|}
|
||||
|
||||
<br>
|
||||
{| border="1"
|
||||
!Parameter Name!!Type!!Usage
|
||||
|-
|
||||
|Y Axis
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the Y axis (up/down) of the analog stick
|
||||
|-
|
||||
|X Axis
|
||||
|M64TYPE_STRING
|
||||
|Input event string for mapping the X axis (left/right) of the analog stick
|
||||
|-
|
||||
|}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
[http://mupen64plus.retrouprising.com Project page]
|
||||
|
||||
Please note: as of January 2011, this API is a work in progress.<br />
|
||||
The core Mupen64Plus v2.0 modules are complete, but work on GUI front-end applications is ongoing.
|
||||
|
||||
To view the design proposal which preceded this API definition, go to [[Mupen64Plus v2.0 Design Proposal 3|Design Proposal 3]].
|
||||
|
||||
== New Architecture ==
|
||||
|
||||
Earlier versions of Mupen64Plus (and other plugin-based N64 emulators) used a single monolithic application (containing the emulator core) and four plugins. The plugins were dynamically-loaded libraries, and the application used one plugin of each type: Video, Audio, Input, and RSP. Each plugin and the application contained its own GUI code for user interface, and each plugin and the application were individually responsible for finding their own data files and finding, loading, parsing, and storing their own configuration data files.
|
||||
|
||||
This was an acceptable architecture for emulators which were only designed to run on a single platform (such as Windows), but causes a lot of developer and user headaches when applied to a cross-platform emulator such as Mupen64Plus. For this reason, we are re-designing the layout of the emulator to solve some of the problems caused by the old architecture.
|
||||
|
||||
Under the new architecture, the old monolithic emulator application is split into two parts: a core emulator library and a main application, called the front-end. The front-end is primarily responsible for the user interface. All GUI code will be removed from the core and plugin libraries. The primary function of the core library is to emulate the R4300 CPU and memory system, attaching the plugins to form a full N64 system emulator. The core library also contains some utility functions which may be used by the front-end and plugins, such as a configuration parameter handler.
|
||||
|
||||
== High-level Usage ==
|
||||
|
||||
The expected sequence of operations which will be taken by the front-end application are as follows:
|
||||
|
||||
# Load core library (libmupen64plus.so) and set function pointers
|
||||
# Call <tt>CoreGetVersion</tt>, check core version and capabilities
|
||||
# Call <tt>CoreStartup</tt> to initialize the core library
|
||||
# Load front-end configuration from core config API or through own mechanism
|
||||
# Find plugins, open dynamic libraries, call <tt>PluginStartup</tt> for each
|
||||
# Enter message loop for user interaction
|
||||
# If user selects ROM and presses Play:
|
||||
#* Load and de-compress the ROM
|
||||
#* Use <tt>CoreDoCommand</tt> to open the ROM
|
||||
#* Call <tt>CoreAttachPlugin</tt> to attach selected plugins to core
|
||||
#* Use <tt>CoreDoCommand</tt> to start emulation
|
||||
#* When emulation is finished, call <tt>CoreDetachPlugin</tt> on all plugins, then close the ROM
|
||||
|
||||
== Core API ==
|
||||
=== [[Mupen64Plus v2.0 Core Basic|Basic Core Functions]] ===
|
||||
|
||||
These two functions (<tt>PluginGetVersion</tt> and <tt>CoreErrorMessage</tt>) are utility functions and may be called at any time (even before core startup). These functions are used by both the front-end and the plugins.
|
||||
|
||||
=== [[Mupen64Plus v2.0 Core Front-End|Front-End Functions]] ===
|
||||
|
||||
There are several types of functions here, which are exported from the Core library to be used by the front-end. There are 'housekeeping' functions, for startup and shutdown, and attaching and detaching plugins. There is also a Command API which is used for many simple functions such as loading, executing, or stopping a ROM. Finally the Cheat API is here, for adding and removing cheat functions.
|
||||
|
||||
=== [[Mupen64Plus v2.0 Core Video Extension|Video Extension API]] ===
|
||||
|
||||
These functions are exported from the Core library for use by the video plugin. These functions are used for high-level video setup tasks such as enumerating available screen resolutions, setting the video mode, window caption, OpenGL attributes, and fullscreen mode. The video extension API allows for the abstraction of these functions away from the hard-coded SDL function calls currently in the video plugins, so that a front-end may override these functions and provide its own video API.
|
||||
|
||||
=== [[Mupen64Plus v2.0 Core Debugger|Debugger Functions]] ===
|
||||
|
||||
These are the debugger functions, which are also called only from the front-end. Most of these functions will return with an error if the core library was not compiled with the debugger enabled. A front-end may examine the <tt>Capabilities</tt> value returned by the <tt>CoreGetVersion</tt> function to determine if the core library was built with the debugger enabled.
|
||||
|
||||
=== [[Mupen64Plus v2.0 Core Config|Configuration API]] ===
|
||||
|
||||
These configuration functions are exported from the core library and are used by the core and the plugins to store all of their persistent configuration parameters. The front-end application may also use these functions to store its configuration options, or it may use a different mechanism. This section also contains two Operating System Abstraction functions. These functions are used by the core, plugins, and the front-end to find full filepaths to shared data files and user-specific data files.
|
||||
|
||||
== Plugin API ==
|
||||
=== [[Mupen64Plus v2.0 Plugin API|Plugin API]] ===
|
||||
|
||||
This section lists all of the functions which are exported by the plugins. The front-end application should only use the <tt>PluginStartup</tt>, <tt>PluginShutdown</tt>, and <tt>PluginGetVersion</tt> functions. All other functions will only be called from the core.
|
||||
|
||||
== Configuration Parameters ==
|
||||
=== [[Mupen64Plus Core Parameters|Core Parameters]] ===
|
||||
|
||||
This section lists the names and descriptions of all of the configuration parameters used by the Core library.
|
||||
|
||||
=== [[Mupen64Plus Plugin Parameters|Plugin Parameters]] ===
|
||||
|
||||
This section lists the names and descriptions of all of the configuration parameters used by the Plugin libraries.
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Basic Core API =
|
||||
|
||||
Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function.
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>PluginType</tt>''' Pointer to an enumerated type to store the plugin type. The value <tt>M64PLUGIN_CORE</tt> will always be stored.<br />
|
||||
'''<tt>PluginVersion</tt>''' Pointer to an integer to store the version number of the Mupen64Plus core. Version number 2.1.3 would be stored as 0x00020103.<br />
|
||||
'''<tt>APIVersion</tt>''' Pointer to an integer to store the version number of the Core--Front-end API used by the Mupen64plus core library.<br />
|
||||
'''<tt>PluginNamePtr</tt>''' Pointer to a const character pointer to receive the name of the core library. The const char * which is returned must point to a persistent string (ie, not stored on the stack).<br />
|
||||
'''<tt>Capabilities</tt>''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the core which were built into the library during compilation. These are defined in the <tt>m64p_core_caps</tt> enumerated type, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]].
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves version information from the core library. This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreGetAPIVersions(int *ConfigVersion, int *DebugVersion, int *VidextVersion, int *ExtraVersion)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigVersion</tt>''' Pointer to an integer to store the version number of the Config API exported by the Mupen64plus core library.<br />
|
||||
'''<tt>DebugVersion</tt>''' Pointer to an integer to store the version number of the Debug API exported by the Mupen64plus core library.<br />
|
||||
'''<tt>VidextVersion</tt>''' Pointer to an integer to store the version number of the Video Extension API exported by the Mupen64plus core library.<br />
|
||||
'''<tt>ExtraVersion</tt>''' Pointer to an integer to store an API version number for future use. Currently set to 0.<br />
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves API version information from the core library. This function may be used by either the front-end application or any plugin modules. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * CoreErrorMessage(m64p_error ReturnCode)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ReturnCode</tt>''' Enumerated type containing an error code.
|
||||
|-
|
||||
|Usage
|
||||
|This function returns a pointer to a NULL-terminated string giving a human-readable description of the error.
|
||||
|}
|
||||
<br />
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Configuration API =
|
||||
|
||||
Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function.
|
||||
|
||||
== Selector Functions ==
|
||||
These functions are used by the front-end to discover the sections in the configuration file, open a section, discover parameters within a section, and find out if a section has been changed.
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigListSections(void *context, void (*SectionListCallback)(void * context, const char * SectionName))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>context</tt>''' Void pointer to be passed to the SectionListCallback function<br />
|
||||
'''<tt>SectionListCallback</tt>''' Pointer to function in front-end for receiving the name of every section in the Mupen64Plus Core configuration data. This function will be called once for each section in the core configuration data structure, and then the ConfigListSections() function will return.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>SectionListCallback</tt>''' pointer cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called to enumerate the list of Sections in the Mupen64Plus Core configuration file. It is expected that there will be a section named "Core" for core-specific configuration data, "Graphics" for common graphics options, and one section for each plugin library.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigOpenSection(const char *SectionName, m64p_handle *ConfigSectionHandle)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SectionName</tt>''' Name of the Mupen64Plus configuration section to open. This name is case-insensitive. If no section exists with the given name, a new one will be created with no parameters. This name may consist of any ASCII characters between 32 and 127 except brackets "[]".<br />
|
||||
'''<tt>ConfigSectionHandle</tt>''' This is a handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) which is required to be used for subsequent calls to core configuration functions to list, retrieve, or set configuration parameters.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>SectionName</tt>''' and '''<tt>ConfigSectionHandle</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to give a configuration section handle to the front-end which may be used to read or write configuration parameter values in a given section of the configuration file.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigListParameters(m64p_handle ConfigSectionHandle, void *context, void (*ParameterListCallback)(void * context, const char *ParamName, m64p_type ParamType))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>context</tt>''' Void pointer to be passed to the ParameterListCallback function<br />
|
||||
'''<tt>ParameterListCallback</tt>''' Pointer to function in front-end for receiving the name of every parameter in the given section of the Mupen64Plus Core configuration data. This function will be called once for each parameter in the section, and then the ConfigListParameters() function will return.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''' and '''<tt>ParameterListCallback</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called to enumerate the list of Parameters in a given Section of the Mupen64Plus Core configuration file.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>int ConfigHasUnsavedChanges(const char *SectionName)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SectionName</tt>''' Name of the Mupen64Plus configuration section to check for unsaved changes. This name is case-insensitive. If this pointer is NULL or points to an empty string, then all sections are checked.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.<br />
|
||||
This function was added in the Config API version 2.2.0.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called to determine if a given Section (or all sections) of the Mupen64Plus Core configuration file has been modified since it was last saved. A return value of 0 means there are no unsaved changes, while a 1 will be returned if there are unsaved changes.
|
||||
|}
|
||||
|
||||
== Modifier Functions ==
|
||||
These functions are used for deleting parts of the configuration list or saving the configuration data to disk.
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigDeleteSection(const char *SectionName)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SectionName</tt>''' Name of the Mupen64Plus configuration section to delete. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except brackets "[]".<br />
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function deletes a section from the Mupen64Plus configuration data.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigSaveFile(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function saves the Mupen64Plus configuration file to disk.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigSaveSection(const char *SectionName)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SectionName</tt>''' Name of the Mupen64Plus configuration section to save. This name is case-insensitive.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The named section must exist in the current configuration.<br />
|
||||
This function was added in the Config API version 2.1.0.
|
||||
|-
|
||||
|Usage
|
||||
|This function saves one section of the current Mupen64Plus configuration to disk, while leaving the other sections unmodified.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigRevertChanges(const char *SectionName)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SectionName</tt>''' Name of the Mupen64Plus configuration section to modify. This name is case-insensitive. This pointer cannot be NULL.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The named section must exist in the current configuration.<br />
|
||||
This function was added in the Config API version 2.2.0.
|
||||
|-
|
||||
|Usage
|
||||
|This function reverts changes previously made to one section of the current Mupen64Plus configuration file, so that it will match with the configuration at the last time that it was loaded from or saved to disk.
|
||||
|}
|
||||
|
||||
== Generic Get/Set Functions ==
|
||||
These functions should be used for reading or writing configuration values in most cases.
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigSetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, const void *ParamValue)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' NULL-terminated string containing the name of the parameter whose value is being set. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.<br />
|
||||
'''<tt>ParamType</tt>''' An <tt>m64p_type</tt> value giving the type of the data object that '''ParamValue''' points to. If this is different from the native data representation used by the core, it will be converted into the type used by the core.<br />
|
||||
'''<tt>ParamValue</tt>''' Pointer to data object containing the value of the parameter to be set.<br />
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''', '''<tt>ParamName</tt>''' and '''<tt>ParamValue</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function sets the value of one of the emulator's configuration parameters in the section which is represented by '''<tt>ConfigSectionHandle</tt>'''.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigGetParameter(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type ParamType, void *ParamValue, int MaxSize)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' NULL-terminated string containing the name of the parameter whose value is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.<br />
|
||||
'''<tt>ParamType</tt>''' An <tt>m64p_type</tt> value giving the type of the data object that '''ParamValue''' points to. If this is different from the native data representation used by the core, it will be converted into the type given by '''ParamType'''.<br />
|
||||
'''<tt>ParamValue</tt>''' Pointer to data object to receive the value of the parameter being retrieved.<br />
|
||||
'''<tt>MaxSize</tt>''' Size (in bytes) of the data object that '''ParamValue''' points to.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''', '''<tt>ParamName</tt>''' and '''<tt>ParamValue</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves the value of one of the emulator's parameters in the section which is represented by '''<tt>ConfigSectionHandle</tt>'''.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigGetParameterType(m64p_handle ConfigSectionHandle, const char *ParamName, m64p_type *ParamType)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' Pointer to a NULL-terminated string containing the name of the parameter whose type is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.<br />
|
||||
'''<tt>ParamType</tt>''' Pointer to an <tt>m64p_type</tt> value to receive the type of the parameter indicated by '''<tt>ParamName</tt>'''.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''', '''<tt>ParamName</tt>''', and '''<tt>ParamType</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves the type of one of the emulator's parameters in the section which is represented by '''<tt>ConfigSectionHandle</tt>'''. If there is no parameter with the given '''<tt>ParamName</tt>''', the error <tt>M64ERR_INPUT_NOT_FOUND</tt> will be returned.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * ConfigGetParameterHelp(m64p_handle ConfigSectionHandle, const char *ParamName)</tt>'''
|
||||
|-
|
||||
|Return Value
|
||||
|Pointer to a NULL-terminated string containing usage information for the '''<tt>ParamName</tt>''' parameter. May be NULL.
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' NULL-terminated string containing the name of the parameter for which usage information is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''', and '''<tt>ParamName</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves the help information about one of the emulator's parameters in the section which is represented by '''<tt>ConfigSectionHandle</tt>'''.
|
||||
|}
|
||||
|
||||
== Special Get/Set Functions ==
|
||||
These parameterized Get/SetDefault functions are provided for simplifying the task of handling default values within a single module. Each code module using the Core's configuration API should set the default values for all configuration parameters used by that module during its Startup() function. This allows the software to set up the default values automatically rather than storing them in a separate "default config file" which has proven problematic in the past. This also solves the problem which occurs when an upgraded module contains a new config parameter not present in the previous release.
|
||||
|
||||
The special Get functions return the configuration value directly rather than writing them through a pointer and returning an error code. For this reason, these parameterized Get functions should only be used within a module which 'owns' the configuration section and set up its default values in the Startup() function. Because these functions cannot signal an error to the caller, a front-end should not use these functions to retrieve configuration values for the core or the plugins, unless the names of the parameters have been enumerated with <tt>ConfigListParameters</tt> and are therefore guaranteed to exist.
|
||||
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error ConfigSetDefaultInt(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp)</tt>'''<br />
|
||||
'''<tt>m64p_error ConfigSetDefaultFloat(m64p_handle ConfigSectionHandle, const char *ParamName, float ParamValue, const char *ParamHelp)</tt>'''<br />
|
||||
'''<tt>m64p_error ConfigSetDefaultBool(m64p_handle ConfigSectionHandle, const char *ParamName, int ParamValue, const char *ParamHelp)</tt>'''<br />
|
||||
'''<tt>m64p_error ConfigSetDefaultString(m64p_handle ConfigSectionHandle, const char *ParamName, const char * ParamValue, const char *ParamHelp)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' NULL-terminated string containing the name of the parameter whose value is being set. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.<br />
|
||||
'''<tt>ParamValue</tt>''' Integer or null-terminated string pointer containing the value of the parameter to be set.<br />
|
||||
'''<tt>ParamHelp</tt>''' NULL-terminated string containing some human-readable information about the usage of this parameter. Can be NULL.
|
||||
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''' and '''<tt>ParamName</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to set the value of a configuration parameter if it is not already present in the configuration file. This may happen if a new user runs the emulator, or an upgraded module uses a new parameter, or the user deletes his or her configuration file. If a parameter named '''<tt>ParamName</tt>''' is already present in the given section of the configuration file, then no action will be taken and this function will return successfully. Otherwise, a new parameter will be created its value will be assigned to '''<tt>ParamValue</tt>'''.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|
|
||||
{|
|
||||
|-
|
||||
|'''<tt>int</tt>''' || '''<tt>ConfigGetParamInt(m64p_handle ConfigSectionHandle, const char *ParamName)</tt>'''
|
||||
|-
|
||||
|'''<tt>float</tt>''' || '''<tt>ConfigGetParamFloat(m64p_handle ConfigSectionHandle, const char *ParamName)</tt>'''
|
||||
|-
|
||||
|'''<tt>int</tt>''' || '''<tt>ConfigGetParamBool(m64p_handle ConfigSectionHandle, const char *ParamName)</tt>'''
|
||||
|-
|
||||
|'''<tt>const char *</tt>''' || '''<tt>ConfigGetParamString(m64p_handle ConfigSectionHandle, const char *ParamName)</tt>'''
|
||||
|}
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>ConfigSectionHandle</tt>''' An <tt>m64p_handle</tt> given by the '''<tt>ConfigOpenSection</tt>''' function.<br />
|
||||
'''<tt>ParamName</tt>''' NULL-terminated string containing the name of the parameter whose value is being retrieved. This name is case-insensitive. This name may consist of any ASCII characters between 32 and 127 except the equals and hash signs, and may not end in a space.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. The '''<tt>ConfigSectionHandle</tt>''' and '''<tt>ParamName</tt>''' pointers cannot be NULL.
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves the value of one of the emulator's parameters in the section which is represented by '''<tt>ConfigSectionHandle</tt>''', and returns the value directly to the calling function. If an errors occurs (such as if '''<tt>ConfigSectionHandle</tt>''' is invalid, or there is no configuration parameter named '''<tt>ParamName</tt>'''), then an error will be sent to the front-end via the <tt>DebugCallback()</tt> function, and either a 0 (zero) or an empty string will be returned.
|
||||
|}
|
||||
|
||||
== OS-Abstraction Functions ==
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * ConfigGetSharedDataFilepath(const char *filename)</tt>'''
|
||||
|-
|
||||
|Return Value
|
||||
|Pointer to a NULL-terminated string containing a full directory path and filename to a given shared data file, or NULL if this file was not found.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|It is common for shared data files on Unix systems to be installed in different places on different systems. Therefore, this core function is provided to allow a plugin to retrieve a full pathname to a given shared data file. This type of file is intended to be shared among multiple users on a system, so it is likely to be read-only. Examples of these types of files include: the .ini files for Rice Video and Glide64, the font and Mupen64Plus.ini files for the core, and the cheat code files for the front-end. This function will first search in a directory given via the <tt>DataPath</tt> parameter to the '''<tt>CoreStartup</tt>''' function, then in a directory given by the <tt>SharedDataPath</tt> core configuration parameter, then in a directory which may be supplied at compile time through a Makefile or configure script option, and finally in some common system locations (such as /usr/share/mupen64plus and /usr/local/share/mupen64plus on Unix systems).
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * ConfigGetUserConfigPath(void)</tt>'''
|
||||
|-
|
||||
|Return Value
|
||||
|Pointer to a NULL-terminated string containing the directory path to user-specific configuration files.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific configuration files. This will be the directory where the configuration file "mupen64plus.cfg" is located.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * ConfigGetUserDataPath(void)</tt>'''
|
||||
|-
|
||||
|Return Value
|
||||
|Pointer to a NULL-terminated string containing the directory path to user-specific data files.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific data files. This may be used to store files such as screenshots, saved game states, or hi-res textures.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>const char * ConfigGetUserCachePath(void)</tt>'''
|
||||
|-
|
||||
|Return Value
|
||||
|Pointer to a NULL-terminated string containing the directory path to user-specific caching data files.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function may be used by the plugins or front-end to get a path to the directory for storing user-specific caching data files. Files in this directory may be deleted by the user to save space, so critical information should not be stored here. This directory may be used to store files such as the ROM browser cache.
|
||||
|}
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Core Debugger API =
|
||||
|
||||
Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function.
|
||||
|
||||
== General Debugger Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error DebugSetCallbacks(void (*dbg_frontend_init)(void), void (*dbg_frontend_update)(unsigned int pc), void (*dbg_frontend_vi)(void))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>dbg_frontend_init</tt>''' Pointer to function which is called when debugger is initialized.<br />
|
||||
'''<tt>dbg_frontend_update</tt>''' Pointer to function which is called after debugger hits a breakpoint or executes one instruction in stepping mode.<br />
|
||||
'''<tt>dbg_frontend_vi</tt>''' Pointer to function which is called during each vertical interrupt.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called by the front-end to supply debugger callback function pointers. If debugger is enabled and then later disabled within the GUI, this function may be called with NULL pointers in order to disable the callbacks.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error DebugSetCoreCompare(void (*dbg_core_compare)(unsigned int), void (*dbg_core_data_sync)(int, void *))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>dbg_core_compare</tt>''' Pointer to function which is called after each R4300 instruction, for comparing the operation of one R4300 emulator core against another.<br />
|
||||
'''<tt>dbg_core_data_sync</tt>''' Pointer to function which is used to transfer data from the sending emulator core to the receiving core, such as controller button press or movement data.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function is called by the front-end to supply callback function pointers for the Core Comparison feature. This feature is designed to work as follows. The front-end application will set up some channel for communicating data between two separately running instances of mupen64plus. For example, the unix console front-end will use named FIFOs. The front-end will register callback functions for comparing the 2 cores' states via this <tt>DebugSetCoreCompare</tt> API call. When the <tt>dbg_core_compare</tt> callback fires, the front-end will use the <tt>DebugGetCPUDataPtr</tt> function (and <tt>DebugMemGetPointer</tt> function if desired) to transmit emulator core state data from the 'sending' instance to the 'receiving' instance. The receiving instance may then check the core state data against it's own internal state and report any discrepancies. When the <tt>dbg_core_data_sync</tt> callback fires, the front-end should transmit a block of data from the sending instance to the receiving instance. This is for the purposes of synchronizing events such as controller inputs or state loading commands, so that the 2 cores may stay synchronized. This feature does not require the <tt>M64CAPS_DEBUGGER</tt> capability to built into the core, but it does require the <tt>M64CAPS_CORE_COMPARE</tt> capability.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error DebugSetRunState(int runstate)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>runstate</tt>''' 0 == pause, 1 == single instruction step, 2 == run
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function sets the run state of the R4300 CPU emulator.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>int DebugGetState(m64p_dbg_state statenum)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>statenum</tt>''' An <tt>m64p_dbg_state</tt> enumerated type specifying which debugger state variable to read.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function reads and returns a debugger state variable, which are enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]].
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error DebugStep(void)</tt>'''
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized, the emulator core must be executing a ROM, and the debugger must be active before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function signals the debugger to advance one instruction when in the stepping mode.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>void DebugDecodeOp(unsigned int instruction, char *op, char *args, int pc)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>instruction</tt>''' 32-bit R4300 instruction opcode<br />
|
||||
'''<tt>op</tt>''' Pointer to character array to store decoded instruction mnemonic<br />
|
||||
'''<tt>args</tt>''' Pointer to character array to store instruction arguments<br />
|
||||
'''<tt>pc</tt>''' Program Counter address at which '''<tt>instruction</tt>''' is stored
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support.
|
||||
|-
|
||||
|Usage
|
||||
|This is a helper function for the debugger front-end. This instruction takes a PC value and an R4300 instruction opcode and writes the disassembled instruction mnemonic and arguments into character buffers. This is intended to be used to display disassembled code.
|
||||
|}
|
||||
|
||||
== Memory Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>void * DebugMemGetRecompInfo(m64p_dbg_mem_info recomp_type, unsigned int address, int index)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>recomp_type</tt>''' Type of information to retrieve about a recompiled machine instruction. Must be a M64P_DBG_RECOMP_* type.<br />
|
||||
'''<tt>address</tt>''' Program Counter value (in N64 memory space) of R4300 instruction about which to retrieve the recompiled x86 instructions.<br />
|
||||
'''<tt>index</tt>''' Index of recompiled instruction about which to receive information.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function. This function may not be available on all platforms.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used by the front-end to retrieve disassembly information about recompiled code. For example, the dynamic recompiler may take a single R4300 instruction and compile it into 10 x86 instructions. This function may then be used to retrieve the disassembled code of the 10 x86 instructions. For '''<tt>recomp_type</tt>''' of <tt>M64P_DBG_RECOMP_OPCODE</tt> or <tt>M64P_DBG_RECOMP_ARGS</tt>, a character pointer will be returned which gives the disassembled instruction code. For '''<tt>recomp_type</tt>''' of <tt>M64P_DBG_RECOMP_ADDR</tt>, a pointer to the recompiled x86 instruction will be given.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>int DebugMemGetMemInfo(m64p_dbg_mem_info mem_info_type, unsigned int address)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>mem_info_type</tt>''' Type of information to retrieve about an N64 memory location. Must be a M64P_DBG_MEM_* type.<br />
|
||||
'''<tt>address</tt>''' Memory location (in N64 memory space) about which to retrieve some information.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function returns an integer value regarding the memory location '''<tt>address</tt>''', corresponding to the information requested by '''<tt>mem_info_type</tt>''', which is a type enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. For example, if '''<tt>address</tt>''' contains R4300 program code, the front-end may request the number of x86 instructions emitted by the dynamic recompiler by requesting <tt>M64P_DBG_MEM_NUM_RECOMPILED</tt>.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>void * DebugMemGetPointer(m64p_dbg_memptr_type mem_ptr_type)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>mem_ptr_type</tt>''' Memory type to which a pointer is requested.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function returns a memory pointer (in x86 memory space) to a block of emulated N64 memory. This may be used to retrieve a pointer to a special N64 block (such as the serial, video, or audio registers) or the RDRAM. The '''<tt>m64p_dbg_memptr_type</tt>''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|
|
||||
{|
|
||||
|-
|
||||
|'''<tt>unsigned long long</tt>''' || '''<tt>DebugMemRead64(unsigned int address)</tt>'''
|
||||
|-
|
||||
|'''<tt>unsigned int</tt>''' || '''<tt>DebugMemRead32(unsigned int address)</tt>'''
|
||||
|-
|
||||
|'''<tt>unsigned short</tt>''' || '''<tt>DebugMemRead16(unsigned int address)</tt>'''
|
||||
|-
|
||||
|'''<tt>unsigned char</tt>''' || '''<tt>DebugMemRead8(unsigned int address)</tt>'''
|
||||
|}
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>address</tt>''' Memory location (in N64 memory space) from which to retrieve a value.<br />
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|These functions retrieve a value from the emulated N64 memory. The returned value will be correctly byte-swapped for the host architecture.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>void DebugMemWrite64(unsigned int address, unsigned long long value)</tt>'''<br />
|
||||
'''<tt>void DebugMemWrite32(unsigned int address, unsigned int value)</tt>'''<br />
|
||||
'''<tt>void DebugMemWrite16(unsigned int address, unsigned short value)</tt>'''<br />
|
||||
'''<tt>void DebugMemWrite8(unsigned int address, unsigned char value)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>address</tt>''' Memory location (in N64 memory space) to which to write a value.<br />
|
||||
'''<tt>value</tt>''' Value to write into emulated memory.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|These functions write a value into the emulated N64 memory. The given value will be correctly byte-swapped before storage.
|
||||
|}
|
||||
|
||||
== R4300 CPU Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>void *DebugGetCPUDataPtr(m64p_dbg_cpu_data cpu_data_type)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>cpu_data_type</tt>''' CPU register type to which a pointer is requested.<br />
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function returns a memory pointer (in x86 memory space) to a specific register in the emulated R4300 CPU. The '''<tt>m64p_dbg_cpu_data</tt>''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. It is important to note that when the R4300 CPU core is in the Cached Interpreter or Dynamic Recompiler modes, the address of the PC register is not constant; it will change after each instruction is executed. The pointers to all other registers will never change, as the other registers are global variables.
|
||||
|}
|
||||
|
||||
== Breakpoint Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>int DebugBreakpointLookup(unsigned int address, unsigned int size, unsigned int flags)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>address</tt>''' Starting address (in R4300 memory space) to search<br />
|
||||
'''<tt>size</tt>''' Size of address space in bytes to search<br />
|
||||
'''<tt>flags</tt>''' Breakpoint flags
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function searches through all current breakpoints in the debugger to find one that matches the given input parameters. If a matching breakpoint is found, the index number is returned. If no breakpoints are found, -1 is returned.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>int DebugBreakpointCommand(m64p_dbg_bkp_command command, unsigned int index, void *ptr)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>command</tt>''' Enumerated value specifying the breakpoint command to execute<br />
|
||||
'''<tt>index</tt>''' Purpose varies by command, see table below<br />
|
||||
'''<tt>ptr</tt>''' Purpose varies by command, see table below
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must be built with debugger support and must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to process common breakpoint commands, such as adding, removing, or searching the breakpoints. The meanings of the '''<tt>index</tt>''' and '''<tt>ptr</tt>''' input parameters vary by command, and are given in the table below. The '''<tt>m64p_dbg_bkp_command</tt>''' type is enumerated in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]].
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
!Command!!Return Value!!Function!!<tt>index</tt> Parameter!!<tt>ptr</tt> Parameter
|
||||
|-
|
||||
|M64P_BKP_CMD_ADD_ADDR
|
||||
|Index of new breakpoint
|
||||
|Add an execution breakpoint at a given R4300 address.
|
||||
|R4300 address
|
||||
|unused
|
||||
|-
|
||||
|M64P_BKP_CMD_ADD_STRUCT
|
||||
|Index of new breakpoint
|
||||
|Add a custom breakpoint specified in a <tt>breakpoint</tt> structure.
|
||||
|unused
|
||||
|Pointer to <tt>breakpoint</tt> struct of new breakpoint
|
||||
|-
|
||||
|M64P_BKP_CMD_REPLACE
|
||||
|unused
|
||||
|Replace an existing breakpoint with one specified by a <tt>breakpoint</tt> structure.
|
||||
|Index of breakpoint to replace
|
||||
|Pointer to <tt>breakpoint</tt> struct of new breakpoint
|
||||
|-
|
||||
|M64P_BKP_CMD_REMOVE_ADDR
|
||||
|unused
|
||||
|Remove an existing breakpoint
|
||||
|R4300 address of breakpoint to remove
|
||||
|unused
|
||||
|-
|
||||
|M64P_BKP_CMD_REMOVE_IDX
|
||||
|unused
|
||||
|Remove an existing breakpoint
|
||||
|Index of breakpoint to remove
|
||||
|unused
|
||||
|-
|
||||
|M64P_BKP_CMD_ENABLE
|
||||
|unused
|
||||
|Enable a specified breakpoint
|
||||
|Index of breakpoint to enable
|
||||
|unused
|
||||
|-
|
||||
|M64P_BKP_CMD_DISABLE
|
||||
|unused
|
||||
|Disable a specified breakpoint
|
||||
|Index of breakpoint to disable
|
||||
|unused
|
||||
|-
|
||||
|M64P_BKP_CMD_CHECK
|
||||
|Index of breakpoint if found, otherwise -1
|
||||
|Search for an execution breakpoint at a given address
|
||||
|R4300 address at which to search
|
||||
|unused
|
||||
|}
|
||||
|
||||
@@ -1,332 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Core<-->Front-End API =
|
||||
|
||||
Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Front-end code should check the return value of each call to a libmupen64plus function.
|
||||
|
||||
== Startup/Shutdown Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreStartup(int APIVersion, const char *ConfigPath, const char *DataPath, void *Context, void (*DebugCallback)(void *Context, int level, const char *message), void *Context2, void (*StateCallback)(void *Context2, m64p_core_param ParamChanged, int NewValue))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>APIVersion</tt>''' Integer containing the version number of the Core API used by the front-end.<br />
|
||||
'''<tt>ConfigPath</tt>''' File path to folder containing Mupen64Plus.cfg. Can be NULL.<br />
|
||||
'''<tt>DataPath</tt>''' Folder to search first when looking for shared data files. Can be NULL.<br />
|
||||
'''<tt>Context</tt>''' Pointer which will be passed back to the '''<tt>DebugCallback</tt>''' function. Can be NULL.<br />
|
||||
'''<tt>DebugCallback</tt>''' Pointer to function in front-end for receiving debug information and warnings from the core. This function must be thread-safe. Can be NULL. The value of <tt>level</tt> is 1 for an error, 2 for a warning, 3 for info, and 4 for verbose info.<br />
|
||||
'''<tt>Context2</tt>''' Pointer which will be passed back to the '''<tt>StateCallback</tt>''' function. Can be NULL.<br />
|
||||
'''<tt>StateCallback</tt>''' Pointer to function in front-end for receiving core state change notifications. This function must be thread-safe. Can be NULL.
|
||||
|-
|
||||
|Requirements
|
||||
|This function must be called before any other libmupen64plus functions.
|
||||
|-
|
||||
|Usage
|
||||
|This function initializes libmupen64plus for use by allocating memory, creating data structures, and loading the configuration file. If '''<tt>ConfigPath</tt>''' is NULL, libmupen64plus will search for the configuration file in its usual place (On Linux, in <tt>~/.config/mupen64plus/</tt>). This function may return <tt>M64ERR_INCOMPATIBLE</tt> if older front-end is used with newer core.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreShutdown(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Usage
|
||||
|This function saves the configuration file, then destroys data structures and releases memory allocated by the core library.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreAttachPlugin(m64p_plugin_type PluginType, m64p_dynlib_handle PluginLibHandle)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>PluginType</tt>''' Enumerated type specifying the plugin type to attach to the core. If this type of plugin is currently attached to the core, an error will be returned.<br />
|
||||
'''<tt>PluginLibHandle</tt>''' Dynamic library handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) corresponding with the plugin object to attach.
|
||||
|-
|
||||
|Requirements
|
||||
|Both the core library and the plugin library must already be initialized with the <tt>CoreStartup()/PluginStartup()</tt> functions, and a ROM must be open. This function cannot be called while the emulator is running. The plugins must be attached in the following order: Video, Audio, Input, RSP.
|
||||
|-
|
||||
|Usage
|
||||
|This function attaches the given plugin to the emulator core. There can only be one plugin of each type attached to the core at any given time.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreDetachPlugin(m64p_plugin_type PluginType)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>PluginType</tt>''' Enumerated type specifying the plugin type to detach from the core. If no plugin of this type is currently attached to the core, this function will exit with a return value of <tt>M64ERR_SUCCESS</tt>.
|
||||
|-
|
||||
|Requirements
|
||||
|Both the core library and the plugin library must already be initialized with the <tt>CoreStartup()/PluginStartup()</tt> functions. This function cannot be called while the emulator is running.
|
||||
|-
|
||||
|Usage
|
||||
|This function detaches the given plugin from the emulator core, and re-attaches the 'dummy' plugin functions.
|
||||
|}
|
||||
|
||||
== Command Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreDoCommand(m64p_command Command, int ParamInt, void *ParamPtr)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Command</tt>''' Enumerated type specifying which command should be executed.<br />
|
||||
'''<tt>ParamInt</tt>''' An integer value which may be used as an input to the command.<br />
|
||||
'''<tt>ParamPtr</tt>''' A pointer which may be used as an input to the command.<br />
|
||||
|-
|
||||
|Requirements
|
||||
|The core library must already be initialized with the <tt>CoreStartup()</tt> function. Each command may have its own requirements as well.
|
||||
|-
|
||||
|Usage
|
||||
|This function sends a command to the emulator core. A table of all commands is given below.
|
||||
|}
|
||||
<br />
|
||||
|
||||
{| border="1"
|
||||
!Command!!Function!!Input Parameters!!Requirements
|
||||
|-
|
||||
|M64CMD_ROM_OPEN
|
||||
|This will cause the core to read in a binary ROM image provided by the front-end.
|
||||
|'''<tt>ParamPtr</tt>''' Pointer to the uncompressed ROM image in memory.<br />'''<tt>ParamInt</tt>''' The size in bytes of the ROM image.
|
||||
|The emulator cannot be currently running. A ROM image must not be currently opened.
|
||||
|-
|
||||
|M64CMD_ROM_CLOSE
|
||||
|This will close any currently open ROM. The current cheat code list will also be deleted.
|
||||
|N/A
|
||||
|The emulator cannot be currently running. A ROM image must have been previously opened. There should be no plugins currently attached.
|
||||
|-
|
||||
|M64CMD_ROM_GET_HEADER
|
||||
|This will retrieve the header data of the currently open ROM.
|
||||
|'''<tt>ParamPtr</tt>''' Pointer to a <tt>rom_header</tt> struct to receive the data.<br />'''<tt>ParamInt</tt>''' The size in bytes of the <tt>rom_header</tt> struct.
|
||||
|A ROM image must be open.
|
||||
|-
|
||||
|M64CMD_ROM_GET_SETTINGS
|
||||
|This will retrieve the settings data of the currently open ROM.
|
||||
|'''<tt>ParamPtr</tt>''' Pointer to a <tt>rom_settings</tt> struct to receive the data.<br />'''<tt>ParamInt</tt>''' The size in bytes of the <tt>rom_settings</tt> struct.
|
||||
|A ROM image must be open.
|
||||
|-
|
||||
|M64CMD_EXECUTE
|
||||
|This command will start the emulator and begin executing the ROM image. This function call will not return until the game has been stopped.
|
||||
|N/A
|
||||
|The emulator cannot be currently running. A ROM image must have been previously opened.
|
||||
|-
|
||||
|M64CMD_STOP
|
||||
|This will stop the emulator, if it is currently running.
|
||||
|N/A
|
||||
|This command will execute asynchronously.
|
||||
|-
|
||||
|M64CMD_PAUSE
|
||||
|This command will pause the emulator if it is running.
|
||||
|N/A
|
||||
|This function will return a non-successful error code if the emulator is in the stopped state. This command may execute asynchronously.
|
||||
|-
|
||||
|M64CMD_RESUME
|
||||
|This command will resume execution of the emulator if it is paused.
|
||||
|N/A
|
||||
|This function will return a non-successful error code if the emulator is in the stopped state. This command may execute asynchronously.
|
||||
|-
|
||||
|M64CMD_CORE_STATE_QUERY
|
||||
|This command will query the emulator core for the value of a state parameter
|
||||
|'''<tt>ParamInt</tt>''' An <tt>m64p_core_param</tt> enumerated type specifying the desired state variable'''<br /><tt>ParamPtr</tt>''' Pointer to an integer to receive the value of the requested state variable.
|
||||
|None
|
||||
|-
|
||||
|M64CMD_CORE_STATE_SET
|
||||
|This command will set the value of a state parameter in the emulator core
|
||||
|'''<tt>ParamInt</tt>''' An <tt>m64p_core_param</tt> enumerated type specifying the desired state variable'''<br /><tt>ParamPtr</tt>''' Pointer to an integer to containing the value of the requested state variable.
|
||||
|The initial requirements vary depending upon the variable being set. Setting some variables requires the emulator to be running.
|
||||
|-
|
||||
|M64CMD_STATE_LOAD
|
||||
|This command will attempt to load a saved state file. If '''<tt>ParamPtr</tt>''' is not NULL, this function will load a state file from a full pathname specified by this pointer. Otherwise ('''<tt>ParamPtr</tt>''' is NULL), it will load from the current slot.
|
||||
|'''<tt>ParamInt</tt>''' Ignored'''<br /><tt>ParamPtr</tt>''' Pointer to string containing state file path and name, or NULL
|
||||
|The emulator must be currently running or paused. This command will execute asynchronously.
|
||||
|-
|
||||
|M64CMD_STATE_SAVE
|
||||
|This command will save a state file. If '''<tt>ParamPtr</tt>''' is not NULL, this function will save a state file to a full pathname specified by this pointer. Otherwise ('''<tt>ParamPtr</tt>''' is NULL), it will save to the current slot.
|
||||
|'''<tt>ParamInt</tt>''' This parameter will only be used if '''<tt>ParamPtr</tt>''' is not NULL. If 1, a Mupen64Plus state file will be saved. If 2, a Project64 compressed state file will be saved. If 3, a Project64 uncompressed state file will be saved. '''<br /><tt>ParamPtr</tt>''' Pointer to string containing state file path and name, or NULL<br />
|
||||
|The emulator must be currently running or paused. This command will execute asynchronously.
|
||||
|-
|
||||
|M64CMD_STATE_SET_SLOT
|
||||
|This command will set the currently selected save slot index
|
||||
|'''<tt>ParamInt</tt>''' Value to set for the current slot index. Must be between 0 and 9'''<br /><tt>ParamPtr</tt>''' Ignored<br />
|
||||
|None
|
||||
|-
|
||||
|M64CMD_SEND_SDL_KEYDOWN
|
||||
|This command will inject an SDL_KEYDOWN event into the emulator's core event loop. Keys not handled by the core will be passed to the input plugin.
|
||||
|'''<tt>ParamInt</tt>''' Key value of the keypress event to inject, with SDLMod in the upper 16 bits and SDLKey in the lower 16 bits.
|
||||
|The emulator must be currently running or paused.
|
||||
|-
|
||||
|M64CMD_SEND_SDL_KEYUP
|
||||
|This command will inject an SDL_KEYUP event into the emulator's core event loop.
|
||||
|'''<tt>ParamInt</tt>''' Key value of the keypress event to inject, with SDLMod in the upper 16 bits and SDLKey in the lower 16 bits.
|
||||
|The emulator must be currently running or paused.
|
||||
|-
|
||||
|M64CMD_SET_FRAME_CALLBACK
|
||||
|This command either registers or removes (if '''<tt>ParamPtr</tt>''' is NULL) a frame callback function. This function will be called after each video frame is rendered. The front-end callback function may call the video plugin's ReadScreen2() function to retrieve the frame if desired.
|
||||
|'''<tt>ParamPtr</tt>''' Can be either NULL or a <tt>m64p_frame_callback</tt> object.
|
||||
|None
|
||||
|-
|
||||
|M64CMD_TAKE_NEXT_SCREENSHOT
|
||||
|This will cause the core to save a screenshot at the next possible opportunity.
|
||||
|N/A
|
||||
|The emulator must be currently running or paused. This command will execute asynchronously.
|
||||
|-
|
||||
|M64CMD_READ_SCREEN
|
||||
|This command will copy the current contents of the video display to the buffer pointer by '''<tt>ParamPtr</tt>'''.
|
||||
|'''<tt>ParamInt</tt>''' 1 to copy the buffer that is currently displayed (front buffer), 0 to copy the buffer that is being drawn (back buffer).'''<br /><tt>ParamPtr</tt>'''A pointer to a buffer of at least width*height*3 bytes. The buffer will be filled with the current display. The format is RGB888 with the origin in the lower left corner.
|
||||
|The emulator must be currently running or paused.
|
||||
|-
|
||||
|M64CMD_RESET
|
||||
|Reset the emulated machine.
|
||||
|'''<tt>ParamInt</tt>''' 0 to do a soft reset, 1 to do a hard reset.'''<br /><tt>ParamPtr</tt>''' Ignored
|
||||
|The emulator must be currently running or paused.
|
||||
|-
|
||||
|M64CMD_ADVANCE_FRAME
|
||||
|Advance one frame (the emulator will run until the next frame, then pause).
|
||||
|'''<tt>ParamInt</tt>''' Ignored'''<br /><tt>ParamPtr</tt>''' Ignored
|
||||
|The emulator must be currently running or paused.
|
||||
|}
|
||||
<br />
|
||||
|
||||
|
||||
== Core State Parameters ==
|
||||
These core parameters may be read and/or written using the M64CMD_CORE_STATE_QUERY and M64CMD_CORE_STATE_SET commands. The front-end application will receive a callback (via the <tt>StateCallback</tt> function pointer given to the '''<tt>CoreStartup</tt>''' function) when these parameters change value. This callback will be sent even if the function which caused the state change was called by the front-end application itself. Not all of these parameters are readable or writable. Each parameter's value is held in a single 32-bit integer. The meaning of this integer is given in the Parameter Encoding column. See the table below for details on these core parameters.
|
||||
<br />
|
||||
{| border="1"
|
||||
!Name!!Readable!!Writable!!<tt>int</tt> Parameter Encoding!!Notes
|
||||
|-
|
||||
|M64CORE_EMU_STATE
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>enum m64p_emu_state</tt>
|
||||
|<tt>1</tt>=Stopped, <tt>2</tt>=Running, <tt>3</tt>=Paused
|
||||
|-
|
||||
|M64CORE_VIDEO_MODE
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>enum m64p_video_mode</tt>
|
||||
|<tt>1</tt>=None (video not running), <tt>2</tt>=Windowed, <tt>3</tt>=Fullscreen
|
||||
|-
|
||||
|M64CORE_SAVESTATE_SLOT
|
||||
|Yes
|
||||
|Yes
|
||||
|
|
||||
|Valid values are 0 through 9.
|
||||
|-
|
||||
|M64CORE_SPEED_FACTOR
|
||||
|Yes
|
||||
|Yes
|
||||
|Emulator playback speed in percent
|
||||
|Valid values are 1 to 1000.
|
||||
|-
|
||||
|M64CORE_SPEED_LIMITER
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>1</tt> to enable speed limiter, or <tt>0</tt> to disable speed limiter.
|
||||
|When speed limiter is disabled, emulator will run as fast as possible (useful for benchmarking).
|
||||
|-
|
||||
|M64CORE_VIDEO_SIZE
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>(ScreenWidth << 16) + ScreenHeight</tt>
|
||||
|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
|
||||
|Yes
|
||||
|Volume level in percent, 0 - 100
|
||||
|
|
||||
|-
|
||||
|M64CORE_AUDIO_MUTE
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>1</tt> if muted, otherwise <tt>0</tt>
|
||||
|
|
||||
|-
|
||||
|M64CORE_INPUT_GAMESHARK
|
||||
|Yes
|
||||
|Yes
|
||||
|<tt>1</tt> when Gameshark button pressed, <tt>0</tt> when button released.
|
||||
|Callback function will be invoked on both button press and release.
|
||||
|-
|
||||
|M64CORE_STATE_LOADCOMPLETE
|
||||
|No
|
||||
|No
|
||||
|<tt>1</tt> if state loading was successful, <tt>0</tt> if state loading failed.
|
||||
|This parameter cannot be read or written. It is only used for callbacks, because the state load/save operations are asynchronous.
|
||||
|-
|
||||
|M64CORE_STATE_SAVECOMPLETE
|
||||
|No
|
||||
|No
|
||||
|<tt>1</tt> if state saving was successful, <tt>0</tt> if state saving failed.
|
||||
|This parameter cannot be read or written. It is only used for callbacks, because the state load/save operations are asynchronous.
|
||||
|}
|
||||
<br />
|
||||
|
||||
== ROM Handling Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreGetRomSettings(m64p_rom_settings *RomSettings, int RomSettingsLength, int Crc1, int Crc2)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>RomSettings</tt>''' Pointer to <tt>m64p_rom_settings</tt> object to be filled in with data.<br />
|
||||
'''<tt>RomSettingsLength</tt>''' Size of the object pointed to by '''<tt>RomSettings</tt>''' in bytes.<br />
|
||||
'''<tt>Crc1</tt>''' A 32-bit integer value containing the first CRC (taken from the ROM header) to identify the ROM.<br />
|
||||
'''<tt>Crc2</tt>''' A 32-bit integer value containing the second CRC (taken from the ROM header) to identify the ROM.
|
||||
|-
|
||||
|Requirements
|
||||
|The core library must already be initialized with the <tt>CoreStartup()</tt> function. The '''<tt>RomSettings</tt>''' pointer must not be NULL. The '''<tt>RomSettingsLength</tt>''' value must be greater than or equal to the size of the <tt>m64p_rom_settings</tt> structure. This function does not require any ROM image to be currently open.
|
||||
|-
|
||||
|Usage
|
||||
|This function searches through the data in the <tt>Mupen64Plus.ini</tt> file to find an entry which matches the given '''<tt>Crc1</tt>''' and '''<tt>Crc2</tt>''' hashes, and if found, fills in the '''<tt>RomSettings</tt>''' structure with the data from the <tt>Mupen64Plus.ini</tt> file.
|
||||
|}
|
||||
<br />
|
||||
|
||||
== Video Extension Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreOverrideVidExt(m64p_video_extension_functions *VideoFunctionStruct);</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>VideoFunctionStruct</tt>''' Pointer to a structure (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) containing pointers to the Front-end's custom Video Extension functions to override the default SDL functions
|
||||
|-
|
||||
|Requirements
|
||||
|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 core library with a Video Extension API v3.0 expects the <tt>Functions</tt> struct member to be equal to 11 or more.
|
||||
|}
|
||||
<br />
|
||||
|
||||
== Cheat Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreAddCheat(const char *CheatName, m64p_cheat_code *CodeList, int NumCodes)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>CheatName</tt>''' Pointer to NULL-terminated string containing a unique name for this Cheat Function.<br />
|
||||
'''<tt>CodeList</tt>''' Pointer to an array of <tt>m64p_cheat_code</tt> objects.<br />
|
||||
'''<tt>NumCodes</tt>''' Number of <tt>m64p_cheat_code</tt> elements in the cheat code array.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. A ROM image must be currently opened.
|
||||
|-
|
||||
|Usage
|
||||
|This function will add a Cheat Function to a list of currently active cheats which are applied to the open ROM, and set its state to Enabled. This function may be called before a ROM begins execution or while a ROM is currently running. Some cheat codes must be applied before the ROM begins executing, and may not work correctly if added after the ROM begins execution. A Cheat Function consists of a list of one or more <tt>m64p_cheat_code</tt> elements. If a Cheat Function with the given '''<tt>CheatName</tt>''' already exists, it will be removed and the new Cheat Function will be added in its place.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error CoreCheatEnabled(const char *CheatName, int Enabled)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>CheatName</tt>''' Pointer to NULL-terminated string containing the name of an existing Cheat Function.<br />
|
||||
'''<tt>Enabled</tt>''' Boolean value to which to set the enabled state of the specified Cheat Function.
|
||||
|-
|
||||
|Requirements
|
||||
|The Mupen64Plus library must already be initialized before calling this function. A ROM image must be currently opened.
|
||||
|-
|
||||
|Usage
|
||||
|This function enables or disables a specified Cheat Function.
|
||||
|}
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Video Extension API =
|
||||
|
||||
Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]. Plugin code should check the return value of each call to a libmupen64plus function.
|
||||
|
||||
All of these functions should only be called from within the video plugin; they should not be called from the front-end.
|
||||
|
||||
== Startup/Shutdown Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_Init(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Requirements
|
||||
|This function should be called before any other Video Extension functions.
|
||||
|-
|
||||
|Usage
|
||||
|This function should be called from within the RomOpen() video plugin function call. The default SDL implementation of this function simply calls SDL_InitSubSystem(SDL_INIT_VIDEO). It does not open a rendering window or switch video modes.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_Quit(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Usage
|
||||
|This function closes any open rendering window and shuts down the video system. The default SDL implementation of this function calls SDL_QuitSubSystem(SDL_INIT_VIDEO). This function should be called from within the RomClosed() video plugin function.
|
||||
|}
|
||||
<br />
|
||||
|
||||
== Screen Handling Functions ==
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_ListFullscreenModes(m64p_2d_size *SizeArray, int *NumSizes)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>SizeArray</tt>''' Pointer to an array of <tt>m64p_2d_size</tt> objects, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]<br />
|
||||
'''<tt>NumSizes</tt>''' Pointer to an integer which contains the size of '''<tt>SizeArray</tt>''' for input, and the number of size objects stored for output.
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to enumerate the available resolutions for fullscreen video modes. An array '''<tt>SizeArray</tt>''' is passed into the function, which is then filled (up to <tt>*'''NumSizes'''</tt> objects) with resolution sizes. The number of sizes actually written is stored in the integer which is pointed to by '''<tt>NumSizes</tt>'''.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<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><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.
|
||||
|-
|
||||
|Usage
|
||||
|This function creates a rendering window or switches into a fullscreen video mode. Any desired OpenGL attributes should be set before calling this function.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_SetCaption(const char *Title)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Title</tt>''' Pointer to a NULL-terminated string containing the desired title text of the emulator rendering window
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function sets the caption text of the emulator rendering window.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_ToggleFullScreen(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function. The rendering window should already be created.
|
||||
|-
|
||||
|Usage
|
||||
|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"
|
||||
|Prototype
|
||||
|'''<tt>void * VidExt_GL_GetProcAddress(const char* Proc)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Proc</tt>''' Pointer to a NULL-terminated string containing the name of the desired OpenGL extension function.
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to get a pointer to an OpenGL extension function. This is only necessary on the Windows platform, because the OpenGL implementation shipped with Windows only supports OpenGL version 1.1.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_GL_SetAttribute(m64p_GLattr Attr, int Value)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Attr</tt>''' Enumerated type (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) specifying which OpenGL attribute to set<br />
|
||||
'''<tt>Value</tt>''' Value to set for the attribute
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function. The desired attributes should be set before calling '''<tt>VidExt_SetVideoMode</tt>'''
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to set certain OpenGL attributes which must be specified before creating the rendering window with '''<tt>VidExt_SetVideoMode</tt>'''.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_GL_GetAttribute(m64p_GLattr Attr, int *pValue)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>Attr</tt>''' Enumerated type (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) specifying OpenGL attribute of which to get value<br />
|
||||
'''<tt>pValue</tt>''' Pointer to integer Value which will be set to attribute's value
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function may be used to check that OpenGL attributes where successfully set to the rendering window after the '''<tt>VidExt_SetVideoMode</tt>''' function call.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error VidExt_GL_SwapBuffers(void)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|N/A
|
||||
|-
|
||||
|Requirements
|
||||
|The video extension must be initialized before calling this function. The rendering window should already be created.
|
||||
|-
|
||||
|Usage
|
||||
|This function is used to swap the front/back buffers after rendering an output video frame.
|
||||
|}
|
||||
<br />
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
[http://mupen64plus.retrouprising.com Project page]
|
||||
|
||||
== Primary Goal ==
|
||||
|
||||
The primary goal of this re-architecture is to split this large project into smaller projects which may proceed to be developed independently of each other. The advantages of the new architecture are:
|
||||
* The build system can be greatly simplified
|
||||
* Each module can use its own build system. For example, the Qt GUI might switch to cmake for better Qt integration.
|
||||
* Porting the emulator core to other platforms (namely Win32) will be greatly simplified by removing the most platform-specific pieces.
|
||||
* Making releases for each package will be simpler and faster
|
||||
* Mupen64Plus may be included into the Debian/Ubuntu repositories since glN64 (with its 'unknown' license) will be a separate project
|
||||
|
||||
== Topography ==
|
||||
|
||||
This re-architecture will force us to lay boundaries with well-defined APIs between different parts of the emulator. Here are some initial suggestions for the new layout of the modules:
|
||||
|
||||
# Mupen64plus-core
|
||||
#* To simplify porting to other platforms, the core needs to be as lean as possible
|
||||
#* For this reason, the GUI interfaces, the ROM cache, and the zip/lzma/7zip decompressors will be removed
|
||||
#* The core will contain the code for:
|
||||
#** Emulating the R4300 main CPU and memory systems
|
||||
#** Loading and configuring plugins
|
||||
#** Reading, parsing, and writing all configuration files for the core + plugins
|
||||
#** Parsing and returning information about ROM images
|
||||
#** Core user interface for keyboard and LIRC input
|
||||
#** Savestates and screenshots
|
||||
#** An on-screen display
|
||||
#** Cheat and debugger core functions
|
||||
#** 'Dummy' plugins
|
||||
# Mupen64plus-console, Mupen64plus-gtk, Mupen64plus-qt
|
||||
#* Command-line only, GTK, and Qt front-end interfaces
|
||||
#* Each front-end for the core library will be a separate project
|
||||
#* The ROM cache code will be forked and included into both GUIs
|
||||
#* The front-ends will be responsible for finding and loading the core library and the plugins
|
||||
#* The dynamic library handle of the core will be passed to all the plugins, and the dynamic library handle of the plugins will be passed to the core
|
||||
#* The front-ends will be responsible for loading and decompressing the ROM image, and passing a pointer to the core
|
||||
# Plugins (RiceVideo, glN64, glide64, Blight Input, JTTL Audio)
|
||||
#* The plugins will be spun off into separate projects
|
||||
#* The plugin API will change, and will be incompatible with the old Zilmar spec
|
||||
|
||||
== Project Owners ==
|
||||
Richard42 will retain ownership of the Mupen64plus-core and Mupen64plus-console modules. I will recommend that Slougi take ownership of the Qt GUI. The plugins and GTK GUI are up for grabs.
|
||||
|
||||
== Work To Do ==
|
||||
Tasks which have been completed will be marked with the <s>strikethrough</s> format.
|
||||
|
||||
=== Prior to starting on the code ===
|
||||
# <s>Write design document for Core API</s>
|
||||
#* Front-end + debugger + cheat
|
||||
#* Configuration interface
|
||||
#* Video plugin
|
||||
#* Audio plugin
|
||||
#* Input plugin
|
||||
#* RSP plugin
|
||||
# <s>Set up new Mercurial repository for project</s>
|
||||
=== Coding tasks ===
|
||||
# <s>First steps</s>
|
||||
#* <s>Split & fork the source files into new structure</s>
|
||||
# Core
|
||||
#* <s>Refactor/simplify makefiles</s>
|
||||
#* <s>Remove #include statements from header files</s>
|
||||
#* <s>Write new configuration load/parse/save functionality</s>
|
||||
#* <s>Separate event loop out of main.c into new source file</s>
|
||||
#* <s>Fix broken WM_KeyDown/WM_KeyUp commands sent to input plugin</s>
|
||||
#* <s>Remove main() function</s>
|
||||
#* <s>Remove main/winlnxdefs.h</s>
|
||||
#* <s>Add new shared library interface (Must be thread-safe and re-entrant where necessary)</s>
|
||||
#** <s>api/callbacks.c</s>
|
||||
#** <s>api/common.c</s>
|
||||
#** <s>api/config.c</s>
|
||||
#** <s>api/debugger.c</s>
|
||||
#** <s>api/frontend.c</s>
|
||||
#** <s>api/vidext.c</s>
|
||||
#* <s>Refactor core code for new debug info interface (instead of printf(), send back to front-end)</s>
|
||||
#* <s>Modify plugin-handling code to use new plugin API</s>
|
||||
#* <s>Fix 64-bit dynamic recompiler for dynamic lib</s>
|
||||
#* <s>Update translate.c file handling and translations</s>
|
||||
#* <s>Update cheat.c cheat code handling</s>
|
||||
#* <s>Remove compare_core.c, add core comparison feature to console-ui</s>
|
||||
#* <s>Generate versioned core library</s>
|
||||
#* <s>Simplify makefile / pre.mk</s>
|
||||
#* <s>Refactor install.sh</s>
|
||||
#* Go through google code issue list, apply patches and close issue reports
|
||||
# Front-ends
|
||||
#* <s>Refactor/simplify makefiles</s>
|
||||
## <s>CLI</s>
|
||||
##* <s>Write from scratch, based on main.c</s>
|
||||
##* Update man page
|
||||
## GUI-Qt
|
||||
##* Adapt from previous mupen64puls Qt GUI code, pulling code from CLI front-end (Slougi)
|
||||
## GUI-GTK
|
||||
##* Adapt from previous mupen64puls GTK GUI code, pulling code from CLI front-end (TBD)
|
||||
# <s>Plug-ins</s>
|
||||
#* For each plug-in:
|
||||
#** <s>m64p-rsp-hle</s>
|
||||
#** <s>m64p-audio-sdl</s>
|
||||
#** <s>m64p-video-rice</s>
|
||||
#** <s>m64p-input-sdl</s>
|
||||
#* Remove existing configuration read/write code
|
||||
#* Add Deadzone and Scaling parameters to Blight Input plugin
|
||||
#* Refactor to use new configuration interface through core library
|
||||
#* Refactor for changes in core plugin API
|
||||
#* Refactor for new debug info interface (instead of printf(), send back to front-end)
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]
|
||||
|
||||
= Mupen64Plus v2.0 Plugin API =
|
||||
|
||||
This section lists all of the functions which are exported by the plugins. The front-end application should only use the PluginStartup, PluginShutdown, and PluginGetVersion functions. All other functions will only be called from the core.
|
||||
|
||||
== Common Plugin API ==
|
||||
These functions are present in all of the plugins.
|
||||
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context, void (*DebugCallback)(void *Context, int level, const char *Message))</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>CoreLibHandle</tt>''' Dynamic library handle (defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]]) corresponding with the core mupen64plus library.<br />
|
||||
'''<tt>Context</tt>''' Pointer which will be passed back to the '''<tt>DebugCallback</tt>''' function. Can be NULL.<br />
|
||||
'''<tt>DebugCallback</tt>''' Pointer to function in front-end for receiving debug information and warnings from the plugin. This function must be thread-safe. Can be NULL.
|
||||
|-
|
||||
|Requirements
|
||||
|This function must be called before any other plugin functions. The Core library must already be started before calling this function. This function must be called before attaching the plugin to the core.
|
||||
|-
|
||||
|Usage
|
||||
|This function initializes plugin for use by allocating memory, creating data structures, and loading the configuration data. This function may return <tt>M64ERR_INCOMPATIBLE</tt> if an older core library is used with a newer plugin.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error PluginShutdown(void)</tt>'''
|
||||
|-
|
||||
|Requirements
|
||||
|This plugin should be detached from the core before calling this function.
|
||||
|-
|
||||
|Usage
|
||||
|This function destroys data structures and releases memory allocated by the plugin library.
|
||||
|}
|
||||
<br />
|
||||
{| border="1"
|
||||
|Prototype
|
||||
|'''<tt>m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)</tt>'''
|
||||
|-
|
||||
|Input Parameters
|
||||
|'''<tt>PluginType</tt>''' Pointer to an enumerated type to store the plugin type of this plugin.<br />
|
||||
'''<tt>PluginVersion</tt>''' Pointer to an integer to store the version number of this plugin. Version number 2.1.3 would be stored as 0x00020103.<br />
|
||||
'''<tt>APIVersion</tt>''' Pointer to an integer to store the version number of the Core-Plugin API for this type of plugin used by this plugin.<br />
|
||||
'''<tt>PluginNamePtr</tt>''' Pointer to a const character pointer to receive the name of this plugin. The const char * which is returned must point to a persistent string (ie, not stored on the stack).<br />
|
||||
'''<tt>Capabilities</tt>''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the plugin which were built into the library during compilation. These are currently only defined for the core, so this will always return 0 for a plugin.
|
||||
|-
|
||||
|Usage
|
||||
|This function retrieves version information from the plugin. This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types. Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information.
|
||||
|}
|
||||
|
||||
== Video Plugin API ==
|
||||
|
||||
=== Mupen64Plus v2.0 Video Plugin API ===
|
||||
{|
|
||||
|<tt>void ChangeWindow(void);</tt>
|
||||
|Toggle Fullscreen/Windowed mode
|
||||
|-
|
||||
|<tt>BOOL InitiateGFX(GFX_INFO Gfx_Info);</tt>
|
||||
|Called during <tt>CoreAttachPlugin</tt> to send info about the emulator core to the graphics plugin and start up the graphics sub-system. This should create the rendering window and the OpenGL context.
|
||||
|-
|
||||
|<tt>void MoveScreen(int xpos, int ypos);</tt>
|
||||
|This function is called in response to the emulator receiving a WM_MOVE, passing the xpos and ypos from that message.
|
||||
|-
|
||||
|<tt>void ProcessDList(void);</tt>
|
||||
|Process high-level graphics D-list. (not currently used)
|
||||
|-
|
||||
|<tt>void ProcessRDPList(void);</tt>
|
||||
|Process low-level graphics D-list.
|
||||
|-
|
||||
|<tt>void RomClosed(void);</tt>
|
||||
|Called after the emulator is stopped.
|
||||
|-
|
||||
|<tt>int RomOpen(void);</tt>
|
||||
|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)'''
|
||||
|-
|
||||
|<tt>void ShowCFB (void);</tt>
|
||||
|Called from the RSP plugin to signal a condition to the video plugin.
|
||||
|-
|
||||
|<tt>void UpdateScreen(void);</tt>
|
||||
|This function is called in response to a VSync condition if the VI bit in MI_INTR_REG is set
|
||||
|-
|
||||
|<tt>void ViStatusChanged(void);</tt>
|
||||
|This function is called to notify the video plugin that the ViStatus registers value has been changed.
|
||||
|-
|
||||
|<tt>void ViWidthChanged(void);</tt>
|
||||
|This function is called to notify the video plugin that the ViWidth registers value has been changed.
|
||||
|-
|
||||
|<tt>void ReadScreen2(void *dest, int *width, int *height, int front);</tt>
|
||||
|This function reads the pixels of the frame buffer that is either currently displayed (front != 0) or being drawn (front == 0)
|
||||
|-
|
||||
|<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
|
||||
|-
|
||||
|<tt>void FBWrite(unsigned int addr, unsigned int size)</tt>
|
||||
|Write data from emulated RAM space into frame buffer
|
||||
|-
|
||||
|<tt>void FBGetFrameBufferInfo(void *p)</tt>
|
||||
|Get some information about the frame buffer
|
||||
|}
|
||||
|
||||
=== Remove From Older Video API ===
|
||||
{|
|
||||
|-
|
||||
|<tt>void CaptureScreen (char * Directory);</tt>
|
||||
|-
|
||||
|<tt>void CloseDLL(void);</tt>
|
||||
|-
|
||||
|<tt>void DllAbout(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllConfig(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllTest(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DrawScreen(void);</tt>
|
||||
|-
|
||||
|<tt>void GetDllInfo(PLUGIN_INFO *PluginInfo);</tt>
|
||||
|-
|
||||
|<tt>void ReadScreen(void **dest, int *width, int *height);</tt>
|
||||
|-
|
||||
|<tt>void SetConfigDir(char *configDir);</tt>
|
||||
|-
|
||||
|<br />
|
||||
<tt>typedef struct {...} PLUGIN_INFO</tt>
|
||||
|}
|
||||
|
||||
== Audio Plugin API ==
|
||||
|
||||
=== Mupen64Plus v2.0 Audio Plugin API ===
|
||||
{|
|
||||
|<tt>void AiDacrateChanged(int SystemType);</tt>
|
||||
|This function is called to notify the audio plugin that the AiDacrate register's value has been changed.
|
||||
|-
|
||||
|<tt>void AiLenChanged(void);</tt>
|
||||
|This function is called to notify the audio plugin that the AiLen register's value has been changed.
|
||||
|-
|
||||
|<tt>BOOL InitiateAudio(AUDIO_INFO Audio_Info);</tt>
|
||||
|Called during <tt>CoreAttachPlugin</tt> to send info about the emulator core to the audio plugin.
|
||||
|-
|
||||
|<tt>void ProcessAList(void);</tt>
|
||||
|Signal that there is an A-list to be processed. (not currently used)
|
||||
|-
|
||||
|<tt>int RomOpen(void);</tt>
|
||||
|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)'''
|
||||
|-
|
||||
|<tt>void RomClosed(void);</tt>
|
||||
|Called after the emulator is stopped.
|
||||
|-
|
||||
|<tt>void SetSpeedFactor(int percent);</tt>
|
||||
|Called when the emulator playback speed changes.
|
||||
|-
|
||||
|<tt>void VolumeUp(void);</tt><br />
|
||||
<tt>void VolumeDown(void);</tt>
|
||||
|Increase or decrease volume level
|
||||
|-
|
||||
|<tt>int VolumeGetLevel(void);</tt>
|
||||
|Get current volume level in percentage, between 0 and 100. '''***NEW***'''
|
||||
|-
|
||||
|<tt>void VolumeSetLevel(int level);</tt>
|
||||
|Set current volume level. <tt>level</tt> must be between 0 and 100. '''***NEW***'''
|
||||
|-
|
||||
|<tt>void VolumeMute(void);</tt>
|
||||
|Toggle between audio muted and un-muted
|
||||
|-
|
||||
|<tt>const char * VolumeGetString(void);</tt>
|
||||
|Return a string describing the current volume level
|
||||
|}
|
||||
|
||||
=== Remove From Older Audio API ===
|
||||
{|
|
||||
|-
|
||||
|<tt>DWORD AiReadLength(void);</tt>
|
||||
|-
|
||||
|<tt>void AiUpdate(BOOL Wait);</tt>
|
||||
|-
|
||||
|<tt>void CloseDLL(void);</tt>
|
||||
|-
|
||||
|<tt>void DllAbout(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllConfig(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllTest(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void GetDllInfo(PLUGIN_INFO *PluginInfo);</tt>
|
||||
|-
|
||||
|<tt>BOOL PauseAudio(BOOL Pause);</tt>
|
||||
|-
|
||||
|<tt>void SetConfigDir(char *configDir);</tt>
|
||||
|-
|
||||
|<br />
|
||||
<tt>typedef struct {...} PLUGIN_INFO</tt>
|
||||
|}
|
||||
|
||||
== Input Plugin API ==
|
||||
|
||||
=== Mupen64Plus v2.0 Input Plugin API ===
|
||||
{|
|
||||
|<tt>void ControllerCommand(int Control, BYTE * Command);</tt>
|
||||
|Process the raw data that has just been sent to a specific controller.
|
||||
|-
|
||||
|<tt>void GetKeys(int Control, BUTTONS * Keys);</tt>
|
||||
|Get the current state of the controller's buttons
|
||||
|-
|
||||
|<tt>void InitiateControllers(CONTROL_INFO ControlInfo);</tt>
|
||||
|Setup controller data structures
|
||||
|-
|
||||
|<tt>void ReadController(int Control, BYTE *Command);</tt>
|
||||
|Process the raw data in the pif ram that is about to be read. (not currently used)
|
||||
|-
|
||||
|<tt>int RomOpen(void);</tt>
|
||||
|Called just before the emulator begins executing a ROM. '''***changed*** - this function now returns an int (boolean)'''
|
||||
|-
|
||||
|<tt>void RomClosed(void);</tt>
|
||||
|Called after the emulator is stopped.
|
||||
|-
|
||||
|<tt>void SDL_KeyDown(int keymod, int keysym);</tt>
|
||||
|Pass a SDL_KEYDOWN-style message to the input plugin
|
||||
|-
|
||||
|<tt>void SDL_KeyUp(int keymod, int keysym);</tt>
|
||||
|Pass a SDL_KEYUP-style message to the input plugin
|
||||
|}
|
||||
|
||||
=== Remove From Older Input API ===
|
||||
{|
|
||||
|-
|
||||
|<tt>void CloseDLL(void);</tt>
|
||||
|-
|
||||
|<tt>void DllAbout(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllConfig(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllTest(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void GetDllInfo(PLUGIN_INFO *PluginInfo);</tt>
|
||||
|-
|
||||
|<tt>void SetConfigDir(char *configDir);</tt>
|
||||
|-
|
||||
|<tt>void WM_KeyDown(WPARAM wParam, LPARAM lParam);</tt>
|
||||
|-
|
||||
|<tt>void WM_KeyUp(WPARAM wParam, LPARAM lParam);</tt>
|
||||
|-
|
||||
|<br />
|
||||
<tt>typedef struct {...} PLUGIN_INFO</tt>
|
||||
|}
|
||||
|
||||
== RSP Plugin API ==
|
||||
|
||||
=== Mupen64Plus v2.0 RSP Plugin API ===
|
||||
{|
|
||||
|<tt>DWORD DoRspCycles(DWORD Cycles);</tt>
|
||||
|Process pending RSP tasks.
|
||||
|-
|
||||
|<tt>void InitiateRSP(RSP_INFO Rsp_Info, DWORD *CycleCount);</tt>
|
||||
|Called during <tt>CoreAttachPlugin</tt> to send info about the emulator core to the audio plugin.
|
||||
|-
|
||||
|<tt>void RomClosed(void);</tt>
|
||||
|Called after the emulator is stopped.
|
||||
|}
|
||||
|
||||
=== Remove From Older RSP API ===
|
||||
{|
|
||||
|-
|
||||
|<tt>void CloseDLL(void);</tt>
|
||||
|-
|
||||
|<tt>void DllAbout(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllConfig(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void DllTest(HWND hParent);</tt>
|
||||
|-
|
||||
|<tt>void GetDllInfo(PLUGIN_INFO *PluginInfo);</tt>
|
||||
|-
|
||||
|<tt>void GetRspDebugInfo(RSPDEBUG_INFO * RSPDebugInfo);</tt>
|
||||
|-
|
||||
|<tt>void InitiateRSPDebugger(DEBUG_INFO DebugInfo);</tt>
|
||||
|-
|
||||
|<br />
|
||||
<tt>typedef struct {...} PLUGIN_INFO</tt><br />
|
||||
<tt>typedef struct {...} RSPDEBUG_INFO</tt><br />
|
||||
<tt>typedef struct {...} DEBUG_INFO</tt>
|
||||
|}
|
||||
|
||||
@@ -1,327 +0,0 @@
|
||||
[http://mupen64plus.retrouprising.com Project page]
|
||||
|
||||
== m64p_types.h ==
|
||||
/* ----------------------------------------- */
|
||||
/* Platform-specific stuff */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
/* necessary headers */
|
||||
#if defined(WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/* DLL handles and function declaration specifiers */
|
||||
#if defined(WIN32)
|
||||
#define IMPORT extern "C" __declspec(dllimport)
|
||||
#define EXPORT __declspec(dllexport)
|
||||
#define CALL __cdecl
|
||||
typedef HMODULE m64p_dynlib_handle;
|
||||
#else
|
||||
#define IMPORT extern "C"
|
||||
#define EXPORT __attribute__((visibility("default")))
|
||||
#define CALL
|
||||
typedef void * m64p_dynlib_handle;
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* Structures and Types for Core library API */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
typedef void * m64p_handle;
|
||||
|
||||
typedef void (*m64p_frame_callback)(unsigned int FrameIndex);
|
||||
typedef void (*m64p_input_callback)(void);
|
||||
typedef void (*m64p_audio_callback)(void);
|
||||
typedef void (*m64p_vi_callback)(void);
|
||||
|
||||
typedef enum {
|
||||
M64TYPE_INT = 1,
|
||||
M64TYPE_FLOAT,
|
||||
M64TYPE_BOOL,
|
||||
M64TYPE_STRING
|
||||
} m64p_type;
|
||||
|
||||
typedef enum {
|
||||
M64MSG_ERROR = 1,
|
||||
M64MSG_WARNING,
|
||||
M64MSG_INFO,
|
||||
M64MSG_STATUS,
|
||||
M64MSG_VERBOSE
|
||||
} m64p_msg_level;
|
||||
|
||||
typedef enum {
|
||||
M64ERR_SUCCESS = 0,
|
||||
M64ERR_NOT_INIT, /* Function is disallowed before InitMupen64Plus() is called */
|
||||
M64ERR_ALREADY_INIT, /* InitMupen64Plus() was called twice */
|
||||
M64ERR_INCOMPATIBLE, /* API versions between components are incompatible */
|
||||
M64ERR_INPUT_ASSERT, /* Invalid parameters for function call, such as ParamValue=NULL for GetCoreParameter() */
|
||||
M64ERR_INPUT_INVALID, /* Invalid input data, such as ParamValue="maybe" for SetCoreParameter() to set a BOOL-type value */
|
||||
M64ERR_INPUT_NOT_FOUND, /* The input parameter(s) specified a particular item which was not found */
|
||||
M64ERR_NO_MEMORY, /* Memory allocation failed */
|
||||
M64ERR_FILES, /* Error opening, creating, reading, or writing to a file */
|
||||
M64ERR_INTERNAL, /* Internal error (bug) */
|
||||
M64ERR_INVALID_STATE, /* Current program state does not allow operation */
|
||||
M64ERR_PLUGIN_FAIL, /* A plugin function returned a fatal error */
|
||||
M64ERR_SYSTEM_FAIL, /* A system function call, such as an SDL or file operation, failed */
|
||||
M64ERR_UNSUPPORTED, /* Function call is not supported (ie, core not built with debugger) */
|
||||
M64ERR_WRONG_TYPE /* A given input type parameter cannot be used for desired operation */
|
||||
} m64p_error;
|
||||
|
||||
typedef enum {
|
||||
M64CAPS_DYNAREC = 1,
|
||||
M64CAPS_DEBUGGER = 2,
|
||||
M64CAPS_CORE_COMPARE = 4
|
||||
} m64p_core_caps;
|
||||
|
||||
typedef enum {
|
||||
M64PLUGIN_NULL = 0,
|
||||
M64PLUGIN_RSP = 1,
|
||||
M64PLUGIN_GFX,
|
||||
M64PLUGIN_AUDIO,
|
||||
M64PLUGIN_INPUT,
|
||||
M64PLUGIN_CORE
|
||||
} m64p_plugin_type;
|
||||
|
||||
typedef enum {
|
||||
M64EMU_STOPPED = 1,
|
||||
M64EMU_RUNNING,
|
||||
M64EMU_PAUSED
|
||||
} m64p_emu_state;
|
||||
|
||||
typedef enum {
|
||||
M64VIDEO_NONE = 1,
|
||||
M64VIDEO_WINDOWED,
|
||||
M64VIDEO_FULLSCREEN
|
||||
} m64p_video_mode;
|
||||
|
||||
typedef enum {
|
||||
M64VIDEOFLAG_SUPPORT_RESIZING = 1
|
||||
} m64p_video_flags;
|
||||
|
||||
typedef enum {
|
||||
M64CORE_EMU_STATE = 1,
|
||||
M64CORE_VIDEO_MODE,
|
||||
M64CORE_SAVESTATE_SLOT,
|
||||
M64CORE_SPEED_FACTOR,
|
||||
M64CORE_SPEED_LIMITER,
|
||||
M64CORE_VIDEO_SIZE,
|
||||
M64CORE_AUDIO_VOLUME,
|
||||
M64CORE_AUDIO_MUTE,
|
||||
M64CORE_INPUT_GAMESHARK,
|
||||
M64CORE_STATE_LOADCOMPLETE,
|
||||
M64CORE_STATE_SAVECOMPLETE
|
||||
} m64p_core_param;
|
||||
|
||||
typedef enum {
|
||||
M64CMD_NOP = 0,
|
||||
M64CMD_ROM_OPEN,
|
||||
M64CMD_ROM_CLOSE,
|
||||
M64CMD_ROM_GET_HEADER,
|
||||
M64CMD_ROM_GET_SETTINGS,
|
||||
M64CMD_EXECUTE,
|
||||
M64CMD_STOP,
|
||||
M64CMD_PAUSE,
|
||||
M64CMD_RESUME,
|
||||
M64CMD_CORE_STATE_QUERY,
|
||||
M64CMD_STATE_LOAD,
|
||||
M64CMD_STATE_SAVE,
|
||||
M64CMD_STATE_SET_SLOT,
|
||||
M64CMD_SEND_SDL_KEYDOWN,
|
||||
M64CMD_SEND_SDL_KEYUP,
|
||||
M64CMD_SET_FRAME_CALLBACK,
|
||||
M64CMD_TAKE_NEXT_SCREENSHOT,
|
||||
M64CMD_CORE_STATE_SET,
|
||||
M64CMD_READ_SCREEN,
|
||||
M64CMD_RESET,
|
||||
M64CMD_ADVANCE_FRAME
|
||||
} m64p_command;
|
||||
|
||||
typedef struct {
|
||||
unsigned int address;
|
||||
int value;
|
||||
} m64p_cheat_code;
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* Structures to hold ROM image information */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SYSTEM_NTSC = 0,
|
||||
SYSTEM_PAL,
|
||||
SYSTEM_MPAL
|
||||
} m64p_system_type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char init_PI_BSB_DOM1_LAT_REG; /* 0x00 */
|
||||
unsigned char init_PI_BSB_DOM1_PGS_REG; /* 0x01 */
|
||||
unsigned char init_PI_BSB_DOM1_PWD_REG; /* 0x02 */
|
||||
unsigned char init_PI_BSB_DOM1_PGS_REG2; /* 0x03 */
|
||||
unsigned int ClockRate; /* 0x04 */
|
||||
unsigned int PC; /* 0x08 */
|
||||
unsigned int Release; /* 0x0C */
|
||||
unsigned int CRC1; /* 0x10 */
|
||||
unsigned int CRC2; /* 0x14 */
|
||||
unsigned int Unknown[2]; /* 0x18 */
|
||||
unsigned char Name[20]; /* 0x20 */
|
||||
unsigned int unknown; /* 0x34 */
|
||||
unsigned int Manufacturer_ID; /* 0x38 */
|
||||
unsigned short Cartridge_ID; /* 0x3C - Game serial number */
|
||||
unsigned short Country_code; /* 0x3E */
|
||||
} m64p_rom_header;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char goodname[256];
|
||||
char MD5[33];
|
||||
unsigned char savetype;
|
||||
unsigned char status; /* Rom status on a scale from 0-5. */
|
||||
unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */
|
||||
unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */
|
||||
} m64p_rom_settings;
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* Structures and Types for the Debugger */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
typedef enum {
|
||||
M64P_DBG_RUN_STATE = 1,
|
||||
M64P_DBG_PREVIOUS_PC,
|
||||
M64P_DBG_NUM_BREAKPOINTS,
|
||||
M64P_DBG_CPU_DYNACORE,
|
||||
M64P_DBG_CPU_NEXT_INTERRUPT
|
||||
} m64p_dbg_state;
|
||||
|
||||
typedef enum {
|
||||
M64P_DBG_MEM_TYPE = 1,
|
||||
M64P_DBG_MEM_FLAGS,
|
||||
M64P_DBG_MEM_HAS_RECOMPILED,
|
||||
M64P_DBG_MEM_NUM_RECOMPILED,
|
||||
M64P_DBG_RECOMP_OPCODE = 16,
|
||||
M64P_DBG_RECOMP_ARGS,
|
||||
M64P_DBG_RECOMP_ADDR
|
||||
} m64p_dbg_mem_info;
|
||||
|
||||
typedef enum {
|
||||
M64P_MEM_NOMEM = 0,
|
||||
M64P_MEM_NOTHING,
|
||||
M64P_MEM_RDRAM,
|
||||
M64P_MEM_RDRAMREG,
|
||||
M64P_MEM_RSPMEM,
|
||||
M64P_MEM_RSPREG,
|
||||
M64P_MEM_RSP,
|
||||
M64P_MEM_DP,
|
||||
M64P_MEM_DPS,
|
||||
M64P_MEM_VI,
|
||||
M64P_MEM_AI,
|
||||
M64P_MEM_PI,
|
||||
M64P_MEM_RI,
|
||||
M64P_MEM_SI,
|
||||
M64P_MEM_FLASHRAMSTAT,
|
||||
M64P_MEM_ROM,
|
||||
M64P_MEM_PIF,
|
||||
M64P_MEM_MI,
|
||||
M64P_MEM_BREAKPOINT
|
||||
} m64p_dbg_mem_type;
|
||||
|
||||
typedef enum {
|
||||
M64P_MEM_FLAG_READABLE = 0x01,
|
||||
M64P_MEM_FLAG_WRITABLE = 0x02,
|
||||
M64P_MEM_FLAG_READABLE_EMUONLY = 0x04, // the EMUONLY flags signify that emulated code can read/write here, but debugger cannot
|
||||
M64P_MEM_FLAG_WRITABLE_EMUONLY = 0x08
|
||||
} m64p_dbg_mem_flags;
|
||||
|
||||
typedef enum {
|
||||
M64P_DBG_PTR_RDRAM = 1,
|
||||
M64P_DBG_PTR_PI_REG,
|
||||
M64P_DBG_PTR_SI_REG,
|
||||
M64P_DBG_PTR_VI_REG,
|
||||
M64P_DBG_PTR_RI_REG,
|
||||
M64P_DBG_PTR_AI_REG
|
||||
} m64p_dbg_memptr_type;
|
||||
|
||||
typedef enum {
|
||||
M64P_CPU_PC = 1,
|
||||
M64P_CPU_REG_REG,
|
||||
M64P_CPU_REG_HI,
|
||||
M64P_CPU_REG_LO,
|
||||
M64P_CPU_REG_COP0,
|
||||
M64P_CPU_REG_COP1_DOUBLE_PTR,
|
||||
M64P_CPU_REG_COP1_SIMPLE_PTR,
|
||||
M64P_CPU_REG_COP1_FGR_64,
|
||||
M64P_CPU_TLB
|
||||
} m64p_dbg_cpu_data;
|
||||
|
||||
typedef enum {
|
||||
M64P_BKP_CMD_ADD_ADDR = 1,
|
||||
M64P_BKP_CMD_ADD_STRUCT,
|
||||
M64P_BKP_CMD_REPLACE,
|
||||
M64P_BKP_CMD_REMOVE_ADDR,
|
||||
M64P_BKP_CMD_REMOVE_IDX,
|
||||
M64P_BKP_CMD_ENABLE,
|
||||
M64P_BKP_CMD_DISABLE,
|
||||
M64P_BKP_CMD_CHECK
|
||||
} m64p_dbg_bkp_command;
|
||||
|
||||
#define M64P_MEM_INVALID 0xFFFFFFFF // invalid memory read will return this
|
||||
|
||||
#define BREAKPOINTS_MAX_NUMBER 128
|
||||
|
||||
#define BPT_FLAG_ENABLED 0x01
|
||||
#define BPT_FLAG_CONDITIONAL 0x02
|
||||
#define BPT_FLAG_COUNTER 0x04
|
||||
#define BPT_FLAG_READ 0x08
|
||||
#define BPT_FLAG_WRITE 0x10
|
||||
#define BPT_FLAG_EXEC 0x20
|
||||
#define BPT_FLAG_LOG 0x40 //Log to the console when this breakpoint hits.
|
||||
|
||||
#define BPT_CHECK_FLAG(a, b) ((a.flags & b) == b)
|
||||
#define BPT_SET_FLAG(a, b) a.flags = (a.flags | b);
|
||||
#define BPT_CLEAR_FLAG(a, b) a.flags = (a.flags & (~b));
|
||||
#define BPT_TOGGLE_FLAG(a, b) a.flags = (a.flags ^ b);
|
||||
|
||||
typedef struct _breakpoint {
|
||||
unsigned int address;
|
||||
unsigned int endaddr;
|
||||
unsigned int flags;
|
||||
//unsigned int condition; //Placeholder for breakpoint condition
|
||||
} breakpoint;
|
||||
|
||||
/* ------------------------------------------------- */
|
||||
/* Structures and Types for Core Video Extension API */
|
||||
/* ------------------------------------------------- */
|
||||
|
||||
typedef struct {
|
||||
unsigned int uiWidth;
|
||||
unsigned int uiHeight;
|
||||
} m64p_2d_size;
|
||||
|
||||
typedef enum {
|
||||
M64P_GL_DOUBLEBUFFER = 1,
|
||||
M64P_GL_BUFFER_SIZE,
|
||||
M64P_GL_DEPTH_SIZE,
|
||||
M64P_GL_RED_SIZE,
|
||||
M64P_GL_GREEN_SIZE,
|
||||
M64P_GL_BLUE_SIZE,
|
||||
M64P_GL_ALPHA_SIZE,
|
||||
M64P_GL_SWAP_CONTROL,
|
||||
M64P_GL_MULTISAMPLEBUFFERS,
|
||||
M64P_GL_MULTISAMPLESAMPLES
|
||||
} m64p_GLattr;
|
||||
|
||||
typedef struct {
|
||||
unsigned int Functions;
|
||||
m64p_error (*VidExtFuncInit)(void);
|
||||
m64p_error (*VidExtFuncQuit)(void);
|
||||
m64p_error (*VidExtFuncListModes)(m64p_2d_size *, 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,40 +0,0 @@
|
||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.
|
||||
|
||||
Bitstream Vera Sans
|
||||
Bitstream Vera Sans - Roman Release 1.10 Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.
|
||||
|
||||
Bitstream Vera is a trademark of Bitstream, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts
|
||||
accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to
|
||||
reproduce and distribute the Font Software, including without limitation the rights to use, copy,
|
||||
merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom
|
||||
the Font Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright and trademark notices and this permission notice shall be included in all copies
|
||||
of one or more of the Font Software typefaces.
|
||||
|
||||
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or
|
||||
characters in the Fonts may be modified and additional glyphs or characters may be added to the
|
||||
Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word
|
||||
"Vera".
|
||||
|
||||
This License becomes null and void to the extent applicable to Fonts or Font Software that has been
|
||||
modified and is distributed under the "Bitstream Vera" names.
|
||||
|
||||
The Font Software may be sold as part of a larger software package but no copy of one or more of the
|
||||
Font Software typefaces may be sold by itself.
|
||||
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
||||
BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE
|
||||
GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL,
|
||||
SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
||||
DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc.,
|
||||
shall not be used in advertising or otherwise to promote the sale, use or other dealings in this
|
||||
Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc.,
|
||||
respectively. For further information, contact: fonts at gnome dot org.http://www.bitstream.com
|
||||
|
||||
@@ -1,342 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
|
||||
@@ -1,505 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
||||
@@ -1,192 +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
|
||||
|
||||
- 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.
|
||||
|
||||
|
||||
@@ -1,413 +0,0 @@
|
||||
This page describes the dynamic recompiler in [[Mupen64Plus]], and the changes made for the ARM port.
|
||||
|
||||
==The original dynamic recompiler by Hacktarux==
|
||||
|
||||
The dynamic recompiler used in Mupen64plus v1.5 is based on the original written by Hacktarux in 2002.
|
||||
|
||||
It recompiles contiguous blocks of MIPS instructions. First, each instruction is decoded into a dynamically-allocated 132-byte data structure.
|
||||
|
||||
<source lang="text">
|
||||
typedef struct _precomp_instr
|
||||
{
|
||||
void (*ops)();
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
long long int *rs;
|
||||
long long int *rt;
|
||||
short immediate;
|
||||
} i;
|
||||
struct
|
||||
{
|
||||
unsigned int inst_index;
|
||||
} j;
|
||||
struct
|
||||
{
|
||||
long long int *rs;
|
||||
long long int *rt;
|
||||
long long int *rd;
|
||||
unsigned char sa;
|
||||
unsigned char nrd;
|
||||
} r;
|
||||
struct
|
||||
{
|
||||
unsigned char base;
|
||||
unsigned char ft;
|
||||
short offset;
|
||||
} lf;
|
||||
struct
|
||||
{
|
||||
unsigned char ft;
|
||||
unsigned char fs;
|
||||
unsigned char fd;
|
||||
} cf;
|
||||
} f;
|
||||
unsigned int addr; /* word-aligned instruction address in r4300 address space */
|
||||
unsigned int local_addr; /* byte offset to start of corresponding x86_64 instructions, from start of code block */
|
||||
reg_cache_struct reg_cache_infos;
|
||||
} precomp_instr;
|
||||
</source>
|
||||
|
||||
The decoded instructions are then compiled, generating x86 instructions for each MIPS instruction. A 32K block is allocated with malloc() to hold the x86 code. If this size proves insufficient, it is incrementally resized with realloc().
|
||||
|
||||
MIPS registers are allocated to x86 registers with a least-recently-used replacement policy. All cached registers are written back prior to a branch, or a memory read or write.
|
||||
|
||||
To facilitate invalidation and replacement of modified code blocks, each 4K page is compiled separately. If a sequence of instructions crosses a 4K page boundary, the current block is ended, and the next instructions will be compiled as a separate block.
|
||||
|
||||
Branch instructions within a 4K page are compiled as branches directly to the target address. Branches which cross a 4K page go through an indirect address lookup.
|
||||
|
||||
Compiled code blocks are invalidated on write. On an actual MIPS CPU, the instruction cache is invalidated using the CACHE instruction, however a few N64 games clear the cache using other methods. Trapping writes appears to be the most reliable method of ensuring cache coherency in the emulated system. The cache instruction is ignored.
|
||||
|
||||
==Problems with the original design==
|
||||
|
||||
The most significant performance problem with this design is its excessive memory usage. The decoded instruction data is retained (132 bytes for each MIPS instruction) and occasionally referenced during execution. Memory accesses frequently miss the L2 cache, resulting in poor performance.
|
||||
|
||||
Additionally, the register cache is relatively inefficient, since all registers are flushed before any read or write operation.
|
||||
|
||||
==A new approach==
|
||||
|
||||
To reduce memory usage, the new design allocates a single large block of memory (generally 32 MiB, but the size is configurable) which is used for recompiled code. This memory is allocated using mmap with the PROT_EXEC bit set, to ensure operation on CPUs with no-execute (NX) page permissions.
|
||||
|
||||
Contiguous blocks of MIPS instructions are compiled (that is, it does not attempt to follow branches or 'hot-paths').
|
||||
|
||||
The recompiler consists of eight stages, plus a linker, and a memory manager.
|
||||
|
||||
Compiled blocks are invalidated on write, as before, however as the compiler will cross a 4K page, writes may invalidate adjacent pages as well.
|
||||
|
||||
Currently the dynarec generates x86, x86-64, ARMv5, and ARMv7 (little-endian). Most of the code is shared between the architectures, but a different code generator is included at compile time, using different #include statements depending on the CPU type.
|
||||
|
||||
==Pass 1: Disassembly==
|
||||
|
||||
When an instruction address is encountered which has not been compiled, the function new_recompile_block is called, with the (virtual) address of the target instruction as its sole parameter. If the address is invalid, the function returns a nonzero value and the caller is responsible for handling the pagefault.
|
||||
|
||||
Instructions are decoded until an unconditional jump, usually a return, is encountered. Disassembly is ordinarilly continued past a JAL (subroutine call) instruction, however this strategy is abandoned if invalid instructions are encountered.
|
||||
|
||||
Up to 4096 instructions (16K of MIPS code) may be disassembled at once. Surprisingly, some games do actually reach this limit.
|
||||
|
||||
==Pass 2: Liveness analysis==
|
||||
|
||||
After disassembly, liveness analysis is performed on the registers. This determines when a particular register will no longer be used, and thus can be removed from the register cache.
|
||||
|
||||
A separate analysis is done on the upper 32 bits of 64-bit registers. This can determine when only the lower 32 bits of a register are significant, thus allowing use of a 32-bit register. This enables more efficient code generation on 32-bit processors.
|
||||
|
||||
==Pass 3: Register allocation==
|
||||
|
||||
The 31 MIPS registers must be mapped onto seven available registers on x86, or twelve available registers on ARM.
|
||||
|
||||
Instructions with 64-bit results require two registers on 32-bit host processors. 32-bit instructions require only one. A flag is set for registers containing 32-bit values, and these registers will be sign-extended before they are written to the register file.
|
||||
|
||||
Registers are made available using a least-soon-needed replacement policy. When the register cache is full, and no registers can be eliminated using the liveness analysis, a ten-instruction lookahead is used to determine which registers will not be needed soon and these registers are evicted from the cache.
|
||||
|
||||
==Pass 4: Free unused registers==
|
||||
|
||||
After the initial register allocation, the allocations are reviewed to determine if any registers remain allocated longer than necessary. These are then removed from the register cache. This avoids having to write back a large number of registers just before a branch, and makes more registers available for the next pass.
|
||||
|
||||
==Pass 5: Pre-allocate registers==
|
||||
|
||||
If a register will be used soon and needs to be loaded, try to load it early if the register is available. This improves execution on CPUs with a load-use penalty.
|
||||
|
||||
==Pass 6: Optimize clean/dirty state==
|
||||
|
||||
If a cached register is 'dirty' and needs to be written out, try to do so as soon as the register will no longer be modified. This avoids having to write the same register on multiple code paths due to conditional branches. Additionally, try to avoid writing out dirty registers inside of loops.
|
||||
|
||||
==Pass 7: Identify where registers are assumed to be 32-bit==
|
||||
|
||||
When a 64-bit register is mapped to a 32-bit register with the assumption that the value will be sign-extended before being used, it is necessary to ensure that no register contains a 64-bit value when branching to such a location. These instructions are flagged to identify them as requiring 32-bit inputs. This information is used by the linker, and the exception return (ERET) handler.
|
||||
|
||||
==Pass 8: Assembly==
|
||||
|
||||
This generates and outputs the recompiled code.
|
||||
|
||||
Following the main code block, handlers for certain exceptions as well as alternate entry points are added.
|
||||
|
||||
If a recompiled instruction relies on a certain MIPS register being cached in a certain native register, then a short 'stub' of code is generated to load the necessary registers. When an instruction outside of this block needs to jump to that location, it will instead jump to the stub. The necessary registers will be loaded, and then it will jump into the main code sequence.
|
||||
|
||||
On architectures which require literal pools (ARMv5) these are inserted as necessary.
|
||||
|
||||
==Linker==
|
||||
|
||||
The linker fills in all unresolved branches. Branches within the block are linked to their target address. Branches which jump outside of the block are linked to their target if that address has been compiled already. These inter-block branches are recorded in the jump_out array. This information will be used to remove the links in the event that the target of the branch is invalidated.
|
||||
|
||||
Unresolved branches point to a stub which loads the address of the branch instruction and the virtual address of its target into registers, and calls the dynamic linker. When this code is executed, the dynamic linker will compile the target if necessary, and then patch the branch instruction with the new address.
|
||||
|
||||
==Memory manager==
|
||||
|
||||
The last step in new_recompile_block is to ensure that there will be sufficient memory available to compile the next block. If there is not, then the oldest blocks are purged.
|
||||
|
||||
The dynarec cache can be described as a 32MB circular buffer divided into eight segments. Memory is allocated in order from beginning to end.
|
||||
|
||||
When there are less than 2 empty segments, the next segment in sequence is cleared, wrapping around to the beginning of the buffer. This continues as memory is needed, wrapping around from end to beginning.
|
||||
|
||||
==Invalidation and restoration==
|
||||
|
||||
Normally, code blocks are looked up via a hash table, using the virtual address of the target instruction. However, for purposes of invalidation, blocks are grouped by physical address. This can be described as a virtually-indexed, physically-tagged (VIPT) cache.
|
||||
|
||||
References to compiled blocks are stored in one of 4096 linked lists in the jump_in array. Each list covers a 4K block of memory, and 2048 such lists are sufficient to cover the 8MB of RAM in the Nintendo 64. The remaining lists are for code in ROM, and the bootloader in SP memory.
|
||||
|
||||
When a write hits a memory page marked as cached, all entries in the corresponding list are invalidated. If any code is found to cross a 4K boundary, the adjacent lists are invalidated also.
|
||||
|
||||
Sometimes blocks may be invalidated even when none of the code is actually modified. This can happen if data is written to memory in the same 4K page, or if code is reloaded without actually modifying it. If blocks which were previously invalidated are subsequently found to be unmodified, those blocks are marked in the restore_candidate array. If the block remains unmodified, it will be restored as a valid block, to avoid recompiling blocks which do not need to be recompiled. This is performed by the clean_blocks function which is called periodically.
|
||||
|
||||
The jump_in array, which lists unmodified blocks, is physically indexed, however the jump_dirty array, which lists potentially-modified blocks, is virtually indexed. This allows blocks which have changed physical addresses, but are still at the same virtual address, to be recognized as being the same as before, and not in need of recompilation.
|
||||
|
||||
==Dynamic linker==
|
||||
|
||||
Branches with unresolved addresses jump to the dynamic linker. This will look through the jump_in list corresponding to the physical page containing the virtual target address. If found, the branch instruction will be patched with the address, and then it will jump to this address.
|
||||
|
||||
If not found, the jump_dirty list will be searched for blocks which were previously compiled but may have been modified. If a potential match is found, the code will be compared against a cached copy to determine if any changes have been made. If not, then it will jump to the block. Because the memory could be modified again, branch instructions referencing these blocks are not altered, and continue to point to the dynamic linker. These blocks will continue to be verified each time they are called, until restored to the jump_in list by the clean_blocks function described above.
|
||||
|
||||
If no compiled block is found, or the existing block was modified, the target is recompiled.
|
||||
|
||||
==Address lookup==
|
||||
|
||||
When a JR (jump register) instruction is encountered, the address of the recompiled code must be looked up using the address of the MIPS code. The majority of such instructions jump to the link register (r31) to return to the location following a JAL (call) instruction.
|
||||
|
||||
When a JAL or JALR is executed, the address of the following instruction is inserted into a small 32-entry hash table, which is checked when a JR r31 instruction is executed. This allows for a quick return from subroutine calls.
|
||||
|
||||
If the JR instruction uses a register other than r31, or the small hash table lookup fails to find a match, a larger 131072-entry hash table is checked. This table contains 65536 bins with up to 2 addresses per bin. If this also fails to find a match (which occurs less than 1% of the time) an exhaustive search of all compiled addresses within that 4K memory page is performed.
|
||||
|
||||
If no match is found by any of these methods, the target address is compiled, and the new address is inserted into the hash table.
|
||||
|
||||
==Cycle counting==
|
||||
|
||||
Cycles are counted before each branch by adding the cycles from the preceding instructions to a specific register. The cycle count is in R10 on ARM and ESI on x86. The value in this register is normally a negative number. When this number exceeds zero, a conditional branch is taken which jumps to an interrupt handler.
|
||||
|
||||
For example, the following x86 code adds eight cycles:
|
||||
|
||||
<source lang="text">
|
||||
add $8,%esi
|
||||
jns interrupt_handler
|
||||
</source>
|
||||
|
||||
The conditional branch jumps to a small bit of code located after the main compiled block, which saves the cached registers to the register file, sets the instruction pointer which will be used upon return from the interrupt, and then calls cc_interrupt.
|
||||
|
||||
As in the original mupen64plus, the emulated clock runs at 37.5 MHz, and each instruction takes 2 clock cycles.
|
||||
|
||||
==Interrupt handler==
|
||||
|
||||
When the cycle count register reaches its limit, cc_interrupt is called, which in turn calls gen_interrupt [sic]. If interrupts are not enabled, cc_interrupt returns. If interrupts are enabled, and an interrupt is to be taken, the pending_exception flag will be set. In this case, cc_interrupt does not return, and instead pops the stack and causes an unconditional jump to the address in pcaddr (usually 0x80000180).
|
||||
|
||||
There is one additional case where the interrupt handler may be called. If interrupts were disabled, and are enabled by writing to coprocessor 0 register 12, any pending interrupts are handled immediately.
|
||||
|
||||
==Delay slots==
|
||||
|
||||
MIPS has 'delay slots', where the instruction after the branch is executed before the branch is taken. Instructions in delay slots are issued out-of-order in the recompiled code.
|
||||
|
||||
[[Image:Recompiler delay slot reordering.png]]
|
||||
|
||||
When a branch jumps into the delay slot of another branch, this case must be handled slightly differently:
|
||||
|
||||
[[Image:Recompiler delay slot reordering 2.png]]
|
||||
|
||||
The branch test and delay slot are executed in-order if a dependency exists, or for 'likely' branches where the delay slot is nullified when the branch condition is false. These cases are infrequent (typically less than 10% of branches).
|
||||
|
||||
==Constant propagation==
|
||||
|
||||
When an instruction loads a constant into a register, the register is tagged as a constant. The constant tag will be retained if subsequent instructions modify the constant using other constants. During assembly, such a sequence of instructions is combined into a single load. For example:
|
||||
|
||||
<source lang="text">
|
||||
LUI r8,12340000 --> mov $0x12345678,%eax
|
||||
ORI r8,r8,5678
|
||||
</source>
|
||||
|
||||
This optimization is not performed where a branch target intervenes, eg
|
||||
|
||||
<source lang="text">
|
||||
...
|
||||
LUI r8,12340000 --> mov $0x12340000,%eax
|
||||
L1:
|
||||
ORI r8,r8,5678 --> or $0x5678,%eax
|
||||
...
|
||||
BEQ r0,r0,L1
|
||||
</source>
|
||||
|
||||
Registers containing constants are identified by bits in the isconst and wasconst fields of the regstat structure. The wasconst bit is set for a register if the register contained a known constant before the instruction, and the isconst bit is set for a register if the register will contain a known constant after the instruction executes.
|
||||
|
||||
==Translation lookaside buffer emulation==
|
||||
|
||||
Most Nintendo 64 games do not use virtual memory, but some do. At startup, main memory is directly mapped at addresses from 0x80000000 to 0x803FFFFF, or up to 0x807FFFFF if the memory expansion is used.
|
||||
|
||||
Normally, read or write operations are checked against this range, and if outside this range, control is passed to the appropriate I/O handler. This is done as follows:
|
||||
|
||||
MIPS instruction: LW r1,8(r2)
|
||||
|
||||
ARM code:
|
||||
<source lang="text">
|
||||
add r1, r2, #8
|
||||
cmp r1, #8388608
|
||||
bvc handler
|
||||
ldr r1, [r1]
|
||||
</source>
|
||||
|
||||
If there are valid entries in the TLB, this would instead be compiled as follows:
|
||||
<source lang="text">
|
||||
add r1, r2, #8
|
||||
mov r0, #264
|
||||
add r0, r0, r1, lsr #12
|
||||
ldr r0, [r11, r0, lsl #2]
|
||||
tst r0, r0
|
||||
bmi handler
|
||||
ldr r1, [r1, r0, lsl #2]
|
||||
</source>
|
||||
|
||||
This looks up the offset in the memory_map table (which, in this example, is located at r11+264*4). The high bit is tested to determine whether a valid mapping exists for this page.
|
||||
|
||||
==Page fault emulation==
|
||||
|
||||
If a memory address references an invalid page, a conditional branch is taken to a bit of code placed after the main block. This will save any modified cached registers, and call an appropriate handler function for the address. The handler will either perform I/O, or generate an exception (pagefault).
|
||||
|
||||
==Mapping executable pages==
|
||||
|
||||
If the dynamic recompiler encounters code which is not in contiguous physical memory, it will end the block at the page boundary, so that the block can be removed cleanly if the mapping is changed.
|
||||
|
||||
There is a special case of this, where a branch and delay slot span two pages. If a branch instruction is the last instruction in a virtual memory page, it is compiled in a different manner than other branches. The branch condition is evaluated, and the target address is placed in a register (%ebp on x86, and r8 on ARM). A special form of the dynamic linker (dyna_linker_ds) is used to link the branch to its corresponding delay slot in another block. If no page fault occurs, the delay slot executes and then jumps to the address in the register. For conditional branches that are not taken, the target address is the next instruction. This code is generated by the pagespan_assemble function.
|
||||
|
||||
== Self-modifying code detection ==
|
||||
|
||||
Pages not containing code which has been compiled or where the code may have been modified since compilation are marked in the invalid_code array. Writes are checked against this array, and if a write hits a valid (compiled and unmodified) page, invalidate_block is called:
|
||||
|
||||
MIPS instruction: SW r1,8(r2)
|
||||
|
||||
ARM code:
|
||||
<source lang="text">
|
||||
ldr r3, [r11, #88] // pointer to invalid_code
|
||||
add r4, r2, #8
|
||||
cmp r4, #8388608
|
||||
bvc handler
|
||||
str r1, [r4]
|
||||
ldrb r14, [r3, r4 lsr #12]
|
||||
cmp r14, #1
|
||||
bne invstub
|
||||
</source>
|
||||
|
||||
In TLB mode, the invalid_code array is not checked directly. Instead, pages are marked non-writable in memory_map.
|
||||
|
||||
== Long jumps ==
|
||||
|
||||
Branch instructions are limited to a +/-32MB range on ARM. In some cases, the dynamic recompiler needs to generate calls to locations beyond this range. This is accomplished via a jump table located at the end of the code generation area, and the full address is loaded via a pointer. The jump table is generated in arch_init().
|
||||
|
||||
As these indirect jumps cause some delay, it is best to avoid this situation if possible, by locating this area close to the other executable code.
|
||||
|
||||
== Compile options ==
|
||||
|
||||
=== ARMv5_ONLY ===
|
||||
|
||||
If this is defined, the UXTH instruction is not used, and the dynamic recompiler will generate literal pools instead of using movw/movt. This provides compatibility with older processors, but generates somewhat less efficient code.
|
||||
|
||||
=== RAM_OFFSET ===
|
||||
|
||||
When compiling for ARM, this allocates an additional register which is used to add an offset to all pointers to memory addresses between 0x80000000 and 0x807FFFFF. This allows the N64's memory to be mapped at an alternate address. This incurs a small performance penalty, but is required for certain operating systems (eg Google Android, which places shared libraries at 0x80000000).
|
||||
|
||||
This option is not used for x86. The x86 instruction set allows for a full 32-bit offset in the instruction encoding, making it unnecessary to allocate an additional register for this purpose.
|
||||
|
||||
=== CORTEX_A8_BRANCH_PREDICTION_HACK ===
|
||||
|
||||
If this is defined, the dynamic recompiler will avoid generating consecutive branch instructions without another instruction in between. This avoids a possible branch misprediction on the Cortex-A8 due to this processor having dual instruction decoders, but only one branch-prediction unit. See [[Assembly Code Optimization]] for details.
|
||||
|
||||
=== USE_MINI_HT ===
|
||||
|
||||
If this is defined, attempt to look up return addresses in a small hash table before checking the larger hash table. Usually improves performance.
|
||||
|
||||
=== IMM_PREFETCH ===
|
||||
|
||||
If this is defined, the x86 PREFETCH instruction is used to prefetch entries from the hash table. The increase in code size often outweighs the benefit of this.
|
||||
|
||||
=== REG_PREFETCH ===
|
||||
|
||||
Similar to the above, but loads the address into a register first, then uses the ARM PLD instruction. The increase in code size almost always outweighs the benefit of this.
|
||||
|
||||
=== R29_HACK ===
|
||||
|
||||
Assume that the stack pointer (r29) is always a valid memory address and do not check it. It is similar to the optimization described [http://strmnnrmn.blogspot.com/2007/08/interesting-dynarec-hack.html here]. This can crash the emulator and is not enabled by default.
|
||||
|
||||
== Debugging ==
|
||||
|
||||
Debugging information can be obtained by defining the assem_debug macro as printf. This will cause the dynamic recompiler to print debugging information to stdout. For each disassembled MIPS instruction, an entry similar to the following will be printed:
|
||||
|
||||
<source lang="text">
|
||||
U: r1 r8 r11 r16 r31 UU: r29 32: r0 r9
|
||||
pre: eax=-1 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1
|
||||
needs: ecx ebp esi r: r9
|
||||
entry: eax=-1 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1
|
||||
dirty: ecx ebp esi
|
||||
800001d8: LW r16,r29+14
|
||||
eax=16 ecx=9 edx=-1 ebx=-1 ebp=29 esi=36 edi=-1 dirty: eax ecx ebp esi
|
||||
32: r0 r9 r16
|
||||
</source>
|
||||
|
||||
U: A list of MIPS registers which will not be used before they are overwritten (liveness analysis)
|
||||
|
||||
UU: A list of MIPS registers for which the upper 32 bits will not be used before they are overwritten
|
||||
|
||||
32: Registers that contain 32-bit sign-extended values
|
||||
|
||||
pre: The state of the register mapping prior to execution of this instruction. (-1 = no mapping; 36 = cycle count; The complete list of values with special meanings can be found in the source code)
|
||||
|
||||
needs: a list of register mappings that were considered necessary and which could not be eliminated to make room for other mappings
|
||||
|
||||
r: Registers that are known to contain 32-bit values and where optimizations rely on the assumption that the register does not contain a value outside of the range -2<sup>31</sup> to 2<sup>31</sup>-1
|
||||
|
||||
entry: The minimum set of register mappings required to jump to this point
|
||||
|
||||
dirty: Cached registers that have been modified and will need to be written back
|
||||
|
||||
address: instruction - The decoded opcode, followed by the register mapping in effect after this instruction executes
|
||||
|
||||
An asterisk (*) designates locations which are the target of a branch instruction. Constant propagation will not be performed across these points.
|
||||
|
||||
After the complete disassembly, the recompiled native code is shown.
|
||||
|
||||
Note that the output can be quite voluminous; 20-30 MB is typical.
|
||||
|
||||
==Potential improvements==
|
||||
|
||||
===Copy propagation/offset propagation===
|
||||
|
||||
A common instruction sequence is of the form:
|
||||
|
||||
<source lang="text">
|
||||
LUI r9,12340000
|
||||
ADD r9,r9,r8
|
||||
LW r9,5678(r9)
|
||||
</source>
|
||||
|
||||
It would be helpful to recognize this as a load from r8+12345678. The current constant propagation code does not do so.
|
||||
|
||||
===Constant propagation and register assignment===
|
||||
|
||||
Constant propagation is currently done after register assignment. Registers are assigned even if the register will always contain a known value. In certain cases, such as where the constant is used only to generate a memory address, this could be avoided and no register would need to be allocated.
|
||||
|
||||
===Unaligned memory access===
|
||||
|
||||
A small improvement could be made by combining adjacent LWL/LWR instructions. The potential gain from doing so is very limited because these instructions typically represent less than 1% of all memory accesses.
|
||||
|
||||
===SLT/branch merging===
|
||||
|
||||
A frequent occurrence in MIPS code is an SLT or SLTI instruction followed by a branch. This is generated relatively inefficiently on x86 and ARM, first doing a compare and set, then testing this value and doing a conditional branch. Doing only one comparison would save at least one instruction, and could potentially save up to three instructions if the liveness analysis reveals that the result of the SLT instruction is used nowhere else.
|
||||
|
||||
While a potentially useful optimization, there are several problems with this approach. First, there are often additional instructions between the slt and the branch. These must be checked to make sure they do not modify the registers as that would prevent reordering the instruction stream as desired. Secondly, if the result of the slt is found to be live, but unmodified, on both paths of the branch, clean_registers will normally write this value before the branch, to avoid duplicating the writeback code on both paths of the branch. This optimization would have to be removed if the slt was combined with the branch.
|
||||
|
||||
===x86-64===
|
||||
|
||||
Currently the x86-64 backend generates only 32-bit instructions. Proper 64-bit code generation would improve performance.
|
||||
|
||||
===PowerPC===
|
||||
|
||||
It would be possible to add a PowerPC code generator to the dynamic recompiler. Currently no one is working on this. (The mupen64gc project is using a different codebase.)
|
||||
|
||||
The following is a summary of the changes which would be necessary to add a PowerPC backend.
|
||||
|
||||
The slt* instructions use conditional moves, which are unavailable on PowerPC. A suitable alternative (such as moves from the condition register) would need to be used.
|
||||
|
||||
The assembler can generate as much as 256K of code in a single block, however conditional branches on PowerPC are limited to +/-64K. It will be necessary to either restrict the block size, or insert jump tables in a manner similar to the literal pools on ARM.
|
||||
|
||||
PowerPC generally relies on early branch resolution rather than statistical branch prediction. Scheduling branch condition tests earlier may be advantageous. (For example, the address bounds check could be done in address_generation, rather than just before the load or store. Similarly it may be advantageous to test the branch condition and update the cycle count before executing the delay slot.)
|
||||
|
||||
===MIPS===
|
||||
|
||||
Recompiling MIPS into MIPS would be relatively straightforward, however the current code generator has no facility for filling delay slots. This capability would be required for efficient code generation.
|
||||
|
||||
[[Category:Emulators]]
|
||||
[[Category:Optimization]]
|
||||
[[Category:Development]]
|
||||
@@ -1,46 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-core - api/debugger.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Copyright (C) 2009 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 *
|
||||
* 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. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This file contains the definitions for debugger functions which will be
|
||||
* called from the other Core modules
|
||||
*/
|
||||
|
||||
#ifndef API_DEBUGGER_H
|
||||
#define API_DEBUGGER_H
|
||||
|
||||
#include "m64p_types.h"
|
||||
|
||||
/* Debugger Definitions */
|
||||
|
||||
typedef enum {
|
||||
DEBUG_UI_INIT = 1,
|
||||
DEBUG_UI_UPDATE,
|
||||
DEBUG_UI_VI,
|
||||
DEBUG_CORE_COMPARE
|
||||
} eDbgCallbackType;
|
||||
|
||||
/* Functions for use by the Core, to send information back to the front-end app */
|
||||
extern void DebuggerCallback(eDbgCallbackType type, unsigned int param);
|
||||
extern void CoreCompareCallback(void);
|
||||
extern void CoreCompareDataSync(int length, void *ptr);
|
||||
|
||||
#endif /* API_DEBUGGER_H */
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-core - m64p_debugger.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Copyright (C) 2009 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 *
|
||||
* 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. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This header file defines typedefs for function pointers to Core Debugger
|
||||
* functions.
|
||||
*/
|
||||
|
||||
#ifndef M64P_DEBUGGER_H
|
||||
#define M64P_DEBUGGER_H
|
||||
|
||||
#include "m64p_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* DebugSetCallbacks()
|
||||
*
|
||||
* This function is called by the front-end to supply debugger callback
|
||||
* function pointers. If debugger is enabled and then later disabled within the
|
||||
* UI, this function may be called with NULL pointers in order to disable the
|
||||
* callbacks.
|
||||
*/
|
||||
typedef m64p_error (*ptr_DebugSetCallbacks)(void (*)(void), void (*)(unsigned int), void (*)(void));
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL DebugSetCallbacks(void (*)(void), void (*)(unsigned int), void (*)(void));
|
||||
#endif
|
||||
|
||||
/* DebugSetCoreCompare()
|
||||
*
|
||||
* This function is called by the front-end to supply callback function pointers
|
||||
* for the Core Comparison feature.
|
||||
*/
|
||||
typedef m64p_error (*ptr_DebugSetCoreCompare)(void (*)(unsigned int), void (*)(int, void *));
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL DebugSetCoreCompare(void (*)(unsigned int), void (*)(int, void *));
|
||||
#endif
|
||||
|
||||
/* DebugSetRunState()
|
||||
*
|
||||
* This function sets the run state of the R4300 CPU emulator.
|
||||
*/
|
||||
typedef m64p_error (*ptr_DebugSetRunState)(int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL DebugSetRunState(int);
|
||||
#endif
|
||||
|
||||
/* DebugGetState()
|
||||
*
|
||||
* This function reads and returns a debugger state variable, which are
|
||||
* enumerated in m64p_types.h.
|
||||
*/
|
||||
typedef int (*ptr_DebugGetState)(m64p_dbg_state);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT int CALL DebugGetState(m64p_dbg_state);
|
||||
#endif
|
||||
|
||||
/* DebugStep()
|
||||
*
|
||||
* This function signals the debugger to advance one instruction when in the
|
||||
* stepping mode.
|
||||
*/
|
||||
typedef m64p_error (*ptr_DebugStep)(void);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT m64p_error CALL DebugStep(void);
|
||||
#endif
|
||||
|
||||
/* DebugDecodeOp()
|
||||
*
|
||||
* This is a helper function for the debugger front-end. This instruction takes
|
||||
* a PC value and an R4300 instruction opcode and writes the disassembled
|
||||
* instruction mnemonic and arguments into character buffers. This is intended
|
||||
* to be used to display disassembled code.
|
||||
*/
|
||||
typedef void (*ptr_DebugDecodeOp)(unsigned int, char *, char *, int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void CALL DebugDecodeOp(unsigned int, char *, char *, int);
|
||||
#endif
|
||||
|
||||
/* DebugMemGetRecompInfo()
|
||||
*
|
||||
* This function is used by the front-end to retrieve disassembly information
|
||||
* about recompiled code. For example, the dynamic recompiler may take a single
|
||||
* R4300 instruction and compile it into 10 x86 instructions. This function may
|
||||
* then be used to retrieve the disassembled code of the 10 x86 instructions.
|
||||
*/
|
||||
typedef void * (*ptr_DebugMemGetRecompInfo)(m64p_dbg_mem_info, unsigned int, int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void * CALL DebugMemGetRecompInfo(m64p_dbg_mem_info, unsigned int, int);
|
||||
#endif
|
||||
|
||||
/* DebugMemGetMemInfo()
|
||||
*
|
||||
* This function returns an integer value regarding the memory location address,
|
||||
* corresponding to the information requested by mem_info_type, which is a type
|
||||
* enumerated in m64p_types.h.
|
||||
*/
|
||||
typedef int (*ptr_DebugMemGetMemInfo)(m64p_dbg_mem_info, unsigned int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT int CALL DebugMemGetMemInfo(m64p_dbg_mem_info, unsigned int);
|
||||
#endif
|
||||
|
||||
/* DebugMemGetPointer()
|
||||
*
|
||||
* This function returns a memory pointer (in x86 memory space) to a block of
|
||||
* emulated N64 memory. This may be used to retrieve a pointer to a special N64
|
||||
* block (such as the serial, video, or audio registers) or the RDRAM.
|
||||
*/
|
||||
typedef void * (*ptr_DebugMemGetPointer)(m64p_dbg_memptr_type);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void * CALL DebugMemGetPointer(m64p_dbg_memptr_type);
|
||||
#endif
|
||||
|
||||
/* DebugMemRead**()
|
||||
*
|
||||
* These functions retrieve a value from the emulated N64 memory. The returned
|
||||
* value will be correctly byte-swapped for the host architecture.
|
||||
*/
|
||||
typedef unsigned long long (*ptr_DebugMemRead64)(unsigned int);
|
||||
typedef unsigned int (*ptr_DebugMemRead32)(unsigned int);
|
||||
typedef unsigned short (*ptr_DebugMemRead16)(unsigned int);
|
||||
typedef unsigned char (*ptr_DebugMemRead8)(unsigned int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT unsigned long long CALL DebugMemRead64(unsigned int);
|
||||
EXPORT unsigned int CALL DebugMemRead32(unsigned int);
|
||||
EXPORT unsigned short CALL DebugMemRead16(unsigned int);
|
||||
EXPORT unsigned char CALL DebugMemRead8(unsigned int);
|
||||
#endif
|
||||
|
||||
/* DebugMemWrite**()
|
||||
*
|
||||
* These functions write a value into the emulated N64 memory. The given value
|
||||
* will be correctly byte-swapped before storage.
|
||||
*/
|
||||
typedef void (*ptr_DebugMemWrite64)(unsigned int, unsigned long long);
|
||||
typedef void (*ptr_DebugMemWrite32)(unsigned int, unsigned int);
|
||||
typedef void (*ptr_DebugMemWrite16)(unsigned int, unsigned short);
|
||||
typedef void (*ptr_DebugMemWrite8)(unsigned int, unsigned char);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void CALL DebugMemWrite64(unsigned int, unsigned long long);
|
||||
EXPORT void CALL DebugMemWrite32(unsigned int, unsigned int);
|
||||
EXPORT void CALL DebugMemWrite16(unsigned int, unsigned short);
|
||||
EXPORT void CALL DebugMemWrite8(unsigned int, unsigned char);
|
||||
#endif
|
||||
|
||||
/* DebugGetCPUDataPtr()
|
||||
*
|
||||
* This function returns a memory pointer (in x86 memory space) to a specific
|
||||
* register in the emulated R4300 CPU.
|
||||
*/
|
||||
typedef void * (*ptr_DebugGetCPUDataPtr)(m64p_dbg_cpu_data);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT void * CALL DebugGetCPUDataPtr(m64p_dbg_cpu_data);
|
||||
#endif
|
||||
|
||||
/* DebugBreakpointLookup()
|
||||
*
|
||||
* This function searches through all current breakpoints in the debugger to
|
||||
* find one that matches the given input parameters. If a matching breakpoint
|
||||
* is found, the index number is returned. If no breakpoints are found, -1 is
|
||||
* returned.
|
||||
*/
|
||||
typedef int (*ptr_DebugBreakpointLookup)(unsigned int, unsigned int, unsigned int);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT int CALL DebugBreakpointLookup(unsigned int, unsigned int, unsigned int);
|
||||
#endif
|
||||
|
||||
/* DebugBreakpointCommand()
|
||||
*
|
||||
* This function is used to process common breakpoint commands, such as adding,
|
||||
* removing, or searching the breakpoints. The meanings of the index and ptr
|
||||
* input parameters vary by command.
|
||||
*/
|
||||
typedef int (*ptr_DebugBreakpointCommand)(m64p_dbg_bkp_command, unsigned int, void *);
|
||||
#if defined(M64P_CORE_PROTOTYPES)
|
||||
EXPORT int CALL DebugBreakpointCommand(m64p_dbg_bkp_command, unsigned int, void *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #define M64P_DEBUGGER_H */
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "../../api/callbacks.h"
|
||||
#include "../../api/debugger.h"
|
||||
#include "../../api/m64p_types.h"
|
||||
#include "cached_interp.h"
|
||||
#include "cp0_private.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "regcache.h"
|
||||
#include "interpret.h"
|
||||
|
||||
#include "../../../api/debugger.h"
|
||||
#include "../../../api/m64p_types.h"
|
||||
#include "../../../api/callbacks.h"
|
||||
#include "../../../main/main.h"
|
||||
|
||||
@@ -48,7 +48,6 @@ extern int g_cp0_cycle_count;
|
||||
#endif
|
||||
|
||||
#include "../../api/callbacks.h"
|
||||
#include "../../api/debugger.h"
|
||||
#include "../../api/m64p_types.h"
|
||||
/* TLBWrite requires invalid_code and blocks from cached_interp.h, but only if
|
||||
* (at run time) the active core is not the Pure Interpreter. */
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "../../api/callbacks.h"
|
||||
#include "../../api/debugger.h"
|
||||
#include "../../api/m64p_types.h"
|
||||
#include "cached_interp.h"
|
||||
#include "cp0_private.h"
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "../api/callbacks.h"
|
||||
#include "../api/core_config.h"
|
||||
#include "../api/m64p_config.h"
|
||||
#include "../api/debugger.h"
|
||||
#include "../api/m64p_vidext.h"
|
||||
#include "../api/vidext.h"
|
||||
|
||||
@@ -170,7 +169,6 @@ int main_set_core_defaults(void)
|
||||
#endif
|
||||
ConfigSetDefaultBool(g_CoreConfig, "NoCompiledJump", 0, "Disable compiled jump commands in dynamic recompiler (should be set to False) ");
|
||||
ConfigSetDefaultBool(g_CoreConfig, "DisableExtraMem", 0, "Disable 4MB expansion RAM pack. May be necessary for some games");
|
||||
ConfigSetDefaultBool(g_CoreConfig, "EnableDebugger", 0, "Activate the R4300 debugger when ROM execution begins, if core was built with Debugger support");
|
||||
ConfigSetDefaultInt(g_CoreConfig, "CountPerOp", 0, "Force number of cycles per emulated instruction.");
|
||||
ConfigSetDefaultBool(g_CoreConfig, "DelaySI", 1, "Delay interrupt after DMA SI read/write");
|
||||
|
||||
|
||||
Reference in new issue
Block a user