elf2: update note about dma

This commit is contained in:
hap 2025-01-11 16:01:34 +01:00
parent ae9bafdeef
commit 4142cc168a
2 changed files with 12 additions and 15 deletions

View File

@ -9,8 +9,9 @@
/* /*
TODO: TODO:
- problem with DMA: open MAME debugger to see RAM, set LOAD, input a value, - Problem with DMA: open MAME debugger to see RAM, set LOAD, input a value,
and it will write twice and it will write twice. It is because set_input_line is delayed until
the CPU finished execute_run after sc_w.
- proper layout - proper layout
*/ */
@ -95,7 +96,7 @@ void elf2_state::elf2_io(address_map &map)
INPUT_CHANGED_MEMBER(elf2_state::input_w) INPUT_CHANGED_MEMBER(elf2_state::input_w)
{ {
if (newval) if (newval && ~m_sc & 2)
{ {
/* assert DMAIN */ /* assert DMAIN */
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, ASSERT_LINE); m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, ASSERT_LINE);
@ -142,7 +143,7 @@ INPUT_PORTS_END
int elf2_state::wait_r() int elf2_state::wait_r()
{ {
return LOAD; return !LOAD;
} }
int elf2_state::clear_r() int elf2_state::clear_r()
@ -162,17 +163,11 @@ uint8_t elf2_state::dma_r()
void elf2_state::sc_w(uint8_t data) void elf2_state::sc_w(uint8_t data)
{ {
switch (data) /* DMAIN is reset while SC1 is high */
{ if (data & 2)
case COSMAC_STATE_CODE_S2_DMA:
case COSMAC_STATE_CODE_S3_INTERRUPT:
/* clear DMAIN */
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, CLEAR_LINE); m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, CLEAR_LINE);
break;
default: m_sc = data;
break;
}
} }
/* MM74C923 Interface */ /* MM74C923 Interface */
@ -206,6 +201,7 @@ void elf2_state::machine_start()
/* register for state saving */ /* register for state saving */
save_item(NAME(m_data)); save_item(NAME(m_data));
save_item(NAME(m_sc));
} }
/* Machine Driver */ /* Machine Driver */
@ -230,7 +226,7 @@ void elf2_state::elf2(machine_config &config)
CDP1802(config, m_maincpu, XTAL(3'579'545)/2); CDP1802(config, m_maincpu, XTAL(3'579'545)/2);
m_maincpu->set_addrmap(AS_PROGRAM, &elf2_state::elf2_mem); m_maincpu->set_addrmap(AS_PROGRAM, &elf2_state::elf2_mem);
m_maincpu->set_addrmap(AS_IO, &elf2_state::elf2_io); m_maincpu->set_addrmap(AS_IO, &elf2_state::elf2_io);
m_maincpu->wait_cb().set(FUNC(elf2_state::wait_r)).invert(); m_maincpu->wait_cb().set(FUNC(elf2_state::wait_r));
m_maincpu->clear_cb().set(FUNC(elf2_state::clear_r)); m_maincpu->clear_cb().set(FUNC(elf2_state::clear_r));
m_maincpu->ef4_cb().set(FUNC(elf2_state::ef4_r)); m_maincpu->ef4_cb().set(FUNC(elf2_state::ef4_r));
m_maincpu->q_cb().set_output("led0"); m_maincpu->q_cb().set_output("led0");

View File

@ -69,8 +69,9 @@ private:
required_device<ram_device> m_ram; required_device<ram_device> m_ram;
required_ioport m_special; required_ioport m_special;
// display state // internal state
uint8_t m_data = 0; uint8_t m_data = 0;
uint8_t m_sc = 0;
}; };
#endif // MAME_NETRONICS_ELF_H #endif // MAME_NETRONICS_ELF_H