Skip to Content
The Alchemy Project

struct SoundVBlankState

How the tick wait and the VBlank handler share the sound driver's update, so that it runs once a VBlank, from whichever reaches it first.

Declared in sound_driver_symbols.h.

Fields

NameDescription
Uint8lastFrameThe low byte of FrameCount when the update last ran.
Uint8transferCountdownSoundInfo.transferCountdown as the update last left it: the VBlank handler copies it, the tick wait counts it a frame ahead.
Uint8soundTestActiveSet while the sound test runs: the tick wait then leaves the update to the VBlank handler.
Uint8updatingSet while the tick wait runs the update: the VBlank handler skips its own, and sySoundPlay ignores every sound.

Description

How the tick wait and the VBlank handler share the sound driver's update, so that it runs once a VBlank, from whichever reaches it first.

struct SoundVBlankState

Referenced by SoundVBlankStateWork and syVBlankHandler().

Definition at line 77 of file sound_driver_symbols.h.

Fields in detail

lastFrame

Uint8 lastFrame

The low byte of FrameCount when the update last ran.

transferCountdown

Uint8 transferCountdown

SoundInfo.transferCountdown as the update last left it: the VBlank handler copies it, the tick wait counts it a frame ahead.

soundTestActive

Uint8 soundTestActive

Set while the sound test runs: the tick wait then leaves the update to the VBlank handler.

updating

Uint8 updating

Set while the tick wait runs the update: the VBlank handler skips its own, and sySoundPlay ignores every sound.