-- 0.9.37.1: -- December 19, 2014: Fixed some issues causing compilation errors on gcc 4.7.x. Conditionalize the compilation of shared hardware emulation components(such as 68K, Z80, YM2612, etc. emulators) based on what emulation modules are being compiled in, since support for loading external emulation modules never went anywhere, and if we do eventually add support for it, the exported symbols won't include the common specific hardware emulation components. Fixed some code causing compiler errors with clang 3.4.0. Fixed broken loading of save states made with 0.9.37+ on big-endian platforms(0.9.37 regression). fflush() before fstat() on the underlying file descriptor in FileStream::size() if the stream is open for writing. December 18, 2014: Added zlib type-size sanity tests to tests.cpp _LARGEFILE64_SOURCE and _LARGEFILE_SOURCE are now defined to "1" in config.h, for zlib purposes. December 17, 2014: PSX: Avoid undefined behavior(that wasn't currently causing any problems) in the CPU core. December 16, 2014: PSX: Clamp final SPU output samples(before volume adjustment and resampling) properly; lack of it wasn't causing any problems per-se, but it could have been an issue in the future. GB: Load GBC custom palette from "gbc.pal", not "gb.pal"(0.9.37 regression). -- 0.9.37-UNSTABLE: -- December 15, 2014: MD: Added EA 4-Way Play multitap emulation, based on information from Charles MacDonald. MD: Fixed Team Player save states(sub ports weren't getting unique section names). December 14, 2014: MD: Rewrote the Mega Mouse emulation code so it actually works. NGP: Added a couple of missing sound chip emulation variables to save states. MD: Fixed some issues with the new multitap support code, including removing Hyper Dunk/Double Dribble from the internal database due to issues the game has with multitap in some game modes. PSX: Fixed a potentially-nasty sizeof()-related bug in frontio.cpp. PSX: Tweaked Justifier lightgun emulation to fix problems with occasional extremely wrong positioning in "Elemental Gearbolt". December 13, 2014: PSX: Reworked how overscan is hidden when the psx.h_overscan setting is set to 0 to not cause netplay desync with lightguns if different players have that setting configured differently. MD: Added emulation of Sega's Team Player multitap. MD: Added default key to button assignments for the emulated 6-button gamepad on virtual port 1. December 12, 2014: PSX: Fixed SPU audio mixing so that reverb output respects the main volume control, and to correct output precision/ranges/clamping, per tests on a PS1. Fixes excessive reverb volume in some parts of "WipEout", and likely other games as well. Mednafen's PS1 emulation audio output is also now about 3.5dB louder than before, while still maintaing a 2.5dB headroom. PSX: Greatly simplified the reverb address wrapping logic, per tests on a PS1. December 11, 2014: Various const char* to const std::string& changes. Added additional MDFN_GetSetting* inline functions that take a const std::string reference instead of a const char*, and call .c_str() internally, to cut down on .c_str() usage elsewhere. Added setting "filesys.state_comp_level". Removed setting "filesys.disablesavegz". GB, GBA, MD, VB, SNES, WonderSwan: Save-game memory files are no longer written gzip-compressed. GBA: Removed support for loading EEPROM from the save-game memory file with "sav" extension(last produced by Mednafen version 0.8.1). PSX: Made minor precision-related changes to the SPU reverb algorithm code, per tests on a PS1. December 10, 2014: PSX: Added emulation of unaligned access to the registers controlling the front input/output ports(and no longer triggers an assert() when/if it happens). PSX: Fixed broken emulation of an esoteric CDC feature, that could lead to an assert() being triggered under specific circumstances. Fixes the "Rockman 8" intro FMV(previously, Mednafen would abort out right after the end of the FMV if it was allowed to play all the way through). December 9, 2014: Reinitialize some input info vectors properly in drivers/input.cpp on emulated device change(so we don't get hilariously bad messages about analog mode being enabled on a lightgun ;)). PSX: Added setting psx.h_overscan, default value of "1", that when set to "0" will hide most of the horizontal overscan area(area to the left and right sides of the screen); useful for games like "Captain Commando" that have garbage in that area. PSX: Adjusted horizontal positioning of image so that the different pixel clock modes will have the correct relative horizontal positioning(within a +/-1 pixel tolerance in some cases, due to performance considerations and rounding issues in Mednafen), per tests on a PS1. PSX: Use two small LUTs instead of one gigantic LUT for 15-bit RGB -> 24/32-bit RGB conversion. PSX: Split the GPU primitive rendering code into several standalone source code files, to be easier on the compiler and enable more effective parallel building of the source code. PSX: Added preliminary emulation of GPU texture cache; (mostly) fixes the flickering graphics problem in the map screen of "Tactics Ogre", and fixes the heat engine effect in "F1 2000". December 8, 2014: PSX: Reworked various aspects of triangle rasterization to be more accurate, per PS1 tests(though some of the triangle setup code is a bit convoluted now and should probably be simplified/rewritten somehow). December 7, 2014: PSX: Added emulation of GPU CLUT cache. December 6, 2014: Print a warning message about portability if an untrusted file include path(such as from a CUE sheet) contains an 8-bit non-ASCII character. Fixed a regression that occurred since 0.9.36.x that caused Mednafen to abort out when rotating the screen(via ALT+O) with an emulated system other than Lynx and WonderSwan. PSX: Now differentiate between Reset(triggered with F10) and Powering-On(triggered with F11) events, so the former will no longer reset input device state(relevant with controllers with persistent long-lived internal state like the DualShock). December 5, 2014: PSX: Fixed some precision-related bugs in the triangle rendering code; fixes the flickering-characters issue that occurs at several locations in "Final Fantasy 8". Unfortunately, this fix does increase CPU usage a bit more that I would like, and it's going to be tricky to optimize the difference away. December 4, 2014: PSX: Made a minor change to the GPU polygon blitting code with negligible performance impacts, but shaves a few hundred KB off the compiled code size. PSX: Reworked how the GPU saturation LUTs are implemented to prevent undefined behavior. Lynx: Hooked up(and cleaned up) support for loading homebrew RAM image dumps(such as available at http://handy.sourceforge.net/homebrew.zip and http://pdroms.de/files/atarilynx/chopper ) NGP: Fixed a couple of shadowed-variable warnings in T6W28_Apu.cpp. December 3, 2014: Added new class ZLInflateFilter, to be used for stream-based decompression in the PSF file loading code. MDFNFILE is now a thin container on top of a Stream-derived object(MemoryStream or FileStream; GZFileStream is not suitable for direct use since we still have to use Stream::size() in a few places). MDFNGI::Load() no longer uses return type to signal an error. Reworked the emulation modules' file loading code to be stream-oriented, rather than an amalgamation of memory-mapped semantics and stream semantics. NES: Utilize exceptions to handle errors during file loading and initialization. December 1, 2014: Merged(finally) FileWrapper into FileStream. November 30, 2014: Fixed handling/mapping of rumble, status, and switch input bits during netplay. The current semantics of input device switch state in regards to netplay save states is still less than ideal, and could be considered a regression from 0.9.36. November 28, 2014: Fixed a rumble-related crashing bug(due to careless use of a pointer into a vector that was later resized) introduced in changes yesterday. VB: Corrected the value that the timer reload register is initialized with on reset. "--large-address-aware" is now passed to the linker when building the Windows build, so that the 32-bit build can use more address space(and RAM), which reduces the probability of running out when state rewinding and/or CD image memory caching is enabled. PSX: Avoid left-shifting negative values(which is technically undefined behavior, though I'm hopeful compiler developers aren't foolish enough that this will ever be a real issue) in gte.cpp, spu.cpp, and gpu_polygon.inc. There are still instances left in dma.cpp, mdec.cpp, and gpu_line.inc, however. Compile with -fwrapv instead of -fno-strict-overflow, as the latter has numerous issues. November 27, 2014: No longer compile with -Winline, it's causing spurious warnings due to design decisions, and if something really should be inlined we use the INLINE macro anyway(which evaluates to include __attribute__((always_inline))). Current emulated device raw input state is now saved in save states, so that persistent data like switch state isn't lost. Input device input/button descriptors(of type InputDeviceInputInfoStruct) are now packed into IDIISG(derived from std::vector) instead of being plain C-style arrays, to facilitate, in the future, fixing design flaws and possibly adding neat new functionality. November 26, 2014: NES: Added some missing MMC5 variables to save states. NES: Allow save states to be saved and loaded while in the Game Genie code entry screen. November 25, 2014: Use shiny new C++11 std::exception_ptr to better handle deferred errors/exceptions in the save state loading code, instead of just using naked error message C-string pointers. No longer clear the state-present indicator to 0 when a save state load fails(since it could have led to confusion and the accidental overwriting of a state that is good in a different context). PSX: Changed the hashing algorithm used on the BIOS ROM image data(for the database and save states) from SHA-1 to SHA-256. November 24, 2014: PSX: Save the SHA-1 hash of the BIOS in save states, and on load compare the value recorded with the actual current value, and error out the state loading process if they mismatch(to prevent loading a save state created while running under a different BIOS, which can cause insidiously subtle problems). PSX: Implemented a rudimentary internal BIOS database, and now error-out when using a bad BIOS, or a BIOS from the wrong region. PCE, PC-FX: Fixed the garbled-sound-while-state-rewinding problem. PCE: Fixed a frame mid-sync regression from around 0.9.33 that broke "Takeda Shingen". Implemented new netplay commands "/list" and "/gamekey". Replaced UTF8* in favor of plain char* in various places where it's still used. November 21, 2014: PSX: Changed DualShock analog mode status display to use new IDIT_STATUS input/output type, instead of directly calling MDFN_DispMessage(). PCE_FAST: Changed 6-button mode toggle to use new IDIT_SWITCH input type, instead of IDIT_BUTTON coupled with internal state toggling and MDFN_DispMessage(). November 15, 2014: Fixed virtual analog button input support(e.g. for DualShock analog sticks), broken in an August 4th change. November 9, 2014: WonderSwan: Added partial emulation(just enough to get it to work) of the WonderWitch's flash ROM, so that the WonderWitch firmware will boot now, and can be used with the "wswan.excomm" and "wswan.excomm.path" settings/functionality. November 5, 2014: Added support for automatic loading and usage of redump.org "SBI" files when loading CUE sheets; the files should have the same base filename as the CUE sheet, and the file extension case should match the case of the corresponding character in the CUE sheet filename file extension. Example: "Super Bandicoot Luigi (Moon, Niflheim, Australia).CuE" -> "Super Bandicoot Luigi (Moon, Niflheim, Australia).SbI" PSX: Fixed half-implemented broken implementation of CDC command 0x00; fixes lockups in the European PAL releases of "Spyro 2" and "Spyro - Year of the Dragon". November 4, 2014: PCE_FAST, PC-FX: Fixed some mostly-benign violations of strict aliasing. MD: C68k code is compiled as C++ now, and fixed the flawed approach at circumventing strict aliasing. Replaced MDFN_ALIGN() with C++11 alignas(). Revamped masmem.h and endian.h, merging functionality into endian.h, and fixed "MultiAccessSizeMem" to actually work properly(the previous code constructs it used violated strict aliasing, due to a misunderstanding of how gcc handles type punning via unions). "MultiAccessSizeMem" may be phased out now, since its original intended purpose no longer requires it. November 2, 2014: NES: Partially encapsulated the code in namespace MDFN_IEN_NES to reduce global namespace pollution(in regards to object file linking). NES: Use fastcall calling convention for high-call-frequency performance-critical functions when compiling for 32-bit x86. PSX: Implemented preliminary support for multiplicand value-dependent MULT/MULTU instruction timing. Added more compiler sanity/bug tests to tests.cpp. On startup, now print out version information regarding the MinGW-W64 runtime and libiconv, if applicable. October 30, 2014: Use poll() instead of select() in the POSIX sockets netplay code, to keep netplay from breaking in some quasi-pathological real-world Mednafen usage scenarios. October 20, 2014: NES: Fixed a minor issue that could break compiling after --disable-nls was passed to the configure script. PSX: Reworked disc detection and region detection heuristics to pick up more homebrew PS1 games, and to make better decisions on what region of the PS1 to emulate for heterogenous disc sets and for titles(e.g. homebrew) that don't follow Sony conventions in regards to ISO-9660 system area contents and ISO-9660 filesystem layout. September 10, 2014: PSX: Generate an AdEL exception when trying to fetch an instruction and PC is mis-misaligned. PCE: No longer attempt to load a custom palette after loading an NSF file. NES: No longer attempt to load a custom palette after loading an NSF file. September 8, 2014: Fixed a piece of ancient mouse button mapping/reading code that was so broken it worked most of the time; fixes broken mapping of more exotic(other than left, center, and right) physical mouse buttons to virtual buttons. PSX: Made changes to avoid signed overflow and left shift of signed variables in the CPU core JUST BECAUSE. Fixed several violations of C/C++ sequence point rules in relation to call order in expressions of functions with side effects, that could lead to undefined/wrong behavior with certain types of compiler optimizations and features(e.g. PC-FX emulation was broken on gcc 4.9.x with -fsanitize=undefined -std=gnu++11). August 27, 2014: NES: Handle missing input-related save state sections on load more gracefully. NES: Automatically enable emulation of the Famicom 4-player adapter for the "Nekketsu Koukou Dodgeball-bu" game. August 24, 2014: SNES: Fixed usage of wrong form of std::unique_ptr in the save state code. August 23, 2014: Made minor optimizations to the music format(NSF, HES, PSF, etc.) waveform visualization code. Removed unused selective blur code, as the algorithm is too simplistic to really be useful in Mednafen. Though on a similar subject, it may be interesting to look into SA-DCT again for PS1 and PC-FX FMV-filtering purposes, but that's an exercise for another day. Cleaned up and refactored a bit of code in drivers/*. August 20, 2014: Changed a few uses MDFN_malloc/MDFN_calloc to MDFN_malloc_T/MDFN_calloc_T, where appropriate. August 19, 2014: Lynx: Fixed a bug that could cause Mednafen to crash when a game attempts to power-down the emulated Lynx(which may occur if a game is left unattended for a prolonged period of time). August 17, 2014: GB, GBA: Fixed broken save state structure definitions for saving/loading GB APU state. This fix will cause save state backwards incompatibility issues (for states created with Mednafen < 0.9.37) on big-endian platforms. Save state variable data is now saved in native-endian form for performance reasons(and it fixes a bug introduced from the earlier save state refactoring that could cause state corruption if a state save failed when running on a big-endian platform), repurposing the most-significant bit of the total length field of the header to signal if the data is big-endian or not. August 16, 2014: NES: Custom palette loading with PAL emulation now loads from file "nes-pal.pal" instead of file "nes.pal"(NTSC custom palette). GB, NES, PCE_FAST: Implemented internal support for palettized 8bpp output when the palette color components have a precision of less than 8 bits. August 13, 2014: PSX: Implemented a very rough simulation of complex, borderline-unstable CDC behavior that "Bedlam" and "Rise 2" rely on(fixes corrupt graphics problems in those two games). August 12, 2014: Lynx: Fixed a minor stereo sound emulation issue thanks to a patch from "sage". SMS, GG: Added support for custom palettes. NES: Added support for custom palettes with 512 colors(for de-emphasis bits colors). Refactored custom palette loading code out of emulation modules and into Mednafen's core. August 8, 2014: PCE, PCE_FAST, PC-FX: Fixed a bug that could cause a crash if the emulated CD lid/tray is closed with no disc when loading a pre-0.9.37 save state. August 5, 2014: Hardcode enabling of DirectSound and WASAPI in configure.ac for mingw builds, rather than enabling it only if the relevant header files are found; this will help ensure that any unofficial Windows builds of Mednafen in the future will not be silently broken/lacking in important features. August 4, 2014: The input port state data memory is no longer zeroed-out in bulk in the driver-side input code on emulated devices input updating, instead being cleared as needed by each input; this change is to faciliate implementing switches in a more proper and flexible way in the future than they're handled now. Changed the types of the arguments to MDFNI_SetInput() and MDFNGI::SetInput to be more sensible. Added dummy enum(= 0) to GameMediumTypes to fix a bug introduced from the July 31 GameType change. WonderSwan: Add strict checking for proper save game memory file size on game load(NOTE: this will cause problems for Dicing Knight and Judgment Silversword save game memory files written with Mednafen versions prior to 0.9.36). August 3, 2014: PCE, PCE_FAST: Fixed bug(from sloppy handling of errors) that caused battery-backed save game file destruction if an error(e.g. missing CD BIOS, memory allocation failure, etc.) occurred during game load and initialization. August 2, 2014: PCE: Added missing(oops) code to load MCGenjin non-volatile memory from disk on game load, and no longer compress MCGenjin non-volatile memory files on disk(in gzip format). PCE, PCE_FAST, PC-FX: Add strict checking for proper save game memory file size on game load. August 1, 2014: Removed unused MDFNGI::soundrate. PSX: Reworked InputDevice::ReadNV() to reduce overhead in the memory card saving code. July 31, 2014: Begin phasing out usage of MDFNGI::GameType July 30, 2014: GBA: No longer compile with -fno-unit-at-a-time as it's no longer the 2000s. ;) Implemented a new, more flexible abstraction for removable media changing during runtime, and updated the NES, PCE, PC-FX, PCE_FAST, and PSX modules to use it. Removed mostly-unnecessary gcc command-line arguments that control inlining decision parameters from the build system. July 27, 2014: Removed the recently-added state load error recovery code, as it's not worth the overhead and increased code complexity, especially considering the deferred error and optional-section changes from today. Fixed save state loading code to not read past the end of the state while searching for sections(which is important now that we made some guarantees and implications about how the stream passed in is utilized). PC-FX, MD: Mark input device state sections as optional to prevent the new state code from erroring out completely when a section is missing(as will happen when loading a state saved when a different device was selected). PSX: Restructured save state generation to be hierarchical(in relation to multitaps). Reworked MDFNSS_StateAction() to not throw exceptions, instead marking deferred error state, to avoid potential security issues under low memory conditions(due to state variables being loaded without the emulation module-specific sanitizing code being run). July 26, 2014: Made use of "override" specifier in a few places. On save state load(outside of the state rewinding code path), a temporary save state is now created before the load is attempted. If the load fails, the temporary save state is loaded. Now compile QuickLZ with -fno-strict-aliasing to avoid potential future trouble, since it does violate strict aliasing in at least a few places. July 25, 2014: Fixed broken utility get_BE<>() template function in Stream. Moved gzip-reading-into-memory algorithm(exponentially increasing read() sizes along with allocated memory) from MDFNFILE to MemoryStream. Moved mmap() functionality from MDFNFILE(file.cpp) to FileWrapper/FileStream. Moved IPS patching code out of file.cpp, and made the code patch a Stream instead of raw memory directly(which causes a slight drop in efficiency, but it shouldn't be a problem). GB, PCE_FAST: Utilize GZFileStream, and properly error out if there's a fatal error(other than file not found) during save game loading. July 24, 2014: Changed how missing section errors are handled; an exception is now thrown when loading a save state and a section is missing, unless MDFNSS_StateAction() was called with optional == true. Utilize GZFileStream instead of direct zlib gz*() usage in the game/ROM image file loading code. July 23, 2014: Re-implemented support for state-rewinding during movie recording, and added support for doing it during playback. Though trying to rewind across a movie state-change(in the sense of recording/playing started or stopped) will cause the rewinder to error out, as should be expected. Input-recording movies are no longer written/read gzip-compressed(just plain file access), and the format is now slightly different as well. In the fast(state-rewinding) state loading/saving code, align the stream's position to a 16-byte boundary before writing large(>=65536 bytes) variables, to ostensibly improve memory copy performance. Save and verify(on load) section names and small canaries in state-rewinding save states, to help prevent save game corruption in case something goes horribly wrong(such as from a severe (de)compressor or compression filter bug). July 22, 2014: Utilize strongly-typed enum for GZFileStream open modes, to prevent accidental usage of FileStream open modes. July 21, 2014(accumulated changelog for several days): Fixed some subtle bugs in MemoryStream. Removed "srwcompressor" setting; only "quicklz", the default of the removed setting, is available and used now for state rewinding. Refactored and rewrote state rewinding code, with some optimizations over the old code for systems with large save states(PC-FX, PS1). Simplified and cleaned up some of the core save state functions. Adapted core save state code to take a Stream(though the save state code does require fast seeking during saving and loading, so that rules out passing in a GZFileStream directly), and to utilize exceptions to signal error conditions(except for missing sections, that still needs to be worked out). Made changes to the build system to require and enable C++11(-std=gnu++11). SNES, PSX: Reverse sound data before resampling when state-rewinding, to fix the sound crackling. PSX: Fixed a bug that caused a crash when trying to use save states during PSF playback/PS-EXE execution. NES: Save NSF playback variables in save states(though save states made during NSF playback are still missing expansion chip state data). WonderSwan: Resolved a few compiler warnings. WonderSwan: Save/Load relevant WSR playback state in save states during WSR playback. PCE, PC-FX, SMS, SNES, VB, WonderSwan: Utilize GZFileStream, and properly error out if there's a fatal error(other than file not found) during save game loading. Wrote GZFileStream class, derived from Stream, as a wrapper around gzFile. July 17, 2014: NGP: Added proper error handling(using exceptions) to the FLASH loading and saving code July 16, 2014: NGP: Initialize XIX, XIY, and XIZ to match what the BIOS leaves them as(as observed via MESS' debugger), and removed the ROM patches/hacks for "Puyo Pop". NGP: Utilize exceptions in the ROM image loading and initialization code. NGP: Fixed some endian-related issues in regards to reflecting bits of the ROM header to RAM during initialization. NGP: Initialize VRAM differently to partially reflect the state the BIOS leaves it in, and removed the "Metal Slug - 2nd Mission" ROM patch/hack (thanks to "FluBBa" for the tip on what the game was doing/relied on). NGP: Fixed a potentially-exploitable overflow bug in the FLASH dirty block list code. July 15, 2014: Added a truncate() method to the Stream class and derived classes. July 13, 2014: SMS: Made use of exceptions in the file loading and system initialization code paths. July 11, 2014: SNES: Removed unused(in this fork) header and build files. SNES: Removed nonfunctional stubish(in this old version of bsnes) ST011 and ST018 emulation code. SNES: Removed SGB emulation code that was never properly hooked up in Mednafen. SNES: Removed unsupported and untested(in Mednafen) 21fx emulation code. SNES: Made minor structural optimizations to the S-CPU and SuperFX emulation code. July 10, 2014: SNES: Made minor structural optimizations to the S-DSP emulation code. July 8, 2014: VB: Made (better) use of exceptions in the ROM image loading and initialization code. NES: Made use of MODE_WRITE_INPLACE to write nonvolatile (saved game) memory to disk. July 7, 2014: PSX: Made use of MODE_WRITE_INPLACE to write memory cards to disk, to slightly reduce the probability of unrecoverable memory card destruction/corruption under certain pathological system conditions(though in the future we should probably change it to use a temporary filename and rename(), at least on POSIX-compliant systems). Added a new file open mode to FileWrapper(and FileStream) named "MODE_WRITE_INPLACE", that is like "MODE_WRITE"(and "wb" with fopen()), EXCEPT that it won't truncate the file if it already exists. July 4, 2014: PSX: Fixed a longstanding bug(and removed the associated kludge) in the DMA IRQ emulation, per tests on a PS1. Added missing relevant copyright statement to pce_psg.cpp and pce_psg.h(since the origin of the skeleton code, TGEmu, isn't listed in the documentation anywhere). Cleaned up a few #include statements(#include "mednafen/XXX.h" to #include ). June 30, 2014: PSX: Made optimizations to the SPU reverb resampling code. PSX: Added emulation of an SPU quirk/bug regarding its handling of ADPCM blocks with a shift value greater than 12, per tests on a PS1. It's unlikely any commercially-released games use such shift values, though. June 28, 2014: PSX: Replaced 128KiB GTE division reciprocal table with a 257-byte table and Newton-Raphson reciprocal calculation code. -- 0.9.36.2: -- June 25, 2014: SNES: Save extra input device state in save states that the bsnes core fails to save. Removed computationally-expensive and unnecessary(it's already done in the state load code path) duplicate-variable check debug code in the save state saving code. SNES: Hooked up Super Scope emulation. June 24, 2014: PCE_FAST: Removed debug puts() in VPC mixing inner loop, and added compiler hints to some of the rendering and mixing loops. Fixed an ancient regression introduced around version 0.9.16-WIP. Said regression caused the file extension of the save state used by the auto save state save/load feature(setting "autosave") to be the same as the extension used for the currently selected save state slot, effectively overwriting that save state slot on exit. Added setting "video.disable_composition", to allow the user to override Mednafen's default behavior of disabling desktop composition on Windows Vista and Windows 7. June 23, 2014: MD: Fixed a 68K emulation regression introduced in 0.9.34, that broke save game loading in "Sonic the Hedgehog 3", and possibly broke other games in subtle ways. MD: Fixed prototype for cart mapper 16-bit write function. MD: Cleaned up debug printf()s. PSX, PCE, MD, CDPLAY: Resolved a few compiler warnings. PC-FX: Fixed an old bug that, when coupled with changes made in 0.9.35, caused low-volume crackling in the CD-DA sound output. -- 0.9.36.1: -- June 22, 2014: Fixed a bug that could cause an assert() to trigger under certain circumstances when the scale2x/scale3x/scale4x special scaler is used with SNES emulation. PSX: Fixed a major SPU emulation regression in 0.9.36 that completely broke sample playback on a channel when the playback rate was set near the maximum. PSX: Fixed noise emulation playback frequency calculation(particularly for the lowest noise playback frequencies), per tests on a PS1. It's unlikely to have any audible effect on games, though. -- 0.9.36: -- June 17, 2014: PSX: Rewrote SPU ADPCM decoding code per tests on a PS1; fixes the early voice cutoff problem in "Thousand Arms", and possibly some other games as well. Seems to fix the post-battle quasi-random lockup problem in the Japanese version of Tales of Destiny. June 15, 2014: WonderSwan: Added experimental, undocumented support for interfacing with trap15's WonderFence program, which provides MobileWonderGate emulation; controlled via settings "wswan.excomm" and "wswan.excomm.path". This support is currently only available on UN*X-like platforms. WonderSwan: Added SRAM size calculation for the raw header value of 0x05(used by MobileWonderGate). WonderSwan: Corrected the SRAM size calculation for the raw header value of 0x04(used by Dicing Knight and Judgement Silversword). WonderSwan: Rewrote RTC emulation code to avoid runtime use of C library time functions(fixing potential desync issues when using netplay and input-recording movies), and fixed the time initialization code to reflect the current local time instead of UTC. June 14, 2014: PSX: Implemented experimental support for save states. PSX: Rewrote MDEC execution loop; the MDEC emulation model still is far from perfect, though. Fixes the lockup during the intro FMV of a corrupt copy of "Dragon Knight 4" that's floating around the Internet. June 10, 2014: Ripped out incomplete "snes_perf" emulation module, and ripped out the unimplemented PC emulation stub module. June 9, 2014: PSX: Improvements to SPU volume sweep emulation accuracy per tests on a PS1. Fixes sound/music wonkiness in "WipEout 3". June 6, 2014: PSX: Minor improvements to MDEC YCbCr to RGB color conversion accuracy, per tests on a PS1. -- 0.9.35.1: -- June 5, 2014: PSX: Improved accuracy of the GPU framebuffer rectangle copy command(0x80) per tests on a PS1; fixes graphical glitches in the water effect of stage 4 of "Einhander". -- 0.9.35: -- May 31, 2014: Use a semaphore to allow for tighter emulation-thread->video-thread blit timing granularity. May 29, 2014: PC-FX: Battery-backed save game memory is now saved to a file during runtime if the memory contents have changed, rather than only saved on exit as before. NES: Fixed unusably-broken emulation of iNES mapper 80's internal battery-backed save-game RAM(used by "Minelvation Saga", "Mirai Shinwa Jarvas", and "Taito Grand Prix"). NES: Implemented battery-backed save game support for iNES mapper 69(for the two or so games that need it). NES: Fixed multiple major issues with the iNES mapper 69 save state code. NES: Added missing PowerPad default button assignments. NES: Fixed how Mahjong, Family Trainer, and PowerPad input device code reads input data, to fix brokenness on big-endian platforms, and to prevent (mostly benign) buffer overflows. NES: Fixed some buffer overflow issues in the "Barcode World" barcode reader input device emulation code. NES: Changed how save state loading works so that failure to load one section will not abort loading, but signal a deferred error(most useful with missing input device sections). May 28, 2014: Fixed some careless unsafe instances of "-2147483648" added since 0.9.34.1. PSX: Draw lightgun crosshairs in a separate pass to the lightgun color/brightness evaluation logic, so that crosshairs from a lightgun on a lower port won't mess up the color evaluation logic of a lightgun on a higher port. PSX: Refactored the lightgun crosshair drawing code to reduce code duplication, and made some changes to the drawing algorithm to increase visibility(and make the crosshairs not lopsided anymore). Pack IDIT_X_AXIS and IDIT_Y_AXIS input types in 2 bytes, 1-byte-aligned, instead of 4 bytes, 4-byte-aligned. NES: Fixed some minor issues with the lightgun coordinate translation calculations(hopefully for the last time :p). PSX: Fixed a bug in the Guncon and Justifier emulation code that resulted in memory corruption when the crosshairs were positioned near the upper left corner of the screen. NES: Fixed a bug in the iNES mapper 71 code that was causing Mednafen to crash when trying to play "Dreamworld Pogie". May 27, 2014: NES: Made some improvements to the new X24C01P/X24C02P EEPROM emulation code, though it's still a bit messy. May 26, 2014: NES: Added support for iNES mapper 159. NES: Added emulation of mapper 16's EEPROM. NES: Fixed a bug that was causing some of the Bandai Datach games to have corrupt graphics. NES: Reworked how the Zapper crosshairs are drawn to fix the problem of them being drawn at the wrong position if "nes.clipsides" is set to "1"(and to render with 8bpp and 16bpp video output, and to update properly in respect to MDFN_MidLineUpdate(); though neither is currently used by Mednafen per-se, they are useful for ports). NES: Fixed a design flaw that could easily cause desync during netplay with an emulated Zapper if different clients' video settings are different. May 25, 2014: Cleaned up some of the netplay code to increase maintainability. May 24, 2014: Changed how the Linux joystick code de-initializes joysticks when rumble has been used, to try to minimize the probability of a kernel panic due to buggy(race conditions) Linux kernel drivers. PSX: Added emulation of GPU IRQs. PSX: Implemented support for GPU command number mirrors. May 23, 2014: NES: Added SSE2 code to the sound resampler, but currently disabled(#if 0'd out) as it will probably perform worse than the MMX version on a large number of CPU models. NES: Made some general minor optimizations to the sound resampling code. NES: Add "memory" to the clobber list of the sound resampler's MMX inline assembly MAC loop code. May 22, 2014: PSX: Improved accuracy of GPU line drawing algorithm. WonderSwan: Improved noise(sound) emulation(thanks to trap15). May 20, 2014: PSX: Optimized(reduced memory usage) layout of the GPU command table. May 19, 2014: Added gcc format string check attributes to the applicable trio function prototypes, and fixed a few minor problems the checks uncovered. Fixed a compilation error when compiling without the debugger(--disable-debugger passed to the configure script). PSX: Fixed a glitch/bug in the triangle rasterization code that was causing some textured rectangular quads to have incorrect distortion of the texture(see "I" of "OPTIONS" in the Twisted Metal 2 title screen). May 18, 2014: Implemented MDFND_WaitCondTimeout() (currently unused by anything, though). May 14, 2014: Make the "wasapish"(WASAPI shared-mode) sound driver the default sound driver for where it's available(Windows Vista and newer). May 13, 2014: PCE, PC-FX: Implemented CD-DA de-emphasis filter support(though the filter is a rough approximation). PCE, PC-FX: Optimized CD-DA filtering code, and implemented an SSE2 version of the oversampling filter code, to partially mask the performance hit that the oversampling filter causes. May 12, 2014: PCE, PCFX: Loosened output resampling filter design constraints so that the resampler doesn't take excessive amounts of CPU time with higher(96KHz+) output rates(made feasible by implementing CD-DA oversampling). PCE, PC-FX: CD-DA is now run through a 2x oversampling filter(this does have a minor performance penalty to it though, sadly). -- 0.9.34.1: -- May 11, 2014: Fixed a bug in the sound format conversion code that caused garbled audio when using the new shared-mode WASAPI driver with a sound device configured with more than 2 speakers. -- 0.9.34: -- May 10, 2014: CDPLAY: Optimized the visualization code. Added a new shared-mode WASAPI sound driver named "wasapish". For consistency, the "wasapi" and "sdl" sound drivers no longer subtract the overhead latency from the desired buffer size when calculating the size of the buffer to use. Changed the default value of setting "sound.buffer_time" to "0", to enable usage of partially-new code that calculates a buffer size automatically based on emulated system characteristics and the sound driver in use. May 8, 2014: GB: Fixed tilt sensor emulation that was broken in the May 6 IDIT_BUTTON_ANALOG packing change. Updated the embedded copy of libmpcdec to the latest SVN copy; fixes problems with playback of older SV7 format files(with the CD emulation code). Wrote threading code to target Win32 APIs directly, rather than rely on SDL's threading support, for the Windows build. May 7, 2014: GBA, NES: Resolved some compiler warnings. No longer compile with -mstackrealign for the Windows build, instead using "__attribute__((force_align_arg_pointer))" where appropriate(e.g. Win32 and SDL callbacks). Updated the cheat console-interface code to use a condition variable instead of sleep-waiting. Remove an erroneous extra mutex unlock around a driver-side message queue. May 6, 2014: Pack "IDIT_BUTTON_ANALOG" and "IDIT_RUMBLE" type input device data more tightly(only aligning to a byte-boundary now, and packing as 16-bits rather than 32-bits). Calculate and send a device type number for each emulated port with the netplay login data(the data is not used currently by mednafen-server, but will be in the future). May 5, 2014: Reworked the multithreaded CD reading code to use condition variables, rather than repeatedly unlocking, sleeping, and locking mutexes. This should help with performance a bit, and will prevent a lot of unnecessary CPU/CPU core wakeups, especially after loading multiple disc images with M3U files(since a read thread is created for each disc image, at least when CD image memcaching is disabled, the default). Moved common parts of the MDFNI_Load and MDFNI_LoadCD functions into a separate function to reduce code duplication. Emulation modules' LoadCD functions all now throw exceptions on error, so changed the function pointer prototype to remove the return type(void all the way!). May 4, 2014: PCE, PCE_FAST, PC-FX, MD: Make better use of exceptions(and handle some that were not handled properly before) in the game loading and initialization code paths. Emulation modules' Load and LoadCD functions may now throw exceptions upwards instead of calling MDFN_PrintError() and returning 0. Reworked IPS parsing and applying code to use exceptions, and Stream instead of stdio file access. Reworked MDFNFILE to use exceptions to signal errors on file loading(the memory-stream functions provided primarily for the NES module's use still don't throw exceptions, however). Lynx: Removed undocumented(and largely pointless) support for loading a gzip or ZIP-compressed "lynxboot.img" firmware file. GB: Made game loading code more resilient to avoid leaking memory if an error occurs during game load. Added a gcc format string check attribute to an MDFN_Error constructor, and fixed a few minor format string problems this checking exposed. May 3, 2014: GBA: Reworked save file type parsing code to use FileStream instead of stdio. GBA: Sanitize a few variables in the flash memory save state loading code to prevent malicious save states blah blah blah. GBA: Added masks to array access in the EEPROM emulation code to prevent malicious save states from corrupting the heap. GBA: EEPROM file loading code now errors out if there's an error opening or reading the file(but not if the error is that it simply does not exist), or the file is of an unexpected/incorrect size. May 2, 2014: NES: The filename scanning to select region/video standard(NTSC or PAL), controlled via the "nes.fnscan" setting, now uses the filename and path stored in the ZIP file(when loading a NES game from a ZIP file) rather than the name of the ZIP file itself. Additionally, the filename scanning feature no longer is affected by strings in the file extension(though I doubt this will affect anyone, as you'd have to be pretty deranged to name a NES game file like that). May 1, 2014: PSX: Made CD-DA playback position report code more correct and resilient in regards to Q subchannel checksum errors. April 30, 2014: PSX: Added settings to allow for scaling the analog stick axis values, to work around the issue of different logical ranges of motion for PS1 DualShock and Dual Analog controllers versus more modern PC-compatible gamepads. April 29, 2014: Added logic to gracefully fall back to other fullscreen stretch modes if the current fullscreen resolution is too low to support the stretch mode selected. April 28, 2014: Added support for mapping joystick axes to lightgun screen coordinates; however, the configuration must be done manually by editing the configuration file. (Additionally, the translation will not function properly if the software-rotation feature(via ALT+O) is used.) Example: psx.input.port2.guncon.x_axis joystick 630f0eab74165481 00008000 psx.input.port2.guncon.y_axis joystick 630f0eab74165481 00008001 Alternate coordinate translation for fullscreen mode, intended for physical modern lightgun and pointer devices: psx.input.port2.guncon.x_axis joystick 630f0eab74165481 00048000 psx.input.port2.guncon.y_axis joystick 630f0eab74165481 00048001 April 27, 2014: GB: Cleaned up the memory-mapper code, fixing a few bugs that allowed some games(like "Best of the Best Championship Karate") to cause Mednafen itself to crash. GB: Fixed MBC7 support(it's been broken in Mednafen for a loooong time). GB: Disabled the broken simulation of HDMA overhead that seemed to be doing more harm than good; fixes problems with unstable framerates and inaccurate slowdown on some GBC games(such as "Shantae"). MD, NGP, WonderSwan: Fixed potential memory leaks(memory was not really leaked due to how Mednafen is currently structured, but they could have become problematic leaks in the future). Merge clamp.h into math_ops.h. More #include statement changes in emulation module sources to use #include style instead of #include "../BLAH". April 26, 2014: Fixed a bug that was causing the output image to be distorted when rotation(via ALT+O) was used in conjunction with a *.videoip setting value of "x" or "y". Added a test/demo module to help work out bugs in the video processing code paths. April 25, 2014: Reworked the build system and numerous source code and header files to allow for less sloppiness with -I include paths. GB: Statically-allocate a 320-byte graphics buffer instead of malloc()'ing it. April 24, 2014: Fixed a problem with the configure script so it will (hopefully) no longer error out when cross-compiling. MD: memset() line buffer padding areas to prevent sprite rendering from reading from uninitialized memory. MD: Fixed violations of strict aliasing in the 68K CPU core. PC-FX, VB: Replaced SoftFloat, used in FPU emulation, with newly-written-while-sleep-deprived code. It's possible this may cause regressions, since floating-point stuff is rather hairy... Fixed an ancient bug that made iterative multibyte-value cheat searches extremely unreliable. Fixed a bug that broke the output image when displaying a source image with multiple horizontal resolutions at a specific rotation angle(selected via ALT+O). Added support for negative .scanlines setting values, which will change scanline behavior and size to overlay/obscure the previous field's line data if "video.deinterlacer" is set to "weave". Added setting "video.deinterlacer", default value of "weave". NES: Align a temporary line buffer array to prevent the possibility of a CPU fault and/or poor performance on non-x86 platforms. Simplified handling of muli-horizontal-resolution frames by changing "LineWidths"'s type from MDFN_Rect(representing x offset and width) to a simple int32(representing just width). April 23, 2014: GB: Added support for custom palettes that specify BGP, OBP0, and OBP1 colors independently. April 18, 2014: PC-FX, VB: Corrected the debugger's disassembly of the 5-bit sign-extended immediate form of "mov" (the disassembler was failing to sign-extend). -- 0.9.33.3: -- April 16, 2014: Reworked the FPS calculation algorithm to produce more accurate FPS values. Added a manifest file that's embedded into the Windows executable, to ensure that noxious DPI virtualization and scaling available on Windows Vista and newer will not be used with Mednafen. Added code to disable DWM composition when running on pre-Windows 8 systems, to ensure better performance and less video juddering. (Sadly, it's not possible to disable desktop composition in this manner on Windows 8 and later) PCE, PCE_FAST: Added a missing ADPCM playback variable to save states; fixes the problem of severe ADPCM sound distortion when loading save states that are saved during ADPCM playback(especially noticeable with the state rewinding feature). April 15, 2014: Modified MDFN_RemoveControlChars() to not kill non-7-bit-ASCII text. April 12, 2014: Misc minor code cleanups and fixes for some compiler warnings. April 11, 2014: NES: Fixed broken emulation of board "UNL-Sachen-8259B"(used in the game "Silver Eagle"). April 10, 2014: Fixed the with-drop-shadow internal text drawing routine to not draw horizontally one pixel beyond the specified maximum width in some circumstances. April 9, 2014: SNES: Altered a code construct to hopefully resolve a reported compiler error with clang. Error out of save state loading when the version specified in the save state is invalid. Call SDL_WM_SetIcon() before SDL_SetVideoMode(), to fix the problem of the missing Mednafen icon on some platforms/window managers. Fixed a minor integer overflow issue in the core PSF loading code. NES: Fixed some problems in the ROM image file loading code, including a potential heap overflow vulnerability. -- 0.9.33.2: -- March 24, 2014: PSX: Fixed a small MDEC emulation bug; fixes the hang during startup in "SimCity 2000". March 17, 2014: The order of evaluation of the frame advance and run normal command keys/hotkeys is now based on whether or not we're currently in frame advance mode, to allow for the derivation of a single-press pause/unpause key(effected by the user mapping both functions to a single key). March 15, 2014: Renamed the log2 LUT array in the mpcdec code to avoid shadowing the math library function log2(). NES: Fixed the problem of the VS Unisystem DIP switch position display(accessed via the "F6" key) being invisible. PCE: Fixed broken MCGenjin support. March 13, 2014: CDPLAY: Tweaked visualization code to reduce memory and CPU usage. March 11, 2014: Lynx: Minor code cleanups. -- 0.9.33.1: -- March 8, 2014: Fixed compiler errors when compiling without the debugger. Fixed a couple of memory leaks. PSX: Made better use of exceptions in the loading and initialization code paths(and avoid leaking memory if a part of the process fails). PSX: Protect against sound buffer overflow without causing a call to abort() so that using save states(when they're added) or power toggling/resetting in the debugger while in step mode is safer. PSX: Output of debug messages to stdout and stderr is now controlled via the "psx.dbg_level" setting, whose default value of "0" disables almost all debug messages. Set the setting to "3" to obtain roughly the same output as previous versions of Mednafen. March 1, 2014: Modified the simple interpolation pixel shader code to avoid using the GLSL 1.3 function "round()", for better compatibility with some OpenGL implementations. -- 0.9.33: -- February 25, 2014: PSX: Reworked CD-XA ADPCM playback buffering and sector buffering per tests on a PS1; fixes the problem of cut-off voices in some games("Breath of Fire 4" for example), and *should* increase the playability of some games like "Um Jammer Lammy". Also, these changes seem to have somehow fixed the corrupted boss graphics in the first boss fight in "Captain Commando". PSX: Refactored sector reading code, and added support for reading from the leadout area(the data is synthesized, though). February 15, 2014: Implemented simple dithering in the 16-bit->8-bit sound sample conversion code. Added checks for legacy DOS device filenames to the untrusted file include path checking code used for Win32 and DOS. February 11, 2014: Added support for "FOUR_CHANNEL_AUDIO", "TWO_CHANNEL_AUDIO", "COPY", "NO COPY", "PRE_EMPHASIS", and "NO PRE_EMPHASIS" directives in the cdrdao TOC-format file parsing and Q subchannel synthesis code. PC-FX, VB: Fixed V810 "mul" instruction overflow flag calculation per tests on a PC-FX. February 2, 2014: PSX: Added settings "psx.slstart", "psx.slstartp", "psx.slend", and "psx.slendp" to control the vertical positioning and viewable area(more useful with PAL). NES: If the value of the nes.slstart? setting is larger than the value of the nes.slend? setting, swap the values when calculating the surface rectangle. Rewrote the simple interpolation pixel shader code(for "ipsharper", "ipxnoty", "autoipsharper", etc.) to fix problems with the autoip* shaders sometimes causing diagonal distortion lines in some scenarios. February 1, 2014: Fixed a bug that caused major graphics corruption when rotation(ALT+O) is used with a multiple-horizontal-resolution source image(emulation modules that can produce such an image include pce, pce_fast, pcfx, psx, and snes). Fixed a bug in the SDL soft stretching with rotation code path that effectively caused the source surface rectangle Y offset to be ignored(with varying effects from emulation module to emulation module). GBA: Implemented support for 16bpp video output format. GBA: Implemented usage of MDFN_MidLineUpdate(). January 29, 2014: GB, NES, PCE_FAST, SNES: Implemented usage of MDFN_MidLineUpdate() call to allow for 0 video frame latency in some environments in the future(though this is not going to be possible for the VB module due to how it renders); and, we still need to figure out the semantics of handling interlaced video this way. January 24, 2014: Replaced some usage of snprintf() with trio_snprintf(). Replaced some usage of round(...) with floor(0.5 + ...) where appropriate, to work with the non-C99-compliant libc distributed with the last stable DJGPP release; however, we didn't have too many uses of round(), but it may make sense in the future to just insert our own custom round() function instead to preserve code clarity. (Note that floor(0.5 + ...) does not always give the same result as round(), as it rounds negative midway points(-0.5,-1.5, etc.) differently). January 23, 2014: Made some changes to the build system to support a DOS port. January 18, 2014: VB: Moved initialization of some variables from the VSU emulation class destructor to the constructor(must have been asleep or something when that code first went in); fixes audio "pop" that could sometimes be heard on VB emulation startup. January 17, 2014: Use XInputGetStateEx() instead of XInputGetState(), if available, to allow for usage of the XBox 360 controller guide button within Mednafen on MS Windows. January 13, 2014: In the TOC file reading code, set disc type based on CD_DA/CD_ROM/CD_ROM_XA string. In the CUE sheet reading code, if any tracks are MODE2, assume the disc type is 0x20(CD-XA). January 5, 2014: PSX: Moved CD-XA ADPCM resampling code from spu.cpp to cdc.cpp. PSX: CD-XA ADPCM audio is now resampled using the proper(ish) impulse responses, as observed from running CD-R-eating-nom-nom-nom tests on a PS1(this improves CD-XA ADPCM quality a bit compared to what it was in previous versions of Mednafen). PSX: Don't play CD-XA ADPCM sectors if the "realtime" bit in the subheader isn't set to 1(per an unintentional test on a PS1). January 1, 2014: Synchronize raw input mapping structures to setting strings when an emulated input device configuration is finished/interrupted, instead of unconditionally on exit or emulated device change, to prevent pollution of the primary settings file when using per-module settings override files(though in that context it doesn't make much sense to override the emulated input device mappings that way, but we're going to add per-game settings override support eventually). Allow for overriding the "video.glvsync" setting and command key input mappings via the per-module settings override files. December 31, 2013: Added support for per-module settings overrides(specified via placing settings in files named such as "nes.cfg", "pce.cfg", "pce_fast.cfg", etc.). The settings override files will be considered read-only, and should not alter the contents of the primary settings file unless an in-emulator configuration process occurs that builds on the current effective setting value. PCE, PCE_FAST: Don't generate a command error if a track number too high is specified via CD commands 0xD8 and/or 0xD9; instead, treat it as if the leadout track was specified. I'm not certain if this is correct behavior as per the actual system, but that'll have to wait until I'm able to run some tests. Fixes a startup lockup in "Star Mobile". December 22, 2013: PC-FX: CD-DA impulse volume is now adjusted based on the current CD-DA playback rate. PCE, PC-FX: Recalculated the CD-DA impulse phase adjustment convolution table to fix a tiny quality issue. December 18, 2013: PC-FX: Implemented ADPCM phase-correction filtering(related to the Dec. 1 resampling changes), and modified the ADPCM volume handling code to not throw away so much ADPCM output sample precision. December 1, 2013: PCE: Changed default value of "pce.psgrevision" from "huc6280a" to "match"; this causes revision "huc6280" to be used for non-SuperGrafx games, and "huc6280a" to be used for SuperGrafx games and HES playback(since SuperGrafx emulation is forcibly enabled during HES playback). PCE, PC-FX: Implemented new sound resampling and filtering code(actually we did this in November, but it's been a definite work-in-progress since then, and still is to a degree); benefits include better frequency response(especially for CD-DA), and more flexible filtering options(code-wise, for the future). Downsides include increased CPU utilization, and the output sound rate has a degree of error. Minimum CPU usage(and quality) with the new resampling code can be achieved with the following setting values: pce.resamp_quality 0 pce.resamp_rate_error 0.0000350 pcfx.resamp_quality 0 pcfx.resamp_rate_error 0.0000350 Maximum CPU usage(and quality, though arguably overkill) can be achieved with: pce.resamp_quality 5 pce.resamp_rate_error 0.0000001 pcfx.resamp_quality 5 pcfx.resamp_rate_error 0.0000001 PCE: Removed support for the "enhanced" PSG revision(previously selectable by pce.psgrevision setting), as it had negligible benefits, caused problems with at least one game, and made the PSG emulation code slightly more complex. PCE: Added setting "pce.adpcmextraprec", default value of 0, that when enabled will do the same thing that the PCE_FAST module is now hardcoded to do with ADPCM predictor precision. PCE_FAST: Reduced Blip_Buffer attenuation of upper frequencies with CD-DA playback, and also to a lesser degree PSG sound. PCE_FAST: Removed stubish Tsushin Booster code; the regular "PCE" module's better for emulating Tsushin Tool anyway, as it includes keyboard emulation. PCE_FAST: Output full 12-bit ADPCM predictor instead of truncating it to 10-bits, for less whining in ADPCM sounds; since we're targetting PCE_FAST more for compatibility and subjective quality than outright accuracy per-se. PCE_FAST: Utilizing some macro-magic, only use computed goto on compilers known to support it. PCE_FAST: PSG revision changed to HuC6280A instead of "Enhanced". November 24, 2013: Reduced the maximum supported sound output rate from 1048576Hz to a much more reasonable 192000Hz(significantly eases proper sound processing algorithm design and testing). November 16, 2013: PCE_FAST: Fixed a potential crash after a garbage/corrupted ROM image is loaded. November 12, 2013: Reworked the debugger UI code to fix various thread safety issues by running it(drawing, and input processing) in the game/emulation thread instead of the main/video blit thread. November 9, 2013: PCE: During HES playback initialization, the second emulated VDC's registers are now initialized properly so that the emulation event system isn't overtaxed(which drove up CPU usage considerably during HES playback). It may be prudent to look into implementing an optimization(based on VDC CR and DCR IRQ enable bits) in the HuC6270 emulation code so that a similar issue doesn't occur when the user has set "pce.forcesgx" to "1" and is emulating a non-SuperGrafx game; however, this could have a performance PENALTY for SuperGrafx games due to the required need to recalculate events on every VDC write(unless we're smart and only recalculate when the IRQ enable bits change?). November 7, 2013: Reworked settings string->floating-point conversion code to not use ancient(and apparently buggy) code from glibc, and instead rely on the system's libc(which is ostensibly less buggy!); also changed some of the NES setting structure entries so that the default values and minimum/maximum values have the same number of places after the decimal point to forestall any future similar problems with libc strtod(). November 3, 2013: PSX: Implemented forced synchronization before calling debugger interface core hook. Changed debugger CPU core hook semantics so that the core emulation code will only call the driver-side debugger interface code when absolutely necessary(which will allow for proper emulator core forced synchronization when in step mode without killing performance, which is a prerequisite for the register view, save states, and reset/power to work properly in step mode; actually implementing said forced synchronization will have to be done carefully on a core-by-core basis, though, in addition to other changes to make major machine state changes work reliably when in step mode). November 1, 2013: PCE_FAST: Changed CD-DA Blip_Synth treble parameter so that the upper parts of the CD-DA frequency spectrum aren't attenuated so much. PCE_FAST: Removed PC-FX-specific code from the CD drive emulation code. PCE_FAST: Forked PSG, CD interface unit, and CD drive emulation code so that it's no longer shared with the regular PCE and PC-FX(for CD drive) modules. October 25, 2013: SNES: Added support for Game Genie codes. SNES: Simplified(and hackified gloriously!) and reduced memory usage of SuperFX memory mapping code. October 22, 2013: A name(used in the window title bar) for loaded CD games will now be extracted from the filepath, as was already done for cart-based games. October 21, 2013: Reworked cheat loading and saving code to use FileStream. Renamed Stream::printf to Stream::print_format to avoid head-desking. GBA, PCE, PCE_FAST: Rewrote custom palette loading code to use FileStream, and removed the undocumented gzip'd custom palette support in the process. October 20, 2013: PSX: Added limited support for entering "GameShark" cheats in the cheat interface(not every code type is supported), and some cheats may not work properly anyway due to differences in the timing of RAM patching in Mednafen vs on a actual GameShark. Cheat support: The cheat interface's cheat list now displays less information overall, but is better structured. Fixed broken cheat conditions when condition unit size is greater than 4 bytes(due to a missing typecast). The interface for adding and modifying a cheat now exposes more of the core cheat engine functionality. Added support for RAM copy and RAM repeat/fill type cheats to the cheat engine. October 18, 2013: NES: Added support for entering "Pro Action Rocky" cheats in the cheat interface. GB: Added support for entering "GameShark" cheats in the cheat interface. Refactored NES and GameBoy Game Genie decoding code from the Mednafen core into the NES and GameBoy cores respectively. Made some changes to the cheat interface: Cheat text size is now larger with higher resolutions(though the size increase is a bit too granular). When asking to add a new cheat, the default will now be 'Y' instead of 'N'. System-specific cheat format adding support(e.g. Game Genie) has been moved to the main menu. When adding a system-specific cheat(e.g. Game Genie), the code is now asked for before the name, and the default for the name is set to the code text. October 10, 2013: Lynx: Added emulation of Lynx 2 stereo audio registers, based on patches submitted by "sage". October 8, 2013: Added a very simple double-precision floating-point range test to tests.cpp. October 1, 2013: PC-FX: Changed the default value of setting "pcfx.rainbow.chromaip" from "1" to "0". When reading the TOC from a physical CD with the READ TOC command, now use response format 0010b instead of response format 0000b so that we can get the disc type field stored in the TOC. September 29, 2013: Fixed a bug that was causing the CD reading code to get confused about whether a disc(or drive dray) was inserted or ejected when the insert/eject MMC command failed, and updated the documentation in regards to physical discs and multiple CD games. Added more verbose error messages when errors with libcdio occur in regards to reading a physical CD. September 27, 2013: PSX: Improved DualShock emulation accuracy per tests on a DualShock; rumble now works in "Final Fantasy 8", and possibly other games where rumble was previously non-working. Reworked how joystick/gamepad rumble is handled on Linux, to perform better and hopefully not cause kernel panics anymore(or at least not so often as the old code did). September 25, 2013: CDPLAY: More Q subchannel information is now displayed. PSX: Removed an unnecessary and borked memset() statement from mdec.cpp. Compile with "-fno-aggressive-loop-optimizations", if the option is detected to be supported by the compiler. I don't particularly trust that new optimization in gcc 4.8.x. September 22, 2013: SNES: Eliminated bsnes' internal framebuffer, and added a scanline render callback into the Mednafen interface code. SNES: Reduced size of sound resampling buffer. -- 0.9.32-WIP: -- September 12, 2013: PSX: Reworked GPU interlacing and double-height mode emulation code a bit; fixes lockups in "iS: Internal Section" and "The Next Tetris". -- 0.9.31-WIP: -- September 4, 2013: PSX: Separated the memory map peeking functionality(for the debugger) from the main memory read/write handler, as previous timing changes broke peeking functionality, and the peeking code was making the read/write handler too complicated and hard to read. When in the debugger's step mode, blit the previous valid frame, instead of trying to blit an incomplete frame(which was buggy and prone to various modes of failure). In the future, blitting incomplete frames may be re-added as a "feature", but it will require work and guarantees in the emulation modules to make sure it works properly. Slightly refactored code that passes around video buffers(in the driver-side code) to be a bit cleaner and more clear as to what it does. September 3, 2013: PSX: Slow down CDC DMA a bit, but nowhere near how long it is on an actual PS1(that will have to wait for further tests so we don't overshoot the time required). Fixes broken music in the intro movie in "Legend of Mana" (a regression from the DMA changes on Aug 13). September 2, 2013: PSX: Various multitap changes: Improved multitap emulation, so that multitap will work properly with the "Tales of " games. Reworked how Mednafen's virtual port numbers are assigned to emulated PS1 and multitap ports(see the documentation for details on the new mapping), so multitap is not so user-unfriendly and will work better with netplay when save states are finally implemented. Note that if you have used Mednafen's PS1 multitap emulation before for more than 2-player support, this change will cause your multitap-connected configured controllers to be a bit jumbled up in regards to controller order. Renamed the "psx.input.port1.multitap" and "psx.input.port2.multitap" settings to "psx.input.pport1.multitap" and "psx.input.pport2.multitap", respectively. August 29, 2013: Changed the semantics of the experimental "-remote" command-line argument such that it now takes a value, that is used as a "key" of sorts to differentiate between debug garbage written to stdout and properly-formatted messages. Example: mednafen -remote gAsafYghGb50gAKSFskIAMARANDOMSTRINGRAWRGH SomeGame.pce ...and the frontend would use something like: char *good_line = strstr(line_buffer, "gAsafYghGb50gAKSFskIAMARANDOMSTRINGRAWRGH"); ...and also changed where the "remote" initialization occurs, so that startup messages will be properly formatted. Fixed a double-free bug in file.cpp that could be triggered if an error occurred while reading a non-compressed file into memory. Refactored handling of physical CD loading: Removed physical CD device detection heuristics from the normal game file loading path. This means you can't do something like "mednafen /dev/sr0" to load a physical CD anymore. Deprecated -loadcd. Added new command-line option "-physcd". It takes no arguments, makes it so that the typically-required "filename" argument is optional, and treats the "filename" argument as the device name. Examples of syntax: mednafen -physcd mednafen -physcd /dev/sr0 mednafen -physcd \\.\E: mednafen -force_module pce_fast -physcd August 28, 2013: Added experimental support for CloneCD-format disc images, based on my own observations and nocash notes. August 27, 2013: Fixed minor line-reading logic errors(we were discarding the last line read if it ended because of a stream EOF) with settings file and CUE/TOC file reading(with CUE/TOC file reading, it's a regression introduced on Aug 23) by changing the semantics of Stream::get_line() August 25, 2013: VB: Return a known good value on reads from the VIP version control register. VB: Tweaked noise generation algorithm a bit per VB dev observations from PVB forum members. August 23, 2013: Reworked the CUE and TOC CD image loading code to use FileStream instead of FileWrapper, to remove the 512-byte line length limit, and to fix a bug that was causing multiple copies of the sector data file to be loaded into memory with multi-track TOC images when "cd.image_memcache" is set to 1. August 18, 2013: PSX: With MDEC, added emulation of quantization multiplier quirks per tests on a PS1, reversed the order of the 1D-IDCTs to match what was observed occurring on the PS1, and improved command word parsing. The overall MDEC emulation model is still far from what it should be, though(not that commercially-released games really care), not to mention that the IDCT and colorspace conversion algorithms are still off in some test cases(looks to be precision and saturation related). (nocash notes were useful in devising tests, and for improving command word parsing) August 13, 2013: PSX: Slow down one type of DMA to the GPU, and add a cycle penalty to CPU memory reads when they occur during this type of DMA (almost fixes the glitchy "Sony Computer Entertainment" logo at the start of FF7). August 11, 2013: Made conditional cheats work on all emulation modules where cheat support is implemented(previously, they were limited to NES and PCE). PSX: Fixed improper vertical screen offset in non-interlaced mode caused by the August 9 internal GPU field toggle change. Though come to think of it, maybe it's not so improper after all, but emulating that way does introduce practical problems, and I doubt any PS1 games will be switching between interlaced and non-interlaced modes every 16ms... August 10, 2013: PSX: MDEC 2D IDCT is now done via multiple 1D IDCTs, reducing computational complexity(and CPU usage). PSX: Return data with all bits set on reads from the PIO memory area when it's not in use(for PSFs or whatnot); fixes game lockup in "Tetris with Cardcaptor Sakura". August 9, 2013: PSX: Corrected value of internal GPU field toggle when in non-interlaced mode; fixes "Toobin" in "Arcade Party Pak"(but I don't know why...) PSX: Don't flush the DMA sector data buffer on Read* command start; fixes a lockup that occurred after a while in the course selection screen of "Crash Team Racing". August 8, 2013: PSX: Made some optimizations to the new memory load pipeline stall emulation code. PSX: Improved CDC emulation model in regards to command argument FIFO handling, per tests and nocash notes. August 6, 2013: PSX: Brought pad/memcard serial I/O timing closer to that of an actual PS1; made practical(IE games don't flip out) by the aforementioned mess of a solution for pipeline stalls. PSX: Implemented hackish, ugly, kludgish, abominational, horrible, terrible, and just downright bad pipeline stall emulation for divides, multiplies, and loads from memory. August 3, 2013: Lynx: Added 16bpp video output format support. Added 8bpp and 16bpp video format support to the deinterlacing code. MD: Added 16bpp video output format support. Encapsulated mostly-platform-independent OpenGL blitting and shader code into classes. August 2, 2013: In the deinterlacer code, if the current field surface pixel format does not equal the field history surface pixel format, convert the field history surface to the current pixel format. Fixes minor graphical glitches in some circumstances when using the "overlay" "video.driver" setting. July 31, 2013: Fixed a few minor issues in Stereo_Buffer. GB: Made minor optimizations to graphics rendering code. GB: Added support for 8bpp and 16bpp video output formats(color gamut is heavily degraded in CGB games when rendering for 8bpp, though). -- 0.9.29-WIP: -- July 26, 2013: Manually replaced m4/iconv.m4 with the copy from the latest gettext, and modified it slightly, to fix build errors on some non-glibc-utilizing platforms(e.g. my Win32 toolchain setup). Fixed a bug that broke(sometimes crashing Mednafen) displaying of long lines in the console viewport(cheats, netplay). July 24, 2013: SNES: Fixed a couple of bugs that could cause memory corruption when a corrupted/bad save state is loaded. (Bad save states being loaded can still cause the emulator to lock up or trigger an assert(), and that's probably never going to be fixed, at least with the SNES emulation core). July 22, 2013: SNES: Implemented code for more aggressive frameskipping, but currently disabled pending further contemplation. Removed some unused files from the SNES emulation code tree. July 17, 2013: SNES: Changed hires blending algorithm, and only blend when in pseudo-hires mode(which is "cheating" a bit, but is ultimately the best solution I've found to blend/blur what needs to be while preserving pixel clarity). July 15, 2013: SNES: Implemented partial frameskipping support(won't affect emulation from the view of the emulated program/game, and it is disabled when interlacing is enabled). SNES: Changed it so the Mednafen core does deinterlacing, instead of the bsnes core; improves performance slightly when games are in interlaced mode. July 14, 2013: WASAPI: Prevent complete Mednafen lockup when a device invalidation error occurs after successful initialization. WASAPI: Fixed sample format conversion/volume issues with > 16-bit formats. July 13, 2013: SNES: Smashed some PPU emulation files together just 'cause. SNES: Made minor structural optimizations to S-SMP emulation. July 12, 2013: SNES: Made minor structural(shouldn't affect emulation accuracy) optimizations to SuperFX emulation. July 11, 2013: Added support for additional formats and rates to the new, experimental WASAPI exclusive-mode driver; fixes audio output on my Echo Mia MIDI sound card. May 28, 2013: CDPLAY: Added boolean setting "cdplay.visualization", default value of "1", to allow disabling of the CPU-intensive simplistic waveform visualization effect. CDPLAY: Reduced horizontal and vertical resolutions to 60% of their previous values, to reduce CPU usage. April 20, 2013: Fixed a typo-bug that would cause Mednafen to crash when, in addition to the host, the port was specified via the /server command in the netplay console. April 3, 2013: Lynx: Fixed an audio bug(or alternatively, replaced with kludges ;)) that was breaking the "mwahahaha" audio from the spiderthing in Gates of Zendocon, per a bug report and code patch from "sage". The "autoip" and "autoipsharper" pixel shaders weren't working properly when the screen was rotated(such as via ALT+O); fixed. March 23, 2013: PSX: Changed Read* and Play CD command processing, and added support for playing CD-DA via the Read* commands coupled with bit0 of the mode set via SetMode; fixes music resumption after pause issue in "Mortal Kombat Trilogy". March 19, 2013: Rearranged the psg_channel struct in pce_psg.h a bit to potentially allow for tiny performance improvements on some architectures. PCE_FAST: Made a few micro-optimizations to the BG rendering code. March 17, 2013: PCE_FAST: Added a runtime check for "cmov" instruction availability on 32-bit x86, and an alternate VDC BG/SPR mixing function that avoids using it when it's not available. Fixes an illegal instruction-related crash on older non-Intel CPUs(like AMD K6-III+), and Intel CPUs older than Pentium Pro(though I doubt that even a 233MHz Pentium MMX is fast enough to run it fullspeed anyway). Added a compiler version check to avoid utilization of "fastcall" calling convention when compiling with a version of gcc older than 4.1.0, as the older versions of gcc have code generation bugs relating to fastcall/regparm(though I'm not sure if Mednafen will even compile at all with those older versions...). Repositioned the FPS display position when in SDL software rendering mode such that it won't cause a potentially expensive backbuffer clear operation for every frame which would compromise the accuracy/usefulness of the FPS display. Fixed some bugs with the SDL software rendering mode fallback used when the "opengl" vdriver is selected but OpenGL initialization failed(doubled-buffered video wasn't being specified in this fallback case, which led to massive screen flickering when an OSD element was active). March 14, 2013: Added a configure script option to build without fancy software scalers(hq2x, 2xsai, scale2x, and the like). Replaced ancient rectangle drawing code with newer, slightly different code! February 24, 2013: Renamed edc_lec_check_correct() to edc_lec_check_and_correct(). February 19, 2013: SNES: Use higher-quality, but more CPU-intensive(and slightly higher latency, on the order of about 1ms), speex resampler instead of Fir_Resampler. PC-FX: Save-game RAM is no longer stored compressed. PCE, PCE_FAST: BRAM save-game RAM is no longer stored compressed. Optimized special scalers slightly by not initializing dynamically allocated memory for pixel data, since it's overwritten in totality by the special scalers anyway. Added a parameter to MDFN_Surface()'s constructor to allow the creation of a surface without initializing its pixel data to zero. Added a kludge to try to clear all OpenGL backbuffers(when necessary) when an OpenGL implementation with forced triple-buffering is used. Changed code so that the video backbuffer won't be needlessly cleared due to OSD presence if the OSD is only displayed in portions of the screen that are overwritten each frame anyway during normal emulated video blitting. February 18, 2013: When recording a QuickTime movie and the sound output rate is greater than 64000Hz, resample the audio stream written to the QuickTime file to 64000Hz, as the QuickTime format has issues with sound rates greater than 65535Hz. February 14, 2013: Removed MDFND_KillThread(). Worked around x87 excess-precision problems that were causing nonsensical error messages to be printed in some circumstances when parsing the settings file. I'm so tempted to just compile with -mfpmath=sse when compiling for 32-bit x86... Fixed broken error messages printed out when an error occurs when loading the settings file. SexyAL: Changed DirectSound buffer writing algorithm to write up to an extra ~30ms of sound data beyond the effective buffer size on sound writes, and then synchronize(IE wait) to the effective buffer size after the data is written, to slightly reduce the chance of sound buffer underruns and sound glitches on a loaded system. Changed DirectSound buffer underrun handling to better preserve the flow of emulated time. Use a dynamically-allocated buffer sized to fit 25ms of output-device-format audio as the sound conversion target buffer, rather than a statically-allocated fixed-size buffer that could only fit a very small amount of audio data (time-wise) at higher output sample rates. Added channel deinterleaving into the main audio format conversion code, and removed the driver-specific deinterleaving code from the "ALSA" and "JACK" driver code. Fixed a potential buffer overrun bug when converting 1-channel audio from one sample format to another(it's unlikely to have triggered a crash though, due to the size of the sound buffers used and doing the conversion in chunks). Added logic to the "SDL" and "JACK" output driver code so that the internal software buffers won't overflow if a large amount of data is passed to it at once(which wouldn't have happened anyway, since there's protection code in the SexyAL core to prevent that, but that protection code is in need of removal or updating). January 27, 2013: Added a floating-point-related compiler code generation bug test to tests.cpp. January 20, 2013: Changed endian detection in tremor header files to hopefully fix a compilation problem on Haiku. January 19, 2013: SNES: Renamed some functions to fix a compilation problem on "ALT Linux". MD: Fixed broken default key assignments for emulated 3-button gamepads(for the A, B, and C buttons). -- 0.9.28-WIP: -- January 13, 2013: PSX: Corrected lcm_width and lcm_height emulation module structure values(affects QuickTime movie recording). Fixed a bug in the netplay sound buffer underrun mitigation code that was causing it to only write 1/2 the data it should be writing when the emulated system has stereo sound output. Make netplay text line command processing only able to make the netplay text area visible or refresh its visibility, and not able to hide it; fixes a problem of the netplay text area disappearing before the command response text (like the disconnect message after /quit) can be seen. Un-documented Musepack support for ripped CD images as the feature doesn't get much testing, and the support will eventually be removed(someday ;)). Removed some ancient unused members of a debugger-related address space data structure. Fixed a major bug in the CD image audio decoding code that broke repeated playback of CD audio tracks that are encoded in files handled by libsndfile(e.g. FLAC, WAV), although it may not have affected all formats, the problem was noted to occur with FLAC at least. (The bug is a regression apparently introduced in 0.9.25-WIP) January 12, 2013: PCE_FAST: Fixed some problems with the 8bpp palette generation routine. Don't compile with -ffast-math anymore, as it was noted to mess up the NES sound resampler code when __attribute__((cold)) was used on the filter class constructor, to the extent that it was clearly audible. January 10, 2013: Don't needlessly clear the software video buffers to black when changing video modes; fixes the problem of the screen going black when in frame advance mode and toggling fullscreen. January 8, 2013: Fixed a crash(due to a buffer overflow) in Mednafen's test CD-DA player when sound is disabled. Fixed recording of QuickTime movies when sound is disabled(it was producing unplayably broken QuickTime files before). PSX: Added a pseudorandom component to command processing and seek timing, to prevent a lockup in "Legend of Dragoon". January 6, 2013: NES, PCE_FAST: Made limited use of MDFN_COLD. Added "MDFN_COLD" define, expanding to "__attribute__((cold))" on sufficiently-recent versions of gcc. NES, PCE_FAST: Implemented 8-bit rendering internally(for ports, not used by Mednafen proper), using static(in the sense that the palettes won't change while emulation is in progress) palettes. The limitations of palettized 8bpp don't really affect the NES too much in practice, except for at least one homebrew demo. The PC Engine, on the other hand, is a different story... January 5, 2013: PC-FX, VB, PSX: Fixed debugger trace log PC address recording. VB: Corrected (lack of) disassembly of "di" and "ei" instructions. PC-FX: Fixed broken VDC-A/VDC-B VRAM read/write aux debugger breakpoint support. PC-FX: Fixed debugger's graphics viewer weirdness when viewing transparent KING BG pixels(by forcing them to black). PC-FX: Fixed totally broken VDC VRAM debugger memory editor functionality January 4, 2013: Only rebuild and re-run the 68K core generator program when necessary, hopefully fixing one big problem when doing a pure cross-compiled build. January 3, 2013: Added "SABR"( http://board.byuu.org/viewtopic.php?f=3&t=3416 ) pixel shader, as an option for the *.pixshader settings. December 24, 2012: Added "WYSIWYG"-style(except for the "overlay" video.driver) scaled, filtered, maimed, diced, and so forth screen snapshots, taken with the SHIFT+F9 key Marked "Insert/Eject disk/disc" key function assigned to key F8 as being "dangerous" and subject to the delay specified by the "ckdelay" setting, since many games respond very poorly to the disk/disc being ejected in the middle of a disc/disk operation. December 23, 2012: Simplified(less multithreaded message moving madness) and moved some driver-side netplay code into the Mednafen core.