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:
AJR 2018-05-02 00:05:32 -04:00
parent bafe9c47ab
commit 20f49a2f4e
12 changed files with 29 additions and 22 deletions

View File

@ -21,8 +21,6 @@ files {
MAME_DIR .. "src/devices/machine/keyboard.ipp",
MAME_DIR .. "src/devices/machine/laserdsc.cpp",
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.h",
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",
}
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

View File

@ -522,6 +522,7 @@ MACHINES["NETLIST"] = true
MACHINES["NMC9306"] = true
--MACHINES["NSC810"] = true
MACHINES["NSCSI"] = true
MACHINES["OUTPUT_LATCH"] = true
MACHINES["PC_FDC"] = true
MACHINES["PC_LPT"] = true
--MACHINES["PCCARD"] = true

View File

@ -514,6 +514,7 @@ MACHINES["NMC9306"] = true
MACHINES["NSC810"] = true
MACHINES["NSCSI"] = true
MACHINES["OMTI5100"] = true
MACHINES["OUTPUT_LATCH"] = true
MACHINES["PC_FDC"] = true
MACHINES["PC_LPT"] = true
MACHINES["PCCARD"] = true

View File

@ -13,7 +13,7 @@
#include "exp.h"
#include "machine/ataintf.h"
#include "machine/latch.h"
#include "machine/output_latch.h"

View File

@ -17,7 +17,7 @@
#include "machine/64h156.h"
#include "machine/6522via.h"
#include "machine/6821pia.h"
#include "machine/latch.h"
#include "machine/output_latch.h"

View File

@ -11,7 +11,7 @@
#pragma once
#include "machine/buffer.h"
#include "machine/latch.h"
#include "machine/output_latch.h"
#define MCFG_CENTRONICS_ADD(_tag, _slot_intf, _def_slot) \

View File

@ -17,7 +17,7 @@
#include "cpu/m6502/m65c02.h"
#include "machine/6522via.h"
#include "machine/buffer.h"
#include "machine/latch.h"
#include "machine/output_latch.h"
#include "machine/mc146818.h"
#include "machine/mc6854.h"
#include "machine/ram.h"

View File

@ -7,7 +7,7 @@
#pragma once
#include "machine/buffer.h"
#include "machine/latch.h"
#include "machine/output_latch.h"
#define SCSI_PORT_DEVICE1 "1"
#define SCSI_PORT_DEVICE2 "2"

View File

@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:smf
#include "emu.h"
#include "latch.h"
#include "output_latch.h"
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)
, m_bit_handlers{ { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this }, { *this } }
, 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()
{
save_item(NAME(m_bits));
@ -20,15 +25,6 @@ void output_latch_device::device_start()
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)
{
int const bit = BIT(data, i);

View File

@ -41,14 +41,13 @@ public:
DECLARE_WRITE8_MEMBER(write) { write(data); }
protected:
virtual void device_resolve_objects() override;
virtual void device_start() override;
private:
devcb_write_line m_bit_handlers[8];
int m_bits[8];
bool m_resolved;
};
DECLARE_DEVICE_TYPE(OUTPUT_LATCH, output_latch_device)

View File

@ -63,7 +63,7 @@ ToDo:
#include "cpu/m6805/m68705.h"
#include "machine/input_merger.h"
#include "machine/latch.h"
#include "machine/output_latch.h"
#include "machine/pit8253.h"
#include "screen.h"

View File

@ -16,7 +16,7 @@
#include "machine/buffer.h"
#include "machine/i8251.h"
#include "machine/i8255.h"
#include "machine/latch.h"
#include "machine/output_latch.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
#include "machine/ram.h"