Skip to content

Conversation

@skyfloogle
Copy link
Contributor

@skyfloogle skyfloogle commented Jun 21, 2025

This pull request introduces a number of changes to the Virtual Boy emulator to make it more accurate to how the original hardware behaves. These changes are based on my own testing of the hardware.

The most significant change is that writes to wave channels are ignored if any sound is playing. All VGM files created by Furnace before version 0.6.8 rely on this being emulated incorrectly.

Other behaviours are relied on by certain games, e.g. the homebrew game Hyper Fighting constantly writes to S5EV1 to keep the noise channel at a standard value, so that it can be modulated for sample playback.

With that in mind, maybe you'd want to keep the original version as a separate core? Does this project prefer accuracy or compatibility with existing files?

General:

  • Writes to wave RAM are ignored if any sound is playing.
    Noise:
  • Writing to S5EV1 resets the noise register.
  • Added an additional invert to the noise output when moving to the next sample.
    Envelopes:
  • After an envelope is completed (i.e. the tick after it hits 0 or 15), if repeat is off, then from the next time SxEV0 is written to, no envelopes can occur again until S*INT is written to. This check happens even if enveloping is turned off (e.g. direction set to descend and volume is set to 0).
    Sweep/modulation:
  • Writes to the modulation table are ignored if channel 5 is playing.
  • When the sweep value overflows, the channel is muted. This occurs even if frequency modification is disabled (but not if modulation is enabled).
  • When frequency modification is enabled, regardless of whether it's in sweep or modulation mode, the modulation index increases.
  • When the modulation index overflows, some flag is primed, but not fully activated unless modulation is enabled (i.e. if it overflows during modulation, it'll activate instantly, but if it overflows during a sweep, it'll wait until the mode is changed to modulation).
  • When this flag is activated, no modulation occurs if repeat is disabled, but also no sweep happens whatsoever.
  • This flag is reset by writing to S5INT.
  • Writing S5FQ* during modulation leads to the output frequency having its corresponding byte locked to what was just written. This is unlocked when writing to literally anywhere in the VSU's address space, including wave RAM and unassigned registers.

@ValleyBell ValleyBell merged commit 6ff896f into ValleyBell:master Jul 14, 2025
8 checks passed
@ValleyBell
Copy link
Owner

Thanks!

I prefer accuracy over "buggy emulation", actually. But for cases that are really severe, I sometimes add options that allow the "old" behaviour. (I have such an issue with old GameBoy VGMs as well.)
I added an option to the sound core that allows waveRAM writes anytime with 5fcfe30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants