OSDN Git Service

[VM][STATE] Apply New framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pv1000 / psg.h
1 /*
2         CASIO PV-1000 Emulator 'ePV-1000'
3
4         Author : Takeda.Toshiya
5         Date   : 2006.11.16 -
6
7         [ psg ]
8 */
9
10 #ifndef _PSG_H_
11 #define _PSG_H_
12
13 #include "../vm.h"
14 #include "../../emu.h"
15 #include "../device.h"
16
17 class PSG : public DEVICE
18 {
19 private:
20         struct {
21                 int count;
22                 int period;
23                 bool signal;
24         } ch[3];
25         int diff;
26         int volume_l, volume_r;
27         
28 public:
29         PSG(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
30         {
31                 volume_l = volume_r = 1024;
32                 set_device_name(_T("PSG"));
33         }
34         ~PSG() {}
35         
36         // common functions
37         void reset();
38         void write_io8(uint32_t addr, uint32_t data);
39         void mix(int32_t* buffer, int cnt);
40         void set_volume(int ch, int decibel_l, int decibel_r);
41         bool process_state(FILEIO* state_fio, bool loading);
42         
43         // unique function
44         void initialize_sound(int rate);
45 };
46
47 #endif
48