OSDN Git Service

[VM][STATE] Apply New framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pv1000 / psg.h
index b113b82..4be84dc 100644 (file)
@@ -1,43 +1,48 @@
-/*\r
-       CASIO PV-1000 Emulator 'ePV-1000'\r
-\r
-       Author : Takeda.Toshiya\r
-       Date   : 2006.11.16 -\r
-\r
-       [ psg ]\r
-*/\r
-\r
-#ifndef _PSG_H_\r
-#define _PSG_H_\r
-\r
-#include "../vm.h"\r
-#include "../../emu.h"\r
-#include "../device.h"\r
-\r
-class PSG : public DEVICE\r
-{\r
-private:\r
-       struct {\r
-               int count;\r
-               int period;\r
-               bool signal;\r
-       } ch[3];\r
-       int diff;\r
-       \r
-public:\r
-       PSG(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}\r
-       ~PSG() {}\r
-       \r
-       // common functions\r
-       void reset();\r
-       void write_io8(uint32 addr, uint32 data);\r
-       void mix(int32* buffer, int cnt);\r
-       void save_state(FILEIO* state_fio);\r
-       bool load_state(FILEIO* state_fio);\r
-       \r
-       // unique function\r
-       void init(int rate);\r
-};\r
-\r
-#endif\r
-\r
+/*
+       CASIO PV-1000 Emulator 'ePV-1000'
+
+       Author : Takeda.Toshiya
+       Date   : 2006.11.16 -
+
+       [ psg ]
+*/
+
+#ifndef _PSG_H_
+#define _PSG_H_
+
+#include "../vm.h"
+#include "../../emu.h"
+#include "../device.h"
+
+class PSG : public DEVICE
+{
+private:
+       struct {
+               int count;
+               int period;
+               bool signal;
+       } ch[3];
+       int diff;
+       int volume_l, volume_r;
+       
+public:
+       PSG(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+       {
+               volume_l = volume_r = 1024;
+               set_device_name(_T("PSG"));
+       }
+       ~PSG() {}
+       
+       // common functions
+       void reset();
+       void write_io8(uint32_t addr, uint32_t data);
+       void mix(int32_t* buffer, int cnt);
+       void set_volume(int ch, int decibel_l, int decibel_r);
+       bool process_state(FILEIO* state_fio, bool loading);
+       
+       // unique function
+       void initialize_sound(int rate);
+};
+
+#endif
+