summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/novag/const.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/novag/const.cpp')
-rw-r--r--src/mame/novag/const.cpp52
1 files changed, 25 insertions, 27 deletions
diff --git a/src/mame/novag/const.cpp b/src/mame/novag/const.cpp
index 7f37c315c4d..c9fb6ddc873 100644
--- a/src/mame/novag/const.cpp
+++ b/src/mame/novag/const.cpp
@@ -70,8 +70,8 @@ TODO:
#include "bus/generic/carts.h"
#include "bus/generic/slot.h"
+#include "cpu/m6502/g65sc02.h"
#include "cpu/m6502/m6502.h"
-#include "cpu/m6502/m65sc02.h"
#include "cpu/m6502/r65c02.h"
#include "machine/clock.h"
#include "machine/nvram.h"
@@ -116,8 +116,8 @@ public:
void init_const();
protected:
- virtual void machine_start() override;
- virtual void machine_reset() override { m_power = true; }
+ virtual void machine_start() override ATTR_COLD;
+ virtual void machine_reset() override ATTR_COLD { m_power = true; }
private:
// devices/pointers
@@ -129,27 +129,30 @@ private:
bool m_power = false;
u8 m_inp_mux = 0;
- u8 m_led_select = 0;
// address maps
- void const_map(address_map &map);
- void ssensor4_map(address_map &map);
- void sconst_map(address_map &map);
+ void const_map(address_map &map) ATTR_COLD;
+ void ssensor4_map(address_map &map) ATTR_COLD;
+ void sconst_map(address_map &map) ATTR_COLD;
// I/O handlers
- void update_display();
void mux_w(u8 data);
void control_w(u8 data);
u8 input1_r();
u8 input2_r();
};
+
+
+/*******************************************************************************
+ Initialization
+*******************************************************************************/
+
void const_state::machine_start()
{
// register for savestates
save_item(NAME(m_power));
save_item(NAME(m_inp_mux));
- save_item(NAME(m_led_select));
}
INPUT_CHANGED_MEMBER(const_state::power_off)
@@ -175,28 +178,23 @@ void const_state::init_const()
I/O
*******************************************************************************/
-void const_state::update_display()
-{
- m_display->matrix(m_led_select, m_inp_mux);
-}
-
void const_state::mux_w(u8 data)
{
// d0-d7: input mux, led data
m_inp_mux = data;
- update_display();
+ m_display->write_mx(data);
}
void const_state::control_w(u8 data)
{
// d0-d2: ?
// d3: ? (goes high at power-off NMI)
+
// d4-d6: select led row
- m_led_select = data >> 4 & 7;
- update_display();
+ m_display->write_my(data >> 4 & 7);
// d7: enable beeper
- m_beeper->set_state(data >> 7 & 1);
+ m_beeper->set_state(BIT(data, 7));
}
u8 const_state::input1_r()
@@ -322,7 +320,7 @@ static INPUT_PORTS_START( ssensor4 )
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Hint")
PORT_START("POWER") // needs to be triggered for nvram to work
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, const_state, power_off, 0) PORT_NAME("Power Off")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(const_state::power_off), 0)
INPUT_PORTS_END
static INPUT_PORTS_START( nconstq )
@@ -347,7 +345,7 @@ static INPUT_PORTS_START( sconst )
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Print List / Acc. Time / Pawn")
PORT_START("POWER")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, const_state, power_off, 0) PORT_NAME("Power Off")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_POWER_OFF) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(const_state::power_off), 0)
INPUT_PORTS_END
@@ -404,7 +402,7 @@ void const_state::nconst36(machine_config &config)
nconst(config);
// basic machine hardware
- M65SC02(config.replace(), m_maincpu, 7.2_MHz_XTAL/2);
+ G65SC02(config.replace(), m_maincpu, 7.2_MHz_XTAL/2);
m_maincpu->set_addrmap(AS_PROGRAM, &const_state::const_map);
subdevice<clock_device>("irq_clock")->set_clock(7.2_MHz_XTAL/2 / 0x2000); // ~439Hz (pulse width same as nconst)
@@ -513,11 +511,11 @@ ROM_END
*******************************************************************************/
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS
-SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag", "Super Sensor IV", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+SYST( 1981, ssensor4, 0, 0, ssensor4, ssensor4, const_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Sensor IV", MACHINE_SUPPORTS_SAVE )
-SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag", "Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
-SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
-SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
-SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag", "Constellation Quattro", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+SYST( 1983, const, 0, 0, nconst, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation", MACHINE_SUPPORTS_SAVE )
+SYST( 1984, const36, const, 0, nconst36, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation 3.6MHz (set 1)", MACHINE_SUPPORTS_SAVE )
+SYST( 1986, const36a, const, 0, nconst36a, nconst, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation 3.6MHz (set 2)", MACHINE_SUPPORTS_SAVE )
+SYST( 1986, constq, const, 0, nconstq, nconstq, const_state, init_const, "Novag Industries / Intelligent Heuristic Programming", "Constellation Quattro", MACHINE_SUPPORTS_SAVE )
-SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag", "Super Constellation", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
+SYST( 1984, supercon, 0, 0, sconst, sconst, const_state, empty_init, "Novag Industries / Intelligent Heuristic Programming", "Super Constellation", MACHINE_SUPPORTS_SAVE )