An open API service indexing awesome lists of open source software.

https://github.com/tmagri/nes_oc_mister

MiSTer NES Overclock using CPU with VBlank Extension and APU Audio Stretch, Smooth Audio, Stereo Sound, and Epilectic-Friendly filter
https://github.com/tmagri/nes_oc_mister

apu epilectic-friendly-filter mister misterfpga nes oc overclock stereo-sound

Last synced: about 1 month ago
JSON representation

MiSTer NES Overclock using CPU with VBlank Extension and APU Audio Stretch, Smooth Audio, Stereo Sound, and Epilectic-Friendly filter

Awesome Lists containing this project

README

          

# [**Nintendo Entertainment System**](https://en.wikipedia.org/wiki/Nintendo_Entertainment_System) **for [MiSTer Platform](https://github.com/MiSTer-devel/Main_MiSTer/wiki)**

**⚠️ Fork Notice:** Due to the OC (Overclocking) feature, this is maintained as a separate fork due to potential instability. You may experience issues where reloading a ROM or numerous resets of the console are required to get the OC going. **Using savestates may also have issues (this has been improved recently).** Enjoy\! A huge thank you to the original NES\_MiSTer devs as well.

This is an FPGA implementation of the NES/Famicom based on [FPGANES](https://github.com/strigeus/fpganes) by Ludvig Strigeus and ported to MiSTer.

## **Fork Features & Updates**

### **NES Overclocking Methods**

A comprehensive suite of overclocking options designed to eliminate slowdowns while improving compatibility and stability across the NES library.

* **Auto (Default):** Intelligently selects the best OC method based on the loaded game's mapper. It defaults to the highly stable Postrender method for most games, but automatically switches to VBlank Extension for specialized mappers (like Konami VRC and MMC5) that require strict hardware synchronization.
* **Postrender Overclock:** Applies overclocking after the PPU’s render phase. Avoids CPU/PPU timing conflicts, especially around $2002 reads, reduces visual glitches, and improves frame pacing. Essential for eliminating lag in CPU-heavy games like *Kirby's Adventure*, *Final Fantasy III [J]*, and *Super Mario Bros 2 [FDS]*.
* **VBlank Extension:** A CPU-only overclocking method that utilizes VBlank extension to increase CPU frequency while maintaining standard 60fps video and cycle-accurate audio. Required for games like *Parodius* and *Castlevania III [J]* which use strict cycle-counting IRQs and break if the NMI is delayed.

**Performance Modes:**

* **Medium (1.50×) Mode:** A stable intermediate performance boost using dynamic PPU clocking and anti-jitter logic. Ideal and recommended for most games.
* **Extreme (100%) Mode:** Doubles the CPU speed. Uses a dedicated 1.78MHz mapper clock for proper cycle synchronization to preserve compatibility with complex mappers. Not recommended for most games.
* **APU Pitch Correction:** Dynamically scales expansion audio. Ensures that mappers with internal sound hardware (like VRC6/VRC7) maintain their original pitch and timing during overclocked gameplay.

### **High-Fidelity Stereo Audio Overhaul**

True Stereo Sound implemented with high-quality separation (enable "Stereo Mix" in OSD):

* **Left Channel:** Pulse 1, Triangle, and DMC.
* **Right Channel:** Pulse 2, Noise, and DMC.
* **Unified Mixing Logic:** Fixed "loud and clipping" audio in Mono mode by implementing a unified internal downmixing pipeline. Mono and Stereo now share the same gain structure and expansion audio balance.
* **Smooth Triangle (Pure Triangle/Sawtooth):** An optional audio‑interpolation system that smooths the NES’s stepped triangle and sawtooth‑like waveforms. It reduces digital harshness, aliasing, and stair‑step artifacts—especially noticeable when overclocking—while preserving accurate pitch and timing. The reduced bass may affect nostalgia or fondness for the original NES sound for some users.
* **Smooth Noise:** A togglable low-pass filter within the audio pipeline to mitigate harsh "pop" and transient artifacts in the NES noise channel.

### **Epileptic‑Friendly Filter (Temporal Frame Blending)**

A new optional accessibility feature designed to reduce rapid flashing sequences that may trigger discomfort or photosensitive reactions.

* Uses temporal frame blending: 25% current frame \+ 75% previous frame.
* Maintains pixel‑accurate timing with no spatial shift.
* Smooths out multi‑frame flash patterns (e.g., *Zelda II* death screen).
* Fully optional and non‑intrusive, preserving NES authenticity.

### **Mapper & Core Stability Improvements**

* **VRC Mapper IRQ Pause:** Implemented a new mechanism to gate cycle-based IRQ counters during the extended VBlank periods used in overclocking. This resolves graphical tearing and split-screen shaking in *Castlevania III (Akumajou Densetsu)* and other VRC-based titles.
* **Sync Improvements:** Decoupled timing-sensitive mapper logic from the CPU clock to ensure stable IRQ firing regardless of the overclocking percentage.

### **Advanced Compatibility Hacks (OSD)**

Added new toggles in the Advanced menu to support modern ROM hacks under accurate hardware conditions:

* **OAM Corruption:** Disables accurate PPU OAM corruption/decay when rendering is disabled mid-screen. This is required for some ROM hacks, such as the *Legend of Zelda Redux*, which can freeze during screen transitions due to accidental OAM scrambling. Set to "Disabled" to play these hacks.

## **Features**

* Supports saves for most games
* Savestates *(Note: May have issues in this OC fork)*
* Supports NTSC, PAL, and Dendy system types
* FDS Support with expansion audio
* Multiple Palette options
* Zapper, Powerpad, Microphone, and Miracle Piano support
* Supports four players
* Setting for increasing sprites per line by 8
* Supports up to 32 cheat codes
* Supports NSF Player
* Supports expansion audio from mappers including VRC6 & 7, MMC5, Namco 163 and Sunsoft 5b
* Supports many popular mappers including VRC1-7, MMC0-5, and many more (see below)
* Supports large games such as Legend of Link and Rockman Minus Infinity

## **Installation**

Copy the NES_OC_\*.rbf file to the directory or subdirectory of `/media/fat/`. Create a `games/NES/` directory on the root of the SD card (`/media/fat/games/NES/`), and place NES roms (\*.nes) inside this NES directory. The ROMs must have an iNES or NES2.0 header, which most already do. NES2.0 headers are preferred for the best accuracy. To have an NES or FDS game ROM load automatically upon starting the core, place it in the NES directory named as boot1.rom or boot2.rom, respectively.

- `boot0.rom` = FDS BIOS file. Will be used for any FDS images loaded
- `boot1.rom` = NES Cart file. Can be used with boot0.rom (BIOS) in place
- `boot2.rom` = FDS image file. Requires boot0.rom (BIOS). Use a blank FDS (header only) to boot the FDS BIOS without a disk image.
- `boot3.rom` = PAL file. It can be used to set your default custom palette. Save the menu option on "Custom" to apply immediately.

## **Famicom Disk System Usage**

Before loading \*.FDS files, you must first load the official, unpatched FDS BIOS. The BIOS file should be renamed to boot0.rom and placed in the same folder as the ROMs (NES). Alternatively, it can be loaded from the OSD if boot0.rom doesn't exist. After loading the core and the bios you may select an FDS image. By default, the NES core will swap disk sides for you automatically. To suppress this behavior, hold the FDS button on the player 1 controller. The "Disk Swap" OSD option manually controls the disk side. Each button press increments the disk side. Press and hold the fds button to eject and increment the disk side in this mode. Some games only work correctly in manual disk swap mode, and require holding the FDS button for up to a few seconds (Gall Force,...).

## **Extra Sprites**

This feature will double the number of sprites drawn per scanlines, decreasing the flickering sprites that NES is known for. Some games relied on the 8 sprite behavior to work correctly, such as Simon's Quest swamps. Other mappers may be impacted by using extra sprites. While it works well in most games, glitches may occur with this enabled.

## **Saving and Loading**

The battery backed RAM (Save RAM) for the NES does not write to disk automatically. After saving in your game, you must then write the RAM to the SD card by selecting **Save Backup RAM** from the menu. If you do not save your RAM to disk, the contents will be lost next time you restart the core or switch games. Alternatively you can enable to Autosave option from the OSD menu, and if you do your games will be recorded to disk every time you open the OSD menu. FDS saving uses the same method as for cartridge RAM saves. Save RAM is stored as a .sav file based on the NES/FDS filename in `/media/fat/saves/NES/`. Examples:
`Metroid (Japan) (Rev 3).fds` -> `Metroid (Japan) (Rev 3).sav`
`Legend of Zelda, The (USA) (Rev 1).nes` -> `Legend of Zelda, The (USA) (Rev 1).sav`

## **Savestates**
Core provides 4 slots to save and restore the state.
Those can be saved to SD Card or reside only in memory for temporary use (OSD Option).
Usage with either Keyboard, Gamepad mappable button, or OSD. Save states are stored as .ss files in `/media/fat/savestates/NES/`, with an underscore and the save slot number (1,2,3,4) preceding `.ss`. Example (save slot 1): `Metroid (USA).nes` -> `Metroid (USA)_1.ss`

Keyboard Hotkeys for save states:
- ALT+F1/F2/F3/F4 – save state
- F1/F2/F3/F4 – restore state

Gamepad:
- SAVESTATEBUTTON+LEFT/RIGHT prev/next savestate slot
- SAVESTATEBUTTON+START+DOWN saves to the selected slot
- SAVESTATEBUTTON+START+UP loads from the selected slot

## **Zapper Support**

The "Zapper" (aka Light Gun) can be used via two methods. You can select Peripheral: Zapper(Mouse) to use your mouse to aim and shoot with the left button. This mode uses relative mouse motion, so devices that rely on absolute coordinates will not work via this method. Alternatively, you can choose Zapper(Joy) to use the Analog stick to aim, and the defined Trigger button to fire. Guns such as Aimtrak have joystick modes which may be compatible with this method.

## **Miracle Piano Support**

The Miracle Piano is a MIDI keyboard compatible with the Miracle Piano Education System cart. To use it with SNAC, no further settings are needed. To use it with midilink, in the System Settings, set the UART connection to use MIDI. The piano will then be connected on controller port 1 as expected. The primary controller will automatically be assigned to port 2 as the cart expects. The header for the ROM file should be set to NES 2.0 with controller type (0xF) set to the Miracle Piano (0x19).

## Supported Mappers

|#||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|**0**|**1**|**2**|**3**|**4**|**5**||**7**||**9**|**10**|**11**|**12**|13||15|
|**16**||**18**|**19**|**FDS**|**21**|**22**|**23**|**24**|**25**|**26**|**27**|**28**||**30**|31|
|**32**|**33**|**34**|**35**|**36**|**37**|**38**|**39**|40|41|42|~~43~~|**44**|**45**|**46**|**47**|
|**48**|**49**|~~50~~|~~51~~|**52**|~~53~~|~~54~~|~~55~~|~~56~~|~~57~~|~~58~~|~~59~~|~~60~~|~~61~~|~~62~~|~~63~~|
|**64**|**65**|**66**|**67**|**68**|**69**|**70**|**71**|**72**|**73**|**74**|**75**|**76**|**77**|**78**|**79**|
|**80**|**81**|**82**|83|~~84~~|85|**86**|**87**|**88**|**89**|**90**|91|**92**|**93**|**94**|**95**|
|~~96~~|**97**||~~99~~|~~100~~|**101**|||**104**|105||107|~~108~~|~~109~~|~~110~~|**111**|
|**112**|**113**|**114**|**115**|~~116~~|~~117~~|**118**|**119**|~~120~~||~~122~~|**123**||~~125~~|~~126~~|~~127~~|
|~~128~~|~~129~~|~~130~~|~~131~~|**132**|**133**|**134**|~~135~~|**136**|**137**|**138**|**139**|**140**|**141**|142|**143**|
|**144**|**145**|**146**|**147**|**148**|**149**|**150**|**151**|**152**|**153**|**154**|**155**|**156**|157?|**158**|**159**|
|~~160~~|~~161~~|162|163|164|165|~~166~~|~~167~~|~~168~~|~~169~~||**171**|**172**|**173**|||
|||||**180**|~~181~~|**182**|~~183~~|**184**|**185**|~~186~~|**187**|~~188~~|**189**|**190**|**191**|
|**192**|**193**|**194**|**195**|**196**|**197**|**198**|**199**|~~200~~|~~201~~|202|203|204|**205**|**206**|**207**|
|**208**|**209**|**210**|**211**|212|213|214|**215**|~~216~~|**217**|**218**||||~~222~~||
|**224**|**225**|~~226~~|227|228|~~229~~|~~230~~|~~231~~|**232**|~~233~~|234|~~235~~|~~236~~|~~237~~|**238**||
|~~240~~|~~241~~|~~242~~|**243**|~~244~~|**245**|246||~~248~~|**249**|**250**|~~251~~|~~252~~||~~254~~|255|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|**263**|**268**|413|**547**|**552**|---|---|---|---|---|---|---|---|---|---|---|

Key: **Supported+Save state**, Supported, Limited Support?, ~~Not Supported~~. Mappers that are not existent or not useful are blank.