-- 1.32.1: -- March 15, 2024: Apple2: Fixed erroneous parsing of WOZ file padding bytes and unknown chunks' data as 8-byte chunk headers. Fixed broken handling of the end-of-stream condition when reading from non-compressed files stored in ZIP archives; fixes loading of such Apple II WOZ disk images and CloneCD CD images. January 17, 2024: SS: Implemented workaround for gcc bug #113255 in the VDP1 rasterization code. January 14, 2024: Apple2: Fixed typos/brainfart that broke language card and ROM card control accesses via $C08F. -- 1.32.0-UNSTABLE: -- December 29, 2023: Silently disable keyboard grabbing temporarily while the netplay text input, debugger, or cheat interface is active, to avoid complicated text input problems with AltGr and low-level keyboard hooks on Windows. December 25, 2023: Fixed directory creation error(s) when trying to run Mednafen in the root directory of a (non-subst'd) drive on Windows, a regression introduced in 1.22.0-UNSTABLE. December 24, 2023: PSX: Added support for Konami's "Pop'n Music" controller. December 22, 2023: Added setting "input.grab.strategy" to control when the system keyboard and mouse are grabbed while input grabbing is toggled on in Mednafen. Note that SDL2 2.0.16 or later is required for the non-default "auto" option to fully work. December 18, 2023: Fixed excessive CPU usage when sound is disabled or fast-forwarding is active while in frame advance/pause or in the cheat interface. December 17, 2023: No longer set environment variable "__GL_SYNC_TO_VBLANK", instead relying only on SDL_GL_SetSwapInterval(), as it seems to work fine nowadays with Nvidia's binary Linux driver, to avoid thread safety issues with environment modifications. Renamed configuration macro "PSS_STYLE" to "MDFN_PSS_STYLE", and path-separator string macro from "PSS" to "MDFN_PSS". December 15, 2023: PSX: Renamed setting "psx.dbg_level" to "psx.dbg_mask", and changed its type to a multi-enum, to allow for more granular enabling of debug messages. Added SettingsManager::GetMultiM() and MDFN_GetSettingMultiM() functions, which will return the setting's enum values OR'd together. abort() when SettingsManager::GetUI(), SettingsManager::GetI(), or SettingsManager::GetF() is called for a MDFNST_MULTI_ENUM-type setting. PSX: Snoop additional BIOS tty stdout functions when setting "psx.dbg_level" is 2 or higher. December 2, 2023: Patched SDL2 in the Windows build toolchain to ignore synthetic Left CTRL key events generated by AltGr, when keyboard input grabbing is active. Demo: Added an interactive graphical keyboard test mode to check input grabbing and SDL2 keyboard support, among other things, activated by changing the value of new setting "demo.mode" to "keyboard". November 29, 2023: PCE, NES: Fixed broken rendering in the graphics debugger when the OSD pixel format is not the same as the emulation video pixel format. November 28, 2023: Changed the OpenGL RGB555 support(e.g. via the "video.glformat" setting) to use a pixel format and type of GL_RGBA and GL_UNSIGNED_SHORT_5_5_5_1(instead of GL_BGRA and GL_UNSIGNED_SHORT_1_5_5_5_REV as before). Set emulation video texture parameters GL_TEXTURE_WRAP_* to GL_CLAMP before trying to set them to GL_CLAMP_TO_BORDER, to avoid texture wrapping on pre-1.2 OpenGL. November 26, 2023: Added support for 16bpp video/framebuffer modes, dependent on specific emulation module support, when OpenGL is disabled. Blocked the graphics debugger from being selected when it's not implemented for the current emulation module. Fixed hang when a post-startup error occurred during video reinitialization or blitting, due to erroneously unlocking a mutex twice. November 23, 2023: Updated toolchain for official Windows builds(non-Win9x): binutils 2.28 -> 2.28.1 flac 1.3.2 -> 1.3.4 mingw-w64 5.0.3 -> 5.0.5 SDL2 2.0.8-11835 -> 2.28.5 zlib 1.2.8 -> 1.2.13 Additionally, the 32-bit build of SDL2 has been patched to restore support for Windows 2000, broken since the migration to SDL2 in Mednafen 1.x. November 21, 2023: Apple2: Delay Disk II processing of normal flux pulses vs. random noise pulses, and disable the 500ns delay pseudorandomly(50% probability) added to normal pulse detection, as it breaks WOZ dumps of "Test Drive" and "Wizardry". November 19, 2023: Fixed design flaw in MDFN_strargssplit() that broke handling of an escaped backslash immediately preceding a closing double quote character. November 18, 2023: Documentation: Added support for hyperlinks to settings in the description text for settings, custom palettes, and internal databases, by enclosing the setting name in double quotes and prefixing the name with ASCII control character 5. Fixed broken handling of octal along with a few edge case issues in MDFN_strunescape(). In MDFN_strescape(), escape control characters in 3-digit octal instead of 2-digit hex or 1-digit octal to avoid potential conflicts with subsequent characters. October 21, 2023: Align QTRecord CSCD video codec line data to 4-byte boundaries, as is correct, to fix broken recorded video in some circumstances. October 20, 2023: SS: Parse the 32-byte region area data in addition to the 1-byte region characters when determining the region to emulate. October 18, 2023: SS: Extend previously-undocumented bootable ROM cart support from 1MiB to 48MiB, with support for 512KiB backup memory if 32MiB or smaller, and force full cache emulation to be enabled when running with a bootable ROM cart image. SS: When loading a save state, mark internal and cart backup memories as dirty only if loading the state actually changed them, to try to avoid excessive disk writes when using state rewinding. SS: Added support for routing SCSP MIDI output to stdout, activated by changing the value of the new "ss.midi" setting to "stdout". Note that byte values of 0x1B will be filtered from the output, and timing synchronization issues limit its uses outside debug text output. October 12, 2023: SS: Corrected behavior of VDP2 color calculation blending when in both hires mode and a non-zero color RAM mode. October 11, 2023: SS: Prevent VDP2 color calculation blending with a transparent sprite shadow pixel beneath the topmost layer; fixes erroneous opaque red shadows under units during the last episode's first battle in "Sakura Taisen". October 2, 2023: SS: Added "Gambler Jiko Chuushinha: Tokyo Mahjongland" to the internal database of games to use full cache emulation with, to fix octopus screen flickering. September 22, 2023: Apple2: Error out when loading WOZ 2.1-format images with FLUX chunks, as they're not currently supported. September 21, 2023: Apple2: Added "rgb_video7" video rendering mode, which supports the additional graphics modes offered by the Apple IIe Video 7 RGB interface, one of which is used by Sierra's AGI games, and provides two distinct grays in all graphics modes. September 14, 2023: Apple2: Added "apple2.input.kb.auto_repeat" setting. Debugger: In the memory editor, the Escape key will now exit text entry prompts and editing mode. Debugger: Don't set a register's value to 0 when the register edit text entry string is empty or completely invalid. September 13, 2023: Fixed bug that could cause nearly all hotkey/command key functions to trigger spontaneously when Mednafen has been running for around 49.7 days Changed the default mapping for exit to just F12 instead of ESC and/or F12. Added a new hotkey for closing the netplay popup, by default mapped to "ESC", controlled by setting "command.close_popup". September 10, 2023: Apple2: Added "rgb_qd" and "rgb_qd_tfr" video rendering modes, which will render DHGR at quarter-resolution, and provide two distinct grays in all graphics modes. September 9, 2023: Apple2: Renamed keyboard input mapping settings to reduce their lengths, and documented the caps lock default position setting. Apple2: Changed how HGR is handled with the "rgb_alt" and "rgb_alt_tfr" video rendering modes, for consistency with DHGR and to correct a few glitches. August 31, 2023: Apple2: Added an adjustable composite color video sharpening filter, controlled by the new setting "apple2.video.postsharp". May 7, 2023: SNES-Faust: CPU writes to VRAM during active display are now blocked. Fixes missing dialog box and text in "Mazinger Z", title screen corruption in "NBA Pro Basketball: Bulls vs Blazers" and "Shin Nihon Pro Wrestling: Chou Senshi in Tokyo Dome", and graphical garbage during startup in "Zen-Nihon Pro Wres". May break ancient ROM hacks and fan translations. April 17, 2023: Include general mode(read, write, read+write) in file open error messages. April 12, 2023: Added command-line option "-ovconfig", to load global override settings from the specified file. The global override settings will override any settings loaded from "mednafen.cfg" or set via command-line arguments, but will be overridden in turn by more-specific per-module and per-game override configuration files. April 4, 2023: Apple2: Added high-level(no seek delay) ProDOS-compatible hard disk drive emulation, usable by loading a raw hard disk drive image with an "hdv" file extension, and through the "hdd" directive in a MAI file. March 28, 2023: Apple2: Added support for Apple IIe and Enhanced IIe, selectable via changing the new "apple2.model" setting, or by utilizing the new "model" directive in a MAI file. Apple2: When loading a floppy disk image from a ZIP archive without a MAI file, all other floppy disk images with the same extension in the same directory in the ZIP archive will now also be loaded automatically. If desired, this feature can be disabled by setting the new "apple2.multiload" setting to "0". March 26, 2023: Apple2: Added setting "apple2.input.kb.ghosting", default value of "1", that can be set to "0" to disable emulation of spurious ghost keypresses. March 25, 2023: Apple2: Increased the maximum value of the "apple2.video.color_smooth" setting to "2", which will enable more-aggressive composite video color smoothing. March 6, 2023: Use AX_APPEND_COMPILE_FLAGS() instead of AX_CFLAGS_GCC_OPTION() in the configure script. February 24, 2023: SS: Enable data cache bypass kludge for "Kanzen Chuukei Pro Yakyuu Greatest Nine (Japan)", to fix game hangs. SS: Enable full cache emulation for "Gal Jan (Japan)", to fix a hang after a game ends. SS: Enable data cache bypass kludge for "Creature Shock: Special Edition (USA)", "Magic Carpet (Europe)", and "Manx TT SuperBike (Europe)", to fix hangs/crashes. SS: Enable full cache emulation for the Europe and Germany releases of "Revolution X", to fix hangs. February 7, 2023: SNES-Faust: Implemented a minor SA1 CPU emulation optimization. January 29, 2023: Fix potential stack corruption due to insufficiently large array in the Win32-utilizing version of Time::LocalTime(). October 20, 2022: SNES-Faust: When a write to INIDISP changes the force blank bit from 1->0, only trigger OAM address reset if the write occurred during the first line of vblank(semantics might not be totally correct); fixes disappearing graphics glitches in "Wordtris". September 4, 2022: SNES-Faust: Fixed distorted graphics in "Marvelous" and "Bishoujo Janshi Suchie-Pai" due to hires color math emulation inaccuracies. -- 1.31.0-UNSTABLE: -- August 22, 2022: SNES-Faust: Fixed garbage MSU1 audio on big-endian platforms. August 15, 2022: SS: Added "Real Bout Garou Densetsu" to the internal database of games to enable full cache emulation with, to fix startup hang after skipping the BIOS bootup animation, a regression introduced in 1.26.0-UNSTABLE. August 11, 2022: VB: Don't flip framebuffers at the first start of drawing to the framebuffer after power-on, and (always) flip framebuffers when XPRST is triggered, per tip from blitter. August 6, 2022: When running the configure script with --with-external-trio, pkg-config information is now used preferentially if available. July 28, 2022: SNES-Faust: Added mouse emulation. July 25, 2022: SNES: Fixed #if/#ifdef typo in libco PPC code that reportedly broke libco on PPC when compiling with clang. July 16, 2022: MD: Fixed bad values in the PAL V28 VCounter table(though normal resolution interlace VCounter stuff still needs to be fixed). Fixes glitches and hang in the Europe release of "Donald in Maui Mallard". Fixed some M68K instruction and exception execution time inaccuracies. Implemented emulation of M68K instruction Scc's dummy read. July 4, 2022: SS: Added basic ST-V support. SS: In SMPC INTBACK command processing, when starting controller reading after returning SMPC status, wait for Continue/Break *before* waiting for the end of VBlank, prioritize Continue over Break, and don't allow the wait for end of VBlank to be interrupted by setting the Break bit, per tests on a SS. June 30, 2022: Extended support for configuring buttons on virtual ports from port 12 to port 13, using new key combo ALT+SHIFT+Keypad 3, and switching devices by CTRL+SHIFT+Keypad 3, for future use. June 25, 2022: Added std::string variants of MDFN_strazicmp(). Adjusted minimum file extension search priority(e.g. for ".bin" and ".exe" extensions) from -80 to -1000. June 20, 2022: Added initial value argument to crc16_ccitt(). June 14, 2022: Added support for returning CRC32 values in VirtualFS::finfo(), for entries in a ZIP archive. June 12, 2022: SS: Trigger mid-frame synchronization when going into vblank if not already triggered by SMPC INTBACK command processing. March 26, 2022: SS: When VDP2 per-dot RBG0 coefficient reading is enabled, and a per-dot coefficient read is attempted from a memory region not configured for that purpose via RDBS, force the coefficient data to 0, instead of using the per-line coefficient data. Fixes graphical glitches in "Radiant Silvergun" when starting a new game after interrupting the attract mode during the AKA-O battle. March 23, 2022: SS: Forcibly disable NBG1-3 only if both RBG0 and RBG1 are enabled via BGON, instead of only checking if RBG1 is enabled; fixes missing/glitchy graphics in "Houkago Ren'ai Club: Koi no Etude". March 9, 2022: SNES-Faust: Fixed broken ExLoROM support. PCE, PCE-Fast, PC-FX: Update channel 1 frequency cache upon LFO frequency register writes(the way the channel 1 frequency and LFO frequency are combined is still inaccurate, however, causing frequency update timing granularity to be too high). February 4, 2022: SNES-Faust: Fixed PPU window emulation bug that caused graphical glitches with a white circle at a few places in "Final Fantasy 5". February 2, 2022: PC-FX: Expanded external backup memory to 128KiB, and changed it so that internal backup memory and external backup memory are saved to/loaded from separate files. January 22, 2022: SASPlay: Added support for "Air Walkers". -- 1.29.0: -- January 12, 2022: PCE, PCE-Fast: Initialize VCE color table memory at power-on to roughly(without probabilistic bit randomness) match test results from a PC Engine Duo instead of just zeroing it; fixes unreadable letters in the password entry screen of "Order of the Griffon". Added test for potential splatting-related bug in qemu's PPC64 VSX "xscvdpsp" instruction emulation that messes up OwlResampler when compiled with gcc. January 11, 2022: PCE: Added patch in the "notes" subdir for extending the upper range of the "pce.slend" setting to 241(not applied in Mednafen due to increasing the probability of an extra 8ms of input lag with some games). January 9, 2022: VB: Fixed a couple inaccuracies in the VSU modulation emulation, fixing a few sound effects in "Virtual Boy Wario Land". January 7, 2022: SNES-Faust: Fixed S-DSP pitch modulation being half as strong as it should be. December 29, 2021: SNES: Fixed wrong compile-time endian detection on little-endian PPC64. December 24, 2021: PCE: Fixed incomplete initialization of the VDC BG tile cache; fixes glitches after the boss explodes in "R-Type" under certain conditions(more likely to occur in forks of Mednafen). December 20, 2021: NES: Added missing mapper 90 variables to save states. December 5, 2021: Placing a "%d" or "%b" specifier at the beginning of a filesys.fname_* setting format string will now cause the generated path to be used as-is, rather than potentially being prefixed with the corresponding filesys.path_* setting or the Mednafen base directory. Fixes a regression introduced in 1.28.0-UNSTABLE that caused IPS patch files to be loaded from the wrong location when the user had loaded a game via a relative path. November 29, 2021: Added support for playing the SCSP-generated music from most Sega Model 2A, 2B, 2C, and 3 games, via the new experimental "sasplay" module. November 15, 2021: SNES: Fixed compilation error for little-endian PPC64 with LTO enabled. Fixed compilation error after running configure with --disable-fancy-scalers. -- 1.28.0-UNSTABLE: -- November 7, 2021: SNES: Updated libco to latest. November 5, 2021: Paths included in informational and error messages are now outputted with ASCII control characters non-reversibly transformed by inverting bit 6 and prefixing with a "^" character. When loading a game from a ZIP archive, the path used within the ZIP archive is now outputted in an informational message. The paths of CD images specified within M3U files are now outputted in informational messages as they are loaded. November 3, 2021: Added support for loading CD images from ZIP archives when the "cd.image_memcache" setting is set to "1". Implemented an M3U recursion limit of 9, adjustable by the new setting "cd.m3u.recursion_limit". Implemented a limit of 25 on the total number of CD images loaded while processing M3U files, adjustable via the new setting "cd.m3u.disc_limit". Implemented a size sanity limit of 65535 bytes for PSF tag source data. October 28, 2021: Changed handling of single gzip/Zstd compressed files to treat the .gz/.zst suffix as the second part of the extension, instead of the whole extension, with respect to Mednafen data file path construction and naming. Added undocumented setting "filesys.old_gz_naming", that can be set to "1" by the user to restore the old data file naming behavior for gzip-compressed files for backwards-compatibility reasons. October 27, 2021: Added Zstandard decompression support to game loading, with both naked files("zst" extension) and ZIP archives. October 21, 2021: SS: Don't send CD data sectors to partition buffers when the disc hasn't gone through the authentication process. October 19, 2021: SS: Moved some CDB CD reading variable initialization into StartSeek() to reduce the amount of redundant error-prone code. SS: Don't erroneously signal CDB EHST HIRQ when ending a TOC or file info data transfer. October 18, 2021: SS: Implemented more aspects of the CD block disc authentication process. Fixes abort to CD player screen when trying to start a game demo in Gremlin Interactive's "Demo Disc". SS: fixed a few issues with CD block directory reading and handling of directories with more than 256 entries. October 6, 2021: SS: Added commented-out partial fix for end-of-level hang in "Loaded". SS: Changed midsync event time initializing to use SS_SetEventNT() instead of doing it directly(and breaking when the midsync event isn't the last enumerated event) SS: Added a dev build event order sanity check to ForceEventUpdates(). October 5, 2021: SS: Implemented a delay when the SMPC joystick read process is aborted due to time over or due to the Break bit being 1, per tests on a SS, and fixed timing granularity issues with the processing of the Break/Continue bits; fixes unresponsive input in "Discworld", and abort to CD player screen in the USA and Europe releases of "Primal Rage". October 1, 2021: SS: Added "Senkutsu Katsuryu Taisen: Chaos Seed" to the internal database of games to enable full cache emulation with, to fix the inability to skip the intro FMV. An empty string for a setting that expects a numeric value is now rejected instead of being treated as 0. September 29, 2021: Misformatted setting file lines are now rejected with an error instead of silently ignored. September 27, 2021: SS: Fixed a mistake in an invocation of the SH-2 emulation Branch() macro that caused an expensive debugger function to be called even when the debugger was not active, hurting performance. September 26, 2021: Settings file parsing error messages now include line numbers when relevant. SS: Removed MDFN_COLD from SH7095::SetDebugMode(), as it causes newer gcc's optimizer to make bad assumptions and place the main CPU execution loop in the cold text section. September 25, 2021: Providing an empty string for a setting that expects an integer or real number will now result in an error, instead of being treated as 0. Modified the settings code to use the new string<->integer conversion functions, for stricter parsing(nonsense like "0x -0x1" is no longer allowed) and better error messages in certain cases. Added new string<->integer utility conversion functions. September 21, 2021: SS: Implemented a simple optimization in the VDP1 drawing code, reducing executable size by about 900KB on x86_64 Linux. Added MDFNI_SaveSettingsCompact(), to be used in the future for settings backups. September 14, 2021: Added tests for clamp_to_u8(), clamp_to_u16(), and MDFN_abs64(). Added the MDFN_abs64() function. Rewrote the sign_*_to_s*() macros and clamp_to_u8/u16() functions. September 13, 2021: Added MemoryStream::get_line_mem() function to allow for more efficient parsing of large line-delimited text files. Added MDFN_memdupstr() function, stuck the guts of the settings handling code in a class, and reworked the settings file loading code to be a bit faster. Added inline FileStream::put_char() function, and optimized the settings file saving code. September 10, 2021: Reworked how setting generation at startup works a bit to reduce the number of memory allocations, and added setting flags to mark strings that should be free()'d when MDFNI_Kill()->MDFN_KillSettings() is called at exit, to reduce noise when checking for memory leaks. Fixed currently-benign memory leak in the FPS display code. SexyAL: Fixed memory leak in dummy sound driver. September 9, 2021: SexyAL: Modified the ALSA driver code to not use a VLA for the noninterleaved multichannel support. September 8, 2021: Fixed an instance of undefined behavior in SwiftResampler. September 7, 2021: Added a couple more compiler bug/sanity tests. September 6, 2021: Rewrote some of the small inline utility functions in CDUtility.h, and added tests for the rewritten utility functions to ensure correctness and stable semantics. Added test for gcc bug #97760. August 28, 2021: Added crc32_cdrom_edc() function(to be used later), reimplemented crc16_ccitt() with the new generic fast CRC calculation template function, and added a few CRC calculation sanity tests run at startup. August 24, 2021: SS: Fixed an off-by-150 bug in the CDB code, present since the first release with Saturn emulation, that caused the read hinting at the start of emulated seeks to not have the desired effect. SS: Implemented emulation of the CDB Scan command. August 16, 2021: SS: Optimized the SCSP sound CPU interrupt level calculation code. August 14, 2021: SS: Fixed a few inaccuracies in the relative timing of SCSP timer increments across different prescaler rates, per tests on a SS. August 13, 2021: SS: Added emulation of the SCSP MIDI interface output logic and approximate timing. August 10, 2021: SS: Fixed a few inaccuracies in the relative timing of SCSP EG level updates across different rates, per tests on a SS. July 21, 2021: Typedef signed char and unsigned char to int8 and uint8 respectively, instead of relying on int8_t and uint8_t, in case they're ever implemented without the aliasing properties of char types, which Mednafen code relies on. July 17, 2021: SS: When a CDB seek is started very shortly after another seek, don't elide the previous seek's startup side effects; fixes the CD audio player in the North America/Europe BIOS, which broke with 1.26.0-UNSTABLE. Compile with -Wstack-usage=32768 to check for excessive stack usage in functions. July 15, 2021: VB: Added "left" and "right" options to the "vb.3dmode" setting, to allow for more easily showing only the left or right view. July 11, 2021: Added setting "video.cursorvis", to control the window manager default cursor visibility. June 26, 2021: Use AtomicFIFO for the main thread->emulation thread event queue, and fixed related excessive(100+ KB) stack usage in a couple functions. June 20, 2021: SS: Added "Saturn Super Vol. 2" to the internal database of games to use the data cache read bypass kludge with, to fix the flickering title screen in the "Golden Axe: The Duel" demo. SS: The VA0/VA1 motherboard's memory mapping behavior for Low-RAM is now emulated instead of VA2's, to fix a crash in "Myst" in the generator room. SS: The emulated reset button mapped to Mednafen's reset command key(F10 default) will now respect the "ckdelay" setting. Added a quick configure script test to check if disabling PIC/PIE breaks the compiler/linker, and if it does, PIC/PIE is not disabled, to prevent a link-time failure on Haiku. June 19, 2021: Use AC_TRY_LINK() instead of AC_TRY_COMPILE() in the configure script test for AVX inline assembly availability, to handle toolchain setups where the assembler is run at link time instead of compile time. Added setting "video.force_bbclear", default value of "0", which when set to "1" will force clearing of the backbuffer before drawing every frame. -- 1.27.1: -- June 4, 2021: SS: Added "Herc's Adventures" to the internal database of games to enable SH-2 read/write VDP1 draw slowdown with, to fix a few graphical glitches. May 28, 2021: Error out in the configure script when iconv is not found, rather than later during compilation. May 26, 2021: SNES: Applied untested fix for an issue with libco on PPC64 ELFv2 systems. May 18, 2021: SS: Corrected a few inaccuracies in the handling of SCSP EG phase transitions, per tests on a SS. May 12, 2021: Renamed intl/VERSION to intl/VERSION.txt to prevent a conflict with a system C++ header file on case-insensitive filesystems(problem introduced in 1.27.0-UNSTABLE). April 29, 2021: Demo: Use #pragma(pack) instead of __attribute__((packed)), to work around a bug/design flaw in older versions of gcc that caused the demo module's save state test to fail when compiled for a Windows target(where ms_struct is the default structure layout). April 28, 2021: Increased verbosity of bad Q subchannel data error messages in the CloneCD CD image loader. Fixed crashing with non-glibc iconv implementations when the user specifies an unsupported character encoding in the debugger's memory editor. -- 1.27.0-UNSTABLE: -- March 29, 2021: SS: Corrected threshold and semantics of envelope level-based blocking of slots' access to SCSP RAM, per tests on a SS. March 13, 2021: SS: Fixed a big-endian target incompatibility in the SCSP emulation code. Use ternary operator instead of std::min in endian.h, as doing so somehow causes gcc to produce smaller and faster machine code. PSX: Removed incorrect filtering of CD-XA ADPCM sectors based on the file and channel numbers of the first ADPCM sector played, originally added in 0.9.24-WIP to fix the speech playback in "Yarudora Series Vol.1: Double Cast", but made unnecessary by later sector buffering accuracy improvements; fixes missing audio in the FMVs of "Blue's Clues: Blue's Big Musical". March 12, 2021: PSX: Adjusted which sectors are processed and reflected by GetLocP after SeekP completes to only those before the seek target(which is slightly different than SeekL behavior, which also includes the target and a few after, at least with a typical PS1 CD); fixes hangs at different points in some versions of "Tomb Raider", a problem initially fixed in 0.9.38.3, but regressed in 1.22.0-UNSTABLE. March 9, 2021: VB: Block writes to VSU registers and memories when A0 and A1 are not both 0, per tip from "enthusi". March 7, 2021: SS: Implemented incomplete(regarding stack frame data) M68K address error handling, and implemented M68K halting when accessing addresses where any of A21-A23 is 1. Fixes major audio distortion during boss battles in "Lunar: Silver Star Story" due to SCSP DSP register corruption that occurred when the game crashed the sound CPU during bootup. SNES-Faust: Don't call event handlers in read/write handlers if the read/write is from DMA/HDMA, to avoid problematic recursion and related issues. SNES-Faust: Fixed clearing of pending SuperFX IRQ on reset/power; fixes hang/crash in "Stunt Race FX" upon performing a virtual power toggle after the game boots up. March 4, 2021: SNES-Faust: Added commented-out fix for "Speedy Gonzales", to enable later. SNES-Faust: Added detection heuristics and support for mapping LoROM RAM into $8000-$FFFF, to fix save game saving/loading in "Light Fantasy", "PGA Tour Golf", and "Ys III". February 23, 2021: SNES-Faust: Added commented-out fix for "Kishin Douji Zenki Tenchi Meidou", to enable on a per-game basis in the future due to a minor negative performance impact. February 19, 2021: SNES-Faust: Reworked cart header detection and cart type detection logic a bit, fixes "Yuuyu no Quiz de Go! Go!". February 17, 2021: SNES-Faust: Return open bus in bits 4 through 6 for reads from $4210; fixes early hang in "Super Professional Baseball II". SNES-Faust: Return open bus in bits 0 through 6 for reads from $4211; fixes early hang in "Yuujin Janjuu Gakuen 2". SNES-Faust: Added support for special ROM mapping required by "Derby Stallion 96" and "Sound Novel Tsukuru". February 16, 2021: SNES-Faust: Changed power-on APU RAM initialization pattern; fixes hangs in "Ihatov Monogatari" and "Kyuuyaku Megami Tensei". February 3, 2021: Fixed an off-by-1 error in the multithreaded CD reader that would cause a hang if a read was attempted for the sector at LBA 449849. January 31, 2021: Fixed a design flaw that caused the creation of empty backup counter files when automatically attempting to back up a nonvolatile memory save file that does not exist. January 28, 2021: SNES-Faust: Disabled the PPU brightness modulation sanity check when compiling a non-dev build, and fixed array misalignment that was causing the code to segfault when compiled with stack smashing protection enabled on newer gcc. January 25, 2021: Resync console scroll to the last drawn line of the target unwrapped line in the scrollback buffer, not the first, otherwise the console will erroneously scroll up on windowed<->fullscreen transitions when the last line is wider than the console viewport, confusing the user. January 24, 2021: Fixed rendering of Unicode combining characters, fixed handling of combining characters when entering text in the console and debugger prompt, added support for pasting into the debugger prompt, cleaned up rendering of the debugger prompt box, implemented automatic scrolling when entering text in the debugger prompt, made console text entry automatic scrolling bidirectional, changed console scrollback buffer beginning/end scroll key combos to CTRL+Home/CTRL+End instead of SHIFT+Home and SHIFT+End, added support for clearing multiple characters at once in the console and debugger prompts by pressing CTRL with Backspace/Delete. January 19, 2021: Added support for reinitializing game controllers while Mednafen is running by pressing Shift+F3. Aborting the input configuration process for a virtual device will now discard the new configuration data, instead of combining it with the old configuration data for the not-configured buttons as previously done. January 12, 2021: Added "upper_center" and "center" options to the "fps.position" setting. January 7, 2021: WonderSwan: Fixed RTC month field being incorrectly treated as 0-based instead of 1-based. Give the user feedback when they try to toggle a graphics layer that doesn't exist or isn't toggleable. NGP: Sanitize some sound-related variables on state load to prevent potential memory corruption. January 6, 2021: SMS: Sanitize more variables on state load. NES: Fixed a few instances of missing variable initialization on poweron. January 5, 2021: GB: Sanitize a few variables on state load. January 4, 2021: Automatically create any missing parent directories to the Mednafen base directory on startup. Create each Mednafen data directory(e.g. firmware, sav, snaps, etc.) at startup based on the current value of the filesys.path_* setting instead of based on its default value, unless the corresponding filesys.fname_* setting is not set to its default value, in which case the directory is not created. January 2, 2021: NES: Sanitize more sound emulation variables on state load. January 1, 2021: NES: Added missing VRC6 variables to save states. GBA: Backup save game memory files on game load SMS: Fixed a bug that could cause the emulated reset button state to get stuck as pressed if a hard reset occurred within about 20 frames after a soft reset. December 31, 2020: GBA: Added a few missing variables to save states. GB: Added a few missing variables to save states. PCE-Fast: Renamed encapsulating namespace from "PCE_Fast" to "MDFN_IEN_PCE_FAST", to match the convention of all other emulation modules. Made Emulated* MDFNGI objects constant, copied over to a dynamically-allocated MDFNGI assigned to MDFNGameInfo on game load. December 30, 2020: Dynamically-allocate QTRecord LZO work memory. Apple2: Dynamically allocate state helper floppy disk object. PCE-Fast: Fixed massive overallocation of memory for the VDC background tile cache. December 29, 2020: Optimized MDFN_FastArraySet() for non-ideal counts. Utilized MDFN_HIDE in more places. December 28, 2020: Removed incomplete YCbCr MDFN_Surface support unused since 0.9.x, and likely to remain unused. Added support for 16bpp graphics output to core Mednafen code and the majority of emulation modules(excluding "pce", "pcfx", "psx", "snes", "ss", and "vb"), and added setting "video.glformat" to allow for using this support with OpenGL. December 25, 2020: PSX: Initialize some missed state on reset/poweron. December 24, 2020: Completely rewrote the save state preview image resizing code, so that now it's only somewhat wrong, instead of mostly wrong as before. December 22, 2020: GB: Use fastcall on 32-bit x86, for a tiny performance boost. Use MDFN_RESTRICT macro instead of __restrict__. NGP: Use fastcall calling convention on 32-bit x86 to boost performance a little bit. Apple2: Disabled some expensive asserts when compiling without MDFN_ENABLE_DEV_BUILD defined. December 20, 2020: Birthed pernicious human date/time calculation functions to replace the usage of _gmtime64() and _localtime64() on Windows, for Windows 9x compatibility. December 14, 2020: Set icon using Win32 API functions on Windows instead of relying on SDL_SetWindowIcon(), and use alternate, smaller(and boxier!) window icons when running on Windows 9x so the poor beetle doesn't look splatted. December 12, 2020: Don't call SetConsoleOutputCP() on startup on Windows, as it messes up the cmd.exe console on Windows 7(at least) even when Mednafen has exited, and for Windows 9x compatibility. Pass a pointer to a dummy variable, instead of NULL, as the output thread identifier pointer argument to _beginthreadex(), for Windows 9x compatibility. Allow for the absence of GetConsoleWindow() on Windows, for Windows 9x compatibility. Automatically attempt to lock file offset 0xFFFFFFFF if the attempt to lock offset 0xFFFFFFFFFFFFFFFF fails with an invalid parameter error on Windows, for Windows 9x compatibility. Use SetFilePointer(), GetFileSize(), and LockFile() instead of SetFilePointerEx(), GetFileSizeEx(), and LockFileEx() on Windows, for Windows 9x compatibility. December 10, 2020: Dropped usage of and dependency on libsndfile, and added a direct dependency on libFLAC. The only CD image audio file formats/encodings other than raw supported now are: FLAC, Ogg Vorbis, Musepack, and uncompressed PCM in AIFF/AIFC, AU/SND, W64, and WAV. Require the first four bytes of the tentative Ogg Vorbis file to be "OggS" before calling ov_open_callbacks(), to prevent unnecessary excessive reads when trying to determine the type of the audio file, and to avoid treating a non-Vorbis file as Vorbis under certain conditions. Open the main settings file for both reading+writing on startup instead of just reading, to allow file locking to work over NFS, and as a quick check to make sure the file is writeable before it's too late upon exit. December 1, 2020: Made various changes to the Windows support code, to allow for compiling a non-Unicode Windows build. November 24, 2020: Implemented stream buffering in the FileStream class, now using read(), write(), etc. instead of fread(), fwrite(), etc. -- 1.26.1: -- November 8, 2020: PSX: Fixed various inaccuracies in the SPU reverb emulation code. PSX: Fixed quasi-benign dereferencing of a null pointer in the GPU code when playing a PSF. November 3, 2020: SNES-Faust: Fixed a crash when an MSU1-enabled game tried to play MSU1 audio but no audio tracks existed. SNES-Faust: Only create MSU1 multithreaded audio reader object if at least one audio track is available. November 2, 2020: SNES-Faust: Fixed a design flaw in the MSU1 audio track loading code that broke loading of audio tracks when the game's filename included a "%" character. November 1, 2020: SS: Fixed compilation errors after configuring with --disable-debugger. SS: Fixed compilation errors with clang. -- 1.26.0-UNSTABLE: -- October 26, 2020: SS: Added "The Lost World: Jurassic Park" to the internal database of games to enable full cache emulation with, to fix most rock face graphical glitches. October 25, 2020: SS: Added "Corpse Killer" to the internal database of games to enable full cache emulation with, to fix the glitchy rotation-zoom effect. October 24, 2020: SS: Fixed major bug, existing since Saturn save state support was added, in the SCU save state code that caused wrong state to be saved(and later restored) when an SCU DMA level in indirect mode was active. SS: Added "Kaitei Daisensou"/"In the Hunt" to the internal database of games to enable SH-2 read/write VDP1 draw slowdown with, to fix FMV tearing. SS: Added "Zero Divide" to the internal database of games to use the data cache read bypass kludge with, to fix a graphical glitch with character portraits. October 23, 2020: SS: Made changes to prevent the CDB emulation from reporting PLAY status until the second sector is read after a seek completes; fixes game-breaking problems in "Break Point", "DJ Wars", "Hop Step Idol", and "Tennis Arena". SS: Fixed inaccuracies with how CDB playback buffer full auto-pause and resume works; fixes occasional hangs of finite duration in "Dragon Force II" and "World Cup France '98: Road to Win" when trying to skip FMVs. October 22, 2020: SS: Added "Mujintou Monogatari R: Futari no Love Love Island" to the internal database of games to use the data cache read bypass kludge with, to fix glitches when character portrait graphics change. October 21, 2020: SS: Added "Doraemon: Nobita to Fukkatsu no Hoshi" to the internal database of games to use the data cache read bypass kludge with, to fix the blank Game Over screen. SS: When a CDB 'Get CD Device Connection' command is issued very shortly after a 'Reset Selector' command, the 'Get CD Device Connection' command will now be executed before the resetting effects of the 'Reset Selector' command occur. Fixes startup hang in the USA version of "Independence Day". October 20, 2020: SS: Slowed down emulated VDP1 pixel plotting performance by a bit less than 20%(10% in 8bpp mode); fixes prematurely cut-off voices in "Paneltia Story", and reduces tearing in "Yu-No". October 18, 2020: SS: Added "3D Baseball", "The Crow", "NBA Action", "NFL Quarterback Club 96", "Solar Eclipse", and "Titan Wars" to the internal database of games to enable full cache emulation with, to fix minor FMV glitches. SS: Added "Thunder Force Gold Pack 1" to the internal database of games to enable full cache emulation with, to fix the glitchy ship sprite in the ending of "Thunder Force III". SS: Added the Europe releases of "Virtua Cop" and "Virtua Cop 2" to the internal database of games to enable full cache emulation with, to fix startup hangs. SS: Added "Yu-No" to the internal database of games to enable full cache emulation with, to fix the problem of the intro FMV ending too soon. SS: Added "Horror Tour" to the internal database of games to enable full cache emulation with, to fix graphical glitches on the save and load screens. SS: Added "Falcom Classics II" to the internal database of games to enable SH-2 read/write VDP1 draw slowdown with, to fix tearing in the intro FMV of "Ys II". SS: Added "Tokimeki Memorial: Forever With You" to the internal database of games to enable SH-2 read/write VDP1 draw slowdown with, to fix the glitchy arm sprite in the Konami intro. SS: Added "Virtua Fighter Kids" to the internal database of games to use the data cache read bypass kludge with, to fix a major FMV glitch. October 17, 2020: SS: Made a very small SSE2-based optimization to the cache tag evaluation code. October 16, 2020: SS: Removed incorrect write mirrors for the SH-2 CCR register; fixes FMV glitches in "NFL Quarterback Club 97". SS: When full cache emulation is enabled(e.g. via database), alternate slave CPU and bus sharing emulation code will be used, to reduce disproportionate sharing of the bus(it's still not perfect, however). SS: SH-2 PC-relative MOV.W and MOV.L loads are now correctly treated as instruction fetches instead of data fetches with respect to the OD/ID bits of CCR. SS: The SH-2 WB/EX pipeline stall emulation logic is now always enabled, instead of only being enabled in full cache emulation mode as it was previously. October 12, 2020: SS: Moved SH-2 cache entry invalid bit from bit31 of the internal combined tag variable to bit0, for slightly better code generation. October 11, 2020: SS: Slave SH-2 on/off is now handled outside of the regular event handling system to prevent a crash under certain conditions. October 9, 2020: SS: Extended the handling of VDP1 command execution slowdown on SH-2 CPU reads/writes to also include SH-2 DMA accesses. October 5, 2020: SS: Bumped up minimum seek timing delay, to compensate for upcoming general CPU timing improvements in the games sensitive to seek timing. October 4, 2020: SS: The SR value loaded with RTE is now properly masked. October 2, 2020: SS: Allow the SMPC joystick reading process to be aborted earlier on, while still waiting for vblank to end; fixes another hang in "QuoVadis". SS: Added "Wolf Fang SS: Kuuga 2001" to the internal database of games to enable SH-2 CPU read/write VDP1 draw slowdown with, to fix glitchy graphics in the player's robot. SS: Added "Mahjong Doukyuusei Special" to the internal database of games to use the data cache read bypass kludge with, to fix the missing background graphics layer on disc 2. SS: Added "Kidou Senkan Nadesico: Yappari Saigo wa Ai ga Katsu" to the internal database of games to use full cache emulation with, to fix a hang. SS: Implemented emulation of the timing effects of the B-bus write buffer on SH-2 CPU writes; fixes hang in "QuoVadis". September 4, 2020: SNES-Faust: Fixed bug in the multithreaded PPU renderer that could cause massive graphics corruption when a game interleaves reads and writes to VRAM without resetting the VRAM address, like in "NBA Pro Basketball: Bulls vs Blazers". August 28, 2020: SS: Delay CDB status position info update by about 44us after a seek request(via Play command, or otherwise); fixes missing graphics in the intro of "Magical Drop 3". -- 1.25.0-UNSTABLE: -- June 27, 2020: SS: Implemented more accurate emulation of VDP1 drawing of excessively-large primitives. It's not perfect, there's still something weird going on with antialiasing, and the effects on gradient shading and texturing are not fully emulated, but it's enough to fix missing graphics in the attract mode of "Virtua Cop", and a hang after defeating the final boss in "Rayman". SS: Fixed an off-by-1 inaccuracy in the edge stepping code for sprites and polygons, with minor visible effects in non-rectangular sprites/polygons. June 26, 2020: SS, MD: Fixed/Implemented M68K MULU and MULS instruction timing. June 24, 2020: SS: Added wait states to M68K writes; fixes hang in "Lunar" after the Meribia pub singer's singing, that was caused by a timer being reloaded too quickly in an interrupt handler. June 13, 2020: SS: Allow VDP1 primitive drawing code to be suspended(and later resumed) mid-drawing when it's consumed too much emulated time; fixes excessive CPU usage during the FMV in "Dark Seed II". June 4, 2020: SS: Added "Senken Kigyouden", "Xian Jian Qi Xia Zhuan", "Virtua Fighter", and "Virtua Fighter Remix" to the internal database of games to enable full cache emulation with, to fix graphical glitches. May 17, 2020: SS: Implemented more complete emulation of SCSP's buggy(inter-slot contamination) linear interpolation on FM carrier slots. -- 1.24.3: -- May 1, 2020: SS: Implemented more complete emulation of the SCSP short waveform mode, after running further tests; fixes excessive distortion in a sound effect in "Sega Ages: OutRun", a regression introduced in Mednafen 1.24.2. -- 1.24.2: -- April 25, 2020: Fixed broken support for systems without any usable OpenGL implementation available. April 24, 2020: Apple2: Adjust disk angle variable upon disk change, partially sanitize the disk angle variable on state load, and print out a debug error message instead of triggering an assert() in the disk reading code, to prevent Mednafen from aborting out in certain circumstances involving disk changing and state loading. April 21, 2020: Apple2: Added missing keyboard reading variable to save states. April 7, 2020: SS: Fixed a few inaccuracies with the SCSP waveform loop handling. April 6, 2020: SS: Added emulation of SCSP slot short waveform mode bit. April 5, 2020: SS: Implemented the buggy linear interpolation that occurs on the SCSP when FM is used. April 3, 2020: SS: Added emulation of SCSP slot EG bypass bit. SS: Implemented SCSP register mirroring. -- 1.24.1: -- February 27, 2020: NES: Changed some macros in the CPU emulation code to not have leading underscores. February 25, 2020: Use sem_clockwait() or sem_clockwait_np() when available, instead of sem_timedwait(). NES: Don't memset() MDFN_PixelFormat object. February 23, 2020: Fixed build errors on FreeBSD relating to the multithreading code. February 22, 2020: Fixed broken semaphore emulation code used on non-Windows platforms when sem_timedwait() is not available(1.24.0-UNSTABLE regression). February 15, 2020: Altered Linux joystick API detection in the configure script, to avoid compiling with Linux joystick support in lieu of SDL joystick support on *BSD systems with Linux header files installed. February 11, 2020: Fixed AltiVec-related build errors on 64-bit POWER/PPC. SS: Added kludges to fix NBG2/NBG3 background layer offset problems in "Fighters Megamix". February 2, 2020: SNES-Faust: Replaced assert() in the DSP-1 emulation code with a SNES_DBG() January 23, 2020: PSX: Implemented a partial fix for missing notes/instruments in the music of "Dragon Ball GT: Final Bout". December 30, 2019: PSX: Don't ignore the sample loop address set via ADPCM header when the loop address register was written only before the end of voice on startup delay. Fixes sound effect glitches in "Re-Loaded: The Hardcore Sequel". -- 1.24.0-UNSTABLE: -- December 19, 2019: PSX: Handle SPU CD volume as signed 16-bit instead of unsigned; fixes lowest volume setting in "Star Wars Dark Forces". December 18, 2019: PSX: Tweaked PAL pixel aspect ratio, tweaked nominal FPS values, added setting "psx.correct_aspect", and fixed light gun Y positioning with PAL games. December 16, 2019: SNES-Faust: Added SDD-1 emulation. November 26, 2019: SNES-Faust: Allow emulation to switch away from the SPC700 during execution of opcode 0xFA, between the read and write, to fix bonkers audio that leads to a hang in the "Tenshi no Uta" game. SNES-Faust: Extended DMA NMI delay kludge to cover 8-bit LDX #imm to fix hang in "Frisky Tom" in "Nichibutsu Arcade Classics". SNES-Faust: Added DSP-2 emulation. November 19, 2019: SNES-Faust: Added MSU1 support. SNES-Faust: Added a multithreaded PPU renderer, controlled via the new "snes_faust.renderer" setting, disabled by default. SNES-Faust: Added SuperFX overclocking support, controlled via setting "snes_faust.superfx.clock_rate". SNES-Faust: Added SuperFX instruction cache emulation support, controlled via setting "snes_faust.superfx.icache", disabled by default. SNES-Faust: Added support for Game Genie cheats(entered via Mednafen's cheat system). SNES-Faust: Added setting "snes_faust.region" to allow for overriding the automatic region detection and emulating one region while reporting the different region to the game. November 17, 2019: On Windows, call CoInitializeEx() with COINIT_MULTITHREADED before calling SDL_Init(), to prevent potential initialization errors with Mednafen's WASAPI sound code. November 16, 2019: Using drive-relative paths on Windows should no longer make a mess due to Mednafen looking for and putting files in the wrong place. November 14, 2019: SS: Removed "ss.midsync" setting; the functionality it controlled is now always enabled. Added settings "affinity.cd", "affinity.emu", "affinity.video", and "ss.affinity.vdp2" to specify CPU thread affinity masks for the CD read threads, main emulation thread, video blitting thread, and Saturn VDP2 rendering thread, respectively. Setting thread affinities properly can improve Saturn emulation performance on a dual-core CPU with hyperthreading. Cleaned up multithreading code and API. November 10, 2019: Removed "using namespace Mednafen;" from types.h, and related changes. October 25, 2019: SNES-Faust: Ignore frameskip if interlace mode is enabled, to avoid feeding uninitialized data into the deinterlacer which leads to a crash. September 18, 2019: Implemented workaround in OwlResampler_neon.inc for a C++ parsing bug in gcc 9.x. September 13, 2019: Apple2: Renamed(with backwards-compatibility aliases) video mode "rgb_alt1" to "rgb_alt" and "rgb_alt2" to "rgb_alt_tfr", and added new video mode "rgb_tfr". Apple2: Added support for 32-color custom palettes(will automatically enable a text fringe reduction RGB mode if used). -- 1.23.0-UNSTABLE: -- August 26, 2019: Apple2: Added support for an RGB-style video mode, selectable with the new setting "apple2.video.mode". SS: Added "Shunsai" to the internal database of games to use the data cache read bypass kludge with, to fix various graphical glitches. August 25, 2019: Expanded and harmonized the accepted value ranges for settings "sfspeed" and "ffspeed" to 0.25 through 15, for greater versatility. NGP: Added very incomplete emulation of BIOS system call "VECT_FLASHERS", per tip from stellarporter. Fixes eventual hang in "The Last Blade". NGP: Fixed TLCS-900H new IFF calculation when taking an interrupt, per tip from trinemark. Fixes broken voice playback in "Densetsu no Ogre Battle Gaiden". NGP: Fixed potential division by zero in the TLCS-900H MINC* and MDEC* instructions emulation(the emulation of the instructions is still almost certainly wrong, though), per tip from byuu. August 24, 2019: PCE: Changed the Super CD-ROM^2 memory identification signature to match a Duo instead of a PCE with a system card, to fix compatibility issues with some US Super CD-ROM^2 games when using a US system card image, per tip from elmer. August 22, 2019: SS: Added "Ronde" to the internal database of games to use the data cache read bypass kludge with, to fix missing graphics on the title screen and main menu. August 20, 2019: SS: Added "Thunder Force Gold Pack 1" to the internal database of games to use the data cache read bypass kludge with, to fix explosion graphic glitches in "Thunder Force III". SS: Fixed a bug that could cause erroneous VDP1 framebuffer erasure when the lower Y coordinate for the erase window was too large. August 12, 2019: SS: Added "Thunder Force Gold Pack 2" to the internal database of games to use the data cache read bypass kludge with, to fix quasi-random hangs when pausing the game in "Thunder Force AC". SS: Corrected the value the SCU DMA mode registers are initialized to on reset. June 18, 2019: SS: Added "Formula Grand Prix - Team Unei Simulation" to the internal database of games to use the data cache read bypass kludge with, to fix a hang after the title screen. SS: Added "Virtual Mahjong" to the internal database of games to use the data cache read bypass kludge with, to fix graphical glitches on the character select screen. June 16, 2019: SS: Slowed down SCU DMA from SDRAM/SH-2 bus slightly, though I'm not sure what is the origin of the measured overhead/slowdown on a Saturn. Fixes FMV flickering in "Lunar". SS: Added partial emulation(CS0 and CS1, SH-2 non-DMA accesses and SCU DMA accesses) of the timing effects of the SCU A-bus configuration registers. SS: Added "Tech Saturn 1997.6" to the internal database of games for which 1MiB RAM cart emulation is enabled, for its "Groove on Fight" demo. SS: Implemented a crude simulation of the VDP1 command execution slowdown that occurs when an SH-2 CPU writes to VDP1 RAM or registers, activated via the horrible hacks mechanism; fixes text flickering in "Arcade's Greatest Hits", most rescue text flickering in "Burning Rangers"(at least on the first stage), graphical glitches in "Whizz", and some of the graphical glitches in "All-Star Baseball 97". SS: Added a horrible hack to fix the hang in "Fighters Megamix" that occurred after the intro FMV played(or was interrupted). SS: Added a horrible hack to fix the hang at the end of disc 1 of "Grandia". SS: Added a per-game horrible hacks mechanism. SS: Added "Albert Odyssey" to the internal database of games to use full cache emulation with, to fix battle text truncation. SS: Added "Die Hard Trilogy", "GeGeGe no Kitarou", "Nobunaga no Yabou Shouseiroku", "Space Jam" to the internal database of games to use full cache emulation with, to fix hangs/crashes. SS: Added "Gex" and "Slam 'n Jam 96" to the internal database of games to use full cache emulation with, to fix minor FMV glitches. SS: Added "Policenauts" to the internal database of games to use full cache emulation with, to fix screen flickering on disc 2. SS: Full cache emulation(enabled via database) now also enables emulation of SH-2 WB/EX pipeline stalls. SS: Tweaked the kludgey CPU instruction read/write penalty during SH-2 DMA to be higher in some circumstances; fixes major graphical glitches in the later stages of "Shienryu" when on arcade mode. SS: Added "Dragon Force II" to the internal database of games to use the data cache read bypass kludge with, to fix major game logic errors during battles. March 15, 2019: SNES-Faust: Added CX4, SuperFX, and SA-1 emulation. SNES-Faust: Made various changes to try to improve game compatibility. -- 1.22.2: -- April 23, 2019: PSX: Fixed a regression introduced in 1.22.0-UNSTABLE that broke a few PS1 games(e.g. SimCity 2000 and Rise 2). Fixed issues with inline functions in the QuickLZ code that could cause linker errors when compiling with optimizations disabled. April 14, 2019: Apple2: Added basic WOZ 2.0 disk image support. April 13, 2019: NGP: Fixed a sequence point rule violation that could cause "Gals' Fighters" to malfunction when Mednafen was compiled with clang, per tip from stellarporter. SS: Added the European release of "Theme Park" to the internal database of games to use the data cache read bypass kludge with, to fix a crash/hang during the intro FMV. Lynx: Fixed an old heap buffer overflow bug that could be triggered if the emulated game set up registers and RAM in a certain way. March 18, 2019: PCE: Fixed an old bug(looks like from around a decade ago) in the HES playback code; it caused periodic high IRQ latency, which resulted in timer IRQ-driven DDA playback sounding rougher than it should have. -- 1.22.1: -- January 27, 2019: Changed the default sound device for the OpenBSD sound driver from "/dev/audio" to "/dev/audio0". January 26, 2019: Semaphores are now implemented with condition variables and mutexes when compiling against a POSIX threads implementation without sem_timedwait(). January 23, 2019: PC-FX: Replaced old RAINBOW IDCT code with newly-written code. January 20, 2019: Some hotkeys in the debugger's memory editor weren't being ignored properly when in text entry mode; fixed. (Regression introduced in 1.21.0-UNSTABLE) January 1, 2019: Apple2: Corrected minimum allowed value for the "apple2.video.mono_lumafilter" setting(was -2 when it should have been -3). SS: Corrected line-scroll handling in double-density interlaced mode with non-zero LSS; fixes broken background graphics effect in Dural's stage in "Virtua Fighter 2". SS: Added "Linkle Liver Story" to the internal database of games to use the data cache read bypass kludge with, to fix a crash/hang when going to the world map. -- 1.22.0-UNSTABLE: -- December 11, 2018: SS: Added support for directly loading <= 1MiB bootable cart ROM images, with the expected file extension being "ss", for debugging and testing purposes. December 2, 2018: SS: Added "Fighting Vipers" to the internal database of games to use the data cache read bypass kludge with, to fix the problem of the computer-controlled opponent sometimes losing the will to not be a statue. December 1, 2018: PSX: Memory cards are now backed up on startup(maximum number of backup copies kept for each memory card is 5). November 30, 2018: PCE: Increased CD read startup delay per tip from dshadoff. Fixes ADPCM voice playback issues in "Downtown Nekketsu Monogatari" when text speed is set to fast. MD: Fixed a few errors in the internal automatic multitap database, per tip from clobber. SS: Added setting "ss.cart.auto_default". NES: Removed apparently erroneous iNES header correction database entry for "Dragon Quest II" that was breaking the game. November 6, 2018: VB: Added the ability to toggle the state of the low battery sensor bit; configure the device on virtual input port 2(e.g. ALT+SHIFT+2) to assign a key/button to this function. November 4, 2018: PSX: Added a pseudorandom component to Pause command timing to address loading-related hangs in "Colony Wars - Vengeance (Europe)" and "Army Men - Air Attack (Europe)". PSX: Generate a seek error if the tray is opened while the CD drive is not stopped; fixes broken disc switching in "Arc the Lad III". November 3, 2018: PSX: Improved emulation of the behavior of CDC command 0x0A per tests on a PS1; fixes hang in "Goryuujin Electro". November 2, 2018: PSX: Don't set the autopause track test value unless autopause is enabled; fixes missing music in "Pitball". PSX: Delay first CD-DA report after playback begins, per tests on a PS1; fixes missing music in "Roswell Conspiracies - Aliens, Myths & Legends". October 31, 2018: PSX: Improved timing of CDC command 0x0A per tests on a PS1; fixes missing music and hangs in "Grind Session". PSX: Altered seek and pause timing and behavior per tests on a PS1; fixes hangs in "Incredible Crisis", "Ballerburg - Castle Chaos", "Transformers - Beast Wars Transmetals", and "Simple 1500 Series Vol. 057 - The Maze". October 28, 2018: The settings management code will now throw an exception if a floating-point setting is NaN. Fixed a crash that occurred when "debugger.autostepmode" was set to "1" and a game was loaded for a system for which debugger functionality was not implemented. NativeVFS, FileStream, and GZFileStream methods taking a path will now throw an error when the path contains a null character. October 23, 2018: SNES-Faust: Added recognition of files with "fig" and "swc" file extensions as SNES ROM images. October 9, 2018: Altered the variants of MDFN_rtrim(), MDFN_ltrim(), MDFN_trim(), MDFN_zapctrlchars(), MDFN_strazlower(), MDFN_strazupper(), and UTF8_sanitize() that operate on a mutable std::string to take a pointer to the std::string instead of a non-const reference, and added variants that take a const std::string reference and return a std::string result. October 8, 2018: Dropped support for "game set" hashes used to change the naming of save state and save game files. The feature was mostly broken by changes made years ago, and is redundant now with M3U support. Save game files for multi-disc PC-FX games created in previous versions of Mednafen will need to be renamed to be seen by this and newer versions of Mednafen. Other files, including save states, should generally be unaffected, unless the user has changed filesys.fname_* settings to use the %F specifier where they wouldn't by default. Removed usage of the deprecated "register" keyword in some old code. October 7, 2018: Adjusted placement of MDFN_FASTCALL and NO_INLINE to fix some compilation errors with MSVC. In addition to nonvolatile memory backup files as before, any missing directories in the file path for input-recording movies, save states, screen snapshots, and nonvolatile memory files are now created as necessary, to increase the versatility of the filesys.fname_* settings. October 6, 2018: Implemented partial virtual filesystem support via classes VirtualFS, NativeVFS, and ZIPReader. Emulation modules' loading of files referenced from the main file being loaded is now done through its associated VFS. This does create a small backwards-compatibility issue with PSF-family(PSF, SSF, GSF, etc.) files, in that previously a ZIP'd PSF-family file that referenced a library file would have the referenced file loaded from the directory containing the ZIP file, but now will have it loaded from within the same ZIP file. October 4, 2018: NGP: Replaced min/max macros with usage of std::min/std::max. September 30, 2018: Modified usage of std::swap in OwlResampler.cpp to not explicitly(and unnecessarily) specify the template argument, to fix a compilation error on MSVC. Reworked FileStream.cpp to fix some issues causing errors on MSVC. GBA: Fixed a regression introduced in 0.9.47 that partially broke compatibility with save states created in previous versions(< 0.9.47), while preserving compatibility for save states created in versions between and including 0.9.47 and 1.21.3. September 29, 2018: SNES-Faust: Added RAM cheat support(main WRAM only for now). SNES-Faust: Added emulation of PPU-area open bus/bus read latches; fixes missing sprites in the water stage of "Mario's Time Machine". SNES-Faust: Corrected H/V latch reading to use two separate high/low byte toggles. September 24, 2018: SNES-Faust: Made minor changes to the CPU emulation core to not require computed goto support in the compiler. September 23, 2018: Added "blend" and "blend_rg" deinterlacers. Moved multithreading management code into the core. Encapsulated most(ish) core Mednafen code in the "Mednafen" namespace. Slightly improved the quality of audio output by SwiftResampler when running at the higher quality settings. September 22, 2018: Moved NES audio resampler so it can be used by any emulation module, and renamed it to "SwiftResampler". Added an SSE intrinsics-utilizing MAC loop to OwlResampler as a fallback(for the inline assembly) when compiling with MSVC. Added an SSE2 intrinsics-utilizing MAC loop to SwiftResampler as a fallback(for the inline assembly) when compiling with MSVC. September 21, 2018: Wrote new Kaiser-windowed sinc generation code, and modified OwlResampler and the NES resampler to use it. It shouldn't have any particularly noticeable end-user effects, other than slightly different startup performance(assuming no mistakes were made :p). September 11, 2018: SS: Emulated input devices' internal states were not being reset on virtual power toggle; fixed. September 5, 2018: SS: Reorganized SCSP DSP emulation code to make the lifetime of variables clearer, for a possible x86_64 dynarec in the future. August 30, 2018: Modified SHA-256 hashing code to allow for piecemeal hashing of data, instead of requiring the hash to be generated from one contiguous chunk of memory. August 8, 2018: PSX: Fixed a startup crash that could occur with a malformed or corrupted SYSTEM.CNF file. July 31, 2018: Replaced MD5 hashing code with newly-written code. July 29, 2018: Replaced SDL threading code with new code that uses pthreads directly. July 28, 2018: Replaced Q subchannel CRC16 calculation code from cdrdao with newly-written code. July 24, 2018: gzip-compressed ROM/disk image files are now recognized by file extension instead of header magic. June 13, 2018: SS: Fixed an emulation inaccuracy with the handling of the SH-2 "mac.l" instruction when saturation is enabled, per tests on a SS. -- 1.21.3: -- April 29, 2018: SNES: Fixed an off-by-1 bug in the PPU code that would cause writing past the end of the OAM tile list array. April 24, 2018: SS: Added "House of the Dead (Japan)" to internal database of games to use the data cache read bypass kludge with, to fix a game crash on the gun calibration screen. SS: Added "Virtua Fighter Kids (Java Tea Original)" and "World Series Baseball" to internal database of games to use the data cache read bypass kludge with, to fix gameplay glitches. April 22, 2018: Removed some unnecessary memory allocations in the old settings to argument parsing glue code. Fixed a crash bug with 2xSaI-family scalers during initialization(regression introduced in 1.21.0-UNSTABLE). Create the Mednafen base directory(e.g. ~/.mednafen) before opening the lockfile to fix a startup error when the directory does not already exist(regression introduced in 1.21.0-UNSTABLE). April 21, 2018: SS: Added kludge to fix layer offset problem in "Alien Trilogy". SS: Added "WipEout" to internal database of games to use the data cache read bypass kludge with, to fix a hang that occurred when trying to exit gameplay back to the main menu. -- 1.21.2: -- April 2, 2018: Updated bundled copy of Tremor to address a security vulnerability. SS: Improved emulation of SCU DSP DMA to program RAM, per tests on a SS(still nowhere near perfect, the way it's implemented on hardware is kind of horrible, but it should work ok if games use it how it's meant to be used); fixes graphical glitches in "Shining Force III - Scenario 2", and perhaps in the other "Shining Force III" games as well. SS: Flush the prefetched SCU DSP instruction when PC is set via PPAF, instead of when END/ENDI executes or when execution is forcibly stopped, per tests on a SS. SS: Disallow SCU DSP LOP from being written in a looped single instruction unless it's the final iteration, per tests on a SS. SS: Allow SCU DSP LOP to underflow to 0xFFF with LPS and BTM, per tests on a SS. -- 1.21.1: -- March 9, 2018: Enabling the automatic save state loading/saving feature will no longer cause an error to be outputted on game load if the save state does not exist. March 3, 2018: Added support for compiling and linking with external LZO instead of the bundled miniLZO. A CD image loading hint will now be appended to the ROM image too large error message in certain circumstances. February 25, 2018: PC-FX: Added a missing variable to save states. (Re)Added backwards-compatibility "video.driver" setting value aliases. February 24, 2018: NES: Misc minor fixes for a few bootleg mappers. NES: Added missing data to VS Unisystem save states. NES: Added missing variable to mapper 64 save states. NES: Added missing save state support to the mapper 22 code. NES: Fixed improper handling of an MMC1 variable in save states. February 22, 2018: Fixed handling of the "osd.state_display_time" setting to allow a value of "0" to work as expected. -- 1.21.0-UNSTABLE: -- February 19, 2018: An attempt to run an instance of Mednafen while another instance is already running with the same base directory is now blocked during startup, via a lock file; note that this check occurs after stdout and stderr are potentially redirected to stdout.txt and stderr.txt on Windows. February 15, 2018: Changed the default value of setting "video.driver" from "opengl" to "default", removed the old "0" and "1" backwards-compatibility value aliases, renamed the "sdl" driver to "softfb"(without backwards-compat aliases), and made it so the setting's value will be reset to "default" after automatically importing settings from "mednafen-09x.cfg". On Windows, no longer exit on ALT+F4 while input is grabbed. Added settings "fps.autoenable", "fps.position", "fps.textcolor", and "fps.bgcolor". February 11, 2018: Removed reliance on malloc(), realloc(), and calloc() setting errno to ENOMEM on failure, since it's not the case on Windows XP, and possibly other platforms/operating systems too. February 9, 2018: ZIP files are now recognized by file extension instead of by magic(wizards). Replaced old minizip code with newly-written ZIP archive reading code. Replaced MDFN_PrintError() and MDFN_DispMessage() with MDFN_Notify(). February 6, 2018: Use versionsort() instead of alphasort() when scanning for js* joystick devices on Linux. February 1, 2018: Added settings "fps.scale" and "fps.font". January 31, 2018: On Windows, in-memory conversion of M3U and CUE files to UTF-8 will be attempted if they lack a UTF-8 BOM and contain byte sequences that are not valid UTF-8. On Windows, path/filename settings loaded from the old mednafen-09x.cfg(before being saved to mednafen.cfg on exit) will now be converted to UTF-8. January 29, 2018: Added support for pasting text into the cheat and netplay consoles. January 28, 2018: SS: Added Japanese keyboard emulation. SS: Improved VDP2 window Y coordinate evaluation emulation; fixes at least one background layer graphical glitch in "Radiant Silvergun"(at the start of stage 2C), and the graphical glitch near the end of the intro in "Snatcher". January 20, 2018: Altered calculations involving *.xscale(fs)/*.yscale(fs) settings to be more predictable given floating point nuances; any user using non-integer scaling values for these settings may need to adjust them to get the same result as in previous versions of Mednafen, however. Added setting "video.fs.display". January 18, 2018: SDL2(2.0.5+) is now used and required. Removed the "overlay" video driver. On Windows, error messages during startup will now be displayed in a popup message box. On Windows, Mednafen will now output text to a console if it's started from a console(e.g. cmd.exe or Cygwin), and if not, write to stdout.txt and stderr.txt like before. On Windows, Mednafen now uses Unicode variants of CRT and Win32 functions; this may require the user to convert their CUE sheets to UTF-8 if filenames use exotic(e.g. not directly typable on a standard US-layout keyboard) characters. For key bindings relating to the debugger and cheat management interface, the Right ALT key modifier will no longer be respected(only the Left ALT has any effect now), for internationalization reasons. The configuration file is back to "mednafen.cfg" instead of "mednafen-09x.cfg". If a 0.8.x "mednafen.cfg" is in the way, it will be renamed. If "mednafen.cfg" does not exist, or is from an old version of Mednafen, settings will initially be loaded from "mednafen-09x.cfg", but still saved to "mednafen.cfg" on exit(and loaded from "mednafen.cfg" from that point on). Reworked the input mapping setting format to be more human-readable(and editable). Details are in the documentation, in the "Advanced Usage" section. Old input mappings will be translated internally, except for keyboard mappings, due to incompatibilities between how SDL 1.2 and 2 handle keyboards. Added support for mapping joystick axes and buttons, mouse buttons, and keyboard keys to emulated mouse device relative motion for testing purposes(via manually editing the configuration file, as the in-emulator configuration process currently won't create such mappings). Added support for digital button input mappings that mix AND, ANDNOT, and OR-style operations together(previously it was either just AND or OR); refer to the documentation for more details. Note that the in-emulator configuration process won't create complex mappings that mix different boolean operations, but you can map combinations using simpler logic in-emulator, and then edit the configuration file to adjust the boolean operations used. January 15, 2018: SS: Fixed a bug that caused a crash if an error occurred early in the process of loading a game. Updated the configure script to disable gcc's mitigations for Spectre, in the event distributions configure their compilers to enable them by default. Stopped (erroneously) memset()'ing some MDFN_PixelFormat objects. January 12, 2018: Cleaned up the handling and reduced the size of axis-related inputs as communicated from the driver-side code to core Mednafen. PCE_FAST: Fixed fubared mouse emulation. December 28, 2017: Replaced usage of strcasecmp() and strncasecmp() with MDFN_strazicmp(), for consistent behavior across locales. Added MDFN_strazlower(), MDFN_strazupper(), MDFN_memazicmp(), and MDFN_strazicmp() functions. December 14, 2017: SS: Fixed a logic error in the BIOS sanity check code that caused it to throw a less helpful error message than intended in certain circumstances, and made the error messages related to BIOS file misconfiguration more verbose(and hopefully more helpful...). December 6, 2017: Fixed broken cheat file saving on MS Windows. November 12, 2017: Changed how some multidimensional arrays and arrays of structs are accessed, to try to avoid behavior that's probably undefined and may be a problem in the future. PC-FX: Fixed integer overflows that caused fatal division by zero when Mednafen's cheat functionality was used(a regression introduced around 0.9.39). SS: Stuck SCU DMA table arrays in a struct to avoid unspecified behavior in the SCU save state code. -- 0.9.48: -- September 16, 2017: Set cheat's default endianness to that preferred by the system being emulated when manually adding a cheat that's not a cheat device code nor the result of a cheat search. September 15, 2017: SS: Fixed SCU DSP DMA from B-bus; fixes the periodic loud popping in Grandia's FMV. September 12, 2017: SS: Added a hack/kludge to allow bypassing of data cache on reads(such that the timing benefits of partial cache emulation are preserved, without cache coherency problems that partial cache emulation sometimes leads to with poorly programmed games), and added an internal database to enable it on select games; fixes graphical glitches and/or hangs in "Area 51 (USA and Europe)", "Clockwork Knight 2 (USA)", "DeJig - Lassen Art Collection", "Father Christmas", "Golden Axe The Duel", "Sega Saturn Choice Cuts", "Spot Goes to Hollywood (USA and Japan)", "Street Fighter Zero", "Street Fighter Zero 3", "Super Puzzle Fighter II Turbo", and "Virtual Volleyball". SS: Full cache emulation is now enabled for "Whizz"(by using an internal database), to resolve(or at least reduce) quasi-random hanging issues during startup. September 11, 2017: SS: Corrected an inaccuracy with CDB play repeat handling; fixes hang when trying to resume a suspended game in "Tactics Ogre". SS: Initialize VDP1 clipping and local coordinate registers only on power-on, and not on reset. September 7, 2017: SS: Fixed side-effect inaccuracies in the CDB Put Sector Data, Copy Sector Data, and Move Sector Data command emulation. September 6, 2017: Added configure option "--with-external-trio", for distribution packagers. SS: Added partial emulation of SH-2 external bus open bus behavior; fixes messed up colors in "Discworld 2". September 4, 2017: SS: Improved CDB Initialize command emulation; fixes crash in "Tenchi Muyou! Ryououki Gokuraku" when it tries to play an opening movie during startup. August 28, 2017: SS: Made CD seek overhead calculation less completely wrong; fixes graphics corruption in intro of "Batman Forever", and fixes hang in "Jung Rhythm" when trying to retry a failed stage. -- 0.9.47: -- August 25, 2017: Lynx, MD, NGP, SMS: Added a few missing variables to save states. August 24, 2017: SS: Added save state support. Revamped save state helper macros and functions, to allow save-stating of variables in arrays of structs to be simpler. August 22, 2017: SS: Fixed BCR1 write protect, and added stub emulation of the other BSC registers. SS: Added incomplete stub Action Replay 4M Plus emulation(for experimentation); proper Action Replay support would require SH-2 UBC emulation, and that may be too costly performance wise. August 21, 2017: SS: Implemented very rough approximation of bus timing side effects when master SH-2 DMA is active(accurate handling of bus priorities and sharing would increase CPU requirements noticeably, but it may ultimately be necessary as a database-driven option for some stubborn games in the future). Fixes startup hangs in "Device Reign", "Real Sound", "Resident Evil", "SD Gundam G Century S", "Super Tempo", "Tennis Arena", "Tilk", "Yuukyuu Gensoukyoku", "Yuukyuu Gensoukyoku 2nd Album", "Yuukyuu Gensoukyoku ensemble", "Yuukyuu Gensoukyoku ensemble 2", "Yuukyuu no Kobako Official Collection", and "Zero4 Champ". -- 0.9.46: -- August 10, 2017: Compile with explicit -fstrict-aliasing, for distributions/OSes that have configured gcc to not enable strict aliasing at -O2(and possibly other levels). Fixed a bug that could, under certain conditions, cause emulator OSD elements to not be updated in the time after entering frame advance mode and before a frame advance. August 7, 2017: Use a sorted std::vector instead of std::multimap to store current settings, to reduce memory usage. August 6, 2017: SS: Added ss.input.port*.3dpad.mode.defpos settings to control the default position of the digital/analog mode switch. August 5, 2017: Allow addresses above FFFF to be entered as the logical watch address in the debugger. August 4, 2017: SS: Added kludge to fix layer offset problem in "Daytona USA CCE". NES: The functionality controlled by setting "nes.fnscan" now recognizes "(F)" and "(France)" as PAL. NES: Added support for iNES mapper 40. July 11, 2017: Utilize _byteswap_*() functions in endian.h when compiling with Microsoft's C++ compiler. June 22, 2017: Fixed a couple of minor issues(log header formatting, and skipped logging of first instruction in step mode) with the debugger's undocumented trace log feature. NES: Corrected the period of PAL noise channel frequency setting 0x1. June 21, 2017: NES: Fixed a few square wave sound channel emulation bugs(wrong phase for duty setting 3, and failing to clock the period counter when the channel is silenced). -- 0.9.45.1: -- June 5, 2017: SNES: Fixed an instance of possibly-undefined behavior. Silenced dumb warning spam relating to endian.h emitted by newer versions of gcc. June 4, 2017: Fixed garbled audio with the exclusive-mode WASAPI sound driver on some higher-end sound cards(regression introduced in 0.9.45 due to a mistake in changing the meaning of a macro field during development); may also fix garbled audio when using the new OpenBSD sound driver with certain sound cards. -- 0.9.45: -- May 29, 2017: Tweaked netplay sound buffer underrun kludge code. The netplay server host and port being connected to are now printed to the netplay console at the beginning of a connection attempt. Netplay connection attempts to servers are now non-blocking. May 25, 2017: SS: Synchronize end of SMPC clock change commands to beginning of vsync instead of beginning of vblank, per tests on a SS. May 23, 2017: SS: Reworked how the VDP2 rendering thread waits, to make Saturn emulation usable with the default OpenBSD kernel. SS: Added emulation of the light gun("Stunner"/"Virtua Gun"). April 28, 2017: #include'd many commonly-used C and C++ standard library headers in types.h(and removed redundant #include statements from various header and source files), to reduce the probability of portability problems(due to neglecting to explicitly include a header file) when different standard C/C++ libraries behave differently in regards to what header files include what other header files. Added a sound output driver for OpenBSD's /dev/audio. Reworked the sound output format conversion code to be more versatile, April 25, 2017: NES: Wrote new "Barcode Battler II" emulation code to replace the old "Barcode World" code, based on quick testing with actual hardware(albeit the English version). April 24, 2017: SSFPlay: Added save state support. -- 0.9.44.1: -- April 21, 2017: MD: Added a missing MDFN_FASTCALL, the absence of which broke 32-bit x86 builds(either at link time or run time). -- 0.9.44: -- April 19, 2017: PSX: Restructured the GPU emulation code and data a bit to get a minor performance boost. April 18, 2017: VB, PCE, WonderSwan, MD, GBA: Use fastcall calling convention(on 32-bit x86) in a few (more) places where it makes sense. April 16, 2017: SNES-Faust: Added setting "snes_faust.correct_aspect", default value of "1". SNES-Faust: Added PAL support. April 14, 2017: SNES-Faust: Made minor optimizations to the BG rendering code. April 9, 2017: Added command-line option "-which_medium", to specify which CD to start with when using multi-CD M3U sets. April 5, 2017: SNES: Fixed emulator hang when saving state in "Panic Bomber W". April 3, 2017: Added some simple scripts to cross-compile and package Mednafen for Windows. Added Windows cross-compiler toolchain setup notes. 32-bit Windows builds are now compiled with -march=i686 instead of -march=i586(shouldn't affect compatibility for official builds, since the toolchain and libraries were already effectively being compiled with -march=i686, which was not intended, but since nobody apparently complained... ;p). March 25, 2017: VB: Added support for custom palettes. VB: Reworked how LED on-state duration is translated into RGB values and added setting "vb.ledonscale"; the default value of "vb.ledonscale" is set such that the overall brightness will be lower than in previous versions of Mednafen, to reduce white crush, but the user can set it to a value of "1.9921875" to approximate the old brightness level. March 20, 2017: SNES: Made a couple of SDD1 registers readable; fixes "Tractor Beam" spell graphical glitches in "Star Ocean"(thanks to orbea). March 17, 2017: SS: Added support for a 16MiB RAM cart mapped into the A-bus CS1 area(for "Heart of Darkness" and homebrew). March 15, 2017: WonderSwan: Removed setting "wswan.rotateinput", and added a new device("gamepadraa") that can be selected on virtual input port 1 to automatically rotate inputs when the display is rotated. March 14, 2017: Reworked text drawing to not use an excessive number of potentially-large VLAs. Moved statements with important side effects outside of assert()s in settings.cpp. Replaced ancient Unicode conversion code with newly-developed code. March 7, 2017: SS: Prioritize SMPC command execution over VBlank handler execution, per (limited) tests on a SS. Fixes broken input in "Primal Rage"(a 0.9.43 regression). -- 0.9.43: -- February 24, 2017: Reworked how input grabbing is handled. The new way uses only one key combo(CTRL+SHIFT+Menu), and will adapt its behavior based on any keyboards being selected on any virtual input ports or not(refer to the documentation for full details). A new setting is added, "command.toggle_grab", and two settings were removed, "command.toggle_grab_input" and "command.toggle_cidisable". Emulated keyboard(FKB, Tsushin, Saturn) key state is now only updated when input grabbing is toggled on. February 22, 2017: SS: Fixed SMPC read handling of an empty input port. SS: Implemented emulation of SMPC 0-byte port read mode. PSX: Reduced rumble latency by 1 frame. February 20, 2017: Reworked how keyboard key state is handled, to prevent extremely short button presses from being lost(like what can happen with the Pause key, or other keys when slow-forwarding is active). SS: Added 101-key US keyboard emulation. February 17, 2017: SS: Allow SMPC commands to be dual-issued; fixes hang in "F1 Challenge", and hangs/missing sound in "Magic Knight Rayearth". SS: Added emulation of the 6-Player Adaptor(multitap). February 15, 2017: SS: Added emulation of the Mission Stick and Dual Mission Sticks. February 13, 2017: SS: Added emulation of the steering wheel("Arcade Racer"), for use with "Virtua Racing", "High Velocity - Mountain Racing Challenge", "The Need for Speed", and other Saturn racing games that apparently lack 3D pad support. -- 0.9.42: -- February 7, 2017: SS: Ignore lower bit of VDP1 sprite draw command texture base address when drawing using color mode 5, per tests on a SS; fixes some of the graphical glitches in "All-Star Baseball 97". February 6, 2017: SS: Ignore writes to VDP1 registers via SCU DMA under certain conditions to approximate what happens on a SS; fixes hang in "GunBlaze-S". SS: Fixed handling of RSTCSR WOVF clearing, per tests on a SS. Also changed the semantics of RSTCSRM a bit to simplify things, might want to change WTCSRM, FTCSRM, etc. semantics too in the future for consistency... SS: Fixed handling of WTCSR OVF clearing, per tests on a SS. Updated tremor to revision 19427. Updated libogg to version 1.3.2. Fixed a bug that caused a crash if the user tried to select(via CTRL+SHIFT+[n]) a device on a non-existent virtual input port. February 5, 2017: SNES-Faust: Added multitap support. February 3, 2017: SS: Fixed a bug in the handling of M68K level 7 interrupts; fixes missing sound in "Arcade's Greatest Hits". February 1, 2017: SS: Suspend VDP1 command processing while an SCU DMA from SDRAM to VDP1 VRAM is active, to approximate how a SS behaves. Fixes FMV tearing in "Johnny Bazookatone", and fubared graphics in "Virtua Cop" and "Virtua Cop 2". January 31, 2017: SS: Fixed handling of clearing FTCSR bits, per tests on a SS. January 30, 2017: SS: Improved instruction timing(though still far from perfect); fixes speed problems in "Pocket Fighter", reduces the size of the flickering area in "Lunar"'s FMV, and fixes the crash that occurs immediately after gameplay starts in "Virtua Fighter" and "Virtua Fighter Remix". January 26, 2017: NES: Added support for iNES mapper 190. January 25, 2017: SS: Clear SCU internal pending interrupt bit upon the SCU's acceptance of the IRQ to send to the SH-2, instead of when the SH-2 fetches the vector, per tests on a SS. -- 0.9.41: -- January 21, 2017: SS: Implemented disc change IRQ on disc eject. January 20, 2017: Replaced usage of trio_snprintf() to a fixed-size buffer for path construction in general.cpp with manual concatenation of std::string strings. January 18, 2017: Use _beginthreadex() instead of CreateThread() on Windows, to avoid a small memory leak. Now explicitly use 64-bit walltime functions on 32-bit Windows builds. January 17, 2017: PCE, PCE_FAST: Added a missing sound emulation variable to save states. January 16, 2017: SNES: Added setting "snes.h_blend", default value of "0", that when set to "1" will enable a horizontal blend/blur filter. January 15, 2017: PCE: Improved SuperGrafx window handling in 10MHz dot clock modes. GBA: Modified RTC emulation to not use standard C library walltime functions during emulation. Wrapped various time functions, and dropped the dependencies on SDL time functions, in Time.cpp/Time.h. January 14, 2017: WonderSwan: Fixed off-by-1 bugs in window coordinate evaluation, per tip from trap15. WonderSwan: Fixed copyright notice headers to not allow distribution under versions of the GPL other than version 2(an oversight from back when the Cygne code was added to Mednafen). WonderSwan: Applied sound and DMA emulation fixes from trap15; fixes rain sound effect in "Star Hearts". The changes did necessitate lowering the overall WonderSwan sound emulation volume a bit to prevent excessive clipping, however. January 12, 2017: SS: Fixed a logic error in the VDP2 rendering code; fixes battle scenes in "Grandia". January 10, 2017: SS: Removed a few bad entries in the internal region-correction database that were breaking the Korean releases of some games. January 9, 2017: PCE, PCE_FAST: Added support for auto-enabling SuperGrafx emulation with CDs when a mode 1 data track has the 16-byte magic "4D 65 64 6E 61 66 65 6E 74 AB 90 19 42 62 7D E6" at offset 0x86A(assuming 2048 bytes per sector), for homebrew and translations. January 7, 2017: SS: Added emulation of the SCSP 18-bit DAC enable bit; fixes low volume problem in "Daytona USA". SS: Fixed some bugs that broke emulation on big-endian platforms. January 5, 2017: Fixed an off-by-1 memory corruption bug in the debugger's memory editor relative bytestring search code. VB: Finally commented out some debug printf()s. January 1, 2017: Cleaned up code that passes video data from the game thread to the main thread, and replaced some volatile usage with atomics. December 31, 2016: Fixed a large memory leak that occurred when saving screenshots with SHIFT+F9. VB: Fixed a regression introduced in 0.9.39.2 that caused transient sound/note distortion on save state load. December 27, 2016: Moved TCP/IP networking code into the core of Mednafen, and added support for non-blocking connects, so the Saturn emulation module can eventually use it for modem emulation. December 25, 2016: Modified configure script to (hopefully) compile in the Saturn emulation module when building for PPC64 and AArch64 architectures(in addition to x86_64). December 21, 2016: Allow emulated digital button mappings to be used in AND mode(like command keys configured with SHIFT+F2) if the user manually prefixes the "/&&\ " magic string to the mapping setting string in the configuration file. Can be useful with emulated switches and mode toggle buttons, but the in-emulator input configuration process will need to be revamped before enabling this mode for a mapping can be done in a sane and more user-friendly manner. Rewrote round_up_pow2() in math_ops.h to use MDFN_log2, which in turn uses MDFN_lzcount*(), since the major CPUs that Mednafen is going to run on should have dedicated instructions to (at least indirectly) count leading zeroes. Also changed the semantics to return 0 on overflow instead of 1. December 20, 2016: SS: Now use leading-zero counting function from math_ops.h in the VDP2 rendering code, instead of using inline assembly. Reorganized the leading/trailing bit counting functions in math_ops.h, added 32-bit and 64-bit trailing-bit counting functions, and added faster variants where passing a 0 results in an undefined result. December 19, 2016: Print out the game key used after a connection is established with netplay, when the game key is not empty. SMS: Added settings "sms.slstart", "sms.slend", "sms.slstartp", and "sms.slendp". Added some checks to help prevent a black screen when the scanlines effect is enabled via a .scanlines setting and the effective Y scale is too small(by forcing negative-value behavior in the case of interlaced video, or temporarily disabling the effect otherwise). December 18, 2016: PSX: The functionality controlled by the "psx.input.analog_mode_ct" setting no longer interferes with netplay. PSX: Added "psx.input.analog_mode_ct.compare" setting to control the combination of buttons used when the functionality controlled by the "psx.input.analog_mode_ct" setting is enabled. Modified build system to use $(localedir) instead of $(datadir)/locale for LOCALEDIR define. Updated miniLZO to version 2.09. December 14, 2016: SS: Added setting "ss.h_blend", default value of "0", that when set to "1" will enable a horizontal blend/blur filter(with a much noticeable effect on the Saturn video modes with a higher horizontal resolution). December 10, 2016: SS: Added setting "ss.h_overscan", default value of "1", to allow the user to show less of the screen on the left and right sides by setting it to "0". December 9, 2016: SS: Added setting "ss.correct_aspect", default value of "1", to allow the user to disable aspect ratio correction(not recommended, but whatever~). Added simple TV CRT-approximating OpenGL shader, "goat". December 8, 2016: Renamed settings "*.pixshader" to "*.shader". December 7, 2016: Check for and use -no-pie instead of just -nopie in the configure script, to fix build failures on at least one platform. December 6, 2016: Fixed half-source-pixel image offset bug in the "autoip", "ipxnoty", and "ipynotx" pixel shaders. Fixed altivec.h header detection regression in 0.9.39. October 7, 2016: Fixed a bug that caused input movie recording to produce broken recordings when done during netplay with an emulation module that uses mid-frame sync functionality. -- 0.9.39.2: -- September 19, 2016: SMS: Sanitize some previously-missed variables in the save state loading code. September 18, 2016: MD: Fixed a bug that caused some YM2612 state to not be restored properly on save state load. MD, SMS, NGP: Fixed an old Z80 emulation bug with interrupt handling. Make an index of save state sections on save state load, to detect sections in a save state that are unused by the state loading code(for debugging). MD, PCE, PCE_FAST: Sanitize some previously-missed variables in the save state loading code. September 16, 2016: SS: Added PAL support. SS: Fixed vertical positioning brokenness with custom "ss.slstart" setting values with interlaced video. September 15, 2016: PC-FX, WonderSwan, NES, VB, PSX: Sanitize some previously-missed variables in the save state loading code. Fixed a use-after-free bug in the SDL sound output driver. NGP: Fixed several off-by-1 bugs in the address to ROM data translation function. September 11, 2016: Removed nonsensical unused frame advance loop in drivers/main.cpp leftover from 0.5.x. PCE_FAST: Fixed a bug that could cause a crash with large "pce_fast.ocmultiplier" setting values when running CD games. September 10, 2016: PCE_FAST: Skip 512-byte copier header if detected when loading a ROM image. PCE_FAST: Made some minor optimizations. PCE, PSX, PCE_FAST: Avoid UB by biasing uintptr_t values instead of pointers directly in the CPU core. September 1, 2016: GB: Corrected the layer names used with the layer toggling feature. August 26, 2016: SS: Fixed a potential problem with SH-2 DMA event rescheduling when bus lock is held, that probably wouldn't ever happen in practice. NES: Fixed several instances of missing initialization of on-cart WRAM. August 24, 2016: SS: Marked more functions with MDFN_COLD hint, and marked a few functions to be forcibly-inlined where it makes sense. August 23, 2016: SNES: Fixed an issue causing a compilation error on Mac OS X. -- 0.9.39.1: -- August 22, 2016: SS: Settings "ss.dbg_mask" and "ss.dbg_exe_cdpath", and the functionality they control, are no longer available unless Mednafen has been compiled with "MDFN_SS_DEV_BUILD" defined(such as with -DMDFN_SS_DEV_BUILD=1 in CPPFLAGS env var passed to configure). SS: Replaced some instances of case ranges with more portable constructs. August 20, 2016: SS: Run VDP1 vblank erase at end of vblank, so we know how much time we have and thus how many entries in the framebuffer we'll be able to erase. Currently, the available time calculations are generous, allowing for a bit more erase than what's possible on a Saturn, but we can tighten it up in the future once it's fairly certain there aren't any more event scheduling accuracy issues. Fixes FMV subtitle text in "Panzer Dragoon". SS: Fixed a bug that caused VDP2 frames to be short by 1 to 3 CPU cycles. SS: Reschedule the SH-2 DMA event handler as necessary to prevent it from running when the SH-2 bus is locked. SS: Force the SH-2 DMA and SCU DMA event handlers to be rescheduled to SH7095_mem_timestamp time when necessary. SS: Check for pending events right before calling VDP1, VDP2, SMPC, and SCU regs read/write handlers, which may then call their own event update functions. August 17, 2016: Fixed an old bug that could cause a startup crash on Windows systems without XInput DLLs installed(e.g. some Windows XP systems). NES: Fixed a very old bug triggered when disabling(via CTRL+1) the background layer, that would cause sprite pixels to also be visually disabled too under certain circumstances. August 16, 2016: MD, PC-FX: Fixed several instances of left-shifting negative values. August 15, 2016: SS: Fixed a compilation error when compiling with the debugger disabled("--disable-debugger" passed to configure). Added configure options "--with-external-mpcdec" and "--with-external-tremor", for distribution packagers. SS, SNES-Faust: Fixed a few issues causing compilation errors on clang. SS: Tweaked how seek command pause works; fixes a lockup issue in "Astal". August 11, 2016: WonderSwan: Fixed a bad usage of "char" without an unsigned/signed qualifier. SS: Slow down SCU DMA to VDP2 VRAM under certain conditions. August 10, 2016: SS: Adjusted VDP1 polygon and line draw commands to behave as if SPD=1, ECD=1 when color mode >= 6; fixes missing graphics problem in "Hi-Octane". August 8, 2016: SS: Reworked SCU DMA's timekeeping and scheduling code to be more accurate; reduces the size of the flickering section of the FMV in "Lunar". SS: Fixed handling of CPU<->SMPC open bus. August 7, 2016: Relaxed the CloneCD Q subchannel sanity checks to allow a track number of 0xAA(leadout). August 6, 2016: SS: Implemented kludgy(incomplete) support for quasi-illegal window X start position values; fixes ground layer issues in the forest stage of Panzer Dragoon 2. -- 0.9.39-UNSTABLE: -- August 4, 2016: Put "official" -mtune and -march build flags for Windows targets into configure.ac. July 27, 2016: The version is now displayed in the upper right-hand corner of the F1 help screen. June 28, 2016: PSX: Modified GTE emulation to inline instruction-handling functions, to not unroll large loops, and to use MDFN_lzcount32() for LZCS/LZCR register calculation. June 27, 2016: SNES: Modified libco to use __attribute__((section(".text"))) on the libco swap function data arrays, instead of calling mprotect()/VirtualProtect(). June 24, 2016: PSX: Rearranged CPU structure layout to improve performance a little on ARM CPUs. June 20, 2016: PSX: Don't specially compile the code with -mmx -msse -msse2 on 32-bit x86, to avoid potential ODR violations. June 19, 2016: NES: Added ARM NEON support to the resampler. June 18, 2016: NES: Enabled SSE2 support in the resampler, though only enabled(through rough heuristics) when likely to have a performance benefit over MMX. June 17, 2016: NES: Made resampler's coefficient memory layout more optimal. PCE, PC-FX: Added ARM NEON support to the resampler(though it's only compiled in when the compiler is setup to use NEON, such as by passing -mfpu=neon). June 16, 2016: PCE, PC-FX: Added AVX support to the resampler. PCE, PC-FX: Made resampler's coefficient memory layout more optimal. June 14, 2016: PCE: Allocate HuC6280 objects statically instead of dynamically, and removed a layer of indirection for the event handler pointer. PCE: Moved HuC6280 CPU emulator back into the "pce" directory, since no other emulated systems use it and there are no plans for emulating any such systems(and if there were, new, cleaner HuC6280 emulation code should probably be written). June 13, 2016: PSX: Enabled CDC periodic-report maximum level calculation code that was written a while back, to fix a lockup in "Fantastic Pinball Kyutenkai". Added setting "netplay.console.lines". When a console is scrolled, a green indicator arrow will now be drawn in the lower right corner. Scrolling in the console(netplay, cheat) is now done in visible line units, rather than in internal line units. June 12, 2016: Removed setting "netplay.smallfont", and added settings "netplay.console.scale" and "netplay.console.font". Somewhat revamped the layout of the debugger's memory editor. Removed 4x5 font(it's too small to be of much real use), and added 6x9 and 6x12 fonts(mostly for debugger use). Code points outside the BMP are no longer drawn as being truncated to 16-bits. In the text drawing routines, a character missing from the chosen font is now drawn as the Unicode replacement character instead of a question mark. June 11, 2016: Made some minor visual and positioning tweaks to the debugger's memory editor. Revamped the text drawing routines to not take naked pointers, instead taking an MDFN_Surface*, optionally an MDFN_Rect for specifying a clipping rectangle, and x and y positions within the surface. June 10, 2016: Replaced MDFN_FastU32MemsetM8() with a set of MDFN_FastArraySet() functions, which don't require minimum alignments beyond natural alignment, but will perform faster with them. June 9, 2016: PSX: Brought MDEC emulation decode timing closer to the timing of a PS1. VB: Replaced endian-handling functions local to vip.cpp with new code in endian.h derived from code written for Saturn emulation. June 8, 2016: Fixed long-broken MDFN_en24msb() function. June 7, 2016: Fixed a bug that could cause a crash if a gzip-compressed file whose uncompressed size is 0 bytes is loaded. June 6, 2016: SNES: Updated libco to the copy included with higan v098, for x86_64 Windows fixes and ARM support. June 4, 2016: Added support for CUE sheet "INDEX" directives for indexes 2-99. May 31, 2016: NES: Extended the mapper 184 emulation to support "Fantasy Zone"'s board. May 30, 2016: Replaced various redundant C-string-utilizing file path decomposition functions/code with usage of the newer MDFN_GetFilePathComponents(). May 29, 2016: Replaced usage of MDFN_calloc*()/MDFN_malloc*()/MDFN_free() with new/delete. Replaced MDFN_IsFIROPSafe() with MDFN_CheckFIROPSafe(), which throws an exception instead of relying on the caller to do it. May 5, 2016: SNES: Removed unused disassembler code. Fixed code causing a compilation error on gcc 6. April 10, 2016: Cleaned up cheat code a little, and added support for RAM cheats to be applied via function call instead of through direct data pointer access. March 29, 2016: MD, NGP, PC-FX: Encapsulated code in namespaces. March 28, 2016: NES: Implemented kludge to fix a minor Zelda 2 title screen glitch, a status bar glitch in Burai Fighter, and scrolling in the second stage of The Young Indiana Jones Chronicles. October 23, 2015: PSX: Reworked how branch delay slots are handled to be simpler and slightly more efficient. October 12, 2015: PSX: Improved emulation of the instruction cache management features of the PS1's CPU core; probably won't affect any games, but could be of use in homebrew. -- 0.9.38.7: -- September 30, 2015: Fixed several malformed trio_sscanf() format strings in regards to field width, that could cause stack buffer overflows in certain cases. September 29, 2015: PSX: Added skeleton BCzF/BCzT instruction emulation, and fixed handling of illegal CP0 instructions. September 25, 2015: PSX: Added emulation of CPU exception-handling bad address register. PSX: Implemented emulation of the Coprocessor Error field in the CAUSE register. PSX: Added emulation of CPU exception-handling branch target register. PSX: Fixed handling of CAUSE bits 30 and 31 when an exception occurs immediately after a branch instruction is executed. PSX: Fixed link address calculation for JAL, JALR, and B*AL instructions when they're executed in a branch delay slot. PSX: Corrected emulation of the quasi-illegal mirrors of the BGEZ*/BLTZ* type instructions. PSX: Added emulation of a pipeline quirk that occurs with back-to-back load instructions to the same register(previously only emulated with LWL and LWR). September 22, 2015: Fixed a bug in the debugger's disassembler that could break disassembly when a disassembled instruction wraps around the end of the CPU's program address space to the beginning. September 18, 2015: PCE: Removed experimental and unfinished hypothetical subtitle hardware emulation which had a few security-related problems. September 16, 2015: MD: Fixed registration of main RAM in the cheat engine to be mirrored properly. PCE: Fixed a bug that caused the debugger's disassembly and memory view to show a wrong value for the HES bootstrap register at $1D00. PCE: Fixed a bug that sometimes caused the "TIMV" register in the debugger to display "FFFFFFFF" instead of "FF". The date and time of the compilation of qtrecord.cpp are no longer written to recorded QuickTime movie files, to solve a minor privacy issue and a build reproducibility issue. PSX: Rewrote parts of the timer emulation code to fix several issues; fixes wrong music playback speed problem in "RPG Tsukuru 4". -- 0.9.38.6: -- August 9, 2015: PSX: Fixed a bug in the calculation of time taken by some GPU commands while in interlaced mode; fixes graphical glitches in "Mr. Driller G". PCE, PCE_FAST: Added more delay to CD Read command's returning of sector data, to fix a lockup in "Mirai Shonen Conan", and a stuck note problem in "4 in 1 Super CD". -- 0.9.38.5: -- June 26, 2015: PSX: Generate a seek error when trying to read audio sectors(when the appropriate Mode bit isn't set), and generate a bad command error when executing ReadN/ReadS with a non-PS1 disc. Fixes a lockup in "Vib Ribbon" when trying to play with audio CDs. June 20, 2015: Altered SHA-1 and SHA-256 test code to work around a preprocessor-related bug in gcc. NES: Fixed a mapper 19 sound emulation bug; fixes music issues in the Japanese release of "Rolling Thunder". PSX: Replaced a GPU debug puts() with code that respects the psx.dbg_level setting. June 18, 2015: PC-FX: Corrected handling of width/height of 0xA for KING BG1-3, per tests on a PC-FX. Fixes a graphical glitch in "Sakuraigar Mode" in "Tyoushin Heiki Zeroigar". May 5, 2015: PSX: Added some debug messages to the memory card emulation code, outputted when setting psx.dbg_level is set to certain values. April 29, 2015: PCE, PCE_FAST: Corrected decimal-mode ADC and SBC behavior(especially for "illegal" input values), per tests on a HuC6280. April 22, 2015: Added a test to tests.cpp for gcc bug #60196(triggered with non-default optimization flags). April 19, 2015: Added a missing dependency statement to configure.ac, whose absence broke compilation with --disable-pce --enable-pcfx April 16, 2015: WonderSwan: Removed erroneous constraints that were preventing opposing X* and Y* buttons from being pressed simultaneously, and changed the names of the the X* and Y* buttons used during input configuration, per tip from trap15. -- 0.9.38.4: -- April 12, 2015: PC-FX: Reorganized the debugger's register view to be slightly more space-efficient horizontally. NES: Migrated the rest of the *GetRegister() and *SetRegister() debugger functions over to the newer-style interface. PC-FX: Migrated the rest of the *GetRegister() and *SetRegister() debugger functions over to the newer-style interface. April 11, 2015: PC-FX: Migrated debugger functions PCFXDBG_GetRegister() and PCFXDBG_SetRegister() over to the newer-style interface that takes integer IDs instead of std::string. VB: Migrated debugger functions VBDBG_GetRegister() and VBDBG_SetRegister() over to the newer-style interface that takes integer IDs instead of std::string. WonderSwan: Migrated debugger functions WSwan_GfxGetRegister() and WSwan_GfxSetRegister() over to the newer-style interface that takes integer IDs instead of std::string. PC-FX: Added support for setting breakpoints on writes to specific VDC registers, by setting an Aux Write Breakpoint on an address ranging from A0000-A001F(VDC-A) or B0000-B001F(VDC-B). April 10, 2015: Debugger: Relaxed most maximum string length restrictions on user-inputted addresses(to allow for lazily leaving an excessive number of 0s at the beginning of an address, for example). Debugger: "Goto Address" prompt in the memory editor can now be activated by pressing "ENTER"(in addition to "G"), and "Disassembly Address" prompt in the main debugger view can now be activated by pressing the "G" key(in addition to "ENTER"). April 9, 2015: NES: Added sprite RAM to the debugger's memory editor. NES: Fixed some issues with the debugger's graphics/tileset viewer. April 8, 2015: PSX: Improved GPU texture cache emulation accuracy per tests on a PS1; fixes graphical glitches in the menus of "Tigershark". April 5, 2015: PCE: Added support for setting breakpoints on writes to specific VDC registers(like MAWR, BXR, BYR, etc.), by setting an Aux Write Breakpoint on an address ranging from 20000-2001f(hexadecimal). April 4, 2015: Avoid left-shifting negative values in hw_sound/pce_psg/pce_psg.cpp Added a couple more tests regarding left shift of signed integers to tests.cpp. April 2, 2015: Debugger: Fixed half-broken re-activation of the debug screen when a breakpoint triggers and the user was last on a debug screen other than the main one. Debugger: Fixed a rounding issue that could cause insufficient disassembly lines with some *.debugger.disfontsize setting values. PSX: Hooked up writing(editing) in the debugger's memory editor for "CPU Main RAM". March 29, 2015: PCE: Removed old leftover debug puts() in HuC6280 emulation code. Debugger: Fixed a bug that could cause breakpoints to be skipped if the 'R' key was pressed(or auto-repeated) while outside of step mode. NES: Fixed highpass filter coefficient calculation. SNES: Fixed a bug that was breaking input after triggering a virtual Reset/Power Toggle event when a non-gamepad controller(e.g. mouse) is currently selected for a port. March 23, 2015: NES: Fixed a minor sound emulation bug. March 15, 2015: GBA: Fixed several instances of left-shifting negative values in thumb.cpp. PC-FX, VB: Fixed an instance of left-shifting uint64 by 64 in the FPU emulation code. March 14, 2015: GBA: Fixed a few instances of technically undefined behavior(shifting 32-bit int by >= 32, and left-shifting negative values) in arm.cpp. March 11, 2015: Reworked a test in tests.cpp to better reflect the requirements of certain undefined behavior some code still (unfortunately) relies on, to avoid triggering an assert() during startup when compiled with llvm/clang 3.6. March 6, 2015: PCE: Fixed a major VRAM DMA emulation regression introduced around version 0.9.16-WIP, that breaks some homebrew software. NES: Altered mapper 185 emulation to fix "Bird Week", "B-Wings", "Sansuu 1 Nen", "Sansuu 2 Nen", "Sansuu 3 Nen", and "Seicross (version 2)". PSX: Added a kludge to the core cheat file reading and writing code to work around the mess created by our flawed game ID generation code (the PS1 game library is enormous, and many games only have one track, leading to many collisions); effectively, the game's filename(which was previously regarded as a comment), is now used in addition to the game ID. -- 0.9.38.3: -- March 4, 2015: NES: Fixed mapper 69 IRQ acknowledge behavior, per tip from tepples. February 24, 2015: MD: Fixed an out-of-bounds array access in the 68K emulation code. Avoid passing NULL to memcpy() in netplay.cpp. MD: Fixed some code doing misaligned memory writes in vdp.cpp. February 23, 2015: Avoid blitting to the screen when visibility is lost(i.e. window is minimized), to reduce CPU usage and to prevent memory usage from skyrocketing on Windows under certain conditions. February 22, 2015: PSX: Tweaked non-logical CD seek emulation to fix lockups in some versions of "Tomb Raider". February 17, 2015: PSX: Fixed Justifier and GunCon x position being off when setting "psx.h_overscan" is set to "0". -- 0.9.38.2: -- February 15, 2015: PSX: Fixed some miscellaneous minor issues in the triangle rasterization code. PSX: Fixed a GPU timing regression introduced around version 0.9.37; fixes a disappearing graphics glitch in "Tobal No.1". -- 0.9.38.1: -- February 11, 2015: NES: Subtract 3 from emulated 6502 stack pointer on reset, to match what reportedly occurs on a NES and to fix a certain poorly-programmed "Legend of Zelda" game hack. February 9, 2015: Allow interrupting the virtual device input configuration process(it was broken in 0.9.38-UNSTABLE); though of course interrupting it will still leave the configuration in a broken state(but that's not a regression ;)). PSX: Fixed a bug that was causing a segfault on loading a PSF/EXE file(a regression introduced in 0.9.38-UNSTABLE). February 8, 2015: Clear override settings on game close(for the benefit of forks/ports). -- 0.9.38-UNSTABLE: -- February 5, 2015: Lynx: Added support for custom palettes. January 31, 2015: Split cdrom/audioreader.cpp into multiple files. January 29, 2015: Dropped physical CD support. Throw an error, rather than crashing, in the CUE sheet reader if a track is missing. Throw an error in the CUE sheet reader if an M:S:F time contains a component out of range. Implemented rudimentary support for CD-i discs (images), but no actual CD-i emulation, of course(yet :p). January 27, 2015: PSX: Added support for reading (synthesized) CD sector data located at MSF 00:00:00 through 00:01:74. Fixed completely broken synthesis of pregap data(mode 1/mode 2) sectors with CUE+whatever. PSX: Refactored leadout track sector data synthesis handling into the core CD reading code. January 26, 2015: PSX: Host system file/disk access time is now partially masked by emulated seek time when using CD images(except TOC+BIN with embedded subchannel data), which should reduce the probability of sound buffer underruns when running with "cd.image_memcache" set to "0"(the default). The CloneCD format reader now always caches the subchannel file data in memory on load, regardless of the "cd.image_memcache" setting's value. Added setting "osd.message_display_time". Added undocumented setting "srwautoenable". January 25, 2015: PSX: Fixed a problem that broke building after passing --disable-debugger to the configure script. January 24, 2015: PCE_FAST, VB: Now dynamically-allocate the Blip_Buffer objects, and made very minor tangentially-related optimizations to the sound emulation code. Refactored command key processing to be a bit cleaner, and to fix a couple of issues in the process(avoid triggering a command if keys/buttons are pressed while Mednafen is starting up, and to skip the input.ckdelay delay when selecting a command key to remap after starting the process via F2); some of the changes could conceivably cause regressions, as the modified code was very old and convoluted. January 18, 2015: PSX: Improved some Read*/SeekL versus status bits versus GetLocL semantics, to fix a lockup in "Harukanaru Toki no Naka de - Banjou Yuugi". PSX: SetLoc CDC command now generates an error on invalid arguments, per tests on a PS1. January 17, 2015: PSX: Fixed the value that the "Mode" CDC parameter is reset to in the CDC Reset command; fixes lockups in "This Is Football 2" and "Disney's Pooh's Party Game: In Search of the Treasure". PSX: Fixed some issues with emulation of CDC command GetTD, per tests on a PS1. PSX: Improved CDC result FIFO emulation accuracy; fixes a startup lockup in the Japanese version of "CyberSled". PSX: Fixed a line-drawing regression from a Dec 28 change. PSX: Fixed a few minor bugs in the GPU RAM write and read commands, per tests on a PS1. January 15, 2015: PSX: Tweaked CDC SeekL timing to fix a random lockup problem in Wing Commander 3. January 14, 2015: Fixed a small memory corruption issue in the input grabbing/command key disable toggle code, and reworked the code to be more verbose in the status message it displays and to prevent activating certain combinations of input grabbing/command key disabling that can be confusing to deactivate. January 13, 2015: PSX: Fixed some problems with multitap emulation that were preventing DualShock functionality(such as rumble) from working properly when the emulated DualShock was behind an emulated multitap. January 11, 2015: PSX: Allow dithering on non-gradient lines(instead of only on gradient-colored lines), per tests on a PS1. January 10, 2015: PSX: Fixed an off-by-1 saturation/clamping related bug in the RTPS/RTPT emulation code. January 9, 2015: PSX: Improved emulation of the GPU info/VRAM read latches, per tests on a PS1. PSX: Added support for GPU texturing disable bits, per no$ notes and tests on a PS1(still need to implement the actual functionality of texturing disabling, though). PSX: Return GPU display mode bit 7 in GPU status port reads properly(though we still don't emulate the effects of setting that bit to 1). January 1, 2015: PSX: Removed most of the event system pedantic sanity checks(and associated computational/cache overhead), as they've long outlived their usefulness. December 29, 2014: No longer ignore settings in configuration files when the value is empty. December 28, 2014: CDPLAY: Increased output volume by 3.5dB. Added support for per-game configuration override files. PSX: Fixed a minor line drawing bug, per tests on a PS1. December 27, 2014: PSX: Fixed a few instances of left-shifting a negative value, and signed integer overflow. December 26, 2014: PSX: Replaced SimpleFIFO usage in GPU and MDEC emulation with a new FastFIFO class. December 25, 2014: PSX: Altered an emulation loop exit condition to not be based on psx.slstart* and psx.slend* settings(to fix a potential desynchronization issue with netplay and input-recording movies). Removed VLA usage in qtrecord.cpp. December 24, 2014: PSX: Tweaked the region detection heuristics to support a hacky Russian translation of Tomb Raider 1. Added MDFN_lzcount32() inline function to math_ops.h to replace direct usage of __builtin_clz() in psx/cpu.cpp. PSX, PC-FX, VB: Added alternative to computed-goto in the CPU emulation cores, for crazy people who want to compile (parts of) Mednafen with MSVC. December 23, 2014: PSX: Fixed a bug that could cause a significant mischeduling of timer/root-counter 1's IRQ event under certain conditions. PSX: Brought MDEC decode timing closer to what it is on a PS1; fixes stuttering issue in the early FMV-background sequence in in Parasite Eve II. December 21, 2014: Replaced usage of case-range and VLAs with non-GNUish alternatives in: cdrom/CDAccess_CCD.cpp cdrom/CDAccess_Physical.cpp gb/gb.cpp general.cpp lynx/system.cpp md/input/megamouse.cpp md/system.cpp nes/input.cpp netplay.cpp pce/subhw.cpp pce/vce_sync.inc pcfx/debug.cpp psx/cpu.cpp psx/spu.cpp psx/input/memcard.cpp settings.cpp vb/debug.cpp wswan/v30mz.cpp -- 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. -- 0.9.27-WIP: -- December 20, 2012: Removed some old unused code from the memory debugger. PSX: The debugger's disassembler will now pull instructions from the instruction cache, if it's valid(and fall back to the memory map data if it's not). NES: Fixed a bug in the FDS state loading routine that could cause sound issues(wrong volume of FDS sound channel). NES: Replaced a floating-point filter used when expansion sound is in use with a 64-bit fixed-point integer math filter, to fix a problem of massive performance degradation in some circumstances(probably due to denormals). NES: Fixed a bug that was causing a crash when Game Genie emulation was enabled while trying to emulate an FDS game. Don't make use of errno in FileWrapper::read when handling an unexpected EOF. NES, SNES: Replaced usage of stdio file access with FileStream usage. December 19, 2012: Fixed a startup multithreading race condition with QuickTime and WAV file recording. PC-FX: Resolved a few compiler warnings. Replaced usage of stdio file access with FileStream usage in: Memory debugger. NGP FLASH memory saving/loading routines. December 17, 2012: NES: Added setting "nes.correct_aspect". Attempt to open a Linux (joystick) event device read-only if opening it for read+write fails, so at least some of the enhanced functionality will be available on Linux distributions with partially broken device permissions. December 16, 2012: PSX: Run EXE-loading MIPS binary code from a cacheable segment so it doesn't take so long to run. December 15, 2012: SNES: Changed frame/system synchronization point logic, to reduce input latency by 1 video frame(~17ms). SNES: The setting "snes.correct_aspect" setting now supports the unique PAL aspect ratio with PAL games(rather than just correcting the aspect ratio per NTSC as before) SNES: Fixed a bug that was causing distorted vertical scaling with PAL games. December 12, 2012: PSX: Improved CDC "ID" command emulation, fixes a problem with music in "WipEout 3". PSX: Changed how end-of-disc is handled while CD-DA is playing, per tests on a PS1; fixes a major problem with "Wu-Tang - Shaolin Style" during its startup. December 11, 2012: PSX: Added a kludge to the CDC logical seek emulation code to fix the problem of missing music in "Gran Turismo 1". PSX: More DMA emulation revising. December 10, 2012: PSX: Force DMA channel 6's channel control register bit1 to 1, per tests on a PS1. December 9, 2012: PSX: Added use of MDFN_LIKELY() and MDFN_UNLIKELY() to the CPU core. Added MDFN_LIKELY() and MDFN_UNLIKELY() macros to provide crude branch prediction hints to the compiler. PSX: Improved DMA controller emulation, per tests on a PS1 and nocash documentation. Fixes major problems with "Final Fantasy 7", "Final Fantasy 9", "Chrono Cross", "Legacy of Kain - Soul Reaver", and "Dragon Quest 7". December 8, 2012: PSX: Added preliminary instruction cache emulation, fixes problems with "Formula One 99", "Formula One 2000", and "Formula One 2001". PSX: Corrected the value in the CPU product ID register. December 5, 2012: PSX: Improved GPU info control port command emulation, per tests on a PS1. PSX: Reset more GPU state on software(via control port) reset, per tests on a PS1. December 2, 2012: PSX: Initialize NTSC vertical and horizontal GPU display timings properly on software reset(via the GPU control port), per tests on a PS1(the horizontal timings might not be 100% correct, but they probably are). PSX: Increased the amount of NTSC horizontal overscan shown. PSX: Revamped GPU vertical display timing model, per tests on a PS1(the old model was Quite Wrong), and made the visible vertical 240-pixel "viewport" match standard PS1 NTSC game vertical timings. PSX: Ignore lower bit of the GPU framebuffer X readout coordinate, per tests on a PS1. Made CUE sheet parser slightly stricter. Added setting, "cd.image_memcache", default value of "0", that when enabled will cause any referenced data files in CUE and TOC sheets to be loaded entirely into memory on startup, and cause the non-multithreaded CD reader interface to be used rather than the reader interface that uses an additional thread, for that emulated CD. November 16, 2012: Replaced various instances of "__attribute__((unused))" with MDFN_NOWARN_UNUSED, a macro defined in types.h. Removed nonutilized file "git-virtb.h". November 13, 2012: PCE_FAST: Comment out a debug print statement in the CPU emulation core. PCE_FAST: Fixed a heap overflow bug when loading excessively large ROM images. November 6, 2012: Fixed a compiler warning in the Linux joystick code that could hypothetically be treated as an error by some compiler(configurations). In the Linux joystick code, Directly include instead of relying on it being included by . November 5, 2012: Removed internal input button data encoding method "IDIT_BUTTON_BYTE", as the sole user of it(Family Keyboard) has been changed to not use it, and it is wasteful(especially with netplay). NES: Simplified Family Keyboard emulation, and compacted the key state. NES: Removed unused members from emulated input device definition structures. November 4, 2012: Don't error out if the corresponding evdev to a jsdev device can't be opened, and instead rely on legacy jsdev functionality only, as Mednafen versions prior to 0.9.25-WIP would. November 3, 2012: The "SDL" audio driver/output method now respects the "sound.period_time" setting. November 2, 2012: PCE: Fixed a rather obvious major problem with the (incomplete/preliminary) MCGenjin emulation code. Added missing sizeof(RAWINPUTDEVICELIST) parameter to a GetRawInputDeviceList() call in the Win32 DirectX joystick code. It's probably not strictly necessary now when viewed in context, but may be in the future if Microsoft does something weird, which Microsoft tends to do, so better safe than sorry. Thanks to zeromus for pointing it out. October 28, 2012: Fixed typos that broke compilation without internal CJK fonts. Thanks to zeromus for pointing it out. October 25, 2012: VB: Completely removed the deprecated and disabled code for support for ".bin" file extension. NES: Added support for iNES mapper 37. October 24, 2012: NES: Changed filter parameters for a "nes.soundq" setting of "-2", increasing the computational complexity slightly, so that games like "Solstice" and "Mega Man 2" don't sound like whining messes. October 19, 2012: Cleaned up TODO file a bit, migrating some of the useful data into the general documentation. PCE_FAST: Brought aspect ratio correction in line with the "pce" module(which is about what it should be). -- 0.9.26-WIP: -- October 13, 2012: PSX: Handle non-word-aligned timer port reads and writes, rather than triggering an assert(). Also, a warning message is now printed if a game tries to read from timer open bus space, rather than an assert() being triggered. More C++11 warning fixes. October 12, 2012: NES: Added emulation of iNES mapper 101. October 11, 2012: PSX: Added a "Dance Pad" emulated device, that uses mostly the same code as the "Gamepad" device, but doesn't provide access to the shoulder buttons, and allows for opposing D-pad directions to be pressed simultaneously. PSX: Improved emulation of bit15 of the SPU control register; fixes problems with "Dance Dance Revolution", "Medal of Honor", "Madden NFL 2003", "Fuuraiki", and "The Misadventures of Tron Bonne". October 10, 2012: PSX: Fixed a bug that could cause an emulator crash if the game crashed and tried to execute code in the last 64KiB of the CPU logical address space. -- 0.9.25-WIP: -- October 9, 2012: Fixed a problem of usage of uninitialized memory in a startup function in drivers/input.cpp. October 8, 2012: PSX: Tweaked GunCon hit detection, to improve menu behavior in games like "Point Blank 2". PSX: Reduced the penalty time required to resume from a Pause state to the best-case observed times(for 1x and 2x) on a PS1; more accurate modeling will need to take into account the time passed since the Pause command among other things(TODO for the future maybe, though the relationship between time passed and time to resume from a Pause state is a bit...wonky). PSX: Pause command completion time is now more accurate, per tests on a PS1. October 7, 2012: PSX: Changed conditions under which "GetLocL" fails, per limited tests on a PS1. Fixed a game-breaking lockup in "Star Ixiom". PSX: Added CDC "Standby" command and status emulation, fixes a game-breaking lockup in "Philosoma". October 6, 2012: PSX: Don't run DMA channel 1 unless there really is data available from the MDEC; fixes partially-broken FMV in "Rayman". October 5, 2012: PSX: DMA, and GPU FIFO emulation tweaks, to fix a regression in "Legacy of Kain - Soul Reaver"(the game does something fairly unique; it has a transfer length of 0x10 in some linked-list headers). PSX: Increased base cycle usage counts for polygon commands, per tests on a PS1. PSX: Improved GPU FIFO behavior, based on tests on a PS1. The GPU on an actual PS1 appears(more of a hypothesis than anything, based on limited data) to have a contention or dependency system with different functional units that have access to the FIFO; the changes here just simulate some of its less-computationally-expensive characteristics in regards to GPU status bits and gross/rough timing. September 30, 2012: Fixed numerous code constructs that caused errors and/or warnings when compiling for the C++11 standard. September 29, 2012: PSX: Improved reliability of the Konami Justifier simulated offscreen shot process. PSX: More event handling tweaks. September 28, 2012: PSX: Added experimental emulation of the DREAD Konami Justifier. This light gun makes tears of pain flow in a torrent. PSX: Added partial emulation of some esoteric timer features, though what was added is probably not totally correct. PSX: Altered the global event system to use a sorted doubly-linked list, to allow for more precise timing of events in relation of one sub-device/chip to another. September 27, 2012: Added code to allow CD image file data to be entirely loaded into memory, though the code is not used as such at current. SNES: Added boolean setting "snes.correct_aspect", default value of "0"(preserving previous behavior). PSX: Added additional heuristics for determining game region; fixes misdetection of the region for the North American release of "Wing Commander IV". September 25, 2012: PSX: Tweaked GunCon x coordinate scaling. Changed absolute mouse x and y coordinate passing from driver->core to be in 1.15.16 fixed point format(previously simple integers), to avoid excess precision loss when scaling the coordinates from viewport dimensions to nominal_width and nominal_height. September 24, 2012: PSX: Added preliminary GunCon emulation. Genesis: Adjusted aspect ratio slightly. PSX: Adjusted NTSC aspect ratio slightly. PSX: Reduced internal frame buffer width by 1/4(reduces memory usage). PSX: When playing a PSF, virtual input(gamepad, etc.) devices are no longer emulated as being connected. The CUE sheet reader will now seek past a UTF-8 BOM at the beginning of a CUE sheet if present(and print an error/warning message). Fixed resource leakage issue when CUE/TOC sheet loading aborts due to an error. September 20, 2012: Removed the rawer parts of a half-baked idea implemented long ago in the virtual input device abstraction structures, and removed some extremely poorly-scaling-with-increased-emulated-system-count-and-emulated-device-count code that said half-baked functionality required, shaving a considerable amount off Mednafen's startup time (though probably not really noticeable on faster CPUs). Modified settings loading and saving code to use new FileStream functionality. September 18, 2012: Modified the CD image reading and "AudioReader" code(used for reading MS WAV/Vorbis/MusePack/etc) to operate on a "Stream" object instead of using stdio functions on "FILE", in regards to files used for track data. This allows MemoryStream to be used very easily to preload the track file data into memory, which may be put to use in the future. Implemented FileStream, derived from Stream, as a quick wrapper around FileWrapper(HAH). September 15, 2012: Map SDL hats to buttons instead of axes in the new joystick interface abstraction code, to prevent loss of information. September 8, 2012: Entered more information into the possible values enum struct for the *.debugger.disfontsize setting(s) so that the possible values will be in the autogenerated documentation. September 7, 2012: Added a const char* "Description" member to the "InputDeviceInfoStruct", and did some minor internal plumbing so it will be propagated to the automatically-generated documentation if non-NULL. (For the possibility of more verbose emulated input device information for the *.input.port* settings in the documentation) September 6, 2012: Increased size of line buffer used in settings file reading. Changed input configuration evaluation code to allow multiple physical mappings to a single emulated analog button/axis to work properly(it is somewhat useful for neGcon emulation). PSX: Added neGcon emulation. September 5, 2012: Added setting "input.joystick.global_focus". Renamed settings: autofirefreq -> input.autofirefreq analogthreshold -> input.joystick.axis_threshold ckdelay -> input.ckdelay September 3, 2012: PSX: Don't mask the address specified by the memcard write command, but instead signal an error condition if the address is invalid, per tests on a PS1. September 1, 2012: Reduced memory usage of internal runtime text rendering data structures by about 2.4MB for 64-bit builds, and about 0.8MB for 32-bit builds. August 31, 2012: Only destroy and recreate the emulated device and device state on the port being altered with CTRL+SHIFT+[n], rather than all ports, to avoid usability problems with more complex input devices(like on the PS1 for instance). Fixed a longstanding bug that caused input configuration data to be lost if you changed the device on a port with CTRL+SHIFT+[n] after configuring input without an emulator exit in-between. August somethingth, 2012: PSX: Added DualShock emulation, complete with Analog mode toggle button emulation. Revamped physical joystick/gamepad support: Added native code targeting DirectInput(5.0) and XInput on MS Windows, and jsdev and evdev on Linux. Added support for rumble on Linux and XInput devices on MS Windows. Refactored and recoded much of the joystick input configuration handling code. Added kludgey support for handling physical joystick analog buttons in the input configuration process without it freaking out: Note: The process described below should NOT be necessary if you're using an XBox 360/XInput controller under MS Windows. If you're using such a controller under a different operating system, or using a non-XBox 360/non-XInput controller, and it has analog buttons, then you should perform the process as described below. Also note that the process is only necessary when you're configuring inputs, and not during "normal" gameplay/usage. Twirl all sticks and D-pads and press all analog buttons on any physical gamepads/joysticks with analog buttons you want to use in the input configuration process, then press F3. Then, configure input as normal. The detected analog buttons will be recognized during input configuration until Mednafen exits; if you exit Mednafen and restart, and want to configure input devices again, you'll need to repeat the twirling-pressing-F3 process again). August 12, 2012: Fixed a bug that was causing the FPS display to be missing if the "overlay" video driver was used in combination with PC Engine emulation. Removed the last vestiges of the driver-side handling of the long since removed/replaced PC-FX multi-resolution-frame multi-layer alpha blending method. August 11, 2012: Added setting "osd.alpha_blend", default value of "1", that controls enabling of OSD alpha-channel blending. Set it to "0" for a speedup when using the "sdl" video.driver. Software("sdl" video driver) render fixes/improvements: Improved precision and rounding behavior with the fixed-point math used for scanline effects and non-integer scaling. Implemented alpha blending for all OSD elements except the FPS display. Added support for the scanlines effect when the screen is rotated(via ALT+O). Fixed a bug that caused an enabled scanline effect to be missing when a special scaler(hq2x, hq3x, scale2x, etc) is used and no post-special-scaler scaling is necessary. August 10, 2012: Implemented minor optimizations to the "sdl" "video.driver" scanlines effect code. Changed a ton of driver-side OSD rendering code to use MDFN_Surface instead of SDL_Surface. August 1, 2012: Fixed port numbering(from 0-based to 1-based) in the error message display after trying to configure buttons for a nonexistent virtual device/port. June 14, 2012: Added a non-threaded alternative implementation of CDIF(currently unused, but will be useful if we ever target an OS without multithreading capabilities). July 13, 2012: Lynx: Made reporting of errors during game load to be more verbose. GB: Error out if a ROM image to be loaded is less than 512 bytes in size. GB: Don't use TestMagic() in Load(), and don't return -1. (So that -force_module gb will work as expected) -- 0.9.24-WIP: -- July 12, 2012: Only use "AI_ADDRCONFIG" flag with getaddrinfo() hints if it's available; fixes a compilation error on OpenBSD. Disallow manual save states with "snes" module during netplay, since the bsnes save state code alters the current state on save state, which would cause desynchs, or annoyances and extra bandwidth usage to work around the issue, in a netplay environment. July 9, 2012: Netplay: Removed setting "netplay.merge", since similar functionality can be obtained by issuing one or more of the newly-added commands. Added /take, /dupe, and /drop commands. July 8, 2012: PSX: Implemented CD-XA playback current file and channel matching(per very limited tests on a real PS1), fixes broken speech in "Yarudora Series Vol.1 - Double Cast". Netplay: BSD/POSIX: Only use MSG_NOSIGNAL if it is defined; fixes compilation issue on Mac OS X. And don't use MSG_NOSIGNAL for recv(), only send(). BSD/POSIX: Use socket option "SO_NOSIGPIPE", if available. Handle a recv() return value of zero properly(or at least semi-properly :b), to prevent a lockup in certain situations. Added player /swap command(requires mednafen-server 0.5.0). July 6, 2012: SMS: Added "Power Strike II" to the internal game database, to force PAL mode, per suggestion from "megadriver". -- 0.9.23-WIP: -- July 5, 2012: PSX: Fixed a very small memory leak in frontio.cpp. Updated internal copy of miniLZO from version 2.01 to version 2.06. July 4, 2012: SNES: Removed some debug printf()'s that got left in the code from the work a few days ago. Networking: Don't pass a NULL pointer to the WSAIoctl() output length count pointer argument. More verbose error reporting with Winsock2 network code. Break out of the name resolution loop so that we don't erroneously connect() multiple times. Fixed some socket leaks on error bugs. PSX: Use only one 9-bit SPU RAM write address offset counter for voices 1 and 3, and CD-audio writing to SPU RAM, and never reset it during runtime(sans reset/power condition, of course); fixes audio glitches with the guitar sounds in "Um Jammer Lammy". July 3, 2012: Wrote netplay code directly targeting BSD/POSIX and Winsock2 APIs, and removed SDL_net support. This change also brings support for IPv6. July 2, 2012: /server and /connect no longer accept "[HOST]:[PORT]" form, only "[HOST] [PORT]". /server and/or /connect with no arguments in the netplay console will now connect to the server as specified by "netplay.host" instead of trying to connect to an empty string and trashing the "netplay.host" setting in the process. July 1, 2012: Fixed various internal problems with the netplay user interface code(memory leaks, using free()'d memory, definite multithreading unsafety, /quit not working properly, trying to access the network when the connection is closed, etc.). June 30, 2012: Further disable state rewinding functionality during netplay. SNES: Backported(sort of) a fix to the serializer code that was breaking 64-bit integer restoring. June 29, 2012: SNES: Change various instances of "if(scheduler.sync == Scheduler::SyncAll)" to "while(scheduler.sync == Scheduler::SyncAll)" in the bsnes code, for better save state behavior. SNES: Run S-SMP more tightly in sync with S-CPU, to further reduce frame timing jitter. June 27, 2012: Updated netplay protocol to increase the maximum number of allowed controllers per game from 8 to 16. June 26, 2012: Changed save-state header magic from the 16-bytes MEDNAFENSVESTATE to the 8-bytes MDFNSVST, to make room for a 64-bit creation timestamp(which will be used in the future). The old header magic is still recognized, for backwards compatibility. June 25, 2012: Cleaned up and remove VLA usage from core netplay code. June 24, 2012: NES: Fixed an annoying old compiler warning in "ines.cpp". SNES: Disable some warnings to keep compilation of the bsnes code from spamming the screen with warnings. SNES: Implemented kludges to prevent sound clicks and scratchiness when state rewinding functionality is enabled(but it's still plenty scratchy when actually rewinding ;)). A more proper fix does not seem possible, due to the way bsnes works. SNES: Modified bsnes core to prevent S-SMP(and S-DSP) from running as far ahead of the CPU as it did before, to reduce timing jitter. This change has a small negative speed impact. June 23, 2012: Tidied up netplay join/leave messages. May 30, 2012: Fall back to nearest-neighbor scaling when blitting a screen image segment with a height less than 2(or less than 4, for scale4x); fixes an assert-triggered "crash" when using scale2x with PSX emulation(and possibly Genesis and PC Engine emulation with some games, as well). May 29, 2012: PSX: Fixed a stupid bug in the FB fill GPU command; the height iteration variable was being tested in respect to drawability(interlace mode, dfe, etc.), rather than the actual destination Y coordinate into GPU RAM. Fixes major graphical problems with "Dead or Alive". May 28, 2012: PSX: Altered data structures to avoid instantiating a templated struct with 0-size arrays. May 26, 2012: PSX: The Pause CDC command will "complete" much, much faster now if the drive is already paused. Fixes the lack of music after pausing and unpausing in "Dead or Alive". PSX: Corrected GPU line draw command coordinate precision handling, in regards to x,y drawing offset, per tests on a PS1; fixes a flickering line issue in "Triple Play 97". May 25, 2012: PC-FX: QuickTime movie recording will now (indirectly) take the "pcfx.high_dotclock_width" setting into account, to reduce the size of the raw recorded image data when the setting is set to "256". (Note that this setting should still not be changed from the default of "1024", unless you understand the graphical degradation smaller setting values will cause in some games.) MD: Fixed a bug that was causing the QuickTime movie recording code to instantly crash right after emulator startup with MD/Genesis emulation. May 24, 2012: PCE_FAST: Some 32-bit x86 inline assembly was listing "rbp" in the clobber list, when it should have been listing "ebp". Fixed. May 23, 2012: PSX: Improved the emulation accuracy of GPU texture windows(and made the texture window code much simpler), per tests on a PS1. May 23, 2012: PSX: Mask sprite width and height for custom/variable-sized GPU sprites against 1023 and 511, respectively, per tests on a PS1. -- 0.9.22-WIP: -- May 8, 2012: PC-FX: Increased the minimum allowable value for the "pcfx.cdspeed" setting from "1" to "2". Replaced internal module graphics layer toggling code with absolute graphics layer enable mask setting code. May 5, 2012: NGP: Reduced the size of the noise channel LFSR from 16-bits to 15-bits, per mic_'s suggestion(and test program and recorded sound sample). May 4, 2012: Fixed broken support for "CTRL" modifier when configuring command keys/hotkeys(this doesn't affect hardcoded default key assignments, or manual configuration file changes to use the ctrl modifier, both of which already worked fine, it's just the in-Mednafen configuration process that was broken in regards to the CTRL modifier key). May 2, 2012: PSX: Fixed SPU handling of voice pitches > 0x3FFF; fixes broken sound effects in "Tales of Phantasia", and likely other games as well. Thanks to "sparklewind" for bringing the bug to my attention, and recording sound samples of the sound effects from a PS1. April 30, 2012: MD: Reworked YM2612 LFO PM/FM emulation based on notes from Nemesis. Changed the LFO AM waveform start phase so that the first "sample" is 0; though the waveform probably needs to be changed from sine to triangle. Corrected(I hope. :b) LFO AM depth setting 0x1 shift factor. April 29, 2012: PSX: Increased CD audio buffering slightly, and flush buffers on Pause, to reduce the number of voice audio glitches in "Tales of Destiny 2". April 28, 2012: PSX: Began adding save state support. Fixed a regression in the deinterlacer code, from the April 20 fix, that was causing the first entry in a valid line widths array to be trashed. April 26, 2012: NGP: Got rid of various truncations of CPU cycle counts to 8-bits(they're still ultimately truncated to 8-bit, but only in one place now, so that it can easily be removed in the future when the CPU timing mess is resolved). PCE: Added direct BRAM editing capability to the debugger's memory editor. PCE: Fixed broken direct main RAM viewing and editing in the debugger's memory editor. April 23, 2012: MD: Added support for region overrides in the internal database(though no entries that override region are present yet). MD: Changed supported region(as indicated by the game's embedded header) preference order to prefer domestic NTSC over overseas PAL. MD: Removed an erroneously superfluous interrupt pending check in the 68K emulator core(which should have been removed a long time ago, since it is apparently a leftover of the original C68K timing model). April 21, 2012: MD: The upper 8 and lower 8 horizontal lines on the screen are now rendered as the border color in 224 height mode; fixes graphical glitches in "Micro Machines", possibly other games. MD: Corrected VDP vblank flag set and clear time, fixes sprite glitches in X-Men 2. April 20, 2012: Fixed a bug in the system-independent deinterlacing code that was causing graphical glitches with Genesis interlaced mode under certain conditions MD: Reset-button-triggered reset no longer resets VDP state, fixes major graphical corruption with Bonkers after such a reset. April 19, 2012: MD: If the YM2612 channel "algorithm" has changed, start the attack phase on the next key on from maximum attenuation, to ostensibly fix a broken sound effect in Ecco the Dolphin 2(Tides of Time), per the Gens EG implementation; this needs to be tested on an actual Genesis, which will have to wait until I'm able to obtain a Genesis flash cart. April 18, 2012: MD: Fixed the YM2612 save state code to work again(after the recent changes broke it); however, the recent changes have broken save state compatibility with save states from 0.9.21-WIP and earlier, and that isn't going to be "fixed". MD: Fixed a major problem with the new EG implementation that was causing significant timbre and volume issues, due to an erroneous assumption(from PS1 emulation work) of how the attack phase entry works(thanks to a terse old forum post from Steve Snake for clarifying the issue). April 16, 2012: MD: Tweaked the sin and exp table algorithms to more or less match those described at https://docs.google.com/View?docid=dd8kqn9f_13cqjkf4gp (different chip, but at least the logsin table is supposed to be the same as the YM2612). The LFO tables still need to be worked on, though. MD: Fixed a bug(relating to ADSR phase skipping) in the new EG code that caused some broken music in Flashback. April 15, 2012: MD: Fixed CSM support(untested) in YM2612 emulator. MD: Rewrote YM2612 emulator EG portion, based on information from Nemesis and MAME/Genesis Plus GX. (CSM support was broken in the process, and will need to be fixed, along with some other code cleanups) MD: Simulated FIFO bits in the status register were only being set(to 1), and never cleared. Fixed. (Mega Turrican actually checks the FIFO full bit, unlike many other games). April 14, 2012: MD: Updated Z80 core to latest FUSE SVN revision(though it required heavy modification for inclusion in Mednafen, so it's possible something Z80-emulation-related could have broken in the process); the update fixes some undocumented flag results, and changes/fixes timing for some instructions. MD: Implemented very crude VDP FIFO timing simulation, fixes issues with "Soldiers of Fortune" and "Fatal Rewind". MD: Removed old, questionable YM2612 hack, fixes some missing sound effects in "Williams Arcade's Greatest Hits". April 13, 2012: MD: Changed VDP line timing based on information in Genesis Plus GX, "Bram Stoker's Dracula" is now playable. MD: Reset(via F10 button) will now reset less state than power off/on "reset", to allow "X-Men" to progress to the final level. MD: Revamped 68K emulator timing, for more versatility and better timing granularity(exact timing not so much, at least not yet...) at the cost of increased CPU usage. MD: Fixed a bug in the VDP DMA fill and VDP DMA VRAM copy timing calculations, fixes graphical glitches in a few games. MD: Applied Yabause revision 1972 C68K timing fix patch. April 11, 2012: MD: Fixed a few(but there are many left :() YM2612 emulator bugs, based on information at http://gendev.spritesmind.net/forum/viewtopic.php?t=386 April 10, 2012: PSX: Unmapped entries in the CPU emulator's fast instruction fetch memory map are now filled with a pointer to a dummy page, to prevent a game's crash from crashing Mednafen as a whole. PSX: Removed unused partially-implemented CPU trampoline code and data, to reduce RAM usage and clean up code a bit(it was originally to ensure stability with a PC-as-a-pointer style CPU optimization, but that optimization was never implemented due to being in conflict with branch delay slot emulation). April 9, 2012: PSX: Added main RAM mirror addresses to the fast instruction fetch memory map. PSX: Added various coprocessor-related instructions to the disassembler. Added logical AND mode command key functionality(where all buttons/keys configured to the command are required to be in a pressed state simultaneously for the command to occur), on a per-command basis(commands can be configured in this mode with SHIFT+F2). April 8, 2012: Fixed transposed memset() value and length arguments in cdromif.cpp, thanks to skitt for the notice. PSX: Fixed triangle coordinate precision in relation to draw offset based on more tests, fixes flickering graphical glitches on the right side of the screen in "Quake II", probably other games as well. April 7, 2012: PSX: Added L3 and R3 button emulation for emulated Dual Analog gamepads. -- 0.9.21-WIP: -- March 30, 2012: Updated the internal copy of libmpcdec to r475(which supports SV8, whereas the version in Mednafen previously only supported up to SV7), and updated the CD audio file reading code to use the new API, fixing a few problems(with variable initialization, and seeking) in the process. SNES, PSX: Moved cleanup/deallocation code into a separate Cleanup() function, and call Cleanup() instead of CloseGame() in case of error during file loading, to prevent nonvolatile saved memory deletion in case of error. SNES: 8MiB of memory is now allocated for the ROM image buffer passed to bsnes, regardless of actual ROM image size, to work around potential design flaws in the bsnes cart loading code to prevent emulator crashes with malformed or corrupted ROM images. SNES: Added an 8MiB limit maximum ROM image size limit. March 29, 2012: Updated the internal copy of tremor to SVN revision 18222, and imported and merged in libogg 1.3.0, since SVN tremor no longer has its own libogg implementation(and hasn't for some time apparently!). PSX: Added draw time penalty for texturing on polygons. SNES: Began adding SNSF support. SNES: Added default mouse button assignments to emulated mice, and default key assignments to the emulated gamepad on the first port. March 28, 2012: Fixed a big bug in the CUE sheet parser that caused wrong track addresses/LBAs with multi-data/bin-file CD rips where the pregap data is included in the binary image via "INDEX 00/INDEX 01" directives in the CUE sheet(which is a common form for PSX CD rips). PSX: Added draw time penalty for goraud/gradient polygon shading. PSX: Reduced draw time penalty for having transparency enabled, and added a draw time penalty for mask evaluation, per a quick, noncomprehensive test on a PS1(more thorough testing in the future is warranted) on a flat-shaded triangle. PSX: Reduced triangle coordinate integer component precision, and reduced the maximum allowed triangle height to 512; fixes some graphical glitches in "Fighting Force 2". PSX: Added SPU RAM editing(as opposed to simply viewing, as before) capability to the debugger. PSX: Noise mode being enabled on a voice will now suppress ADPCM block flags effecting an ADSR release, per tests on a PS1. March 27, 2012: PSX: Revamped SPU IRQ to fix lockups in "Eithea". Tests need to be run on a PS1 to make sure the fix is correct, but the fix is derived from plausible hypothetical behavior. PSX: Added emulation of some bits of the SPU status "register" at 0x1F801DAE. March 21, 2012: PSX: Brought SPU DMA timing closer to what it is on actual PS1 in game usage cases(more accurate timing than this will require significantly more SPU emulation work). This should fix sound glitches in the "Legend of Mana" FMV sequences. March 20, 2012: PSX: Reverse OT clear DMA is now emulated as halting the CPU, per tests on a PS1(though further tests are needed, the DMA controller "halting" is likely more complex than simply halting the CPU unconditionally while the DMA runs; and even in a C program, the halting effect does not occur immediately, but is slightly delayed, which is not emulated). PSX: Improved CDC DMA timing slightly. PSX: Bit 28 of a channel control register is now cleared on DMA completion of that channel, per tests on a PS1. March 19, 2012: PSX: Mute/Demute is now implemented for CD-XA playback as well as CD-DA playback. PSX: SPU control register bit14(mask 0x4000, the mute bit) no longer affects CD audio output, per a test on a PS1. March 4, 2012: PSX: Added emulation of SPU registers available at [0x1F801E00, 0x1F801E80). February 29, 2012: NGP, VB, GBA: Implemented minor optimizations for when running on PowerPC. February 28, 2012: PSX: Added support for running on big-endian hosts, and added PowerPC-specific optimizations(AltiVec IDCT for MDEC, and load/store byte-reverse instructions via inline assembly for memory accesses). A 1.42GHz PowerMac G4 system is more than fast enough to play PSFs(especially with the idle loop detection speed hack added earlier), but is much too slow to play games at full speed. February 18, 2012: NES: Fixed Famicom Arkanoid controller emulation, thanks to raz0red for reporting that it was completely borked. February 16, 2012: Fixed a compilation problem with gcc 4.7-prerelease, reported by belegdol. Feburary 11, 2012: PSX: Fixed a mnemonic typo in the disassembler for "sltu", thanks to zeromus for reporting it. February 6, 2012: PSX: Altered DMA abort behavior to try to prevent lockups in some games. February 5, 2012: PSX: Fixed a potential buffer overflow crash when playing a PSF if the PSF tries to enable GPU video output. PSX: Added a simple idle loop detection speed hack to the CPU core, used only during PSF playback. PSX: Removed the InBDSlot variable, rolling its functionality into an interpretation of the lower 2 bits of the "new_PC_mask" variable. February 3, 2012: Fixed a spelling error in a 3D mode setting in vb/vb.cpp Added some missing typecasts in src/file.cpp. January 31, 2012: Fixed a bug in the interpolation pixel shaders code that could cause a shader compilation error on some OpenGL implementations. -- 0.9.19-WIP: -- January 28, 2012: Added workaround for questionable header changes with libcdio 0.83 and newer. January 25, 2012: Fixed "x" and "y" .videoip settings not working properly with screen rotation(though the fix is a bit convoluted, in the future it may make sense to completely re-evaluate how destination rectangles and rotation are done). Re-added "ipxnotysharper", "ipynotxsharper", and "ipsharper" pixel shader settings. Fixed interpolation-pixel-shader algorithm texture coordinate evaluation. January 24, 2012: Re-added "ipxnoty" and "ipynotx" pixel shader settings, to compensate for the removal of the extended videoip settings. Fixed "x" and "y" .videoip settings to work properly in full-screen mode. PSX: Added default mouse button assignments for emulated mice. PC-FX: Fixed a crash when selecting the "RAINBOW" layer in the debugger's graphics viewer. (Note that viewing the RAINBOW layer via this manner is still not supported; IE there's just empty space when the layer is selected in the graphics viewer). January 23, 2012: WonderSwan: Fixed a reset initialization bug(due to a design flaw) that was partially corrupting internal and external EEPROM. PSX: Added emulation of LWL and LWR load delays, and emulation of LWL and LWR diversion of the register writeback stage of a previous instruction's delayed load. January 22, 2012: libcdio version information is now printed out on startup. January 21, 2012: PSX: Added mouse emulation. Changed how physical mouse events are processed, removing a potential thread-safety issue with some SDL functions, and ensuring that a very quick mouse button press and release registers as pressed for at least 1 frame, as far as command processing and virtual input device emulation go. January 20, 2012: PSX: Added default keyboard button assignments for emulated digital gamepad 1. PSX: Worked on multitap emulation some more. PSX: Corrected gamepad and memcard emulation, to only respond when the first communication byte is 0x01 or 0x81 respectively, rather than masking the byte with 0x81 and then testing, which is apparently incorrect based on real system testing. January 19, 2012: PSX: Began adding multitap emulation. Fixed broken emulated input device selection command keys for ports 6, 7, and 8 January 18, 2012: PSX: Front port I/O changes: Masked values written to control and mode registers to match tests on a real PS1. Corrected RxD bit status when no device is driving it(was 0, should be 1). Added emulation of DSR status bit to reads from the status register(though DSR emulation is totally kludgy at the moment, need to fix it up in the future). Added emulation of interrupt status bit to reads from the status register. Added emulation of memory card insertion detection bit, that is apparently set when the memory card receives power after being off, and is cleared by issuing a (successful?) write. Attempted memory card block reads from beyond the end of the memory card will now fail as tested(granted not extensively tested for multiple beyond-end address values) on a real PS1. The high byte of the read address specified in the memory card read command will now be echoed back in the following byte sent back to the PS1, as per tests on the real PS1(previously in Mednafen, that byte was just being sent as 0x00). The receive buffer byte is now duplicated across all bytes of multi-byte reads of the data port address, as on a real PS1. Began adding analog gamepad support; though, the current front port SIO device interface is a bit clunky, so probably no more emulated devices will be added until that can be improved. PSX: Removed asserts on MFC0 from a debug register; a warning message will still be printed if a debug register is written with MTC0, however. Fixed a bug that could cause an assert() to be thrown with small effective y-scale values on certain types of multires video frames, thanks to Speedvicio for reporting it. January 17, 2012: PSX emulation module compilation is now enabled by default in the configure script. PC-FX: Fixed a lack of updating a cached copy of the debugger-editable KING register "ADPCMCTRL" on edit. Added a rudimentary test in the configure script to determine if "-fno-strict-overflow" or "-fwrapv" should be used (in regards to gcc 4.2.x generating bad code for -fno-strict-overflow). Updated list of gettext translateable source code files. January 16, 2012: PSX: Fixed emulation of bit7 of SPU control register, it actually appears to control the reverb algorithm writing into the reverb work area, rather than setting the inputs to 0 as it was emulated before. Fixes music corruption in "The Roots" demo, music playback in "Vib-Ribbon", and possibly minor sound glitches in other games as well. PSX: CD audio data is now written to SPU RAM without SPU output CD volume being applied, fixes course generation in "Vib-Ribbon". Implemented support for mapping command keys(hotkeys) to mouse buttons; it was partially implemented before, in that the command key configuration process allowed you to select mouse buttons for a command key, but the mouse buttons had no effect in actually triggering the command. January 15, 2012: GB: Added GB system type selection via "gb.system_type" setting. Sound emulation nuances have changed from the previous default, such that DMG games will select emulation of the DMG sound hardware whereas before they selected CGB sound hardware. To achieve the previous behavior, set the "gb.system_type" setting to "cgb", though note that in a future version this setting may change color and palette selection as well. January 13, 2012: Corrected a wrong argument type in an error reporting function in drivers/shader.cpp, which should fix compilation issues with certain OpenGL implementations. PSX: Removed erroneous coordinate check in line-drawing code that was preventing 1-pixel-long lines from being drawn, and fixed a divide-by-zero issue that removing the check caused. Port cache is now cleared on game close; has no practical effect on stock Mednafen, but needed for ports that allow for more than one game loading per instance, to prevent problems with netplay and state rewinding. PSX: Refined GPU status port bit28 emulation, per tests run on a real system(it's a bit weird and inconsistent). PSX: GPU polylines now require at least one line segment(two vertices) to be specified before the termination code is honored, per tests on a real system. January 12, 2012: PSX: Fixed a problem with shaded polyline end code evaluation, fixes startup lockup in "Codename: Tenka". PSX: Fixed GPU flipped sprite drawing, the starting coordinates were being set incorrectly as to how a real GPU apparently works(and how a real GPU apparently works is kind of wonky compared to sprite flipping on older consoles!). PSX: Sprites are no longer dithered, per test results run on the real thing(though only with commands 0x64 through 0x67, it's possible that the others couuuuld be different, more tests will be run). Fixes the motion-blurred running scene in the beginning of "Silent Hill". January 11, 2012: PSX: Improved GPU FB Read, FB Write, FB Copy, and FB Fill command emulation(particularly coordinate and size masking; and doing mask bit handling for FB Copy, which fixes FF8 battle transitions), based on tests run on a real system. January 8, 2012: PSX: Fixed IRQ idle and FIFO room bits, fixes graphical update issues with "The Roots" demo. PSX: Made OT clear DMA occur over time instead of instantly. Fixed a deinterlacer bug that would cause a stale field to be displayed for the first interlaced frame after a period of non-interlaced frames. January 6, 2012: More build information is displayed on startup. Fixed a memory leak in the internal message display code. January 5, 2012: Improved PAL region game support, and added rough region autodetection, with a BIOS filename setting for each supported region. January 4, 2012: Fixed multiple issues with the signal handler. January 3, 2012: Fixed temporal blur memory allocation that could lead to crashes with emulated systems that support interlaced video, it was only allocating for a fixed height of 256 when it should have been using the fb_height member of MDFNGameInfo. Fixed problems with the configure script that caused user-supplied CPPFLAGS to be ignored. The Win32 build is now compiled with gcc 4.5.4 20111030(prerelease), and compiled with gcc option "-mstackrealign". December 30, 2011: PSX: Added emulation of coprocessor->CPU transfer delay slots, fixes graphical glitches in "Tekken 2". PSX: Fixed bug that was causing timer overflow flag to be set when it shouldn't be(when in target mode). PSX: GPU CLUT offset wrapping fixed(fixes "Next Tetris"). PSX: Return interlaced mode field in bit 13 of GPU status port reads. PSX: Miscellaneous GPU emulation improvements relating to coordinate precision. PSX: Revamped GPU, SPU, and MDEC DMA, (and GPU command buffering), to run over time instead of all at once. December 29, 2011: Lynx: Fixed EVERON detection emulation, and emulated a hardware bug regarding SCB data reading, the latter of which fixes a graphical glitch in "Joust". Thanks to sage and LX.NET for information and patches. December 21, 2011: PSX: Fixed a typo in the return value calculation for control command 0x10, fixes graphical glitches in "Xenogears". December 19, 2011: PSX: Added backing variables/memory for memory accesses to 0x1f801000-0x1f801023, though their actual functionality isn't emulated yet. PSX: Added dummy SIO(rear serial port) emulation to fix a divide-by-zero crash in Wipeout. PSX: Altered ReadN and ReadS semantics, fixes a lockup in Suikoden II. PSX: CD sector error correction will no longer be attempted on mode 2 form 2 sectors, fixes data corruption and lockup issues with "Final Fantasy Tactics", "SaGa Frontier", and perhaps others. December 18, 2011: PSX: Fixed a problem with line drawing gradient shading, fixes some glitches with lighting effects in "Quake II", "Need for Speed III", and probably other glitches in other games as well. PSX: Altered Mem->GPU DMA completion calculation to take into account the GPU's FIFO, though the FIFO simulation is rather crude; fixes various games that were flickering messes. PSX: Fixed FB write coordinate and size masking to not be braindead(it didn't allow 1024 width or 512 height, which obviously broke games). December 17, 2011: PSX: Improved emulation of SPU control register bit 15, fixes sound effects and music glitches in "Viewpoint", "Mat Hoffman's Pro BMX", and likely other games as well(though "Hydro Thunder" still seems to have issues with garbage sound). PSX: Improved emulation of SPU control register bit 14. December 16, 2011: SMS: Began work on fixing H-counter behavior. December 15, 2011: PSX: Masked FB write coordinates and widths to the bare minimum; not sure if this is totally correct(need to run tests on the real thing), but it fixes a startup lockup in "Crash Team Racing". Revamped internal CD direct reading abstraction, and made several user-visible changes: Removed "cdrom.lec_eval" setting; it complicated internal design, and was a bad decision in the sense that it could promote distributing patches or CD rips that would likely not work properly when burned to an actual disc. Added more proper support for multi-disc CD games; see the CD-emulation section in the documentation for further details. Dropped support for physical CD drives that don't support MMC commands, don't support raw sector reading, and/or don't support raw subchannel reading. December 7, 2011: Added experimental support for enabling linear interpolation on one axis only(via the .videoip setting), that doesn't require FBOs or pixel shaders. December 4, 2011: PSX: Corrected time of FB Y readout offset lower bit versus field bit setting, fixes startup freeze in "X-Men: Mutant Academy". PSX: Made SPU IRQ emulation slightly more accurate. December 3, 2011: PSX: Added a kludge to prevent the GPU from returning busy status on status port reads after DMA to the GPU finishes its simulated run time, to fix major problems with the battles in "Valkyrie Profile". TODO: This kludge will be removed when more accurate DMA emulation is in place in the future. PSX: Reduced triangle vertex x,y coordinate integer precision, fixes missing level graphics in "Tony Hawk's Pro Skater 2". December 2, 2011: PSX: Improved mask bit emulation, fixes text brightness issues in "Dragon Quest 4", and possibly other graphical issues in other games as well. Swapped the lines the scanlines effect is applied to, and removed the OpenGL texture offset hack used when scanlines were enabled. December 1, 2011: PSX: Improved display FB Y readout position emulation, and added support for line skipping and "dfe" functionality when drawing in interlaced mode(it's likely not 100% correct, though). November 29, 2011: Added emulation of the VDP quirk present in the Japanese SMS VDP to fix the graphical glitches in the Japanese version of "Ys"; however, the quirk will only be emulated when the "sms.territory" setting is set to "domestic". November 28, 2011: Replaced the various .pixshader ip* settings with "autoip" and "autoipsharper", and rewrote the underlying "sharper" interpolation algorithm to produce more visually-pleasing results. There is some loss of potential functionality with this change, but hopefully the gained functionality will greatly offset the loss in practice. November 25, 2011: SMS: Reduced FM volume to prevent some kind of overflow clicking in Blip_Buffer(TODO: investigate where exactly it was happening). November 17, 2011: Fixed some code causing compiler warnings in: psx/dis.cpp pcfx/king.cpp pcfx/fxscsi.cpp pce_fast/vdc.cpp pce/vce_sync.inc nes/boards/emu2413.cpp nes/ntsc/nes_ntsc.cpp md/debug.cpp md/cd/cdc_cdd.cpp November 15, 2011: Fixed the broken scanline effect when the screen is rotated when using the OpenGL video output driver. November 13, 2011: Genesis: Fixed left/right gamepad default key assignments, they were backwards for some reason. Changed the default values for .xres and .yres to "0", which will cause Mednafen to use the same resolution as the desktop video mode. Changed the default values for .xscalefs and .yscalefs to "1", and changed the default value for .stretch from "0"(disabled) to "aspect_mult2". Revamped the quick help(via F1) screen, removing the annoying partial opacity and changing colors and layout slightly. Remapped the screen rotation button from "F8" to "ALT + O", enabled screen rotation for all emulated systems, and renamed the "command.rotatescreen" setting to "command.rotate_screen". November 12, 2011: Began adding support for emulated analog buttons/axes to the core and driver code(to be used in the future for additional PSX input device support). November 11, 2011: Implemented a workaround for compiling the unzip code with Gentoo's messed up zlib header files. November 10, 2011: NES: Corrected multiple problems with mouse coordinate translation for Zapper, Space Shadow Gun, Oeka Kids Tablet, and Arkanoid controller emulation, especially with non-default video settings. November 9, 2011: Altered "video.glvsync" semantics slightly, such that a setting of "0"(vsync disabled) will override video card system driver settings in the same way that a setting of "1" will. (In short, it makes disabling vsync via this setting more reliable) November 8, 2011: Added new video stretch modes "aspect_int" and "aspect_mult2". WonderSwan: Implemented experimental setting "wswan.language"; it's only known to affect one game. November 7, 2011: PSX: Made SPU execution slaved to the CDC, to prevent potential edge-case synchronization issues for audio streaming. PSX: Implemented rudimentary CD-XA playback. PSX: Implemented GetLocL CD command. October 30, 2011: PSX: Implemented more of MDEC, to the point where the video in FMV sequences is working to a degree. October 27, 2011: NES: Improved iNES mapper 69 expansion sound emulation accuracy(volume interpretation and channel frequencies were off). October 26, 2011: PSX: Fixed a bug that caused crashing when emulator sound output was disabled. PSX: Fixed missing initialization of a local variable in a GTE emulation function(very curiously, gcc 4.4 optimized it as if it were initialized to zero, and didn't even print a warning about an uninitialized variable being used, but the lack of initialization DID cause a warning and broke the code with gcc 4.6). October 25, 2011: PSX: More GTE fixes. October 19, 2011: PSX: Altered GPU triangle rendering to fix the little problem of invisible walls in "Doom". October 18, 2011: PSX: Corrected GTE MVMA when mx is 3(it has very strange behavior). October 17, 2011: PSX: Improved CPU branch delay slot emulation, fixes a few graphical glitches in "Threads of Fate". PSX: Improved GTE flag emulation, and support for MVMA with the far color vector. October 15, 2011: Fixed a bug that caused crackling and increased CPU usage when using certain non-integer fast/slow-forward speed multipliers. October 13, 2011: GBA: Added GSF-related file extensions to known file extensions list. PSX: Added PSF-related file extensions to known file extensions list. PSX: Disabled memory card emulation when a PSF is loaded. October 12, 2011: CDPLAY, SNES, PSX: Changed several large statically-allocated arrays to be dynamically-allocated to reduce memory usage when those emulation modules aren't being used. Increased the maximum supported sound output rate to 1048576 Hz, JUST BECAUSE. GB: Fixed loading of custom per-game palettes. October 10, 2011: Changed setting and code constraints to increase the maximum supported sound output rate from 48KHz to 192KHz. NES: Altered the resampler to work for output rates higher than 48KHz. Modified Blip_Buffer to use 64-bit types for time-keeping and calculation instead of 32-bit, and extended the precision of the fractional component of the output-to-input rate ratio from 20 bits to 32-bits. This change to 64-bit types also has the effect for allowing for very large buffer sizes with very high output rates. However, if you're using a custom video mode with a refresh rate tuned to minimize juddering and frameskipping, you will need to adjust/recalculate those modes for all emulation modules *other* than "nes", "psx", and "snes". October 8, 2011: NES: Fixed a bug in the MMC5 split-screen emulation that caused a garbage scanline in the intro sequence of "Uchuu Keibitai SDF". NES: Fixed MMC5 32K PRG switching mode. September 29, 2011: Fixed a file descriptor leak in the gzip loading code, and removed usage of dup(). Maximum ROM image size is now enforced in the gzip loading code. September 25, 2011: GBA: Fixed an endian-related bug in the sound emulation code. September 22, 2011: Changed an erroneous memcpy() of an object to an assignment in the MDFN_Surface constructor. SMS: Removed an unecessary memset() that sometimes tried to memset() a NULL pointer. September 5, 2011: PSX: Changed coordinate precision in the GPU sprite drawing code so that the level in "Skullmonkeys" doesn't disappear when your character goes far enough to the right. September 4, 2011: PSX: Added memory card support. PSX: Reworked SIO(for front ports) code, fixes problems with controllers acting totally wonky on some games. August 29, 2011: NES: Fixed potential(in ports) memory leaks in the Game Genie emulation code. August 28, 2011: PCE, PCE_FAST: Fixed an Arcade Card emulation bug that made Garou Densetsu 2 virtually unplayably difficult. August 25, 2011: Added a "close()" method to FileWrapper, and modified the QuickTime and WAV recording code to make use of it. August 24, 2011: GBA: Encapsulated in a namespace. GB: Encapsulated in a namespace. GB: Added a few minor missing variables to save states. PCE, PCE_FAST, PC-FX: Fixed potential memory leak(in ports) in the SCSI CD emulation code. NES: Fixed potential memory leaks(in ports) in the FDS and PPU emulation code. August 23, 2011: PC-FX: Fixed a potential memory leak in the RAINBOW emulation code, again currently only relevant to ports of Mednafen. Refactored and reorganized physical CD and image reading code, and moved utility-type functions, types, and enums into their own namespace, with somewhat more consistent naming, and removal of redundant functions and macros. Fixed a crash when "cdrom.lec_eval" is "0" and a physical data CD is loaded. Fixed potential(in ports of Mednafen) memory leaks in the CD-ROM emulation code. August 20, 2011: PCE, PCE_FAST: Fixed potential memory leaks(in ports of Mednafen, not Mednafen as-is) in HES player code. August 18, 2011: WonderSwan: Fixed an issue in the debugger's disassembly code that had the potential to cause the compiler's linker to error out in certain situations. NGP: Fixed a memory map initialization bug(won't affect Mednafen as it is currently, but may affect ports that load more than one game without restarting Mednafen). Thanks to raz0red for pointing it out. August 13, 2011: Fixed(again) waveform Y coordinate saturation in the music player. -- 0.9.18-WIP: -- August 11, 2011: SexyAL: Added support for reversed-byte-order(relative to CPU endianness) sample formats to the ALSA driver; this will allow for better support for non-native soundcards(such as a little-endian sample format "PC" soundcard plugged into an old PowerPC Mac big-endian system running Linux). SNES: Added support for custom palettes. GB: Added support for custom palettes. August 9, 2011: The "P" subchannel is now simulated along with the Q subchannel in the CD read functions. This shouldn't have any effect on emulation now, as the P subchannel data isn't used by any system emulation code in Mednafen, but it may be used in the future. Improved accuracy of simulated Q subchannel data for pregap areas, in the CD read functions. August 8, 2011: Added path checks to files referenced in CUE sheets and PSF files, controlled(enabled/disabled) via the setting "filesys.untrusted_fip_check". Added untested support for the "POSTGAP" directive in CUE sheets. Added support for specifying absolute file paths in PSF files and CUE/TOC files. August 7, 2011: When loading a state, if the recorded variable/datum size is not equal to the expected size of the variable, it will be treated as missing and not loaded. Removed redundant function "CDIF_GetTrackStartPositionLBA()". Removed mostly-redundant, and inconsistent across disc images and physical discs, functions "cdrfile_get_track_sec_count()" and "CDIF_GetTrackSectorCount()". GB: Fixed coarse instruction timing and flag behavior for several instructions, based on blargg's CPU tests and on code in the VBA-M SVN repository. Fixed a file descriptor leak in the save state preview code, that could cause file descriptor exhaustion if multiple save states are used extensively in one session. Thanks to raz0red for reporting the bug. August 5, 2011: SNES: Implemented RAM cheats and cheat search via the common interface. WonderSwan: Cart save RAM is now available to the cheat engine code(it was supposed to be before, but the code was passing the pointer before it was initialized). Genesis: Updated EEPROM code to newer code from Genesis Plus GX, and fixed most of the EEPROM database entries that were previously broken in Mednafen. August 4, 2011: Genesis: Refactored and tweaked input device emulation a bit to fix input unresponsiveness issues in "Samurai Spirits/"Samurai Shodown". August 3, 2011: Genesis: Revamped 6-button gamepad emulation, and made it actually work. August 1, 2011: Fixed a lack of mutex locks in the debugger's memory viewer when editing memory, that could cause crashes or wrong behavior in certain cases. Began work on supporting comments in the disassembled code in the debugger. July 29, 2011: Genesis: Made H-counter reading less completely wrong, but it's likely still mostly wrong(added a TODO entry for fixing it). WonderSwan: Fixed(made considerably less broken at least!) debugger's fubar branch history(it only took a few years, I guess no one used the WonderSwan debugger much :b). July 28, 2011: WonderSwan: Cleaned up debugger code a bit. WonderSwan: Encapsulated in a namespace. The music player interface's waveform display will now saturate the Y coordinate to the screen boundaries rather than forcing it to the middle of the screen(not sure why it was doing that before, doesn't make much sense). NES: Tweaked the audio resampling algorithms a bit to prevent degraded audio quality on high-amplitude input samples. NES: Corrected audio resampler filter setup debug printfs to use more-correct labels, and added more information. NES: Added AltiVec support to the audio resampler. July 27, 2011: Internal text renderer now truncates text with pixel granularity rather than glyph granularity. July 26, 2011: NES: Reduced fb_height from 256 to 240. GBA: Changed "gba.bios" setting to use Mednafen's firmware path construction semantics rather than specifying a path used directly. GBA: The "gba.bios" setting is now ignored when playing a GSF, fixing GSF playback with a real BIOS ROM image is used. July 25, 2011: PCE_FAST: Changed x86 inline assembly to manually push and pop rbx/ebx, rather than listing it in the clobber list, to work around pedanticness in compilers in certain cases. Added a test to make sure "char" type is signed to "tests.cpp". Added a quick and dirty signed overflow test to "tests.cpp". July 18, 2011: Lynx: ROM image headers are now read out field-by-field rather than memcpy()'ing into a packed struct. July 16, 2011: Genesis: A loaded file with an extension of "md" will now be treated as a Sega Genesis/Megadrive game. July 8, 2011: WonderSwan: Added "Code Segment", "Stack Segment", "Data Segment", and "Extra Segment" logical address spaces to the debugger's memory editor. July 5, 2011: Added highlighting to the instruction disassembly for the instruction that PC is pointing to, to avoid confusion when the disassembly cursor is moved off in step mode from the current PC. Debugger disassembly will now be forcibly resynchronized to PC, in addition to the current disassembly cursor address(currently, only the latter was synched). PCE: Revamped branch history to show the old PC in addition to the new PC, not to add an entry when a conditional branch isn't taken, to show reset and IRQ events/"branches", and to show branch count when repeatedly branching to the same target from the same source with no other branches in-between. These changes necessitated reducing the number of entries in the branch history from 32 to 24. T = timer, 1 = IRQ1, 2 = IRQ2, R = reset. Increased the available area for branch history display in the debugger. Halved the size(and number of bytes displayed) of the memory watch section in the debugger when the disassembly list is selected(and offseted the watch address by -0x80 when the register list is selected). Jun 26, 2011: Replaced the old CPU flag testing code with newer code from libavutil from ffmpeg. Restructured architecture detection code in configure.ac. Jun 19, 2011: Fixed a minor(it's unlikely to have noticeably affected any commercial games) LFO emulation bug in the HuC6280 sound core emulation code, reported by "mic_". Jun 13, 2011: GBA: GSF playback now uses new PSF loading code developed for the PS1 emulation module. Changed the music player overlay to use std::string instead of C-strings. Jun 7, 2011: Fixed a lack of variable initialization in the WAV recording code, which could cause WAV recordings to have an erroneous value in a size field in the header. Jun 5, 2011: PC-FX, VB: Implemented a minor CPU optimization that could cause regressions. TODO: Test games. Jun 2, 2011: Changed "INLINE" #define in the SoftFloat target definition file from "extern inline" to "static inline" to resolve issues user "mziab" reported with gcc 4.6.0. May 30, 2011: NGP: Fixed the "ngp.language" setting to work properly with the non-numeric setting values("english" and "japanese") (previously it was always Japanese language selection for both strings). May 28, 2011: Genesis: Fixed a bug in the 68K emulation core that caused major problems in some games("Instruments of Power", "The Lost Vikings", perhaps others) when running on big-endian platforms. May 20, 2011: PCE: Loading Games Express CD games will now automatically load the Games Express CD Card BIOS; BIOS filename is specified by the new "pce.gecdbios" setting, default value of "gecard.pce". PCE: Added Games Express CD game detection based on CRC32s for the remaining handful of games that the previous method didn't detect. May 18, 2011: Tweaked CD simulated read ahead to read farther ahead, but incrementally instead of all at once as before. April 28, 2011: SNES: Fixed PAL video output size, and frame rate when using netplay. April 27, 2011: SexyAL: Rewrote the channel and format conversion code, now allowing for output channel count up to 8; and, tweaked the ALSA code to work with devices that only support > 2(but code is limited to <= 8) channels. (The Audigy 2's "p16v" sub-device in ALSA can now be used directly by Mednafen) April 23, 2011: Fixed a crash on exit when one audio file(FLAC, WAV, Vorbis, etc.) is used for multiple tracks in a CUE sheet. April 17, 2011: NES, PCE: Fixed relative branch target address 16-bit wrapping in the debugger's disassembler. PCE: Added "SET" instruction to the debugger's disassembler(can't believe it's been missing all this time). April 15, 2011: Fixed "--disable-vb" option to ./configure, thanks to Rakashazi for reporting the bug. April 8, 2011: PC-FX: Fixed debugger's timer register text, and hooked up sound chip register setting in the debugger. PCE: Altered VDC line timing to fix raster effects in "Camp California" and "Shape Shifter". The changed way probably still isn't right, but it's something commercial games are unlikely to rely on anyway(except in maybe those hidden "four-screen" modes), and the previous way WAS breaking commercial games. PCE: Fixed a timing bug in the maximum VDC wait state calculation code(wasn't taking into account VCE-controlled events like hsync and vsync changing state). April 5, 2011: VB: Fixed register 30 state during and after *bsu instructions. Thanks to blitter for pointing the bug out and submitting a patch. PCE: Improved ADPCM emulation based on more tests run on the real system. Fixes a lockup bug in "Hyper Wars". (The changes made have the potential to cause regressions, however, if any are found please report them) Mar 7, 2011: Hackish fix for problems with CUE/BIN disc images(particularly bad with multiple BIN style images) that contain "INDEX 00" statements in the CUE sheet. (Problems ranging from incorrect Q subchannel data for the pregap to wrong track start LBAs) February 12, 2011: PC-FX, MD: Factored the deinterlacing code out of the individual emulation modules and into the core Mednafen code. PCE: Adjusted ADPCM emulation slightly, fixes massive A/V sync problems with "Sherlock Holmes". January 29, 2011: NGP: Masked NGP BIOS syscall code properly, thanks to SANiK for pointing it out. MD: Changed line timings so vertical refresh rates are the same in both 256 and 320-wide modes. PCE: Fixed a Seiya Monogatari ADPCM-related lockup, thanks to Rakashazi for pointing the problem out. January 15, 2011: Began adding PlayStation 1 emulation. January 5, 2011: Fixed "volatile" placement on several pointer declarations. -- 0.9.16-WIP: -- December 31, 2010: PCE: Re-enabled the VDC wait-state-limiting kludge, with some tweaks, to prevent hypothetical emulator crashes. PCE: Added a FIFO to buffer the CD subchannel data. Fixes CD+G playback, which was broken when VRAM access wait stating was implemented. Adjusted a few setting descriptive texts, for the automatically-generated documentation. December 29, 2010: Added setting aliases, allowing old setting names to be used in the settings file(though the new setting name will be saved back to the setting file, not the old name) and on the command line. Currently, settings renamed since December 15, 2010 have old setting name aliases. (Note: This of course doesn't apply to the numerous removed settings since 0.9.15). Renamed settings: frameskip -> video.frameskip glvsync -> video.glvsync (Might want to rename this to video.opengl.vsync or video.driver.opengl.vsync in the future) fs -> video.fs vdriver -> video.driver December 26, 2010: Added "gama" atom to recorded QuickTime files. Added setting "qtrecord.vcodec", and added support for the QuickTime PNG codec. Possible values for this setting are "raw", "cscd", and "png", with the default being "cscd". Added "ftyp" atom writing to the beginning of QuickTime files created. Class-ified PNG writing code, and fixed a bug from when the filesys.fname_* settings were added that broke screen snapshots. Wrote new MS WAV file recording code to replace the old code that relied on libsndfile. This allows sound recording to function even when Mednafen is compiled without libsndfile. December 25, 2010: Fixed various problems with the QuickTime writing code. VLC and the official Apple QuickTime player can now play the files Mednafen produces(though not necessarily the video component in the Apple QuickTime player). open() in the FileWrapper class is now passed with flag O_BINARY if it's defined. Fixes QT recording on MS Windows. Creation and modification timestamps in QuickTime files produced are now filled with the time of recording start, rather than being left at 0. Adjusted the QuickTime matrix calculation used for aspect ratio correction. Added settings "qtrecord.w_double_threshold" and "qtrecord.h_double_threshold". Users on slower systems, or those who are transcoding via full-featured software after recording, may want to set these to 0. December 24, 2010: Mednafen is now compiled with largefile support enabled on 32-bit platforms(Win32 kind of included, its largefile support is...DIFFERENT), though it is currently only necessary for QuickTime movie recording. Added experimental QuickTime movie recording support via the -qtrecord command-line switch. Video data is encoded via the CamStudio codec(this may cause problems for Apple's QuickTime player software, as this codec is typically not used in QuickTime containers AFAIK), audio data is raw. A few auxillary atoms were left out, and may or may not need to be implemented in the future. MPlayer, ffmpeg, and Youtube seem to be able to handle the files produced, though MPlayer has occasional random A/V sync issues(at least for me). The version of VLC I have installed can play the video, but aspect ratio correction and audio playback are broken. Removed the custom MMM-format recording and playback. Added lcm_width and lcm_height members to the MDFNGI struct, to aid in video recording(and perhaps other uses in the future). December 19, 2010: Added "%%" specifier to filesys.fname_* parser. Fixed a couple of deadlock bugs in the signal handler, though the probability of them having been encountered during normal Mednafen use is very low. sigaction() will now be used instead of signal(), if available. Fixed strerror_r() usage(AGAIN, hopefully corectly this time) on non-glibc platforms. December 18, 2010: Renamed settings: nethost -> netplay.host netport -> netplay.port netpassword -> netplay.password netlocalplayers -> netplay.localplayers netnick -> netplay.nick netgamekey -> netplay.gamekey netmerge -> netplay.merge netsmallfont -> netplay.smallfont Updated QuickLZ from 1.2.0 to 1.3.1. (1.4.1 seems to have some kind of a performance regression, at least how it's used in Mednafen), and changed the default value for the "srwcompressor" setting from "minilzo" to "quicklz". December 17, 2010: Renamed settings: sounddriver -> sound.driver sounddevice -> sound.device soundrate -> sound.rate soundvol -> sound.volume soundbufsize -> sound.buffer_time Added filesys.fname_movie, filesys.fname_state, filesys.fname_sav, and filesys.fname_snap settings. These settings contain a format string, and through manipulation of this format string, the previous functionality of "dfmd5", filesys.*_samedir, and "snapname" settings can be obtained. For example, remove the "%M" specifier to simulate setting the "dfmd5" setting to 0. Available specifiers: %b - Mednafen base directory (no trailing slash) %z - Path separator %d - Loaded file base directory("/games/nintendo/megaman.nes" -> "/games/nintendo") %f - File base("/games/nintendo/megaman.nes" -> "megaman") %F - Same as %f, but replaced with emulation module's short name with recognized multi-CD CD sets. %m - MD5 hash of the currently loaded game. %M - Empty for first evaluation per full path construction, then filled with the game's MD5 hash(or the game set's MD5 hash ID for multi-CD CD sets) followed by a period. %e - Loaded file extension("/games/nintendo/megaman.nes" -> ".nes") %s - Current emulation module's short name. %p - Special parameter(usually a number/numeric counter). %x - Default extension for the file type the path will be used for(extension is WITHOUT the period). %X - A merging of %p and %x(replaces the last character of %x with %p). If the constructed path is relative, it will be appended to the Mednafen base directory and value of the filesys.*_path settings automatically. If the constructed path is absolute, this appending will not occur. Removed setting dfmd5. December 16, 2010: Removed the filesys.*_samedir settings, as they're largely unnecessary, can cause file corruption in certain cases, and generally cause filesystem clutter. Removed the "snapname" setting(it's now hardcoded-on, effectively), and altered the snapshot naming template to produce filenames that will be sorted correctly when in a list(IE in a file browser). NES: Added hashes of alternate VS SMB and VS The Goonies ROM images into the internal VS Unisystem database. NES: Cleaned up palette-handling code, and updated the VS System palettes. December 15, 2010: NES: Added rudimentary bus conflict emulation to mapper 3, to fix corrupt graphics in Cybernoid. Removed the "pce.colormap", "pce_fast.colormap", "nes.cpalette", and "gba.colormap" settings. Custom palettes will automatically be loaded if they're named "pce.pal", "pce_fast.pal", "nes.pal", and "gba.pal" respectively, under the "palettes" directory under the Mednafen base directory. All of these systems can now use custom per-game palettes by name a palette file as .pal or ..pal, IE "Mega Man 4.pal" or "Mega Man 4.db45eb9413964295adb8d1da961807cc.pal". Using the form that includes the MD5 hash is preferred, to prevent conflicts between games on different systems with the same filenames, and conflicts with the custom palette for all games on an emulated system. Renamed path_snap, path_sav, path_state, path_movie, path_cheat, path_palette, path_firmware to filesys.path_*, changed the interpretation of the path so that if the path is relative, it is relative to the Mednafen base directory, and filled in the default values for these settings as the Mednafen default directories("sav", "mcs", "mcm", "snaps", etc.). Changed the directory used for custom NES palettes from "gameinfo" to "palettes", since that was the only thing the directory was being used for. Changed MDFN_Thread and MDFN_Mutex structs to forward declarations. December 13, 2010: Fixed a rather insidious bug with the 64-bit little-endian decoding function(bug was due to a misunderstanding of implicit type promotion rules). This fixes some (potential) issues with MMM playback, and RTC clock corruption when loading the GameBoy MBC3 mapper's RTC data from a sav file. Added MasterClock and MasterCycles fields to the MMM format. This change is incompatible with previously-recorded MMM movies. Added MasterCycles setting on the remaining systems. December 12, 2010: PCE: Implemented mid-frame synching and input updating(at this point, it only happens twice per frame, IE only once "in the middle"), although it can be extended to more points very easily in the future if the need should arise. This should reduce input latency by up to 8ms in cases not improved by the previous change(below), and allows "Takeda Shingen" to be playable. Mid-frame sync required a lot of code refactoring and kludging, Mednafen was definitely not designed nor written with this feature in mind, so it's possible some things may be broken now when using the PCE module/emulation; for example, rewinding while movie recording is active might corrupt the movie. Also, mid-frame syncing isn't done while netplay is active, so "Takeda Shingen" will remain unplayable in netplay. PCE: Altered frame end timing slightly to reduce input lag on some games by 1 frame. SNES: Reduced input latency by 1 frame(~16.67ms). If the MEDNAFEN_HOME environment variable is either unset or empty, and the HOME environment variable is unset, and getuid() and getpwuid() are available, the home directory used in consructing Mednafen's base directory will now be obtained from the system password file via getpwuid(). Rewrote most of the speed throttling and frameskip determination code to be cleaner, and made a few minor tweaks to the algorithms. December 9, 2010: Being in the input configuration process will now disable all emulated device input during the process, and until 300ms after it ends. December 8, 2010: PCE: Rewrote the HES VDC initialization HuC6280 assembly code to work correctly with the new VDC emulation accuracy improvements. Fixed a bug that would prevent exiting if physical CD-ROM reading hung, and the exit key was assigned to a joystick button or a mouse button. Fixed an old kludge/bug that caused keyboard input latency for emulated devices(IE not command keys) to be 1 frame(16.7 ms usually) higher than it should have been. PCE: Improved VRAM DMA emulation accuracy, improved wait state emulation accuracy, added kludgy emulation of a CPU VRAM-access dead zone tied to HSYNC(fixes "Star Breaker" locking up when leaving a town), and improved VDC horizontal timing register emulation. -- 0.9.15-WIP: -- November 12, 2010: SNES: Reworked a floating-point compare to work correctly with x87 FPU math on gcc(and probably most 32-bit x86 compilers). TODO: Audit code to find and correct any other instances of similar problematic floating-point code. November 11, 2010: MasterCycles field of EmulateSpecStruct is now assigned in more emulated systems. November 10, 2010: Genesis: Converted the "md.region" and "md.reported_region" settings to enum types, to allow for automatic document generation for the various values for these settings. Genesis: Fixed various issues that were preventing emulation from working properly on big-endian systems. SNES: Updated the PowerPC code in libco with "blargg_libco_ppc64-5". November 9, 2010: VB: Fixed an endian-related bug with joystick input state decoding. VB: Made the VIP emulation code big-endian-compatible. VB, PC-FX: Made the V810 core's "fast" mode work on big-endian platforms. Genesis: Fixed a major problem with illegal instruction handling; executing a long string of illegal instructions will no longer lock up Mednafen. Thanks to Zombie for pointing out the lockup problem. November 8, 2010: Fixed(hopefully) OpenGL pixel shader initialization error detection. Fixed "supereagle" special scaler crashing when the source surface was large. VB: Added setting "vb.sidebyside.separation", which controls the number of pixels between the L/R view(pixel count is pre-scaling by xscale(fs)), with a default value of 0. Previously, the effective separation for the sidebyside was 16, so if you want to replicate the behavior of previous versions, set this setting's value to 16. November 7, 2010: NGP, SMS, NES: const-ified some const data. NGP, PC-FX, NES, WonderSwan: Fixed various initialization issues(they're not a problem now, but it's done for future-proofing). WonderSwan: Fixed internal EEPROM initialization to not persist across game loadings(this doesn't apply to Mednafen... yet ;)). TODO: Evaluate removing persistence across power events. MDFND_DestroyMutex() now actually frees the memory for the mutex wrapper. Fixed a few initialization and deinitialization bugs in cdrom/cdromif.cpp (thanks to Rakashazi for pointing them out) -- 0.9.14-WIP: -- November 6, 2010: Corrected the last updated dates in the auto-generated documentation files. VB: Uncommented out important save state code that was commented out for debugging purposes(and was accidentally left that way). -- 0.9.13-WIP: -- November 5, 2010: PCE: The timestamp displayed in the debugger is now counted from when a virtual power off->on occurred, rather than the start of the Mednafen video frame. However, the displayed value wrap when it reaches 2^32 due to limitations in the debugger code(TODO: fix in the future). PCE: Fixed default mouse L/R button assignments(they were reversed). (You'll need to delete the Mednafen configuration file for the new defaults to take effect, or reconfigure the mouse in Mednafen, with the correct L/R button assignment) PCE: Fixed a bug that caused the debugger to corrupt Arcade Card state in certain common situations while the debugger was open or breakpoints were enabled. PCE, PCE_FAST: Reworked and fixed the ADPCM code to closer match a real system(based on hardware tests). Previously, ADPCM playback IRQ generation was sooooo wrong. These changes finally fix the broken battle voices in "Langrisser", yay. October 17, 2010: Fixed 2xSaI family filters to not crash; the 2xSaI filter source image data is now from a temporary video buffer created from the original source video buffer, but with padding on all sides to handle 2xSaI's lack of source video buffer coordinate bounds checking. October 14, 2010: Re-disabled physical CD unreadable sector testing code, as it causes too long of a delay at startup. A different solution will need to be found. October 4, 2010: PCE: Optimized debugger PC and opcode breakpoint testing during emulation. October 3, 2010: PCE: Fixed CD register reads with side effects when the debugger is open, and changed PCE_InDebug from bool to uint32, to allow for ++/-- pairs instead of = true, = false, to handle potential recursion. September 30, 2010: PCE_FAST: Fixed a emulator crash in the case that a game didn't initialize MPRs properly. PCE_FAST: Made a small optimization to the HuC6280 core. PCE_FAST: Rewrote a bit of HES playback code so it works at a lower-level, allowing the removal/privatization of some HuC6280 state setting functions. September 29, 2010: PCE_FAST: Fixed a reversed-tile issue with BG drawing on big-endian platforms(thanks to Rakashazi for pointing it out). PCE_FAST: Added 16bpp rendering support. NES: Added 16bpp rendering support. Added 16bpp support to MDFN_Surface and MDFN_PixelFormat. However, most internal components in Mednafen currently can't handle 16bpp, emulation modules included. September 25, 2010: Altered the text for the "sound" setting to better match what it actually does. September 19, 2010: The destination blit rectangle in the video output code now has the lowermost bits of the X and Y coordinates cleared, as a quick kludge to fix potential issues with the VB emulation's "hli" and "vli" video modes. A cleaner solution may be prudent in the future. VB: Added setting "vb.liprescale". Optimized the "hli" video mode drawing code slightly. September 18, 2010: VB: Added setting "vb.3dreverse". VB: Renamed "pbarrier" 3dmode to "vli". VB: Added 3dmode "hli". September 16, 2010: When -force_module is used with an unknown/invalid system, Mednafen will print an error stating so, rather than stating that the file format is unrecognized. If the system is recognized, but the system only supports CDs and the file being loaded is not a CD image, a message will be printed to that effect. September 13, 2010: PCE_FAST: HDS is now used in calculating the screen viewable area position, fixing the "Final Blaster" intro sequence. September 12, 2010: Fixed a significant memory leak in the video output code(the leak would increase every time fullscreen is toggled while Mednafen is running). PCE_FAST: Fixed a benign(in Mednafen as it is now) memory leak. PCE_FAST, PCE: IsSGX variable is now explicitly initialized to 0 correctly. Updated the AX_CFLAGS_GCC_OPTION autoconf macro. PCE_FAST: Renamed various identifiers in the HuC6280 emulator code to avoid conflicting with C reserved identifier conventions. PCE_FAST: Removed unused VDC debug code. NES: An error while attempting to open the file specified by setting "nes.cpalette" will no longer cause Mednafen to crash. SCSI CD: Refactoring and code cleanups. Added various command error condition checks, and corrected various error codes(NEC uses a few nonstandard ASC values). (INCOMPLETE) Specific command fixes for PCE CD: Command 0xD8: If the command is executed with the same address as when it was previously executed, and the previous execution was < 190ms ago, then the new execution is ignored(this occurs regardless if the previous command was ignored). This is more of a kludge than a proper fix, and it is intended to fix the silent CD-DA problem with "Steam Heart's". Specific command fixes for PC-FX: MODE SENSE and MODE SELECT: Added support for block descriptor(incomplete), and the DBD bit for MODE SENSE. Added support for all the mode pages present on a PC-FX(though most don't actually do anything in emulation yet, as I do not know their function or their function is irrelevant at the current level of CD emulation accuracy). Command 0x25: Corrected returned data when PMI bit is set. Command 0x42: Fixed the relative address returned when the address results are expressed as LBA. Command 0xD8: Proper support for play bit. Command 0xD9: Improved play mode evaluation, and play mode 0x1 is no longer erroneously interpreted as loop mode(only 0x4 is). Command 0xDD: The control/adr field is now returned in the data. Command 0xDE: Added emulation of returned data mode 0x03(there was a dummy stub before, to get the PhotoCD player to work). September 11, 2010: Changed hqxx's sole supported pixel format to match the new OpenGL texture pixel format used(in the future, changing its hardcoded pixel format based on an #ifdef MSB_FIRST may be warranted). WonderSwan: Re-enabled(and fixed) debugger's graphics viewer. PCE_FAST: Reduced fb_height from 256 to 242. September 10, 2010: If Mednafen is running with an OpenGL implementation of OpenGL >= 1.2, and is on an x86 or x86_64 platform, it will now upload texture data in GL_BGRA GL_UNSIGNED_INT_8_8_8_8_REV format rather than GL_RGBA GL_UNSIGNED_BYTE. This may need to be tweaked for older video cards. Would it have killed the OpenGL developers to have included a means of querying the fastest formats for texture uploading? September 8, 2010: todo: make sure tblur works right with surface->pitch32 != gameinfo->fb_width and player Converted MDFNGI pitch(in bytes) to fb_width(in pixels). Fixes for incorrectly using MDFNGameInfo->fb_width instead of the surface's pitch: gb gba lynx(was hardcoded) nes ngp pce_fast(was hardcoded) player wswan mmrecord.cpp tblur.cpp Reduction of fb_width to minimum acceptible for the module(the driver-side can still round up to a power of 2 when creating the MDFN_Surface, of course): gb gba lynx ngp pce_fast(required a bit of work in vdc.cpp to eliminate non-visible-area surface rendering) vb wswan September 5, 2010: PC-FX: Implemented an optimization to the FX VCE layer mixing priority evaluation code, that will also allow further optimization in the future. September 4, 2010: NES: Replaced "femms" inline assembly generated when compiling for x86_64 with "emms", as not all x86_64 processors are made by AMD. August 24, 2010: PC-FX: Track numbers in READ TOC(10) are now returned in hex instead of BCD(fixes BIOS handling of discs with a large number of tracks; no PC-FX games are like this, but it may be useful for playing audio CDs or audio portions of PCE CD). The bug was present in 0.8.x, but due to a design decision/bug elsewhere, it didn't cause the BIOS to be unable to play the CD-DA tracks. August 22, 2010: Re-enabled raw MMC command usage for reading physical discs(it had been disabled for debugging purposes). PC-FX: A PhotoCD disc will now automatically be detected as being handled by the PC-FX module. L-EC correction code is now called external to cdromfile.cpp, and with PC-FX/PCE CD emulation, will generate a SCSI error if it fails. August 20, 2010: SNES: Applied a patch from Jonas Quinn to fix a Cx4 emulation bug. VB: Mednafen will no longer automatically recognize files with the ".bin" extension as Virtual Boy games, as the extension conflicts with Sega Genesis/Megadrive. If you have any such files, they will need to be renamed to have an extension of ".vb" or ".vboy". VB: Files with the extension ".vboy" are now automatically recognized as Virtual Boy games. VB: Altered timer emulation to fix digital sound and voice playback in "Virtual Bowling". The change has the possibility of causing regressions with other games, but none were detected in very quick and not thorough testing. August 14, 2010: Cleaned up git.h slightly. -- 0.9.12-WIP: -- August 13, 2010: Updated internal copy of "libmpcdec" library from 1.2.5 to 1.2.6. Updated internal copy of "trio" library to 1.14(I believe the previous version was a pull from CVS between the 1.10 and 1.11 releases). August 12, 2010: PCE_FAST: Added setting "pce.correct_aspect", default value of 1. When disabled(value of 0), no aspect correction will take place(other than in the 10MHz dot clock mode to halve its width), and overscan color will be used to fill in the empty space when in 5MHz/10MHz dot clock modes. PCE_FAST: Corrected aspect ratio when playing HES files. PC-FX, VB: Fixed CPU operand order for FPU subops in the disassembler. VB: Hooked up more debugger functionality. PC-FX, VB: Fixed V810 read/write breakpoints in "fast" V810 emulation mode. August 9, 2010: Mednafen's now compiled with -Wempty-body and -Wignored-qualifiers. NES: Removed a typoed semicolon in sound.cpp. August 8, 2010: Added "math.h" header order inclusion check to "types.h", and fixed a few instances of incorrect #include order. Fixed C68K code generator dependency when building on/for a platform that has an extension for executables(AKA MS Windows). Fixed a structure initialization problem in the input setting generation code that could cause crashing under certain circumstances. Fixed Makefile.am to actually link against SDL(somehow it was working anyway on Linux, probably through an indirect linkage through SDL_net). August 5, 2010: Debugger settings *.debugger.disfontsize and *.debugger.memcharenc are now automatically generated, the latter based on the system's DebuggerInfoStruct. Renamed *.debugger.memcharset settings to *.debugger.memcharenc PC-FX: Added settings "pcfx.input.port1.multitap" and "pcfx.input.port2.multitap". These settings shouldn't be enabled by average users. August 4, 2010: PC-FX: Added RAINBOW buffer data to save states. Added a variable to save states whose absence was breaking save states made in the middle of a CD-ROM transfer. Switched to using the internal copy of Tremor to decode Ogg Vorbis files during CD emulation preferentially over libsndfile, as libsndfile has an unacceptably slow seek implementation for Ogg Vorbis. August 3, 2010: PC-FX: Added emulation of the 2 gamepad switches. Fixed a bug that caused a crash if input type of "none" was selected for a virtual input port. Input device state is now saved in save states(missing a call before). Fixed mouse emulation(previously, cursor movement was totally broken). Disabled various debug printf statements. Removed "bios.fastboot" setting and the HuEXE loading code(both of which have been broken for a while). The fastboot code likely won't return(it'd be better as an external patch to the BIOS ROM image), and the HuEXE loading may return when PIO emulation is added(requiring the use of the PC-FXGA BIOS most likely). August 2, 2010: PC-FX: Fixed the horizontal position of the VDC layers vs KING BG and RAINBOW layers when VDC is in 7MHz dot clock mode. PC-FX: Disabled a few unknown memory address read/write debug printf()s. August 1, 2010: PC-FX: Writing 0 to D0 of KING register 0x40 while a RAINBOW transfer is in process will now abort it. Fixes background flickering in "Tonari no Princess Rolfee". PC-FX, VB: Values written to system registers EIPSW, FEPSW, EIPC, and FEPC by instruction "ldsr" are now masked properly. PC-FX: Added emulation of the TIMER TIREQ bit. PC-FX: Interrupt controller level/priority register writes are now ignored unless all 7 bits in the interrupt mask register are set. This matches tests done on a real system(done by writing the priority registers, and then reading back the values; wouldn't catch the case of there being shadow registers, however, given that this ignoring behavior is documented in the hardware documentation, this seems highly unlikely). This *finally* fixes the PC-FX BIOS PhotoCD player! PC-FX: Fixed interrupt controller register value masks. July 31, 2010: PCE: Removed a (mostly benign) debug addition left in the extended SF2 mapper size calculation code. July 30, 2010: NES: Removed/Disabled some debug(not debugger :b) code. NES: Fixed the FDS written-disk shadow copy code. Previously, the FDS loading code was updating the MD5 hash improperly, causing the filename of the shadow copy to be different when it was written than it was when a shadow copy was to be opened. NES: Altered FDS IRQ emulation to fix "Druid". NES: Fixed a bug that caused the entire file pathname to be evaluated when determining system type, now only the filename is examined. NES: Added strings "(Europe)", "(Germany)", "(USA)", and "(Japan)" to the filename scanning code for system determination. NES: Prettified the NES filter.cpp debug printf()s a little. PCE: Fixed HES player screen dimensions. PCE: Removed debug printf on bad opcode execution. PCE: HES playback code now initializes the VDC horizontal and vertical timing registers before calling the song initialization routine. Interestingly, this seems to have broken the Cosmic Fantasy IV HES, but that it even sort-of worked in the first place was probably a fluke given the quality of the rip... PCE: Altered HuC6270 reset code to reset the horizontal and vertical timing registers to 0(which is closer to the real system than setting them to 0xFF, but real reset values are unknown, though they might just be 0). PCE: When in LFO(FM) mode, excessive playback frequency for channel 0(carrier) is handled more gracefully(but still not "correct", as it would be too CPU intensive). PCE: Rolled the LFO counter into the normal channel counter. On a real system, the LFO counter(pre-divider) and the normal channel counter may be resetable independently, however, rolling them into one shouldn't cause any audible differences and simplifies the code(and fixes a bug due to how it was implemented before in that if the modulator channel's volume was in the audible range, the waveform would have been distorted for larger LFO pre-divider reload values). July 25, 2010: Fixed Ogg Vorbis playback when libsndfile doesn't support it(I'd accidentally inverted the ov_open() success test during the change to AudioReader()). PCE: PSG channel numbering in the debugger's memory editor is now from 0 instead of 1. July 24, 2010: Fixed libsndfile linkage with mingw32 target(it was broken when we added --with(out)-libsndfile configure option). July 22, 2010: PCE: The 2MiB of arcade card RAM is now defined as an array that's allocated along with the ArcadeCard object, rather than a pointer that's manually allocated off the heap. PCE: Added support for HES files that load data into banks 0x80-0x87. PCE: Fixed HES controls(song increment/decrement) to not lose responsiveness if the frame is being skipped. July 21, 2010: PCE: Added a setting to select the PSG revision, "pce.psgrevision". PCE, PCE_FAST, PC-FX: Added revision selection functionality(only supporting HuC6280 and HuC6280A revisions currently) to the PSG emulation code, and altered the volume table slightly to mimic the PCE's actual volume reduction limits. Also, hooked up the PSG register setting code for the debugger. July 17, 2010: PCE: Fixed inconsistencies in how an emulated "power toggle" affects timestamps, correcting a failed assert in the CD-ROM emulation code if the user tries to reset/power in the debugger under certain conditions. (TODO: Make similar fixes to PC-FX emulation code) PCE, PCE_FAST, PC-FX: Revamped and refactored PCE PSG core code to implement new details obtained through tests on a real SuperGrafx(HuC6280A) and on a PC Engine(HuC6280). However, the emulation is closer to the HuC6280A revision. It may be necessary in the future to run tests on a PC-FX to determine what differences, if any, are in its PSG core vs the HuC6280A's sound core. July 10, 2010: PC-FX, PCE: SCSI CD-ROM emulation code cleanup and minor tweaks. July 7, 2010: PCE: Improved mouse emulation greatly; previously, emulation of two buttons was missing. The two newly-emulated buttons "Select" and "Run" are mapped to keyboard keys "Tab" and "Enter" by default. However, the L/R mapping may be backwards, and there are still problems with using the mouse with at least one game("Lemmings"). July 5, 2010: Fixed a temporal blur code bug that was causing an unblurred section of the screen on PCE games. Renamed the .vblur* settings to .tblur* (for temporal blur) to reduce confusion. July 3, 2010: PCE: Adjusted DMA timing again to fix an extremely long delay at the beginning of Takeda Shingen(TODO: make sure the delay doesn't exist on a real PCE). The core CD reading functions now always put CD-DA data in the buffer in little-endian form. Separated and refactored the audio format decoding code out of cdromfile.cpp into audioreader.cpp July 2, 2010: PCE_FAST: Scrapped the old arcade card code in favor of the modularized code from the "pce" emulation module. PCE: Moved arcade_card.* to hw_misc/arcade_card/arcade_card.*, and made its save state section names more verbose. July 1, 2010: PCE_FAST: Corrected the aspect ratio. PCE_FAST: Scrapped the old PSG code in favor of the new modularized PSG code already being used by the regular "pce" module. June 27, 2010: PCE: Fixed PRAM poking in the debugger to not allow unused bits to be set. June 26, 2010: GBA: Including a line containing "rtc" in the save-game "type" file(refer to the GBA module documentation) will now enable realtime clock emulation for that game. June 22, 2010: SNES: Hooked up backup memory loading. Fixed the "autosave" option to work instead of causing a crash on exit. June 21, 2010: The IPS patch loading code now checks for file read errors, and is no longer tolerant of IPS patches that end without an "EOF" patch/chunk header. Removed support for automatically patching with compressed IPS patches, as it causes a problem with at least one patch that has semi-hidden PKZIP-format data in it that was confusing the file loader. June 20, 2010: SNES: Hooked up multitap and mouse input emulation code(you'll need to manually enable multitap by setting "snes.input.port2.multitap" to "1" because it can cause problems if it's enabled by default. SNES: Updated to bsnes v0.59(for SA-1 and SuperFX save state support). June 17, 2010: NES: Added cart WRAM to mapper 18 emulation to fix "Jajamaru Gekimaden". PCE: Altered VRAM-to-VRAM DMA operation to fix Ankoku Densetsu/Legendary Axe II(and without breaking Langrisser), though stage 5 in LAII/AD may still randomly have graphics corruption in certain conditions. June 11, 2010: PC-FX: Fixed a bug that caused only half of the VDC BG tiles to be displayed in the debugger's graphics viewer. Fixed segfault on 0-entry setting enum lists. Wrote some simple PHP scripts to automatically generate portions of the individual emulation module documentation based on templates and the settings definition file produced by -dump_settings_def. Added a command-line option "-dump_settings_def", which will dump definition data for all possible settings in Mednafen. June 8, 2010: PCE: Adjusted VDC VDW start timing to fix vibrating screen in World Court Tennis. June 7, 2010: PCE: Fixed "pce.h_overscan" setting to actually work right. PCE: Fixed screenshot width. June 6, 2010: Finally got rid of the old FSettings global, moving SndRate to SoundRate of EmulateSpecStruct. Video frames are now recorded before temporal blur effect is applied(rationale: external movie encoders will have a wider variety of filters, whose quality and parameters are not constrained by being able to run in realtime). June 5, 2010: CDPLAY: Fixed a crash if playback when past the last audio track, and the last audio track was not the last track of the disc. PCE: Added more missing data to save states. June 2, 2010 PCE: Altered vblank IRQ start timing to fix occasional massively-glitchy frames in Street Fighter II. PCE: Fixed a bug that could cause a crash(due to an incorrect parameter to memcpy()) if trying to load a large ROM image(>= 2MiB) that was not padded to the Street Fighter II mapper size. PCE: Fixed missing intialization of many VDC variables on reset. PCE: Added support for a hypothetical extended Street Fighter II mapper. June 1, 2010: Revamped CD-ROM system determination code. PCE: Altered VDC BXR/BYR latch timing again to fix Seiya Monogatari, and probably breaking another game in exchange though. :/ PC-FX: Fixed a problem caused by V810 optimization changes that broke CD ROM emulation in save states. Fixed loading of game cheats when loading a CD game(PCE CD, PC-FX). May 31, 2010: PCE: Added a few missing variables to save states. May 29, 2010: Fixed a bug that could cause crashing on invalid save states(or with a state variable name >= 128 chars in length). NES: Added a few missing sound variables to save states, and added a missing CPU state variable to save states that could cause netplay desync(unlikely, but still possible). PCE_FAST: Fixed broken frameskip behavior in regards to sprite overflow IRQs(which caused netplay desyncs). PCE_FAST: Added missing variables to save states(whose absence caused netplay desyncs). May 26, 2010: Made an optimization to the V810 emulation code in order to improve performance on RISC CPUs(TODO: Make sure this didn't break anything). Fixed compiling when the configure script was passed "--disable-debugger". May 25, 2010: Added support for compiling without libcdio and without libsndfile, by passing --without-libcdio and --without-libsndfile to the configure script, respectively. Compiling without either is not recommended for general use of course, but may be of use to porters(especially compiling without libcdio). May 23, 2010: Lynx: Fixed a few pieces of poorly-formed(and possibly undefined) code in the UART emulation code. Fixed an incorrect object creation bug in cdrom/pcecd.cpp SMS: Fixed a couple of strict aliasing violations. GBA: Fixed code causing gcc to issue warnings(listed here in the ChangeLog in the case I broke something, I'll know what did it) in the BIOS emulation code. May 22, 2010: Moved MDFN_Rect typedef from types.h to video.h. Removed an extraneous semicolon after an if statement in the V810 save state code. Fixed a few code constructs causing compiler warnings. Added various macros(to force no inlining, force arbitrary alignment, etc.) to allow for an easier time getting the code to compile on non-gcc-compatible compilers. May 21, 2010: NES: Fixed a bug that could cause Mednafen to crash if the game crashed or intentionally executed off the end of the 16-bit address space without an immediate absolute branch afterwards. VB: Hooked up settings "vb.disable_parallax", "vb.default_color", "vb.anaglyph.preset", "vb.anaglyph.lcolor", "vb.anaglyph.rcolor", and "vb.input.instant_read_hack" to a SettingChanged() notification function so that those settings can be changed during emulation runtime. "vb.cpu_emulation" and "vb.3dmode" are not hooked up, and can not be due to current Mednafen architectural limitations(and even if those weren't present, "vb.cpu_emulation" would still require a virtual power toggle). May 15, 2010: Began work on expanding the information in the setting definition structures, so that the documentation on settings can eventually be mostly auto-generated. Altered the help screen accessible via command-line option "-help" to not display any settings. There are far too many settings to list all at once. Perhaps we'll add additional command-line options in the future to list settings according to a simple filter. May 14, 2010: PC-FX: Added setting "pcfx.disable_bram". Only set this to 1 if you know what you're doing, as it's enabling an illegal/broken state. PCE: Added setting "pce.disable_bram_cd" and "pce.disable_bram_hucard". Only set "pce.disable_bram_cd" to 1 if you know what you're doing, as it's enabling an illegal/broken state. pce.disable_bram_hucard is more useful, as it will make HuCard game run as if they're on a plain-Jane PC Engine/TurboGrafx without CD-style backup memory. May 13, 2010: NES: Moved read/write handler installation from the Power function to the Init function for input emulation, PPU emulation, and VS Unisystem emulation. NES: Corrected the power-up state(values) of internal RAM. NES: Fixed mapper 99 emulation(hopefully, I'm unable to test it currently). Fixed #include order(for config.h, basically) in many files. May 7, 2010: Added a new fullscreen stretch mode that preserves the aspect ratio(at least in the same way that keeping xscalefs == yscalefs does), courtesy of donb04. May 6, 2010: NES: Fixed PPU rendering code to use the real pitch of the output surface, rather than the requested pitch as specified in the MDFNGameInfo struct. This should fix garbled video with "overlay" vdriver in some circumstances. NES: Fixed clear color during PPU startup/reset, such that the screen will no longer be briefly green after a reset using the "overlay" vdriver. NES: Added a (slow) kludge so that the output image is not totally wrong when NTSC blitter is enabled while using the "overlay" vdriver. April 30, 2010: Altered the strerror_r() implementation detection preprocessor code to hopefully work correctly on non-GNU platforms. April 29, 2010: GBA: Fixed a small bug that totally broke GSF loading. PCE_FAST: Added padding to memory mapped into the HuC6280 virtual address space to avoid potential emulator crashes if a game crashes. VB: Implemented more of the debugger. April 27, 2010: Added 2xSaI, Super 2xSai, and Super Eagle scaling filters courtesy of a code submission from "donb04". Fixed fatal bugs in the IPS patching code(the bugs were introduced from the refactoring of the file loading code). Genesis: Removed various debug calls to exit() so that games crashing should no longer cause Mednafen to crash/exit. Genesis: Fixed interlaced mode to not be totally broken. April 23, 2010: VB: Fixed brightness calculation bug that resulted in very dark images instead of completely black images. April 12, 2010: SMS: Encapsulated in a namespace. SMS: Added missing state to save states to fix netplay and movie desynchs. April 11, 2010: VB: Null-terminated the anaglyph preset list. April 11, 2010: VB: Changed nominal width in pbarrier 3dmode to 768. Removed stale build files. April 7, 2010: Removed unused PulseAudio option from configure.ac. Genesis: Encapsulated more code in a namespace. April 6, 2010: PCE_FAST: Changed "inc" instructions to the equivalent "add" forms in inline assembly for better performance. April 5, 2010: Replaced MDFN_FastU32MemsetM8() with code that doesn't violate strict aliasing(at least when an array with 32-bit elements is passed...which is not exactly the case in every place it's called), and with inline assembly for x86 and x86_64. April 4, 2010: VB: Fixed graphics output when "vdriver" is set to "overlay", and "vb.3dmode" is set to "anaglyph". Fixed command-line argument "-force_module" handling. PC-FX: Renamed setting "pcfx.adpcm.restrict_range" to "pcfx.adpcm.emulate_buggy_codec", since it now does more than effectively restrict the range, thanks to David Michel's analysis of an official PC-FX ADPCM encoder. April 3, 2010: Settings are now sorted before being saved to disk. Invalid/Unknown settings are now saved back to the configuration file on exit rather than being discarded. PCE: Fixed input port definitions so that Tsushin Keyboard can only be enabled on input port 1(which reduces the number of input mapping settings automatically generated by about 400). PCE: Multitap emulation is now automatically disabled when Tsushin Keyboard is selected on input port 1(TODO: document this fact). NES: Fixed a few memory leaks in filter.cpp. March 30, 2010: VB: Added a hack, enabled by default, that will return the current pad state when reading from SDR, rather than the latched state, to reduce latency by 20milliseconds in some games. Perhaps remove this option when everyone has 240Hz monitors and we don't have much emulator and PC-caused latency. ;) VB: Fixed input automatic reading code to read 16 bits, not 32. Stupid typos. VB: Changed VB_SetEvent() to take the timestamp of the next event, rather than the number of cycles until the next event. The input code was erroneously calling it with a timestamp before this change, so this change should fix potential input lag issues. March 29, 2010: Factored some cheat management function calls out of individual emulation module code. March 26, 2010: Added support for "enum" setting type. Added support for recognizing integer settings expressed as hexadecimal, with a 0x prefix. March 19, 2010: PCE: Added (untested) emulation of Arcade Card register 0x1AE5, based on information from FluBBa. PC-FX, VB: Fixed "DIV" and "DIVU" instruction emulation when the destination register is "r30". March 18, 2010: VB: Began adding Virtual Boy emulation. March 17, 2010(FIXME/TODO these changelogs): Reorganized sufficiently-abstracted chip hardware emulation into directories hw_cpu, hw_sound, and hw_video. PC-FX: Fixed V810system register "PIR" value. March 16, 2010: PC-FX: Scrapped the old PC-FX-specific VDC code, in favor of the new abstracted VDC code originally written for the new more accurate PC Engine emulation. Removed KING KRAM mode masks(they were pretty much disabled, anyway, and only served to bloat the code). Moved the KRAM arrays to the end of the king_t struct, so that commonly-used variables don't require 1MB+ offsets. Added page setting cache pointers to speed up rainbow and DMA operations slightly. The V810 event handler and memory+IO read/write functions are now accessed via pointers(small speed penalty, unfortunately). Minor V810 optimizations. FINALLY fixed the ADPCM decoding algorithm for the most part(I'm still unsure about loss of precision in interpolation mode, though), removing that ugly hack that ran a DC-bias removal filter on the ADPCM predictors themselves. However, it turns out PC-FX games are somewhat glitchy, so the following settings have been added(implemented as hacks that can improve sound quality over that of an actual PC-FX): pcfx.adpcm.restrict_range (Default: Disabled) Hack that restrict ADPCM predictor to 50% normal range. Can improve sound in some games whose ADPCM was encoded improperly(for example, in Miraculum FMV), but will make sound worse in other games(for example, Nirgends). pcfx.adpcm.suppress_channel_reset_clicks (Default: Enabled) Hack to suppress clicks caused by forced channel resets. This will MURDER those nasty clicks that occur when games reset the ADPCM predictor values when they are off-center. It shouldn't harm anything(except in pathological cases, and even then, only minimally), thus it is enabled by default. However, people developing new code for the PC-FX may wish to disable it for testing their programs. March 7, 2010: PC-FX, PCE CD: Fixed SCSI commands 0xD8 and 0xD9 to work properly when passed a track value of last_track + 1(leadout in this cae). PC-FX: V810 event handling revamp. March 5, 2010: PC-FX: Added untested V810 bitstring search instructions. PC-FX: Fixed the FPU precision degradation flag when an overflow exception occurred(it was never being set, even in cases where it should have). PC-FX: Fixed CY and S flags when an FPU overflow exception occurred(they were erroneously being set in EIPSW, due to V810_Exp() being called before SetFlag()). March 4, 2010: PC-FX: The result of an FPU operation that overflows is now written to the output register(instead of discarded). Additionally, to get the correct value on overflows required hacking the SoftFloat code to "wrap" the exponent on overflows, instead of transforming the value into an infinity. March 3, 2010: PC-FX: Fixed the value returned on reads from the "PIR" V810 system register. PC-FX: Fixed the exception generated when an invalid FP instruction is executed. PC-FX: Scrapped most of the old V810 FPU emulation code, and switched from glibc's FPU emulation code to using "SoftFloat". SoftFloat has a well-defined interface(even if it does pollute the namespace with globals :b), documentation, and has a license that will allow the V810 code to eventually be backported to RealityBoy. The new V810 emulation code also has much more accurate FPU flag calculation and exception handling. February 27, 2010: PC-FX: Fixed TRNC.SW and CVT.SW to set the FIV flag instead of the FRO flag in the event the result is too large to fit in an integer register. PC-FX: Fixed unused variable warnings in the V810 emulator. PC-FX: Fixed lastop variable in V810 emulation code after a bitstring instruction is executed. Fixed bitstring handling so that the emulator won't malfunction if an unhandled/illegal bitstring instruction is executed. February 15, 2010: PCE: Reworked HES playback code to be lower-level. PCE_FAST: Copied more CPU state to local variables in the execution loop. PCE_FAST: Added a "Page1" pointer that ZP and stack accessess now go through, instead of directly to RAM(for the case the game changes what RAM is mapped into $2000-$3FFF). Note that this doesn't have any write protection mechanism, so if a game maps in ROM and then writes to ZP or stack, the ROM data will be trashed. FIXME. February 10, 2010: PCE: Added VCE and VPC registers to the debugger. February 8, 2010: PCE_FAST: Optimized the SuperGrafx VPC mixing code a bit. February 5, 2010: PCE_FAST: Refactored the HuC6280 cycle counting code to reduce CPU usage, and made a simple event system to reduce CPU usage further by factoring timer updates out of the per-instruction execution loop. PCE_FAST: Increased the maximum overclock value accepted to "100", for testing purposes. TODO: Decrease this to a sane value (or not, if 100 will work correctly even with PCE CD emulation) for 0.9.0 final. January 27, 2010: PCE: Removed a bit of preprocessor abuse in the HuC6280 CPU core, and altered the HuC6280 CPU core emulator to not have dependencies on the main PC Engine emulation code. PCE: Fixed CPU reset while in step mode(and a few other related problems) by altering the semantics of the debugger step mode with a pending IRQ. (TODO: This needs to be documented in detail later when my thoughts are more collected) January 25, 2010: Fixed a bug that would cause the emulator to crash if any opcode breakpoints triggered when the debugger screen was disabled and no other breakpoints were active. January 24, 2010: PCE: Encapsulated HuC6280 emulation in a class, and fixed(mostly) the debugger-related code. January 22, 2010: Changed save state format to save variable/array names somewhat like PASCAL strings in the file(maximum 255 bytes per name), instead of a fixed-width field. On save state loading, each of the section definition arrays are now parsed and copied into a std::map, before the data in each section is loaded, changing variable name search algorithmic complexity in the actual loading code from O(n^2) to O(log n)(ignoring any overhead that loading into the std::map incurs). January 20, 2010: Fixed a couple of remotely-exploitable(if connected to a malicious server) stack manipulation bugs in the network play code. January 18, 2010: PCE: Removed settings "pce.ocmultiplier" and "pce.cdspeed", as they break games and cause code obfuscation(especially the overclocking option). They will still be available in the PCE_FAST module, though(with no plans to remove them from it). PCE: Fixed the SF2 bank mask value to prevent invalid memory accesses. PCE: Altered multitap emulation slightly to fix input in "Strip Fighter". PCE: Fixed a bug that was causing CPU cycles to be lost as far as the VCE is concerned due to failing to synchronize the VCE emulation before the timestamp was reset. PCE: Fixed a similar bug with lost cycles in timer emulation. (TODO: Maybe refactor the forced synchronization code so that it's all in one spot instead of scattered about). PCE: Reverted VDC wait states to multiples of the 7MHz CPU clock instead of the 21MHz master clock, as after thinking about it more, I highly doubt the wait states are done with 21MHz granularity. January 17, 2010: PCE: Altered VRAM DMA so that it will only run outside of VDW(or inside if in burst mode), and only when SAT DMA is not in progress. Fixes status bar glitches in Langrisser. PCE: Removed VRAM DMA running shadow variables to fix "Fushigi no Yume no Alice"(setting SOUR to the value of DMA_SOUR, LENR to the value of DMA_LENR, etc. works too, but I prefer the solution that uses the least number of extra registers/variables; to see which way is correct, though, we would need to try to write LENR/SOUR/DESR while VRAM DMA is in progress on a real PC Engine). PCE: Adjusted horizontal line timing slightly to fix a broken scanline in Aoi Blink. PCE: Removed various debug print statements. PCE: Dot clock mode changes will now reset the VCE's clock divider. This is done, in combination with VDC wait states being in 21MHz master cycles, to synchronize the VDC with the CPU when in 7MHz dot clock(and not possibly be in an unsynchronized state dependent on when the dot clock change occurred). This may not be what happens on the real system, but it *shouldn't* hurt anything(commercial games at least), and it should make it easier to get scanline timing right for emulating raster effects without glitches when in 7MHz dot clock. PCE: VDC wait states are now done in terms of 21MHz master cycles(TODO: confirm this is how it is on a real PCE or not). January 16, 2010: PCE: Added a lot of missing VDC variables to save states. PCE: Adjusted horizontal line timing slightly to fix a jittery problem with Shin Megami Tensei. January 15, 2010: PCE: Fixed arcade card state loading(it wasn't saving and loading the ACRAMUsed variable, causing the actual RAM contents to not be loaded unless the arcade card RAM was written to before the state was loaded). PCE: Fixed the end of VRAM DMA code to actually commit any pending reads/writes(fixes an assert() failure in Crest of Wolf). January 14, 2010: PCE: Added a semi-hack to fix VRAM and screen corruption in Asuka 120%'s split-resolution screen. January 10, 2010: PCE: Mostly figured out the Tsushin Keyboard layout, and mapped the best keys on a standard western "Windows key"-style keyboard I could think of to the emulated keyboard. It turns out the keyboard is very similar to later(?) PC-88 keyboards(I used source code from "M88 - PC8801 Series Emulator" as a guide to some of the more exotic keys I was having trouble with). January 9, 2010: PCE_FAST: Fixed CD BIOS loader to look in the "firmware" directory with non-absolute paths. PCE_FAST: Changed the default setting for "pce_fast.cdbios" from a warning string to "syscard3.pce". PCE_FAST: Fixed CD emulation crash. January 8, 2010: Added very basic support for threading functions on the driver side(which right now are just basic wrappers around SDL's threading support). This was done to get the SDL dependency out of the new multi-threaded CD-ROM reading code. January 7, 2010: PCE: Fixed graphics rendering to use the actual pitch of the MDFN_Surface, instead of the hard-coded requested pitch/framebuffer width in EmulatedPCE. Fixed a compilation problem with MINGW in src/cdrom/lec.h SNES, MMPlay, PCE_FAST: Fixed sound emulation to use driver-side supplied buffer. PCE, PC-FX: lastts is now initialized in the PCE_PSG constructor. WonderSwan: EEPROM is now initialized to 0 on startup(it wasn't being initialized at all before). Fixed a bug in the overlay blitting code that was causing graphics corruption on some PCE games(it was essentially assuming the source width was always a multiple of 2). This bug made apparent another bug(reading beyond the source rect width, and possibly beyond the buffer in the worst-case. FIXME.). Overloaded the Open() method of the MDFNFILE class to allow for passing a "std::string" type for the path argument. PCE: Fixed the base path used in CD BIOS loading. PCE: Fixed loading of CD BIOS ROM images with 512-byte headers(broken in the HuCLoadCD->HuCLoad merge). SNES: Fixed compilation with (at least old) mingw32. byuu will include the fix in future bsnes. Fixed link order of libintl and libiconv. Fixed the include dir for config.h in intl/Makefile.in January 6, 2010: Moved the ".forcemono" setting functionality out of individual emulator modules, into the core Mednafen code. The new way will be slightly less efficient, but only when the user changes the setting from the default of 0, and most users PROBABLY won't do this. The benefit is simplification of sound emulation in the emulation modules. (This definitely breaks/changes the music format player's waveform visualization, which we might want to fix in the future) PCE: Merged HuCLoadCD() into HuCLoad(). PCE, PC-FX: Abstracted the core PCE PSG code in a class. The PCE and PC-FX PSG emulation now use this class(but not pce_fast, at least not yet...). PCE: Fixed CD sound emulation(broken in the PCE PSG refactoring). PCE: Stuffed arcade card emulation into a class. SMS: Fixed YM2413 detection(though I'm not sure it's 100% correct, games that can use it actually do use it now). SMS: Fixed an output overflow bug in the YM2413 emulation code. SNES: 15-bit SNES RGB to the host system video format now uses a 32768-entry uint32 LUT, instead of calling the output surface's MakeColor() method for every pixel(which was especially slow in YCbCr mode). SNES: Updated to BSNES v058. January 5, 2010: Added a "slow-forwarding" feature. It's like FAST forwarding, but you go SLOWER. Which kind of goes without saying, but I felt like saying it anyway. It is controlled via the new settings "sftoggle" and "sfspeed", which behave similarly to "fftoggle" and "ffspeed", except that "sfspeed" can be set to < 1 values(the actual range is 0.25 <= value <= 1). Fast-forwarding is activated by the backslash key(I first thought about using SHIFT+BACKQUOTE, but that would probably make Mednafen worse on foreign keyboards, and we don't need any more of that...)...though this will probably break on some Frussiranistanadengia keyboard somewhere. If fast-forwarding and slow-forwarding are activated simultaneously(YOU MONSTER), the fast-forwarding speed multiplier will have precedence over the slow-forwarding multiplier. ...and since we recently moved to resampling the audio post-emulation-module-...emulation, slow-forwarding won't bring inaudible frequencies down to the audible frequency range(since they were already filtered out). This has both good and bad sides, but probably mostly good(so no non-tubular sounds caused by games "silencing" sound channels by setting their playback rates extremely high will be heard). GB: Fixed a bug(still many left) in the external RAM handling code, fixing an emulator crash with "Wizards & Warriors - Chapter X". (I think! TODO: confirm) 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. Lynx, GBA, PC-FX, MD, SMS: Fixed sound emulation to use the driver-side allocated buffer. January 4, 2010: PC-FX: Added more checks to error conditions during fast booting, and cleaned up and added a few error messages. MDFND_PrintError() and MDFN_Message() will now lock a mutex around access to stdout, instead of queueing the messages to be sent to stdout in the main thread. This is what I should have done in the first place... (This change fixes, among other things, dropped status/error messages when CD-ROM loading fails). SMS: Fixed video output, broken during the transition to MDFN_Surface. January 3, 2010: PCE: Fixed broken Soldier Blade title screen by altering the conditions of when D6 is set(TODO: alter/rename VDC_IS_BSY). Finished implementing priorities for emulation modules when loading a game. The priorities are, from highest to lowest: External_high Internal_high (All modules but pce_fast are currently set to this) External_low Internal low (pce_fast is set to this) Added .enable settings(type boolean, default value of 1) for all emulation modules. Setting the setting for an emulation module to 0 will cause that module to not be considered when trying to determine which module to load the game with(it will still be used if explicitly specified via -force_module or -loadcd). Added TestMagic() to Lynx, NES, GG, SMS, SNES. Removed SetSoundVolume() from the emulation modules, it's handled in the core code now, but the emulation modules can handle it themselves if speed is critically important. Removed SetSoundMultiplier() from the emulation modules, sound is now resampled in the main core if fast-forwarding is in effect. However, there still is a provision to handle it in the emulation modules if speed is critically important. The sound buffer emulation modules write to is now allocated on the driver side, but Mednafen still supports the old method of having the sound buffer allocated in emulation modules. Currently, the following modules have been converted to the new system: GameBoy Neo Geo Pocket NES WonderSwan January 2, 2010: Updated the documentation to reflect the additions and changes made between 0.8.5 and 0.8.D. GBA: Fixed a bug that would cause data corruption and the loaded game to crash whenever a state was saved(but the state itself, and loading it, was fine) on a big-endian platform. NES: Removed support for sound quality setting "-3". It's too low-quality(Solstice sounds awful) and is unlikely to give a significant % performance boost over quality -2. December 31, 2009: Replaced more instances of usage of strerror() and "%m" in format strings with usage of the ErrnoHolder class. Lynx: The boot ROM is now loaded through MDFNFILE instead of stdio f*(). PC-FX: ROM BIOS and FX-SCSI ROM are now loaded through MDFNFILE instead of stdio f*(). 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. GB: Fixed colors when "vdriver" is set to "overlay". Fixed strerror_r() usage in error.cpp/error.h 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). If an invalid "sounddriver" is selected, Mednafen will now print an error message and not initialize sound instead of silently selecting the default sound driver. SexyAL: Altered the argument order of SexiALI_Convert() to make more sense. Fixed the broken conversion code used when the frame count passed to Write() is greater than 2048. Fixed a bug/design flaw in the SexyAL SDL sound driver that can cause a crash during program deinitialization. Added support for "float" output format to the ALSA driver. The ALSA driver will now try all formats that SexyAL's conversion code supports if the desired format is not supported by the output device, rather that simply erroring out as before. Added support for converting to 24-bit and 32-bit PCM output formats from the source format(which is still fixed to signed 16-bit). The driver function RawCanWrite() is now passed a pointer to a uint32_t, which it sets to the number of bytes that can be written without blocking, rather than returning the value directly, so that the return value can be used as a success/failure indicator. The driver function RawWrite(), and the "user" function Write(), will now return 1 on success, 0 on (fatal) error, rather than returning the amount of data written. The OSS driver was testing the return value of open() incorrectly. Fixed. SexyAL is now compiled as C++(but doesn't use many C++ features yet), which necessitated adding several explicit casts in various code, and fixing some inconsistent function prototypes and declarations. JACK: Fixed a stereo playback crashing problem(a loop count was being calculated incorrectly). JACK: Switched to using jack_client_open() instead of the deprecated jack_client_new(). JACK: The "sounddevice" setting is now used, to specify the JACK server to connect to. JACK: Fixed a possible race condition in RawCanWrite(). JACK, SDL: Changed the inter-thread ringbuffer setup to be less likely to underrun, while not hurting latency. JACK, SDL: Additional playback position precision is now obtained by using jack_get_time()/SDL_GetTicks(). This will improve Mednafen's performance with larger fragment sizes with these drivers, but smaller fragment sizes are still preferred for latency-to-underrun-occurrence-ratio reasons. Renamed the "byteorder" field of SexyAL_format to "revbyteorder", and changed it to a boolean type, to avoid confusion over what it actually represents. December 30, 2009: Altered autogen.sh to force updates(copy to Mednafen's source dir) of automake standard files. Added usage of the AM_SILENT_RULES macro to the autoconf script, allowing pretty compile output via: ./configure --enable-silent-rules or make V=0 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. Fixed: joystick.cpp:141: warning: format ‘%016llx’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64’ November 30, 2009: Fixed some PC-FX interlaced compile errors(resulting from an earlier effort to fix 0-width source rect blits due to not verifying that the variables for the previous field contained valid data). Fixed a minor typo in NGPGFX_CLASS::reset() GB: Fixed initialization of "HRAM" on virtual power toggle/reset. SMS: Fixed the input and reset emulation when the territory was set to "domestic"(Japan) and FM emulation was enabled; the emulated system was erroneously being treated as a Game Gear in a few places when those conditions were met. November 8, 2009: Reran ./autogen.sh, under Ubuntu 9.10 Reverted drivers/opengl.cpp and drivers/opengl.h to pre-PBO experimentation copies. Fixed incorrect(and excessively complex, old code nearby) usage of MDFNI_DispMessage() in drivers/input.cpp in the input configuration process. Removed archaic and unused(but still being compiled!) files drivers/config.cpp and drivers/config.h. Fixed cases of file I/O return values being ignored in: mempatcher.cpp mmmreader.cpp (not complete) Fixed some strict-aliasing-conflicting code in nes/ppu/ppu.cpp, and somewhat ambiguous parentheses. TODO: Clean it up more. Reverted PC-FX KING/FXVCE rendering/mixing code to pre-black-bias-optimization attempt. It was convoluting the code too much. Before(some of these changes listed below are seriously out of order from when they occurred, development was kind of chaotic and haphazard): Altered the netplay protocol, adding "INTEGRITY", "SERVERTEXT", and "ECHO" commands. Added "/ping" and "/integrity" commands to the netplay text console. CD emulation: Added new multi-threaded CD image and physical drive reading code, with a small readahead buffer. This new code will also allow sector read hints to be given, which should alleviate emulation freezes once we emulate CD seek delays in cdrom/scsicd.cpp. Simplified the base CD reading code, to always fetch 2352+96 bytes of data. Physical CD reads will now read semi-"raw" data(2352 bytes per sector regardless of sector type), along with 96 bytes of subchannel data per sector. extra commands(WIP) requires_medium Added "ErrnoHolder" class, to be instantiated immediately after a function that modifies errno(passed "errno" as the constructor argument). It holds the errno value in a safe place(so future calls to any printf or whatever functions won't change it), and it has a StrError() function, which is essentially a wrapper that will use strerror_r(), or if not available, strerror(), and return a const char * pointer to a buffer internal to the ErrnoHolder class. PC-FX: (August 30, 2009) Fixed stupid ASC value bug in DoPAUSERESUME that broke PC-FX CDDA player PC-FX, PCE: (August 30, 2009) Fixed stupid CD-DA playback volume bug PC-FX: Fixed ADPCM IRQ handling(fixes random lockups in Sparkling Feather during the initial period of FMVs). NES: Changed DMC IRQ emulation to fix "Apple Town Story". NES: Greatly improved FDS sound emulation(thanks to Disch's document, and VirtuaNES source code). The framebuffer that emulation modules render to is now abstracted behind the "MDFN_Surface" class, instead of having naked pointers and various video format global variables out the wazoo. Adding the "overlay" output driver/method necessitated this change, too. Added support for SDL Y'CbCr overlays(USUALLY hardware accelerated). Enabling this video output method can be achieved by setting the "vdriver" setting to "overlay". This is a very experimental video output method, it may not work properly on all operating systems and video cards. Added a special case faster 5x scaler for the "SDL soft" video driver. Added a faster generic integer scaler for the "SDL soft" video driver. 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] Added a (convoluted) compiler bug test to tests.cpp, to guard against buggy gcc versions when compiling with -fno-strict-overflow with optimizations enabled. Added "frameskip" setting to disable internal frameskip for speed testing(because we invariably forget to disable manual frameskip disabling code changes after we're done running tests). Fixed a crashing problem when entering an invalid menu choice("0") in the cheat interface. Thanks to tsenart for reporting the bug. Fixed several instances of mismatches between format strings and passed argument types, which could cause nonsensical information to be printed on big-endian platforms, and perhaps some little-endian platforms as well. Fixed the minimum field-width specifier on the statements that print the loaded game's CRC32 in several places. Added the "format(...)" function attribute to the MDFN_DispMessage(), MDFN_PrintError(), and MDFN_printf() function prototypes to catch format string errors. Changed the INLINE define to always force an inline with gcc(contrast with 0.8.x, where we introduced a new ALWAYS_INLINE in addition to INLINE). ...and added a blip_inline that does the same for Blip_Buffer. ...and changed various "inline" statements to INLINE and blip_inline, where appropriate. TODO: Audit our INLINE statements to make sure we're using them only in speed-critical code and with smallish functions. Looking at Lynx and NES code here especially... NES: Fixed an intialization bug in mapper 193. NGP: Fixed an unaligned memory access bug in the memory r/w handlers, causing crashes on platforms that do not support unaligned memory accesses. Removed erroneous dependency on CD-ROM emulation when WonderSwan emulation is enabled in the configure script. The included Tremor is now compiled with "-fvisibility=hidden" to work around a dynamic symbol collision problem with libsndfile(BUT, -fvisibility is only available in gcc 4.0 and newer). This solution may not be correct... Updated Tremor to the latest SVN version. Upped the minimum playback rate to 22050 Hz, from 8192 Hz. The lower rates aren't tested very often, and the sound resampling code works very poorly at such low rates(not to mention sound quality in general is going to be pretty bad at such low rates anyway). Added sanity checks to the first track number and total track count returned from libcdio, to prevent a crash in Mednafen if the libcdio driver fails and returns nonsensical values. Removed unused file sms/state.h. Fixed a very-old bug that caused joystick unique ID collisions if more than 2 of the same "type" of physical joystick were available. Mednafen is now compiled with -fsigned-char, to prevent any potential problems on systems with an "unsigned" char type as default. Reworked the setting code to use a multimap with a 32-bit key(CRC32 of the setting name) instead of a vector that was iterated over(TODO: Sort settings written to the configuration file). PC-FX: Adjusted the range of the I/O map mirror access range in the memory map, and added emulation of reads from it. PC-FX: Refactored the KING BG drawing code, adding support for BG0 subscreen. Fixes problems with "Angelique Special". (We'll add a simple hack/very limited subscreen code to 0.8.x to fix this problem) PCE, PC-FX: Fixed the emulation of SCSI command 0xDE, mode 0x1. The value returned was too small by 2 seconds. PCE, PC-FX: Fixed the sector count for the last track(which influences the leadout track start position/total sector count) in multi-track CUE/BIN CDROM images. PC-FX: Greatly improved the KING->RAINBOW block transfer logic(previously a hacky buggy mess). Fixes some minor glitches in Zenki. Fixed several problems in file.cpp, including buggy and overly-complicated MDFN_read*le() functions, and a problem with the const-ness of the return value of strrchr() with gcc 4.4. PC-FX: Fixed the exception code set when an FPU divide-by-zero occurs(previously, it was being set to the integer divide-by-zero exception code). PC-FX: Fixed the handler address called when a TRAP instruction is executed. PC-FX: Added boolean setting "pcfx.rainbow.chromaip", default enabled, that controls whether or not the chroma channel of the RAINBOW chip's YUV output(usually used when decoding still full-color or moving images) should be interpolated bilinearly. Turning it off will make the output image appear blockier and slightly less blurry, and closer to what a real PC-FX displays. For a good example of its effect, look at the scrolling red letters in "Kishin Douji Zenki" with it on, and then with it off. GBA: An error loading the custom colormap file is now treated as fatal. Increased the maximum X scale and Y scale sanity check value from 20 to 50. Fixed an off-by-one error in the software SDL graphics rotation code(used for Lynx and WonderSwan). 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 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. Added new entries to "InputDeviceInputInfoStruct" concerning rotated inputs, and removed the Lynx and WonderSwan partially-specific rotation code in drivers/input.cpp 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. fflush(stdout) is now called after printing status messages or errors(may be nominally slower, but should provide more information if something goes kaka on some platforms). TODO: Synchronous error messages and status messages from the game thread, rather than asynchronous. Z80(SMS, NGP, MD): Ported the following changes from the FUSE SVN repository: Unhalt on NMI (thanks, Simon Owen). Changed how firmware is located. Firmware is now searched in several locations, in this order: MEDNAFEN_BASE_PATH/firmware/SYSTEM_SPECIFIC_FIRMWARE_FILENAME_SETTING MEDNAFEN_BASE_PATH/SYSTEM_SPECIFIC_FIRMWARE_FILENAME_SETTING (for backwards compatibility) ...or, if SYSTEM_SPECIFIC_blahblahblah has been set to an absolute path by the user, it will only search there. Also, the firmware path override "path_firmware" setting has been added. Note that setting "path_firmware" to a non-default value will cause Mednafen to only try to open SYSTEM_SPECIFIC_FIRMWARE_FILENAME_SETTING in that path, it won't look anywhere else. TODO: Document all this in the primary documentation. 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. Changed the name of the mednafen configuration file to "mednafen-09x.cfg", to prevent conflicts with 0.8.x and older(when going back and forth). NES: Renamed the misnamed Famicom input device "Quiz King Buzzers" to the correct name, "Party Tap". 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. 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 string constant-to-(char *) problems in drivers/cheat.cpp 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. PCE: Fixed ST0, ST1, and ST2 instruction timings(they were too low by 1 cycle). (Autoconf/automake cleanups and fixes) NES: Fixed "Time Lord" by altering the PPU startup sequence timing. Netplay (New commands, WIP) PC-FX: Chroma keying is now disabled in the 7.16MHz dot-clock mode(the problem that making this change caused with Nirgends before was apparently a bug in the handling of RAINBOW's non-endless scroll mode, which was fixed during optimizations). PC-FX: Made various optimizations: Altered how chip linebuffer transparencies are expressed. They are now expressed simply by the pixel being 0(along with layer number reorganization, the layer number in the upper bits of the internal pixel prevents a YUV-triplet of "0" erroneously being interpreted as transparent). Reworked the VDC layer mixing code to be simpler, and have separate optimized(if the compiler works properly :b) versions for the 4 different VDC 240-color-mode-enable settings. Rewrote pieces of the RAINBOW Huffman decoder to use LUTs. Rewrote the RAINBOW chroma-key evaluation code on suggestion of Exophase, and added several special-case faster versions for common simple chroma-key settings. PC-FX: Modified the ADPCM play back code to use linear interpolation, with respect for the enable bits in the control register, and to use the OKI/Dialogic ADPCM decoder class originally written for PCE CD ADPCM emulation. 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. Added configure script option "--enable-altivec/--disable-altivec (default: enabled)" for compiling on PowerPC architectures where AltiVec is not supported, or causes problems. Fixed a call to putenv(), to pass a static character array initialized to a string constant instead of a string constant directly. SMS: Removed the old unused Z80 emulator code from when SMS Plus was assimilated. NES: Added support for mapper 163(TODO). NES: Added support for mapper 241. PCE, PC-FX: Improved LFO emulation again, fixing vibratto effects in the intro of "Hanii in the Sky". 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. Fixed a few argument descriptions(invoked with the -help command-line switch) that weren't properly gettextized. TODO-itemize? Added Sega Genesis emulation: Based on cgfm2's Genesis Plus. Uses YM2612 emulator from Gens Uses Stef's C68k emulator(still needs more bug fixes for "The Lost Vikings"). Uses blargg's Sms_Apu. Some code based on/imported from Genesis Plus GX. PCE: Revamped input emulation: Individual devices(exluding multitap) are now in their own classes. Added incomplete emulation of the Tsushin Keyboard. Added setting "pce.input.multitap" to allow for disabling the multitap(enabled by default). Fixed a few deprecated const string to char* conversions in: v810_cpuD.cpp:188: warning: deprecated conversion from string constant to ‘char*’ romdb.cpp:21: warning: deprecated conversion from string constant to ‘char*’ (More driver interface changes) GB: Corrected a lack of address masking in most of the cart RAM emulation code. Fixes a few Chinese GameBoy Color games. GBA: Fixed a buffer overflow in the ROM image loading code. NES: (Re?)-added support for mapper 240(it was erroneously listed in the documentation as being supported...). 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) Changed default key assignments for d-pads on emulated input devices from WASZ style to WASD. Altered the save state format and file extensions. Save states made from previous versions of Mednafen will obviously be completely incompatible with this version. (Support for older save states may be readded later...) 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. Added a save state function to the base Z80 emulation code(since the Z80 emulation is now used in 3 places). Added to the global include list in mednafen.h. Moved the multi-byte single-variable decoding/encoding functions from endian.cpp to endian.h as inline functions. PC-FX: Emulated gamepad button presses weren't being decoded from the driver-side data correctly(causing problems on big-endian platforms). Fixed. SMS: SMS pause and 2-player support were erroneously commented out. Fixed. NES: Fixed CNROM emulation initialization bug. PCE: Added the VDC register select register to the debugger. PCE: Reads from the timer count register the cycle it is set to reload after expiring will now return 0x7F. Fixes "Battle Royale". PCE: Rewrote arcade card emulation based on information from David Shadoff, and a tip from Exophase. The ADPCM sound effects in Garou Densetsu II work correctly now. PCE: ADPCM: Combined the two dividers into one. Rewrote the ADPCM nybble decoder. Fixed an off-by-one-nybble playback bug. Altered how the read and write addresses are set. Fixes the Super CD version of "Tengai Makyou Ziria", and "CD Mahjong Bishoujo Chuushinha". PCE, PC-FX: Improved PSG LFO emulation. 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. 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). 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. PCE: Fixed emulation of a few VDC vertical timing registers when in SuperGrafx mode(this change shouldn't affect the released commercial SuperGrafx games at all, but it will fix a few graphical emulation problems when trying to play normal PCE games in SuperGrafx mode). PCE: ADPCM software reset was erroneously also resetting the playback frequency. Fixed. (Fixes ADPCM voices in Gulliver Boy) Added magic testing functions to the MDFNGI structure. Added known file extensions to the MDFNGI structure. PC-FX: KING BG and CG offset registers are now emulated as 8-bit instead of 9-bit. This shouldn't affect emulation at all(these registers were write-only to the game code, and the background rendering code already effectively masked these to 8-bits when rendering), but it will fix potential confusion when using the debugger's register viewer. Also, did the same to the soundbox ADPCMControl register(limiting it to 6-bits, in this case). 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. PCE: Fixed disassembly of the JMP $(AAAA, X) instruction. GBA: Fixed a startup crashing bug on big-endian platforms. Removed unnecessary indirection of sound buffer variables in EmulateSpecStruct. Changed many instances of *printf() and *scanf() to their trio equivalents. Changed instances of fprintf() in mempatcher.cpp to trio_fprintf() to work around major issues with pre-C99 standard C libraries. WonderSwan: Added rudimentary support for playing back WSR(ripped WonderSwan music) files. Cleaned global header files. NES: Replaced the old FIR+Blip_Buffer resampler with an experimental new, all-in-one, polyphase resampler, written with some code and help from blargg. Two new settings were added to control its characteristics: nes.soundq - An arbitrary sound quality setting, default of 0. Higher values will increase sound quality(decreasing passband width and increasing stopband attenuation), while lower values will decrease sound quality. The maximum is 3, and the minimum is -3. Going below sound quality -1 is not recommended nes.sound_rate_error - The error tolerance of the polyphase resampler's output rate versus the real output rate. Lower values will cause the resampler's output rate to come closer to the real output rate, at the cost of more memory usage(and possibly cache thrashing), while higher values will do the opposite. The default is 0.00005. The range is 0.0000001(most accurate) to 0.01(least accurate, will likely cause sound to sound out of tune). Changing this setting is not recommended for normal usage, though it may make sense to set it to its minimum value if you are recording Mednafen's sound output. The setting .scanlines now takes the opacity of scanlines directly, in percent(range 0-100), instead of the old totally-fubar formula. WARNING: THIS CHANGE BREAKS BACKWARDS COMPATIBILITY FOR THIS SETTING IN EXISTING CONFIGURATION FILES AND ANY FRONTENDS OR SCRIPTS. GBA: Cleaned up a few benign shadowed-variables. GBA: DMA registers were being saved as 32-bit arrays instead of 16-bit arrays in save states, potentially causing memory corruption, and broken save states on big endian platforms. Fixed. Abused C++ function overloading to force the SFARRAY16, SFARRAY32, etc. macros in state.h to force a compiler error if they are passed arrays of an unknown/invalid type. Updated GBA, Lynx, NES... to not save invalid types(usually with a typecast to the appropriate type, for union'd types). Added support in state.cpp and state.h for saving/loading bool types properly. Removed the hackish "bool8" type. Changed instances of manual SFORMAT structure creation in a lot of old system emulation code to use the SF* macros instead. GB, GBA: Upgraded Gb_Apu and replaced Gba_Apu(a Mednafen-specific hacked-up ancient version of Gb_Apu) to a newer version provided by blargg, that includes builtin support for GBA's legacy sound channels. This change breaks save states for GB and GBA created in previous versions of Mednafen(though this shouldn't happen again, at least not for updates to the sound code). Added a "fullname" member to the MDFNGI struct. PCE CD, PC-FX: Fixed display of CDROM data tracks in the debugger's memory viewer(it was broken sometime between 0.8.2 and 0.8.4). GBA: The Load() function was returning a largeish integer, instead of 1, after successfully loading a ROM image. Fixed. Removed the "fb" variable from the MDFNGI struct. Renamed "width" and "height" in the MDFNGI struct to "nominal_width" and "nominal_height", fixed NES and PCE emulation code to set nominal_height correctly, and modified save state code to use these variables for generating and displaying save state previews(TODO: rewrite save state preview resize code to resize vertically when DisplayRect.h != nominal_height, though this should never occur at the moment, it may if we add support for systems with selectable interlaced video modes). Removed the save state preview width variable from the MDFNGI struct. Added an fb_height member to the MDFNGI struct. Fixed header include order in the JACK audio driver. GB: Corrected loading/saving of MBC3 time values in save files(this will cause incompatibility with MBC3 RTC save games created in previous versions of Mednafen, unless they were created running on a 64-bit little-endian system). GB: The setting "filesys.disablesavegz" will now affect GameBoy save files. MDFN_DumpToFile() now checks for errors in fclose(). Added preliminary movie(audio+video) recording support to a custom format. A secondary 0.8.6: PCE: Removed a statement, that was used for debugging, that broke PC Engine multiplayer support in 0.8.5. (I'm not sure how it got there in the first place...). 0.8.5: Fixed a crashing bug when loading an uncompressed file and using the automatic IPS-patching feature when mmap() is available. PCE, PC-FX: All SCSI CDROM commands are now logged in the debugger's log viewer(when logging is enabled, of course). Added group support to the debugger's log viewer. PC-FX: Renamed the type of BIOS ROM font calls in the debugger's log viewer from "BIOS" to "ROMFONT". PC-FX: BIOS filesystem syscall(for backup memory access) calls are now logged in the debugger's log viewer. PC-FX: Added internal backup memory and external backup memory address spaces to the debugger's memory editor. PC-FX: In the 263-line mode, line 262 is now reported as being during blanking time(as on a real PC-FX). Fixes the annoying transparency layer flickering and other weird graphical glitches in Der Langrisser FX. Added setting "filesys.disablesavegz", to disable gzip compression when saving save states and backup memory. (In the case of backup memory, disabling gzip compression isn't supported for GB yet) 0.8.4: PC-FX: Some RAINBOW registers weren't being reset on emulated system reset. Fixed. PC-FX: Added dummy support for the external bus reset register. PC-FX: Altered the way garbage data is handled by RAINBOW to fix a graphics bug in the Tengai Makyu options screen. PC-FX: Reworked a large part of the KING SCSI emulation code, and parts of the CDROM device emulation code. Previously non-working-at-all games "Battle Heat" and "Tengai Makyu" work now. The non-anime game mode in "Tyoushin Heiki Zeroigar" works now. "Der Langrisser FX" no longer locks up if you skip the intro movie. "Yuna FX" no longer locks up in one of the intro movies. These changes will cause some save state incompatibilities with previous versions of Mednafen. (Some of the SCSI changes also affect the PCE CDROM emulation, which may also result in save-state incompatibility issues, particularly if the save state occurred during a CDROM data transfer operation.) PC-FX: Added setting "pcfx.cdspeed". If you want to change this, read the documentation first! Cleaned up the video deinitialization code slightly, and fixed a few bugs in the OpenGL deinitialization code. PC-FX: Reads from the dummy KING register 0x07 will now return 0xFF, per the devkit docs. PC-FX: Reads from KING register 0x0B will now return the "DMA end" bit in D0 set correctly(at least, according to the developer docs). Fixed a compilation error after running configure with --disable-nes. PC-FX: Reads from I/O port 0xFC0 will *now* return the current timer counter value. The switch statement mask value was wrong... Removed the warning in the documentation about error correction of raw data track rips, as Mednafen will now perform simple correction using the EDC and L-EC data(since 0.8.4-rc3). This could conceivably cause problems with naive hacks/translations/patches that neglect to update the EDC and L-EC data, so it can be disabled by setting the setting "cdrom.lec_eval" to 0. L-EC correction is based off code from dvdisaster(http://dvdisaster.net/). PCE, PC-FX: Removed some debug printf()'s that were left in 0.8.4-rc3 by mistake. 0.8.4-rc3: PCE: Added preliminary(it works, but the code needs to be cleaned) ADPCM support for HES rips. PCE: Interrupts will be enabled with a CLI after a HES' init routine is called, to fix rips that neglect to do it themselves. PCE: Added support for HES rips that try to write data where it really shouldn't be written(some CD-ROM game rips do this), though a warning will be printed the first time this occurs after loading. PCE: Added sanity checks to the HES loader to prevent crashes if invalid data is present. PCE: Reads from the I/O port will now return D7 as clear when emulating a PCE CD game. PCE: ADPCM RAM is now reset(to 0) on emulated PCE reset. PCE: Sprites trying to pull tile data from $8000-FFFF of VRAM will now be invisible(probably not correct, but trying to emulate indeterminate effects is too difficult :b). Fixes a minor sprite garbage issue in Camp California. PCE, PC-FX: Fixed VRAM DMA source/dest increment/decrement bits(the source and dest were flipped). Fixes a problem with Fushigi no Yume no Alice. Moved some code in the source root directory to appropriate subdirectories. Added setting .debugger.disfontsize, valid settings being "xsmall", "small"(default), "medium", and "large", to control the font size used to draw the disassembly text. Note that there may be overlap with other parts of the debugger at font sizes larger than the default. Refactored a few address space and register group debugger support functions out of individual system code. Fixed various low-impact memory leaks. The version of Mednafen last run is now stored in the configuration file as a comment(this will be necessary for changes in 0.8.5 or later that will involve proper escaping/unescaping and quoting of strings, to prevent problems with extra whitespace added by manually editing the configuration file). Fixed state rewinding on big-endian machines, and removed some unnecessary operations from the state rewinding code path. Mednafen will now refuse to try to load ROM images larger than 64MiB, as a sanity check. mmap() and madvise() will now be used to load ROM images, assuming they're available(UN*X only, generally). Errors during automatic IPS patching are now fatal. Sped up loading gzip'ed ROM images. Removed a global variable from the NES emulation code that had invaded state.cpp. Though, this makes the error message when trying to use save states with authentic Game Genie emulation very unhelpful... GBA: Added support for loading a real GBA BIOS ROM image, using the setting "gba.bios". GBA: Added the ability to specify the backup memory type for games by creating a file with the same name as the ROM image, with the extension replaced with "type", in the "sav" directory under the Mednafen base directory. Example: SexyPlumbers.gba -> SexyPlumbers.type One or more of the following strings(on separate lines) may appear in the file: sram flash eeprom sensor Additionally, the flash size can be specified by specifying the size(real size, or divided by 1024) after the type, like "flash 128" or "flash 131072". PCE: Improved noise LFSR and volume emulation, thanks to cgfm2 for the detailed information. 0.8.4-rc2: Added meaningful descriptions to the command.* settings. PC-FX: Added an experimental feature to use mmap() to create a virtual 32-bit address space to speed up V810 instruction reads. Enable by setting "pcfx.use_mmap" to 1. Of course, it won't work on 32-bit CPUs! Please read the documentation, there are caveats! PC-FX: Removed some redundant logic in the KING BG 8x1 drawing functions. PC-FX: FX VCE and VDC port access are now emulated as 16-bit, as in the real PC-FX, instead of 8-bit. PC-FX: Altered the debugger's memory peek and disassembly functions to not read the emulated memory map in the 0x80000000-0xEFFFFFFF region. (Reading those addresses can cause side effects, and this is a temporary workaround) PC-FX: Changed the V810 memory read handlers to read RAM faster than BIOS ROM. This will probably increase host CPU usage while in the BIOS loading screen, but decrease it in the actual game. PC-FX: Altered the V810 opcode fetch logic to do 16-bit reads instead of 32-bit, fixing potential crash issues when Mednafen is run on CPUs that don't support unaligned memory accesses. PC-FX: Factored-out a few address masks in the memory read and write handlers. PC-FX: Replaced most of the V810 signed-variable bit-size converting code that uses conditional branches to code that uses 2 shifts, taking advantage of modern 2's-complement CPU's arithmetic right-shift capabilities. It reduces generated machine code size slightly, and should provide a slight speed boost as well. PC-FX: Optimized V810 address mode decoding by removing an unnecessary conditional jump. Added an important warning to the documentation regarding Mednafen's ripped CD image support: Mednafen does *not* correct bit errors in the user data of "raw" data track rips. It is strongly recommended to use "cooked" data track rips(2048 bytes/sector for mode 1, not counting any subchannel data) with Mednafen. PC-FX: Improved exception handling, and added untested emulation of the TRAP instruction. Debugger: Rewrote the memory load and dump functions to be faster, and also to fix a bug in the load function that would trash memory if the user tried to load more data than the specified file contained. Debugger: Using the Goto function will no longer cause memory edit mode to be exited. Debugger: Fixed a bug that occurred when entering a prompt(goto, change charset, etc.) while in editing mode, that caused keyboard focus to be misdirected. SexyAL: The ALSA driver will try to set smaller period sizes when lower playback rates are used. GBA: Changed the heuristics used to detect SRAM/Flash usage, though they're still not perfect...if a game tries to use flash memory improperly, it could be detected as using SRAM instead, or silently corrupt parts of flash memory... GB: Fixed sound register initialization on reset, fixes missing sound in A Boy and His Blob GB: Slightly increased the contrast of GBC colors. GB: Reworked blitting of mono GB colors for future features. GB: Removed a redeclaration of a variable in the same scope in a function in gfx.cpp. Debugger: Fixed PCE VRAM breakpoints to work with block memory transfer instructions. Debugger: Fixed parsing of single-address breakpoints after range breakpoints. Mednafen will now print out SDL version information when it starts. (The Win32 build will now be distributed with SDL 1.2.12) Debugger: Fixed -/+ opacity adjustment to not be done when entering text(such as in a dialog). Debugger: Fixed null termination of the ASCII string buffer displayed in the memory watch section. PCE, PC-FX: Fixed the frequency of the highest-frequency noise generation register setting, hopefully! PCE, PC-FX: Changed the LFSR to 16-bit, and to use a maximized tap configuration, to make the noise sound a bit closer to a real PC Engine's(at least, in my opinion! It still sounds slightly more bassy than a real PC Engine, but that might be due to filters on the PC Engine's sound output...). Non-power-of-2-sized-textures will not be used when a pixel shader is selected and enabled, to prevent a severe graphical corruption regression introduced in 0.8.3-beta. I'm not sure if it's a problem with Mednafen's pixel shaders or the graphics card... SMS: Fixed soft reset. SexyAL: Removed smallc.c, and modified the OSS driver to use snprintf() instead of the single function smallc.c provided. SexyAL: "sexyal.h" is now included before all other header files. SexyAL: Revamped parts of the ALSA driver to fix reported lockup issues under certain conditions. 0.8.4-rc1: Added preliminary support for inputting text directly into the selected address space in the debugger's memory editor. Moved the temporal video blurring code in mednafen.cpp to vblur.cpp Added settings "filesys.snap_samedir", "filesys.sav_samedir", "filesys.state_samedir", and "filesys.movie_samedir", default 0, that when set to 1, will read/write the respective files from/to the same directory the game was loaded from. If you want to use these, PLEASE read the documentation first, there are caveats! PCE CD, PC-FX: Added support for MS WAV file offsets and lengths in TOC files. PCE CD, PC-FX: Fixed a bug that caused CD-DA playback to be off by one sector(the first sector specified was being skipped). Began work to allow settings to be temporarily overridden during netplay and movie playback. PCE, PC-FX: Added settings "pce.disable_softreset" and "pcfx.disable_softreset", default 0, which when set to 1 will disable simultaneous pressing of RUN and SEL. The current implementation kind of abuses the driver-side code that disallows opposing diagonal buttons being pressed at the same time, so if we ever change that (undocumented) feature to go with the last-pressed direction rather than clearing both, the description of these settings in the documentation will need to be updated. PCE CD, PC-FX: Read operations and CD-DA playback will now be stopped when the RST signal is asserted(fixes soft reset issues on PCE CD games). 0.8.3-beta: Fixed an OpenGL function typedef in drivers/opengl.h. PC-FX: Writes and reads to the KING and FXVCE chips "mapped" in parts of 0xA0000000 through 0xBFFFFFFF will now go through the respective data port write handlers, instead of directly to KRAM or palette RAM. If non-power-of-2-sized OpenGL textures are not available, and bilinear interpolation or a pixel shader is enabled, and the emulated system resolution changes(such as on the PCE), two lines of black pixels will be written to the texture buffer to prevent the display of multi-colored garbage at borders, though the right+bottom borders will still be slightly darker than they should be... PC-FX: Added support for VDC data port writes via writes to 0xB4000000-0xB7FFFFFF and 0xB8000000-0xBBFFFFFF in the V810's memory map. Fixes major graphical problems in "Super Power League FX". Updated the srwcompressor description in mednafen.cfg. PC-FX: KING BG1-3 scroll registers are now emulated as 10-bit instead of 11-bit(BG0's are still 11-bit), and BG1-3 virtual screen size is now limited to 512x512(BG0 is still 1024x1024), per the official developer documents. Non-power-of-2-sized OpenGL textures will now be used if the "GL_ARB_texture_non_power_of_two" extension is detected. Fixed a bug that sometimes would cause black screens when using the "sdl"(non-default) video driver(SDL surface per-pixel alpha blending was enabled when it shouldn't have been). PCE: Fixed a line clearing bug when BG is disabled that was causing some minor graphical garbage on some games that use multiple horizontal resolutions per frame. Changed some nonsensical #ifdef statements that were intended to always evaluate as false with "#if 0". Renamed SYSTEM_CLOCK to System_Clock in scsicd.cpp to work around a potential macro conflict on OSX. PC-FX: Added partial support for NEC's "scan" SCSI command, used in the BIOS' CD-DA player screen. PC-FX, PCE CD: Revamped parts of the subchannel emulation code. The PC-FX BIOS CD player screen's time display works now. Also, an important note regarding cdrdao "TOC" files and "RW_RAW" subchannel data was added to the documentation. PC-FX: Fixed a bug in the KING BG0 scrolling+rotation code for 16-color and 4-color backgrounds with BATs that was causing graphical corruption in the PC-FX BIOS CD player screen. Fixed a compilation error when --disable-debugger was passed to the configure script. 0.8.2-beta: Added blargg's experimental blz compressor, for use with state rewinding(change the setting "srwcompressor" to use it). (This was added a while back, after 0.8.1, but I forgot to document it) SMS,GG: Added missing default key configurations. PC-FX: Added untested emulation of scaling+rotation in 4-color KING BG mode. PC-FX: Added emulation of scaling+rotation in 16-color KING BG mode. Fixes a problem with the background in the last stage of Zenki. PCE: Added VRAM size constants to the beginning of vdc.cpp, and modified the code to use them, to allow a certain crazy person to compile a custom version of Mednafen which emulates extra VDC VRAM. PCE: Removed 0xEB as SBC immediate in the disassembler(it was left over from the 6502 disassembler). Changed setting type of setting "vdriver" to a string, with possible values "opengl" and "sdl"(and "0" and "1" for backwards compatibility, of course). PCE: Set the default char set in the debugger's memory viewer to shift_jis. PCE: Fixed a missing #include in debug.cpp. 2007-6-17: PC-FX: Improved VCE<->VDC<->KING scanline timing to fix a lockup issue in Anime Freak Vol 4(polling the FX VCE raster counter register vs VDC VBlank IRQs). Unforunately, this change has caused some 1-line graphical glitches in games that do "raster effects". This may be solved once/if V810 emulation has accurate cycle counts, which would require emulating instruction cache and prefetch logic. -_-; Fixed branch traces display in the debugger, it was broken to only display half of them twice sometime since 0.8.1. PC-FX: Optimized RAINBOW JPEG-like decoding by using a static implementation of bit fetching functions(instead of a class). PC-FX: Added untested emulation of the CAXI V810 instruction. PC-FX: The RAINBOW transfer block count register is now emulated as being 5-bits instead of 16-bits, fixes screen issues(blue blue!) after defeating the snake monster in Zenki. PC-FX: If a KING BG is set to BAT+CG mode, but is missing a BAT fetch microprogram, it will now be drawn in CG mode(previously, the BAT data was simply being forced to 0, which was wrong). It's confirmed on a real system. Fixes missing graphics in "Tonari Princess no Rolfee". PC-FX: Fixed transparency testing with 16M color KING backgrounds(only 1 Y component of every 2 pixels was being checked, now both are checked). PC-FX: Implemented back cellophane support. Fixes fadeouts in "Lunatic Dawn", fadeins in "Team Innocent", and screen darkening issues during dialogue in "Last Imperial Prince"(and also exposes a bug that LIP probably has on a real system too, wherein CCR isn't reset to black after the dialogue is over, leaving the upper and lower parts of the screen outside the play area slightly dark greenish). The hindmost color when mixing the layers is now set to palette entry #0, except when all layers are disabled(set to black), or front cellophane(set to black) or back cellophane(set to value in CCR) is enabled. PC-FX: Added emulation of the expansion backup RAM. While not particularly necessary since Mednafen already emulated backup memory separately for each game, it does give a few extra save slots to some games(such as Miraculum ^_^). Added opacity control(-/+) to the debugger. Added an always-on zero page view to the CPU debugger for NES and PC Engine. Reduced the size of the game thread event queue to a somewhat saner size, and added extra buffering so that its mutex is only locked for a minimal amount of time to eliminate the chances of deadlock with this mutex. GBA: Fixed a bug that caused only half of the legacy wave sound channel's sample data to be saved. GB: Updated to Gb_Snd_Emu 0.1.5, fixes hanging note problems on some games, and cleaned up the sound save state code. 2007-5-30: Added preliminary Sega Master System and Game Gear emulation based off of SMS Plus. Factored the remaining state rewinding code out of the individual systems' code. Fixed a minor visual bug when using state rewinding(also with save states, but it's not really visible) with the NTSC blitter. Simplified how state rewind requests are passed to the emulation code, and fixed a small bug when using state rewinding with frame advance(now, a rewind will only occur if the state rewind button is held down while the frame advance button is pushed). Changed a local variable name in selblur.cpp to fix compilation on OS/X(and maybe PPC in general?), thanks to Matt Beaumont for pointing out the conflict with a definition in altivec.h. PCE: Fixed cycle counts for BRA and BSR(they were 1 too high). PC-FX: Reads from I/O port 0xFC0 now return the current timer counter value. Parameters to MDFNI_Emulate() and the internal system Emulate() functions are now passed through a structure, to allow for easier future expansion. PCE, PC-FX: Fixed audio track reading from physical CDs on big-endian platforms. NES: Fixed a bug that caused an emulator crash if Game Genie-style cheats were enabled at the same time as authentic Game Genie emulation was enabled. Added setting "srwframes", which controls the number of save states to keep when state rewinding is enabled. Debugger: Fixed a bug that caused a crash if a PC breakpoint was triggered while the debugger screen was disabled. Added an experimental logging feature to the debugger, currently only used by the PC-FX emulation code, to log CD-ROM read commands and calls to the PC-FX BIOS' glyph bitmap address function, both of which should be quite helpful in translation work... PCE, PC-FX: Moved the mouse sensitivity adjustments to the driver side to fix mouse emulation with network play and movies when using non-default pce.mouse_sensitivity/pcfx.mouse_sensitivity settings. Added a few more entries to the in-emulator help screen. PC-FX: Increased the keyport latch delay, and added emulation of the PC-FX mouse. PC-FX: The keyport data ready flag is now reset only on low reads from the keyport data registers. PCE: Fixed disassembly of the BSR instruction. NGP: Fixed Z80 emulation cycle counts(they were far too low), and fixed emulation of the EI delay. GB: Reworked various things, including Z80 interrupt and HALT emulation. GameBoy emulation will be a bit more CPU intensive now, and save states from older versions won't work with this version(sorry!). These changes could easily break some games, but...at least "A Boy and His Blob" works now! GBA: Changed the file type detection code to reduce the chance of false positives. PCE: Files with the extension "sgx" will now be treated as raw SuperGrafx ROM image files(AKA SuperGrafx emulation will be enabled). NES: Refactored the file type detection code, so that emulation data structures and memory won't be initialized unless it's a recognized file type. NES: NSF(but not NSFE) game/album name, artist, and copyright strings are now trimmed of leading and trailing whitespace. Added MDFN_trim(), MDFN_rtrim(), and MDFN_ltrim() functions. WonderSwan: Fixed a buffer overflow bug in the sprite drawing code. GBA: Flash and SRAM save games are now stored gzip-compressed. PCE: Fixed raw bytes display of relative branch instructions in the disassembler. PC-FX: Added CD-ROM data tracks to the memory debugger/viewer, read-only, however. The selected character set in the memory debugger/viewer will now be saved for that emulated system when exiting. Fixed text search in the memory debugger/viewer(iconv() was being called before the variables passed to it were initialized, oopsie). Simplified the scrolling code in the memory debugger/viewer, the line containing the cursor will now always be centered vertically on the screen. PCE: Fixed an ambiguous if() statement in huc.cpp in the BRAM emulation code. GB: Fixed a semi-ambiguous boolean math statement in the cpu emulation code. Fixed an ambiguous else statement in the throttling code in drivers/main.cpp NGP: Neo Geo Pocket emulation code is now compiled with -fno-strict-aliasing to work around issues in the TLCS-900h code. GBA: Removed unused ELF code. Fixed some implicit conversions of const char * to char *. (stupid putenv() prototype grumble mumble) is now included in "mednafen.h", added notes to README about system header files automatically included, and removed inclusions of such header files in source code files that include mednafen.h(most do, and should). This change was brought about by gcc 4.3...it may not be the best way in regards to compile-performance wise, but it is more convenient and safer than #include'ing the system headers manually(and forgetting to >_>). Modified instances of "Makefile.am" to stop including the top directory in the include search path, and removed the symlink of config.h to include/config.h, and fixed the references to "config.h" in intl/Makefile.in. PCE: Made hes.cpp use MDFN_de32lsb() and MDFN_de16lsb() from endian.cpp. PCE: Changed some instances of free() to MDFN_free(). GBA: Un-inlined the CPUWriteMemory() function. GBA: Rewrote parts of the save-game(flash, eeprom, sram) code to make more sense! EEPROM data is now stored with a file extension "eep". 0.8.1: PC-FX: Added more registers/SetRegister() support to the debugger. Trying to edit a register in a debugger register groups with a NULL SetRegister method will no longer crash Mednafen. NES: Fixed a misnamed save state variable in the FME-7 code. Mednafen will now be compiled with "-fno-strict-overflow" if the C compiler supports that option, for the upcoming gcc 4.2 release, as I'm not sure this optimization is safe with Mednafen's code(it may be, but better safe than somewhat sorry!). PCE CD, PC-FX: Added partial support for cdrdao "TOC" files, including support for rips with subchannel data, but it must be in the "RW_RAW" format. Ripped CD+G CDs can be played back this way in the PCE CD and PC-FX BIOS CD players. 0.8.0-beta: PC-FX: Improved VDC chain/256-color mode emulation. PC-FX: Altered FXVCE->VDC vsync emulation. PC-FX: Revamped RAINBOW code, adding support for JPEG-like encoded content, thanks to David Michel's help. WonderSwan: Fixed a bug in the debugger(HAH) regarding the display of HBTimerPeriod and VBTimerPeriod(they were erroneously listed as 1-byte variables, when they should've been listed as 2-byte variables, which caused the values to wrap around to the other side of the screen if they were >= 0x100). GBA: Structurized free-floating various variables...there shouldn't be any regressions, aside from save state incompatibility, unless typos were made(if so, please tell me!). PC-FX: Added support for scrolling/rotation in 64K color mode. PC-FX: The KING data structure(including KRAM) is now dynamically allocated. GB, GBA: The memory for the color map/filter is now dynamically allocated. PC-FX: Changed the size of the emulated X tile coordinate register when drawing KING BG, affecting in-range calculation when in non-endless scroll mode. Fixes missing eyes and mouths and other craziness in cutscenes in Chip Chan Kick. PC-FX: Fixed playback of the last 4 samples of an ADPCM playback sequence, fixes crazy volume problems in "Team Innocent". PCE: VDC chip data structures(including emulated VRAM) are now dynamically allocated. NES: FDS and several mappers' larger data structures are now dynamically allocated. NES: NSF write handler info structure is now dynamically allocated, which should reduce memory usage by 1 or 2 MiB(depending on the platform) on other games/files. PCE: CDROM-related memory is now dynamically allocated, which should reduce Mednafen's memory usage for non PCE-CD games by at least 2.25MiB. PCE: Added untested support for the Tsushin Booster's expansion RAM Replaced the hard-coded file extension tests when loading from a ZIP archive in MDFN_fopen() with code that tests extensions passed as a double-NULL-terminated(each entry is single-NULL-terminated) string to MDFN_fopen(). Added QuickLZ to the codebase, and added the setting "srwcompressor" to specify which compressor to use for staterewinding, "minilzo" or "quicklz", with "minilzo" as the default. QuickLZ can be considerably faster at compression than MiniLZO, though QuickLZ is written with x86 and x86_64 CPUs in mind, and performance will likely suffer on other platforms, and its compression ratio isn't as good as MiniLZO(which itself isn't that great!). PCE: Added the settings "pce.adpcmvolume", "pce.cddavolume", and "pce.cdpsgvolume", for people who like music more than sound effects, or vice-versa for some weirdos! ;) PCE: Burst mode will now be tested for when the VDC would enter the active display area. PCE: Altered the relative volume of CDDA vs PSG vs ADPCM with CDROM games, based on tests done on a real system. PCE: ADPCM no longer uses saturated addition for the current output value, instead just wrapping(like apparently occurs on a real system). PCE: Scrapped the old SCSI CDROM code, it now uses code that was previously PC-FX only(and was abstracted to be used for both). The Game Express CDROM card image now works, including Game Express CD games(at least Hi-Leg Fantasy ;)). John Madden Duo CD Football works. Steam Hearts plays stage music now. 3x3 Eyes doesn't seem to have desynchronized audio anymore during cutscenes... Updated libmpcdec to 1.2.5(I think it was 1.2.2 previously...). PC-FX: Added VRAM and FXVCE palette RAM to the debugger's memory editor. PCE,PC-FX: Fixed CUE+BIN pregap handling, it was totally borked before. PC-FX: Improved byte writes to KING I/O ports, fixes graphics problems in First Kiss Monogatari and Pia Carrot He Youkoso PC-FX: Changed how reads/writes from/to KING registers 0x09 and 0x0A are handled. PC-FX: All writes to 0x80000000-0x80000FFF are now translated to I/O port writes. PC-FX: Reads from "unmapped" areas in the V810's memory address space will now return 0xFF(or 0xFFFF, or 0xFFFFFFFF). This fixes a lockup that could occur in Power Dolls FX...the game seems to be trying to use 4MiB of RAM when there's only 2MiB of RAM in a PC-FX! Also, while this is probably the correct value to return for unmapped areas < 16MiB, it's not correct for at least some higher addresses... more tests are called for, but we can't just dump the entire 4GiB address space...can we? PC-FX: D4 of reads from KING register 0x05 will now be set if a SCSI CD interrupt is pending. PC-FX: Fixed READ TOC SCSI command emulation. The starting track field is no longer treated as BCD. Silly me... Fixes "Power Dolls FX" ADPCM sounds, and probably other games that have data tracks numbered 10 or above... PC-FX: D0 of reads from the KING DMA status registers is now the only bit returned. PC-FX: D0 of writes to the KING SCSI DMA length register is now ignored. PC-FX: Started work on initial support for for KING's 1M KRAM chip mode...I need to run tests! PC-FX: Reads from KING register/port 0x05 will now return the ATN and ACK SCSI status bits. PC-FX: Reads from KING register/port 0x04 will now return the SCSI status bits. PC-FX: Changed reads to KING registers/ports 0x01, 0x02, and 0x03 to return the last values written to those registers, rather than setting the bits returned corresponding to the current SCSI status bits. PC-FX: Improved keyport emulation, fixes Can Can Bunny Extra DX title-screen "lockup". PC-FX: Added support for negative KRAM increment values on read/write(king register 0xE). PC-FX: Fixed the SCSI bits returned on port $600 reads: D17 now returns SEL status, and D23 now returns RST status(instead of ATN). PCE: Block memory transfer instructions are now emulated at 6 cycles per byte transfered(+extra if VDC is accessed) instead of 5, to match tests done by malducci. This does break Wonder Momo, unfortunately... Moved the Q-subchannel simulation code to the general CD-ROM reading interfaces, and made PC Engine CD and PC-FX CD emulation both use it. Also, the code will now set the index data field to index 0 for pregap areas, but...this is only possible when using disc images, due to libcdio(or CD-ROM in general) limitations. :( Ideally, on a physical disc, we would read the Q subchannel data directly, but...I'm not sure that all drives can read and return this data, and using libcdio's direct MMC functions results in much much more latency(probably because it bypasses the OS's caching of CDROM data), which would require an extra CDROM reader thread, which does its own caching and prefetch, in Mednafen. Maybe later! PC-FX: Fixed cmpf.s emulation, fixes lockups in "Pachio Kun FX". PC-FX: Added a tidy structure to contain SCSI command numbers, CDB lengths, and function pointers. PC-FX: Added support for SCSI command 0x08(READ6), which "Mahjong Gokuu Tenjiku" uses. PC-FX: Removed most of the 32-bit I/O and memory read/write functions, which are now handled by calling the 16-bit functions twice. PC-FX: Modified the KING background rendering code to only draw to one buffer, instead of multiple buffers that are later mixed, to improve speed slightly. PC-FX: The raster counter returned on reads from FX-VCE now returns correct(I hope...at least according to a simple test I did on a real PC-FX!) values in vblank. PC-FX: SCDI CD interrupts on end of CD-DA track playback are now emulated. PC-FX: SCSI CD "Test unit ready" command now expects to receive 6 data bytes total(1+5) instead of 1. I'm not sure if this is correct with the PC-FX, but it matches the SCSI specs, so I'll keep it this way until shown otherwise. PC-FX: A17 of the effective KING BG CG and BAT addresses are now fixed to the CG and BAT offset settings, respectively, during rendering. PC-FX: Added support for non-endless-scroll in BG0 rotation mode. Fixes the title screen flipping effect for Last Imperial Prince. PC-FX: When a VDC layer has the same VCE priority as a KING BG layer, the VDC layer will now be shown on top. I don't know if this is correct... but it does fix a problem with disappearing sprites when leaving the airship in Miraculum. PC-FX: Added KING BG0 scaling/rotation support, but only for 8bpp backgrounds(direct or indirect) in endless scroll mode for now... Fixes graphics in Miraculum(yay!) and Konpeki no Kantai. PC-FX: Fixed direct CG mode width mask, corrects graphics bugs in "Boundary Gate" and others. PC-FX: Added partial microprogram emulation, fixes junk graphics in Megami Paradise II. PC-FX: Combined the different KING background non-endless/endless and direct/indirect rendering codepaths. This will make it a bit slower, but much more maintainable and...changeable! SexyAL: Added support for sound cards that don't support interleaved stereo samples...probably. Changed the font glyph cache to use an array of pointers instead of 2-dimensional array. This reduces resident memory usage considerably, even on systems with 64-bit pointers. Readded the old 6x13 and 12x13 fonts for future usage in the debugger. Fixed the documentation to list the controls for configuring virtual devices as ALT+SHIFT+1, ALT+SHIFT+2, etc. instead of ALT+1. Oops. PC-FX: Made fairly invasive minor optimizations/refactoring to the cellophane code... I *have* tested it, and hopefully it won't break anything that worked before! PC-FX: Fixed a clipping bug in KING BG non-endless scrolling mode in regards to X scroll wrapping. Fixes the disappearing boss problem in Stage 2 of Tyoushin Heiki Zeroigar! PCE: The soft reset function(F10 key by default) no longer soft-resets the PCE, as such a button doesn't exist on a real unit, and could cause problems with some games, so it causes a hard reset(the same as the F11 key) now. PCE: Added PSG registers to the debugger. Enclosed many strings in _() or gettext_noop() for translation purposes. Altered po/Makefile.in.in to pass "-N" to msgmerge, to disable fuzzy string matching. Fuzzy strings are braindead I say! Reworked MDFN_malloc(), it now takes a purpose, and on error, will print out the number of bytes attempted to be allocated, the purpose of the allocation, and the file and line number in which the allocation was attempted(through macro magic!). PC-FX: Changed the 7.16MHz dot-clock emulation mode to use an internal layer 1024-pixels wide(the least-common multiple of the 2 different screen resolutions that are mixed by the video chip), rather than having 2 different layers that are merged by the video code(which causes problems on edges). This new method is much slower, unfortunately... The overlay code that supported this in the driver code and the interfaces have also been removed, as it is not used, and will not be used. ADDITIONALLY, a setting "pcfx.high_dotclock_width" has been added. The default is, of course, 1024, but other accepted values are 341 and 256, though I REALLY don't recommend using 256, as it will cause dropped pixels, whereas 341 will only cause somewhat distorted pixels horizontally. The advantage of using 341 over the default of 1024 is SPEED, and bilinear interpolation(if enabled) will work much better as well. PC-FX: Fixed major problems when using more than one breakpoint of a type(read, write, etc.); it also occurred with the PCE debugger, but only with Aux breakpoints. PC-FX: Fixed the VDC state restore code to properly recache all the tiles, instead of half of them! GB, GBA: Fixed a few duplicate and misnamed variables in the save state structures. PCE, PC-FX: Fixed a misnamed variable in the VDC save state structures. Lynx: Removed a duplicate variable in the CPU save state structure. PC-FX: Save states are now named so that they can be shared among CDs in recognized multi-disc sets(previously only .sav games were). This is intended to emulate "hot-swapping" as far as the game is concerned(though you will need to exit the emulator and load the second disc, so it isn't truly hot-swap ;)). When a game requests you to change the disc, the procedure is: Eject virtual disc(F8 key). Save state. Exit emulator. Load emulator with second CD. Load state. Wait for the game to load it. :b PC-FX: Implemented virtual CD insert/eject, via the F8 key. PC-FX: Added dummy handling of SCSI command 0x01(rezero unit), Doukyusei II no longer aborts the emulator. PC-FX: Fixed bitstring instructions to fetch from the proper source address, fixes major graphics corruption bugs in "Anime Freak FX Vol. 4" and probably some other games as well. PC-FX: Fixed RAINBOW decoding to not begin block decoding until a 0xFF is discovered in the bytestream. Fixes some graphical problems in "Ojousama Sousama". PC-FX: Fixed the CD-DA playback speed calculation to match with tests I performed on my own PC-FX with a pure sine wave(interestingly, there was some really weird frequency aliasing at +10% playback speed on a real PC-FX...). WonderSwan: Refactored the SRAM and external EEPROM code, and added support for larger SRAM sizes(Dicing Knight works now!). PCE: Extended the Sherlock Holmes 1 hack to Sherlock Holmes 2 as well. The address displayed in the "Cursor position" field in the memory viewer/debugger is now masked properly. PC-FX: Fixed the ADPCM lowpass filter rolloff frequency calculation(forgot to divide by 2!). PC-FX: Changed priority handling of KING background for priorities 5-7, though I don't know if the new way is correct... fixes a graphical bug in "Power Dolls FX". PC-FX: The ADPCM volume control registers are now emulated as logarithmic, instead of linear. PC-FX: Modified 256-color VDC sprite and bg palette index calculation, to fix color problems in the 3/4 view of Ojousama Sousamou. PC-FX: Altered ADPCM address emulation so that the "active" play address is 17 bits instead of 18 bits, fixes problems in several games(Anime Freak FX Vol. 1, Tenchi Muyo! FX), hopefully it doesn't cause any new ones. ;) PC-FX: Added support for KING bitstring writes and reads, and changed maximum BGn screen dimension setting from 0x9 to 0xA. "Boundary Gate" works much much better now due to these changes. NES: NULL-terminated the debugger's list of MMC1 registers, which was apparently forgotten earlier. Oops. Added MMC3 registers to the debugger. Added the current scanline(read-only) to the debugger's list of registers. 0.7.2: NES: Added MMC1 registers to the NES debugger. Various cleanups(removing dead code and header declarations). Added settings "vblur.accum", enables motion blur accumulation mode, and "vblur.accum.amount". Added setting "vblur", when enabled, will (motion) blur adjacent video frames 50/50. Added WonderSwan emulation, based on Cygne, but greatly improved, and with a debugger. Modified the time base adjustment code used when sound is disabled to fix fast-forwarding when sound is disabled. "Fixed" a few instances of mostly harmless variable shadowing. Mednafen is now compiled with -Wshadow. Modified the save state preview rescaling code to properly(with interpolation instead of nearest-neighbor) rescale PCE games that use the 512pixel-width mode, or in other words... the rescaling code will now work where (fb_width / state_preview_width) <= 2 whereas previously it only worked properly where (fb_width / state_preview_width) < 2. Errors saving save states are now propagated and reported. NGP: Files with an extension of "npc" are now also treated as Neo Geo Pocket ROM images. PC-FX: Added setting "pcfx.nospritelimit". Removed the memory dump and graphics memory dump functionality from the main debugger. The new memory editor provides the same or higher level of functionality. Added a new memory editor to the debugger interface, accessible by pressing ALT + 3 in the debugger. PCE: Added support for reduced-bit-depth background mode. If the ALSA driver code is unable to set stereo or mono sound, it will try mono or stereo sound instead, respectively. PCE: PSG waveform RAM will now only be updated if the channel is turned off. glFinish() will no longer be called every frame in the OpenGL code, which should improve performance(if it causes problems, like tearing where there wasn't any before or decreased performance, please file a bug report!). If the "glvsync" setting is 1(the default), and the environment variable "__GL_SYNC_TO_VBLANK" is not set at all(either 0 or any value), then it will be set to "1". This has the effect of forcing vblank synchronization when running under Linux with NVidia's drivers. Fixed configure script option "--disable-jack". Lynx: Screen rotation now works in non-OpenGL mode(SDL+framebuffer), sans scanlines support. Lynx: Screen rotation now also rotates input sanely, as it did in 0.6.x and earlier versions. Fixed a fatal compilation error in the ALSA driver with ALSA versions < 1.0.9. Fixed a fatal compilation error on GCC < 3.4 in the PC-FX code. Added code to detect the maximum OpenGL texture size, and reworked the OSD code to use tiled drawing if a particular OSD surface is too large to fit in a single texture. This is particularly relevant to users of old Voodoo cards. Note that tiled drawing isn't supported for the main game framebuffer, so video cards with severe texture size limitations will still have problems with PC Engine and PC-FX games that use higher resolution modes. The help screen, debugger, and cheat search interface now use their own surfaces instead of the generic OSD surface. Fixed(hopefully) OSD-clearing in SDL blit mode("-vdriver 1"). Removed the option "doublebuf". It is kind of an archaic leftover from when Mednafen did only one blit per frame(and had the OSD written to the game's virtual framebuffer). Double buffering must always be enabled, or else screen corruption may occur. Also, as a note, double buffering does not imply synchronizing to vblank, though this does occur in some situations. ***NOTE: Please check your scripts and frontends and remove any "-doublebuf" arguments! *** 0.7.1: Began work on an experimental stdio interface, see drivers/remote.cpp if you are a frontend author and can read C code, though it is disabled for now. :) Documentation for it will be written when it is closer to completion. Switched to trio_snprintf() from snprintf() in the input configuration code, this should fix problems under Windows(and any other OS with a lame snprintf() implementation) with joystick button configurations not saving properly. Fixed parsing of the "sounddevice" setting(it was erroneously being compared to the long, descriptive name of the driver instead of the short name). PC-FX: More changes. 0.7.0: *** Network play with this release requires Mednafen Server >= 0.3.0 *** PCE: Fixed a timer reload bug. Added the following configure script options: --enable-debugger build with internal debugger [default=yes] --enable-cjk-fonts build with internal CJK(Chinese, Japanese, Korean) fonts [default=yes] --enable-gb build with GameBoy emulation [default=yes] --enable-gba build with GameBoy Advance emulation [default=yes] --enable-lynx build with Atari Lynx emulation [default=yes] --enable-nes build with Nintendo Entertainment System emulation [default=yes] --enable-ngp build with Neo Geo Pocket emulation [default=yes] --enable-pce build with PC Engine(TurboGrafx 16) emulation [default=yes] --enable-pcfx build with PC-FX emulation [default=yes] Moved the save states display and info text message display to blit directly to the framebuffer, rather than to the general OSD layer(which is now only used for cheat console and debugger). Reworked the network play console interface to be more...usable. It takes up much less space, is centered at the bottom of the screen, the "t" button now activates text input, pressing "Enter" exits netplay console mode, and it will automatically pop up(though without user input possible, unless you press "t" while it's up) for 2.5 seconds when a new message is received. Added support for all possible input devices to be used with network play. Command-line arguments can now be prefixed with either "-" or "--". Fixed "--help/-help" parsing from command-line. PC-FX: Increased emulation accuracy, most games still don't work correctly, if at all. PCE: Fixed VRAM->VRAM DMA when destination writes occur outside of VRAM space(they're now ignored). Fixes "Ruin - Kami no Isan". OpenGL page flips will now try(it doesn't seem to work with nvidia's binary driver under Linux, so use "nvidia-settings" utility instead) to be synchronized to vertical retrace/blanking period if Mednafen is compiled against SDL >= 1.2.10, controllable by the setting "glvsync", enabled by default. The "sounddriver" setting is now honored. Values you can try are "default", "oss", "alsa", "dsound", and "jack". Added support for JACK and ALSA sound output, ALSA sound output is now preferred over OSS. Mednafen will now exit properly if it receives a not-fatal signal, such as SIGTERM or SIGINT. NES: Fixed noise and DMC playback frequencies with PAL emulation. Thanks to blargg for the information. Due to internal changes, and wanting to clean up code, save states created in versions older than 0.6.0 are no longer supported(if you have any old save states you absolutely must have, load them in 0.6.5 and save them, then load them in 0.7.0). Added keys to increment(though a predefined list of possible devices) the currently selected device on an input port(CTRL+SHIFT+1 through CTRL+SHIFT+5); note that this WILL change the setting for this port saved in the configuration file. PCE: Added mouse support(use "-pce.input1 mouse"). To use it properly in windowed mode, you will need to press the "Scroll Lock" key. PCE: Added 6-button pad support. By default, the "M" key will switch between 2-button and 6-button modes(this is necessary because most non-supporting games will break horribly in 6-button mode, which happens on a real system as well). Revamped much of the internal input device handling. Important user-visible changes: Button configuration order is slightly different, with the rapid-fire instances of buttons immediately coming after normal instances of the buttons. More buttons can now be configured for rapid-fire. A virtually unlimited number(instead of 4 in previous versions) of physical buttons may now be assigned to a virtual button or command. Input button settings are now saved in the text-format mednafen.cfg file. Famicom input devices that were previously not configurable, such as the Family Keyboard, now are; however, it would be unwieldy to configure the Family Keyboard using the in-emulator configuration process, so edit the configuration file instead. The NES Zapper and other devices that are emulated using the mouse can now have their buttons configured. The setting to manually set an input device on the Famicom expansion port has changed from "nes.fcexp" to "nes.input5". Gameboy and Gameboy Advance pad button configurations are now independent of each other. Save states and movies can't be accessed during HES/NSF/GSF playback anymore(does this hurt anyone?). Button configuration hotkey functions are now mapped to ALT+SHIFT+1 through ALT+SHIFT+5(for input ports 1-5) instead of F3, F4, and various convoluted combinations of F3 and F4 with CTRL and SHIFT. The NSF/HES/GSF player graphical code now all use the same resolution and video settings("player.*"). Replaced the internal fixed-width 6x13 and 12x13 fonts with 9x18 and 18x18 fonts, respectively, and increased the general OSD layer size to 384x336 from 256x224(which has a side effect of allowing more detailed save state previews for NES and PCE). The new fonts provide about 10,000 more glyphs(for a total of about 32,000 glyphs), mostly for east-Asian languages(I think this MIGHT be slightly overkill, but, eh...*flees*). PCE: The timer counter was being updated one instruction too late. Fixed. (This problem probably didn't affect any games, but it could have resulted in confusion while using the debugger.) Remapped the state rewind key to ALT+S, and added a new help screen triggered by pressing "F1". PCE: The disassembler was missing opcode 0x3A, DEC. Fixed. NES: A few sound variables weren't being saved in the VRC6 and FME7 sound code. Fixed. PCE: Fixed disassembler decoding of ZP indirect addressing mode. NES: Fixed unofficial opcode 0xE2 cycle timing. 0.6.5: PCE: Made a small optimization to HuC6280 emulation by caching the CPU speed shift-left cycle count adjust value. Removed an old kludge for Win32 that worked around an SDL problem in which the window position would be off-screen when switching from fullscreen to windowed mode, as I think the problem is fixed in SDL 1.2.10. Reworked the signal handling code to be included if HAVE_SIGNAL is defined instead of if WIN32 is not defined, and added #ifdefs around each possible signal(as some platforms don't provide #define's for some signals). PCE: Added setting "pce.cdspeed" to set a CD-ROM data transfer speed multiplier. PLEASE READ THE DOCUMENTATION FOR CAVEATS. PCE: Fixed CD-DA and ADPCM fadeout speed when setting the "pce.ocmultiplier" setting to a value other than 1. Cleaned up the multi-res blitting code in drivers/video.cpp to not cause crazy compiler warnings(and not be crazy in general!). PCE: Fixed the ADPCM playback rate formula(the result was off by about 0.27%), thanks to Charles MacDonald for detailed information. Began work on implementing several OpenGL pixel shaders, which will be finished in a later release. Mednafen no longers directly links to the OpenGL library, instead it uses SDL's OpenGL library loading and function address functions. Reverted back to pow() and cos() from powl() and cosl() in Blip_Buffer.cpp, due to some platforms not having long double types per se, and adjusted the code activated by setting "pce.adpcmlp" to call Blip_Synth::treble_eq() with a "treble" value of a lower magnitude, which might result in a slight difference in the ADPCM frequency spectrum produced when "pce.adpcmlp" is enabled. Fixed "Value increased" cheat search method(it was acting the same as "Value decreased", oops -_-). Changed the usage of fix-sized filename component arrays in general.cpp with string objects. MDFN_printf() and MDFN_PrintError() now use trio_vaprintf() instead of trio_vsnprintf(). NES: Added setting "nes.n106bs", which when set, will enable less-accurate, but better sounding, Namco 106(mapper 19) sound emulation. NES: Fixed save states for mapper 69 games(mirroring and prg bank setup wasn't being saved and restored). NES: Added support for multiple expansion sound chips used simultaneously in NSFs, including limiting the address space they will respond to when multiple expansion sound chips are used(to prevent collisions between VRC6 and VRC7's address space, for example). PCE: Fixed CD-DA playback speed when setting the "pce.ocmultiplier" setting to a value other than 1. NGP: Changed the default full-screen video settings, so that the scaled image size is no longer larger than the display area(oops -_-). NES: Added support for UNIF board "UNL-603-5052"(thanks to CaH4e3). NES: Fixed mapper 115, "Thunderbolt 2" now works(thanks to CaH4e3). NGP: Sound emulation now respects global sound volume setting "soundvol". NGP: Added missing setting "ngp.forcemono". PCE: Physical CDROM device names will now be printed on Mac OS/X on startup again. Physical CDROM access seems to work, but the DarwinPorts libcdio 0.75 package appears to be horribly broken, so please remove it and install libcdio 0.77(or higher) from its source code. NGP: Fixed a few major problems with NGP emulation on big-endian platforms(such as PPC OS/X). 0.6.4: Added somewhat experimental Neo Geo Pocket(Color) emulation based off code from NeoPop, heavily modified. GB: Fixed frame rate when sound is disabled. Added →, ←, ↑, and ↓ characters to the Lynx, GB, GBA, and PC Engine directional button names used for button configuration, to match the NES button names. PCE: Added setting "pce.adpcmlp", default value 0, that when enabled, will cause Mednafen to apply a lowpass filter to ADPCM sound output with a rolloff frequency dependent on the current ADPCM playback frequency. This makes ADPCM voices sound less "harsh", however, the downside is that it will cause many ADPCM sound effects to sound a bit muffled. PCE: Moved the OpenGL screen clearing code into the FlipOpenGL() function to fix a problem with some PCE games that use multiple resolutions per frame having a partially corrupted screen when the OSD was up. PCE: Fixed save state loading with save states created during a CDROM data transfer. Fixed a bug that was causing flickering OSD remnants to remain onscreen in fullscreen mode if the OSD was drawn outside of the game screen area. Fixed a bug in the resizing code for save state previews that was causing save state previews for the NES, GB, GBA, and Lynx to look absolutely horrible. Assigned the two keys "-"(not the numpad instance) and "=" to functions "decrement selected save state slot" and "increment selected save state slot", respectively. Removed the checks preventing save state usage when playing NSFs, since save states may be useful with NSFs in some circumstances. Added a new setting "ckdelay", which controls the length of time, in milliseconds, that a button/key corresponding to a "dangerous" command like power, reset, exit, load state, etc. must be pressed before the command is executed. The default value is 0. Input mapping configuration is now saved after argument parsing if there is no game to be loaded, allowing a command like "mednafen -inputcfg pcegamepad1" to work properly. The message "Configuration finished." will now be displayed when button mapping for the selected input device is complete when using the in-game configuration process. PCE: Fixed a bug in the debugger involving disassembling block memory transfer instructions(effectively, the length was being fetched 1 byte too early). 0.6.3: SexyAL: Fixed buffer write memcpy() optimization to also check to make sure the input and output byte orders are the same. PCE: Added setting "pce.forcemono" to force monophonic sound output. Added setting "analogthreshold", which is the threshold for detecting a "button" press on analog axis, in percent. The default value is 75(%). Worked around a very odd "bug" in gcc that involved muddling of local-scope structure definitions among different object files( the structure previously named "BPOINT" in both NES and PCE emulation code), which led to breakpoints with NES emulation being totally fubared. Added graphics memory dumping capabilities to the debugger. PCE, NES: Save states and powers/resets in debugger step mode SHOULD work properly now. Fixed a potential deadlock when exiting. Various debugger fixes. I lost the ChangeLog, sorry. -_- 0.6.2: PCE: Physical CDROM device names will no longer be printed on Mac OS/X on startup, due to the code crashing badly(rather than goodly!). OpenGL texture heights are now rounded up to the nearest power of 2(texture widths already had this rounding in previous versions), which should fix special scalers on video output devices that don't support non-power-of-2 textures(IE most video cards and Mac boxen). PCE: The libcdio sector reading functions are now checked for return values < 0 as errors, rather than != 0, to fix problems under Linux and possibly many other OSes where the return value is something like 2048(the number of bytes read, presumably). PCE: Fixed a bug with disassembling block memory transfer instructions on < 64-bit systems(I had forgot to type-cast a variable to uint64 before left-shifting it past 32-bits). PCE: Added the implied form of INC to the disassembler. NES: Removed the PRG mask constraint for UNROM/mapper 2, introduced in version 0.2.0, to fix the Japanese "Maniac Mansion" and possibly other games. PCE: Fixed debugger write breakpoints. The code had a logical error in it, with the end effect of preventing stack writes in the IRQ sequence, causing games to crash. 0.6.1: PCE: The HuC6280 disassembler now gives @ZP hints for BBR and BBS instructions. NES: Increased the effectiveness of frame-skipping. Removed unnecessary sound buffer copying if the source format == device format in SexyAL, which is true most of the time. Fixed a bug that was causing a crash in the cheat interface when trying to list cheats, under Win32. Fixed a bug in the settings loading code that forced the user to resort to manual creation of ~/.mednafen/mednafen.cfg on some operating systems(*BSD, OS/X). It was being caused by 'errno' being modified between the attempt to open the settings file, and the test 'if(errno == ENOENT)'. Silent sound will now be outputted when in step mode in the debugger. Windows users' ears rejoice! Added a strtod() replacement that recognizes both "." and "," as valid radix characters, regardless of the current locale, and modified settings.cpp to use it. Lynx: Removed some unused code. 0.6.0: The internal sound format has been changed to 16-bit from floating-point to improve performance, especially on processors without FPUs. There should be no perceptual nor measurable loss in sound quality. Removed fidlib from the source code tree, as it is no longer used. Lynx: Switched over to Blip_Buffer's lowpass("treble") capabilities from fidlib. PCE, NES: Added a debugger of DOOOOOM. PCE: Altered timer emulation slightly. PCE: It is now possible to load CDs simply by specifying the CUE file, or device, as you would with a ROM image, like so: mednafen /dev/cdrom mednafen /home/sauron/games/Ys/Ys.cue Added MusePack CD-DA playback(IE audio tracks encoded as MPC data) support. Added legal information to the end of the documentation, though it's likely incomplete. Switched over to using an internal copy of the "Tremor" decoder, and dropped dependencies on the ogg and vorbis external libraries. The CD-DA reading function now provides sound data as 16-bit signed samples in the endian format native to the host platform. PCE: Changed two often-used CDROM timing variables from int64 to int32 to try to improve performance slightly on non-64-bit platforms. PCE: Added a hack that changes subtle CDROM unit behaviour when the game "Sherlock Holmes" is loaded, so that the aforementioned game will work. In general, I really, really dislike hacks of this nature, but I think it's justified until I have a better understanding of the (complex) PCE CD functioning. PCE: Lowered CDROM data transfer rate, and removed the kludgey one-time delay in the sector reading function. PCE: Altered ADPCM write delay to be inversely proportional to the playback frequency selected. GB, GBA and Lynx save-state previews are now saved at native resolution, instead of scaling down to 1/4 of the native resolution. NES: Fixed a mapper 96 initialization problem. NES: Implemented blargg's NTSC graphics filtering code(version 0.2.0). The setting "sounddevice" will now select which filesystem entry(like "/dev/dsp" or "/dev/adsp") to open when using the OSS output driver. NES: Changed the internal sound channels high-frequency mixing buffer to 16-bit, from 32-bit, to try to increase performance on cache-starved processors. Added a simple, non-ideal(it increases CPU usage measureably because it dirties the OSD surface and causes it to be redrawn) FPS display, toggled with SHIFT+F1. PCE: Added "hes" and "pce" to the file extensions looked for in ZIP archives in the file loader. NES: Added support for iNES mapper 38. Lynx: The lowpass filter can now be optionally disabled by modifying the "lynx.lowpass" setting. ROM sizes, MD5 hashes, and CRC32 checksums are now printed out for all systems emulated by Mednafen. Rearranged the file loader detector to attempt to load the file as a GBA game last, since the GBA cart-detection code *could* give false positives if the game isn't a GBA game. PCE: The 2KiB of BRAM is no longer mirrored across the 8KiB segment 0xF7, fixing "RAM is full" problems with Exile 2. PCE: Fixed MD5 hash calculation for CD data tracks. Added settings "gb.forcemono" and "gba.forcemono". Lynx: Cleaned up the code. The MD5 hash is now calculated for GBA and Lynx games, and the correct MD5 hash is now used in filenames (the nibbles in each byte were swapped previously). ***NOTE*** Save states and save games created in previous versions of Mednafen will have different filenames than the current version. To do a quick-and-dirty fix, simply remove the MD5 hash component from the filename as such: rename somegame.7e74d04f2d147f03061d447310b109ec.sav somegame.sav Changed autofire behavior to have the button set on half the frames in the autofire period, rather than just one frame. NES: Changed the background clear color to light blue(from black) when the background is disabled by the user, and fixed background and sprite disabling by the user to not lock up some games that depend on sprite hits. GBA: Updates from VBA's CVS: - bios.cpp : corrected a bug in registerRamReset. - gba.cpp/gbainline.h : corrected the mirroring of Vram. - gba.cpp : changed slightly the emulation of gbasavetype. - RTC.cpp : vba now ignores rtc command 0x64. GBA: Reduced input latency by one frame. PCE: Reworked the frame/scanline counter loop to run NMI first, and then draw the active frame area, to reduce input latency by one frame. Most games keep the vblank starting line outside of the TV's visible display area, but a few(like Dracula X) have vblank occurring on a scanline that the VDC is still outputting a signal to the TV for. If a game alters its overscan color regularly, and vblank is set to occur rather early, there might be a slight tearing effect at the bottom of the screen. Note that this is a very minor problem, and is more than offset by the reduced input latency, though I thought I should mention it so I won't go crazy in the future trying to debug the oddball game. ;) Note that this change may cause compatibility problems with PCE save states created in older versions of Mednafen. NES: Fixed several PPU sprite RAM and VRAM read and write operations to pass blargg's tests. NES: Altered how the color to be blitted is decided when screen rendering is disabled to fix blargg's 410 color demo. Fixed scanlines to be aligned correctly(scanline darkening over the pixels that are interpolated between rows) when bilinear interpolation is used, at least on my nvidia card. Floating-point/real number settings are now validated and checked to be in range. PCE: Rewrote SuperGrafx VPC priority evaluation code to work correctly with http://pcedev.net/demos/Sgx3b.zip which was tested on real hardware. Simplified the OpenGL blitting code. 0.5.2: Modified the PCE code to only include header files that are needed. Fixed a memory leak in the state saving code. PCE: Closing HES music files will no longer produce battery-backed RAM files. x_x Fixed a memory leak in the state loading code. Reduced memory slightly in the text rendering code by using all the bits available in the array(instead of the lower bit of each byte) that tells if a glyph is available or not. Modified the internal message display code to allocate and free space for the message being displayed, rather than using a rather small static array. PCE: Fixed a small bug that would cause 1/75 second or less of the old CDDA track to play when switching to a new CDDA track. PCE: Changed how reads from $0000 are handled, and made vblank occur slightly later in the frame, to fix Valis 1. PCE: The CD reset function of $1804 now clears more variables, fixing problems with lockups when using the START+SELECT soft reset in the middle of a data read. Finally fixed the endian conversion code so that save states(and netplay) are compatible between big-endian and little-endian systems. **NOTE** Save states created in previous versions of Mednafen on big endian platforms(such as OS/X PPC) will no longer work in this version. Removed the tech documentation from the source code distribution. Truncated the ChangeLog to the first Nintencer release. 0.5.1: Fixed a crashy bug with hq2x, hq3x, and hq4x when using big-endian systems, or when the "vdriver" setting is set to "1". 0.5.0: Added a frame-advance feature. Press ALT+A to enter frame-advance mode, and subsequently to advance frames, and ALT+R to exit frame-advance mode. The current machine state is now saved at the end of movies, to allow for the future implementation of the seamless continuation of an already recorded movie. PCE: When loading from a physical disc, auxillary data(save states, movies, etc.) prefixes should now always be "cdrom", rather than "cdrom" for the default device and the given name for other devices, because this(previous) behavior caused problems under Win32(where colons couldn't be used in filenames). NES: Fixed FDS sound output(it was technically outputting before, but the volume was so low as to be inaudible). NES: The disk system BIOS can now be in iNES format. NES: The Game Genie and FDS ROM image loaders can now load the ROM image from a gzip or zip compressed file. Revised the documentation to remove misleading statements(that applied to FCE Ultra) and add some missing information. Updated the command-line section of the documentation with warnings and notes regarding settings, network play, and movies. PCE: Fixed more bugs with CD reading when sound is disabled. Loading a save state while recording a movie will now embed that save state in the movie file. PCE: Save state previews are now generated with correct horizontal linear interpolation, fixing icky blockiness. NES: It's now possible to record movies with any virtual input devices(like the Zapper), though the nes.input1, nes.input2, and nes.fcexp settings must be set the same as they were at recording time, before playback. NES: All currently used expansion input devices are now saved in save states(before only gamepad data was saved). Added a network play setting to merge all local input into one virtual remote input(via inclusive OR on the server), to allow for those UTTERLY SILLY games that support multiple players on one gamepad/joystick. Worked around an SDL bug(or feature? :b) that was causing events to be processed by SDL instead of Mednafen when SDL_JoystickEventState() is called. Scrapped the old movie format from FCE Ultra, and replaced it with a simplified version that simply writes the joystick inputs to the movie file stream each frame, and lets zlib handle the compression and encoding. This is incompatible with the old format, sorry. Movies are now stored in the right directory finally(mcm vs mcs). Rewrote most of the on-screen display code to work with a separate 256x224 buffer that is scaled and blitted independently of the main game's video output buffer. Note that if you have OpenGL disabled(via "-vdriver 1"), the overlay will not be scaled. PCE: Added support for multiple resolutions per frame, as used in such games as "Asuka 120%" and "Ryuuko no Ken". PCE: Adjusted the internal resolution(and outputted aspect ratio) slightly when using the ~7MHz dot-clock. PCE: Added movie recording support. PCE: Adjusted ADPCM volume. PCE: Fixed left overscan clearing and disabled background lines clearing. The trio code is no longer compiled with -ffast-math. Removed netplay divider support(it didn't really work all that well anyway), and removed it from the server as well. PCE: Changes to the IRQ masking register are now delayed by one instruction, thanks to D. Michel for the information. Status messages are now displayed for 2.5 seconds, rather than 180 frames. Changed save state display timing from frames to seconds, and set it to display for 2 seconds after a number is pressed(previously it was around 3). Added the following settings: nes.ggrom, path_snap, path_sav, path_state, path_movie, path_cheat, path_palette. Changed the data types of "bool" variables that are saved in save states to uint8, to address more cross-platform save-state compatibility issues. Fixed a problem with save states on big-endian platforms(was dividing by sizeof(uint32) instead of sizeof(uint16) in a few places). Fixed hq2x, hq3x, and hq4x filters on big-endian platforms. PCE: Pushing the virtual reset or power button during CD reads will no longer cause the emulator to fail on subsequent reads(a few variables weren't being reset properly). 0.4.9: GB/GBA: Added configurable rapid fire buttons for virtual buttons A and B. NES: Disabling the background now works properly(it no longer also disables sprites!). PCE: Disabling background layers now replaces that layer with an obnoxious green color that shouldn't be used by any games, to make sprite ripping easier. Added settings "fftoggle" and "ffnosound", to make the fast-forwarding button a toggle switch, and to silence sound during fast-forwarding, respectively. PCE: CDDA playback interrupt and looping enabled flags are now reset properly, fixing a lockup that occurs when facing a boss in Valis 2, and possibly other games. 0.4.8: PCE: Loading a physical CD will now print out a list of available devices. NES: Blip_Buffer's highpass filtering capabilities(for DC-offset removal) are now used instead of a custom function. Modified the included libintl so that it will compile on Mac OS/X. The "trio" subdirectory should(I can't test it) now be compiled with -mieee on Alpha architectures, fixing a compilation error. NES: Fixed long-standing graphical problems with some sprites in (Mike Tyson's) Punch-Out. Removed "#include " from cdromif.cpp and cdromfile.cpp, since I forgot to in 0.4.6. 0.4.7: Fixed the NES PPC AltiVec resampling code by properly aligning an output array. Fixed NES sound emulation on 32-bit platforms(omitting the buffer size to Blip_Buffer::set_sample_rate() was causing an assert to go off on <64-bit platforms). 0.4.6: Dropped the libsamplerate dependency. NES: Replaced the resampling code from the intermediate frequency after FIR resample with Blip_Buffer. The only audible effect seems to be a slight lowpass filter effect. PCE: Integrated the CDDA playback code into the main PCE CDROM emulation code by using Blip_Buffer. PCE: Removed the compressor and cddaquality settings. Updated the Russian PO file, mostly to remove or fix grossly incorrect "fuzzy" entries. Added an incomplete Spanish(Spain) PO file. PCE: If a data sector read from a physical disc fails, it will be reattempted continuously until it succeeds, or the user presses the exit key(F12 by default). (note that this may appear to lock up Mednafen, but the exit key will still work) This *should* fix problems with physical PCE CDs under Mac OS/X and MS Windows. Merged trio(http://daniel.haxx.se/projects/trio/) into Mednafen to fix format-string problems on non-glibc systems(MS Windows for example!). GB: Modified the APU emulation code to silence a gcc warning. PCE, Lynx, GB, GBA: Doubled the size of the Blip_Buffer phase offset table for slightly higher sound quality. PCE: Fixed ADPCM playback code for when sound is disabled(it was ultimately causing a crash in earlier versions). Converted the MD5 functions to a class. Fixed(hopefully) compilation on non-Apple PowerPC systems. Fixed save-state support for saving/loading arrays of 16-bit and 32-bit variables(the hints were already there, but the code to handle the hints was nonexistant). Note that this change will cause incompatibilities between old save states and this version on big-endian platforms. Removed the included "m4" directory, updated autogen.sh, and reran it to regenerate aclocal.m4 with newer(and fixed on AMD64) versions of the gettext autoconf scripts. See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349845 0.4.5: drivers/opengl.cpp now includes the GL header files AFTER the header file that eventually loads config.h is included to fix compilation on Mac OS X. Redefined SFEND from { 0 } to { 0, 0, 0}, and fixed older code to use the SFEND macro, to fix crashing on OSX and possibly other platforms when saving or loading states. Reduced SDL's buffer size when using the SDL sound driver(used on MacOSX). Restructured and merged some of the sections in the autoconf script. Note to future self: I noted that it seems if the first instance of PKG_CHECK_MODULES() is in a statement that doesn't evaluate, any other PKG_CHECK_MODULES() statements will fail. I don't know if this is a bug in autoconf, or a misunderstanding on my part. Removed the largely unused ESD sound driver from compilation, as it is mostly unsuitable for use in Mednafen. Also removed the jack driver, as it was unfinished, and couldn't be used anyway. PCE: Fixed CD-DA playback from "WAV" audio files on big-endian platforms. Fixed a compilation problem on big-endian CPUs by adding appropriate type-casts in psf.cpp. 0.4.4: Modified the GBA code to not use many INLINEd functions in arm.cpp. This greatly reduces RAM and CPU usage during compilation, and should have only a negligible impact on performance(and might even improve performance on cache-starved systems). Fixed a compilation problem on non-x86 and non-PPC platforms in the NES emulation code. 0.4.3: (Note: PCE CD save states created in previous versions will not work very well with this release) Fixed a compilation problem in cdromif.cpp regarding NULL on *BSD platforms by including . Lynx: Fixed the constructor and destructor declarations of the C65C02 class, which should fix a reported compilation error with gcc 4.1. GBA: Added a few missing variables to save states. GB: Lines during which time the screen is turned off are now cleared(fixes flickering problems at the start of games, and during transitory blank screens). Fixed the SDL_net.h include statement in drivers/netplay.cpp. PCE: Fixed a bug with CUE+BIN sector size handling with regards to pregaps. CUE+BIN is still officially unsupported. :B PCE: Noise is now rendered at blip_med_quality. PCE: Removed the code that checks to make sure the audio sector to play is non-zero. Fixes "Crazy Hospital". Changed the maximum supported playback rate from 96KHz to 48KHz, to be able to safely extend the temporal precision of Blip_Buffer further. Note that this shouldn't be considered a regression, as there are virtuall no benefits to using a sample rate above 48KHz in Mednafen(though there may be benefits in other applications). *************** ***BIG NOTE:*** *************** If you previously set the playback rate above 48KHz, you will have to manually edit the text configuration file(~/.mednafen/mednafen.cfg) to bring the value in range. This is necessary because of a limitation in the setting validation code. Updated to Blip_Buffer 0.4.0, which offers improved sound quality over previous versions: - Improved sound quality by rewriting library to use 32-bit internal sample buffer, higher phase resolution, and a properly windowed filter kernel. Current user code should work without changes. PCE: When sprites and background are both disabled, and the VDC is not in burst mode, the scanline is now filled with color 0x000 from the palette rather than 0x100. This fixes the "Hurry Up" water effect in the CD game "Rainbow Islands". PCE: Fixed the CD-DA amplitude calculating(used the BIOS' CD-DA player interface). PCE: Altered VDC line timing slightly. PCE: ADPCM frequency is no longer reset on ADPCM reset, fixes Gulliver Boy's dialogue voices during gameplay. PCE: Fixed reading from nonexistant audio sectors(by memset()'ing the audio buffer to zero). PCE: Implemented sector reading delays, games that use FMV like Gulliver Boy work much better now. It's not implemented 100% correctly, and requires a small CPU hack to disable IRQs during a timing-sensitive period of emulation. I don't like hacks, but...it's still better than the giant hack of reading all the sectors at once, which was how it used to be. PCE: Implemented ADPCM read and write delay. "Record of Lodoss War" no longer locks up at the title screen. PCE: Opcode and operand data reads from VDC register 0x1 will now return 0x40, which fixes Dragon Slayer 2. I doubt this is correct, but it shouldn't break any other game. PCE: CUE+BIN audio playback no longer locks up the emulator, but CUE+BIN is still officially unsupported. 0.4.2: Fixed sprite hit emulation, fixes problems with VS Duck Hunt and VS Hogan's Alley that have existed since Nintencer. Modified VS Unisystem light gun emulation slightly to be more accurate. Fixed the in-emulator sound(nsf,gsf,hes) player's waveform visualization, broken in 0.4.1. 0.4.1: Joysticks initialization is now slightly more verbose. Fixed hash calculation in the joystick code, and added a workaround for hash collisions(which would occur if two extremely similar joysticks are used on the same system). Video initialization is now more verbose. The -.special command-line arguments for selecting a special scaler now take the short name of the scaler, which is found in the documentation, instead of arbitrarily-chosen numbers. However, out of the goodness of my cold, black heart, arbitrarily-chosen numbers may still be used, though it should be considered deprecated. Example: -nes.special 1 (deprecated, but works, selecting hq2x) -nes.special hq2x (good!) -nes.special wombat (bad!) libsndfile is now used for WAVE recording(instead of the old ugly code). Altered the internal floating-point format used to represent audio data by changing the range to -1.0<=sample<=1.0(previously it was 0.0<=sample<=1.0). NES: Fixed a 1-byte overflow bug in the Barcode World input device emulation code by changing a strcpy() to a memcpy(). Added a "-help" command-line option, which prints out command-line arguments and parameters. Fixed the configuration file loading code to exit the emulator if invalid data is in the configuration file, instead of just ignoring it and the rest of the entries, thus trashing the configuration file on exit. Changed the default xscale and yscale settings for Lynx to 4. Physical mouse buttons can now be assigned to virtual buttons. The width and height of the state preview are now saved in save states, fixing a problem with broken save states if the -nes.clipsides option is used, and possibly in other situations(note that this won't fix the problem in old save states, only new ones). Fixed a garbage(OSD stuff) problem in screen snapshots and save states when they are done after a frame that has been skipped(the solution is to delay the snapshot/save state until the next frame, which is set to not be skip). Fixed a typo that broke the hq3x effect(it had weird graphical glitches). Modified more settings to use the new plain-text configuration file format. 0.4.0: Various minor code changes I forgot to document. I hope none of them are of the Mednafen-exploding variety. ;) Added support for saving and loading settings in a plain-text file format, and moved many settings to use this code. This file is named "mednafen.cfg" in the Mednafen base directory(whereas the old binary configuration file is still named "mednafen03x.cfg"). NES: Merged RDoPCM() into RDoNoise(), reducing CPU usage slightly. NES: Removed the pedantically high-quality sound mode, and reduced the filter order for downsampling from 512 to 256, with a larger transition band and smaller passband, creating a somewhat subtle low-pass filter effect on the audible portion of the signal, and decreasing CPU usage. NES: Made optimizations to the CPU and PPU emulation code. PCE: Added -pce.forcesgx, -pce.ocmultiplier, -pce.nospritelimit, -pce.cdbios, -pce.cddaquality, and -pce.compressor command-line options PCE: Sound(excluding CDDA in CD emulation mode) is now passed through an audio volume compressor. NES: Zero-page and stack memory accesses now go through the normal read-write function pointer system. This will increase CPU usage slightly, but it's important for future plans(readding cheat support, and an enhanced sound system through OggVorbis and WAV files). Updated to Blip_Buffer and Blip_Synth 0.3.6b1. Added special gcc options to configure.ac to get gcc to actually inline many functions that are specified to be inlined. Sometimes I wonder if gcc developers are sane... NES: Fixed a weird typo(with apparently no effect) in the B2005() function in ppu/ppu.cpp Fixed scanlines effect when using a special scaler. Lynx: Optimized the sound rendering code slightly. PCE: Added PCE CD emulation. NES: Fixed the AMD64 MMX sound downsampling assembly code. This bug fix fixes staticy sounds and other problems with NES audio on AMD64 platforms(only in 64-bit mode, of course :)). Removed MDFND_UTF8fopen() and MDFND_UTF8gzopen(), since they weren't really doing anything useful, and the same functionality could be provided more easily with some kind of wrapper library, if it's needed in the future. Updated the ZIP-file handling code with the newest version available, 1.01e. GBA: Updated most of the GBA emulation code with newer code from VBA's CVS repositoy. MDFN_FastU32MemsetM8() no longer tries to use floating-point data types, which was causing very bizarre problems on x86_64 targets when compiled with gcc 4.0, and was probably an illegal thing to do anyway, as far as portability is concerned(or maybe gcc 4.0's autovectorizer is broken). This fixes problems with many GBA games when Mednafen is compiled with gcc 4.0. Added code to check for SDL_net in configure.ac and error out if it's not found, instead of blindly trying to compile. A negative result for the JACK test in configure.ac will now print the result "no". Removed the argument to AM_GNU_GETTEXT in configure.ac, effectively setting it to "no-libtool". This will force a static library to be made when necessary, instead of a shared library, which should fix problems some people have been having with missing shared library error messages(libintl.so.3 and libintl.dll, for example). 0.3.7 Modified the OpenGL code to use glTexSubImage2D() instead of glTexImage2D() every frame, resulting in a slight performance increase. Modified the OpenGL code to use smaller texture sizes with most PC Engine games(at least those that run at a width of 256 pixels; exceptions include Aoi Blink, R-Type 1 and 2, Yo Bros., and others). Lynx: Moved CMikie::Update() and C65C02::Update() into c65c02.cpp and mikie.cpp, respectively. Fixed pointer-to-integer type casting that was causing compiler errors under Ubuntu Linux AMD64. Modified a lot of code to work around/fix various compiler warnings. Fixed a few typos in the documentation. 0.3.6: NES: Fixed a bug with the VRC6 sound emulation which was causing heap corruption and one sound channel to not work. The bug apparently came up between Nintencer 0.1.1 and Mednafen 0.2.0. Why didn't anyone tell me... -_- PCE: Made significant optimizations to CPU emulation. The code's a bit messier now, but I'll clean it up if/when 0.4.0 is released. NES: Removed the high-level frameskipping code, since frameskipping is automatically used now, and it could easily break some games. Removed the "-frameskip" command-line option, as it should not be needed anymore. Unified a lot of the driver-side frame-skipping code. Fixed a startup bug(MainThreadID was being used before it was set) that was causing the "Starting Mednafen x.x.x" line to be lost. Slightly restructured the "features" and "command line" sections of the documentation. PCE: Pressing the "Power" key now resets the internal RAM. All: Altered the shared music player interface, decreasing the brightness of the text, and adding pseudo-shadows. PCE: Added simple HES playback code. PCE: Altered noise emulation slightly, Ninja Ryukenden(and probably other games)'s music sounds more accurate now. Fixed alignment of the save state preview and selection box when emulating the PC Engine. The status line text and the save state selection message are now drawn with black shadows, to make reading easier. Changed the text status line background darkening shape to a rectangle on the NES, and fixed it to display correctly with PC Engine emulation. 0.3.5: Added code to allow for writing to SDL framebuffers directly, without using OpenGL, controlled with the command-line option "-vdriver". -vdriver 0 = OpenGL -vdriver 1 = SDL framebuffer(bilinear interpolation and Lynx screen rotation are not available). Lynx: Disabled the crude(as in, non-working) stereo sound support, and added a low-pass filter to make the sound sound much closer to what comes out of a real Lynx. PCE: Adjusted the visible horizontal display area, and overscan, in the 7 and 10MHz dot clock modes. PCE: Expanded the visible vertical display area by 8 pixels(4 on top, 4 on bottom). PCE: Altered VDC timing agaaaain. PCE: Block memory transfers now take 5 cycles(read, write, alter source, alter dest, decrement length?) per byte transferred instead of 6. Fixes "Wonder Momo". PCE: Altered HuC6280 instruction timing slightly(removed the tests for indirect indexed and indexed indirect addressing modes to use extra CPU cycles). PCE: Corrected a timer emulation bug, fixes "Dragon Egg"'s tempo. PCE: Increased the number of cpu cycles per scanline from 454 to 455, based on tests I performed. GB/GBC: A sound enable register is now initialized properly on reset, fixing at least one unlicensed game. Lynx: Disabled the superclipping code, as it's buggy(causes bad sprite clipping and invisible mountains(OHNOS) in Steel Talons) and doesn't appear to be necessary. The mouse cursor is now hidden. 0.3.4: Added command-line option "-autofirefreq" for setting the frequency of the configured auto-fire buttons when playing NES and PC Engine games. PCE: Fixed Street Fighter 2 HuCard emulation. PCE: Modified PSG waveform writing/DDA emulation, fixes "Fire Pro Wrestling - Combination Tag". PCE: Modified TRB and TSB emulation. Fixes "Toy Shop Boys". PCE: Implemented VRAM-VRAM DMA direction control bits. PCE: Altered VDC timing, fixing a few games, making a few games more bouncy. ;) 0.3.3: PCE: Fixed sprite clipping on the left side of the screen. PCE: The emulated RCR register is now masked with 0x3FF when being set. Fixes Niko Niko Pun. PCE: Several CPU cycles are now emulated between setting the in-vblank flag and the vblank IRQ occurring. This works around an issue that would otherwise require timing granularity as small as one cpu cycle. Interestingly, this same type of problem occurs with NES emulation. PCE: Altered the display rectangle calculation code to take into effect screen areas that may be hidden on many television sets(and some games were designed with the assumption that these areas WOULD be hidden). PCE: Modified noise emulation...again. :b PCE: Modified LFO emulation, fixes major sound problems in "Bull Fight". PCE: The sprite DMA completion IRQ now occurs earlier(probably a few cycles too early now, but oh well). Fixes some graphical issues in "Bull Fight". PCE: Sprite bit plane selection is now emulated to a degree. Fixes "Fighting Run". PCE: Very high-frequency(and probably inaudible) sounds are no longer played, because Blip_Synth can't handle them well. Fixes "Bouken Danshaku Don" and others. 0.3.2: GB: CGB-specific emulated RAM is no longer saved in save-states. GB: Fixed a bug in sound sweep emulation. GBC: The palette is now saved in save states. This fixes a major problem with save states with most GBC games... Fixed the SF*N() save state macros to not put quotes around names in save state files, and added a workaround for compatibility with old save states. This is an embarrassing bug. :b PCE: Made major optimizations to the VDC emulation code. PCE: Rewrote the PSG emulation to use Blip_Synth and Blip_Buffer. PCE: Altered the noise channel emulation frequency calculation and LFSR emulation. I'm still not sure if it's correct. Increased the minimum sound rate supported from 8192 to 22050. I don't test low rates very often, and there may be loss-of-precision issues with such low rates. 0.3.1: Fixed a bug that existed since 0.2.0 that was causing a null-pointer deference in stat(). Interesting, glibc silently ignored the error, but the error caused crashing under Windows. PCE: The HuC6280 timer latch is now loaded with an appropriate value on reset. Fixes "Double Dungeons". PCE: Added generic PC Engine save RAM emulation. 0.3.0 Added PC Engine and SuperGrafx emulation. Save states are now compressed and encapsulated in gzip-format files. NES: Fixed display rectangle setting code that was causing screenshots from PAL games to be cut off at the top and bottom. NES: Added an iNES header correction entry for "Gauntlet 2", to clear the four-screen bit. NES: Added support for configuring NES gamepads 3 and 4 from within the emulator(during emulation), mapped to key combinations "F4" and "Shift + F4", respectively. Fixed virtual input device configuration from the command-line(it was segfaulting before because the code was dereferencing a null pointer). 0.2.2: Fixed a few problems with '#ifdef's when compiling on an MSB-first platform, though I still haven't tested Mednafen on such a platform... NES: Fixed a nasty bug in the iNES loading code(the list of known bad ROM images wasn't terminated with a NULL entry) that could cause segmentation faults on startup in some situations. NES: A slightly faster version of the sprite priority handling+blitting code is now compiled when a 64-bit CPU is "detected" by: #if (SIZEOF_LONG == 8) (is this the correct way to determine whether or not the cpu has native 64-bit integer support? I know it works ok on x86 and x86_64, but what about SPARCs? :b) NES: Rewrote portions of the sprite rendering and priority comparison code to use simpler logic. 0.2.1: GBA: Converted the DMA registers into arrays, rather than having them as a gazillion different variables. GBA: Replaced the if() alpha-blending clamping mechanism with a simple LUT. GBA: Removed some apparently unnecessary if() statements in the graphics rendering code. GBA: Made a few experimental optimizations to the graphics rendering code( >> 24 changed to & 0xFF000000 in some of the priority comparison code). GBA: Played around with some optimizations in the "gfxDrawTextScreen" function. GBA: Restructured the CPU emulation code, so I don't have to recompile one giant file when I make a small change(and so it doesn't use totally obscene amounts of RAM during compilation). GBA: The sound flushing routine was returning and setting the wrong values, totally breaking the speed-throttling code. Fixed. GB: Slightly increased the video contrast and brightness of the original GameBoy's emulation. GBA: Extended the BLIP buffer size, fixing a startup emulator crash with "Midway's Greatest Arcade Hits", and possibly other games. Updated the documentation with better explanations in a few areas, and fixed a few errors. 0.2.0: (Sorry, I lost track of changes, but... 0.2.0 is kind of like an entirely new emulator! :b) 0.1.1: SDL_QUIT events are now handled properly. Increased the default fast-forward speed to 4x. Fast-forwarding will now invoke the emulation frame-skip code, to achieve much higher fast-forwarding speeds. Fast-forwarding with frame skipping code may break some games, but I haven't encountered any yet... Jitter correction is now done when configuring virtual input devices and command keys, and the button pressed is on a physical joystick/gamepad. This is particularly necessary for some(all?) analog joysticks connected via the ancient gameport interface on the PC, at least under Windows 98 ;). Various code cleanups and subtle usability fixes. The "cheats" subdirectory under the Mednafen base directory is now created on startup(broken in 0.1.0). Fixed sound code used when expansion channels are used and the internal pre-downsample target format is floating-point. Added error condition checks and more verbose error messages to various pieces of code. Implemented a modified version of the old PPU rendering code that is used when it is safe to do so. This helps to offset the increased CPU requirements of the new code. The command-line option "-nothrottle" works again. Joysticks are now configured by a unique hash id, instead of by index number. This should help if people install or uninstall joysticks. It has not been tested, but the code structure was copied from the old Win32 port of FCE Ultra, so it should work. Note that this change will break old button configurations in the configuration file from 0.1.0. Fixed mapper 19's(Namco 106) expansion sound. It now actually outputs sound(broken in 0.1.0)! Rewrote large parts of the PPU rendering code to be more accurate, and slower. :/ This fixes Final Fantasy's "orb lighting" effect, and Micro Machines' title screen, among others. Reads from $2004 will now return something meaningful to the games "Bee 52" and "Micro Machines"(it returned nothing meaningful before, so it shouldn't break anything). This, combined with the correct background palette selection used when sprites and background are disabled, fixes some graphical issues in Micro Machines and Bee 52. Internal text rendering will now truncate strings that are too long to fit on the screen (an issue with NSFEs and song titles...). Is there a better, sane way to deal with this? Added support for loading NSFE files, and made changes to the NSF player to display more information if it's available. file.cpp: The FCEU_f* wrapper functions will now always load the entire file into memory on FCEU_fopen(). I hope people don't do something silly like trying to load a 1GB file of garbage. ;) I might add mmap() capabilities in the future. Reworked the UNIF/FDS/iNES/NSF file loading code. Removed the "en" translation from the po directory, since it was a bit...redundant or silly. If you did a "make install" with 0.1.0, you should run a command like: rm /usr/local/share/locale/en/LC_MESSAGES/mednafen.mo Fixed a compile-time error in general.cpp when the asprintf() emulation function is used. Replaced the SDL WM icon with a scaled image of the Mednafen Beetle. Fixed the Super24-in-1 bootleg cart board emulation by removing a line of silly debug(?) code. Added FCEU_indent() function, for use with FCEU(I)_printf(), to automatically set indentation for newlines, rather than having it in the format strings directly. This should make strings in the gettext catalogs more manageable. config.h is now used instead of passing gobs of defines on the command-line to g++/gcc. Added code and an MDFNI_* interface to set the sound speed multiplier from the driver code, and modified the driver code to use it. This is MUCH better than the method used in 0.1.0, which was just telling FCE Ultra to reinitialize sound at a different rate whenever fast forwarding started and stopped(which caused clicking). The sprite hit flag will no longer be set if the sprite hit would occur on pixel column 255, which matches behavior on the NES. 0.1.0: Miscellaneous things I've forgotten about. Command-keys and virtual input devices are now configurable while a game is running. gettext is now used to provide message lookup services. Implemented crude Unicode rendering of internal in-game text messages, and several fixed-width fonts covering most western languages, Japanese, Chinese, and Korean. Added 2xSaI, Super2xSaI, and SuperEagle video filters, and reordered the integer->filter mappings(used on the command line). Should I parse for a string instead of an integer on the command-line? Converted Mednafen to compile with GCC's C++ compiler, though no advanced C++ features are used yet. Fixed mapper 165 emulation with code from CaH4e3. VS Unisystem and Famicom Disk System commands are now saved in recorded movies. Video blits and special effects are now done in a thread separate from the game emulation and sound output thread. Command keys are now user-configurably(wow, it happened before the 22nd century!). Fixed emulation of MMC5's $5130 register. Fixed sound sweeping emulation; thanks to blargg. Corrected the behavior of mapper 144 to match what the hardware does regarding bus conflicts. Removed the low quality sound emulation code, and replaced the old high-quality sound emulation filter code with newer code that can output to arbitrary rates and uses SIMD instructions if available. Fixed a rather stupid bug that could break loading of certain non-bankswitched NSFs.