2 EPOCH Super Cassette Vision Emulator 'eSCV'
4 Author : Takeda.Toshiya
14 #include "../../emu.h"
15 #include "../device.h"
17 #define SOUND_CLOCK 1522400.0
18 #define NOISE_CLOCK 760.0
19 #define SQUARE_CLOCK 174000.0
21 #define PCM_PERIOD 120000
23 #define MAX_TONE 24000
24 #define MAX_NOISE 16000
25 #define MAX_SQUARE 8000
28 #define MAX_PARAM 0x8000
30 class SOUND : public DEVICE
45 struct channel_t tone;
46 struct channel_t noise;
47 struct channel_t square1;
48 struct channel_t square2;
49 struct channel_t square3;
51 void clear_channel(channel_t *ch);
53 int pcm_table[MAX_PARAM * 8];
61 int param_cnt, param_ptr, register_id;
62 uint8 params[MAX_PARAM];
64 void process_pcm(uint8 data);
68 SOUND(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}
73 void write_data8(uint32 addr, uint32 data);
74 void write_io8(uint32 addr, uint32 data);
75 void event_callback(int event_id, int err);
76 void mix(int32* buffer, int cnt);
77 void save_state(FILEIO* state_fio);
78 bool load_state(FILEIO* state_fio);
81 void set_context_cpu(DEVICE* device)