mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
(MESS) modernized AY-3-1015 device. [Fabio Priuli]
This commit is contained in:
parent
f1cbe3df6a
commit
0ab088f287
File diff suppressed because it is too large
Load Diff
@ -12,115 +12,165 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
enum ay31015_type_t
|
||||
{
|
||||
/* For AY-3-1014A, AY-3-1015(D) and HD6402 variants */
|
||||
AY_3_1015,
|
||||
|
||||
/* For AY-3-1014, AY-5-1013 and AY-6-1013 variants */
|
||||
AY_5_1013
|
||||
};
|
||||
|
||||
|
||||
enum ay31015_input_pin_t
|
||||
{
|
||||
AY31015_SWE=16, /* -SWE - Pin 16 - Status word enable */
|
||||
AY31015_RDAV=18, /* -RDAV - Pin 18 - Reset data available */
|
||||
AY31015_SI=20, /* SI - Pin 20 - Serial input */
|
||||
AY31015_XR=21, /* XR - Pin 21 - External reset */
|
||||
AY31015_CS=34, /* CS - Pin 34 - Control strobe */
|
||||
AY31015_NP=35, /* NP - Pin 35 - No parity */
|
||||
AY31015_TSB=36, /* TSB - Pin 36 - Number of stop bits */
|
||||
AY31015_NB1=37, /* NB1 - Pin 37 - Number of bits #1 */
|
||||
AY31015_NB2=38, /* NB2 - Pin 38 - Number of bits #2 */
|
||||
AY31015_EPS=39 /* EPS - Pin 39 - Odd/Even parity select */
|
||||
AY31015_SWE = 16, /* -SWE - Pin 16 - Status word enable */
|
||||
AY31015_RDAV = 18, /* -RDAV - Pin 18 - Reset data available */
|
||||
AY31015_SI = 20, /* SI - Pin 20 - Serial input */
|
||||
AY31015_XR = 21, /* XR - Pin 21 - External reset */
|
||||
AY31015_CS = 34, /* CS - Pin 34 - Control strobe */
|
||||
AY31015_NP = 35, /* NP - Pin 35 - No parity */
|
||||
AY31015_TSB = 36, /* TSB - Pin 36 - Number of stop bits */
|
||||
AY31015_NB1 = 37, /* NB1 - Pin 37 - Number of bits #1 */
|
||||
AY31015_NB2 = 38, /* NB2 - Pin 38 - Number of bits #2 */
|
||||
AY31015_EPS = 39 /* EPS - Pin 39 - Odd/Even parity select */
|
||||
};
|
||||
|
||||
|
||||
enum ay31015_output_pin_t
|
||||
{
|
||||
AY31015_PE=13, /* PE - Pin 13 - Parity error */
|
||||
AY31015_FE=14, /* FE - Pin 14 - Framing error */
|
||||
AY31015_OR=15, /* OR - Pin 15 - Over-run */
|
||||
AY31015_DAV=19, /* DAV - Pin 19 - Data available */
|
||||
AY31015_TBMT=22, /* TBMT - Pin 22 - Transmit buffer empty */
|
||||
AY31015_EOC=24, /* EOC - Pin 24 - End of character */
|
||||
AY31015_SO=25 /* SO - Pin 25 - Serial output */
|
||||
AY31015_PE = 13, /* PE - Pin 13 - Parity error */
|
||||
AY31015_FE = 14, /* FE - Pin 14 - Framing error */
|
||||
AY31015_OR = 15, /* OR - Pin 15 - Over-run */
|
||||
AY31015_DAV = 19, /* DAV - Pin 19 - Data available */
|
||||
AY31015_TBMT = 22, /* TBMT - Pin 22 - Transmit buffer empty */
|
||||
AY31015_EOC = 24, /* EOC - Pin 24 - End of character */
|
||||
AY31015_SO = 25 /* SO - Pin 25 - Serial output */
|
||||
};
|
||||
|
||||
|
||||
struct ay31015_config
|
||||
{
|
||||
ay31015_type_t type; /* Type of chip */
|
||||
double transmitter_clock; /* TCP - pin 40 */
|
||||
double receiver_clock; /* RCP - pin 17 */
|
||||
devcb_read8 read_si_cb; /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
|
||||
double transmitter_clock; /* TCP - pin 40 */
|
||||
double receiver_clock; /* RCP - pin 17 */
|
||||
devcb_read8 read_si_cb; /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
|
||||
devcb_write8 write_so_cb; /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
|
||||
devcb_write8 status_changed_cb; /* This will be called whenever one of the status pins may have changed. Optional */
|
||||
};
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
DEVICE INTERFACE
|
||||
***************************************************************************/
|
||||
|
||||
enum state_t
|
||||
{
|
||||
IDLE,
|
||||
START_BIT,
|
||||
PROCESSING,
|
||||
PARITY_BIT,
|
||||
FIRST_STOP_BIT,
|
||||
SECOND_STOP_BIT,
|
||||
PREP_TIME
|
||||
};
|
||||
|
||||
|
||||
class ay31015_device : public device_t,
|
||||
public ay31015_config
|
||||
{
|
||||
public:
|
||||
ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
ay31015_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
|
||||
~ay31015_device() {}
|
||||
|
||||
|
||||
/* Set an input pin */
|
||||
void set_input_pin( ay31015_input_pin_t pin, int data );
|
||||
|
||||
|
||||
/* Get an output pin */
|
||||
int get_output_pin( ay31015_output_pin_t pin );
|
||||
|
||||
|
||||
/* Set a new transmitter clock (new_clock is in Hz) */
|
||||
void set_transmitter_clock( double new_clock );
|
||||
|
||||
|
||||
/* Set a new receiver clock (new_clock is in Hz) */
|
||||
void set_receiver_clock( double new_clock );
|
||||
|
||||
|
||||
/* Reead the received data */
|
||||
/* The received data is available on RD8-RD1 (pins 5-12) */
|
||||
UINT8 get_received_data();
|
||||
|
||||
|
||||
/* Set the transmitter buffer */
|
||||
/* The data to transmit is set on DB1-DB8 (pins 26-33) */
|
||||
void set_transmit_data( UINT8 data );
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
virtual void internal_reset();
|
||||
|
||||
// internal state
|
||||
inline UINT8 get_si();
|
||||
inline void set_so(int data);
|
||||
inline int update_status_pin(UINT8 reg_bit, ay31015_output_pin_t pin);
|
||||
void update_status_pins();
|
||||
void transfer_control_pins();
|
||||
inline void update_rx_timer();
|
||||
inline void update_tx_timer();
|
||||
TIMER_CALLBACK_MEMBER(rx_process);
|
||||
TIMER_CALLBACK_MEMBER(tx_process);
|
||||
|
||||
int m_pins[41];
|
||||
|
||||
UINT8 m_control_reg;
|
||||
UINT8 m_status_reg;
|
||||
UINT16 m_second_stop_bit; // 0, 8, 16
|
||||
UINT16 m_total_pulses; // bits * 16
|
||||
UINT8 m_internal_sample;
|
||||
|
||||
state_t m_rx_state;
|
||||
UINT8 m_rx_data; // byte being received
|
||||
UINT8 m_rx_buffer; // received byte waiting to be accepted by computer
|
||||
UINT8 m_rx_bit_count;
|
||||
UINT8 m_rx_parity;
|
||||
UINT16 m_rx_pulses; // total pulses left
|
||||
double m_rx_clock;
|
||||
emu_timer *m_rx_timer;
|
||||
|
||||
state_t m_tx_state;
|
||||
UINT8 m_tx_data; // byte being sent
|
||||
UINT8 m_tx_buffer; // next byte to send
|
||||
UINT8 m_tx_parity;
|
||||
UINT16 m_tx_pulses; // total pulses left
|
||||
double m_tx_clock;
|
||||
emu_timer *m_tx_timer;
|
||||
|
||||
devcb_resolved_read8 m_read_si; /* SI - pin 20 - This will be called whenever the SI pin is sampled. Optional */
|
||||
devcb_resolved_write8 m_write_so; /* SO - pin 25 - This will be called whenever data is put on the SO pin. Optional */
|
||||
devcb_resolved_write8 m_status_changed; /* This will be called whenever one of the status pins may have changed. Optional */
|
||||
};
|
||||
|
||||
class ay51013_device : public ay31015_device
|
||||
{
|
||||
public:
|
||||
ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
protected:
|
||||
virtual void internal_reset();
|
||||
|
||||
};
|
||||
|
||||
extern const device_type AY31015; // For AY-3-1014A, AY-3-1015(D) and HD6402 variants
|
||||
extern const device_type AY51013; // For AY-3-1014, AY-5-1013 and AY-6-1013 variants
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION MACROS
|
||||
***************************************************************************/
|
||||
|
||||
#define MCFG_AY31015_ADD(_tag, _config) \
|
||||
MCFG_DEVICE_ADD(_tag, AY31015, 0) \
|
||||
MCFG_DEVICE_CONFIG(_config)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
***************************************************************************/
|
||||
|
||||
/* Set an input pin */
|
||||
void ay31015_set_input_pin( device_t *device, ay31015_input_pin_t pin, int data );
|
||||
|
||||
|
||||
/* Get an output pin */
|
||||
int ay31015_get_output_pin( device_t *device, ay31015_output_pin_t pin );
|
||||
|
||||
|
||||
/* Set a new transmitter clock (new_clock is in Hz) */
|
||||
void ay31015_set_transmitter_clock( device_t *device, double new_clock );
|
||||
|
||||
|
||||
/* Set a new receiver clock (new_clock is in Hz) */
|
||||
void ay31015_set_receiver_clock( device_t *device, double new_clock );
|
||||
|
||||
|
||||
/* Reead the received data */
|
||||
/* The received data is available on RD8-RD1 (pins 5-12) */
|
||||
UINT8 ay31015_get_received_data( device_t *device );
|
||||
|
||||
|
||||
/* Set the transmitter buffer */
|
||||
/* The data to transmit is set on DB1-DB8 (pins 26-33) */
|
||||
void ay31015_set_transmit_data( device_t *device, UINT8 data );
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE INTERFACE
|
||||
***************************************************************************/
|
||||
|
||||
class ay31015_device : public device_t
|
||||
{
|
||||
public:
|
||||
ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~ay31015_device() { global_free(m_token); }
|
||||
|
||||
// access to legacy token
|
||||
void *token() const { assert(m_token != NULL); return m_token; }
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
private:
|
||||
// internal state
|
||||
void *m_token;
|
||||
};
|
||||
|
||||
extern const device_type AY31015;
|
||||
|
||||
#endif
|
||||
|
@ -55,7 +55,6 @@ Nascom Memory map
|
||||
/* Components */
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/wd17xx.h"
|
||||
#include "machine/ay31015.h"
|
||||
#include "machine/z80pio.h"
|
||||
|
||||
/* Devices */
|
||||
@ -254,7 +253,6 @@ INPUT_PORTS_END
|
||||
|
||||
static const ay31015_config nascom1_ay31015_config =
|
||||
{
|
||||
AY_3_1015,
|
||||
( XTAL_16MHz / 16 ) / 256,
|
||||
( XTAL_16MHz / 16 ) / 256,
|
||||
DEVCB_DRIVER_MEMBER(nascom1_state, nascom1_hd6402_si),
|
||||
|
@ -247,7 +247,7 @@ TIMER_CALLBACK_MEMBER(sol20_state::sol20_cassette_tc)
|
||||
m_cass_data.input.level = cass_ws;
|
||||
m_cass_data.input.bit = ((m_cass_data.input.length < 0x6) || (m_cass_data.input.length > 0x20)) ? 1 : 0;
|
||||
m_cass_data.input.length = 0;
|
||||
ay31015_set_input_pin( m_uart, AY31015_SI, m_cass_data.input.bit );
|
||||
m_uart->set_input_pin(AY31015_SI, m_cass_data.input.bit);
|
||||
}
|
||||
|
||||
/* saving a tape - convert the serial stream from the uart, into 1200 and 2400 Hz frequencies.
|
||||
@ -256,7 +256,7 @@ TIMER_CALLBACK_MEMBER(sol20_state::sol20_cassette_tc)
|
||||
m_cass_data.output.length++;
|
||||
if (!(m_cass_data.output.length & 0x1f))
|
||||
{
|
||||
cass_ws = ay31015_get_output_pin( m_uart, AY31015_SO );
|
||||
cass_ws = m_uart->get_output_pin(AY31015_SO);
|
||||
if (cass_ws != m_cass_data.output.bit)
|
||||
{
|
||||
m_cass_data.output.bit = cass_ws;
|
||||
@ -288,7 +288,7 @@ TIMER_CALLBACK_MEMBER(sol20_state::sol20_cassette_tc)
|
||||
m_cass_data.input.length = 0;
|
||||
m_cass_data.input.level = cass_ws;
|
||||
}
|
||||
ay31015_set_input_pin( m_uart, AY31015_SI, m_cass_data.input.bit );
|
||||
m_uart->set_input_pin(AY31015_SI, m_cass_data.input.bit);
|
||||
}
|
||||
|
||||
/* saving a tape - convert the serial stream from the uart, into 600 and 1200 Hz frequencies. */
|
||||
@ -296,7 +296,7 @@ TIMER_CALLBACK_MEMBER(sol20_state::sol20_cassette_tc)
|
||||
m_cass_data.output.length++;
|
||||
if (!(m_cass_data.output.length & 7))
|
||||
{
|
||||
cass_ws = ay31015_get_output_pin( m_uart, AY31015_SO );
|
||||
cass_ws = m_uart->get_output_pin(AY31015_SO);
|
||||
if (cass_ws != m_cass_data.output.bit)
|
||||
{
|
||||
m_cass_data.output.bit = cass_ws;
|
||||
@ -322,22 +322,22 @@ READ8_MEMBER( sol20_state::sol20_f8_r )
|
||||
/* set unemulated bits (CTS/DSR/CD) high */
|
||||
UINT8 data = 0x23;
|
||||
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_uart_s, AY31015_TBMT ) ? 0x80 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart_s, AY31015_DAV ) ? 0x40 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart_s, AY31015_OR ) ? 0x10 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart_s, AY31015_PE ) ? 0x08 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart_s, AY31015_FE ) ? 0x04 : 0;
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_SWE, 1 );
|
||||
m_uart_s->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_uart_s->get_output_pin(AY31015_TBMT) ? 0x80 : 0;
|
||||
data |= m_uart_s->get_output_pin(AY31015_DAV ) ? 0x40 : 0;
|
||||
data |= m_uart_s->get_output_pin(AY31015_OR ) ? 0x10 : 0;
|
||||
data |= m_uart_s->get_output_pin(AY31015_PE ) ? 0x08 : 0;
|
||||
data |= m_uart_s->get_output_pin(AY31015_FE ) ? 0x04 : 0;
|
||||
m_uart_s->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
READ8_MEMBER( sol20_state::sol20_f9_r)
|
||||
{
|
||||
UINT8 data = ay31015_get_received_data( m_uart_s );
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_RDAV, 0 );
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_RDAV, 1 );
|
||||
UINT8 data = m_uart_s->get_received_data();
|
||||
m_uart_s->set_input_pin(AY31015_RDAV, 0);
|
||||
m_uart_s->set_input_pin(AY31015_RDAV, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -346,12 +346,12 @@ READ8_MEMBER( sol20_state::sol20_fa_r )
|
||||
/* set unused bits high */
|
||||
UINT8 data = 0x26;
|
||||
|
||||
ay31015_set_input_pin( m_uart, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_TBMT ) ? 0x80 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_DAV ) ? 0x40 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_OR ) ? 0x10 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_FE ) ? 0x08 : 0;
|
||||
ay31015_set_input_pin( m_uart, AY31015_SWE, 1 );
|
||||
m_uart->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_uart->get_output_pin(AY31015_TBMT) ? 0x80 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_DAV ) ? 0x40 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_OR ) ? 0x10 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_FE ) ? 0x08 : 0;
|
||||
m_uart->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
bool arrowkey = m_iop_arrows->read() ? 0 : 1;
|
||||
bool keydown = m_sol20_fa & 1;
|
||||
@ -361,9 +361,9 @@ READ8_MEMBER( sol20_state::sol20_fa_r )
|
||||
|
||||
READ8_MEMBER( sol20_state::sol20_fb_r)
|
||||
{
|
||||
UINT8 data = ay31015_get_received_data( m_uart );
|
||||
ay31015_set_input_pin( m_uart, AY31015_RDAV, 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_RDAV, 1 );
|
||||
UINT8 data = m_uart->get_received_data();
|
||||
m_uart->set_input_pin(AY31015_RDAV, 0);
|
||||
m_uart->set_input_pin(AY31015_RDAV, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ WRITE8_MEMBER( sol20_state::sol20_f8_w )
|
||||
|
||||
WRITE8_MEMBER( sol20_state::sol20_f9_w )
|
||||
{
|
||||
ay31015_set_transmit_data( m_uart_s, data );
|
||||
m_uart_s->set_transmit_data(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sol20_state::sol20_fa_w )
|
||||
@ -414,13 +414,13 @@ WRITE8_MEMBER( sol20_state::sol20_fa_w )
|
||||
m_cassette_timer->adjust(attotime::zero);
|
||||
|
||||
// bit 5 baud rate */
|
||||
ay31015_set_receiver_clock( m_uart, (BIT(data, 5)) ? 4800.0 : 19200.0);
|
||||
ay31015_set_transmitter_clock( m_uart, (BIT(data, 5)) ? 4800.0 : 19200.0);
|
||||
m_uart->set_receiver_clock((BIT(data, 5)) ? 4800.0 : 19200.0);
|
||||
m_uart->set_transmitter_clock((BIT(data, 5)) ? 4800.0 : 19200.0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sol20_state::sol20_fb_w )
|
||||
{
|
||||
ay31015_set_transmit_data( m_uart, data );
|
||||
m_uart->set_transmit_data(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sol20_state::sol20_fd_w )
|
||||
@ -549,7 +549,6 @@ INPUT_PORTS_END
|
||||
|
||||
static const ay31015_config sol20_ay31015_config =
|
||||
{
|
||||
AY_3_1015,
|
||||
4800.0,
|
||||
4800.0,
|
||||
DEVCB_NULL,
|
||||
@ -587,23 +586,23 @@ void sol20_state::machine_reset()
|
||||
m_sol20_fa=1;
|
||||
|
||||
// set hard-wired uart pins
|
||||
ay31015_set_input_pin( m_uart, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_NB1, 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_NB2, 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_TSB, 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_EPS, 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_NP, 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_CS, 1 );
|
||||
m_uart->set_input_pin(AY31015_CS, 0);
|
||||
m_uart->set_input_pin(AY31015_NB1, 1);
|
||||
m_uart->set_input_pin(AY31015_NB2, 1);
|
||||
m_uart->set_input_pin(AY31015_TSB, 1);
|
||||
m_uart->set_input_pin(AY31015_EPS, 1);
|
||||
m_uart->set_input_pin(AY31015_NP, 1);
|
||||
m_uart->set_input_pin(AY31015_CS, 1);
|
||||
|
||||
// set switched uart pins
|
||||
data = m_iop_s4->read();
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_NB1, BIT(data, 1) ? 1 : 0);
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_NB2, BIT(data, 2) ? 1 : 0);
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_TSB, BIT(data, 3) ? 1 : 0);
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_EPS, BIT(data, 0) ? 1 : 0);
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_NP, BIT(data, 4) ? 1 : 0);
|
||||
ay31015_set_input_pin( m_uart_s, AY31015_CS, 1 );
|
||||
m_uart_s->set_input_pin(AY31015_CS, 0);
|
||||
m_uart_s->set_input_pin(AY31015_NB1, BIT(data, 1));
|
||||
m_uart_s->set_input_pin(AY31015_NB2, BIT(data, 2));
|
||||
m_uart_s->set_input_pin(AY31015_TSB, BIT(data, 3));
|
||||
m_uart_s->set_input_pin(AY31015_EPS, BIT(data, 0));
|
||||
m_uart_s->set_input_pin(AY31015_NP, BIT(data, 4));
|
||||
m_uart_s->set_input_pin(AY31015_CS, 1);
|
||||
|
||||
// set rs232 baud rate
|
||||
data = m_iop_s3->read();
|
||||
@ -622,8 +621,8 @@ void sol20_state::machine_reset()
|
||||
s_clock = s_bauds[s_count] << 4;
|
||||
|
||||
// these lines could be commented out for now if you want better performance
|
||||
ay31015_set_receiver_clock( m_uart_s, s_clock);
|
||||
ay31015_set_transmitter_clock( m_uart_s, s_clock);
|
||||
m_uart_s->set_receiver_clock(s_clock);
|
||||
m_uart_s->set_transmitter_clock(s_clock);
|
||||
|
||||
// boot-bank
|
||||
membank("boot")->set_entry(1);
|
||||
|
@ -386,7 +386,6 @@ UINT32 sorcerer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap
|
||||
|
||||
static const ay31015_config sorcerer_ay31015_config =
|
||||
{
|
||||
AY_3_1015,
|
||||
4800.0,
|
||||
4800.0,
|
||||
DEVCB_NULL,
|
||||
|
@ -554,7 +554,6 @@ static const cassette_interface trs80l2_cassette_interface =
|
||||
|
||||
static const ay31015_config trs80_ay31015_config =
|
||||
{
|
||||
AY_3_1015,
|
||||
0.0,
|
||||
0.0,
|
||||
DEVCB_NULL,
|
||||
|
@ -97,7 +97,6 @@
|
||||
#include "machine/ram.h"
|
||||
|
||||
/* peripheral chips */
|
||||
#include "machine/ay31015.h"
|
||||
#include "machine/kr2376.h"
|
||||
#include "machine/wd17xx.h"
|
||||
|
||||
@ -405,7 +404,6 @@ static const UINT32 lx388palette[] =
|
||||
|
||||
static const ay31015_config z80ne_ay31015_config =
|
||||
{
|
||||
AY_3_1015,
|
||||
4800.0,
|
||||
4800.0,
|
||||
DEVCB_NULL,
|
||||
|
@ -8,9 +8,10 @@
|
||||
#define NASCOM1_H_
|
||||
|
||||
#include "imagedev/snapquik.h"
|
||||
#include "machine/wd17xx.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "machine/wd17xx.h"
|
||||
#include "machine/ram.h"
|
||||
#include "machine/ay31015.h"
|
||||
|
||||
struct nascom1_portstat_t
|
||||
{
|
||||
@ -31,13 +32,18 @@ class nascom1_state : public driver_device
|
||||
public:
|
||||
nascom1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_hd6402(*this, "hd6402"),
|
||||
m_cassette(*this, "cassette"),
|
||||
m_ram(*this, RAM_TAG) { }
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_videoram(*this, "videoram")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<ay31015_device> m_hd6402;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<ram_device> m_ram;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
device_t *m_hd6402;
|
||||
int m_tape_size;
|
||||
UINT8 *m_tape_image;
|
||||
int m_tape_index;
|
||||
@ -61,9 +67,6 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(nascom1_hd6402_so);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( nascom1_cassette );
|
||||
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( nascom1_cassette );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<ram_device> m_ram;
|
||||
DECLARE_SNAPSHOT_LOAD_MEMBER( nascom1 );
|
||||
};
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include "video/mc6847.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "machine/ay31015.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@ -97,7 +98,7 @@ public:
|
||||
|
||||
optional_device<mc6847_base_device> m_vdg;
|
||||
optional_shared_ptr<UINT8> m_videoram;
|
||||
required_device<device_t> m_ay31015;
|
||||
required_device<ay31015_device> m_ay31015;
|
||||
optional_device<device_t> m_lx388_kr2376;
|
||||
UINT8 m_lx383_scan_counter;
|
||||
UINT8 m_lx383_key[LX383_KEYS];
|
||||
|
@ -142,26 +142,26 @@ WRITE8_MEMBER(nascom1_state::nascom1_port_00_w)
|
||||
|
||||
READ8_MEMBER(nascom1_state::nascom1_port_01_r)
|
||||
{
|
||||
return ay31015_get_received_data( m_hd6402 );
|
||||
return m_hd6402->get_received_data();
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(nascom1_state::nascom1_port_01_w)
|
||||
{
|
||||
ay31015_set_transmit_data( m_hd6402, data );
|
||||
m_hd6402->set_transmit_data(data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(nascom1_state::nascom1_port_02_r)
|
||||
{
|
||||
UINT8 data = 0x31;
|
||||
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_hd6402, AY31015_OR ) ? 0x02 : 0;
|
||||
data |= ay31015_get_output_pin( m_hd6402, AY31015_PE ) ? 0x04 : 0;
|
||||
data |= ay31015_get_output_pin( m_hd6402, AY31015_FE ) ? 0x08 : 0;
|
||||
data |= ay31015_get_output_pin( m_hd6402, AY31015_TBMT ) ? 0x40 : 0;
|
||||
data |= ay31015_get_output_pin( m_hd6402, AY31015_DAV ) ? 0x80 : 0;
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_SWE, 1 );
|
||||
m_hd6402->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_hd6402->get_output_pin(AY31015_OR ) ? 0x02 : 0;
|
||||
data |= m_hd6402->get_output_pin(AY31015_PE ) ? 0x04 : 0;
|
||||
data |= m_hd6402->get_output_pin(AY31015_FE ) ? 0x08 : 0;
|
||||
data |= m_hd6402->get_output_pin(AY31015_TBMT) ? 0x40 : 0;
|
||||
data |= m_hd6402->get_output_pin(AY31015_DAV ) ? 0x80 : 0;
|
||||
m_hd6402->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -241,18 +241,16 @@ SNAPSHOT_LOAD_MEMBER( nascom1_state, nascom1 )
|
||||
|
||||
void nascom1_state::machine_reset()
|
||||
{
|
||||
m_hd6402 = machine().device("hd6402");
|
||||
|
||||
/* Set up hd6402 pins */
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_SWE, 1 );
|
||||
m_hd6402->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_NP, 1 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_NB1, 1 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_NB2, 1 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_EPS, 1 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_TSB, 1 );
|
||||
ay31015_set_input_pin( m_hd6402, AY31015_CS, 1 );
|
||||
m_hd6402->set_input_pin(AY31015_CS, 0);
|
||||
m_hd6402->set_input_pin(AY31015_NP, 1);
|
||||
m_hd6402->set_input_pin(AY31015_NB1, 1);
|
||||
m_hd6402->set_input_pin(AY31015_NB2, 1);
|
||||
m_hd6402->set_input_pin(AY31015_EPS, 1);
|
||||
m_hd6402->set_input_pin(AY31015_TSB, 1);
|
||||
m_hd6402->set_input_pin(AY31015_CS, 1);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(nascom1_state,nascom1)
|
||||
|
@ -69,7 +69,7 @@ TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_cassette_tc)
|
||||
m_cass_data.input.level = cass_ws;
|
||||
m_cass_data.input.bit = ((m_cass_data.input.length < 0x6) || (m_cass_data.input.length > 0x20)) ? 1 : 0;
|
||||
m_cass_data.input.length = 0;
|
||||
ay31015_set_input_pin( m_uart, AY31015_SI, m_cass_data.input.bit );
|
||||
m_uart->set_input_pin(AY31015_SI, m_cass_data.input.bit);
|
||||
}
|
||||
|
||||
/* saving a tape - convert the serial stream from the uart, into 1200 and 2400 Hz frequencies.
|
||||
@ -78,7 +78,7 @@ TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_cassette_tc)
|
||||
m_cass_data.output.length++;
|
||||
if (!(m_cass_data.output.length & 0x1f))
|
||||
{
|
||||
cass_ws = ay31015_get_output_pin( m_uart, AY31015_SO );
|
||||
cass_ws = m_uart->get_output_pin(AY31015_SO);
|
||||
if (cass_ws != m_cass_data.output.bit)
|
||||
{
|
||||
m_cass_data.output.bit = cass_ws;
|
||||
@ -110,7 +110,7 @@ TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_cassette_tc)
|
||||
m_cass_data.input.length = 0;
|
||||
m_cass_data.input.level = cass_ws;
|
||||
}
|
||||
ay31015_set_input_pin( m_uart, AY31015_SI, m_cass_data.input.bit );
|
||||
m_uart->set_input_pin(AY31015_SI, m_cass_data.input.bit);
|
||||
}
|
||||
|
||||
/* saving a tape - convert the serial stream from the uart, into 600 and 1200 Hz frequencies. */
|
||||
@ -118,7 +118,7 @@ TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_cassette_tc)
|
||||
m_cass_data.output.length++;
|
||||
if (!(m_cass_data.output.length & 7))
|
||||
{
|
||||
cass_ws = ay31015_get_output_pin( m_uart, AY31015_SO );
|
||||
cass_ws = m_uart->get_output_pin(AY31015_SO);
|
||||
if (cass_ws != m_cass_data.output.bit)
|
||||
{
|
||||
m_cass_data.output.bit = cass_ws;
|
||||
@ -147,7 +147,7 @@ TIMER_CALLBACK_MEMBER(sorcerer_state::sorcerer_reset)
|
||||
|
||||
WRITE8_MEMBER(sorcerer_state::sorcerer_fc_w)
|
||||
{
|
||||
ay31015_set_transmit_data( m_uart, data );
|
||||
m_uart->set_transmit_data(data);
|
||||
}
|
||||
|
||||
|
||||
@ -155,13 +155,13 @@ WRITE8_MEMBER(sorcerer_state::sorcerer_fd_w)
|
||||
{
|
||||
/* Translate data to control signals */
|
||||
|
||||
ay31015_set_input_pin( m_uart, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_NB1, data & 1);
|
||||
ay31015_set_input_pin( m_uart, AY31015_NB2, (BIT(data, 1)) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_TSB, (BIT(data, 2)) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_EPS, (BIT(data, 3)) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_NP, (BIT(data, 4)) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_CS, 1 );
|
||||
m_uart->set_input_pin(AY31015_CS, 0);
|
||||
m_uart->set_input_pin(AY31015_NB1, BIT(data, 0));
|
||||
m_uart->set_input_pin(AY31015_NB2, BIT(data, 1));
|
||||
m_uart->set_input_pin(AY31015_TSB, BIT(data, 2));
|
||||
m_uart->set_input_pin(AY31015_EPS, BIT(data, 3));
|
||||
m_uart->set_input_pin(AY31015_NP, BIT(data, 4));
|
||||
m_uart->set_input_pin(AY31015_CS, 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sorcerer_state::sorcerer_fe_w)
|
||||
@ -215,8 +215,8 @@ WRITE8_MEMBER(sorcerer_state::sorcerer_fe_w)
|
||||
// bit 6 baud rate */
|
||||
if (BIT(changed_bits, 6))
|
||||
{
|
||||
ay31015_set_receiver_clock( m_uart, (BIT(data, 6)) ? 19200.0 : 4800.0);
|
||||
ay31015_set_transmitter_clock( m_uart, (BIT(data, 6)) ? 19200.0 : 4800.0);
|
||||
m_uart->set_receiver_clock(BIT(data, 6) ? 19200.0 : 4800.0);
|
||||
m_uart->set_transmitter_clock(BIT(data, 6) ? 19200.0 : 4800.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -246,9 +246,9 @@ WRITE8_MEMBER(sorcerer_state::sorcerer_ff_w)
|
||||
|
||||
READ8_MEMBER(sorcerer_state::sorcerer_fc_r)
|
||||
{
|
||||
UINT8 data = ay31015_get_received_data( m_uart );
|
||||
ay31015_set_input_pin( m_uart, AY31015_RDAV, 0 );
|
||||
ay31015_set_input_pin( m_uart, AY31015_RDAV, 1 );
|
||||
UINT8 data = m_uart->get_received_data();
|
||||
m_uart->set_input_pin(AY31015_RDAV, 0);
|
||||
m_uart->set_input_pin(AY31015_RDAV, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -257,13 +257,13 @@ READ8_MEMBER(sorcerer_state::sorcerer_fd_r)
|
||||
/* set unused bits high */
|
||||
UINT8 data = 0xe0;
|
||||
|
||||
ay31015_set_input_pin( m_uart, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_TBMT ) ? 0x01 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_DAV ) ? 0x02 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_OR ) ? 0x04 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_FE ) ? 0x08 : 0;
|
||||
data |= ay31015_get_output_pin( m_uart, AY31015_PE ) ? 0x10 : 0;
|
||||
ay31015_set_input_pin( m_uart, AY31015_SWE, 1 );
|
||||
m_uart->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_uart->get_output_pin(AY31015_TBMT) ? 0x01 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_DAV ) ? 0x02 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_OR ) ? 0x04 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_FE ) ? 0x08 : 0;
|
||||
data |= m_uart->get_output_pin(AY31015_PE ) ? 0x10 : 0;
|
||||
m_uart->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -123,13 +123,13 @@ READ8_MEMBER( trs80_state::trs80m4_ea_r )
|
||||
d2..d0 Not used */
|
||||
|
||||
UINT8 data=7;
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_TBMT ) ? 0x40 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_DAV ) ? 0x80 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_OR ) ? 0x20 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_FE ) ? 0x10 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_PE ) ? 0x08 : 0;
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 1 );
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_ay31015->get_output_pin(AY31015_TBMT) ? 0x40 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_DAV ) ? 0x80 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_OR ) ? 0x20 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_FE ) ? 0x10 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_PE ) ? 0x08 : 0;
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -137,9 +137,9 @@ READ8_MEMBER( trs80_state::trs80m4_ea_r )
|
||||
READ8_MEMBER( trs80_state::trs80m4_eb_r )
|
||||
{
|
||||
/* UART received data */
|
||||
UINT8 data = ay31015_get_received_data( m_ay31015 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_RDAV, 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_RDAV, 1 );
|
||||
UINT8 data = m_ay31015->get_received_data();
|
||||
m_ay31015->set_input_pin(AY31015_RDAV, 0);
|
||||
m_ay31015->set_input_pin(AY31015_RDAV, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -162,14 +162,14 @@ READ8_MEMBER( trs80_state::sys80_f9_r )
|
||||
d1 Overrun
|
||||
d0 Data Available */
|
||||
|
||||
UINT8 data=70;
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 0 );
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_TBMT ) ? 0 : 0x80;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_DAV ) ? 0x01 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_OR ) ? 0x02 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_FE ) ? 0x04 : 0;
|
||||
data |= ay31015_get_output_pin( m_ay31015, AY31015_PE ) ? 0x08 : 0;
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 1 );
|
||||
UINT8 data = 70;
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 0);
|
||||
data |= m_ay31015->get_output_pin(AY31015_TBMT) ? 0 : 0x80;
|
||||
data |= m_ay31015->get_output_pin(AY31015_DAV ) ? 0x01 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_OR ) ? 0x02 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_FE ) ? 0x04 : 0;
|
||||
data |= m_ay31015->get_output_pin(AY31015_PE ) ? 0x08 : 0;
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -421,8 +421,8 @@ WRITE8_MEMBER( trs80_state::trs80m4_e9_w )
|
||||
FFh 19200 */
|
||||
|
||||
static const int baud_clock[]={ 800, 1200, 1760, 2152, 2400, 4800, 9600, 19200, 28800, 32000, 38400, 57600, 76800, 115200, 153600, 307200 };
|
||||
ay31015_set_receiver_clock( m_ay31015, baud_clock[data & 0x0f]);
|
||||
ay31015_set_transmitter_clock( m_ay31015, baud_clock[data>>4]);
|
||||
m_ay31015->set_receiver_clock(baud_clock[data & 0x0f]);
|
||||
m_ay31015->set_transmitter_clock(baud_clock[data >> 4]);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( trs80_state::trs80m4_ea_w )
|
||||
@ -442,13 +442,13 @@ WRITE8_MEMBER( trs80_state::trs80m4_ea_w )
|
||||
d0 Data-Terminal-Ready (DTR), pin 20 */
|
||||
|
||||
{
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NB1, ( data & 0x40 ) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NB2, ( data & 0x20 ) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_TSB, ( data & 0x10 ) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_EPS, ( data & 0x80 ) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NP, ( data & 0x08 ) ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_CS, 1 );
|
||||
m_ay31015->set_input_pin(AY31015_CS, 0);
|
||||
m_ay31015->set_input_pin(AY31015_NB1, BIT(data, 6));
|
||||
m_ay31015->set_input_pin(AY31015_NB2, BIT(data, 5));
|
||||
m_ay31015->set_input_pin(AY31015_TSB, BIT(data, 4));
|
||||
m_ay31015->set_input_pin(AY31015_EPS, BIT(data, 7));
|
||||
m_ay31015->set_input_pin(AY31015_NP, BIT(data, 3));
|
||||
m_ay31015->set_input_pin(AY31015_CS, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -466,7 +466,7 @@ WRITE8_MEMBER( trs80_state::trs80m4_ea_w )
|
||||
|
||||
WRITE8_MEMBER( trs80_state::trs80m4_eb_w )
|
||||
{
|
||||
ay31015_set_transmit_data( m_ay31015, data );
|
||||
m_ay31015->set_transmit_data(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( trs80_state::trs80m4_ec_w )
|
||||
|
@ -49,7 +49,7 @@ TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_cassette_tc)
|
||||
m_cass_data.input.level = cass_ws;
|
||||
m_cass_data.input.bit = ((m_cass_data.input.length < m_cass_data.wave_filter) || (m_cass_data.input.length > 0x20)) ? 1 : 0;
|
||||
m_cass_data.input.length = 0;
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SI, m_cass_data.input.bit );
|
||||
m_ay31015->set_input_pin(AY31015_SI, m_cass_data.input.bit);
|
||||
}
|
||||
m_cass_data.input.level = cass_ws;
|
||||
|
||||
@ -64,7 +64,7 @@ TIMER_CALLBACK_MEMBER(z80ne_state::z80ne_cassette_tc)
|
||||
else
|
||||
{
|
||||
m_cass_data.output.level=1;
|
||||
cass_ws = ay31015_get_output_pin( m_ay31015, AY31015_SO );
|
||||
cass_ws = m_ay31015->get_output_pin(AY31015_SO);
|
||||
m_cass_data.wave_length = cass_ws ? m_cass_data.wave_short : m_cass_data.wave_long;
|
||||
}
|
||||
cassette_device_image()->output(m_cass_data.output.level ? -1.0 : +1.0);
|
||||
@ -312,15 +312,15 @@ MACHINE_RESET_MEMBER(z80ne_state,z80ne_base)
|
||||
m_cass_data.input.length = 0;
|
||||
m_cass_data.input.bit = 1;
|
||||
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_CS, 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NB1, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NB2, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_TSB, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_EPS, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_NP, m_io_lx_385->read() & 0x80 ? 1 : 0 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_CS, 1 );
|
||||
ay31015_set_receiver_clock( m_ay31015, m_cass_data.speed * 16.0);
|
||||
ay31015_set_transmitter_clock( m_ay31015, m_cass_data.speed * 16.0);
|
||||
m_ay31015->set_input_pin(AY31015_CS, 0);
|
||||
m_ay31015->set_input_pin(AY31015_NB1, 1);
|
||||
m_ay31015->set_input_pin(AY31015_NB2, 1);
|
||||
m_ay31015->set_input_pin(AY31015_TSB, 1);
|
||||
m_ay31015->set_input_pin(AY31015_EPS, 1);
|
||||
m_ay31015->set_input_pin(AY31015_NP, m_io_lx_385->read() & 0x80 ? 1 : 0);
|
||||
m_ay31015->set_input_pin(AY31015_CS, 1);
|
||||
m_ay31015->set_receiver_clock(m_cass_data.speed * 16.0);
|
||||
m_ay31015->set_transmitter_clock(m_cass_data.speed * 16.0);
|
||||
|
||||
m_nmi_delay_counter = 0;
|
||||
lx385_ctrl_w(m_maincpu->space(AS_PROGRAM), 0, 0);
|
||||
@ -518,7 +518,7 @@ WRITE8_MEMBER(z80ne_state::lx383_w)
|
||||
*/
|
||||
READ8_MEMBER(z80ne_state::lx385_data_r)
|
||||
{
|
||||
return ay31015_get_received_data( m_ay31015 );
|
||||
return m_ay31015->get_received_data();
|
||||
}
|
||||
|
||||
READ8_MEMBER(z80ne_state::lx385_ctrl_r)
|
||||
@ -526,21 +526,21 @@ READ8_MEMBER(z80ne_state::lx385_ctrl_r)
|
||||
/* set unused bits high */
|
||||
UINT8 data = 0xc0;
|
||||
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 0 );
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_OR ) ? 0x01 : 0);
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_FE ) ? 0x02 : 0);
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_PE ) ? 0x04 : 0);
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_TBMT ) ? 0x08 : 0);
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_DAV ) ? 0x10 : 0);
|
||||
data |= (ay31015_get_output_pin( m_ay31015, AY31015_EOC ) ? 0x20 : 0);
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_SWE, 1 );
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_OR ) ? 0x01 : 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_FE ) ? 0x02 : 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_PE ) ? 0x04 : 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_TBMT) ? 0x08 : 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_DAV ) ? 0x10 : 0);
|
||||
data |= (m_ay31015->get_output_pin(AY31015_EOC ) ? 0x20 : 0);
|
||||
m_ay31015->set_input_pin(AY31015_SWE, 1);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(z80ne_state::lx385_data_w)
|
||||
{
|
||||
ay31015_set_transmit_data( m_ay31015, data );
|
||||
m_ay31015->set_transmit_data(data);
|
||||
}
|
||||
|
||||
#define LX385_CASSETTE_MOTOR_MASK ((1<<3)|(1<<4))
|
||||
@ -566,23 +566,23 @@ WRITE8_MEMBER(z80ne_state::lx385_ctrl_w)
|
||||
motor_b = ((data & 0x10) == 0x00);
|
||||
|
||||
/* UART Reset and RDAV */
|
||||
if(uart_reset)
|
||||
if (uart_reset)
|
||||
{
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_XR, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_XR, 0 );
|
||||
m_ay31015->set_input_pin(AY31015_XR, 1);
|
||||
m_ay31015->set_input_pin(AY31015_XR, 0);
|
||||
}
|
||||
|
||||
if(uart_rdav)
|
||||
if (uart_rdav)
|
||||
{
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_RDAV, 1 );
|
||||
ay31015_set_input_pin( m_ay31015, AY31015_RDAV, 0 );
|
||||
m_ay31015->set_input_pin(AY31015_RDAV, 1);
|
||||
m_ay31015->set_input_pin(AY31015_RDAV, 0);
|
||||
}
|
||||
|
||||
if (!changed_bits) return;
|
||||
|
||||
/* UART Tx Clock enable/disable */
|
||||
if(changed_bits & 0x04)
|
||||
ay31015_set_transmitter_clock( m_ay31015, uart_tx_clock ? m_cass_data.speed * 16.0 : 0.0);
|
||||
if (changed_bits & 0x04)
|
||||
m_ay31015->set_transmitter_clock(uart_tx_clock ? m_cass_data.speed * 16.0 : 0.0);
|
||||
|
||||
/* motors */
|
||||
if(changed_bits & 0x18)
|
||||
|
Loading…
Reference in New Issue
Block a user