mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
bus/ti99x: Add address space finders; remove machine().device (nw)
This commit is contained in:
parent
4a14085bae
commit
17cd12e896
@ -463,7 +463,7 @@ void ti990_hdc_device::store_registers()
|
||||
if (! (m_w[1] & w1_transfer_inhibit))
|
||||
for (i=0; i<real_word_count; i++)
|
||||
{
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, buffer[i]);
|
||||
m_memory_space->write_word(dma_address, buffer[i]);
|
||||
dma_address = (dma_address + 2) & 0x1ffffe;
|
||||
}
|
||||
|
||||
@ -618,7 +618,7 @@ void ti990_hdc_device::read_data()
|
||||
if (! (m_w[1] & w1_transfer_inhibit))
|
||||
for (i=0; i<bytes_read; i+=2)
|
||||
{
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
|
||||
m_memory_space->write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
|
||||
dma_address = (dma_address + 2) & 0x1ffffe;
|
||||
}
|
||||
|
||||
@ -714,7 +714,7 @@ void ti990_hdc_device::write_data()
|
||||
/* DMA */
|
||||
for (i=0; (i<byte_count) && (i<m_d[dsk_sel].bytes_per_sector); i+=2)
|
||||
{
|
||||
word = machine().device("maincpu")->memory().space(AS_PROGRAM).read_word(dma_address);
|
||||
word = m_memory_space->read_word(dma_address);
|
||||
buffer[i] = word >> 8;
|
||||
buffer[i+1] = word & 0xff;
|
||||
|
||||
@ -821,7 +821,7 @@ void ti990_hdc_device::unformatted_read()
|
||||
if (! (m_w[1] & w1_transfer_inhibit))
|
||||
for (i=0; i<real_word_count; i++)
|
||||
{
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, buffer[i]);
|
||||
m_memory_space->write_word(dma_address, buffer[i]);
|
||||
dma_address = (dma_address + 2) & 0x1ffffe;
|
||||
}
|
||||
|
||||
@ -962,7 +962,9 @@ WRITE16_MEMBER(ti990_hdc_device::write)
|
||||
DEFINE_DEVICE_TYPE(TI990_HDC, ti990_hdc_device, "ti990_hdc", "Generic TI-990 Hard Disk Controller")
|
||||
|
||||
ti990_hdc_device::ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, TI990_HDC, tag, owner, clock), m_interrupt_callback(*this)
|
||||
: device_t(mconfig, TI990_HDC, tag, owner, clock)
|
||||
, m_memory_space(*this, finder_base::DUMMY_TAG, -1)
|
||||
, m_interrupt_callback(*this)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( ti990_hd );
|
||||
DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( ti990_hd );
|
||||
|
||||
template <typename T> void set_memory_space(T &&tag, int spacenum) { m_memory_space.set_tag(std::forward<T>(tag), spacenum); }
|
||||
auto int_cb() { return m_interrupt_callback.bind(); }
|
||||
|
||||
protected:
|
||||
@ -72,6 +73,8 @@ private:
|
||||
|
||||
uint16_t m_w[8];
|
||||
|
||||
required_address_space m_memory_space;
|
||||
|
||||
devcb_write_line m_interrupt_callback;
|
||||
|
||||
hd_unit_t m_d[MAX_DISK_UNIT];
|
||||
|
@ -257,7 +257,7 @@ void tap_990_device::cmd_read_binary_forward()
|
||||
/* DMA */
|
||||
for (i=0; i<bytes_read; i+=2)
|
||||
{
|
||||
machine().device("maincpu")->memory().space(AS_PROGRAM).write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
|
||||
m_memory_space->write_word(dma_address, (((int) buffer[i]) << 8) | buffer[i+1]);
|
||||
dma_address = (dma_address + 2) & 0x1ffffe;
|
||||
}
|
||||
|
||||
@ -963,7 +963,9 @@ void ti990_tape_image_device::call_unload()
|
||||
DEFINE_DEVICE_TYPE(TI990_TAPE_CTRL, tap_990_device, "ti990_tap", "Generic TI-900 Tape Controller")
|
||||
|
||||
tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, TI990_TAPE_CTRL, tag, owner, clock), m_int_line(*this)
|
||||
: device_t(mconfig, TI990_TAPE_CTRL, tag, owner, clock)
|
||||
, m_memory_space(*this, finder_base::DUMMY_TAG, -1)
|
||||
, m_int_line(*this)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
m_tape[id].wp = wp;
|
||||
}
|
||||
|
||||
template <typename T> void set_memory_space(T &&tag, int spacenum) { m_memory_space.set_tag(std::forward<T>(tag), spacenum); }
|
||||
auto int_cb() { return m_int_line.bind(); }
|
||||
|
||||
protected:
|
||||
@ -54,6 +55,8 @@ private:
|
||||
void read_transport_status();
|
||||
void execute_command();
|
||||
|
||||
required_address_space m_memory_space;
|
||||
|
||||
devcb_write_line m_int_line;
|
||||
|
||||
uint16_t m_w[8];
|
||||
|
@ -317,7 +317,8 @@ WRITE_LINE_MEMBER(ti990_10_state::tape_interrupt)
|
||||
// set_int9(state);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(ti990_10_state::ti990_10)
|
||||
void ti990_10_state::ti990_10(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
/* TI990/10 CPU @ 4.0(???) MHz */
|
||||
TI990_10(config, m_maincpu, 4000000);
|
||||
@ -330,11 +331,15 @@ MACHINE_CONFIG_START(ti990_10_state::ti990_10)
|
||||
m_terminal->lineint_cb().set(FUNC(ti990_10_state::line_interrupt));
|
||||
|
||||
// Hard disk
|
||||
TI990_HDC(config, "hdc", 0).int_cb().set(FUNC(ti990_10_state::ti990_set_int13));
|
||||
ti990_hdc_device &hdc(TI990_HDC(config, "hdc", 0));
|
||||
hdc.set_memory_space(m_maincpu, AS_PROGRAM);
|
||||
hdc.int_cb().set(FUNC(ti990_10_state::ti990_set_int13));
|
||||
|
||||
// Tape controller
|
||||
TI990_TAPE_CTRL(config, "tpc", 0).int_cb().set(FUNC(ti990_10_state::tape_interrupt));
|
||||
MACHINE_CONFIG_END
|
||||
tap_990_device &tpc(TI990_TAPE_CTRL(config, "tpc", 0));
|
||||
tpc.set_memory_space(m_maincpu, AS_PROGRAM);
|
||||
tpc.int_cb().set(FUNC(ti990_10_state::tape_interrupt));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user