OSDN Git Service

[VM] Apply VM_TEMPLATE to all VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / msx / psg_stereo.h
1 /*
2         Common Source Code Project
3         MSX Series (experimental)
4
5         Author : umaiboux
6         Date   : 2016.03.xx-
7
8         [ PSG Stereo ]
9 */
10
11 #ifndef _PSG_STEREO_H_
12 #define _PSG_STEREO_H_
13
14 #include "../vm.h"
15 #include "../../emu.h"
16 #include "../device.h"
17
18 //#include "../ym2203.h"
19 #include "../ay_3_891x.h"
20
21 class PSG_STEREO : public DEVICE
22 {
23 private:
24 //      YM2203* d_psg[3];
25         AY_3_891X* d_psg[3];
26         uint8_t rreg[14];
27         uint8_t ch;
28         void sound(int dev, int reg, int val);
29         int m_stereo;
30         int m_decibel_l;
31         int m_decibel_r;
32
33 public:
34         PSG_STEREO(VM_TEMPLATE* parent_vm, EMU* parent_emu);
35         ~PSG_STEREO() {}
36         
37         // common functions
38         void write_io8(uint32_t addr, uint32_t data);
39         uint32_t read_io8(uint32_t addr);
40         void initialize();
41         void release();
42         void reset();
43         void mix(int32_t* buffer, int cnt);
44         void set_volume(int ch, int decibel_l, int decibel_r);
45         void update_config();
46         
47         // unique functions
48         void initialize_sound(int rate, int clock, int samples, int decibel_fm, int decibel_psg);
49 //      void set_context_psg(YM2203* device)
50         void set_context_psg(AY_3_891X* device)
51         {
52                 d_psg[0] = device;
53         }
54 };
55
56 #endif