Mednafen is a portable, utilizing OpenGL and SDL, argument(command-line)-driven multi-system emulator. Mednafen has the ability to remap hotkey functions and virtual system inputs to a keyboard, a joystick, or both simultaneously. Save states are supported, as is real-time game rewinding. Screen snapshots may be taken, in the PNG file format, at the press of a button. Mednafen can record audiovisual movies in the QuickTime file format, with several different lossless codecs supported.
The following systems are supported(refer to the emulation module documentation for more details):
Mednafen is distributed under the terms of the GNU GPLv2.
Due to the threaded model of emulation used in Mednafen, and limitations of SDL, a joystick is preferred over a keyboard to play games, as the joystick will have slightly less latency, although the latency differences may not be perceptible to most people.
-- 0.9.39.2: -- September 19, 2016: SMS: Sanitize some previously-missed variables in the save state loading code. September 18, 2016: MD: Fixed a bug that caused some YM2612 state to not be restored properly on save state load. MD, SMS, NGP: Fixed an old Z80 emulation bug with interrupt handling. Make an index of save state sections on save state load, to detect sections in a save state that are unused by the state loading code(for debugging). MD, PCE, PCE_FAST: Sanitize some previously-missed variables in the save state loading code. September 16, 2016: SS: Added PAL support. SS: Fixed vertical positioning brokenness with custom "ss.slstart" setting values with interlaced video. September 15, 2016: PC-FX, WonderSwan, NES, VB, PSX: Sanitize some previously-missed variables in the save state loading code. Fixed a use-after-free bug in the SDL sound output driver. NGP: Fixed several off-by-1 bugs in the address to ROM data translation function. September 11, 2016: Removed nonsensical unused frame advance loop in drivers/main.cpp leftover from 0.5.x. PCE_FAST: Fixed a bug that could cause a crash with large "pce_fast.ocmultiplier" setting values when running CD games. September 10, 2016: PCE_FAST: Skip 512-byte copier header if detected when loading a ROM image. PCE_FAST: Made some minor optimizations. PCE, PSX, PCE_FAST: Avoid UB by biasing uintptr_t values instead of pointers directly in the CPU core. September 1, 2016: GB: Corrected the layer names used with the layer toggling feature. August 26, 2016: SS: Fixed a potential problem with SH-2 DMA event rescheduling when bus lock is held, that probably wouldn't ever happen in practice. NES: Fixed several instances of missing initialization of on-cart WRAM. August 24, 2016: SS: Marked more functions with MDFN_COLD hint, and marked a few functions to be forcibly-inlined where it makes sense. August 23, 2016: SNES: Fixed an issue causing a compilation error on Mac OS X.
-- 0.9.39.1: -- August 22, 2016: SS: Settings "ss.dbg_mask" and "ss.dbg_exe_cdpath", and the functionality they control, are no longer available unless Mednafen has been compiled with "MDFN_SS_DEV_BUILD" defined(such as with -DMDFN_SS_DEV_BUILD=1 in CPPFLAGS env var passed to configure). SS: Replaced some instances of case ranges with more portable constructs. August 20, 2016: SS: Run VDP1 vblank erase at end of vblank, so we know how much time we have and thus how many entries in the framebuffer we'll be able to erase. Currently, the available time calculations are generous, allowing for a bit more erase than what's possible on a Saturn, but we can tighten it up in the future once it's fairly certain there aren't any more event scheduling accuracy issues. Fixes FMV subtitle text in "Panzer Dragoon". SS: Fixed a bug that caused VDP2 frames to be short by 1 to 3 CPU cycles. SS: Reschedule the SH-2 DMA event handler as necessary to prevent it from running when the SH-2 bus is locked. SS: Force the SH-2 DMA and SCU DMA event handlers to be rescheduled to SH7095_mem_timestamp time when necessary. SS: Check for pending events right before calling VDP1, VDP2, SMPC, and SCU regs read/write handlers, which may then call their own event update functions. August 17, 2016: Fixed an old bug that could cause a startup crash on Windows systems without XInput DLLs installed(e.g. some Windows XP systems). NES: Fixed a very old bug triggered when disabling(via CTRL+1) the background layer, that would cause sprite pixels to also be visually disabled too under certain circumstances. August 16, 2016: MD, PC-FX: Fixed several instances of left-shifting negative values. August 15, 2016: SS: Fixed a compilation error when compiling with the debugger disabled("--disable-debugger" passed to configure). Added configure options "--with-external-mpcdec" and "--with-external-tremor", for distribution packagers. SS, SNES-Faust: Fixed a few issues causing compilation errors on clang. SS: Tweaked how seek command pause works; fixes a lockup issue in "Astal". August 11, 2016: WonderSwan: Fixed a bad usage of "char" without an unsigned/signed qualifier. SS: Slow down SCU DMA to VDP2 VRAM under certain conditions. August 10, 2016: SS: Adjusted VDP1 polygon and line draw commands to behave as if SPD=1, ECD=1 when color mode >= 6; fixes missing graphics problem in "Hi-Octane". August 8, 2016: SS: Reworked SCU DMA's timekeeping and scheduling code to be more accurate; reduces the size of the flickering section of the FMV in "Lunar". SS: Fixed handling of CPU<->SMPC open bus. August 7, 2016: Relaxed the CloneCD Q subchannel sanity checks to allow a track number of 0xAA(leadout). August 6, 2016: SS: Implemented kludgy(incomplete) support for quasi-illegal window X start position values; fixes ground layer issues in the forest stage of Panzer Dragoon 2.
-- 0.9.38.7: -- September 30, 2015: Fixed several malformed trio_sscanf() format strings in regards to field width, that could cause stack buffer overflows in certain cases. September 29, 2015: PSX: Added skeleton BCzF/BCzT instruction emulation, and fixed handling of illegal CP0 instructions. September 25, 2015: PSX: Added emulation of CPU exception-handling bad address register. PSX: Implemented emulation of the Coprocessor Error field in the CAUSE register. PSX: Added emulation of CPU exception-handling branch target register. PSX: Fixed handling of CAUSE bits 30 and 31 when an exception occurs immediately after a branch instruction is executed. PSX: Fixed link address calculation for JAL, JALR, and B*AL instructions when they're executed in a branch delay slot. PSX: Corrected emulation of the quasi-illegal mirrors of the BGEZ*/BLTZ* type instructions. PSX: Added emulation of a pipeline quirk that occurs with back-to-back load instructions to the same register(previously only emulated with LWL and LWR). September 22, 2015: Fixed a bug in the debugger's disassembler that could break disassembly when a disassembled instruction wraps around the end of the CPU's program address space to the beginning. September 18, 2015: PCE: Removed experimental and unfinished hypothetical subtitle hardware emulation which had a few security-related problems. September 16, 2015: MD: Fixed registration of main RAM in the cheat engine to be mirrored properly. PCE: Fixed a bug that caused the debugger's disassembly and memory view to show a wrong value for the HES bootstrap register at $1D00. PCE: Fixed a bug that sometimes caused the "TIMV" register in the debugger to display "FFFFFFFF" instead of "FF". The date and time of the compilation of qtrecord.cpp are no longer written to recorded QuickTime movie files, to solve a minor privacy issue and a build reproducibility issue. PSX: Rewrote parts of the timer emulation code to fix several issues; fixes wrong music playback speed problem in "RPG Tsukuru 4".
-- 0.9.38.5: -- June 26, 2015: PSX: Generate a seek error when trying to read audio sectors(when the appropriate Mode bit isn't set), and generate a bad command error when executing ReadN/ReadS with a non-PS1 disc. Fixes a lockup in "Vib Ribbon" when trying to play with audio CDs. June 20, 2015: Altered SHA-1 and SHA-256 test code to work around a preprocessor-related bug in gcc. NES: Fixed a mapper 19 sound emulation bug; fixes music issues in the Japanese release of "Rolling Thunder". PSX: Replaced a GPU debug puts() with code that respects the psx.dbg_level setting. June 18, 2015: PC-FX: Corrected handling of width/height of 0xA for KING BG1-3, per tests on a PC-FX. Fixes a graphical glitch in "Sakuraigar Mode" in "Tyoushin Heiki Zeroigar". May 5, 2015: PSX: Added some debug messages to the memory card emulation code, outputted when setting psx.dbg_level is set to certain values. April 29, 2015: PCE, PCE_FAST: Corrected decimal-mode ADC and SBC behavior(especially for "illegal" input values), per tests on a HuC6280. April 22, 2015: Added a test to tests.cpp for gcc bug #60196(triggered with non-default optimization flags). April 19, 2015: Added a missing dependency statement to configure.ac, whose absence broke compilation with --disable-pce --enable-pcfx April 16, 2015: WonderSwan: Removed erroneous constraints that were preventing opposing X* and Y* buttons from being pressed simultaneously, and changed the names of the the X* and Y* buttons used during input configuration, per tip from trap15.
-- 0.9.38.4: -- April 12, 2015: PC-FX: Reorganized the debugger's register view to be slightly more space-efficient horizontally. NES: Migrated the rest of the *GetRegister() and *SetRegister() debugger functions over to the newer-style interface. PC-FX: Migrated the rest of the *GetRegister() and *SetRegister() debugger functions over to the newer-style interface. April 11, 2015: PC-FX: Migrated debugger functions PCFXDBG_GetRegister() and PCFXDBG_SetRegister() over to the newer-style interface that takes integer IDs instead of std::string. VB: Migrated debugger functions VBDBG_GetRegister() and VBDBG_SetRegister() over to the newer-style interface that takes integer IDs instead of std::string. WonderSwan: Migrated debugger functions WSwan_GfxGetRegister() and WSwan_GfxSetRegister() over to the newer-style interface that takes integer IDs instead of std::string. PC-FX: Added support for setting breakpoints on writes to specific VDC registers, by setting an Aux Write Breakpoint on an address ranging from A0000-A001F(VDC-A) or B0000-B001F(VDC-B). April 10, 2015: Debugger: Relaxed most maximum string length restrictions on user-inputted addresses(to allow for lazily leaving an excessive number of 0s at the beginning of an address, for example). Debugger: "Goto Address" prompt in the memory editor can now be activated by pressing "ENTER"(in addition to "G"), and "Disassembly Address" prompt in the main debugger view can now be activated by pressing the "G" key(in addition to "ENTER"). April 9, 2015: NES: Added sprite RAM to the debugger's memory editor. NES: Fixed some issues with the debugger's graphics/tileset viewer. April 8, 2015: PSX: Improved GPU texture cache emulation accuracy per tests on a PS1; fixes graphical glitches in the menus of "Tigershark". April 5, 2015: PCE: Added support for setting breakpoints on writes to specific VDC registers(like MAWR, BXR, BYR, etc.), by setting an Aux Write Breakpoint on an address ranging from 20000-2001f(hexadecimal). April 4, 2015: Avoid left-shifting negative values in hw_sound/pce_psg/pce_psg.cpp Added a couple more tests regarding left shift of signed integers to tests.cpp. April 2, 2015: Debugger: Fixed half-broken re-activation of the debug screen when a breakpoint triggers and the user was last on a debug screen other than the main one. Debugger: Fixed a rounding issue that could cause insufficient disassembly lines with some *.debugger.disfontsize setting values. PSX: Hooked up writing(editing) in the debugger's memory editor for "CPU Main RAM". March 29, 2015: PCE: Removed old leftover debug puts() in HuC6280 emulation code. Debugger: Fixed a bug that could cause breakpoints to be skipped if the 'R' key was pressed(or auto-repeated) while outside of step mode. NES: Fixed highpass filter coefficient calculation. SNES: Fixed a bug that was breaking input after triggering a virtual Reset/Power Toggle event when a non-gamepad controller(e.g. mouse) is currently selected for a port. March 23, 2015: NES: Fixed a minor sound emulation bug. March 15, 2015: GBA: Fixed several instances of left-shifting negative values in thumb.cpp. PC-FX, VB: Fixed an instance of left-shifting uint64 by 64 in the FPU emulation code. March 14, 2015: GBA: Fixed a few instances of technically undefined behavior(shifting 32-bit int by >= 32, and left-shifting negative values) in arm.cpp. March 11, 2015: Reworked a test in tests.cpp to better reflect the requirements of certain undefined behavior some code still (unfortunately) relies on, to avoid triggering an assert() during startup when compiled with llvm/clang 3.6. March 6, 2015: PCE: Fixed a major VRAM DMA emulation regression introduced around version 0.9.16-WIP, that breaks some homebrew software. NES: Altered mapper 185 emulation to fix "Bird Week", "B-Wings", "Sansuu 1 Nen", "Sansuu 2 Nen", "Sansuu 3 Nen", and "Seicross (version 2)". PSX: Added a kludge to the core cheat file reading and writing code to work around the mess created by our flawed game ID generation code (the PS1 game library is enormous, and many games only have one track, leading to many collisions); effectively, the game's filename(which was previously regarded as a comment), is now used in addition to the game ID.
-- 0.9.38.3: -- March 4, 2015: NES: Fixed mapper 69 IRQ acknowledge behavior, per tip from tepples. February 24, 2015: MD: Fixed an out-of-bounds array access in the 68K emulation code. Avoid passing NULL to memcpy() in netplay.cpp. MD: Fixed some code doing misaligned memory writes in vdp.cpp. February 23, 2015: Avoid blitting to the screen when visibility is lost(i.e. window is minimized), to reduce CPU usage and to prevent memory usage from skyrocketing on Windows under certain conditions. February 22, 2015: PSX: Tweaked non-logical CD seek emulation to fix lockups in some versions of "Tomb Raider". February 17, 2015: PSX: Fixed Justifier and GunCon x position being off when setting "psx.h_overscan" is set to "0".