summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/swp30.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/swp30.h')
-rw-r--r--src/devices/sound/swp30.h106
1 files changed, 63 insertions, 43 deletions
diff --git a/src/devices/sound/swp30.h b/src/devices/sound/swp30.h
index b33cd99299a..56e24b453f0 100644
--- a/src/devices/sound/swp30.h
+++ b/src/devices/sound/swp30.h
@@ -11,7 +11,7 @@
class swp30_device : public device_t, public device_sound_interface, public device_rom_interface
{
public:
- swp30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+ swp30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 33868800);
void map(address_map &map);
@@ -28,75 +28,95 @@ private:
s32 m_linear_attenuation[0x100];
s16 m_sample_log8[0x100];
+ u64 m_program[0x180];
u64 m_keyon_mask, m_active_mask;
u32 m_pre_size[0x40], m_post_size[0x40], m_address[0x40];
s32 m_sample_pos[64];
s32 m_sample_history[0x40][2][2];
- u16 m_volume[0x40], m_freq[0x40], m_pan[0x40];
- u16 m_lpf_cutoff[0x40], m_lpf_reso[0x40], m_hpf_cutoff[0x40];
- s16 m_eq_filter[0x40][2][3];
+ u16 m_program_pfp[0x180], m_program_pint[0x80], m_program_plfo[0x80];
- u16 m_variation_delay[4];
- u16 m_variation_fb_level[3];
- u16 m_variation_final_level[4];
- u16 m_variation_high_damp[2], m_variation_inv_high_damp[2];
+ u16 m_volume[0x40], m_freq[0x40], m_pan[0x40], m_dry_rev[0x40], m_cho_var[0x40];
+ u16 m_envelope[0x40][3];
+ u16 m_lpf_cutoff[0x40], m_lpf_cutoff_inc[0x40], m_lpf_reso[0x40], m_hpf_cutoff[0x40];
+ s16 m_eq_filter[0x40][6];
+ u16 m_routing[0x40][3];
+ u16 m_map[8];
- u16 m_insertion_delay[2][4];
- u16 m_insertion_fb_level[2][3];
- u16 m_insertion_final_level[2][4];
- u16 m_insertion_high_damp[2][2], m_insertion_inv_high_damp[2][2];
+ u16 m_program_address;
+ // AWM2 per-channel registers
u16 lpf_cutoff_r(offs_t offset);
void lpf_cutoff_w(offs_t offset, u16 data);
+ u16 lpf_cutoff_inc_r(offs_t offset);
+ void lpf_cutoff_inc_w(offs_t offset, u16 data);
u16 hpf_cutoff_r(offs_t offset);
void hpf_cutoff_w(offs_t offset, u16 data);
u16 lpf_reso_r(offs_t offset);
void lpf_reso_w(offs_t offset, u16 data);
- template<int filter, int coef> u16 eq_filter_r(offs_t offset);
- template<int filter, int coef> void eq_filter_w(offs_t offset, u16 data);
+ template<int sel> u16 envelope_r(offs_t offset);
+ template<int sel> void envelope_w(offs_t offset, u16 data);
+ template<int coef> u16 eq_filter_r(offs_t offset);
+ template<int coef> void eq_filter_w(offs_t offset, u16 data);
u16 volume_r(offs_t offset);
void volume_w(offs_t offset, u16 data);
u16 freq_r(offs_t offset);
void freq_w(offs_t offset, u16 data);
- u16 pre_size_r(offs_t offset);
- void pre_size_w(offs_t offset, u16 data);
- u16 post_size_r(offs_t offset);
- void post_size_w(offs_t offset, u16 data);
- u16 address_r(offs_t offset);
- void address_w(offs_t offset, u16 data);
+ u16 pre_size_h_r(offs_t offset);
+ u16 pre_size_l_r(offs_t offset);
+ void pre_size_h_w(offs_t offset, u16 data);
+ void pre_size_l_w(offs_t offset, u16 data);
+ u16 post_size_h_r(offs_t offset);
+ u16 post_size_l_r(offs_t offset);
+ void post_size_h_w(offs_t offset, u16 data);
+ void post_size_l_w(offs_t offset, u16 data);
+ u16 address_h_r(offs_t offset);
+ u16 address_l_r(offs_t offset);
+ void address_h_w(offs_t offset, u16 data);
+ void address_l_w(offs_t offset, u16 data);
u16 pan_r(offs_t offset);
void pan_w(offs_t offset, u16 data);
+ u16 dry_rev_r(offs_t offset);
+ void dry_rev_w(offs_t offset, u16 data);
+ u16 cho_var_r(offs_t offset);
+ void cho_var_w(offs_t offset, u16 data);
+ template<int sel> u16 routing_r(offs_t offset);
+ template<int sel> void routing_w(offs_t offset, u16 data);
+
+ // Control registers
template<int sel> u16 keyon_mask_r();
template<int sel> void keyon_mask_w(u16 data);
u16 keyon_r();
void keyon_w(u16);
-
- template<int id> void variation_delay_w(u16 data);
- template<int id> u16 variation_delay_r();
- template<int id> void variation_fb_level_w(u16 data);
- template<int id> u16 variation_fb_level_r();
- template<int id> void variation_final_level_w(u16 data);
- template<int id> u16 variation_final_level_r();
- template<int id> void variation_high_damp_w(u16 data);
- template<int id> u16 variation_high_damp_r();
- template<int id> void variation_inv_high_damp_w(u16 data);
- template<int id> u16 variation_inv_high_damp_r();
-
- template<int ins, int id> void insertion_delay_w(u16 data);
- template<int ins, int id> u16 insertion_delay_r();
- template<int ins, int id> void insertion_fb_level_w(u16 data);
- template<int ins, int id> u16 insertion_fb_level_r();
- template<int ins, int id> void insertion_final_level_w(u16 data);
- template<int ins, int id> u16 insertion_final_level_r();
- template<int ins, int id> void insertion_high_damp_w(u16 data);
- template<int ins, int id> u16 insertion_high_damp_r();
- template<int ins, int id> void insertion_inv_high_damp_w(u16 data);
- template<int ins, int id> u16 insertion_inv_high_damp_r();
-
+ u16 prg_address_r();
+ void prg_address_w(u16 data);
+ template<int sel> u16 prg_r();
+ template<int sel> void prg_w(u16 data);
+ template<int sel> u16 map_r();
+ template<int sel> void map_w(u16 data);
+
+ // MEG registers
+ template<int sel> u16 prg_fp_r(offs_t offset);
+ template<int sel> void prg_fp_w(offs_t offset, u16 data);
+ template<int sel> u16 prg_int_r(offs_t offset);
+ template<int sel> void prg_int_w(offs_t offset, u16 data);
+ template<int sel> u16 prg_lfo_r(offs_t offset);
+ template<int sel> void prg_lfo_w(offs_t offset, u16 data);
+
+
+ // Generic catch-all
u16 snd_r(offs_t offset);
void snd_w(offs_t offset, u16 data);
+
+ inline auto &rchan(address_map &map, int idx) {
+ return map(idx*2, idx*2+1).select(0x1f80);
+ }
+
+ inline auto &rctrl(address_map &map, int idx) {
+ int slot = 0x40*(idx >> 1) | 0xe | (idx & 1);
+ return map(slot*2, slot*2+1);
+ }
};
DECLARE_DEVICE_TYPE(SWP30, swp30_device)