From 9b6133fa9f68155913bbd36a5b17d14722254ac3 Mon Sep 17 00:00:00 2001 From: smf- Date: Sun, 6 Apr 2014 18:02:40 +0000 Subject: [PATCH] hardcode the rs232 port again. (nw) --- src/mess/drivers/coco12.c | 5 +---- src/mess/drivers/coco3.c | 5 +---- src/mess/includes/coco.h | 10 ++++++--- src/mess/machine/coco.c | 44 +++++++++++++++++++++++++++++++++++---- 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/mess/drivers/coco12.c b/src/mess/drivers/coco12.c index 8cf4bd1fc9f..f3896028f64 100644 --- a/src/mess/drivers/coco12.c +++ b/src/mess/drivers/coco12.c @@ -293,10 +293,7 @@ static MACHINE_CONFIG_START( coco, coco12_state ) MCFG_SAM6883_ADD(SAM_TAG, XTAL_3_579545MHz, coco12_state::sam6883_config) MCFG_SAM6883_RES_CALLBACK(READ8(coco12_state, sam_read)) MCFG_CASSETTE_ADD("cassette", coco_state::coco_cassette_interface) - - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) - // default 600 baud? - + MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config) MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "pak") // video hardware diff --git a/src/mess/drivers/coco3.c b/src/mess/drivers/coco3.c index 4be2536ed35..8ad723d5746 100644 --- a/src/mess/drivers/coco3.c +++ b/src/mess/drivers/coco3.c @@ -262,10 +262,7 @@ static MACHINE_CONFIG_START( coco3, coco3_state ) MCFG_PIA_IRQB_HANDLER(WRITELINE(coco_state, pia1_firq_b)) MCFG_CASSETTE_ADD("cassette", coco_state::coco_cassette_interface) - - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) - // default 600 baud? - + MCFG_BITBANGER_ADD(BITBANGER_TAG, coco_state::coco_bitbanger_config) MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "fdcv11") MCFG_COCO_VHD_ADD(VHD0_TAG) MCFG_COCO_VHD_ADD(VHD1_TAG) diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h index 2a229ddbadb..65b7eb7e120 100644 --- a/src/mess/includes/coco.h +++ b/src/mess/includes/coco.h @@ -14,7 +14,7 @@ #include "emu.h" #include "imagedev/cassette.h" -#include "bus/rs232/rs232.h" +#include "imagedev/bitbngr.h" #include "machine/6821pia.h" #include "bus/coco/cococart.h" #include "machine/coco_vhd.h" @@ -47,7 +47,7 @@ SLOT_INTERFACE_EXTERN( coco_cart ); #define SCREEN_TAG "screen" #define DAC_TAG "dac" #define CARTRIDGE_TAG "ext" -#define RS232_TAG "rs232" +#define BITBANGER_TAG "bitbanger" #define VHD0_TAG "vhd0" #define VHD1_TAG "vhd1" @@ -92,16 +92,18 @@ public: required_device m_cococart; required_device m_ram; required_device m_cassette; - optional_device m_rs232; + optional_device m_bitbanger; optional_device m_vhd_0; optional_device m_vhd_1; static const cococart_interface cartridge_config; + static const bitbanger_config coco_bitbanger_config; static const cassette_interface coco_cassette_interface; // driver update handlers DECLARE_INPUT_CHANGED_MEMBER(keyboard_changed); DECLARE_INPUT_CHANGED_MEMBER(joystick_mode_changed); + static void bitbanger_callback(running_machine &machine, UINT8 bit); // IO virtual DECLARE_READ8_MEMBER( ff00_read ); @@ -149,6 +151,7 @@ protected: // changed handlers virtual void pia1_pa_changed(void); virtual void pia1_pb_changed(void); + virtual void bitbanger_changed(bool newvalue); // miscellaneous virtual void update_keyboard_input(UINT8 value, UINT8 z); @@ -211,6 +214,7 @@ private: void poll_hires_joystick(void); void update_cassout(int cassout); void update_prinout(bool prinout); + DECLARE_WRITE_LINE_MEMBER( bitbanger_callback ); void diecom_lightgun_clock(void); // thin wrappers for PIA output diff --git a/src/mess/machine/coco.c b/src/mess/machine/coco.c index a20827733ff..8f19ac906f0 100644 --- a/src/mess/machine/coco.c +++ b/src/mess/machine/coco.c @@ -88,7 +88,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch m_cococart(*this, CARTRIDGE_TAG), m_ram(*this, RAM_TAG), m_cassette(*this, "cassette"), - m_rs232(*this, RS232_TAG), + m_bitbanger(*this, BITBANGER_TAG), m_vhd_0(*this, VHD0_TAG), m_vhd_1(*this, VHD1_TAG) { @@ -479,7 +479,7 @@ READ8_MEMBER( coco_state::pia1_pb_r ) || (ram_size >= 0x8000 && (m_pia_0->b_output() & 0x80)); // serial in (PB0) - bool serial_in = (m_rs232 != NULL) && (m_rs232->rxd_r() ? true : false); + bool serial_in = (m_bitbanger != NULL) && (m_bitbanger->input() ? true : false); // composite the results return (memory_sense ? 0x04 : 0x00) @@ -963,9 +963,9 @@ void coco_state::update_prinout(bool prinout) else { /* output bitbanger if present (only on CoCos) */ - if (m_rs232 != NULL) + if (m_bitbanger != NULL) { - m_rs232->write_txd(prinout ? 1 : 0); + m_bitbanger->output(prinout ? 1 : 0); } } } @@ -1019,6 +1019,42 @@ INPUT_CHANGED_MEMBER(coco_state::joystick_mode_changed) +//------------------------------------------------- +// bitbanger_changed +//------------------------------------------------- + +void coco_state::bitbanger_changed(bool newvalue) +{ + // do nothing +} + + + +//------------------------------------------------- +// bitbanger_callback +//------------------------------------------------- + +WRITE_LINE_MEMBER( coco_state::bitbanger_callback ) +{ + bitbanger_changed(state ? true : false); +} + + + +//------------------------------------------------- +// bitbanger_config +//------------------------------------------------- + +const bitbanger_config coco_state::coco_bitbanger_config = +{ + DEVCB_DRIVER_LINE_MEMBER(coco_state, bitbanger_callback), /* callback */ + BITBANGER_PRINTER, /* default mode */ + BITBANGER_600, /* default output baud */ + BITBANGER_0PERCENT /* default fine tune adjustment */ +}; + + + //------------------------------------------------- // poll_hires_joystick //-------------------------------------------------