summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ieee488/ieee488.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ieee488/ieee488.cpp')
-rw-r--r--src/devices/bus/ieee488/ieee488.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/devices/bus/ieee488/ieee488.cpp b/src/devices/bus/ieee488/ieee488.cpp
index 38a1f538404..1b2f71c3f6a 100644
--- a/src/devices/bus/ieee488/ieee488.cpp
+++ b/src/devices/bus/ieee488/ieee488.cpp
@@ -63,7 +63,7 @@ device_ieee488_interface::~device_ieee488_interface()
// ieee488_slot_device - constructor
//-------------------------------------------------
-ieee488_slot_device::ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ieee488_slot_device::ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, IEEE488_SLOT, "IEEE-488 slot", tag, owner, clock, "ieee488_slot", __FILE__),
device_slot_interface(mconfig, *this), m_address(0)
{
@@ -100,7 +100,7 @@ void ieee488_slot_device::device_start()
// ieee488_device - constructor
//-------------------------------------------------
-ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, IEEE488, "IEEE-488 bus", tag, owner, clock, "ieee488", __FILE__),
m_write_eoi(*this),
m_write_dav(*this),
@@ -313,7 +313,7 @@ int ieee488_device::get_signal(int signal)
// set_data -
//-------------------------------------------------
-void ieee488_device::set_data(device_t *device, UINT8 data)
+void ieee488_device::set_data(device_t *device, uint8_t data)
{
if (device == this)
{
@@ -346,9 +346,9 @@ void ieee488_device::set_data(device_t *device, UINT8 data)
// get_data -
//-------------------------------------------------
-UINT8 ieee488_device::get_data()
+uint8_t ieee488_device::get_data()
{
- UINT8 data = m_dio;
+ uint8_t data = m_dio;
daisy_entry *entry = m_device_list.first();
ighlight .n { color: #000000 } /* Name */ .highlight .o { color: #ce5c00; font-weight: bold } /* Operator */ .highlight .x { color: #000000 } /* Other */ .highlight .p { color: #000000; font-weight: bold } /* Punctuation */ .highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */ .highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ .highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ .highlight .gd { color: #a40000 } /* Generic.Deleted */ .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ .highlight .gr { color: #ef2929 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ .highlight .go { color: #000000; font-style: italic } /* Generic.Output */ .highlight .gp { color: #8f5902 } /* Generic.Prompt */ .highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ .highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */ .highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */ .highlight .ld { color: #000000 } /* Literal.Date */ .highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */ .highlight .s { color: #4e9a06 } /* Literal.String */ .highlight .na { color: #c4a000 } /* Name.Attribute */ .highlight .nb { color: #204a87 } /* Name.Builtin */ .highlight .nc { color: #000000 } /* Name.Class */ .highlight .no { color: #000000 } /* Name.Constant */ .highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */ .highlight .ni { color: #ce5c00 } /* Name.Entity */ .highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #000000 } /* Name.Function */ .highlight .nl { color: #f57900 } /* Name.Label */ .highlight .nn { color: #000000 } /* Name.Namespace */ .highlight .nx { color: #000000 } /* Name.Other */ .highlight .py { color: #000000 } /* Name.Property */ .highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #000000 } /* Name.Variable */ .highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */ .highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */ .highlight .w { color: #f8f8f8 } /* Text.Whitespace */ .highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ .highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ .highlight .sc { color: #4e9a06 } /* Literal.String.Char */ .highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ .highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ .highlight .se { color: #4e9a06 } /* Literal.String.Escape */ .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ .highlight .sx { color: #4e9a06 } /* Literal.String.Other */ .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ .highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #000000 } /* Name.Function.Magic */ .highlight .vc { color: #000000 } /* Name.Variable.Class */ .highlight .vg { color: #000000 } /* Name.Variable.Global */ .highlight .vi { color: #000000 } /* Name.Variable.Instance */ .highlight .vm { color: #000000 } /* Name.Variable.Magic */ .highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
// license:BSD-3-Clause
// copyright-holders:hap
/**********************************************************************

    IDT7200 series 9-bit Asynchronous FIFO Emulation

**********************************************************************
                            _____   _____
                    _W   1 |*    \_/     | 28  Vcc
                    D8   2 |             | 27  D4
                    D3   3 |             | 26  D5
                    D2   4 |             | 25  D6
                    D1   5 |             | 24  D7
                    D0   6 |             | 23  _FL/_RT
                   _XI   7 |     7200    | 22  _MR
                   _FF   8 |             | 21  _EF
                    Q0   9 |             | 20  _XO/_HF
                    Q1  10 |             | 19  Q7
                    Q2  11 |             | 18  Q6
                    Q3  12 |             | 17  Q5
                    Q8  13 |             | 16  Q4
                   GND  14 |_____________| 15  _R


Known chips and buffer sizes are listed below. Note that in width or depth
expansion mode (using more than one chip and XO/XI), it may be increased more.

    256x9     512x9     1Kx9      2Kx9      4Kx9      8Kx9      16Kx9     32Kx9     64Kx9
  -------------------------------------------------------------------------------------------
    IDT7200   IDT7201   IDT7202   IDT7203   IDT7204   IDT7205   IDT7206   IDT7207   IDT7208

The following chips are functionally equivalent and pin-compatible.

    AM7200    AM7201    AM7202    AM7203    AM7204
    MS7200    MS7201    MS7202    MS7203    MS7204
              QS7201    QS7202    QS7203    QS7204

    LH5495    LH5496    LH5497    LH5498    LH5499
              LH540201  LH540202  LH540203  LH540204  LH540205  LH540206

    CY7C419   CY7C420   CY7C424   CY7C428   CY7C432
              CY7C421   CY7C425   CY7C429   CY7C433

32-pin PLCC/LCC or TQFP configurations are also available.


**********************************************************************/

#ifndef MAME_MACHINE_7200FIFO_H
#define MAME_MACHINE_7200FIFO_H

#pragma once



//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// ======================> fifo7200_device

class fifo7200_device : public device_t
{
public:
	auto ef_handler() { return m_ef_handler.bind(); }
	auto ff_handler() { return m_ff_handler.bind(); }
	auto hf_handler() { return m_hf_handler.bind(); }

	DECLARE_READ_LINE_MEMBER( ef_r ) { return !m_ef; } // _EF
	DECLARE_READ_LINE_MEMBER( ff_r ) { return !m_ff; } // _FF
	DECLARE_READ_LINE_MEMBER( hf_r ) { return !m_hf; } // _HF

	// normal configuration
	DECLARE_WRITE16_MEMBER( data_word_w ) { fifo_write(data); }
	DECLARE_READ16_MEMBER( data_word_r ) { return (uint16_t)fifo_read(); }

	// use these for simple configurations that don't have d8/q8 connected
	DECLARE_WRITE8_MEMBER( data_byte_w ) { fifo_write(data); }
	DECLARE_READ8_MEMBER( data_byte_r ) { return (uint8_t)fifo_read(); }

protected:
	fifo7200_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, int size);

	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

private:
	void fifo_write(uint16_t data);
	uint16_t fifo_read();

	std::vector<uint16_t> m_buffer;
	const int m_ram_size;

	int m_read_ptr;
	int m_write_ptr;

	int m_ef; // empty flag
	int m_ff; // full flag
	int m_hf; // half-full flag

	devcb_write_line m_ef_handler;
	devcb_write_line m_ff_handler;
	devcb_write_line m_hf_handler;
};

// ======================> idt7200_device

class idt7200_device : public fifo7200_device
{
public:
	idt7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
};

// ======================> idt7201_device

class idt7201_device : public fifo7200_device
{
public:
	idt7201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
};

// ======================> idt7202_device

class idt7202_device : public fifo7200_device
{
public:
	idt7202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
};

// device type definitions
DECLARE_DEVICE_TYPE(IDT7200, idt7200_device)
DECLARE_DEVICE_TYPE(IDT7201, idt7201_device)
DECLARE_DEVICE_TYPE(IDT7202, idt7202_device)

#endif // MAME_MACHINE_7200FIFO_H
>0x80) memory_set_bank(space->machine(), "bank1", 1); else memory_set_bank(space->machine(), "bank1", 0); } /*************************************************************************** PROTECTION HANDLING Some of the games running on this hardware are protected with a 68705 mcu. It can either be on a daughter board containing Z80+68705+one ROM, which replaces the Z80 on an unprotected main board; or it can be built-in on the main board. The two are fucntionally equivalent. The 68705 can read commands from the Z80, send back result codes, and has direct access to the Z80 memory space. It can also trigger IRQs on the Z80. ***************************************************************************/ READ8_HANDLER( taitosj_fake_data_r ) { LOG(("%04x: protection read\n",cpu_get_pc(space->cpu))); return 0; } WRITE8_HANDLER( taitosj_fake_data_w ) { LOG(("%04x: protection write %02x\n",cpu_get_pc(space->cpu),data)); } READ8_HANDLER( taitosj_fake_status_r ) { LOG(("%04x: protection status read\n",cpu_get_pc(space->cpu))); return 0xff; } /* timer callback : */ READ8_HANDLER( taitosj_mcu_data_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); LOG(("%04x: protection read %02x\n",cpu_get_pc(space->cpu),state->toz80)); state->zaccept = 1; return state->toz80; } /* timer callback : */ static TIMER_CALLBACK( taitosj_mcu_real_data_w ) { taitosj_state *state = machine.driver_data<taitosj_state>(); state->zready = 1; cputag_set_input_line(machine, "mcu", 0, ASSERT_LINE); state->fromz80 = param; } WRITE8_HANDLER( taitosj_mcu_data_w ) { LOG(("%04x: protection write %02x\n",cpu_get_pc(space->cpu),data)); space->machine().scheduler().synchronize(FUNC(taitosj_mcu_real_data_w), data); /* temporarily boost the interleave to sync things up */ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); } READ8_HANDLER( taitosj_mcu_status_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); /* temporarily boost the interleave to sync things up */ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); /* bit 0 = the 68705 has read data from the Z80 */ /* bit 1 = the 68705 has written data for the Z80 */ return ~((state->zready << 0) | (state->zaccept << 1)); } READ8_HANDLER( taitosj_68705_portA_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); LOG(("%04x: 68705 port A read %02x\n",cpu_get_pc(space->cpu),state->portA_in)); return state->portA_in; } WRITE8_HANDLER( taitosj_68705_portA_w ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); LOG(("%04x: 68705 port A write %02x\n",cpu_get_pc(space->cpu),data)); state->portA_out = data; } /* * Port B connections: * * all bits are logical 1 when read (+5V pullup) * * 0 W !68INTRQ * 1 W !68LRD (enables latch which holds command from the Z80) * 2 W !68LWR (loads the latch which holds data for the Z80, and sets a * status bit so the Z80 knows there's data waiting) * 3 W to Z80 !BUSRQ (aka !WAIT) pin * 4 W !68WRITE (triggers write to main Z80 memory area and increases low * 8 bits of the latched address) * 5 W !68READ (triggers read from main Z80 memory area and increases low * 8 bits of the latched address) * 6 W !LAL (loads the latch which holds the low 8 bits of the address of * the main Z80 memory location to access) * 7 W !UAL (loads the latch which holds the high 8 bits of the address of * the main Z80 memory location to access) */ READ8_HANDLER( taitosj_68705_portB_r ) { return 0xff; } /* timer callback : 68705 is going to read data from the Z80 */ static TIMER_CALLBACK( taitosj_mcu_data_real_r ) { taitosj_state *state = machine.driver_data<taitosj_state>(); state->zready = 0; } /* timer callback : 68705 is writing data for the Z80 */ static TIMER_CALLBACK( taitosj_mcu_status_real_w ) { taitosj_state *state = machine.driver_data<taitosj_state>(); state->toz80 = param; state->zaccept = 0; } WRITE8_HANDLER( taitosj_68705_portB_w ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); LOG(("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data)); if (~data & 0x01) { LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n", cpu_get_pc(space->cpu))); } if (~data & 0x02) { /* 68705 is going to read data from the Z80 */ space->machine().scheduler().synchronize(FUNC(taitosj_mcu_data_real_r)); cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE); state->portA_in = state->fromz80; LOG(("%04x: 68705 <- Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_in)); } if (~data & 0x08) state->busreq = 1; else state->busreq = 0; if (~data & 0x04) { LOG(("%04x: 68705 -> Z80 %02x\n", cpu_get_pc(space->cpu), state->portA_out)); /* 68705 is writing data for the Z80 */ space->machine().scheduler().synchronize(FUNC(taitosj_mcu_status_real_w), state->portA_out); } if (~data & 0x10) { address_space *cpu0space = space->machine().device("maincpu")->memory().space(AS_PROGRAM); LOG(("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(space->cpu), state->portA_out, state->address)); cpu0space->write_byte(state->address, state->portA_out); /* increase low 8 bits of latched address for burst writes */ state->address = (state->address & 0xff00) | ((state->address + 1) & 0xff); } if (~data & 0x20) { address_space *cpu0space = space->machine().device("maincpu")->memory().space(AS_PROGRAM); state->portA_in = cpu0space->read_byte(state->address); LOG(("%04x: 68705 read %02x from address %04x\n", cpu_get_pc(space->cpu), state->portA_in, state->address)); } if (~data & 0x40) { LOG(("%04x: 68705 address low %02x\n", cpu_get_pc(space->cpu), state->portA_out)); state->address = (state->address & 0xff00) | state->portA_out; } if (~data & 0x80) { LOG(("%04x: 68705 address high %02x\n", cpu_get_pc(space->cpu), state->portA_out)); state->address = (state->address & 0x00ff) | (state->portA_out << 8); } } /* * Port C connections: * * 0 R ZREADY (1 when the Z80 has written a command in the latch) * 1 R ZACCEPT (1 when the Z80 has read data from the latch) * 2 R from Z80 !BUSAK pin * 3 R 68INTAK (goes 0 when the interrupt request done with 68INTRQ * passes through) */ READ8_HANDLER( taitosj_68705_portC_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); int res; res = (state->zready << 0) | (state->zaccept << 1) | ((state->busreq^1) << 2); LOG(("%04x: 68705 port C read %02x\n",cpu_get_pc(space->cpu),res)); return res; } /* Space Cruiser protection (otherwise the game resets on the asteroids level) */ READ8_HANDLER( spacecr_prot_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); int pc = cpu_get_pc(space->cpu); if( pc != 0x368A && pc != 0x36A6 ) logerror("Read protection from an unknown location: %04X\n",pc); state->spacecr_prot_value ^= 0xff; return state->spacecr_prot_value; } /* Alpine Ski protection crack routines */ WRITE8_HANDLER( alpine_protection_w ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); switch (data) { case 0x05: state->protection_value = 0x18; break; case 0x07: case 0x0c: case 0x0f: state->protection_value = 0x00; /* not used as far as I can tell */ break; case 0x16: state->protection_value = 0x08; break; case 0x1d: state->protection_value = 0x18; break; default: state->protection_value = data; /* not used as far as I can tell */ break; } } WRITE8_HANDLER( alpinea_bankswitch_w ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); taitosj_bankswitch_w(space, offset, data); state->protection_value = data >> 2; } READ8_HANDLER( alpine_port_2_r ) { taitosj_state *state = space->machine().driver_data<taitosj_state>(); return input_port_read(space->machine(), "IN2") | state->protection_value; }