mirror of
https://github.com/holub/mame
synced 2025-06-29 23:48:56 +03:00
Rename machine/latch.* to machine/output_latch.* (nw)
- Use device_resolve_objects to resolve callbacks in output_latch_device (nw) Note that this renaming is not just for human convenience; genie seems to get confused by modifications to a header called latch.h and decides to recompile everything involving gen_latch.h as well.
This commit is contained in:
parent
bafe9c47ab
commit
20f49a2f4e
@ -21,8 +21,6 @@ files {
|
|||||||
MAME_DIR .. "src/devices/machine/keyboard.ipp",
|
MAME_DIR .. "src/devices/machine/keyboard.ipp",
|
||||||
MAME_DIR .. "src/devices/machine/laserdsc.cpp",
|
MAME_DIR .. "src/devices/machine/laserdsc.cpp",
|
||||||
MAME_DIR .. "src/devices/machine/laserdsc.h",
|
MAME_DIR .. "src/devices/machine/laserdsc.h",
|
||||||
MAME_DIR .. "src/devices/machine/latch.cpp",
|
|
||||||
MAME_DIR .. "src/devices/machine/latch.h",
|
|
||||||
MAME_DIR .. "src/devices/machine/nvram.cpp",
|
MAME_DIR .. "src/devices/machine/nvram.cpp",
|
||||||
MAME_DIR .. "src/devices/machine/nvram.h",
|
MAME_DIR .. "src/devices/machine/nvram.h",
|
||||||
MAME_DIR .. "src/devices/machine/ram.cpp",
|
MAME_DIR .. "src/devices/machine/ram.cpp",
|
||||||
@ -3506,3 +3504,15 @@ if (MACHINES["GEN_FIFO"]~=null) then
|
|||||||
MAME_DIR .. "src/devices/machine/gen_fifo.h",
|
MAME_DIR .. "src/devices/machine/gen_fifo.h",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------
|
||||||
|
--
|
||||||
|
--@src/devices/machine/output_latch.h,MACHINES["OUTPUT_LATCH"] = true
|
||||||
|
---------------------------------------------------
|
||||||
|
|
||||||
|
if (MACHINES["OUTPUT_LATCH"]~=null) then
|
||||||
|
files {
|
||||||
|
MAME_DIR .. "src/devices/machine/output_latch.cpp",
|
||||||
|
MAME_DIR .. "src/devices/machine/output_latch.h",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
@ -522,6 +522,7 @@ MACHINES["NETLIST"] = true
|
|||||||
MACHINES["NMC9306"] = true
|
MACHINES["NMC9306"] = true
|
||||||
--MACHINES["NSC810"] = true
|
--MACHINES["NSC810"] = true
|
||||||
MACHINES["NSCSI"] = true
|
MACHINES["NSCSI"] = true
|
||||||
|
MACHINES["OUTPUT_LATCH"] = true
|
||||||
MACHINES["PC_FDC"] = true
|
MACHINES["PC_FDC"] = true
|
||||||
MACHINES["PC_LPT"] = true
|
MACHINES["PC_LPT"] = true
|
||||||
--MACHINES["PCCARD"] = true
|
--MACHINES["PCCARD"] = true
|
||||||
|
@ -514,6 +514,7 @@ MACHINES["NMC9306"] = true
|
|||||||
MACHINES["NSC810"] = true
|
MACHINES["NSC810"] = true
|
||||||
MACHINES["NSCSI"] = true
|
MACHINES["NSCSI"] = true
|
||||||
MACHINES["OMTI5100"] = true
|
MACHINES["OMTI5100"] = true
|
||||||
|
MACHINES["OUTPUT_LATCH"] = true
|
||||||
MACHINES["PC_FDC"] = true
|
MACHINES["PC_FDC"] = true
|
||||||
MACHINES["PC_LPT"] = true
|
MACHINES["PC_LPT"] = true
|
||||||
MACHINES["PCCARD"] = true
|
MACHINES["PCCARD"] = true
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "exp.h"
|
#include "exp.h"
|
||||||
#include "machine/ataintf.h"
|
#include "machine/ataintf.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "machine/64h156.h"
|
#include "machine/64h156.h"
|
||||||
#include "machine/6522via.h"
|
#include "machine/6522via.h"
|
||||||
#include "machine/6821pia.h"
|
#include "machine/6821pia.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "machine/buffer.h"
|
#include "machine/buffer.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
|
|
||||||
|
|
||||||
#define MCFG_CENTRONICS_ADD(_tag, _slot_intf, _def_slot) \
|
#define MCFG_CENTRONICS_ADD(_tag, _slot_intf, _def_slot) \
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "cpu/m6502/m65c02.h"
|
#include "cpu/m6502/m65c02.h"
|
||||||
#include "machine/6522via.h"
|
#include "machine/6522via.h"
|
||||||
#include "machine/buffer.h"
|
#include "machine/buffer.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
#include "machine/mc146818.h"
|
#include "machine/mc146818.h"
|
||||||
#include "machine/mc6854.h"
|
#include "machine/mc6854.h"
|
||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "machine/buffer.h"
|
#include "machine/buffer.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
|
|
||||||
#define SCSI_PORT_DEVICE1 "1"
|
#define SCSI_PORT_DEVICE1 "1"
|
||||||
#define SCSI_PORT_DEVICE2 "2"
|
#define SCSI_PORT_DEVICE2 "2"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// license:BSD-3-Clause
|
// license:BSD-3-Clause
|
||||||
// copyright-holders:smf
|
// copyright-holders:smf
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "latch.h"
|
#include "output_latch.h"
|
||||||
|
|
||||||
DEFINE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device, "output_latch", "Output Latch")
|
DEFINE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device, "output_latch", "Output Latch")
|
||||||
|
|
||||||
@ -9,10 +9,15 @@ output_latch_device::output_latch_device(const machine_config &mconfig, const ch
|
|||||||
: device_t(mconfig, OUTPUT_LATCH, tag, owner, clock)
|
: device_t(mconfig, OUTPUT_LATCH, tag, owner, clock)
|
||||||
, m_bit_handlers{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
|
, m_bit_handlers{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
|
||||||
, m_bits{ -1, -1, -1, -1, -1, -1, -1, -1 }
|
, m_bits{ -1, -1, -1, -1, -1, -1, -1, -1 }
|
||||||
, m_resolved(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void output_latch_device::device_resolve_objects()
|
||||||
|
{
|
||||||
|
for (devcb_write_line &handler : m_bit_handlers)
|
||||||
|
handler.resolve_safe();
|
||||||
|
}
|
||||||
|
|
||||||
void output_latch_device::device_start()
|
void output_latch_device::device_start()
|
||||||
{
|
{
|
||||||
save_item(NAME(m_bits));
|
save_item(NAME(m_bits));
|
||||||
@ -20,15 +25,6 @@ void output_latch_device::device_start()
|
|||||||
|
|
||||||
void output_latch_device::write(uint8_t data)
|
void output_latch_device::write(uint8_t data)
|
||||||
{
|
{
|
||||||
if (!m_resolved)
|
|
||||||
{
|
|
||||||
// HACK: move to device_config_complete() when devcb supports that
|
|
||||||
for (devcb_write_line &handler : m_bit_handlers)
|
|
||||||
handler.resolve_safe();
|
|
||||||
|
|
||||||
m_resolved = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (unsigned i = 0; 8 > i; ++i)
|
for (unsigned i = 0; 8 > i; ++i)
|
||||||
{
|
{
|
||||||
int const bit = BIT(data, i);
|
int const bit = BIT(data, i);
|
@ -41,14 +41,13 @@ public:
|
|||||||
DECLARE_WRITE8_MEMBER(write) { write(data); }
|
DECLARE_WRITE8_MEMBER(write) { write(data); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void device_resolve_objects() override;
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
devcb_write_line m_bit_handlers[8];
|
devcb_write_line m_bit_handlers[8];
|
||||||
|
|
||||||
int m_bits[8];
|
int m_bits[8];
|
||||||
|
|
||||||
bool m_resolved;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device)
|
DECLARE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device)
|
@ -63,7 +63,7 @@ ToDo:
|
|||||||
#include "cpu/m6805/m68705.h"
|
#include "cpu/m6805/m68705.h"
|
||||||
|
|
||||||
#include "machine/input_merger.h"
|
#include "machine/input_merger.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
#include "machine/pit8253.h"
|
#include "machine/pit8253.h"
|
||||||
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "machine/buffer.h"
|
#include "machine/buffer.h"
|
||||||
#include "machine/i8251.h"
|
#include "machine/i8251.h"
|
||||||
#include "machine/i8255.h"
|
#include "machine/i8255.h"
|
||||||
#include "machine/latch.h"
|
#include "machine/output_latch.h"
|
||||||
#include "machine/pic8259.h"
|
#include "machine/pic8259.h"
|
||||||
#include "machine/pit8253.h"
|
#include "machine/pit8253.h"
|
||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user