Skip to content

Releases: jsgroth/jgenesis

v0.8.3

07 Dec 18:39
Compare
Choose a tag to compare

Highlights: Audio enhancements and improvements for Genesis/Sega CD/32X, a few input/hotkey-related fixes, and a few random other features (e.g. Game Boy custom palette option)

Save states are not compatible with earlier versions


New Features

  • (Genesis / Sega CD / 32X) Added an audio setting to select 1 of 4 different audio low-pass filters, with cutoff frequencies ranging from about 15000 Hz (comparable to the existing filter) to about 5000 Hz (produces a very soft sound)
    • Some hardware models had hardware low-pass filters with fairly low cutoff frequencies, and some game audio seems to be designed around this (e.g. anything that regularly plays the PSG's noise channel at ultrasonic frequencies, like Gunstar Heroes)
    • The difference is also quite noticeable in Sega CD games that use the PCM sound chip, where a strong low-pass filter can clean up some (not all) of the audio aliasing
  • (Genesis / Sega CD / 32X) Added a video setting to enable/disable individual graphics layers
  • (Sega CD) Added an audio enhancement setting to apply cubic Hermite interpolation to PCM sound chip channels
    • This significantly reduces audio noise and audio aliasing in games that play music or voice acting through the PCM chip (e.g. Lunar: Eternal Blue all the time, Sonic CD in past stages, basically every FMV game for cutscene audio)
  • (GB) Added an option to use a custom 4-color palette, with a color picker UI for configuring the custom palette colors
  • Added a new hotkey that completely exits the application (#140)
    • The previous "quit" hotkey (which only closed the currently running game) has been renamed to "power off"

Improvements

  • (32X) PWM chip audio output resampling now uses cubic interpolation rather than a filter that assumed a source frequency of 22 KHz; this should improve audio quality in games that use PWM sample rates other than 22 KHz (e.g. After Burner Complete and Space Harrier)
  • Input mappings that use modifier keys (Shift / Ctrl / Alt) no longer distinguish between Left and Right versions of the modifier, e.g. Left Shift and Right Shift are now both treated as simply "Shift" for input mapping purposes (#139)
  • Redesigned most of the audio low-pass filters to explicitly target a cutoff frequency of about 15000 Hz with a stopband edge frequency of about 20000 Hz, which should further reduce resampling-related audio aliasing
    • For performance reasons, NES and GB/GBC instead target a cutoff frequency of roughly 10000 Hz with a less steep attenuation slope past the cutoff frequency
  • Implemented a performance optimization in how audio low-pass filters are applied when running on CPUs that support x86_64 AVX and FMA instructions (which is almost every x86_64 CPU made in the last 10 years; AVX2 is not needed)
    • To be clear, AVX/FMA instructions are used when supported but are not a hard requirement
  • (SMS / Game Gear / Genesis) Improved video memory viewer UI so that it's now possible to view CRAM and VRAM simultaneously, as well as current VDP settings (captured once per frame at the beginning of VBlank)
  • Display scale factor / DPI is now taken into account when determining initial emulator window size in windowed mode
  • GUI: The GUI window is now repainted immediately when a directory scan finishes, rather than requiring mouse movement or a keyboard input to trigger the repaint

Fixes

  • (32X) Fixed the 68000 incorrectly being allowed to change the PWM timer interrupt interval via PWM control register writes ($A15130); this fixes Primal Rage having horribly broken sound effects
  • Fixed an input configuration bug that made it effectively impossible to correctly configure any gamepad where SDL reads digital buttons as analog axes, such as the 8BitDo M30 with its C and R buttons (#135)
    • The v0.8.2 input changes broke this more, but this also did not work correctly in earlier versions - the configuration UI would set the axis direction to opposite what it was supposed to be (e.g. negative instead of positive)
  • Fixed some minor bugs in the common audio resampling code related to how low-pass filters are applied
  • CLI: For options that only accept a fixed set of possible values, the list of possible values in the help text is now auto-generated at compile time; this fixes at least one case where the list of possible values was incorrect

v0.8.2

10 Nov 20:16
Compare
Choose a tag to compare

Mostly frontend improvements, the highlights being improved video/audio sync and more flexible input/hotkey mapping. Also adds Genesis overclocking support.

Input/hotkey configuration is not compatible with previous versions; input configuration is now stored in a different format, and all input-related settings will one-time revert to defaults if using a config file from a previous version

Save states are not compatible with previous versions


New Features

  • Video/audio sync improvements which should enable significantly improved frame pacing without needing to rely on 60Hz VSync (which can cause very noticeable input latency on some platforms)
    • Added a new "frame time sync" option that uses the host system clock to match the emulated system's framerate and frame timing as closely as possible without relying on host GPU synchronization (i.e. VSync)
    • Added a new option for dynamic audio resampling ratio, which periodically adjusts the audio resampling ratio to try and avoid audio buffer underflows and overflows (which both cause audio popping)
      • This is implemented in a very conservative way in order to avoid audible differences in audio pitch, so it is not completely guaranteed to prevent audio buffer underflow/overflow
    • Audio sync now checks the audio buffer size every 16 samples enqueued rather than only checking once per frame, which should significantly reduce stuttering when audio sync is enabled without VSync or frame time sync
    • Adjusted default sync/audio settings values to hopefully make stuttering and audio popping less likely when running with default settings
    • In the GUI, video/audio sync settings have been moved to a new window under Settings > Synchronization
  • Input mapping overhaul to make input mapping/configuration more flexible (#134 / #137)
    • Keyboard and gamepad settings are no longer separate configurations; each system now supports up to 2 mappings for each emulated button where each mapping can be a keyboard key, a gamepad input, or a mouse button
    • Key/input/button combinations (2 or 3 simultaneous inputs) are now supported for mappings in addition to individual keys/inputs
    • Hotkeys can now be mapped to gamepad inputs, mouse buttons, and combinations in addition to individual keyboard keys
    • Each input settings window now has a button to apply one of two keyboard presets for P1 inputs, one with arrow keys mapped to the d-pad and one with WASD mapped to the d-pad
  • Added a new set of hotkeys for saving/loading specific save state slots (#134)
  • (Genesis / Sega CD / 32X) Added an option to overclock the main Genesis CPU (the 68000) by decreasing the master clock divider, which can reduce or eliminate slowdown in games (#133)
    • Note that this is a fairly naive form of overclocking that works very well in many games but very poorly in some games; use with caution
    • As far as SCD/32X, from my testing overclocking the 68000 almost always causes problems in 32X games (which are normally bottlenecked on SH-2 speed anyway), but it does fix slowdown in some Sega CD games
  • (SMS / Game Gear) Replaced the "double Z80 CPU speed" setting with an option to overclock at finer granularity by decreasing the Z80 master clock divider
    • Same caveat as above regarding this form of overclocking working very poorly in some games, and this is more of an issue for SMS/Game Gear than it is for Genesis/Sega CD
  • Added an option to only hide the mouse cursor when in fullscreen, in addition to the previous settings of "always hide" and "never hide"
  • Added an option to change the fullscreen mode from borderless to exclusive
  • Added an option to change the audio output frequency from 48000 Hz to 44100 Hz

Improvements

  • (Genesis / Sega CD) Slightly improved performance by advancing the emulated clock in larger intervals while a long VDP DMA is in progress
  • (32X) Slightly improved performance by optimizing SH-2 instruction decoding
  • (GB) Improved video frame delivery behavior when the PPU is powered off to make it play a little nicer with VSync and frame time sync
  • The emulator window is now explicitly focused/raised when a game is loaded; previously this wouldn't always happen automatically, particularly on Windows

Fixes

  • (Sega CD) Slightly extended the delay between a game sending a CDD Play/Read command and the CD drive reading the first sector; this fixes Time Gal having excruciatingly long "load times"
    • "Load times" in quotes because the game was actually getting confused and repeatedly re-reading the same CD-ROM sectors until various interrupts happened to trigger at exactly the right times relative to each other
  • (Sega CD) Fixed a bug where some backend settings would not correctly persist after loading a save state (they would temporarily revert to what they were when the save state was created)

v0.8.1

15 Oct 20:27
Compare
Choose a tag to compare

Small release with mostly bugfixes and a few save state-related features

SMS/Game Gear and NES save states are not compatible with previous versions, other systems' save states should be compatible

Features

  • Made the game save file and save state locations configurable (#132)
    • Can be set to the same folder as the ROM image (same as previous behavior), subdirectories in the emulator folder, or custom paths
  • Added a new --load-save-state <SLOT> command-line arg to load a specific save state slot at game launch (#132)
  • Added an option to attempt to load the most recently saved state when launching a game
    • If this option is set when there are no save states or the most recent state cannot be loaded, the game will boot normally
  • (Game Gear) Added an option to render at SMS resolution (256x192) instead of native resolution (160x144)
    • The expanded parts of the frame often contain garbage because they weren't meant to be visible, but they sometimes contain an expanded playfield

Fixes

  • (Sega CD) Fixed a bug where loading a save state could possibly crash the emulator due to a stack overflow; this was particularly likely to happen on Windows due to the small default stack size
    • This was caused by the state deserialization code inadvertently deserializing some very large arrays into the stack before moving them to the heap, rather than deserializing directly into the heap
  • (SMS/Game Gear) Fixed the VDP display disabled implementation so that it properly blanks the display rather than leaving the previous frame onscreen
  • (SMS) Fixed the NTSC/PAL and SMS Model settings not having any effect when loading a game from a .zip/.7z file rather than a .sms file
  • (NES) Fixed multiple bugs related to how the PPU determines what color to display when rendering is disabled while PPUADDR points to palette RAM; this fixes Micro Machines having a solid gray bar in the middle of the title screen, as well as several test ROMs that rely on this hardware quirk for high-color display (#53 / #55 / #56)
  • GUI: Saving or loading a save state slot from the GUI window now also changes the selected save state slot
  • CLI: Fixed the 32X option missing from the help text for the --hardware arg (#131)
  • The video memory viewer window now renders without VSync; this fixes likely stuttering and audio popping while the memory viewer window is open

v0.8.0

16 Sep 21:52
Compare
Choose a tag to compare

Highlights

  • Added support for 32X emulation (with a caveat regarding performance)
  • Significant audio quality improvements for Genesis / Mega Drive and SNES
  • Support for loading directly from .zip and .7z files
  • Lots of Genesis / Mega Drive bugfixes

32X Notes

  • All released 32X games plus Doom 32X Resurrection should be playable except for the 6 FMV games that require the Sega CD 32X combo
    • Doom 32X Resurrection features that require Sega CD do not currently work (CD-DA music, offloading some audio processing to the Sega CD 68000)
  • SH-2 CPU cache and basic SH-2 memory access timings are emulated, so overall SH-2 speed should be moderately accurate (though still faster than actual hardware in some cases)
  • SH-2 emulation is currently not optimized well - full-speed 32X emulation requires a CPU with decent single-core performance, and fast-forward speed will be very limited
    • For a comparison point, the Steam Deck CPU barely runs 32X at full speed from my testing
    • This will likely improve in a future release - the current implementation is pure interpreter because that was easiest to implement and it (surprisingly) still runs at full speed with a fast enough host CPU

New Features

  • Added support for loading directly from .zip and .7z compressed archives for every console except Sega CD (#91)
    • Archives containing multiple images are only partially supported; in this case the emulator will always load the first file with a recognized file extension
  • (SNES) Added an audio enhancement option for cubic Hermite interpolation between decoded ADPCM samples, which usually makes the audio sound sharper and less muffled
    • The difference is most noticeable in games that use low sample rate audio, such as the Donkey Kong Country trilogy
    • This is off by default because it pretty radically changes the sound in some games
  • (Genesis) Added an option to have no controller plugged into one or both of the controller ports, for games that behave differently based on the presence or absence of a controller (#113)
  • (NES) Added support for the UNROM 512 mapper (iNES mapper 30), a homebrew mapper used by a number of games including Black Box Challenge and Battle Kid 2 (#73 / #86)
    • This mapper unusually supports flash memory mapped as PRG "ROM"; for the games that have this (e.g. Black Box Challenge), it's emulated by persisting the entire current contents of PRG ROM to the save file whenever the game modifies itself
  • (GB) Added partial support for the Hudson HuC-3 mapper, used by Robopon and a few Japan-only games (#89)
    • "Partial" because the builtin speaker, the IR sensor, and parts of the event/alarm functionality are not emulated
  • GUI: Added a new "Open Using" menu option to open a file using a specific emulator core, rather than always choosing the core based on file extension (#121)
  • GUI: Added an option to explicitly set the UI theme to light or dark rather than always using the system default

Improvements

  • (Genesis) YM2612 DAC crossover distortion (aka the "ladder effect") is now emulated, which significantly improves music accuracy in a number of games; this is extremely noticeable in Streets of Rage, Streets of Rage 2, and After Burner II, among others
    • There is also a new option to disable ladder effect emulation, since the effect was less pronounced on later console models (and also because I think it's neat to hear how it affects the sound by toggling a checkbox)
  • (SMS/GG/Genesis) Replaced the PSG and YM2612 low-pass filters with much more aggressive ones; this should generally improve audio quality, and in some cases will remove erroneous buzzing/popping noises that were present before (e.g. in The Adventures of Batman & Robin) (#108)
  • Improved audio output behavior for all emulator backends, which should significantly reduce the likelihood of audio pops caused by audio buffer underflow
  • GUI: Added help text to most options menus
  • GUI: Improved performance when the main list table is large

Genesis / Mega Drive Fixes

  • Fixed the PSG's noise channel not oscillating when the period is set to 0 (which should behave the same as period of 1); this fixes missing high-frequency noise in Knuckles' Chaotix among other games
  • Fixed a degenerate case for performance when a game repeatedly writes the same value to specific VDP registers during active display, as After Burner Complete does
  • Fixed some 68000 CPU bugs discovered while working on 32X support
    • Implemented line 1010/1111 exception handling for when the 68000 executes an illegal opcode where the highest 4 bits are 1010 or 1111; Zaxxon's Motherbase 2000 depends on this to boot
    • Fixed divide by zero exception handling pushing the wrong PC value onto the stack; After Burner Complete frequently divides by zero and depends on correctly handling the exception
    • Fixed the DIVS instruction finishing way too quickly in some cases where the division overflows a signed 16-bit result but the CPU doesn't detect the overflow early
  • Fixed an off-by-one error in determining whether to set the sprite overflow flag in the VDP status register; this fixes flickering sprite graphics in Alex Kidd in the Enchanted Castle (#125)
    • This was a regression introduced in v0.6.1 as part of the changes to get Overdrive 2's textured cube effect working
  • Adjusted how writes to the controller CTRL registers ($A10009 / $A1000B) affect the controller's TH line; this fixes controls not working properly in Trouble Shooter (#110)
  • Made it possible for games to read the VINT flag in the VDP status register as 1 slightly before the 68000 INT6 interrupt is raised; this fixes Tyrants: Fight Through Time and Ex-Mutants failing to boot (#127)
  • Implemented undocumented behavior regarding how the Z80 BIT instruction sets the S and P/V flags; this fixes missing audio in Ex-Mutants, which relies on this behavior in its audio driver code
  • Implemented approximate emulation of memory refresh delay
    • This is emulated by simply stalling the 68000 for 2 out of every 128 mclk cycles, unless it executes a very long instruction that doesn't access the bus mid-instruction (e.g. multiplication or division)
    • Memory refresh delay is not emulated in 32X mode because it seemed to break audio synchronization between the Genesis and 32X hardware in some games
  • Added SRAM mappings for several games that have SRAM in the cartridge but don't declare it in the cartridge header: NHL 96, Might and Magic, and Might and Magic III (#107 / #116 / #117)
  • Little-endian ROM images are now detected and byteswapped on load; this along with a custom ROM address mapping fixes Triple Play failing to boot (#112)
  • The emulator will now recognize the unconventionial region string "EUROPE" as meaning that the game only supports PAL/EU; this fixes Another World incorrectly defaulting to NTSC/US mode instead of PAL/EU (#122)
  • Unused bits in the Z80 BUSACK register ($A11100) now read approximate open bus instead of 0; this fixes Danny Sullivan's Indy Heat failing to boot (#120)
  • Improved VDP DMA timing; this fixes corrupted graphics in OutRunners (#118)
  • The vertical interrupt is now delayed by one 68000 instruction if a game enables vertical interrupts while a vertical interrupt is pending; this fixes Sesame Street: Counting Cafe failing to boot (#119)
  • The Z80 BUSACK line now changes immediately in response to bus arbiter register writes instead of waiting for the next Z80 instruction time slot; this fixes the Arkagis Revolution demo failing to boot (#123)
  • The emulator will now enable the bank-switching Super Street Fighter 2 mapper if the cartridge header declares the system as "SEGA DOA" in addition to the standard value of "SEGA SSF"; this fixes the Demons of Asteborg demo not working properly (#115)

Other Fixes

  • Fixed save state slots not working properly if the ROM filename contains multiple dots; before this fix, only one slot would ever be used
  • (Sega CD) When a game issues a CDD command while the drive is playing, the drive now continues to read one more sector before it changes behavior in response to the new command; this fixes Radical Rex crashing during the intro (#100)
  • (Sega CD) Writes to PRG RAM by the main CPU and the Z80 are now blocked unless the sub CPU is removed from the bus; this fixes Dungeon Explorer from crashing after the title screen (#104)
  • (Sega CD) The sub CPU is now halted if it accesses word RAM in 2M mode while word RAM is owned by the main CPU, and it remains halted until the main CPU transfers ownership back to the sub CPU. This fixes glitched graphics in Marko's Magic Football (#101)
  • (Sega CD) Various fixes to CDC register and DMA behavior; with this plus all of the above fixes, the emulator now fully passes the mcd-verificator test suite (#105)
  • (NES) The UxROM mapper code (iNES mapper 2) no longer assumes that the cartridge has no PRG RAM; this fixes Alwa's Awakening: The 8-Bit Edition failing to boot (#93)
  • (SNES) Adjusted timing of PPU line rendering to occur 4 mclk cycles later; this fixes Lemmings having a flickering line at the top of the screen during gameplay
    • This worked correctly prior to v0.7.2 - it was broken by the CPU timing adjustment that fixed Rendering Ranger R2 from constantly freezing
  • (GB) Fixed the window X condition incorrectly being able to trigger when WX=255 and fine X scrolling is used (SCX % 8 != 0); this fixes corrupted graphics in Pocket Family GB 2
  • Fixed the emulator crashing if prescale factor is set so high that the upscaled frame size exceeds 8192x8192 in either dimension

v0.7.2

31 May 19:12
Compare
Choose a tag to compare

Summary: Multiple save state slots, NES Zapper support, and a laundry list of bugfixes (mostly for Game Boy / Game Boy Color)

Save states from earlier versions are not compatible, in-game saves will still work

Features

  • (NES) Added support for the Zapper light gun used by Duck Hunt, Wild Gunman, and some other games (#25)
  • The emulator now supports up to 10 save state slots per game (#22)
    • There are new next/previous slot hotkeys to select a slot for quick save/load via hotkey, and there is a new sub-menu in the GUI to save/load any slot
  • The CLI now reads the same jgenesis-config.toml config file as the GUI (#24)
    • It reads from the same path by default, and there is also an optional --config arg to override the config file location
    • Most of the previously-existing command line args are still present, but they now function as temporary config overrides rather than being the only way to configure the CLI

Improvements

  • (Master System / Game Gear) Cartridge RAM is now assumed to be battery-backed if a game ever accesses it, after which it will be persisted to disk any time it's modified
    • There was already a "database" of games that have battery-backed RAM, but that solution was checksum-based and thus did not work for patched games (e.g. fan translations)
  • Replaced the egui_wgpu_backend library with the offical egui-wgpu integration; this fixes various rendering issues in the Memory Viewer window, most notably the aliased text

Game Boy [Color] Fixes

  • The serial port registers and interrupt are now properly emulated; this fixes a number of games from failing to boot (e.g. Razor Freestyle Scooter, Initial D Gaiden, LEGO Racers) or having game-breaking bugs (e.g. Alleyway, Stargate) (#27 / #28 / #29 / #45)
    • Peripherals (e.g. link cable) are not currently emulated, but these games all depend on how the serial port behaves when no device is connected
  • The joypad interrupt is now properly emulated; this fixes controls not working in The Lawnmower Man (#46)
  • Disabling the LCD now clears the screen after about a frame's worth of cycles instead of clearing it immediately; this fixes screen flashing during movies in A Bug's Life (#26)
  • Fixed the PPU blocking CPU access to VRAM and CGB palettes slightly too early when rendering begins; this fixes flickering colors in LEGO Racers (#29)
  • Added an exception to the DMG STAT write/interrupt bug where the spurious interrupt will no longer trigger if the HBlank STAT interrupt was previously enabled and the STAT write occurred during OAM scan; this fixes Initial D Gaiden from crashing upon starting a race (#28)
    • I'm not 100% confident this is accurate to actual hardware, but it doesn't break the two games that depend on this hardware bug (Zerd no Densetsu and Road Rash)
  • Fixed the DMG STAT bug incorrectly being able to trigger while the LCD is disabled; this fixes the splash screen not showing in Star Trek: 25th Anniversary
  • Implemented (part of) an obscure DMG-only window behavior where a single glitched pixel with color BGP[0] is drawn at the start of the line when the window is disabled, the window has previously rendered pixels in the current frame, and WX + SCX are aligned in a specific way; this fixes a minor visual glitch on the title screen of Star Trek: 25th Anniversary
  • Fixed incorrect logic in the window Y triggered check; this fixes corrupted graphics in Warriors of Might and Magic and Zen: Intergalactic Ninja (#30 / #40)
    • The previous logic was simply checking if WY==line at the start of a line, ignoring whether the window was enabled in LCDC. The check is now (WY==line AND window_enabled) and it's checked at the start and end of every line (checking only at the start of the line breaks the fairylake test ROM)
  • APU wavetable RAM is now pre-populated with values approximate to actual hardware at power-on; this fixes missing sound effects / music in Altered Space, R-Type, and Spot (#32 / #49)
  • In DMG mode, VRAM is now pre-populated with the Nintendo logo (copied out of the cartridge header) and a trademark symbol; this fixes the intro animations in X, Altered Space, and probably other games
  • HDMAs initiated during HBlank now begin immediately instead of waiting until the start of HBlank on the next line; this fixes corrupted graphics in The Little Mermaid II: Pinball Frenzy and 3-D Ultra Pinball: Thrillride (#35 / #58)
  • HBlank STAT interrupts no longer block LY=LYC STAT interrupts when both are enabled; this fixes corrupted graphics in Ken Griffey Jr.'s Slugfest (#37)
  • Fixed multiple bugs around the LY=LYC bit in the STAT register when LYC=0; together with the above two fixes, this fixes Worms Armageddon from crashing upon starting a new game (#44)
  • WRAM contents are now mostly randomized at power-on; this fixes the homebrew Minesweeper for Windows from freezing upon starting a new game (#31)
  • Implemented the obscure behavior of reading wavetable RAM while the wave channel is playing; this gets the emulator to pass the Demotronic demo's emulator detection (#34)
    • Timing is not cycle-accurate; the emulator still fails the relevant tests in both dmg_sound.gb and cgb_sound.gb
  • Improved timing around mid-scanline SCY/SCX writes; this fixes various effects in the Demotronic demo (#34)
  • Fixed timing of the LY=LYC STAT interrupt when LYC=0; combined with the above fix, this fixes the "gin & tonic trick" in the Mental Respirator demo (#41)
  • Fixed the CPU seeing mode 0->2 transitions in the STAT register slightly too early; this fixes the Space Waste demo from crashing at the start of the first effect (#48)
  • The (officially) undocumented PCM12 and PCM34 registers are now emulated; this fixes the GBVisualizer demo (#36)
  • In CGB mode, the first 67 bytes of HRAM are now pre-populated in the same way that the CGB boot ROM would populate them; this fixes GBVisualizer from playing music immediately instead of waiting for 2 seconds like it's supposed to (#36)

Non-GB Fixes

  • (Genesis) YM2612 channel L/R panning flags are now initialized to 1 instead of 0; this fixes missing audio channels in After Burner II as well as the missing low-volume ambient noise during the first ~45 seconds of the Overdrive 2 demo
  • (Genesis) Fixed the 3-button vs. 6-button controller setting being applied only after making a config change, not at game boot
  • (NES) Fixed a bug in parsing ROM sizes out of non-NES 2.0 ROM headers that caused certain test ROMs to crash the emulator due to having nonsense in the later iNES header bytes
  • (NES) Mapper bus conflicts are now emulated for CNROM (iNES mapper 3); this fixes corrupted graphics in Cybernoid (#79)
  • (SNES) Adjusted how INIDISP brightness affects colors, which fixes the image being slightly too bright when brightness is not min or max
  • (SNES) Added rudimentary support for mid-scanline brightness changes; this fixes the missing plane shadows in Air Strike Patrol
  • (SNES) Fixed how mid-scanline writes to BG scroll registers are handled; this fixes glitchy lines on the title screen of NHL '94 and fixes the glitchy "Good Luck" animation in Air Strike Patrol (#68)
  • (SNES) Fixed rendering when 512x448 interlaced mode is enabled mid-frame; this fixes briefing screens in Air Strike Patrol not rendering correctly
  • (SNES) Adjusted timings of 65816 CPU reads/writes so that reads occur at the beginning of the CPU cycle while writes occur at the end; this fixes Rendering Ranger R2 from almost always freezing during screen transitions
    • This game's CPU/APU communication code is extraordinarily timing-sensitive
  • (SNES) Improved handling of cartridges with non-power-of-two ROM sizes (which in actual hardware generally contained multiple ROM chips of different sizes)
  • (SNES) Super FX GSU memory accesses now ignore the highest bank bit; this fixes the VOXEL.smc Super FX demo from crashing (#62)
    • The emulator also now detects this demo and gives it 64KB of Super FX RAM instead of using the default 32KB, which fixes the demo rendering garbage after starting
  • (SNES) Fixed the 34 sprite-tiles-per-line limit not being applied correctly if the 34th tile is partway through a sprite that is more than 1 tile wide
  • (SNES) Fixed OAM priority rotation incorrectly rotating using bits 1-7 of OAM address instead of bits 2-8
  • (SNES) Implemented the "interlaced smaller OBJs" PPU flag (SETINI bit 1); together with the above fix, this fixes a broken effect in the SNES test cartridge's PPU test (stars at the end of the Mode 0 test)

v0.7.1

28 Apr 02:54
Compare
Choose a tag to compare

Summary: CHD support for Sega CD, AppImage builds for Linux, and a bunch of minor fixes/improvements (mostly SNES bugfixes) that have accumulated since the 0.7.0 tag

Features

  • (Sega CD) CHD files are now supported in addition to CUE/BIN files
  • (Sega CD) Added an option to load the CD-ROM image into RAM at startup, which significantly increases RAM usage (by up to 650MB for the largest CDs) but removes the need for the emulator to access disk after starting up
  • (NES) Added an option for whether or not simultaneous opposing directional inputs are allowed, which defaults to not allowed
    • Some NES games exhibit severe glitches when the game reads left+right or up+down pressed simultaneously, including Zelda II and Battletoads
  • (NES) Added support for the unlicensed mapper used by Action 52 and Cheetahmen II (iNES mapper 228)
  • Added a new Video option "auto-prescale" that will automatically adjust the image prescale factor based on the viewport size instead of requiring it to be specified manually

Fixes

  • (Genesis) Writes to higher-numbered VDP registers are now ignored while in mode 4 (SMS mode); this fixes glitchy graphics in Bass Masters Classic: Pro Edition
    • This game does not actually render any graphics while in mode 4, but it accidentally depends on the VDP ignoring certain register writes while it's in mode 4 due to it temporarily switching the VDP to mode 4 during some screen transitions
  • (NES) Fixed the MMC1 mapper not correctly handling the outer 256KB bank in games that have 512KB of PRG ROM; this fixes Dragon Quest III and Dragon Quest IV from failing to boot
  • (NES) Fixed the MMC5 mapper incorrectly applying extended attributes mappings while rendering is disabled; this fixes horribly glitched maps in the SimCity prototype cartridge
  • (SNES) Fixed the APU timers incorrectly continuing to tick while disabled; this fixes Jurassic Park from freezing after the title screen
  • (SNES) Implemented the 1-cycle delay that occurs for handling interrupts that trigger during a DMA; this fixes Wild Guns from having horribly glitched graphics during gameplay
  • (SNES) Super FX GSU instruction timings have been made more accurate, particularly for instructions that access RAM; this fixes occasional glitchy sprite graphics in Winter Gold which seems to be extremely sensitive to the GSU running too fast
  • (SNES) DMA is no longer allowed to access address bus B (PPU/APU/WRAM ports) through address bus A; this fixes incorrect color palettes in Krusty's Super Fun House
  • (SNES) Fixed several SA-1 and Super FX games incorrectly persisting cartridge RAM to disk when the actual cartridge did not have a battery backup (e.g. Star Fox and Dragon Ball Z: Hyper Dimension)
  • (SNES) Fixed the entire screen rendering one pixel too low in 512x448 interlaced mode
  • (SNES) Fixed forced blanking not clearing the bottom half of the frame buffer in 512x448 interlaced mode
  • (SNES) Fixed an off-by-one error in how the window is applied in high-resolution modes; this fixes the entire screen appearing as if shifted half a pixel to the left in Jurassic Park
  • (SNES) Fixed behavior when GPDMA and HDMA are simultaneously enabled on the same DMA channel (the HDMA should cancel the GPDMA)
  • (GB) Implemented the DMG STAT interrupt bug, where writing to the STAT register while any of the four STAT conditions is true will briefly enable all four STAT interrupt sources; this fixes Road Rash (GB version) and Zerd no Densetsu from failing to boot
    • This is emulated only in DMG mode because some Game Boy Color games do not work correctly if this behavior is emulated in CGB mode

Improvements

  • (Sega CD) Backup RAM and the RAM cartridge are now saved to separate files instead of concatenating them into a single 136KB file (the emulator will still load save files in the old format)
  • (SNES) Slight performance improvement in games that use the SA-1 coprocessor
  • Linux releases are now provided as AppImage packages instead of standalone binaries
    • Note these are built on Ubuntu 22.04 due to a dependency on a newer version of SDL2 than what Ubuntu 20.04 provides, so these builds will likely not work on distros more than a few years old
  • The renderer now caches GPU resources per-internal resolution instead of recreating everything on every internal resolution change; this eliminates a potential minor stutter that could have occurred any time a Genesis or SNES game changed its resolution (e.g. between 256x224 and 320x224 on Genesis)
    • This was particularly noticeable in Seiken Densetsu 3 / Trials of Mana (SNES), which changes resolution from 256x224 to 512x224 any time there is a text box onscreen and then switches back to 256x224 when the text box is gone
  • The "SNES adaptive" blur shader now behaves much more reasonably when used with non-SNES consoles; it now provides a lighter blur effect than the other shaders by upscaling to 2x native resolution before applying the blur (e.g. for Genesis in H320px mode, it internally upscales to H640px before blending with adjacent pixels)
  • Symbols and debuginfo are now stripped from release binaries which slightly reduces executable size

v0.7.0

01 Feb 03:11
Compare
Choose a tag to compare

Features

  • Added an emulation core for the Game Boy and Game Boy Color
    • This is somewhat based on my standalone GB/GBC emulator but is mostly a rewrite which should be more accurate
    • Supports MBC1/MBC2/MBC3/MBC5 cartridges, including the MBC3 real-time clock (used by Pokemon Gold/Silver/Crystal Version and 2 other games)
    • Supports a few different color palettes for GB mode and a few different color correction options for GBC mode
    • Supports an option to make games think they're running on a Game Boy Advance, which causes some GBC games to unlock additional content and/or use brighter colors (e.g. Shantae, The Legend of Zelda: Oracle of Ages/Seasons, Mega Man Xtreme 2)

Fixes/Improvements

  • (All) Updated published release builds to target x86-64-v2 CPUs instead of x86-64 CPUs (rustc's default for the x86_64 arch)
    • This should slightly improve performance at the cost of the published builds no longer working on CPUs made prior to 2009 or so. Builds from source will still work on older CPUs
  • (Genesis) Fixed a bug where the interlaced mode check was reading bits 0-1 of VDP register #12 instead of bits 1-2; this fixes single-screen interlaced mode from behaving as double-screen interlaced mode, which caused extreme graphical corruption in anything that used it (fixes #17)
  • (Genesis / Sega CD) Minor performance improvements in the VDP code and the main Sega CD loop
  • (SNES) Improved performance of the core PPU render loop, particularly when color math is enabled
  • (SNES) Games that use real-time clock chips now save the real-time clock state in a separate .rtc file instead of appending it to the end of the SRAM save file
    • This only affects 2 games, Tengai Makyou Zero (Epson RTC-4513 chip) and Daikaijuu Monogatari II (S-RTC chip)

v0.6.1

13 Jan 12:39
Compare
Choose a tag to compare

tl;dr: The Genesis core can now run the Titan Overdrive 2 demo

Features

  • (Genesis) Implemented a whole bunch of features and fixes to get the Titan Overdrive 2 demo working
    • Updated cartridge loading code to use the Super Street Fighter 2 mapper if the ROM header specifies its system as "SEGA SSF"; this fixes the demo from failing to boot
    • Implemented support for the 128KB mode for VRAM writes, which enables byte-size writes to VRAM
    • Implemented the VDP debug register, which enables a form of layer blending as well as limited rendering in the borders
    • Fixed YM2612 address and data port writes to work like actual hardware, where there is really only one data port and the register group written depends on which address port was last written; this fixes FM synth channels 4 and 5 not playing correctly in most scenes
    • Implemented approximate bus arbiter wait states for when the Z80 accesses the cartridge; this fixes the audio desyncing within a minute or two
    • Implemented the "invalid" scroll size and horizontal scroll mode settings; this fixes the Voronoi circles effect
    • Pretty much completely rewrote the sprite processing and rendering code to be more accurate to actual hardware; this fixes the 3D textured cube effect
    • Implemented more accurate VDP FIFO queue timing; this fixes the plasma twisters effect
    • Added options to render the horizontal and vertical borders instead of only rendering the active display area
    • Implemented all of the border rendering shenanigans that the demo depends on for the arcade scene and the following fade-out
    • Fixed a bug related to how per-two-cell vertical scrolling interacts with fine horizontal scrolling; this fixes garbage in the borders on some screens

Fixes

  • (All) Fixed an issue where rewind was not taking into account config changes made since the previous state was written to the rewind buffer
    • This was very noticeable if you changed aspect ratio and then immediately started rewinding. After rewind, the new aspect ratio would not take effect again until you made another config change
  • (Genesis) Fixed writes to VDP register 7 (background color) taking effect after the next rendered scanline instead of taking effect immediately; this fixes Titan Overdrive 1's double helix screen having a briefly flickering line at the bottom of the screen during the start of the effect

v0.6.0

05 Jan 22:12
Compare
Choose a tag to compare

tl;dr: Added an NES core and fixed a bunch of Genesis VDP bugs (Titan Overdrive 1.1 demo now works)

Features

  • (NES) Added a new backend core for the Nintendo Entertainment System (NES) / Famicom, forked/merged from my standalone NES emulator
    • Emulation should be very accurate aside from some APU DMC DMA quirks that aren't emulated (which no games depend on as far as I know)
    • Supports the most commonly used mappers (NROM, common NROM variants, MMC1, MMC3) as well as some less commonly used mappers (MMC2/4/5/6, Konami VRC2/4/6/7, a number of Namco and Bandai mappers, Sunsoft 5A/5B/FME-7, and a few others)
    • This fork adds a nametable/sprite/palette viewer, although since it updates per-frame it won't work completely correctly with games that make mid-frame rendering changes (fairly common in later NES titles, e.g. Super Mario Bros. 3 and Kirby's Adventure which both use MMC3 scanline interrupts to do a mid-frame CHR ROM bank switch from the background tile bank to the status bar tile bank)
  • (All) Added a new menu button to the GUI to open the Memory Viewer window, in addition to the previously existing hotkey
  • (All) Added a filter-by-title box to the GUI's main panel
  • (All) Added a per-console filter setting to the GUI to individually toggle which of the 6 supported consoles show up in the ROM list

Fixes/Improvements

  • (Genesis) Fixed a bunch of VDP bugs discovered while testing the Titan Overdrive 1.1 demo
    • Fixed a PAL-specific bug where the VBlank flag in the VDP status register was incorrectly reading 1 during part of the last scanline before active display; this fixes the demo from running way too fast at the start and then crashing
    • Fixed the VDP FIFO write delay implementation being pretty wildly incorrect; this fixes the spinning "no nintendo inside" board animation and the 512-color screen
    • Fixed the VDP not ignoring the lowest bit of register 5 (sprite attribute table address) in H40 mode; this fixes garbage sprites displaying over the scrolling 3D background screen
    • Fixed V interrupt timing to be closer to actual hardware; this fixes broken effects on the "we <3 evoke" screen and one of the later screens
      • VINT was previously delayed by ~100 mclk cycles (12.5 pixels in H40 mode / 10 pixels in H32 mode) compared to actual hardware because this fixed music tempo bugs in Earthworm Jim, but it seems I fixed whatever the actual cause was because those bugs did not reappear after removing the delay
    • Fixed a bug where changes to nametable address registers (2/3/4) during HBlank were taking effect after the next rendered scanline instead of taking effect immediately; this fixes jittery lines on the spinning 3D cube screen
      • This also fixes some graphical glitches in The Adventures of Batman & Robin which similarly changes nametable addresses during HBlank and expects the new addresses to take effect on the very next scanline
    • Implemented (somewhat) proper handling for reducing the number of sprites scanned and the number of sprite pixels displayed when display is disabled during part of HBlank; this removes the "your emulator suxx" text from the 512-color screen
      • This also enabled removing a sprite masking hack to fix some graphical glitches in Mickey Mania's 3D stages, which do something very similar
  • (Genesis) Fixed the VDP's control port write toggle not getting reset if a game attempts to write to the VDP data port while it is in read mode; this fixes Dynamite Headdy sometimes displaying extremely corrupted graphics during the intro depending on when exactly Start was pressed
  • (All) Fixed an annoying GUI issue where, if you changed input configuration while an emulator was running, the new configuration would not take effect until you moved the mouse over the main GUI window

v0.5.7

11 Dec 19:03
Compare
Choose a tag to compare

Every SNES coprocessor is now supported except for ST018, which I do not plan to implement because it would be a ton of work (it's a 32-bit ARMv3 CPU) and it was only used by an obscure Japan-only shogi game (Hayazashi Nidan Morita Shougi 2)

Features

  • (SNES) Added support for the Super Scope peripheral
    • Super Scope position is controlled using the mouse cursor, and Super Scope buttons can be mapped to either keys or mouse buttons
  • (SNES) Added support for the OBC1 "coprocessor", an OBJ controller chip used by Metal Combat: Falcon's Revenge
  • (SNES) Added support for the SPC7110 coprocessor, a data decompression chip used by Tengai Makyou Zero, Momotarou Dentetsu Happy, and Super Power League 4
    • This implementation does support the extended memory map required by Tengai Makyou Zero's fan translation, which expects the last 1MB of its 7MB ROM image to be mapped directly to banks $40-$4F
  • (SNES) Added support for the S-RTC coprocessor, a real-time clock chip used by Daikaijuu Monogatari II / Super Shell Monsters Story II
  • (SNES) Added support for older ROM images that have an unnecessary 512-byte copier header (typically files with the .smc extension)
  • (All) Added an option for whether to hide or show the mouse cursor when it is over the emulator window (it was previously always hidden, which was problematic in SNES Super Scope games)

Fixes/Improvements

  • (SNES) Fixed the PPU mosaic effect working pretty much completely incorrectly in Mode 7; this fixes mosaic effects in Yoshi's Safari which combines mosaic and Mode 7 for fade-in/fade-out effects
  • (SNES) Adjusted PPU rendering code to account for mid-scanline scroll register writes
    • This fixes glitchy scanlines in Battle Clash, which somehow managed to perfectly time a Mode 7 V scroll write such that the first byte is written before rendering starts and the second byte is written 5-10 pixels into the scanline
    • The implementation is not completely accurate because it doesn't account for some PPU registers being latched at the start of the line (and also because the timing of when the scroll write takes effect is almost certainly not 100% accurate), but very few games seem to do mid-scanline PPU register writes anyway
  • (All) Fixed a bug where changing the joystick axis deadzone setting in the GUI would not take effect until a new game was started
  • (SNES) Fixed a benign bug where the PPU's OAM address was always getting reloaded when forced blanking was disabled; instead, disabling forced blanking should only reload OAM address if it occurs on the first scanline of VBlank