Man Over Board
Loading...
Searching...
No Matches
psg.h File Reference

Defines the music and sound effect processes. More...

#include "global.h"

Functions

void write_psg (u8 reg, u8 val)
 
u8 read_psg (u8 reg)
 
void set_tone (u8 channel, u32 tuning)
 
void set_volume (u8 channel, u8 volume)
 
void enable_channel (u8 channel, enum Bool tone_on, enum Bool noise_on)
 
void stop_sound ()
 
void set_noise (u8 tuning)
 
void set_envelope (u8 shape, u16 sustain)
 
void bob_sound ()
 
void death_sound ()
 

Detailed Description

Defines the music and sound effect processes.

Group B: Thomas Kapocsi, Sylvie Mills

Author
Sylvie Mills

Function Documentation

◆ bob_sound()

void bob_sound ( )

Plays the sound effect for when the swimmer bobs up.

◆ death_sound()

void death_sound ( )

Plays the sound effect for when the player dies.

◆ set_envelope()

void set_envelope ( u8 shape,
u16 sustain )

Loads the PSG envelope control registers with the given envelope shape and 16-bit sustain.

◆ set_noise()

void set_noise ( u8 tuning)

Loads the noise register with the given tuning.

◆ write_psg()

void write_psg ( u8 reg,
u8 val )

Writes the given byte value (0-255) to the given PSG register (0-15). This is a helper routine to be used by the other functions in this module.