From 0d75b0272dcf52bdc419934c6ead6b99bb8b4204 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 17 May 2019 20:34:08 +1000 Subject: (nw) cassette cleanup --- src/mame/drivers/acrnsys1.cpp | 24 ++-- src/mame/drivers/alphatro.cpp | 34 +++--- src/mame/drivers/applix.cpp | 82 +++++++------- src/mame/drivers/bml3.cpp | 253 +++++++++++++++++++----------------------- src/mame/drivers/cd2650.cpp | 16 +-- src/mame/drivers/dolphunk.cpp | 22 ++-- src/mame/drivers/fc100.cpp | 30 ++--- src/mame/drivers/fp1100.cpp | 22 ++-- src/mame/drivers/h8.cpp | 20 ++-- src/mame/drivers/mekd2.cpp | 28 ++--- src/mame/drivers/pro80.cpp | 8 +- src/mame/drivers/proteus3.cpp | 30 ++--- src/mame/drivers/super80.cpp | 4 +- src/mame/includes/super80.h | 2 +- src/mame/machine/super80.cpp | 2 +- 15 files changed, 251 insertions(+), 326 deletions(-) diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp index e9ba3b9f17b..be8fc27e3bc 100644 --- a/src/mame/drivers/acrnsys1.cpp +++ b/src/mame/drivers/acrnsys1.cpp @@ -77,8 +77,8 @@ private: DECLARE_READ8_MEMBER(ins8154_b1_port_a_r); DECLARE_WRITE8_MEMBER(ins8154_b1_port_a_w); DECLARE_WRITE8_MEMBER(acrnsys1_led_segment_w); - TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_c); - TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void acrnsys1_map(address_map &map); required_device m_maincpu; @@ -87,7 +87,7 @@ private: output_finder<9> m_display; uint8_t m_digit; uint8_t m_cass_data[4]; - bool m_cass_state; + bool m_cassbit; bool m_cassold; }; @@ -99,7 +99,7 @@ void acrnsys1_state::machine_start() save_item(NAME(m_digit)); save_item(NAME(m_cass_data)); - save_item(NAME(m_cass_state)); + save_item(NAME(m_cassbit)); save_item(NAME(m_cassold)); } @@ -131,26 +131,26 @@ WRITE8_MEMBER( acrnsys1_state::ins8154_b1_port_a_w ) { m_digit = data & 0x47; m_ttl74145->write(m_digit & 7); - m_cass_state = BIT(data, 6); + m_cassbit = BIT(data, 6); } -TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::acrnsys1_c) +TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::kansas_w) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::acrnsys1_p) +TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::kansas_r) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -286,8 +286,8 @@ void acrnsys1_state::acrnsys1(machine_config &config) CASSETTE(config, m_cass); - TIMER(config, "acrnsys1_c").configure_periodic(FUNC(acrnsys1_state::acrnsys1_c), attotime::from_hz(4800)); - TIMER(config, "acrnsys1_p").configure_periodic(FUNC(acrnsys1_state::acrnsys1_p), attotime::from_hz(40000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(acrnsys1_state::kansas_w), attotime::from_hz(4800)); + TIMER(config, "kansas_r").configure_periodic(FUNC(acrnsys1_state::kansas_r), attotime::from_hz(40000)); } diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp index acb53a7ab39..fd99bcae0b0 100644 --- a/src/mame/drivers/alphatro.cpp +++ b/src/mame/drivers/alphatro.cpp @@ -103,12 +103,11 @@ private: void port30_w(uint8_t data); uint8_t portf0_r(); void portf0_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(txdata_callback); DECLARE_WRITE_LINE_MEMBER(hrq_w); DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); void alphatro_palette(palette_device &palette) const; - TIMER_DEVICE_CALLBACK_MEMBER(timer_c); - TIMER_DEVICE_CALLBACK_MEMBER(timer_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); MC6845_UPDATE_ROW(crtc_update_row); image_init_result load_cart(device_image_interface &image, generic_slot_device *slot); @@ -129,7 +128,7 @@ private: u8 m_flashcnt; u8 m_cass_data[4]; u8 m_port_10, m_port_20, m_port_30, m_port_f0; - bool m_cass_state; + bool m_cassbit; bool m_cassold, m_fdc_irq; required_region_ptr m_p_chargen; required_device m_maincpu; @@ -279,7 +278,7 @@ void alphatro_state::port10_w(uint8_t data) m_cass->change_state( BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); if (BIT(data,2)) - m_cass_state = 1; + m_cassbit = 1; update_banking(); } @@ -353,11 +352,6 @@ void alphatro_state::device_timer(emu_timer &timer, device_timer_id id, int para } } -WRITE_LINE_MEMBER( alphatro_state::txdata_callback ) -{ - m_cass_state = state; -} - MC6845_UPDATE_ROW( alphatro_state::crtc_update_row ) { const rgb_t *pens = m_palette->palette()->entry_list_raw(); @@ -617,7 +611,7 @@ void alphatro_state::machine_start() save_item(NAME(m_port_10)); save_item(NAME(m_port_20)); save_item(NAME(m_cass_data)); - save_item(NAME(m_cass_state)); + save_item(NAME(m_cassbit)); save_item(NAME(m_cassold)); } @@ -629,7 +623,7 @@ void alphatro_state::machine_reset() update_banking(); m_cass_data[0] = m_cass_data[1] = m_cass_data[2] = m_cass_data[3] = 0; - m_cass_state = 0; + m_cassbit = 0; m_cassold = 0; m_fdc_irq = 0; m_usart->write_rxd(0); @@ -676,23 +670,23 @@ void alphatro_state::alphatro_palette(palette_device &palette) const } -TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::timer_c) +TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::kansas_w) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::timer_p) +TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::kansas_r) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -772,7 +766,7 @@ MACHINE_CONFIG_START(alphatro_state::alphatro) m_crtc->set_update_row_callback(FUNC(alphatro_state::crtc_update_row), this); I8251(config, m_usart, 16_MHz_XTAL / 4); - m_usart->txd_handler().set(FUNC(alphatro_state::txdata_callback)); + m_usart->txd_handler().set([this] (bool state) { m_cassbit = state; }); clock_device &usart_clock(CLOCK(config, "usart_clock", /*16_MHz_XTAL / 4 / 13 / 16*/ 19218)); // 19218 to load a real tape, 19222 to load a tape made by this driver usart_clock.signal_handler().set(m_usart, FUNC(i8251_device::write_txc)); @@ -783,8 +777,8 @@ MACHINE_CONFIG_START(alphatro_state::alphatro) m_cass->set_interface("alphatro_cass"); SOFTWARE_LIST(config, "cass_list").set_original("alphatro_cass"); - TIMER(config, "timer_c").configure_periodic(FUNC(alphatro_state::timer_c), attotime::from_hz(4800)); - TIMER(config, "timer_p").configure_periodic(FUNC(alphatro_state::timer_p), attotime::from_hz(40000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(alphatro_state::kansas_w), attotime::from_hz(4800)); + TIMER(config, "kansas_r").configure_periodic(FUNC(alphatro_state::kansas_r), attotime::from_hz(40000)); RAM(config, "ram").set_default_size("64K"); diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp index 01b3043ef01..c1523df34e4 100644 --- a/src/mame/drivers/applix.cpp +++ b/src/mame/drivers/applix.cpp @@ -30,7 +30,7 @@ - Audio: it could be better - DAC output is used to compare against analog inputs; core doesn't permit audio outputs to be used for non-speaker purposes. - - Bios 5 crashes mess after scrolling about half a screen + - Bios 5 crashes MAME after scrolling about half a screen ****************************************************************************/ @@ -61,46 +61,46 @@ class applix_state : public driver_device { public: - applix_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_base(*this, "base"), - m_maincpu(*this, "maincpu"), - m_crtc(*this, "crtc"), - m_via(*this, "via6522"), - m_centronics(*this, "centronics"), - m_cent_data_out(*this, "cent_data_out"), - m_fdc(*this, "fdc"), - m_floppy0(*this, "fdc:0"), - m_floppy1(*this, "fdc:1"), - m_ldac(*this, "ldac"), - m_rdac(*this, "rdac"), - m_cass(*this, "cassette"), - m_io_dsw(*this, "DSW"), - m_io_fdc(*this, "FDC"), - m_io_k0f(*this, "K0f"), - m_io_k300(*this, "K30_0"), - m_io_k301(*this, "K30_1"), - m_io_k310(*this, "K31_0"), - m_io_k311(*this, "K31_1"), - m_io_k320(*this, "K32_0"), - m_io_k321(*this, "K32_1"), - m_io_k330(*this, "K33_0"), - m_io_k331(*this, "K33_1"), - m_io_k340(*this, "K34_0"), - m_io_k341(*this, "K34_1"), - m_io_k350(*this, "K35_0"), - m_io_k351(*this, "K35_1"), - m_io_k360(*this, "K36_0"), - m_io_k361(*this, "K36_1"), - m_io_k370(*this, "K37_0"), - m_io_k371(*this, "K37_1"), - m_io_k380(*this, "K38_0"), - m_io_k390(*this, "K39_0"), - m_io_k3a0(*this, "K3a_0"), - m_io_k3b0(*this, "K3b_0"), - m_io_k0b(*this, "K0b"), - m_expansion(*this, "expansion"), - m_palette(*this, "palette") + applix_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_base(*this, "base") + , m_maincpu(*this, "maincpu") + , m_crtc(*this, "crtc") + , m_via(*this, "via6522") + , m_centronics(*this, "centronics") + , m_cent_data_out(*this, "cent_data_out") + , m_fdc(*this, "fdc") + , m_floppy0(*this, "fdc:0") + , m_floppy1(*this, "fdc:1") + , m_ldac(*this, "ldac") + , m_rdac(*this, "rdac") + , m_cass(*this, "cassette") + , m_io_dsw(*this, "DSW") + , m_io_fdc(*this, "FDC") + , m_io_k0f(*this, "K0f") + , m_io_k300(*this, "K30_0") + , m_io_k301(*this, "K30_1") + , m_io_k310(*this, "K31_0") + , m_io_k311(*this, "K31_1") + , m_io_k320(*this, "K32_0") + , m_io_k321(*this, "K32_1") + , m_io_k330(*this, "K33_0") + , m_io_k331(*this, "K33_1") + , m_io_k340(*this, "K34_0") + , m_io_k341(*this, "K34_1") + , m_io_k350(*this, "K35_0") + , m_io_k351(*this, "K35_1") + , m_io_k360(*this, "K36_0") + , m_io_k361(*this, "K36_1") + , m_io_k370(*this, "K37_0") + , m_io_k371(*this, "K37_1") + , m_io_k380(*this, "K38_0") + , m_io_k390(*this, "K39_0") + , m_io_k3a0(*this, "K3a_0") + , m_io_k3b0(*this, "K3b_0") + , m_io_k0b(*this, "K0b") + , m_expansion(*this, "expansion") + , m_palette(*this, "palette") { } void applix(machine_config &config); diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp index 79dde73fb11..af679b9fa44 100644 --- a/src/mame/drivers/bml3.cpp +++ b/src/mame/drivers/bml3.cpp @@ -88,44 +88,43 @@ public: { } - DECLARE_READ8_MEMBER(bml3_6845_r); - DECLARE_WRITE8_MEMBER(bml3_6845_w); - DECLARE_READ8_MEMBER(bml3_keyboard_r); - DECLARE_WRITE8_MEMBER(bml3_keyboard_w); - DECLARE_WRITE8_MEMBER(bml3_hres_reg_w); - DECLARE_WRITE8_MEMBER(bml3_vres_reg_w); - DECLARE_READ8_MEMBER(bml3_vram_r); - DECLARE_WRITE8_MEMBER(bml3_vram_w); - DECLARE_READ8_MEMBER(bml3_psg_latch_r); - DECLARE_WRITE8_MEMBER(bml3_psg_latch_w); - DECLARE_READ8_MEMBER(bml3_vram_attr_r); - DECLARE_WRITE8_MEMBER(bml3_vram_attr_w); - DECLARE_READ8_MEMBER(bml3_beep_r); - DECLARE_WRITE8_MEMBER(bml3_beep_w); - DECLARE_WRITE8_MEMBER(bml3_piaA_w); - DECLARE_READ8_MEMBER(bml3_keyb_nmi_r); - DECLARE_WRITE8_MEMBER(bml3_firq_mask_w); - DECLARE_READ8_MEMBER(bml3_firq_status_r); + DECLARE_READ8_MEMBER(mc6845_r); + DECLARE_WRITE8_MEMBER(mc6845_w); + DECLARE_READ8_MEMBER(keyboard_r); + DECLARE_WRITE8_MEMBER(keyboard_w); + DECLARE_WRITE8_MEMBER(hres_reg_w); + DECLARE_WRITE8_MEMBER(vres_reg_w); + DECLARE_READ8_MEMBER(vram_r); + DECLARE_WRITE8_MEMBER(vram_w); + DECLARE_READ8_MEMBER(psg_latch_r); + DECLARE_WRITE8_MEMBER(psg_latch_w); + DECLARE_READ8_MEMBER(vram_attr_r); + DECLARE_WRITE8_MEMBER(vram_attr_w); + DECLARE_READ8_MEMBER(beep_r); + DECLARE_WRITE8_MEMBER(beep_w); + DECLARE_WRITE8_MEMBER(piaA_w); + DECLARE_READ8_MEMBER(keyb_nmi_r); + DECLARE_WRITE8_MEMBER(firq_mask_w); + DECLARE_READ8_MEMBER(firq_status_r); DECLARE_WRITE8_MEMBER(relay_w); - DECLARE_WRITE_LINE_MEMBER(bml3_acia_tx_w); - DECLARE_WRITE_LINE_MEMBER(bml3_acia_rts_w); - DECLARE_WRITE_LINE_MEMBER(bml3_acia_irq_w); + DECLARE_WRITE_LINE_MEMBER(acia_rts_w); + DECLARE_WRITE_LINE_MEMBER(acia_irq_w); - DECLARE_READ8_MEMBER(bml3_a000_r); DECLARE_WRITE8_MEMBER(bml3_a000_w); - DECLARE_READ8_MEMBER(bml3_c000_r); DECLARE_WRITE8_MEMBER(bml3_c000_w); - DECLARE_READ8_MEMBER(bml3_e000_r); DECLARE_WRITE8_MEMBER(bml3_e000_w); - DECLARE_READ8_MEMBER(bml3_f000_r); DECLARE_WRITE8_MEMBER(bml3_f000_w); - DECLARE_READ8_MEMBER(bml3_fff0_r); DECLARE_WRITE8_MEMBER(bml3_fff0_w); + DECLARE_READ8_MEMBER(a000_r); DECLARE_WRITE8_MEMBER(a000_w); + DECLARE_READ8_MEMBER(c000_r); DECLARE_WRITE8_MEMBER(c000_w); + DECLARE_READ8_MEMBER(e000_r); DECLARE_WRITE8_MEMBER(e000_w); + DECLARE_READ8_MEMBER(f000_r); DECLARE_WRITE8_MEMBER(f000_w); + DECLARE_READ8_MEMBER(fff0_r); DECLARE_WRITE8_MEMBER(fff0_w); MC6845_UPDATE_ROW(crtc_update_row); - // INTERRUPT_GEN_MEMBER(bml3_irq); - INTERRUPT_GEN_MEMBER(bml3_timer_firq); - TIMER_DEVICE_CALLBACK_MEMBER(bml3_c); - TIMER_DEVICE_CALLBACK_MEMBER(bml3_p); + // INTERRUPT_GEN_MEMBER(irq); + INTERRUPT_GEN_MEMBER(timer_firq); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); - DECLARE_READ8_MEMBER(bml3_ym2203_r); - DECLARE_WRITE8_MEMBER(bml3_ym2203_w); + DECLARE_READ8_MEMBER(ym2203_r); + DECLARE_WRITE8_MEMBER(ym2203_w); void bml3mk2(machine_config &config); void bml3mk5(machine_config &config); @@ -170,26 +169,7 @@ private: required_device m_palette; }; -#define mc6845_h_char_total (m_crtc_vreg[0]) -#define mc6845_h_display (m_crtc_vreg[1]) -#define mc6845_h_sync_pos (m_crtc_vreg[2]) -#define mc6845_sync_width (m_crtc_vreg[3]) -#define mc6845_v_char_total (m_crtc_vreg[4]) -#define mc6845_v_total_adj (m_crtc_vreg[5]) -#define mc6845_v_display (m_crtc_vreg[6]) -#define mc6845_v_sync_pos (m_crtc_vreg[7]) -#define mc6845_mode_ctrl (m_crtc_vreg[8]) -#define mc6845_tile_height (m_crtc_vreg[9]+1) -#define mc6845_cursor_y_start (m_crtc_vreg[0x0a]) -#define mc6845_cursor_y_end (m_crtc_vreg[0x0b]) -#define mc6845_start_addr (((m_crtc_vreg[0x0c]<<8) & 0x3f00) | (m_crtc_vreg[0x0d] & 0xff)) -#define mc6845_cursor_addr (((m_crtc_vreg[0x0e]<<8) & 0x3f00) | (m_crtc_vreg[0x0f] & 0xff)) -#define mc6845_light_pen_addr (((m_crtc_vreg[0x10]<<8) & 0x3f00) | (m_crtc_vreg[0x11] & 0xff)) -#define mc6845_update_addr (((m_crtc_vreg[0x12]<<8) & 0x3f00) | (m_crtc_vreg[0x13] & 0xff)) - - - -READ8_MEMBER( bml3_state::bml3_6845_r ) +READ8_MEMBER( bml3_state::mc6845_r ) { if (offset) return m_crtc->register_r(); @@ -197,7 +177,7 @@ READ8_MEMBER( bml3_state::bml3_6845_r ) return m_crtc->status_r(); } -WRITE8_MEMBER( bml3_state::bml3_6845_w ) +WRITE8_MEMBER( bml3_state::mc6845_w ) { if(offset == 0) { @@ -211,14 +191,14 @@ WRITE8_MEMBER( bml3_state::bml3_6845_w ) } } -READ8_MEMBER( bml3_state::bml3_keyboard_r ) +READ8_MEMBER( bml3_state::keyboard_r ) { u8 ret = m_keyb_scancode; m_keyb_scancode &= 0x7f; return ret; } -WRITE8_MEMBER( bml3_state::bml3_keyboard_w ) +WRITE8_MEMBER( bml3_state::keyboard_w ) { m_keyb_katakana_led_on = BIT(data, 0); m_keyb_hiragana_led_on = BIT(data, 1); @@ -243,7 +223,7 @@ void bml3_state::m6845_change_clock(u8 setting) m_crtc->set_unscaled_clock(m6845_clock); } -WRITE8_MEMBER( bml3_state::bml3_hres_reg_w ) +WRITE8_MEMBER( bml3_state::hres_reg_w ) { // MODE SEL register (see service manual p.43). /* @@ -258,7 +238,7 @@ WRITE8_MEMBER( bml3_state::bml3_hres_reg_w ) m6845_change_clock((m_hres_reg & 0x80) | (m_vres_reg & 0x08)); } -WRITE8_MEMBER( bml3_state::bml3_vres_reg_w ) +WRITE8_MEMBER( bml3_state::vres_reg_w ) { // The MB-6890 had an interlaced video mode which was used for displaying Japanese (Hiragana and Katakana) text (8x16 character glyph bitmaps). /* @@ -270,7 +250,7 @@ WRITE8_MEMBER( bml3_state::bml3_vres_reg_w ) } -READ8_MEMBER( bml3_state::bml3_vram_r ) +READ8_MEMBER( bml3_state::vram_r ) { // Bit 7 masks reading back to the latch if (!BIT(m_attr_latch, 7)) @@ -281,38 +261,38 @@ READ8_MEMBER( bml3_state::bml3_vram_r ) return m_p_videoram[offset]; } -WRITE8_MEMBER( bml3_state::bml3_vram_w ) +WRITE8_MEMBER( bml3_state::vram_w ) { m_p_videoram[offset] = data; // color ram is 5-bit m_p_videoram[offset+0x4000] = m_attr_latch & 0x1F; } -READ8_MEMBER( bml3_state::bml3_psg_latch_r) +READ8_MEMBER( bml3_state::psg_latch_r) { return 0x7f; } -WRITE8_MEMBER( bml3_state::bml3_psg_latch_w) +WRITE8_MEMBER( bml3_state::psg_latch_w) { m_psg_latch = data; } -READ8_MEMBER(bml3_state::bml3_ym2203_r) +READ8_MEMBER(bml3_state::ym2203_r) { u8 dev_offs = ((m_psg_latch & 3) != 3); return m_ym2203->read(dev_offs); } -WRITE8_MEMBER(bml3_state::bml3_ym2203_w) +WRITE8_MEMBER(bml3_state::ym2203_w) { u8 dev_offs = ((m_psg_latch & 3) != 3); m_ym2203->write(dev_offs, data); } -READ8_MEMBER( bml3_state::bml3_vram_attr_r) +READ8_MEMBER( bml3_state::vram_attr_r) { // C-REG-SELECT register // Reads from a VRAM address copy the corresponding 'colour RAM' address to the low-order 5 bits of this register as a side-effect @@ -320,7 +300,7 @@ READ8_MEMBER( bml3_state::bml3_vram_attr_r) return m_attr_latch; } -WRITE8_MEMBER( bml3_state::bml3_vram_attr_w) +WRITE8_MEMBER( bml3_state::vram_attr_w) { // C-REG-SELECT register // Writes to a VRAM address copy the low-order 5 bits of this register to the corresponding 'colour RAM' address as a side-effect @@ -333,12 +313,12 @@ WRITE8_MEMBER( bml3_state::bml3_vram_attr_w) m_attr_latch = data; } -READ8_MEMBER( bml3_state::bml3_beep_r) +READ8_MEMBER( bml3_state::beep_r) { return -1; // BEEP status read? } -WRITE8_MEMBER( bml3_state::bml3_beep_w) +WRITE8_MEMBER( bml3_state::beep_w) { m_speaker->level_w(BIT(data, 7)); } @@ -349,23 +329,23 @@ WRITE8_MEMBER( bml3_state::relay_w ) BIT(data,7) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); } -READ8_MEMBER( bml3_state::bml3_a000_r) { return m_extram[offset + 0xa000]; } -WRITE8_MEMBER( bml3_state::bml3_a000_w) { m_extram[offset + 0xa000] = data; } -READ8_MEMBER( bml3_state::bml3_c000_r) { return m_extram[offset + 0xc000]; } -WRITE8_MEMBER( bml3_state::bml3_c000_w) { m_extram[offset + 0xc000] = data; } -READ8_MEMBER( bml3_state::bml3_e000_r) { return m_extram[offset + 0xe000]; } -WRITE8_MEMBER( bml3_state::bml3_e000_w) { m_extram[offset + 0xe000] = data; } -READ8_MEMBER( bml3_state::bml3_f000_r) { return m_extram[offset + 0xf000]; } -WRITE8_MEMBER( bml3_state::bml3_f000_w) { m_extram[offset + 0xf000] = data; } -READ8_MEMBER( bml3_state::bml3_fff0_r) { return m_extram[offset + 0xfff0]; } -WRITE8_MEMBER( bml3_state::bml3_fff0_w) { m_extram[offset + 0xfff0] = data; } - -READ8_MEMBER( bml3_state::bml3_keyb_nmi_r) +READ8_MEMBER( bml3_state::a000_r) { return m_extram[offset + 0xa000]; } +WRITE8_MEMBER( bml3_state::a000_w) { m_extram[offset + 0xa000] = data; } +READ8_MEMBER( bml3_state::c000_r) { return m_extram[offset + 0xc000]; } +WRITE8_MEMBER( bml3_state::c000_w) { m_extram[offset + 0xc000] = data; } +READ8_MEMBER( bml3_state::e000_r) { return m_extram[offset + 0xe000]; } +WRITE8_MEMBER( bml3_state::e000_w) { m_extram[offset + 0xe000] = data; } +READ8_MEMBER( bml3_state::f000_r) { return m_extram[offset + 0xf000]; } +WRITE8_MEMBER( bml3_state::f000_w) { m_extram[offset + 0xf000] = data; } +READ8_MEMBER( bml3_state::fff0_r) { return m_extram[offset + 0xfff0]; } +WRITE8_MEMBER( bml3_state::fff0_w) { m_extram[offset + 0xfff0] = data; } + +READ8_MEMBER( bml3_state::keyb_nmi_r) { return 0; // bit 7 used to signal a BREAK key pressure } -WRITE8_MEMBER( bml3_state::bml3_firq_mask_w) +WRITE8_MEMBER( bml3_state::firq_mask_w) { m_firq_mask = data & 0x80; if(m_firq_mask) @@ -375,7 +355,7 @@ WRITE8_MEMBER( bml3_state::bml3_firq_mask_w) } } -READ8_MEMBER( bml3_state::bml3_firq_status_r ) +READ8_MEMBER( bml3_state::firq_status_r ) { u8 res = m_firq_status << 7; m_firq_status = 0; @@ -388,53 +368,53 @@ void bml3_state::bml3_mem(address_map &map) { map.unmap_value_high(); map(0x0000, 0x03ff).ram(); - map(0x0400, 0x43ff).rw(FUNC(bml3_state::bml3_vram_r), FUNC(bml3_state::bml3_vram_w)); + map(0x0400, 0x43ff).rw(FUNC(bml3_state::vram_r), FUNC(bml3_state::vram_w)); map(0x4400, 0x9fff).ram(); map(0xff40, 0xff46).noprw(); // lots of unknown reads and writes map(0xffc0, 0xffc3).rw("pia", FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0xffc4, 0xffc5).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); - map(0xffc6, 0xffc7).rw(FUNC(bml3_state::bml3_6845_r), FUNC(bml3_state::bml3_6845_w)); + map(0xffc6, 0xffc7).rw(FUNC(bml3_state::mc6845_r), FUNC(bml3_state::mc6845_w)); // KBNMI - Keyboard "Break" key non-maskable interrupt - map(0xffc8, 0xffc8).r(FUNC(bml3_state::bml3_keyb_nmi_r)); // keyboard nmi + map(0xffc8, 0xffc8).r(FUNC(bml3_state::keyb_nmi_r)); // keyboard nmi // DIPSW - DIP switches on system mainboard map(0xffc9, 0xffc9).portr("DSW"); // TIMER - System timer enable - map(0xffca, 0xffca).r(FUNC(bml3_state::bml3_firq_status_r)); // timer irq + map(0xffca, 0xffca).r(FUNC(bml3_state::firq_status_r)); // timer irq // LPFLG - Light pen interrupt // AM_RANGE(0xffcb, 0xffcb) // MODE_SEL - Graphics mode select - map(0xffd0, 0xffd0).w(FUNC(bml3_state::bml3_hres_reg_w)); + map(0xffd0, 0xffd0).w(FUNC(bml3_state::hres_reg_w)); // TRACE - Trace counter // AM_RANGE(0xffd1, 0xffd1) // REMOTE - Remote relay control for cassette - bit 7 map(0xffd2, 0xffd2).w(FUNC(bml3_state::relay_w)); // MUSIC_SEL - Music select: toggle audio output level when rising - map(0xffd3, 0xffd3).rw(FUNC(bml3_state::bml3_beep_r), FUNC(bml3_state::bml3_beep_w)); + map(0xffd3, 0xffd3).rw(FUNC(bml3_state::beep_r), FUNC(bml3_state::beep_w)); // TIME_MASK - Prohibit timer IRQ - map(0xffd4, 0xffd4).w(FUNC(bml3_state::bml3_firq_mask_w)); + map(0xffd4, 0xffd4).w(FUNC(bml3_state::firq_mask_w)); // LPENBL - Light pen operation enable map(0xffd5, 0xffd5).noprw(); // INTERLACE_SEL - Interlaced video mode (manual has "INTERACE SEL"!) - map(0xffd6, 0xffd6).w(FUNC(bml3_state::bml3_vres_reg_w)); + map(0xffd6, 0xffd6).w(FUNC(bml3_state::vres_reg_w)); // AM_RANGE(0xffd7, 0xffd7) baud select // C_REG_SEL - Attribute register (character/video mode and colours) - map(0xffd8, 0xffd8).rw(FUNC(bml3_state::bml3_vram_attr_r), FUNC(bml3_state::bml3_vram_attr_w)); + map(0xffd8, 0xffd8).rw(FUNC(bml3_state::vram_attr_r), FUNC(bml3_state::vram_attr_w)); // KB - Keyboard mode register, interrupt control, keyboard LEDs - map(0xffe0, 0xffe0).rw(FUNC(bml3_state::bml3_keyboard_r), FUNC(bml3_state::bml3_keyboard_w)); + map(0xffe0, 0xffe0).rw(FUNC(bml3_state::keyboard_r), FUNC(bml3_state::keyboard_w)); // AM_RANGE(0xffe8, 0xffe8) bank register // AM_RANGE(0xffe9, 0xffe9) IG mode register // AM_RANGE(0xffea, 0xffea) IG enable register map(0xa000, 0xfeff).rom().region("maincpu", 0xa000); map(0xfff0, 0xffff).rom().region("maincpu", 0xfff0); - map(0xa000, 0xbfff).w(FUNC(bml3_state::bml3_a000_w)); - map(0xc000, 0xdfff).w(FUNC(bml3_state::bml3_c000_w)); - map(0xe000, 0xefff).w(FUNC(bml3_state::bml3_e000_w)); - map(0xf000, 0xfeff).w(FUNC(bml3_state::bml3_f000_w)); - map(0xfff0, 0xffff).w(FUNC(bml3_state::bml3_fff0_w)); + map(0xa000, 0xbfff).w(FUNC(bml3_state::a000_w)); + map(0xc000, 0xdfff).w(FUNC(bml3_state::c000_w)); + map(0xe000, 0xefff).w(FUNC(bml3_state::e000_w)); + map(0xf000, 0xfeff).w(FUNC(bml3_state::f000_w)); + map(0xfff0, 0xffff).w(FUNC(bml3_state::fff0_w)); #if 0 - map(0xff00, 0xff00).rw(FUNC(bml3_state::bml3_ym2203_r), FUNC(bml3_state::bml3_ym2203_w)); - map(0xff02, 0xff02).rw(FUNC(bml3_state::bml3_psg_latch_r), FUNC(bml3_state::bml3_psg_latch_w)); // PSG address/data select + map(0xff00, 0xff00).rw(FUNC(bml3_state::ym2203_r), FUNC(bml3_state::ym2203_w)); + map(0xff02, 0xff02).rw(FUNC(bml3_state::psg_latch_r), FUNC(bml3_state::psg_latch_w)); // PSG address/data select #endif } @@ -728,7 +708,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(bml3_state::keyboard_callback) } } -TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::bml3_p ) +TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::kansas_r ) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -743,14 +723,14 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::bml3_p ) } #if 0 -INTERRUPT_GEN_MEMBER(bml3_state::bml3_irq) +INTERRUPT_GEN_MEMBER(bml3_state::irq) { m_maincpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); } #endif -INTERRUPT_GEN_MEMBER(bml3_state::bml3_timer_firq) +INTERRUPT_GEN_MEMBER(bml3_state::timer_firq) { if(!m_firq_mask) { @@ -786,16 +766,16 @@ void bml3_state::machine_reset() /* defaults */ mem.install_rom(0xa000, 0xfeff,memregion("maincpu")->base() + 0xa000); mem.install_rom(0xfff0, 0xffff,memregion("maincpu")->base() + 0xfff0); - mem.install_write_handler(0xa000, 0xbfff, write8_delegate(FUNC(bml3_state::bml3_a000_w), this),0); - mem.install_write_handler(0xc000, 0xdfff, write8_delegate(FUNC(bml3_state::bml3_c000_w), this),0); - mem.install_write_handler(0xe000, 0xefff, write8_delegate(FUNC(bml3_state::bml3_e000_w), this),0); - mem.install_write_handler(0xf000, 0xfeff, write8_delegate(FUNC(bml3_state::bml3_f000_w), this),0); - mem.install_write_handler(0xfff0, 0xffff, write8_delegate(FUNC(bml3_state::bml3_fff0_w), this),0); + mem.install_write_handler(0xa000, 0xbfff, write8_delegate(FUNC(bml3_state::a000_w), this),0); + mem.install_write_handler(0xc000, 0xdfff, write8_delegate(FUNC(bml3_state::c000_w), this),0); + mem.install_write_handler(0xe000, 0xefff, write8_delegate(FUNC(bml3_state::e000_w), this),0); + mem.install_write_handler(0xf000, 0xfeff, write8_delegate(FUNC(bml3_state::f000_w), this),0); + mem.install_write_handler(0xfff0, 0xffff, write8_delegate(FUNC(bml3_state::fff0_w), this),0); m_firq_mask = -1; // disable firq } -WRITE8_MEMBER(bml3_state::bml3_piaA_w) +WRITE8_MEMBER(bml3_state::piaA_w) { address_space &mem = m_maincpu->space(AS_PROGRAM); /* ROM banking: @@ -818,15 +798,15 @@ WRITE8_MEMBER(bml3_state::bml3_piaA_w) if(data & 0x40) { mem.install_readwrite_handler(0xa000, 0xbfff, - read8_delegate(FUNC(bml3_state::bml3_a000_r), this), - write8_delegate(FUNC(bml3_state::bml3_a000_w), this), 0); + read8_delegate(FUNC(bml3_state::a000_r), this), + write8_delegate(FUNC(bml3_state::a000_w), this), 0); } else { mem.install_rom(0xa000, 0xbfff, memregion("maincpu")->base() + 0xa000); mem.install_write_handler(0xa000, 0xbfff, - write8_delegate(FUNC(bml3_state::bml3_a000_w), this), + write8_delegate(FUNC(bml3_state::a000_w), this), 0); } } @@ -836,15 +816,15 @@ WRITE8_MEMBER(bml3_state::bml3_piaA_w) if(data & 0x40) { mem.install_readwrite_handler(0xc000, 0xdfff, - read8_delegate(FUNC(bml3_state::bml3_c000_r), this), - write8_delegate(FUNC(bml3_state::bml3_c000_w), this), 0); + read8_delegate(FUNC(bml3_state::c000_r), this), + write8_delegate(FUNC(bml3_state::c000_w), this), 0); } else { mem.install_rom(0xc000, 0xdfff, memregion("maincpu")->base() + 0xc000); mem.install_write_handler(0xc000, 0xdfff, - write8_delegate(FUNC(bml3_state::bml3_c000_w), this), + write8_delegate(FUNC(bml3_state::c000_w), this), 0); } } @@ -854,15 +834,15 @@ WRITE8_MEMBER(bml3_state::bml3_piaA_w) if(data & 0x80) { mem.install_readwrite_handler(0xe000, 0xefff, - read8_delegate(FUNC(bml3_state::bml3_e000_r), this), - write8_delegate(FUNC(bml3_state::bml3_e000_w), this), 0); + read8_delegate(FUNC(bml3_state::e000_r), this), + write8_delegate(FUNC(bml3_state::e000_w), this), 0); } else { mem.install_rom(0xe000, 0xefff, memregion("maincpu")->base() + 0xe000); mem.install_write_handler(0xe000, 0xefff, - write8_delegate(FUNC(bml3_state::bml3_e000_w), this), + write8_delegate(FUNC(bml3_state::e000_w), this), 0); } } @@ -870,52 +850,45 @@ WRITE8_MEMBER(bml3_state::bml3_piaA_w) if(data & 1) { mem.install_readwrite_handler(0xf000, 0xfeff, - read8_delegate(FUNC(bml3_state::bml3_f000_r), this), - write8_delegate(FUNC(bml3_state::bml3_f000_w), this), 0); + read8_delegate(FUNC(bml3_state::f000_r), this), + write8_delegate(FUNC(bml3_state::f000_w), this), 0); } else { mem.install_rom(0xf000, 0xfeff, memregion("maincpu")->base() + 0xf000); mem.install_write_handler(0xf000, 0xfeff, - write8_delegate(FUNC(bml3_state::bml3_f000_w), this), + write8_delegate(FUNC(bml3_state::f000_w), this), 0); } if(data & 2) { mem.install_readwrite_handler(0xfff0, 0xffff, - read8_delegate(FUNC(bml3_state::bml3_fff0_r), this), - write8_delegate(FUNC(bml3_state::bml3_fff0_w), this), 0); + read8_delegate(FUNC(bml3_state::fff0_r), this), + write8_delegate(FUNC(bml3_state::fff0_w), this), 0); } else { mem.install_rom(0xfff0, 0xffff, memregion("maincpu")->base() + 0xfff0); mem.install_write_handler(0xfff0, 0xffff, - write8_delegate(FUNC(bml3_state::bml3_fff0_w), this), + write8_delegate(FUNC(bml3_state::fff0_w), this), 0); } } -WRITE_LINE_MEMBER( bml3_state::bml3_acia_tx_w ) -{ - //logerror("%02x TAPE\n",state); - m_cassbit = state; -} - - -WRITE_LINE_MEMBER( bml3_state::bml3_acia_rts_w ) +WRITE_LINE_MEMBER( bml3_state::acia_rts_w ) { logerror("%02x TAPE RTS\n",state); } -WRITE_LINE_MEMBER( bml3_state::bml3_acia_irq_w ) +WRITE_LINE_MEMBER( bml3_state::acia_irq_w ) { logerror("%02x TAPE IRQ\n",state); } -TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::bml3_c ) +TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::kansas_w ) { m_cass_data[3]++; @@ -943,8 +916,8 @@ void bml3_state::bml3_common(machine_config &config) { /* basic machine hardware */ MC6809(config, m_maincpu, CPU_EXT_CLOCK); - m_maincpu->set_vblank_int("screen", FUNC(bml3_state::bml3_timer_firq)); -// m_maincpu->set_periodic_int(FUNC(bml3_state::bml3_firq), attotime::fromhz(45)); + m_maincpu->set_vblank_int("screen", FUNC(bml3_state::timer_firq)); +// m_maincpu->set_periodic_int(FUNC(bml3_state::firq), attotime::fromhz(45)); // MCFG_MACHINE_RESET_OVERRIDE(bml3_state,bml3) @@ -968,16 +941,16 @@ void bml3_state::bml3_common(machine_config &config) // fire once per scan of an individual key // According to the service manual (p.65), the keyboard timer is driven by the horizontal video sync clock. TIMER(config, "keyboard_timer").configure_periodic(FUNC(bml3_state::keyboard_callback), attotime::from_hz(H_CLOCK/2)); - TIMER(config, "bml3_c").configure_periodic(FUNC(bml3_state::bml3_c), attotime::from_hz(4800)); - TIMER(config, "bml3_p").configure_periodic(FUNC(bml3_state::bml3_p), attotime::from_hz(40000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(bml3_state::kansas_w), attotime::from_hz(4800)); + TIMER(config, "kansas_r").configure_periodic(FUNC(bml3_state::kansas_r), attotime::from_hz(40000)); pia6821_device &pia(PIA6821(config, "pia", 0)); - pia.writepa_handler().set(FUNC(bml3_state::bml3_piaA_w)); + pia.writepa_handler().set(FUNC(bml3_state::piaA_w)); ACIA6850(config, m_acia, 0); - m_acia->txd_handler().set(FUNC(bml3_state::bml3_acia_tx_w)); - m_acia->rts_handler().set(FUNC(bml3_state::bml3_acia_rts_w)); - m_acia->irq_handler().set(FUNC(bml3_state::bml3_acia_irq_w)); + m_acia->txd_handler().set([this] (bool state) { m_cassbit = state; }); + m_acia->rts_handler().set(FUNC(bml3_state::acia_rts_w)); + m_acia->irq_handler().set(FUNC(bml3_state::acia_irq_w)); clock_device &acia_clock(CLOCK(config, "acia_clock", 9'600)); // 600 baud x 16(divider) = 9600 acia_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc)); diff --git a/src/mame/drivers/cd2650.cpp b/src/mame/drivers/cd2650.cpp index 2744717902a..8edeb68acba 100644 --- a/src/mame/drivers/cd2650.cpp +++ b/src/mame/drivers/cd2650.cpp @@ -83,13 +83,12 @@ private: void kbd_put(u8 data); DECLARE_WRITE_LINE_MEMBER(tape_deck_on_w); DECLARE_READ_LINE_MEMBER(cass_r); - DECLARE_WRITE_LINE_MEMBER(cass_w); TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); DECLARE_QUICKLOAD_LOAD_MEMBER(cd2650); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint8_t m_term_data; - bool m_flag; + bool m_cassbit; bool m_cassold; uint8_t m_cass_data[4]; virtual void machine_reset() override; @@ -104,13 +103,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(cd2650_state::kansas_w) { m_cass_data[3]++; - if (m_flag != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_flag; + m_cassold = m_cassbit; } - if (m_flag) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz @@ -135,11 +134,6 @@ WRITE_LINE_MEMBER(cd2650_state::tape_deck_on_w) m_cass->change_state(state ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); } -WRITE_LINE_MEMBER(cd2650_state::cass_w) -{ - m_flag = state; -} - READ_LINE_MEMBER(cd2650_state::cass_r) { return m_cass_data[2]; @@ -328,7 +322,7 @@ void cd2650_state::cd2650(machine_config &config) m_maincpu->set_addrmap(AS_IO, &cd2650_state::cd2650_io); m_maincpu->set_addrmap(AS_DATA, &cd2650_state::cd2650_data); m_maincpu->sense_handler().set(FUNC(cd2650_state::cass_r)); - m_maincpu->flag_handler().set(FUNC(cd2650_state::cass_w)); + m_maincpu->flag_handler().set([this] (bool state) { m_cassbit = state; }); f9334_device &outlatch(F9334(config, "outlatch")); // IC26 outlatch.q_out_cb<0>().set(FUNC(cd2650_state::tape_deck_on_w)); // TD ON diff --git a/src/mame/drivers/dolphunk.cpp b/src/mame/drivers/dolphunk.cpp index 3ac545a18ca..34ba551a718 100644 --- a/src/mame/drivers/dolphunk.cpp +++ b/src/mame/drivers/dolphunk.cpp @@ -106,17 +106,16 @@ public: private: DECLARE_READ_LINE_MEMBER(cass_r); - DECLARE_WRITE_LINE_MEMBER(cass_w); DECLARE_READ8_MEMBER(port07_r); DECLARE_WRITE8_MEMBER(port00_w); DECLARE_WRITE8_MEMBER(port06_w); - TIMER_DEVICE_CALLBACK_MEMBER(dauphin_c); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); void dauphin_io(address_map &map); void dauphin_mem(address_map &map); uint8_t m_cass_data; uint8_t m_last_key; - bool m_cass_state; + bool m_cassbit; bool m_cassold; bool m_speaker_state; virtual void machine_start() override { m_digits.resolve(); } @@ -131,11 +130,6 @@ READ_LINE_MEMBER( dauphin_state::cass_r ) return (m_cass->input() > 0.03) ? 1 : 0; } -WRITE_LINE_MEMBER( dauphin_state::cass_w ) -{ - m_cass_state = state; // get flag bit -} - WRITE8_MEMBER( dauphin_state::port00_w ) { m_digits[offset] = data; @@ -173,17 +167,17 @@ READ8_MEMBER( dauphin_state::port07_r ) return data; } -TIMER_DEVICE_CALLBACK_MEMBER(dauphin_state::dauphin_c) +TIMER_DEVICE_CALLBACK_MEMBER(dauphin_state::kansas_w) { m_cass_data++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data, 1) ? -1.0 : +1.0); // 1000Hz else m_cass->output(BIT(m_cass_data, 0) ? -1.0 : +1.0); // 2000Hz @@ -240,7 +234,7 @@ void dauphin_state::dauphin(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &dauphin_state::dauphin_mem); m_maincpu->set_addrmap(AS_IO, &dauphin_state::dauphin_io); m_maincpu->sense_handler().set(FUNC(dauphin_state::cass_r)); - m_maincpu->flag_handler().set(FUNC(dauphin_state::cass_w)); + m_maincpu->flag_handler().set([this] (bool state) { m_cassbit = state; }); /* video hardware */ config.set_default_layout(layout_dolphunk); @@ -252,7 +246,7 @@ void dauphin_state::dauphin(machine_config &config) /* cassette */ CASSETTE(config, m_cass); - TIMER(config, "dauphin_c").configure_periodic(FUNC(dauphin_state::dauphin_c), attotime::from_hz(4000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(dauphin_state::kansas_w), attotime::from_hz(4000)); } /* ROM definition */ diff --git a/src/mame/drivers/fc100.cpp b/src/mame/drivers/fc100.cpp index 41283265e66..b917defe61b 100644 --- a/src/mame/drivers/fc100.cpp +++ b/src/mame/drivers/fc100.cpp @@ -80,9 +80,8 @@ private: DECLARE_WRITE8_MEMBER(port43_w); DECLARE_WRITE8_MEMBER(port60_w); DECLARE_WRITE8_MEMBER(port70_w); - DECLARE_WRITE_LINE_MEMBER(txdata_callback); - TIMER_DEVICE_CALLBACK_MEMBER(timer_c); - TIMER_DEVICE_CALLBACK_MEMBER(timer_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); TIMER_DEVICE_CALLBACK_MEMBER(timer_k); MC6847_GET_CHARROM_MEMBER(get_char_rom) @@ -105,7 +104,7 @@ private: uint8_t m_intext; uint8_t m_inv; uint8_t m_cass_data[4]; - bool m_cass_state; + bool m_cassbit; bool m_cassold; uint8_t m_key_pressed; bool m_banksw_unlocked; @@ -423,28 +422,23 @@ WRITE8_MEMBER( fc100_state::port33_w ) m_cass->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); } -WRITE_LINE_MEMBER( fc100_state::txdata_callback ) -{ - m_cass_state = state; -} - -TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::timer_c ) +TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::kansas_w ) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::timer_p) +TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::kansas_r) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -487,7 +481,7 @@ void fc100_state::machine_start() void fc100_state::machine_reset() { m_cass_data[0] = m_cass_data[1] = m_cass_data[2] = m_cass_data[3] = 0; - m_cass_state = 0; + m_cassbit = 0; m_cassold = 0; m_key_pressed = 0; membank("bankr")->set_entry(0); @@ -550,13 +544,13 @@ void fc100_state::fc100(machine_config &config) m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED); I8251(config, m_uart, 0); - m_uart->txd_handler().set(FUNC(fc100_state::txdata_callback)); + m_uart->txd_handler().set([this] (bool state) { m_cassbit = state; }); clock_device &uart_clock(CLOCK(config, "uart_clock", XTAL(4'915'200)/16/16)); // gives 19200 uart_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc)); uart_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc)); - TIMER(config, "timer_c").configure_periodic(FUNC(fc100_state::timer_c), attotime::from_hz(4800)); // cass write - TIMER(config, "timer_p").configure_periodic(FUNC(fc100_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "kansas_w").configure_periodic(FUNC(fc100_state::kansas_w), attotime::from_hz(4800)); // cass write + TIMER(config, "kansas_r").configure_periodic(FUNC(fc100_state::kansas_r), attotime::from_hz(40000)); // cass read TIMER(config, "timer_k").configure_periodic(FUNC(fc100_state::timer_k), attotime::from_hz(300)); // keyb scan GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "fc100_cart"); diff --git a/src/mame/drivers/fp1100.cpp b/src/mame/drivers/fp1100.cpp index 2b186ed7ace..51aeed58aca 100644 --- a/src/mame/drivers/fp1100.cpp +++ b/src/mame/drivers/fp1100.cpp @@ -93,10 +93,9 @@ private: DECLARE_READ8_MEMBER(portc_r); DECLARE_WRITE8_MEMBER(portc_w); DECLARE_WRITE_LINE_MEMBER(centronics_busy_w); - DECLARE_WRITE_LINE_MEMBER(cass_w); INTERRUPT_GEN_MEMBER(vblank_irq); MC6845_UPDATE_ROW(crtc_update_row); - TIMER_DEVICE_CALLBACK_MEMBER(timer_c); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); required_device m_palette; void io_map(address_map &map); void main_map(address_map &map); @@ -112,7 +111,7 @@ private: uint8_t m_col_display; uint8_t m_centronics_busy; uint8_t m_cass_data[4]; - bool m_cass_state; + bool m_cassbit; bool m_cassold; struct { @@ -572,22 +571,17 @@ WRITE_LINE_MEMBER( fp1100_state::centronics_busy_w ) m_centronics_busy = state; } -WRITE_LINE_MEMBER( fp1100_state::cass_w ) -{ - m_cass_state = state; -} - -TIMER_DEVICE_CALLBACK_MEMBER( fp1100_state::timer_c ) +TIMER_DEVICE_CALLBACK_MEMBER( fp1100_state::kansas_w ) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz @@ -653,7 +647,7 @@ void fp1100_state::fp1100(machine_config &config) sub.pb_out_cb().set("cent_data_out", FUNC(output_latch_device::bus_w)); sub.pc_in_cb().set(FUNC(fp1100_state::portc_r)); sub.pc_out_cb().set(FUNC(fp1100_state::portc_w)); - sub.txd_func().set(FUNC(fp1100_state::cass_w)); + sub.txd_func().set([this] (bool state) { m_cassbit = state; }); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -687,7 +681,7 @@ void fp1100_state::fp1100(machine_config &config) /* Cassette */ CASSETTE(config, m_cass); m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED); - TIMER(config, "timer_c").configure_periodic(FUNC(fp1100_state::timer_c), attotime::from_hz(4800)); // cass write + TIMER(config, "kansas_w").configure_periodic(FUNC(fp1100_state::kansas_w), attotime::from_hz(4800)); // cass write } /* ROM definition */ diff --git a/src/mame/drivers/h8.cpp b/src/mame/drivers/h8.cpp index 7b2dba21752..29b2bc24281 100644 --- a/src/mame/drivers/h8.cpp +++ b/src/mame/drivers/h8.cpp @@ -80,7 +80,6 @@ private: DECLARE_WRITE8_MEMBER(portf1_w); DECLARE_WRITE8_MEMBER(h8_status_callback); DECLARE_WRITE_LINE_MEMBER(h8_inte_callback); - DECLARE_WRITE_LINE_MEMBER(txdata_callback); TIMER_DEVICE_CALLBACK_MEMBER(h8_irq_pulse); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); @@ -93,7 +92,7 @@ private: uint8_t m_irq_ctl; bool m_ff_b; uint8_t m_cass_data[4]; - bool m_cass_state; + bool m_cassbit; bool m_cassold; virtual void machine_reset() override; virtual void machine_start() override { m_digits.resolve(); } @@ -242,7 +241,7 @@ void h8_state::machine_reset() { output().set_value("pwr_led", 0); m_irq_ctl = 1; - m_cass_state = 1; + m_cassbit = 1; m_cass_data[0] = 0; m_cass_data[1] = 0; m_uart->write_cts(0); @@ -290,22 +289,17 @@ But, all of this can only occur if bit 4 of port F0 is low. */ output().set_value("run_led", state); } -WRITE_LINE_MEMBER( h8_state::txdata_callback ) -{ - m_cass_state = state; -} - TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_w) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz @@ -344,14 +338,14 @@ void h8_state::h8(machine_config &config) /* Devices */ I8251(config, m_uart, 0); - m_uart->txd_handler().set(FUNC(h8_state::txdata_callback)); + m_uart->txd_handler().set([this] (bool state) { m_cassbit = state; }); clock_device &cassette_clock(CLOCK(config, "cassette_clock", 4800)); cassette_clock.signal_handler().set(m_uart, FUNC(i8251_device::write_txc)); cassette_clock.signal_handler().append(m_uart, FUNC(i8251_device::write_rxc)); CASSETTE(config, m_cass); - m_cass->set_default_state((cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)); + m_cass->set_default_state((cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)); m_cass->set_interface("h8_cass"); TIMER(config, "kansas_w").configure_periodic(FUNC(h8_state::kansas_w), attotime::from_hz(4800)); diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp index d77e9ff93fc..954bbc4aa3d 100644 --- a/src/mame/drivers/mekd2.cpp +++ b/src/mame/drivers/mekd2.cpp @@ -114,9 +114,8 @@ private: DECLARE_WRITE8_MEMBER(mekd2_digit_w); DECLARE_WRITE8_MEMBER(mekd2_segment_w); DECLARE_QUICKLOAD_LOAD_MEMBER(mekd2_quik); - DECLARE_WRITE_LINE_MEMBER(cass_w); - TIMER_DEVICE_CALLBACK_MEMBER(mekd2_c); - TIMER_DEVICE_CALLBACK_MEMBER(mekd2_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void mekd2_mem(address_map &map); @@ -125,7 +124,7 @@ private: uint8_t m_segment; uint8_t m_digit; uint8_t m_keydata; - bool m_cass_state; + bool m_cassbit; bool m_cassold; virtual void machine_start() override; required_device m_maincpu; @@ -304,11 +303,6 @@ WRITE8_MEMBER( mekd2_state::mekd2_digit_w ) ************************************************************/ -WRITE_LINE_MEMBER( mekd2_state::cass_w ) -{ - m_cass_state = state; -} - QUICKLOAD_LOAD_MEMBER( mekd2_state, mekd2_quik ) { static const char magic[] = "MEK6800D2"; @@ -334,23 +328,23 @@ QUICKLOAD_LOAD_MEMBER( mekd2_state, mekd2_quik ) return image_init_result::PASS; } -TIMER_DEVICE_CALLBACK_MEMBER(mekd2_state::mekd2_c) +TIMER_DEVICE_CALLBACK_MEMBER(mekd2_state::kansas_w) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -TIMER_DEVICE_CALLBACK_MEMBER(mekd2_state::mekd2_p) +TIMER_DEVICE_CALLBACK_MEMBER(mekd2_state::kansas_r) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -404,7 +398,7 @@ void mekd2_state::mekd2(machine_config &config) m_pia_u->irqb_handler().set_inputline("maincpu", M6800_IRQ_LINE); ACIA6850(config, m_acia, 0); - m_acia->txd_handler().set(FUNC(mekd2_state::cass_w)); + m_acia->txd_handler().set([this] (bool state) { m_cassbit = state; }); clock_device &acia_tx_clock(CLOCK(config, "acia_tx_clock", XTAL_MEKD2 / 256)); // 4800Hz acia_tx_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_txc)); @@ -412,8 +406,8 @@ void mekd2_state::mekd2(machine_config &config) clock_device &acia_rx_clock(CLOCK(config, "acia_rx_clock", 300)); // toggled by cassette circuit acia_rx_clock.signal_handler().set(m_acia, FUNC(acia6850_device::write_rxc)); - TIMER(config, "mekd2_c").configure_periodic(FUNC(mekd2_state::mekd2_c), attotime::from_hz(4800)); - TIMER(config, "mekd2_p").configure_periodic(FUNC(mekd2_state::mekd2_p), attotime::from_hz(40000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(mekd2_state::kansas_w), attotime::from_hz(4800)); + TIMER(config, "kansas_r").configure_periodic(FUNC(mekd2_state::kansas_r), attotime::from_hz(40000)); QUICKLOAD(config, "quickload").set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(mekd2_state, mekd2_quik), this), "d2", attotime::from_seconds(1)); } diff --git a/src/mame/drivers/pro80.cpp b/src/mame/drivers/pro80.cpp index 8b15dee23d9..0e34882cf33 100644 --- a/src/mame/drivers/pro80.cpp +++ b/src/mame/drivers/pro80.cpp @@ -47,7 +47,7 @@ private: DECLARE_WRITE8_MEMBER(digit_w); DECLARE_WRITE8_MEMBER(segment_w); DECLARE_READ8_MEMBER(kp_r); - TIMER_DEVICE_CALLBACK_MEMBER(timer_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void pro80_io(address_map &map); void pro80_mem(address_map &map); @@ -64,7 +64,7 @@ private: // This can read the first few bytes correctly, but after that bit slippage occurs. // Needs to be reworked -TIMER_DEVICE_CALLBACK_MEMBER( pro80_state::timer_p ) +TIMER_DEVICE_CALLBACK_MEMBER( pro80_state::kansas_r ) { m_cass_data[1]++; uint8_t cass_ws = ((m_cass)->input() > +0.03) ? 1 : 0; @@ -72,7 +72,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pro80_state::timer_p ) if (cass_ws != m_cass_data[0]) { m_cass_data[0] = cass_ws; - m_cass_in = ((m_cass_data[1] < 0x0d) ? 0x10 : 0); // data bit + m_cass_in = ((m_cass_data[1] < 12) ? 0x10 : 0); // data bit m_cass_data[1] = 0; } if (m_cass_data[1] < 5) @@ -192,7 +192,7 @@ void pro80_state::pro80(machine_config &config) /* Devices */ CASSETTE(config, m_cass); Z80PIO(config, "pio", XTAL(4'000'000) / 2); - TIMER(config, "timer_p").configure_periodic(FUNC(pro80_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "kansas_r").configure_periodic(FUNC(pro80_state::kansas_r), attotime::from_hz(40000)); // cass read } /* ROM definition */ diff --git a/src/mame/drivers/proteus3.cpp b/src/mame/drivers/proteus3.cpp index c18892408bf..31e7b205429 100644 --- a/src/mame/drivers/proteus3.cpp +++ b/src/mame/drivers/proteus3.cpp @@ -85,10 +85,9 @@ private: DECLARE_WRITE_LINE_MEMBER(ca2_w); DECLARE_WRITE8_MEMBER(video_w); void kbd_put(u8 data); - DECLARE_WRITE_LINE_MEMBER(acia1_txdata_w); DECLARE_WRITE_LINE_MEMBER(acia1_clock_w); - TIMER_DEVICE_CALLBACK_MEMBER(timer_c); - TIMER_DEVICE_CALLBACK_MEMBER(timer_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_w); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); uint32_t screen_update_proteus3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); // Clocks @@ -115,7 +114,7 @@ private: uint8_t m_flashcnt; uint16_t m_curs_pos; uint8_t m_cass_data[4]; - bool m_cass_state; + bool m_cassbit; bool m_cassold; uint8_t m_clockcnt; virtual void machine_reset() override; @@ -200,23 +199,23 @@ void proteus3_state::write_acia_clocks(int id, int state) /****************************************************************************** Cassette ******************************************************************************/ -TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::timer_c ) +TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::kansas_w ) { m_cass_data[3]++; - if (m_cass_state != m_cassold) + if (m_cassbit != m_cassold) { m_cass_data[3] = 0; - m_cassold = m_cass_state; + m_cassold = m_cassbit; } - if (m_cass_state) + if (m_cassbit) m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz else m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz } -TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::timer_p ) +TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::kansas_r ) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; @@ -230,11 +229,6 @@ TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::timer_p ) } } -WRITE_LINE_MEMBER( proteus3_state::acia1_txdata_w ) -{ - m_cass_state = state; -} - WRITE_LINE_MEMBER( proteus3_state::acia1_clock_w ) { m_clockcnt++; @@ -361,7 +355,7 @@ void proteus3_state::machine_reset() { m_curs_pos = 0; m_cass_data[0] = m_cass_data[1] = m_cass_data[2] = m_cass_data[3] = 0; - m_cass_state = 1; + m_cassbit = 1; m_cassold = 1; m_acia1->write_rxd(1); @@ -408,14 +402,14 @@ void proteus3_state::proteus3(machine_config &config) /* cassette */ ACIA6850(config, m_acia1, 0); - m_acia1->txd_handler().set(FUNC(proteus3_state::acia1_txdata_w)); + m_acia1->txd_handler().set([this] (bool state) { m_cassbit = state; }); CASSETTE(config, m_cass); m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); SPEAKER(config, "mono").front_center(); WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25); - TIMER(config, "timer_c").configure_periodic(FUNC(proteus3_state::timer_c), attotime::from_hz(4800)); - TIMER(config, "timer_p").configure_periodic(FUNC(proteus3_state::timer_p), attotime::from_hz(40000)); + TIMER(config, "kansas_w").configure_periodic(FUNC(proteus3_state::kansas_w), attotime::from_hz(4800)); + TIMER(config, "kansas_r").configure_periodic(FUNC(proteus3_state::kansas_r), attotime::from_hz(40000)); // optional tty keyboard ACIA6850(config, m_acia2, 0); diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp index 1baebade4f0..aa4cb9aefe2 100644 --- a/src/mame/drivers/super80.cpp +++ b/src/mame/drivers/super80.cpp @@ -759,7 +759,7 @@ void super80_state::super80(machine_config &config) m_cassette->set_default_state((cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)); m_cassette->set_interface("super80_cass"); - TIMER(config, "timer_p").configure_periodic(FUNC(super80_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "kansas_r").configure_periodic(FUNC(super80_state::kansas_r), attotime::from_hz(40000)); // cass read TIMER(config, "timer_k").configure_periodic(FUNC(super80_state::timer_k), attotime::from_hz(300)); // keyb scan TIMER(config, "timer_h").configure_periodic(FUNC(super80_state::timer_h), attotime::from_hz(100)); // half-speed @@ -853,7 +853,7 @@ void super80_state::super80v(machine_config &config) m_cassette->set_default_state((cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)); m_cassette->set_interface("super80_cass"); - TIMER(config, "timer_p").configure_periodic(FUNC(super80_state::timer_p), attotime::from_hz(40000)); // cass read + TIMER(config, "kansas_r").configure_periodic(FUNC(super80_state::kansas_r), attotime::from_hz(40000)); // cass read TIMER(config, "timer_k").configure_periodic(FUNC(super80_state::timer_k), attotime::from_hz(300)); // keyb scan // software list diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index ff8e274d60b..0201db16ff8 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -108,7 +108,7 @@ private: TIMER_CALLBACK_MEMBER(super80_reset); TIMER_DEVICE_CALLBACK_MEMBER(timer_h); TIMER_DEVICE_CALLBACK_MEMBER(timer_k); - TIMER_DEVICE_CALLBACK_MEMBER(timer_p); + TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void super80_io(address_map &map); void super80_map(address_map &map); diff --git a/src/mame/machine/super80.cpp b/src/mame/machine/super80.cpp index 0ddcf690c71..6879c1f99e4 100644 --- a/src/mame/machine/super80.cpp +++ b/src/mame/machine/super80.cpp @@ -73,7 +73,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_k ) bit 0 = original system (U79 and U1) bit 1 = MDS fast system bit 2 = CA3140 */ -TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_p ) +TIMER_DEVICE_CALLBACK_MEMBER( super80_state::kansas_r ) { uint8_t cass_ws=0; -- cgit v1.2.3