libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
evmu_buzzer.h File Reference

Go to the source code of this file.

Data Structures

struct  EvmuBuzzerClass
 
struct  EvmuBuzzer
 

Macros

#define EVMU_BUZZER_NAME   "buzzer"
 
#define EVMU_BUZZER_PCM_BUFFER_SIZE   256
 
Type System

Type UUID and cast operators

#define EVMU_BUZZER_TYPE   (GBL_TYPEID(EvmuBuzzer))
 
#define EVMU_BUZZER(self)   (GBL_CAST(EvmuBuzzer, self))
 
#define EVMU_BUZZER_CLASS(klass)   (GBL_CLASS_CAST(EvmuBuzzer, klass))
 
#define EVMU_BUZZER_GET_CLASS(self)   (GBL_CLASSOF(EvmuBuzzer, self))
 

Functions

GblType EvmuBuzzer_type (void)
 

Detailed Description

EvmuBuzzer: Piezoelectric buzzer, PWM tone generation.

The EvmuBuzzer API encompasses everything pertaining to signal generation and driving the piezoelectric buzzer. It provides a front-end API for generating and playing tones, as well as a polymorphic event-driven back-end for buffering and playing the generated tones with an audio back-end.

Todo:
  • Stop playback when emulation halts
  • Have to emulate Timer1 mode 3 buzzer output
  • Have to emulate base timer PWM output mode
  • Document emulated modes
  • Document how to implement a new back-end
  • Represent PCM buffer as GblByteArray, resizable samples
Test:
  • PCMs generated from setting tones under different timer1 configs
  • signals for tone generation
Bug:
  • Mini PacMan has no sound
  • Still not quite handling T1ELDC perfectly
Author
2023 Falco Girgis

Definition in file evmu_buzzer.h.

Macro Definition Documentation

◆ EVMU_BUZZER

#define EVMU_BUZZER (   self)    (GBL_CAST(EvmuBuzzer, self))

Cast GblInstance to EvmuBuzzer.

Definition at line 41 of file evmu_buzzer.h.

◆ EVMU_BUZZER_CLASS

#define EVMU_BUZZER_CLASS (   klass)    (GBL_CLASS_CAST(EvmuBuzzer, klass))

Cast GblClass to EvmuBuzzerClass.

Definition at line 42 of file evmu_buzzer.h.

◆ EVMU_BUZZER_GET_CLASS

#define EVMU_BUZZER_GET_CLASS (   self)    (GBL_CLASSOF(EvmuBuzzer, self))

Get EvmuBuzzerClass from GblInstance

Definition at line 43 of file evmu_buzzer.h.

◆ EVMU_BUZZER_NAME

#define EVMU_BUZZER_NAME   "buzzer"

EvmuBuzzer GblObject name.

Definition at line 46 of file evmu_buzzer.h.

◆ EVMU_BUZZER_PCM_BUFFER_SIZE

#define EVMU_BUZZER_PCM_BUFFER_SIZE   256

Size of internal PCM buffer (bytes)

Definition at line 47 of file evmu_buzzer.h.

◆ EVMU_BUZZER_TYPE

#define EVMU_BUZZER_TYPE   (GBL_TYPEID(EvmuBuzzer))

GblType UUID for GblBuzzer.

Definition at line 40 of file evmu_buzzer.h.

Function Documentation

◆ EvmuBuzzer_type()

GblType EvmuBuzzer_type ( void  )

EvmuBuzzer's type ID.