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.
Newer, unstable(WIP) versions of Mednafen can be found on the forum at http://forum.fobby.net/index.php?t=thread&frm_id=4&
The newest version supports Sega Genesis, Nintendo Virtual Boy, and Super NES, to varying degrees, in addition to the systems supported by 0.8.x.
Keep in mind that the unstable/WIP versions will often break savestate support among different versions, and there will likely be various regressions with new unstable versions.
This will be the final release in the 0.8.x branch, unless 0.8.D introduces any major bug(s) that do not have workaround(s).
Changes since the last stable release, 0.8.C:
0.8.D:
SMS: Some state that wasn't being saved in save states now is, which should fix netplay desynch problems with SMS/GG games.
Fixed a couple of remotely-exploitable(if connected to a malicious server) stack manipulation bugs in the network play code.
Fixed an incorrect object creation bug in pce/adpcm.cpp.
NES: Added a missing CPU emulator variable to save states.
PCE: Added a missing CPU emulator variable to save states.
0.8.D-rc1:
Lynx: Fixed a bug in the cart loader code that would cause a crash if the ROM bank size was larger than the actual data available in the
file(as is the case with some homebrew programs). Thanks to "Wookie" for the patch.
Build files were regenerated using autoconf 2.64 and aclocal 1.11(previously, they were generated with autoconf 2.61 and aclocal 1.10.1).
Fixed a crashing problem when entering an invalid menu choice("0") in the cheat interface. Thanks to
tsenart for reporting the bug.
GB: The GameBoy module now respects the "filesys.disablesavegz" setting in respect to saved
battery-backed RAM.
Added support for "lurkers" on the network play server. Previous versions of Mednafen don't lack support for this per se, but there
would be cosmetic issues with status messages printed to the internal console.
SexyAL: Fixed a bug affecting the return value from RawCanWrite() in the ALSA driver. The returned value was typically too
small by a factor of 4. The effects of this bug included potential long periods of garbled sound
during netplay.
Fixed the return value from RawCanWrite() in the JACK driver. It was being clamped to a value
that was too small by a factor of 4; however, the clamp value was already excessively large in a way
that this bug would should have only been triggered if the "soundbufsize" setting was excessively large.
The effects of this bug would be similar to the ALSA RawCanWrite() bug.
The ALSA and OSS drivers will now try to set audio output to 2 channels if the source data only has 1 channel, and 16-bit signed if the
source data is 8-bit(automatic conversion is done). This is done to allow for lower period/fragment sizes, as, in ALSA's internals at least,
the minimum period sizes are expressed in bytes, not sound frames.
The ALSA and OSS drivers will now try to set lower period/fragment sizes than previous versions of Mednafen did. With default settings, for
ALSA, the new period/fragment size is 50% of what it was before, and for OSS, 25%. Also, there's a new setting to override
the SexyAL's driver's preferred period/fragment sizes, named "sound.period_time"(default value of 0: no override).
The period/fragment size is expressed in microseconds. If the new, lower fragment sizes cause problems, the setting can be changed to "2666"
to approximate the fragment size selection in previous versions of Mednafen when using ALSA output, and "5333" when using OSS output.
Added a workaround to the OSS driver for a bug in ALSA(and hence, ALSA's in-kernel OSS emulation) that could cause the emulator to run far
too fast for a short period of time if a buffer underflow occurred.
The ALSA's driver's RawCanWrite() method now(finally) uses snd_pcm_avail_update() instead of snd_pcm_delay().
This should improve performance and frameskipping behavior when the ALSA output is not routed directly to a physical device, such as the case with
PulseAudio(though PulseAudio is still not recommended :b).
Version 0.4.1 of Mednafen's netplay server has been uploaded and is available at https://sourceforge.net/projects/mednafen/files/Mednafen-Server/0.4.1/mednafen-server-0.4.1.tar.bz2/download
This release is a major/apocalyptic/cthulhutastic bug-fix release, fixing stability and portability bugs that have been in mednafen-server for a long long time(and hopefully without introducing any new ones!).
In addition, compared to 0.3.0 and earlier, this release supports lurkers(players who don't control any emulated device inputs), though lurker support is still experimental, and likely needs tweaking.
Mednafen 0.8.D-rc1 is available for testing on the forum at http://forum.fobby.net/index.php?t=msg&th=531&start=0&
A summary of changes:
Various sound output bugs have been fixed, primarily affecting non-Windows platforms.
Various endianness related bugs were fixed, including a severe GBA save state bug on big-endian platforms.
Having more than 2 of the same "type" of joystick/gamepad should no longer cause problems with hash collisions internally.
A few PCE CD and PC-FX CDROM emulation bugs were fixed, concerning the position of the lead-out track, and the length of the last track when loading multi-track CUE/BIN rips.
Various code issues causing compiler problems were fixed.
Additionally, the pre-compiled Win32 package is now distributed with libsndfile 1.0.20.
This is a source-code only release leading up to the 0.8.C release.
See http://forum.fobby.net/index.php?t=msg&th=481&start=0& for details.
Fixed the rectangle calculation for screen rotation with Lynx and WonderSwan to use X scale and Y scale
values appropriately(they were reversed before; also, assuming square pixels on your monitor ;)).
Rotation still poses a problem in fullscreen with the default settings, however.
Fixed an off-by-one error in the software SDL graphics rotation code(used for Lynx and WonderSwan).
Fixed a race condition that could cause rapid oscillation between fullscreen and windowed when trying to
toggle it.
...and fixed a race condition that could cause oscillations when rotating the screen with Lynx and WonderSwan
emulation.
SexyAL: The return values of ALSA functions are now treated as errors only if they're less than 0, rather
than non-zero as before. Thanks to R.L. for pointing this out.
The default "nethost" setting is now "fobby.net" instead of "mednafen.com". The latter was allowed to
expire and lost to domain squatters some time ago. Domain squatters cause desires to commit grievous face-stabbing.
However, the netplay server on "fobby.net" is not guaranteed to be up. :p
PCE: Added the ability to load a custom colormap(palette) by setting "pce.colormap" to the path of the colormap
file. The colormap consists of either 512 or 1024 RGB triplets, 8-bits per color component,
in the order R,G,B,R,G,B,R,G,B,... .
It is recommended that the colormap provide all 1024 entries(the first 512 entries are for normal mode,
the second 512 entries are for grayscale/strip-colorburst mode). If it doesn't, Mednafen will calculate
the grayscale colors using a formula similar to that used with the real VCE, but with more precision.
The colormap may be disabled by setting the "pce.colormap" setting to an empty string, or 0. Command-line
examples:
mednafen -pce.colormap /path/to/blueblue.cmap /yarr/pirate/booty.pce [Enable]
mednafen -pce.colormap 0 /some/where/over/the/rainbow/islands.cue [Disable]
PCE: Added a hack to fix games that try to write to VRAM while VRAM DMA is in progress(fixes graphical
glitches in "Crest of Wolf", maybe others too?).
This could potentially cause regressions, so please post any on the forum.
PCE: Having "pce.forcesgx" set to 1 with non-SuperGrafx games will no longer cause problems with display
timing(and positioning). However, this doesn't fix the underlying issue, and any demos that set
the horizontal and vertical timing registers differently on each VDC won't operate as they would on a real
SuperGrafx. (This could affect commercial SuperGrafx games, but AFAIK they keep the VDC timings the same).
NOTE: Setting "pce.forcesgx" to 1 is still not recommended, the preferred way of forcing a game/demo to
enable SuperGrafx emulation is by giving it a file extension of "sgx".
PCE: Arcade Card RAM is now initialized to 0 on allocation(it was erroneously being left uninitialized before).
PCE: Added Arcade Card RAM to the memory editor in the debugger.
PCE: Fixed the BRAM initialization(it was wrong, and generated from when Mednafen erroneously emulated 8KiB of BRAM).
Fixes lockups in "Sorcerian".
Note that if you have any existing save states or battery-backed RAM files for "Sorcerian" in "sav" or "mcs" under
Mednafen's base directory from when you attempted to run "Sorcerian", you will need to delete them
for this fix to have any effect.
PCE: Reduced the mirroring address space range of the Arcade Card register mapping in HuC6280 banks 0x40-0x43.
It was mirrored throughout 0x40-0x4F, now it's only mirrored at 0x40-0x47. It may not be mirrored at all with
a real Arcade Card, tests need to be performed!
Fixes a crashing bug in "Linda Cubed" early into gameplay.
WonderSwan: Fixed a bug that made it impossible to push a direction on one D-pad while the opposing direction
was being pressed on the other D-pad.
NES: Cleaned up the iNES loading code a bit, and added support for WRAM on a few mappers that nominally shouldn't
have WRAM, enabled if the battery-backed bit is set in the iNES header. Fixes "Family BASIC", and probably
a few bootleg games as well.
NES: Added partially-broken support for mapper 163.
NES: Added support for mapper 241.
Fixed string constant-to-(char *) problems in drivers/cheat.cpp
Added setting "osd.state_display_time", to control the length of time, in milliseconds, the save state/movie
screen is displayed after selecting a save state or movie.
The most recently-saved save state slot will now be colored differently when selecting a save state slot.
Increased the brightness of non-empty save state slots.
Empty save state slots are now black instead of being partially transparent.
PC-FX: Fixed bugs in "Play Audio Track Index" and "Read Subchannel" MMC commands, fixing the totally broken
cinematic sequences in "Boundary Gate". There may still be bugs in these commands that don't cause any known
problems with games, so I will need to run tests on a real system.
GBA: An error loading the custom colormap file is now treated as fatal.
Win32: The German and Russian translation files are now included in the Win32 precompiled binary distribution
ZIP file. Note that Mednafen always assumes the locale to be UTF-8, so the stdio.txt file will need to be
opened with a viewer that can handle UTF-8(though filenames with non-7-bit-ASCII components will appear fubar).
(I am aware that assuming the locale's character encoding to always be UTF-8 is a design flaw with
various insidious consequences when the encoding is not UTF-8).
Updated the Russian translation with the translation done by rubicon.
Added configure script option "--enable-altivec/--disable-altivec (default: enabled)" for compiling on
PowerPC architectures where AltiVec is not supported, or causes problems. This configure script option is
untested, however.
Input for the virtual device on virtual port N will be disabled when the buttons on the virtual device on virtual
port N are being configured. The last button pressed when in button configuration may still be taken as
virtual device input, however(a fix for this would be too invasive, and so will be done in the 0.9.x unstable
tree).
PCE: Added several missing input-related state variables to save states, fixing several netplay/movie
desynchronization issues under certain situations.
Fixed a bug when creating an SDL source surface, whose negative effects(clipping rightmost columns) could be
triggered when the "sdl" vdriver setting was used with certain xscale and yscale settings that would
cause a 1:1 pixel copy operation.
PC-FX: Improved PSG LFO emulation again(Tyoushin Heiki Zeroigar uses it for some sound effects, other
games likely use it as well in similar roles).
PCE: Improved PSG LFO emulation again(Hanii in the Sky, Juuouki, and Flash Hiders use LFO).
PCE: Altered the Street Fighter 2 autodetection code to be data-agnostic. The SF2 mapper will now be enabled for
any ROM images 2MiB and over in size.
Fixed a call to putenv(), to pass a static character array initialized to a string constant instead of a string
constant directly.
Fixed a few argument descriptions(invoked with the -help command-line switch) that weren't properly gettextized.
Debugger: Fixed a bug in the trace log code. It would cause the emulator to lock up if the user pressed
Enter/Return in the prompt popup without any text in the input field.
SMS: Removed the old unused Z80 emulator code from when SMS Plus was assimilated.
Updated the included gettext library to 0.17 to fix a MinGW build issue.
GB: Corrected a lack of address masking in most of the cart RAM emulation code. Fixes a few Chinese GameBoy
Color games.
NES: (Re?)-added support for mapper 240(it was erroneously listed in the documentation as being supported...).
GBA: Fixed a buffer overflow in the ROM image loading code.
PC-FX: Several variables related to subchannel reading weren't being saved in save states. Fixed. (This fixes
save states made within the BIOS' CD-DA player)
PCE: Altered how the ADPCM read and write addresses are set.
Fixes the Super CD version of "Tengai Makyou Ziria", and "CD Mahjong Bishoujo Chuushinha".
Thanks to Exophase and ChrlyMac for the tips.
***(This change may potentially cause regressions. If it does, please report them at http://forum.fobby.net )***
PC-FX: Fixed a few deprecated const string to char* conversions in v810_cpuD.cpp.
PCE: Fixed a bug with Arcade Card emulation with a tip from Exophase. The ADPCM sound effects
in Garou Densetsu II work correctly now.
PCE: Reads from the timer count register the cycle it is set to reload after expiring will now return 0x7F.
Fixes "Battle Royale".
Added <string.h> to the global include list in mednafen.h.
Added boolean setting "debugger.autostepmode" that, when set to 1, will cause Mednafen to automatically start
the debugger in step mode after a game is loaded(only if Mednafen has a debugger for the emulated system, of course).
NES: Fixed CNROM emulation initialization bug.
PCE: ADPCM software reset was erroneously also resetting the playback frequency. Fixed. (Fixes ADPCM voices in Gulliver Boy)
PCE: Fixed disassembly of the JMP $(AAAA, X) instruction.
PCE, PC-FX: Improved PSG LFO emulation.
PC-FX: Emulated gamepad button presses weren't being decoded from the driver-side data correctly(causing problems on big-endian
platforms). Fixed.
PC-FX: Improved the logging of the ROM font system call in the debugger, to also include the callee address and the size of the
glyph being requested.
PC-FX: Disassembly of the "nop" instruction will no longer show the virtually meaningless operand.
PC-FX: Fixed alignment and prettified the disassembly of LDSR and STSR instructions.
SMS: SMS pause and 2-player support were erroneously commented out. Fixed.