mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
elf: correction to in button, remove some more trampolines
This commit is contained in:
parent
15f8ec61e3
commit
02f5cf6671
@ -13,6 +13,7 @@
|
|||||||
and it will write twice. It is because set_input_line is delayed until
|
and it will write twice. It is because set_input_line is delayed until
|
||||||
the CPU finished execute_run after sc_w.
|
the CPU finished execute_run after sc_w.
|
||||||
- proper layout
|
- proper layout
|
||||||
|
- add cassette I/O
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -22,18 +23,12 @@
|
|||||||
#include "speaker.h"
|
#include "speaker.h"
|
||||||
#include "elf2.lh"
|
#include "elf2.lh"
|
||||||
|
|
||||||
#define RUN \
|
|
||||||
BIT(m_special->read(), 0)
|
|
||||||
|
|
||||||
#define LOAD \
|
#define LOAD \
|
||||||
BIT(m_special->read(), 1)
|
BIT(m_special->read(), 1)
|
||||||
|
|
||||||
#define MEMORY_PROTECT \
|
#define MEMORY_PROTECT \
|
||||||
BIT(m_special->read(), 2)
|
BIT(m_special->read(), 2)
|
||||||
|
|
||||||
#define INPUT \
|
|
||||||
BIT(m_special->read(), 3)
|
|
||||||
|
|
||||||
/* Read/Write Handlers */
|
/* Read/Write Handlers */
|
||||||
|
|
||||||
uint8_t elf2_state::dispon_r()
|
uint8_t elf2_state::dispon_r()
|
||||||
@ -94,13 +89,18 @@ void elf2_state::elf2_io(address_map &map)
|
|||||||
|
|
||||||
/* Input Ports */
|
/* Input Ports */
|
||||||
|
|
||||||
|
INPUT_CHANGED_MEMBER(elf2_state::load_w)
|
||||||
|
{
|
||||||
|
/* DMAIN is reset while LOAD is off */
|
||||||
|
if (!newval)
|
||||||
|
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, CLEAR_LINE);
|
||||||
|
}
|
||||||
|
|
||||||
INPUT_CHANGED_MEMBER(elf2_state::input_w)
|
INPUT_CHANGED_MEMBER(elf2_state::input_w)
|
||||||
{
|
{
|
||||||
if (newval && ~m_sc & 2)
|
/* assert DMAIN */
|
||||||
{
|
if (LOAD && !newval && ~m_sc & 2)
|
||||||
/* assert DMAIN */
|
|
||||||
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, ASSERT_LINE);
|
m_maincpu->set_input_line(COSMAC_INPUT_LINE_DMAIN, ASSERT_LINE);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static INPUT_PORTS_START( elf2 )
|
static INPUT_PORTS_START( elf2 )
|
||||||
@ -134,28 +134,13 @@ static INPUT_PORTS_START( elf2 )
|
|||||||
|
|
||||||
PORT_START("SPECIAL")
|
PORT_START("SPECIAL")
|
||||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("RUN") PORT_CODE(KEYCODE_R) PORT_TOGGLE
|
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("RUN") PORT_CODE(KEYCODE_R) PORT_TOGGLE
|
||||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LOAD") PORT_CODE(KEYCODE_L) PORT_TOGGLE
|
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LOAD") PORT_CODE(KEYCODE_L) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(elf2_state::load_w), 0)
|
||||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("M/P") PORT_CODE(KEYCODE_M) PORT_TOGGLE
|
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("M/P") PORT_CODE(KEYCODE_M) PORT_TOGGLE
|
||||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("INPUT") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(elf2_state::input_w), 0)
|
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("IN") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(elf2_state::input_w), 0)
|
||||||
INPUT_PORTS_END
|
INPUT_PORTS_END
|
||||||
|
|
||||||
/* CDP1802 Configuration */
|
/* CDP1802 Configuration */
|
||||||
|
|
||||||
int elf2_state::wait_r()
|
|
||||||
{
|
|
||||||
return !LOAD;
|
|
||||||
}
|
|
||||||
|
|
||||||
int elf2_state::clear_r()
|
|
||||||
{
|
|
||||||
return RUN;
|
|
||||||
}
|
|
||||||
|
|
||||||
int elf2_state::ef4_r()
|
|
||||||
{
|
|
||||||
return INPUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t elf2_state::dma_r()
|
uint8_t elf2_state::dma_r()
|
||||||
{
|
{
|
||||||
return m_data;
|
return m_data;
|
||||||
@ -226,9 +211,9 @@ 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));
|
m_maincpu->wait_cb().set_ioport("SPECIAL").bit(1).invert();
|
||||||
m_maincpu->clear_cb().set(FUNC(elf2_state::clear_r));
|
m_maincpu->clear_cb().set_ioport("SPECIAL").bit(0);
|
||||||
m_maincpu->ef4_cb().set(FUNC(elf2_state::ef4_r));
|
m_maincpu->ef4_cb().set_ioport("SPECIAL").bit(3);
|
||||||
m_maincpu->q_cb().set_output("led0");
|
m_maincpu->q_cb().set_output("led0");
|
||||||
m_maincpu->dma_rd_cb().set(FUNC(elf2_state::dma_r));
|
m_maincpu->dma_rd_cb().set(FUNC(elf2_state::dma_r));
|
||||||
m_maincpu->dma_wr_cb().set(m_vdc, FUNC(cdp1861_device::dma_w));
|
m_maincpu->dma_wr_cb().set(m_vdc, FUNC(cdp1861_device::dma_w));
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
|
|
||||||
void elf2(machine_config &config);
|
void elf2(machine_config &config);
|
||||||
|
|
||||||
|
DECLARE_INPUT_CHANGED_MEMBER(load_w);
|
||||||
DECLARE_INPUT_CHANGED_MEMBER(input_w);
|
DECLARE_INPUT_CHANGED_MEMBER(input_w);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -49,9 +50,6 @@ private:
|
|||||||
uint8_t data_r();
|
uint8_t data_r();
|
||||||
void data_w(uint8_t data);
|
void data_w(uint8_t data);
|
||||||
void memory_w(offs_t offset, uint8_t data);
|
void memory_w(offs_t offset, uint8_t data);
|
||||||
int wait_r();
|
|
||||||
int clear_r();
|
|
||||||
int ef4_r();
|
|
||||||
uint8_t dma_r();
|
uint8_t dma_r();
|
||||||
void sc_w(uint8_t data);
|
void sc_w(uint8_t data);
|
||||||
void da_w(int state);
|
void da_w(int state);
|
||||||
|
Loading…
Reference in New Issue
Block a user