2 Skelton for retropc emulator
4 Author : Takeda.Toshiya
17 #define SIG_PCM1BIT_SIGNAL 0
18 #define SIG_PCM1BIT_ON 1
19 #define SIG_PCM1BIT_MUTE 2
23 class PCM1BIT : public DEVICE
26 bool signal, on, mute;
29 int positive_clocks, negative_clocks;
30 int max_vol, last_vol_l, last_vol_r;
31 int volume_l, volume_r;
39 float before_filter_l;
40 float before_filter_r;
47 void calc_low_pass_filter(int32_t* dst, int32_t* src, int samples, int is_set_val);
48 void calc_high_pass_filter(int32_t* dst, int32_t* src, int samples, int is_set_val);
51 PCM1BIT(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
53 volume_l = volume_r = 1024;
54 set_device_name(_T("1BIT PCM SOUND"));
61 void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
63 void mix(int32_t* buffer, int cnt);
64 void set_volume(int ch, int decibel_l, int decibel_r);
65 void set_high_pass_filter_freq(int freq, double quality = 1.0);
66 void set_low_pass_filter_freq(int freq, double quality = 1.0);
67 bool get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
68 bool is_debugger_available()
73 bool process_state(FILEIO* state_fio, bool loading);
76 void initialize_sound(int rate, int volume);