summaryrefslogtreecommitdiff
path: root/apps/codecs/libgme/gb_oscs.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libgme/gb_oscs.h')
-rw-r--r--apps/codecs/libgme/gb_oscs.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/codecs/libgme/gb_oscs.h b/apps/codecs/libgme/gb_oscs.h
index 0cc9d3f567..7245b4ca50 100644
--- a/apps/codecs/libgme/gb_oscs.h
+++ b/apps/codecs/libgme/gb_oscs.h
@@ -37,9 +37,9 @@ struct Gb_Osc {
37// 11-bit frequency in NRx3 and NRx4 37// 11-bit frequency in NRx3 and NRx4
38static inline int Osc_frequency( struct Gb_Osc* this ) { return (this->regs [4] & 7) * 0x100 + this->regs [3]; } 38static inline int Osc_frequency( struct Gb_Osc* this ) { return (this->regs [4] & 7) * 0x100 + this->regs [3]; }
39 39
40void Osc_update_amp( struct Gb_Osc* this, blip_time_t, int new_amp ) ICODE_ATTR; 40void Osc_update_amp( struct Gb_Osc* this, blip_time_t, int new_amp );
41int Osc_write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data ) ICODE_ATTR; 41int Osc_write_trig( struct Gb_Osc* this, int frame_phase, int max_len, int old_data );
42void Osc_clock_length( struct Gb_Osc* this ) ICODE_ATTR; 42void Osc_clock_length( struct Gb_Osc* this );
43void Osc_reset( struct Gb_Osc* this ); 43void Osc_reset( struct Gb_Osc* this );
44 44
45// Square 45// Square
@@ -61,9 +61,9 @@ struct Gb_Square {
61 bool sweep_neg; 61 bool sweep_neg;
62}; 62};
63 63
64bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) ICODE_ATTR; 64bool Square_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data );
65void Square_run( struct Gb_Square* this, blip_time_t, blip_time_t ) ICODE_ATTR; 65void Square_run( struct Gb_Square* this, blip_time_t, blip_time_t );
66void Square_clock_envelope( struct Gb_Square* this ) ICODE_ATTR; 66void Square_clock_envelope( struct Gb_Square* this );
67 67
68static inline void Square_reset( struct Gb_Square* this ) 68static inline void Square_reset( struct Gb_Square* this )
69{ 69{
@@ -84,8 +84,8 @@ static inline int Square_reload_env_timer( struct Gb_Square* this )
84 84
85// Sweep square 85// Sweep square
86 86
87void clock_sweep( struct Gb_Square* this ) ICODE_ATTR; 87void clock_sweep( struct Gb_Square* this );
88void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data ) ICODE_ATTR; 88void Sweep_write_register( struct Gb_Square* this, int frame_phase, int reg, int old_data, int data );
89 89
90static inline void Sweep_reset( struct Gb_Square* this ) 90static inline void Sweep_reset( struct Gb_Square* this )
91{ 91{
@@ -100,8 +100,8 @@ static inline void Sweep_reset( struct Gb_Square* this )
100 this->osc.delay = 0x40000000; // TODO: something less hacky (never clocked until first trigger) 100 this->osc.delay = 0x40000000; // TODO: something less hacky (never clocked until first trigger)
101} 101}
102 102
103void calc_sweep( struct Gb_Square* this, bool update ) ICODE_ATTR; 103void calc_sweep( struct Gb_Square* this, bool update );
104void reload_sweep_timer( struct Gb_Square* this ) ICODE_ATTR; 104void reload_sweep_timer( struct Gb_Square* this );
105 105
106// Noise 106// Noise
107 107
@@ -117,8 +117,8 @@ struct Gb_Noise {
117 int divider; // noise has more complex frequency divider setup 117 int divider; // noise has more complex frequency divider setup
118}; 118};
119 119
120void Noise_run( struct Gb_Noise* this, blip_time_t, blip_time_t ) ICODE_ATTR; 120void Noise_run( struct Gb_Noise* this, blip_time_t, blip_time_t );
121void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data ) ICODE_ATTR; 121void Noise_write_register( struct Gb_Noise* this, int frame_phase, int reg, int old_data, int data );
122 122
123static inline void Noise_reset( struct Gb_Noise* this ) 123static inline void Noise_reset( struct Gb_Noise* this )
124{ 124{
@@ -130,7 +130,7 @@ static inline void Noise_reset( struct Gb_Noise* this )
130 this->osc.delay = 4 * clk_mul; // TODO: remove? 130 this->osc.delay = 4 * clk_mul; // TODO: remove?
131} 131}
132 132
133void Noise_clock_envelope( struct Gb_Noise* this ) ICODE_ATTR; 133void Noise_clock_envelope( struct Gb_Noise* this );
134 134
135// Non-zero if DAC is enabled 135// Non-zero if DAC is enabled
136static inline int Noise_dac_enabled( struct Gb_Noise* this) { return this->osc.regs [2] & 0xF8; } 136static inline int Noise_dac_enabled( struct Gb_Noise* this) { return this->osc.regs [2] & 0xF8; }
@@ -159,8 +159,8 @@ struct Gb_Wave {
159 uint8_t* wave_ram; // 32 bytes (64 nybbles), stored in APU 159 uint8_t* wave_ram; // 32 bytes (64 nybbles), stored in APU
160}; 160};
161 161
162void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data ) ICODE_ATTR; 162void Wave_write_register( struct Gb_Wave* this, int frame_phase, int reg, int old_data, int data );
163void Wave_run( struct Gb_Wave* this, blip_time_t, blip_time_t ) ICODE_ATTR; 163void Wave_run( struct Gb_Wave* this, blip_time_t, blip_time_t );
164 164
165static inline void Wave_reset( struct Gb_Wave* this ) 165static inline void Wave_reset( struct Gb_Wave* this )
166{ 166{
@@ -179,7 +179,7 @@ void corrupt_wave( struct Gb_Wave* this );
179static inline uint8_t* wave_bank( struct Gb_Wave* this ) { return &this->wave_ram [(~this->osc.regs [0] & bank40_mask) >> 2 & this->agb_mask]; } 179static inline uint8_t* wave_bank( struct Gb_Wave* this ) { return &this->wave_ram [(~this->osc.regs [0] & bank40_mask) >> 2 & this->agb_mask]; }
180 180
181// Wave index that would be accessed, or -1 if no access would occur 181// Wave index that would be accessed, or -1 if no access would occur
182int wave_access( struct Gb_Wave* this, int addr ) ICODE_ATTR; 182int wave_access( struct Gb_Wave* this, int addr );
183 183
184// Reads/writes wave RAM 184// Reads/writes wave RAM
185static inline int Wave_read( struct Gb_Wave* this, int addr ) 185static inline int Wave_read( struct Gb_Wave* this, int addr )