mirror of https://github.com/bsnes-emu/bsnes.git
![]() anomie's notes indicate that polling begins between cycles 32.5-95.5, but his notes were slightly off. 32.5-95.5 is referring to the PPU dot clock. If you multiply by 4 you get the cycle count, 130-382. It's pretty clear that in 256-cycle units, that would need to be 130-384 or you'd have no event when it lands on cycle 384. Jonas Quinn confirmed that with his testing in any case. I chose to split the cycle range in half and run things every 128 clocks. So that reduces us to 32.5-64.0, or 130 to 256 + 258-384. The reason I chose 128 over 256 was so I could emulate the time it takes to perform the joypad latching. I don't believe you can set the controller latch to 1 and then 0 immediately. It needs time to let the controllers see this happening and then release the latch, and time to let that take effect. Polling the controllers is only one operation so it makes sense that happens once every 256 cycles, which is why I have the (counter&1) test for that. Think about it this way: we know the polling sequence takes 4224 cycles, and 4224/256 is 16.5. Isn't that a little strange to have half a cycle? But if we consider the latching is actually twice as fast, then it's 2x128 + 16x256. If we run on a 128-clock counter, it becomes 2x128 + 16x2x128, or 34 total states. But now since we don't actually poll on the second half of each 16x2x256 states, we don't need to bother running the event there, so we can stop at 33 instead of 34 and it's the same thing. And by doing that, it turns our polling duration into 4224 cycles, just like we've observed. Fixes #61. |
||
---|---|---|
.assets | ||
.github/workflows | ||
bsnes | ||
hiro | ||
libco | ||
nall | ||
ruby | ||
shaders | ||
sourcery | ||
.cirrus.yml | ||
.gitattributes | ||
.gitignore | ||
CREDITS.md | ||
GPLv3.txt | ||
LICENSE.txt | ||
README.md | ||
update-subtrees.sh |
README.md
bsnes
bsnes is a multi-platform Super Nintendo (Super Famicom) emulator, originally developed by byuu, which focuses on performance, features, and ease of use.
Unique Features
- True Super Game Boy emulation (using the SameBoy core by Lior Halphon)
- HD mode 7 graphics with optional supersampling (by DerKoun)
- Low-level emulation of all SNES coprocessors (DSP-n, ST-01n, Cx4)
- Multi-threaded PPU graphics renderer
- Speed mode settings which retain smooth audio output (50%, 75%, 100%, 150%, 200%)
- Built-in games database with thousands of game entries
- Built-in cheat code database for hundreds of popular games (by mightymo)
- Built-in save state manager with screenshot previews and naming capabilities
- Customizable per-byte game mappings to support any cartridges, including prototype games
- 7-zip decompression support
- Extensive Satellaview emulation, including BS Memory flash write and wear-leveling emulation
- Optional higan game folder support (standard game ROM files are also fully supported!)
- Advanced mapping system allowing multiple bindings to every emulated input
Standard Features
- MSU1 support
- BPS and IPS soft-patching support
- Save states with undo and redo support (for reverting accidental saves and loads)
- OpenGL multi-pass pixel shaders
- Several built-in software filters, including HQ2x (by MaxSt) and snes_ntsc (by blargg)
- Adaptive sync and dynamic rate control for perfect audio/video synchronization
- Just-in-time input polling for minimal input latency
- Run-ahead support for removing internal game engine input latency
- Support for Direct3D exclusive mode video
- Support for WASAPI exclusive mode audio
- Periodic auto-saving of game saves
- Auto-saving of states when unloading games, and auto-resuming of states when reloading games
- Sprite limit disable support
- Cubic audio interpolation support
- Optional high-level emulation of most SNES coprocessors
- Optional emulation of flaws in older emulators for compatibility with older unofficial software
- CPU, SA1, and SuperFX overclocking support
- Frame advance support
- Screenshot support
- Cheat code search support
- Movie recording and playback support
- Rewind support
- HiDPI support
- Multi-monitor support
- Turbo support for controller inputs