mirror of
https://github.com/holub/mame
synced 2025-04-26 18:23:08 +03:00
decodmd1: Add addressable latch device (nw)
This commit is contained in:
parent
ea7bc5dd72
commit
4a05d05fbd
@ -40,7 +40,6 @@ WRITE8_MEMBER( decodmd_type1_device::ctrl_w )
|
|||||||
if((m_ctrl & 0x02) && !(data & 0x02))
|
if((m_ctrl & 0x02) && !(data & 0x02))
|
||||||
{
|
{
|
||||||
m_rombank1->set_entry(0);
|
m_rombank1->set_entry(0);
|
||||||
m_bank = 0;
|
|
||||||
set_busy(B_SET,0);
|
set_busy(B_SET,0);
|
||||||
m_rowselect = 0;
|
m_rowselect = 0;
|
||||||
m_blank = 0;
|
m_blank = 0;
|
||||||
@ -102,44 +101,40 @@ WRITE8_MEMBER( decodmd_type1_device::dmd_port_w )
|
|||||||
break;
|
break;
|
||||||
case 0x84:
|
case 0x84:
|
||||||
bit = data & 0x01;
|
bit = data & 0x01;
|
||||||
switch(offset & 0xdc)
|
m_bitlatch->write_bit((offset & 0x40) >> 4 | (offset & 0x18) >> 3, bit);
|
||||||
{
|
|
||||||
case 0x84: // Bank bit 0
|
|
||||||
m_bank = (m_bank & ~0x01) | (~bit & 0x01);
|
|
||||||
m_rombank1->set_entry(m_bank);
|
|
||||||
break;
|
|
||||||
case 0x8c: // Bank bit 1
|
|
||||||
m_bank = (m_bank & ~0x02) | ((~bit & 0x01) << 1);
|
|
||||||
m_rombank1->set_entry(m_bank);
|
|
||||||
break;
|
|
||||||
case 0x94: // Bank bit 2
|
|
||||||
m_bank = (m_bank & ~0x04) | ((~bit & 0x01) << 2);
|
|
||||||
m_rombank1->set_entry(m_bank);
|
|
||||||
break;
|
|
||||||
case 0x9c: // Blanking
|
|
||||||
m_blank = bit;
|
|
||||||
if(bit)
|
|
||||||
output_data();
|
|
||||||
break;
|
|
||||||
case 0xc4: // Status
|
|
||||||
m_status = bit;
|
|
||||||
break;
|
|
||||||
case 0xcc: // Row data
|
|
||||||
m_rowdata = bit;
|
|
||||||
break;
|
|
||||||
case 0xd4: // Row clock
|
|
||||||
if(~bit & m_rowclock) // on negative edge
|
|
||||||
m_rowselect = (m_rowselect << 1) | m_rowdata;
|
|
||||||
m_rowclock = bit;
|
|
||||||
break;
|
|
||||||
case 0xdc: // Test
|
|
||||||
set_busy(B_SET,bit);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(decodmd_type1_device::blank_w)
|
||||||
|
{
|
||||||
|
m_blank = state;
|
||||||
|
if (state)
|
||||||
|
output_data();
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(decodmd_type1_device::status_w)
|
||||||
|
{
|
||||||
|
m_status = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(decodmd_type1_device::rowdata_w)
|
||||||
|
{
|
||||||
|
m_rowdata = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(decodmd_type1_device::rowclock_w)
|
||||||
|
{
|
||||||
|
if (!state & m_rowclock) // on negative edge
|
||||||
|
m_rowselect = (m_rowselect << 1) | m_rowdata;
|
||||||
|
m_rowclock = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LINE_MEMBER(decodmd_type1_device::test_w)
|
||||||
|
{
|
||||||
|
set_busy(B_SET, state);
|
||||||
|
}
|
||||||
|
|
||||||
void decodmd_type1_device::output_data()
|
void decodmd_type1_device::output_data()
|
||||||
{
|
{
|
||||||
uint8_t ptr = 0;
|
uint8_t ptr = 0;
|
||||||
@ -225,15 +220,23 @@ MACHINE_CONFIG_MEMBER( decodmd_type1_device::device_add_mconfig )
|
|||||||
MCFG_RAM_ADD(RAM_TAG)
|
MCFG_RAM_ADD(RAM_TAG)
|
||||||
MCFG_RAM_DEFAULT_SIZE("8K")
|
MCFG_RAM_DEFAULT_SIZE("8K")
|
||||||
|
|
||||||
|
MCFG_DEVICE_ADD("bitlatch", HC259, 0) // U4
|
||||||
|
MCFG_ADDRESSABLE_LATCH_PARALLEL_OUT_CB(MEMBANK("dmdbank1")) MCFG_DEVCB_MASK(0x07) MCFG_DEVCB_INVERT
|
||||||
|
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(decodmd_type1_device, blank_w))
|
||||||
|
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(decodmd_type1_device, status_w))
|
||||||
|
MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(decodmd_type1_device, rowdata_w))
|
||||||
|
MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(decodmd_type1_device, rowclock_w))
|
||||||
|
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(decodmd_type1_device, test_w))
|
||||||
MACHINE_CONFIG_END
|
MACHINE_CONFIG_END
|
||||||
|
|
||||||
|
|
||||||
decodmd_type1_device::decodmd_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
decodmd_type1_device::decodmd_type1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||||
: device_t(mconfig, DECODMD1, tag, owner, clock),
|
: device_t(mconfig, DECODMD1, tag, owner, clock),
|
||||||
m_cpu(*this,"dmdcpu"),
|
m_cpu(*this, "dmdcpu"),
|
||||||
m_rombank1(*this,"dmdbank1"),
|
m_rombank1(*this, "dmdbank1"),
|
||||||
m_rombank2(*this,"dmdbank2"),
|
m_rombank2(*this, "dmdbank2"),
|
||||||
m_ram(*this,RAM_TAG)
|
m_ram(*this, RAM_TAG),
|
||||||
|
m_bitlatch(*this, "bitlatch")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void decodmd_type1_device::device_start()
|
void decodmd_type1_device::device_start()
|
||||||
@ -256,7 +259,6 @@ void decodmd_type1_device::device_reset()
|
|||||||
m_rombank1->set_entry(0);
|
m_rombank1->set_entry(0);
|
||||||
m_rombank2->set_entry(0);
|
m_rombank2->set_entry(0);
|
||||||
m_status = 0;
|
m_status = 0;
|
||||||
m_bank = 0;
|
|
||||||
m_busy = 0;
|
m_busy = 0;
|
||||||
set_busy(B_CLR|B_SET,0);
|
set_busy(B_CLR|B_SET,0);
|
||||||
m_rowselect = 0;
|
m_rowselect = 0;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cpu/z80/z80.h"
|
#include "cpu/z80/z80.h"
|
||||||
|
#include "machine/74259.h"
|
||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
|
|
||||||
#define MCFG_DECODMD_TYPE1_ADD(_tag, _region) \
|
#define MCFG_DECODMD_TYPE1_ADD(_tag, _region) \
|
||||||
@ -24,6 +25,7 @@ public:
|
|||||||
required_memory_bank m_rombank1;
|
required_memory_bank m_rombank1;
|
||||||
required_memory_bank m_rombank2;
|
required_memory_bank m_rombank2;
|
||||||
required_device<ram_device> m_ram;
|
required_device<ram_device> m_ram;
|
||||||
|
required_device<hc259_device> m_bitlatch;
|
||||||
memory_region* m_rom;
|
memory_region* m_rom;
|
||||||
|
|
||||||
DECLARE_READ8_MEMBER(latch_r);
|
DECLARE_READ8_MEMBER(latch_r);
|
||||||
@ -36,6 +38,12 @@ public:
|
|||||||
DECLARE_READ8_MEMBER(dmd_port_r);
|
DECLARE_READ8_MEMBER(dmd_port_r);
|
||||||
DECLARE_WRITE8_MEMBER(dmd_port_w);
|
DECLARE_WRITE8_MEMBER(dmd_port_w);
|
||||||
|
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(blank_w);
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(status_w);
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(rowdata_w);
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(rowclock_w);
|
||||||
|
DECLARE_WRITE_LINE_MEMBER(test_w);
|
||||||
|
|
||||||
static void static_set_gfxregion(device_t &device, const char *tag);
|
static void static_set_gfxregion(device_t &device, const char *tag);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user