OSDN Git Service

[VM][FMTOWNS][MEMORY] Fix setup around memory banks by I/O 0404h and 0480h.
[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 namespace MSX {
22         
23 class PSG_STEREO : public DEVICE
24 {
25 private:
26 //      YM2203* d_psg[3];
27         AY_3_891X* d_psg[3];
28         uint8_t rreg[14];
29         uint8_t ch;
30         void __FASTCALL sound(int dev, int reg, int val);
31         int m_stereo;
32         int m_decibel_l;
33         int m_decibel_r;
34
35 public:
36         PSG_STEREO(VM_TEMPLATE* parent_vm, EMU_TEMPLATE* parent_emu);
37         ~PSG_STEREO() {}
38         
39         // common functions
40         void __FASTCALL write_io8(uint32_t addr, uint32_t data);
41         uint32_t __FASTCALL read_io8(uint32_t addr);
42         void initialize();
43         void release();
44         void reset();
45         void __FASTCALL mix(int32_t* buffer, int cnt);
46         void set_volume(int ch, int decibel_l, int decibel_r);
47         void update_config();
48         
49         // unique functions
50         void initialize_sound(int rate, int clock, int samples, int decibel_fm, int decibel_psg);
51 //      void set_context_psg(YM2203* device)
52         void set_context_psg(AY_3_891X* device)
53         {
54                 d_psg[0] = device;
55         }
56 };
57
58 }
59 #endif