Skip to content

GB_set_highpass_filter_mode

Lior Halphon edited this page Nov 30, 2024 · 3 revisions

Definition

typedef enum {
    GB_HIGHPASS_OFF,
    GB_HIGHPASS_ACCURATE,
    GB_HIGHPASS_REMOVE_DC_OFFSET,
    GB_HIGHPASS_MAX
} GB_highpass_mode_t;

void GB_set_highpass_filter_mode(GB_gameboy_t *gb, GB_highpass_mode_t mode);

In apu.h

Description

A real Game Boy has its audio output going through a high-pass filter before reaching the built-in speaker or headphones, which removes the variable DC offset the digital output generates. This function controls the high-pass filter the emulator instance uses:

  • GB_HIGHPASS_OFF: No high-pass filter is used, and the DC offset remains.
  • GB_HIGHPASS_ACCURATE: A simple high-pass filter is applied; this setting best represents the hardware behavior.
  • GB_HIGHPASS_REMOVE_DC_OFFSET: The DC offset is separated from the actual waveform, and a simple high-pass filter is only applied to the DC offset part.

Thread Safety

GB_set_highpass_filter_mode is thread-safe and can be called from any thread and context.

Notes

Keep in mind that the DC offset is not constant before applying the high-pass filter.

Clone this wiki locally