LMMS
Loading...
Searching...
No Matches
Sms_Apu.h
Go to the documentation of this file.
1// Sega Master System SN76489 PSG sound chip emulator
2
3// Sms_Snd_Emu 0.1.4
4#ifndef SMS_APU_H
5#define SMS_APU_H
6
7#include "Sms_Oscs.h"
8
9class Sms_Apu {
10public:
11 // Set overall volume of all oscillators, where 1.0 is full volume
12 void volume( double );
13
14 // Set treble equalization
15 void treble_eq( const blip_eq_t& );
16
17 // Outputs can be assigned to a single buffer for mono output, or to three
18 // buffers for stereo output (using Stereo_Buffer to do the mixing).
19
20 // Assign all oscillator outputs to specified buffer(s). If buffer
21 // is NULL, silences all oscillators.
22 void output( Blip_Buffer* mono );
24
25 // Assign single oscillator output to buffer(s). Valid indicies are 0 to 3,
26 // which refer to Square 1, Square 2, Square 3, and Noise. If buffer is NULL,
27 // silences oscillator.
28 enum { osc_count = 4 };
29 void osc_output( int index, Blip_Buffer* mono );
30 void osc_output( int index, Blip_Buffer* center, Blip_Buffer* left, Blip_Buffer* right );
31
32 // Reset oscillators and internal state
33 void reset( unsigned noise_feedback = 0, int noise_width = 0 );
34
35 // Write GameGear left/right assignment byte
36 void write_ggstereo( blip_time_t, int );
37
38 // Write to data port
39 void write_data( blip_time_t, int );
40
41 // Run all oscillators up to specified time, end current frame, then
42 // start a new frame at time 0.
43 void end_frame( blip_time_t );
44
45public:
46 Sms_Apu();
47 ~Sms_Apu();
48private:
49 // noncopyable
50 Sms_Apu( const Sms_Apu& );
52
55 Sms_Square::Synth square_synth; // used by squares
57 int latch;
61
62 void run_until( blip_time_t );
63};
64
66{
67 unsigned char regs [8] [2];
68 unsigned char latch;
69};
70
71inline void Sms_Apu::output( Blip_Buffer* b ) { output( b, b, b ); }
72
73inline void Sms_Apu::osc_output( int i, Blip_Buffer* b ) { osc_output( i, b, b, b ); }
74
75#endif
blip_long blip_time_t
Definition Blip_Buffer.h:17
Definition Blip_Buffer.h:23
void reset(unsigned noise_feedback=0, int noise_width=0)
Definition Sms_Apu.cpp:209
Sms_Noise noise
Definition Sms_Apu.h:58
Sms_Square::Synth square_synth
Definition Sms_Apu.h:55
Sms_Apu & operator=(const Sms_Apu &)
~Sms_Apu()
Definition Sms_Apu.cpp:175
void write_data(blip_time_t, int)
Definition Sms_Apu.cpp:297
Sms_Apu()
Definition Sms_Apu.cpp:162
Sms_Apu(const Sms_Apu &)
void write_ggstereo(blip_time_t, int)
Definition Sms_Apu.cpp:267
@ osc_count
Definition Sms_Apu.h:28
void osc_output(int index, Blip_Buffer *mono)
Definition Sms_Apu.h:73
Sms_Square squares[3]
Definition Sms_Apu.h:54
void output(Blip_Buffer *mono)
Definition Sms_Apu.h:71
Sms_Osc * oscs[osc_count]
Definition Sms_Apu.h:53
unsigned noise_feedback
Definition Sms_Apu.h:59
void end_frame(blip_time_t)
Definition Sms_Apu.cpp:258
blip_time_t last_time
Definition Sms_Apu.h:56
unsigned looped_feedback
Definition Sms_Apu.h:60
void volume(double)
Definition Sms_Apu.cpp:179
int latch
Definition Sms_Apu.h:57
void run_until(blip_time_t)
Definition Sms_Apu.cpp:234
void treble_eq(const blip_eq_t &)
Definition Sms_Apu.cpp:186
Definition Blip_Buffer.h:239
register unsigned i
Definition inflate.c:1575
struct @113205115357366127300225113341150224053346037032::@137033172036070230260373056156374243321245367362 left
struct @113205115357366127300225113341150224053346037032::@137033172036070230260373056156374243321245367362 right
Definition Sms_Oscs.h:37
Definition Sms_Oscs.h:11
Definition Sms_Oscs.h:25
Blip_Synth< blip_good_quality, 1 > Synth
Definition Sms_Oscs.h:29
Definition Sms_Apu.h:66
unsigned char latch
Definition Sms_Apu.h:68
unsigned char regs[8][2]
Definition Sms_Apu.h:67
b
Definition crypt.c:628