summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/a2bus/mouse.cpp198
-rw-r--r--src/devices/bus/a2bus/mouse.h25
-rw-r--r--src/devices/cpu/amis2000/amis2000.cpp8
-rw-r--r--src/devices/cpu/amis2000/amis2000.h80
-rw-r--r--src/devices/cpu/amis2000/amis2000d.cpp12
-rw-r--r--src/devices/cpu/amis2000/amis2000op.cpp50
-rw-r--r--src/devices/cpu/cop400/cop400.cpp411
-rw-r--r--src/devices/cpu/cop400/cop400.h128
-rw-r--r--src/devices/cpu/cop400/cop400op.hxx34
-rw-r--r--src/devices/cpu/cop400/cop424ds.cpp (renamed from src/devices/cpu/cop400/cop440ds.cpp)46
-rw-r--r--src/devices/cpu/cop400/cop444ds.cpp384
-rw-r--r--src/devices/cpu/e0c6200/e0c6200.cpp2
-rw-r--r--src/devices/cpu/e0c6200/e0c6200.h92
-rw-r--r--src/devices/cpu/e0c6200/e0c6200d.cpp12
-rw-r--r--src/devices/cpu/e0c6200/e0c6200op.cpp52
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.cpp26
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.h66
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.cpp54
-rw-r--r--src/devices/cpu/hmcs40/hmcs40.h130
-rw-r--r--src/devices/cpu/hmcs40/hmcs40d.cpp16
-rw-r--r--src/devices/cpu/hmcs40/hmcs40op.cpp28
-rw-r--r--src/devices/cpu/m6805/m6805.cpp10
-rw-r--r--src/devices/cpu/m6805/m6805.h3
-rw-r--r--src/devices/cpu/m6805/m68705.cpp241
-rw-r--r--src/devices/cpu/m6805/m68705.h75
-rw-r--r--src/devices/cpu/sm510/kb1013vk1-2.h4
-rw-r--r--src/devices/cpu/sm510/kb1013vk1-2core.cpp4
-rw-r--r--src/devices/cpu/sm510/sm500.h6
-rw-r--r--src/devices/cpu/sm510/sm500core.cpp6
-rw-r--r--src/devices/cpu/sm510/sm510.cpp16
-rw-r--r--src/devices/cpu/sm510/sm510.h78
-rw-r--r--src/devices/cpu/sm510/sm510core.cpp4
-rw-r--r--src/devices/cpu/sm510/sm510d.cpp38
-rw-r--r--src/devices/cpu/sm510/sm510op.cpp22
-rw-r--r--src/devices/cpu/sm510/sm511core.cpp8
-rw-r--r--src/devices/cpu/tms1000/tms0270.cpp6
-rw-r--r--src/devices/cpu/tms1000/tms0270.h24
-rw-r--r--src/devices/cpu/tms1000/tms0970.cpp26
-rw-r--r--src/devices/cpu/tms1000/tms0970.h10
-rw-r--r--src/devices/cpu/tms1000/tms0980.cpp42
-rw-r--r--src/devices/cpu/tms1000/tms0980.h24
-rw-r--r--src/devices/cpu/tms1000/tms1000.cpp26
-rw-r--r--src/devices/cpu/tms1000/tms1000.h16
-rw-r--r--src/devices/cpu/tms1000/tms1100.cpp12
-rw-r--r--src/devices/cpu/tms1000/tms1100.h12
-rw-r--r--src/devices/cpu/tms1000/tms1400.cpp12
-rw-r--r--src/devices/cpu/tms1000/tms1400.h12
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.cpp6
-rw-r--r--src/devices/cpu/tms1000/tms1k_base.h126
-rw-r--r--src/devices/cpu/tms1000/tms1k_dasm.cpp24
-rw-r--r--src/devices/cpu/tms1000/tp0320.cpp14
-rw-r--r--src/devices/cpu/tms1000/tp0320.h8
-rw-r--r--src/devices/cpu/ucom4/ucom4.cpp20
-rw-r--r--src/devices/cpu/ucom4/ucom4.h84
-rw-r--r--src/devices/cpu/ucom4/ucom4d.cpp14
-rw-r--r--src/devices/cpu/ucom4/ucom4op.cpp34
-rw-r--r--src/devices/machine/tms1024.cpp6
-rw-r--r--src/devices/machine/tms1024.h12
-rw-r--r--src/devices/machine/tms6100.cpp14
-rw-r--r--src/devices/machine/tms6100.h32
-rw-r--r--src/emu/main.cpp2
-rw-r--r--src/lib/formats/apd_dsk.cpp124
-rw-r--r--src/lib/formats/apd_dsk.h31
-rw-r--r--src/lib/netlist/analog/nld_bjt.cpp26
-rw-r--r--src/lib/netlist/analog/nld_bjt.h80
-rw-r--r--src/lib/netlist/analog/nld_fourterm.cpp11
-rw-r--r--src/lib/netlist/analog/nld_fourterm.h5
-rw-r--r--src/lib/netlist/analog/nld_opamps.cpp240
-rw-r--r--src/lib/netlist/analog/nld_opamps.h147
-rw-r--r--src/lib/netlist/analog/nld_switches.cpp125
-rw-r--r--src/lib/netlist/analog/nld_switches.h55
-rw-r--r--src/lib/netlist/analog/nld_twoterm.cpp24
-rw-r--r--src/lib/netlist/analog/nld_twoterm.h58
-rw-r--r--src/lib/netlist/build/doxygen.conf2
-rw-r--r--src/lib/netlist/devices/net_lib.cpp47
-rw-r--r--src/lib/netlist/devices/net_lib.h22
-rw-r--r--src/lib/netlist/devices/nld_4066.cpp8
-rw-r--r--src/lib/netlist/devices/nld_4316.cpp9
-rw-r--r--src/lib/netlist/devices/nld_7448.h4
-rw-r--r--src/lib/netlist/devices/nld_74ls629.cpp4
-rw-r--r--src/lib/netlist/devices/nld_mm5837.cpp2
-rw-r--r--src/lib/netlist/devices/nld_ne555.cpp8
-rw-r--r--src/lib/netlist/devices/nld_r2r_dac.cpp8
-rw-r--r--src/lib/netlist/devices/nld_system.h4
-rw-r--r--src/lib/netlist/devices/nld_truthtable.cpp37
-rw-r--r--src/lib/netlist/devices/nld_truthtable.h4
-rw-r--r--src/lib/netlist/devices/nlid_proxy.h2
-rw-r--r--src/lib/netlist/devices/nlid_system.h6
-rw-r--r--src/lib/netlist/macro/nlm_cd4xxx.h3
-rw-r--r--src/lib/netlist/macro/nlm_opamp.h4
-rw-r--r--src/lib/netlist/macro/nlm_other.h3
-rw-r--r--src/lib/netlist/macro/nlm_ttl74xx.h4
-rw-r--r--src/lib/netlist/nl_base.cpp4
-rw-r--r--src/lib/netlist/nl_base.h36
-rw-r--r--src/lib/netlist/nl_factory.cpp10
-rw-r--r--src/lib/netlist/nl_factory.h32
-rw-r--r--src/lib/netlist/nl_parser.cpp10
-rw-r--r--src/lib/netlist/nl_parser.h2
-rw-r--r--src/lib/netlist/nl_setup.cpp12
-rw-r--r--src/lib/netlist/nl_setup.h11
-rw-r--r--src/lib/netlist/prg/nltool.cpp79
-rw-r--r--src/lib/netlist/solver/nld_solver.cpp1
-rw-r--r--src/lib/netlist/solver/nld_solver.h3
-rw-r--r--src/mame/drivers/aa310.cpp4
-rw-r--r--src/mame/drivers/atvtrack.cpp127
-rw-r--r--src/mame/drivers/cc40.cpp36
-rw-r--r--src/mame/drivers/ddragon.cpp116
-rw-r--r--src/mame/drivers/fidel6502.cpp69
-rw-r--r--src/mame/drivers/fidel68k.cpp21
-rw-r--r--src/mame/drivers/fidelz80.cpp59
-rw-r--r--src/mame/drivers/goldstar.cpp61
-rw-r--r--src/mame/drivers/hh_amis2k.cpp18
-rw-r--r--src/mame/drivers/hh_cop400.cpp143
-rw-r--r--src/mame/drivers/hh_hmcs40.cpp172
-rw-r--r--src/mame/drivers/hh_melps4.cpp44
-rw-r--r--src/mame/drivers/hh_pic16.cpp30
-rw-r--r--src/mame/drivers/hh_sm510.cpp14
-rw-r--r--src/mame/drivers/hh_tms1k.cpp76
-rw-r--r--src/mame/drivers/hh_ucom4.cpp68
-rw-r--r--src/mame/drivers/jollyjgr.cpp36
-rw-r--r--src/mame/drivers/k28.cpp42
-rw-r--r--src/mame/drivers/m68705prg.cpp3
-rw-r--r--src/mame/drivers/microvsn.cpp4
-rw-r--r--src/mame/drivers/mmodular.cpp140
-rw-r--r--src/mame/drivers/naomi.cpp62
-rw-r--r--src/mame/drivers/novag6502.cpp82
-rw-r--r--src/mame/drivers/novag68k.cpp236
-rw-r--r--src/mame/drivers/pacman.cpp50
-rw-r--r--src/mame/drivers/pse.cpp24
-rw-r--r--src/mame/drivers/quizpun2.cpp57
-rw-r--r--src/mame/drivers/skyarmy.cpp41
-rw-r--r--src/mame/drivers/stadhero.cpp6
-rw-r--r--src/mame/drivers/tb303.cpp6
-rw-r--r--src/mame/drivers/thayers.cpp171
-rw-r--r--src/mame/drivers/ti74.cpp14
-rw-r--r--src/mame/drivers/ticalc1x.cpp10
-rw-r--r--src/mame/drivers/tigeroad.cpp115
-rw-r--r--src/mame/drivers/tispeak.cpp18
-rw-r--r--src/mame/drivers/tispellb.cpp8
-rw-r--r--src/mame/includes/ddragon.h85
-rw-r--r--src/mame/includes/fidelbase.h70
-rw-r--r--src/mame/includes/fidelz80.h71
-rw-r--r--src/mame/includes/goldstar.h1
-rw-r--r--src/mame/includes/hh_tms1k.h34
-rw-r--r--src/mame/includes/hh_ucom4.h30
-rw-r--r--src/mame/includes/novagbase.h57
-rw-r--r--src/mame/includes/tigeroad.h88
-rw-r--r--src/mame/layout/mdallas.lay37
-rw-r--r--src/mame/layout/novag_diablo68k.lay435
-rw-r--r--src/mame/machine/alpha8201.cpp6
-rw-r--r--src/mame/machine/alpha8201.h12
-rw-r--r--src/mame/machine/nl_pongd.cpp1
-rw-r--r--src/mame/machine/tigeroad.cpp134
-rw-r--r--src/mame/mame.lst8
-rw-r--r--src/mame/mess.flt1
-rw-r--r--src/mame/video/goldstar.cpp33
-rw-r--r--src/tools/imgtool/formats/coco_dsk.cpp38
-rw-r--r--src/tools/imgtool/main.cpp2
-rw-r--r--src/tools/unidasm.cpp2
159 files changed, 4746 insertions, 2876 deletions
diff --git a/src/devices/bus/a2bus/mouse.cpp b/src/devices/bus/a2bus/mouse.cpp
index fa0f8377007..6c0c7410c9a 100644
--- a/src/devices/bus/a2bus/mouse.cpp
+++ b/src/devices/bus/a2bus/mouse.cpp
@@ -78,35 +78,22 @@ const device_type A2BUS_MOUSE = &device_creator<a2bus_mouse_device>;
#define MOUSE_ROM_REGION "a2mse_rom"
#define MOUSE_PIA_TAG "a2mse_pia"
#define MOUSE_MCU_TAG "a2mse_mcu"
-#define MOUSE_MCU_ROM "a2mse_mcurom"
#define MOUSE_BUTTON_TAG "a2mse_button"
#define MOUSE_XAXIS_TAG "a2mse_x"
#define MOUSE_YAXIS_TAG "a2mse_y"
-#define TIMER_68705 0
-#define TIMER_QUADRATURE 1
-
-static ADDRESS_MAP_START( mcu_mem, AS_PROGRAM, 8, a2bus_mouse_device )
- ADDRESS_MAP_GLOBAL_MASK(0x7ff)
- AM_RANGE(0x0000, 0x0000) AM_READWRITE(mcu_port_a_r, mcu_port_a_w)
- AM_RANGE(0x0001, 0x0001) AM_READWRITE(mcu_port_b_r, mcu_port_b_w)
- AM_RANGE(0x0002, 0x0002) AM_READWRITE(mcu_port_c_r, mcu_port_c_w)
- AM_RANGE(0x0004, 0x0004) AM_WRITE(mcu_ddr_a_w)
- AM_RANGE(0x0005, 0x0005) AM_WRITE(mcu_ddr_b_w)
- AM_RANGE(0x0006, 0x0006) AM_WRITE(mcu_ddr_c_w)
- AM_RANGE(0x0008, 0x0009) AM_READWRITE(mcu_timer_r, mcu_timer_w)
- AM_RANGE(0x0010, 0x007f) AM_RAM
- AM_RANGE(0x0080, 0x07ff) AM_ROM AM_REGION(MOUSE_MCU_ROM, 0x80)
-ADDRESS_MAP_END
+#define TIMER_QUADRATURE 0
MACHINE_CONFIG_FRAGMENT( mouse )
- MCFG_CPU_ADD(MOUSE_MCU_TAG, M68705, 2043600)
- MCFG_CPU_PROGRAM_MAP(mcu_mem)
+ MCFG_CPU_ADD(MOUSE_MCU_TAG, M68705P3, 2043600)
+ MCFG_M68705_PORTA_R_CB(READ8(a2bus_mouse_device, mcu_port_a_r))
+ MCFG_M68705_PORTB_R_CB(READ8(a2bus_mouse_device, mcu_port_b_r))
+ MCFG_M68705_PORTA_W_CB(WRITE8(a2bus_mouse_device, mcu_port_a_w))
+ MCFG_M68705_PORTB_W_CB(WRITE8(a2bus_mouse_device, mcu_port_b_w))
+ MCFG_M68705_PORTC_W_CB(WRITE8(a2bus_mouse_device, mcu_port_c_w))
MCFG_DEVICE_ADD(MOUSE_PIA_TAG, PIA6821, 1021800)
- MCFG_PIA_READPA_HANDLER(READ8(a2bus_mouse_device, pia_in_a))
- MCFG_PIA_READPB_HANDLER(READ8(a2bus_mouse_device, pia_in_b))
MCFG_PIA_WRITEPA_HANDLER(WRITE8(a2bus_mouse_device, pia_out_a))
MCFG_PIA_WRITEPB_HANDLER(WRITE8(a2bus_mouse_device, pia_out_b))
MCFG_PIA_IRQA_HANDLER(WRITELINE(a2bus_mouse_device, pia_irqa_w))
@@ -117,7 +104,7 @@ ROM_START( mouse )
ROM_REGION(0x800, MOUSE_ROM_REGION, 0)
ROM_LOAD( "341-0270-c.4b", 0x000000, 0x000800, CRC(0bcd1e8e) SHA1(3a9d881a8a8d30f55b9719aceebbcf717f829d6f) )
- ROM_REGION(0x800, MOUSE_MCU_ROM, 0)
+ ROM_REGION(0x800, MOUSE_MCU_TAG, 0)
ROM_LOAD( "341-0269.2b", 0x000000, 0x000800, CRC(94067f16) SHA1(3a2baa6648efe4456d3ec3721216e57c64f7acfc) )
ROM_REGION(0xc00, "pal", 0)
@@ -177,25 +164,18 @@ a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, device_typ
device_a2bus_card_interface(mconfig, *this),
m_pia(*this, MOUSE_PIA_TAG),
m_mcu(*this, MOUSE_MCU_TAG),
- m_mouseb(*this, MOUSE_BUTTON_TAG),
- m_mousex(*this, MOUSE_XAXIS_TAG),
- m_mousey(*this, MOUSE_YAXIS_TAG), m_rom(nullptr), m_ddr_a(0), m_ddr_b(0), m_ddr_c(0), m_port_a_out(0), m_port_b_out(0), m_port_c_out(0), m_port_a_in(0), m_port_b_in(0),
- m_port_c_in(0), m_timer_cnt(0), m_timer_ctl(0), m_mask_option(0), last_mx(0), last_my(0), count_x(0), count_y(0), m_timer(nullptr), m_read_timer(nullptr)
+ m_mouseb(*this, MOUSE_BUTTON_TAG), m_mousex(*this, MOUSE_XAXIS_TAG), m_mousey(*this, MOUSE_YAXIS_TAG),
+ m_rom(*this, MOUSE_ROM_REGION),
+ m_port_a_in(0), m_port_b_in(0),
+ last_mx(0), last_my(0), count_x(0), count_y(0),
+ m_read_timer(nullptr)
{
- m_started = false;
m_rom_bank = 0;
}
a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, A2BUS_MOUSE, "Apple II Mouse Card", tag, owner, clock, "a2mouse", __FILE__),
- device_a2bus_card_interface(mconfig, *this),
- m_pia(*this, MOUSE_PIA_TAG),
- m_mcu(*this, MOUSE_MCU_TAG),
- m_mouseb(*this, MOUSE_BUTTON_TAG),
- m_mousex(*this, MOUSE_XAXIS_TAG),
- m_mousey(*this, MOUSE_YAXIS_TAG), m_rom(nullptr), m_ddr_a(0), m_ddr_b(0), m_ddr_c(0), m_port_a_out(0), m_port_b_out(0), m_port_c_out(0), m_port_a_in(0), m_port_b_in(0), m_port_c_in(0), m_timer_cnt(0), m_timer_ctl(0), m_mask_option(0), last_mx(0), last_my(0), count_x(0), count_y(0), m_timer(nullptr), m_read_timer(nullptr)
+ a2bus_mouse_device(mconfig, A2BUS_MOUSE, "Apple II Mouse Card", tag, owner, clock, "a2mouse", __FILE__)
{
- m_started = false;
m_rom_bank = 0;
}
@@ -208,29 +188,13 @@ void a2bus_mouse_device::device_start()
// set_a2bus_device makes m_slot valid
set_a2bus_device();
- m_rom = device().machine().root_device().memregion(this->subtag(MOUSE_ROM_REGION).c_str())->base();
-
- // allocate two timers: one for the 68705, one for the quadrature magic
- m_timer = timer_alloc(TIMER_68705, nullptr);
+ // allocate a timer for the quadrature magic
m_read_timer = timer_alloc(TIMER_QUADRATURE, nullptr);
- m_timer->adjust(attotime::never, TIMER_68705);
m_read_timer->adjust(attotime::never, TIMER_QUADRATURE);
- // get 68705P3 mask option byte
- m_mask_option = m_rom[0x784];
-
// register save state variables
- save_item(NAME(m_ddr_a));
- save_item(NAME(m_ddr_b));
- save_item(NAME(m_ddr_c));
- save_item(NAME(m_port_a_out));
- save_item(NAME(m_port_b_out));
- save_item(NAME(m_port_c_out));
save_item(NAME(m_port_a_in));
save_item(NAME(m_port_b_in));
- save_item(NAME(m_port_c_in));
- save_item(NAME(m_timer_cnt));
- save_item(NAME(m_timer_ctl));
save_item(NAME(last_mx));
save_item(NAME(last_my));
save_item(NAME(count_x));
@@ -239,20 +203,10 @@ void a2bus_mouse_device::device_start()
void a2bus_mouse_device::device_reset()
{
- m_started = true;
m_rom_bank = 0;
last_mx = last_my = count_x = count_y = 0;
- m_timer_cnt = 0xff;
- m_timer_ctl = 0x40; // disable interrupt, everything else clear
m_port_a_in = 0;
m_port_b_in = 0x80;
- m_port_c_in = 0;
-
- // are we emulating the mask part with a semi-programmable timer?
- if (m_mask_option & 0x40)
- {
- m_timer_ctl |= m_mask_option & 0x17;
- }
m_read_timer->adjust(attotime::from_hz(600.0), TIMER_QUADRATURE, attotime::from_hz(600.0));
}
@@ -285,16 +239,6 @@ uint8_t a2bus_mouse_device::read_cnxx(address_space &space, uint8_t offset)
return m_rom[offset+m_rom_bank];
}
-READ8_MEMBER(a2bus_mouse_device::pia_in_a)
-{
- return m_port_a_out;
-}
-
-READ8_MEMBER(a2bus_mouse_device::pia_in_b)
-{
- return (m_port_c_out << 4);
-}
-
WRITE8_MEMBER(a2bus_mouse_device::pia_out_a)
{
m_port_a_in = data;
@@ -302,8 +246,7 @@ WRITE8_MEMBER(a2bus_mouse_device::pia_out_a)
WRITE8_MEMBER(a2bus_mouse_device::pia_out_b)
{
- m_port_c_in &= 0xf0;
- m_port_c_in |= ((data >> 4) & 0xf);
+ m_mcu->pc_w(space, 0, 0xf0 | ((data >> 4) & 0x0f));
m_rom_bank = (data & 0xe) << 7;
}
@@ -318,17 +261,12 @@ WRITE_LINE_MEMBER(a2bus_mouse_device::pia_irqb_w)
READ8_MEMBER(a2bus_mouse_device::mcu_port_a_r)
{
- return (m_port_a_out & m_ddr_a) | (m_port_a_in & ~m_ddr_a);
+ return m_port_a_in;
}
WRITE8_MEMBER(a2bus_mouse_device::mcu_port_a_w)
{
- m_port_a_out = data;
-}
-
-WRITE8_MEMBER(a2bus_mouse_device::mcu_ddr_a_w)
-{
- m_ddr_a = data;
+ m_pia->set_a_input(data, ~mem_mask);
}
READ8_MEMBER(a2bus_mouse_device::mcu_port_b_r)
@@ -338,14 +276,12 @@ READ8_MEMBER(a2bus_mouse_device::mcu_port_b_r)
// clear the gates, leave everything else alone between pulses
m_port_b_in &= 0x85;
- return (m_port_b_out & m_ddr_b) | (b_in & ~m_ddr_b);
+ return b_in;
}
WRITE8_MEMBER(a2bus_mouse_device::mcu_port_b_w)
{
- m_port_b_out = data;
-
- if (!(data & 0x40))
+ if (!BIT(data, 6))
{
raise_slot_irq();
}
@@ -355,91 +291,9 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_port_b_w)
}
}
-WRITE8_MEMBER(a2bus_mouse_device::mcu_ddr_b_w)
-{
- m_ddr_b = data;
-}
-
-READ8_MEMBER(a2bus_mouse_device::mcu_port_c_r)
-{
- return (m_port_c_out & m_ddr_c) | (m_port_c_in & ~m_ddr_c);
-}
-
WRITE8_MEMBER(a2bus_mouse_device::mcu_port_c_w)
{
- m_port_c_out = data;
-}
-
-WRITE8_MEMBER(a2bus_mouse_device::mcu_ddr_c_w)
-{
- m_ddr_c = data;
-}
-
-READ8_MEMBER(a2bus_mouse_device::mcu_timer_r)
-{
- if (offset == 1)
- {
- return m_timer_ctl;
- }
-
- return m_timer_cnt;
-}
-
-WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w)
-{
- static const int prescale[8] = { 1, 2, 4, 8, 16, 32, 64, 128 };
- bool recalc = false;
-
- // offset 0 = timer data (counts down)
- if (offset == 0)
- {
- m_timer_cnt = data;
- recalc = true;
- }
- // offset 1 = timer control: b7 = IRQ, b6 = IRQ mask (1=suppress),
- // b5 = input select (0=CPU clk, 1=ext),
- // b4 = enable external timer input,
- // b3 = clear, b2-b0 = scaler (1/2/4/8/16/32/64/128)
- else
- {
- // clearing the interrupt?
- if ((m_timer_ctl & 0x80) && !(data & 0x80))
- {
- m_mcu->set_input_line(M68705_INT_TIMER, CLEAR_LINE);
- }
-
- if (m_mask_option & 0x40)
- {
- m_timer_ctl &= 0x3f;
- m_timer_ctl |= (data & 0xc0);
- }
- else
- {
- // if any parameters that affect the timer changed, recalc now
- if ((data & 0x3f) != (m_timer_ctl & 0x3f))
- {
- recalc = true;
- }
-
- // if prescaler reset, recalc
- if (data & 0x8)
- {
- recalc = true;
- }
-
- m_timer_ctl = data;
- }
-
- }
-
- if (recalc)
- {
- // recalculate the timer now
- uint32_t m_ticks = 2043600 / 4;
- m_ticks /= prescale[m_timer_ctl & 7];
- m_ticks /= (int)(m_timer_cnt + 1);
- m_timer->adjust(attotime::from_hz((double)m_ticks), TIMER_68705, attotime::from_hz((double)m_ticks));
- }
+ m_pia->portb_w(data << 4);
}
/*
@@ -452,15 +306,7 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w)
*/
void a2bus_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- if (id == TIMER_68705) // 68705's built-in timer
- {
- m_timer_ctl |= 0x80; // indicate timer expired
- if (!(m_timer_ctl & 0x40)) // if interrupt not suppressed, fire!
- {
- m_mcu->set_input_line(M68705_INT_TIMER, ASSERT_LINE);
- }
- }
- else if (id == TIMER_QUADRATURE)
+ if (id == TIMER_QUADRATURE)
{
int new_mx, new_my;
m_port_b_in = 0x80;
diff --git a/src/devices/bus/a2bus/mouse.h b/src/devices/bus/a2bus/mouse.h
index 5eead183edb..c5a36319d79 100644
--- a/src/devices/bus/a2bus/mouse.h
+++ b/src/devices/bus/a2bus/mouse.h
@@ -35,8 +35,6 @@ public:
virtual ioport_constructor device_input_ports() const override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
- DECLARE_READ8_MEMBER(pia_in_a);
- DECLARE_READ8_MEMBER(pia_in_b);
DECLARE_WRITE8_MEMBER(pia_out_a);
DECLARE_WRITE8_MEMBER(pia_out_b);
DECLARE_WRITE_LINE_MEMBER(pia_irqa_w);
@@ -44,15 +42,9 @@ public:
DECLARE_READ8_MEMBER(mcu_port_a_r);
DECLARE_READ8_MEMBER(mcu_port_b_r);
- DECLARE_READ8_MEMBER(mcu_port_c_r);
DECLARE_WRITE8_MEMBER(mcu_port_a_w);
DECLARE_WRITE8_MEMBER(mcu_port_b_w);
DECLARE_WRITE8_MEMBER(mcu_port_c_w);
- DECLARE_WRITE8_MEMBER(mcu_ddr_a_w);
- DECLARE_WRITE8_MEMBER(mcu_ddr_b_w);
- DECLARE_WRITE8_MEMBER(mcu_ddr_c_w);
- DECLARE_READ8_MEMBER(mcu_timer_r);
- DECLARE_WRITE8_MEMBER(mcu_timer_w);
protected:
virtual void device_start() override;
@@ -64,27 +56,16 @@ protected:
virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override;
required_device<pia6821_device> m_pia;
- required_device<m68705_device> m_mcu;
+ required_device<m68705p_device> m_mcu;
required_ioport m_mouseb, m_mousex, m_mousey;
private:
- uint8_t *m_rom;
- bool m_started;
+ required_region_ptr<uint8_t> m_rom;
int m_rom_bank;
- uint8_t m_ddr_a;
- uint8_t m_ddr_b;
- uint8_t m_ddr_c;
- uint8_t m_port_a_out;
- uint8_t m_port_b_out;
- uint8_t m_port_c_out;
uint8_t m_port_a_in;
uint8_t m_port_b_in;
- uint8_t m_port_c_in;
- uint8_t m_timer_cnt;
- uint8_t m_timer_ctl;
- uint8_t m_mask_option;
int last_mx, last_my, count_x, count_y;
- emu_timer *m_timer, *m_read_timer;
+ emu_timer *m_read_timer;
};
// device type definition
diff --git a/src/devices/cpu/amis2000/amis2000.cpp b/src/devices/cpu/amis2000/amis2000.cpp
index a9b45e865b3..c79c858780c 100644
--- a/src/devices/cpu/amis2000/amis2000.cpp
+++ b/src/devices/cpu/amis2000/amis2000.cpp
@@ -55,15 +55,15 @@ ADDRESS_MAP_END
// device definitions
-amis2000_cpu_device::amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+amis2000_cpu_device::amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: amis2000_base_device(mconfig, AMI_S2000, "AMI S2000", tag, owner, clock, 2, 10, 3, 13, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "amis2000", __FILE__)
{ }
-amis2150_cpu_device::amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+amis2150_cpu_device::amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: amis2000_base_device(mconfig, AMI_S2150, "AMI S2150", tag, owner, clock, 3, 11, 3, 13, ADDRESS_MAP_NAME(program_1_5k), 7, ADDRESS_MAP_NAME(data_80x4), "amis2150", __FILE__)
{ }
-amis2152_cpu_device::amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+amis2152_cpu_device::amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: amis2000_base_device(mconfig, AMI_S2152, "AMI S2152", tag, owner, clock, 3, 11, 3, 13, ADDRESS_MAP_NAME(program_1_5k), 7, ADDRESS_MAP_NAME(data_80x4), "amis2152", __FILE__)
{ }
@@ -89,7 +89,7 @@ void amis2000_base_device::state_string_export(const device_state_entry &entry,
}
}
-offs_t amis2000_base_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t amis2000_base_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(amis2000);
return CPU_DISASSEMBLE_NAME(amis2000)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h
index 76190cb3090..021ebb3f795 100644
--- a/src/devices/cpu/amis2000/amis2000.h
+++ b/src/devices/cpu/amis2000/amis2000.h
@@ -44,7 +44,7 @@ class amis2000_base_device : public cpu_device
{
public:
// construction/destruction
- amis2000_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t bu_bits, uint8_t callstack_bits, uint8_t callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ amis2000_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 bu_bits, u8 callstack_bits, u8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program)
, m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data)
@@ -67,7 +67,7 @@ public:
template<class _Object> static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast<amis2000_base_device &>(device).m_write_d.set_callback(object); }
template<class _Object> static devcb_base &set_write_a_callback(device_t &device, _Object object) { return downcast<amis2000_base_device &>(device).m_write_a.set_callback(object); }
template<class _Object> static devcb_base &set_write_f_callback(device_t &device, _Object object) { return downcast<amis2000_base_device &>(device).m_write_f.set_callback(object); }
- static void set_7seg_table(device_t &device, const uint8_t *ptr) { downcast<amis2000_base_device &>(device).m_7seg_table = ptr; }
+ static void set_7seg_table(device_t &device, const u8 *ptr) { downcast<amis2000_base_device &>(device).m_7seg_table = ptr; }
protected:
// device-level overrides
@@ -75,20 +75,20 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // "
- virtual uint32_t execute_min_cycles() const override { return 1; }
- virtual uint32_t execute_max_cycles() const override { return 2; }
- virtual uint32_t execute_input_lines() const override { return 1; }
+ virtual u64 execute_clocks_to_cycles(u64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
+ virtual u64 execute_cycles_to_clocks(u64 cycles) const override { return (cycles * 4); } // "
+ virtual u32 execute_min_cycles() const override { return 1; }
+ virtual u32 execute_max_cycles() const override { return 2; }
+ virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_run() override;
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 1; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 1; }
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual u32 disasm_min_opcode_bytes() const override { return 1; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 1; }
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
@@ -98,33 +98,33 @@ protected:
address_space *m_program;
address_space *m_data;
- uint8_t m_bu_bits;
- uint16_t m_bu_mask;
- uint8_t m_callstack_bits; // number of program counter bits held in callstack
- uint16_t m_callstack_mask;
- uint8_t m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400
- uint16_t m_callstack[5]; // max 5
+ u8 m_bu_bits;
+ u16 m_bu_mask;
+ u8 m_callstack_bits; // number of program counter bits held in callstack
+ u16 m_callstack_mask;
+ u8 m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400
+ u16 m_callstack[5]; // max 5
int m_icount;
- uint16_t m_pc; // 13-bit program counter
- uint8_t m_ppr; // prepared page register (PP 1)
- uint8_t m_pbr; // prepared bank register (PP 2)
- bool m_skip; // skip next opcode, including PP prefixes
- uint8_t m_op;
- uint8_t m_prev_op; // previous opcode, needed for PP, LAI, LB*
- uint8_t m_f; // generic flags: 2 on 2000/2150, 6 on 2200/2400
- uint8_t m_carry; // carry flag
- uint8_t m_bl; // 4-bit ram index x
- uint8_t m_bu; // 2/3-bit ram index y
- uint8_t m_acc; // 4-bit accumulator
- uint8_t m_e; // 4-bit generic register
- uint8_t m_ki_mask; // 4-bit k/i-pins select latch
- uint8_t m_d; // 8-bit d-pins latch
- bool m_d_active; // d-pins available for direct i/o(floating), or outputting d-latch
- uint8_t m_d_polarity; // invert d-latch output
- uint16_t m_a; // 13-bit a-pins latch (master strobe latch)
+ u16 m_pc; // 13-bit program counter
+ u8 m_ppr; // prepared page register (PP 1)
+ u8 m_pbr; // prepared bank register (PP 2)
+ bool m_skip; // skip next opcode, including PP prefixes
+ u8 m_op;
+ u8 m_prev_op; // previous opcode, needed for PP, LAI, LB*
+ u8 m_f; // generic flags: 2 on 2000/2150, 6 on 2200/2400
+ u8 m_carry; // carry flag
+ u8 m_bl; // 4-bit ram index x
+ u8 m_bu; // 2/3-bit ram index y
+ u8 m_acc; // 4-bit accumulator
+ u8 m_e; // 4-bit generic register
+ u8 m_ki_mask; // 4-bit k/i-pins select latch
+ u8 m_d; // 8-bit d-pins latch
+ bool m_d_active; // d-pins available for direct i/o(floating), or outputting d-latch
+ u8 m_d_polarity; // invert d-latch output
+ u16 m_a; // 13-bit a-pins latch (master strobe latch)
// i/o handlers
- const uint8_t *m_7seg_table;
+ const u8 *m_7seg_table;
devcb_read8 m_read_k;
devcb_read8 m_read_i;
devcb_read8 m_read_d;
@@ -133,8 +133,8 @@ protected:
devcb_write_line m_write_f;
// misc internal helpers
- uint8_t ram_r();
- void ram_w(uint8_t data);
+ u8 ram_r();
+ void ram_w(u8 data);
void pop_callstack();
void push_callstack();
void d_latch_out(bool active);
@@ -203,21 +203,21 @@ protected:
class amis2000_cpu_device : public amis2000_base_device
{
public:
- amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class amis2150_cpu_device : public amis2000_base_device
{
public:
- amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class amis2152_cpu_device : public amis2000_base_device
{
public:
- amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// device-level overrides
@@ -225,7 +225,7 @@ protected:
virtual void device_reset() override;
// digital-to-frequency converter
- uint8_t m_d2f_latch;
+ u8 m_d2f_latch;
emu_timer *m_d2f_timer;
int m_fout_state;
diff --git a/src/devices/cpu/amis2000/amis2000d.cpp b/src/devices/cpu/amis2000/amis2000d.cpp
index 2dd3433718f..adf5e2ed338 100644
--- a/src/devices/cpu/amis2000/amis2000d.cpp
+++ b/src/devices/cpu/amis2000/amis2000d.cpp
@@ -32,7 +32,7 @@ static const char *const s_mnemonics[] =
};
// number of bits per opcode parameter, negative indicates complement
-static const int8_t s_bits[] =
+static const s8 s_bits[] =
{
0, 0, 4, 2, 2, 2, 2, 0, 0, 0,
-2, -2, -2, -2, 2, 2,
@@ -45,7 +45,7 @@ static const int8_t s_bits[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t s_flags[] =
+static const u32 s_flags[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
@@ -56,7 +56,7 @@ static const uint32_t s_flags[] =
};
-static const uint8_t s2000_mnemonic[0x100] =
+static const u8 s2000_mnemonic[0x100] =
{
/* 0x00 */
mNOP, mHALT, mRT, mRTS, mPSH, mPSL, mAND, mSOS,
@@ -103,8 +103,8 @@ static const uint8_t s2000_mnemonic[0x100] =
CPU_DISASSEMBLE(amis2000)
{
int pos = 0;
- uint8_t op = oprom[pos++];
- uint8_t instr = s2000_mnemonic[op];
+ u8 op = oprom[pos++];
+ u8 instr = s2000_mnemonic[op];
util::stream_format(stream, "%-5s ", s_mnemonics[instr]);
@@ -117,7 +117,7 @@ CPU_DISASSEMBLE(amis2000)
if (mask != 0)
{
- uint8_t param = op;
+ u8 param = op;
if (complement)
param = ~param;
param &= mask;
diff --git a/src/devices/cpu/amis2000/amis2000op.cpp b/src/devices/cpu/amis2000/amis2000op.cpp
index 2962f5327cc..685be166c3e 100644
--- a/src/devices/cpu/amis2000/amis2000op.cpp
+++ b/src/devices/cpu/amis2000/amis2000op.cpp
@@ -8,15 +8,15 @@
// internal helpers
-inline uint8_t amis2000_base_device::ram_r()
+inline u8 amis2000_base_device::ram_r()
{
- uint16_t address = m_bu << 4 | m_bl;
+ u16 address = m_bu << 4 | m_bl;
return m_data->read_byte(address) & 0xf;
}
-inline void amis2000_base_device::ram_w(uint8_t data)
+inline void amis2000_base_device::ram_w(u8 data)
{
- uint16_t address = m_bu << 4 | m_bl;
+ u16 address = m_bu << 4 | m_bl;
m_data->write_byte(address, data & 0xf);
}
@@ -49,7 +49,7 @@ void amis2000_base_device::op_lai()
// note: only execute the first one in a sequence of LAI
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
{
- uint8_t param = m_op & 0x0f;
+ u8 param = m_op & 0x0f;
m_acc = param;
m_ki_mask = param;
}
@@ -70,7 +70,7 @@ void amis2000_base_device::op_lae()
void amis2000_base_device::op_xab()
{
// XAB: exchange ACC with BL
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = m_bl;
m_bl = old_acc;
}
@@ -78,7 +78,7 @@ void amis2000_base_device::op_xab()
void amis2000_base_device::op_xabu()
{
// XABU: exchange ACC with BU
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = (m_acc & ~m_bu_mask) | (m_bu & m_bu_mask);
m_bu = old_acc & m_bu_mask;
}
@@ -86,7 +86,7 @@ void amis2000_base_device::op_xabu()
void amis2000_base_device::op_xae()
{
// XAE: exchange ACC with E
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = m_e;
m_e = old_acc;
}
@@ -97,7 +97,7 @@ void amis2000_base_device::op_lbe()
// note: only execute the first one in a sequence of LB*
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
{
- uint8_t param = m_op & 0x03;
+ u8 param = m_op & 0x03;
m_bu = param & m_bu_mask;
m_bl = m_e;
}
@@ -109,7 +109,7 @@ void amis2000_base_device::op_lbep()
// note: only execute the first one in a sequence of LB*
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
{
- uint8_t param = m_op & 0x03;
+ u8 param = m_op & 0x03;
m_bu = param & m_bu_mask;
m_bl = (m_e + 1) & 0xf;
}
@@ -121,7 +121,7 @@ void amis2000_base_device::op_lbz()
// note: only execute the first one in a sequence of LB*
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
{
- uint8_t param = m_op & 0x03;
+ u8 param = m_op & 0x03;
m_bu = param & m_bu_mask;
m_bl = 0;
}
@@ -133,7 +133,7 @@ void amis2000_base_device::op_lbf()
// note: only execute the first one in a sequence of LB*
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
{
- uint8_t param = m_op & 0x03;
+ u8 param = m_op & 0x03;
m_bu = param & m_bu_mask;
m_bl = 0xf;
}
@@ -146,17 +146,17 @@ void amis2000_base_device::op_lam()
{
// LAM _Y: load ACC with RAM, xor BU with _Y
m_acc = ram_r();
- uint8_t param = ~m_op & 0x03;
+ u8 param = ~m_op & 0x03;
m_bu ^= (param & m_bu_mask);
}
void amis2000_base_device::op_xc()
{
// XC _Y: exchange ACC with RAM, xor BU with _Y
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = ram_r();
ram_w(old_acc);
- uint8_t param = ~m_op & 0x03;
+ u8 param = ~m_op & 0x03;
m_bu ^= (param & m_bu_mask);
}
@@ -179,14 +179,14 @@ void amis2000_base_device::op_xcd()
void amis2000_base_device::op_stm()
{
// STM Z: set RAM bit Z
- uint8_t param = 1 << (m_op & 0x03);
+ u8 param = 1 << (m_op & 0x03);
ram_w(ram_r() | param);
}
void amis2000_base_device::op_rsm()
{
// RSM Z: reset RAM bit Z
- uint8_t param = 1 << (m_op & 0x03);
+ u8 param = 1 << (m_op & 0x03);
ram_w(ram_r() & ~param);
}
@@ -196,7 +196,7 @@ void amis2000_base_device::op_rsm()
void amis2000_base_device::op_inp()
{
// INP: input D-pins to ACC and RAM
- uint8_t in = m_d_active ? m_d : m_read_d(0, 0xff);
+ u8 in = m_d_active ? m_d : m_read_d(0, 0xff);
m_acc = in & 0xf;
ram_w(in >> 4 & 0xf);
}
@@ -217,12 +217,12 @@ void amis2000_base_device::op_disb()
void amis2000_base_device::op_disn()
{
// DISN: set D-latch to ACC+carry via on-die segment decoder
- static const uint8_t lut_segment_decoder[0x10] =
+ static const u8 lut_segment_decoder[0x10] =
{
// 0-F digits in bit order [DP]abcdefg
0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, 0x77, 0x1f, 0x4e, 0x3d, 0x4f, 0x47
};
- const uint8_t *ptr = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder;
+ const u8 *ptr = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder;
m_d = ptr[m_acc] | (m_carry ? 0x80 : 0x00);
d_latch_out(true);
}
@@ -301,7 +301,7 @@ void amis2000_base_device::op_eur()
void amis2000_base_device::op_pp()
{
// PP _X: prepare page/bank with _X
- uint8_t param = ~m_op & 0x0f;
+ u8 param = ~m_op & 0x0f;
if ((m_prev_op & 0xf0) != (m_op & 0xf0))
m_ppr = param;
else
@@ -311,8 +311,8 @@ void amis2000_base_device::op_pp()
void amis2000_base_device::op_jmp()
{
// JMP X: jump to X(+PP)
- uint16_t mask = 0x3f;
- uint16_t param = m_op & mask;
+ u16 mask = 0x3f;
+ u16 param = m_op & mask;
// if previous opcode was PP, change PC high bits too
if ((m_prev_op & 0xf0) == 0x60)
@@ -371,7 +371,7 @@ void amis2000_base_device::op_szc()
void amis2000_base_device::op_szm()
{
// SZM Z: skip next on zero RAM bit Z
- uint8_t param = 1 << (m_op & 0x03);
+ u8 param = 1 << (m_op & 0x03);
m_skip = !(ram_r() & param);
}
@@ -432,7 +432,7 @@ void amis2000_base_device::op_adcs()
void amis2000_base_device::op_adis()
{
// ADIS X: add X to ACC, skip next on not carry
- uint8_t param = m_op & 0x0f;
+ u8 param = m_op & 0x0f;
m_acc += param;
m_skip = !(m_acc & 0x10);
m_acc &= 0xf;
diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp
index 459375fb40d..20b93b8e351 100644
--- a/src/devices/cpu/cop400/cop400.cpp
+++ b/src/devices/cpu/cop400/cop400.cpp
@@ -10,29 +10,28 @@
Type ROM RAM G D IN
- COP410 512x8 32x4 none
- COP411 512x8 32x4 0-2 0-1 none
- COP401 none 32x4 none
- COP413?
- COP414?
- COP415?
- COP405?
+ COP410 512x8 32x4 N/A
+ COP411 512x8 32x4 0-2 0-1 N/A
+ COP413 512x8 32x4 N/A N/A
+ COP401 N/A 32x4 N/A
COP420 1024x8 64x4
- COP421 1024x8 64x4 none
- COP422 1024x8 64x4 2-3 2-3 none
- COP402 none 64x4
-
- COP444 2048x8 128x4
- COP445 2048x8 128x4 none
- COP424 1024x8 64x4
- COP425 1024x8 64x4 none
- COP426 1024x8 64x4 2-3 2-3
- COP404 none none
-
- COP440 2048x8 160x4
- COP441 2048x8 160x4
- COP442 2048x8 160x4
+ COP421 1024x8 64x4 N/A
+ COP422 1024x8 64x4 2-3 2-3 N/A
+ COP402 N/A 64x4
+
+ COP444L 2048x8 128x4
+ COP445L 2048x8 128x4 N/A
+ COP404L N/A 128x4
+
+ COP424C 1024x8 64x4
+ COP425C 1024x8 64x4 N/A
+ COP426C 1024x8 64x4 2-3 2-3
+
+ COP444C 2048x8 128x4
+ COP445C 2048x8 128x4 N/A
+ COP446C 2048x8 128x4 2-3 2-3
+ COP404C N/A 128x4
****************************************************************************
@@ -48,12 +47,10 @@
TODO:
- - opcode support for 2048x8 and 128x4/160x4 memory sizes
- - CKO sync input
+ - fix state masks
+ - COP410L/COP410C
- save internal RAM when CKO is RAM power supply pin
- - COP413/COP414/COP415/COP405
- - COP404 opcode map switching, dual timer, microbus enable
- - COP440/COP441/COP442 (new registers: 2-bit N, 4-bit H, 8-bit R; some new opcodes, 2Kx8 ROM, 160x4 RAM)
+ - COP404L opcode map switching, dual timer, microbus enable
*/
@@ -69,12 +66,17 @@ const device_type COP402 = &device_creator<cop402_cpu_device>;
const device_type COP420 = &device_creator<cop420_cpu_device>;
const device_type COP421 = &device_creator<cop421_cpu_device>;
const device_type COP422 = &device_creator<cop422_cpu_device>;
-const device_type COP404 = &device_creator<cop404_cpu_device>;
-const device_type COP424 = &device_creator<cop424_cpu_device>;
-const device_type COP425 = &device_creator<cop425_cpu_device>;
-const device_type COP426 = &device_creator<cop426_cpu_device>;
-const device_type COP444 = &device_creator<cop444_cpu_device>;
-const device_type COP445 = &device_creator<cop445_cpu_device>;
+const device_type COP404L = &device_creator<cop404l_cpu_device>;
+const device_type COP444L = &device_creator<cop444l_cpu_device>;
+const device_type COP445L = &device_creator<cop445l_cpu_device>;
+const device_type COP404C = &device_creator<cop404c_cpu_device>;
+const device_type COP424C = &device_creator<cop424c_cpu_device>;
+const device_type COP425C = &device_creator<cop425c_cpu_device>;
+const device_type COP426C = &device_creator<cop426c_cpu_device>;
+const device_type COP444C = &device_creator<cop444c_cpu_device>;
+const device_type COP445C = &device_creator<cop445c_cpu_device>;
+const device_type COP446C = &device_creator<cop446c_cpu_device>;
+
/***************************************************************************
@@ -153,12 +155,6 @@ static ADDRESS_MAP_START( data_128b, AS_DATA, 8, cop400_cpu_device )
AM_RANGE(0x00, 0x7f) AM_RAM
ADDRESS_MAP_END
-#ifdef UNUSED_CODE
-static ADDRESS_MAP_START( data_160b, AS_DATA, 8, cop400_cpu_device )
- AM_RANGE(0x00, 0x9f) AM_RAM
-ADDRESS_MAP_END
-#endif
-
cop400_cpu_device::cop400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source, uint8_t program_addr_bits, uint8_t data_addr_bits, uint8_t featuremask, uint8_t g_mask, uint8_t d_mask, uint8_t in_mask, bool has_counter, bool has_inil, address_map_constructor internal_map_program, address_map_constructor internal_map_data)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
@@ -185,37 +181,48 @@ cop400_cpu_device::cop400_cpu_device(const machine_config &mconfig, device_type
, m_d_mask(d_mask)
, m_in_mask(in_mask)
{
- int i;
+ for (int i = 0; i < 256; i++) {
+ m_InstLen[i] = 1;
+ }
- /* initialize instruction length array */
- for (i=0; i<256; i++) m_InstLen[i]=1;
+ m_InstLen[0x33] = m_InstLen[0x23] = 2;
switch (featuremask)
{
case COP410_FEATURE:
- /* select opcode map */
m_opcode_map = COP410_OPCODE_MAP;
- /* initialize instruction length array */
- m_InstLen[0x60] = m_InstLen[0x61] = m_InstLen[0x68] =
- m_InstLen[0x69] = m_InstLen[0x33] = m_InstLen[0x23] = 2;
+
+ for (int r = 0; r < 2; r++) {
+ m_InstLen[0x60 + r] = 2; // JMP
+ m_InstLen[0x68 + r] = 2; // JSR
+ }
break;
case COP420_FEATURE:
- /* select opcode map */
m_opcode_map = COP420_OPCODE_MAP;
- /* initialize instruction length array */
- m_InstLen[0x60] = m_InstLen[0x61] = m_InstLen[0x62] = m_InstLen[0x63] =
- m_InstLen[0x68] = m_InstLen[0x69] = m_InstLen[0x6a] = m_InstLen[0x6b] =
- m_InstLen[0x33] = m_InstLen[0x23] = 2;
+
+ for (int r = 0; r < 4; r++) {
+ m_InstLen[0x60 + r] = 2; // JMP
+ m_InstLen[0x68 + r] = 2; // JSR
+ }
break;
- case COP444_FEATURE:
- /* select opcode map */
- m_opcode_map = COP444_OPCODE_MAP;
- /* initialize instruction length array */
- m_InstLen[0x60] = m_InstLen[0x61] = m_InstLen[0x62] = m_InstLen[0x63] =
- m_InstLen[0x68] = m_InstLen[0x69] = m_InstLen[0x6a] = m_InstLen[0x6b] =
- m_InstLen[0x33] = m_InstLen[0x23] = 2;
+ case COP444L_FEATURE:
+ m_opcode_map = COP444L_OPCODE_MAP;
+
+ for (int r = 0; r < 8; r++) {
+ m_InstLen[0x60 + r] = 2; // JMP
+ m_InstLen[0x68 + r] = 2; // JSR
+ }
+ break;
+
+ case COP424C_FEATURE:
+ m_opcode_map = COP424C_OPCODE_MAP;
+
+ for (int r = 0; r < 8; r++) {
+ m_InstLen[0x60 + r] = 2; // JMP
+ m_InstLen[0x68 + r] = 2; // JSR
+ }
break;
default:
@@ -258,36 +265,58 @@ cop422_cpu_device::cop422_cpu_device(const machine_config &mconfig, const char *
{
}
-cop404_cpu_device::cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP404, "COP404", tag, owner, clock, "cop404", __FILE__, 11, 7, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, nullptr, ADDRESS_MAP_NAME(data_128b))
+cop404l_cpu_device::cop404l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP404L, "COP404L", tag, owner, clock, "cop404l", __FILE__, 11, 7, COP444L_FEATURE, 0xf, 0xf, 0xf, true, true, nullptr, ADDRESS_MAP_NAME(data_128b))
+{
+}
+
+cop444l_cpu_device::cop444l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP444L, "COP444L", tag, owner, clock, "cop444l", __FILE__, 11, 7, COP444L_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
+{
+}
+
+cop445l_cpu_device::cop445l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP445L, "COP445L", tag, owner, clock, "cop445l", __FILE__, 11, 7, COP444L_FEATURE, 0x7, 0x3, 0, true, false, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
{
}
-cop424_cpu_device::cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP424, "COP424", tag, owner, clock, "cop424", __FILE__, 10, 6, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
+cop404c_cpu_device::cop404c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP404C, "COP404C", tag, owner, clock, "cop404c", __FILE__, 11, 7, COP424C_FEATURE, 0xf, 0xf, 0xf, true, true, nullptr, ADDRESS_MAP_NAME(data_128b))
{
}
-cop425_cpu_device::cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP425, "COP425", tag, owner, clock, "cop425", __FILE__, 10, 6, COP444_FEATURE, 0xf, 0xf, 0, true, false, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
+cop424c_cpu_device::cop424c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP424C, "COP424C", tag, owner, clock, "cop424c", __FILE__, 10, 6, COP424C_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
{
}
-cop426_cpu_device::cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP426, "COP426", tag, owner, clock, "cop426", __FILE__, 10, 6, COP444_FEATURE, 0xe, 0xe, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
+cop425c_cpu_device::cop425c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP425C, "COP425C", tag, owner, clock, "cop425c", __FILE__, 10, 6, COP424C_FEATURE, 0xf, 0xf, 0, true, false, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
{
}
-cop444_cpu_device::cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP444, "COP444", tag, owner, clock, "cop444", __FILE__, 11, 7, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
+cop426c_cpu_device::cop426c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP426C, "COP426C", tag, owner, clock, "cop426c", __FILE__, 10, 6, COP424C_FEATURE, 0xe, 0xe, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b))
{
}
-cop445_cpu_device::cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : cop400_cpu_device(mconfig, COP445, "COP445", tag, owner, clock, "cop445", __FILE__, 11, 7, COP444_FEATURE, 0x7, 0x3, 0, true, false, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
+cop444c_cpu_device::cop444c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP444C, "COP444C", tag, owner, clock, "cop444c", __FILE__, 11, 7, COP424C_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
{
}
+cop445c_cpu_device::cop445c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP445C, "COP445C", tag, owner, clock, "cop445c", __FILE__, 11, 7, COP424C_FEATURE, 0xf, 0xf, 0, true, false, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
+{
+}
+
+cop446c_cpu_device::cop446c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : cop400_cpu_device(mconfig, COP446C, "COP446C", tag, owner, clock, "cop446c", __FILE__, 11, 7, COP424C_FEATURE, 0xe, 0xe, 0xf, true, true, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b))
+{
+}
+
+
+
/***************************************************************************
INLINE FUNCTIONS
***************************************************************************/
@@ -612,7 +641,7 @@ const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP420_OPCODE_MAP
OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jid)
};
-const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_23_MAP[256] =
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444L_OPCODE_23_MAP[256] =
{
OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
@@ -651,23 +680,23 @@ const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_23_
OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad)
};
-void cop400_cpu_device::cop444_op23(uint8_t opcode)
+void cop400_cpu_device::cop444l_op23(uint8_t opcode)
{
uint8_t opcode23 = fetch();
- (this->*COP444_OPCODE_23_MAP[opcode23])(opcode23);
+ (this->*COP444L_OPCODE_23_MAP[opcode23])(opcode23);
}
-const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_33_MAP[256] =
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444L_OPCODE_33_MAP[256] =
{
OP(illegal) , OP(skgbz0) , OP(illegal) , OP(skgbz2) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
OP(illegal) , OP(skgbz1) , OP(illegal) , OP(skgbz3) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
OP(illegal) , OP(skgz) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
- OP(inin) , OP(inil) , OP(ing) , OP(illegal) , OP(cqma) , OP(illegal) , OP(inl) , OP(ctma) ,
+ OP(inin) , OP(inil) , OP(ing) , OP(illegal) , OP(cqma) , OP(illegal) , OP(inl) , OP(illegal) ,
OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
- OP(it) , OP(illegal) , OP(omg) , OP(illegal) , OP(camq) , OP(illegal) , OP(obd) , OP(camt) ,
+ OP(illegal) , OP(illegal) , OP(omg) , OP(illegal) , OP(camq) , OP(illegal) , OP(obd) , OP(illegal) ,
OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
@@ -697,22 +726,22 @@ const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_33_
OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi)
};
-void cop400_cpu_device::cop444_op33(uint8_t opcode)
+void cop400_cpu_device::cop444l_op33(uint8_t opcode)
{
uint8_t opcode33 = fetch();
- (this->*COP444_OPCODE_33_MAP[opcode33])(opcode33);
+ (this->*COP444L_OPCODE_33_MAP[opcode33])(opcode33);
}
-const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_MAP[256] =
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444L_OPCODE_MAP[256] =
{
OP(clra) , OP(skmbz0) , OP(xor_) , OP(skmbz2) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
- OP(casc) , OP(skmbz1) , OP(cop444_xabr), OP(skmbz3) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(casc) , OP(skmbz1) , OP(cop444l_xabr), OP(skmbz3) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
- OP(skc) , OP(ske) , OP(sc) , OP(cop444_op23) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(skc) , OP(ske) , OP(sc) , OP(cop444l_op23) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
- OP(asc) , OP(add) , OP(rc) , OP(cop444_op33) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(asc) , OP(add) , OP(rc) , OP(cop444l_op33) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
OP(comp) , OP(skt) , OP(rmb2) , OP(rmb3) , OP(nop) , OP(rmb1) , OP(smb2) , OP(smb1) ,
@@ -743,6 +772,136 @@ const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP444_OPCODE_MAP
OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jid)
};
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP424C_OPCODE_23_MAP[256] =
+{
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+ OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) , OP(ldd) ,
+
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) ,
+ OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad) , OP(xad)
+};
+
+void cop400_cpu_device::cop424c_op23(uint8_t opcode)
+{
+ uint8_t opcode23 = fetch();
+
+ (this->*COP424C_OPCODE_23_MAP[opcode23])(opcode23);
+}
+
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP424C_OPCODE_33_MAP[256] =
+{
+ OP(illegal) , OP(skgbz0) , OP(illegal) , OP(skgbz2) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(illegal) , OP(skgbz1) , OP(illegal) , OP(skgbz3) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(illegal) , OP(skgz) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(inin) , OP(inil) , OP(ing) , OP(illegal) , OP(cqma) , OP(illegal) , OP(inl) , OP(ctma) ,
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(it) , OP(illegal) , OP(omg) , OP(illegal) , OP(camq) , OP(illegal) , OP(obd) , OP(camt) ,
+
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) ,
+ OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) , OP(ogi) ,
+ OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) ,
+ OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) , OP(lei) ,
+ OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+ OP(halt) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) , OP(illegal) ,
+
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi)
+};
+
+void cop400_cpu_device::cop424c_op33(uint8_t opcode)
+{
+ uint8_t opcode33 = fetch();
+
+ (this->*COP424C_OPCODE_33_MAP[opcode33])(opcode33);
+}
+
+const cop400_cpu_device::cop400_opcode_func cop400_cpu_device::COP424C_OPCODE_MAP[256] =
+{
+ OP(clra) , OP(skmbz0) , OP(xor_) , OP(skmbz2) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(casc) , OP(skmbz1) , OP(cop444l_xabr), OP(skmbz3) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(skc) , OP(ske) , OP(sc) , OP(cop444l_op23) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+ OP(asc) , OP(add) , OP(rc) , OP(cop444l_op33) , OP(xis) , OP(ld) , OP(x) , OP(xds) ,
+ OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) , OP(lbi) ,
+
+ OP(comp) , OP(skt) , OP(rmb2) , OP(rmb3) , OP(nop) , OP(rmb1) , OP(smb2) , OP(smb1) ,
+ OP(cop420_ret) , OP(retsk) , OP(adt) , OP(smb3) , OP(rmb0) , OP(smb0) , OP(cba) , OP(xas) ,
+ OP(cab) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) ,
+ OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) , OP(aisc) ,
+ OP(jmp) , OP(jmp) , OP(jmp) , OP(jmp) , OP(jmp) , OP(jmp) , OP(jmp) , OP(jmp) ,
+ OP(jsr) , OP(jsr) , OP(jsr) , OP(jsr) , OP(jsr) , OP(jsr) , OP(jsr) , OP(jsr) ,
+ OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) ,
+ OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) , OP(stii) ,
+
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(lqid) ,
+
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) ,
+ OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jp) , OP(jid)
+};
/***************************************************************************
TIMER CALLBACKS
@@ -823,24 +982,11 @@ void cop400_cpu_device::serial_tick()
void cop400_cpu_device::counter_tick()
{
- if (m_featuremask & (COP444_FEATURE | COP440_FEATURE))
- {
- T++;
+ T++;
- if (T == 0)
- {
- m_skt_latch = 1;
-
- if (m_idle)
- {
- m_idle = 0;
- m_halt = 0;
- }
- }
- }
- else
- {
+ if (!T) {
m_skt_latch = 1;
+ m_idle = false;
}
}
@@ -888,13 +1034,11 @@ void cop400_cpu_device::device_timer(emu_timer &timer, device_timer_id id, int p
void cop400_cpu_device::device_start()
{
/* find address spaces */
-
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
m_data = &space(AS_DATA);
/* find i/o handlers */
-
m_read_l.resolve_safe(0);
m_read_l_tristate.resolve_safe(0);
m_write_l.resolve_safe();
@@ -908,29 +1052,18 @@ void cop400_cpu_device::device_start()
m_read_cko.resolve_safe(0);
/* allocate serial timer */
-
m_serial_timer = timer_alloc(TIMER_SERIAL);
m_serial_timer->adjust(attotime::zero, 0, attotime::from_ticks(m_cki, clock()));
/* allocate counter timer */
-
m_counter_timer = nullptr;
if (m_has_counter)
{
m_counter_timer = timer_alloc(TIMER_COUNTER);
-
- if (m_featuremask & (COP444_FEATURE | COP440_FEATURE))
- {
- m_counter_timer->adjust(attotime::zero, 0, attotime::from_ticks(m_cki * 4, clock()));
- }
- else
- {
- m_counter_timer->adjust(attotime::zero, 0, attotime::from_ticks(m_cki * 1024, clock()));
- }
+ m_counter_timer->adjust(attotime::zero, 0, attotime::from_ticks(m_cki * 4, clock()));
}
/* allocate IN latch timer */
-
m_inil_timer = nullptr;
if (m_has_inil)
{
@@ -939,10 +1072,8 @@ void cop400_cpu_device::device_start()
}
/* register for state saving */
-
save_item(NAME(m_pc));
save_item(NAME(m_prevpc));
- save_item(NAME(m_n));
save_item(NAME(m_sa));
save_item(NAME(m_sb));
save_item(NAME(m_sc));
@@ -950,9 +1081,7 @@ void cop400_cpu_device::device_start()
save_item(NAME(m_b));
save_item(NAME(m_c));
save_item(NAME(m_g));
- save_item(NAME(m_h));
save_item(NAME(m_q));
- save_item(NAME(m_r));
save_item(NAME(m_en));
save_item(NAME(m_sio));
save_item(NAME(m_skl));
@@ -968,24 +1097,19 @@ void cop400_cpu_device::device_start()
state_add(STATE_GENPC, "GENPC", m_pc).mask(0xfff).noshow();
state_add(STATE_GENPCBASE, "CURPC", m_prevpc).mask(0xfff).noshow();
- state_add(STATE_GENSP, "GENSP", m_n).mask(0x3).noshow();
state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).mask(0x3).callimport().callexport().noshow().formatstr("%3s");
state_add(COP400_PC, "PC", m_pc).mask(0xfff);
- if (m_featuremask & (COP410_FEATURE | COP420_FEATURE | COP444_FEATURE))
+ if (m_featuremask & (COP410_FEATURE | COP420_FEATURE | COP444L_FEATURE | COP424C_FEATURE))
{
state_add(COP400_SA, "SA", m_sa).mask(0xfff);
state_add(COP400_SB, "SB", m_sb).mask(0xfff);
- if (m_featuremask & (COP420_FEATURE | COP444_FEATURE))
+ if (m_featuremask & (COP420_FEATURE | COP444L_FEATURE | COP424C_FEATURE))
{
state_add(COP400_SC, "SC", m_sc).mask(0xfff);
}
}
- if (m_featuremask & COP440_FEATURE)
- {
- state_add(COP400_N, "N", m_n).mask(0x3);
- }
state_add(COP400_A, "A", m_a).mask(0xf);
state_add(COP400_B, "B", m_b);
@@ -993,41 +1117,30 @@ void cop400_cpu_device::device_start()
state_add(COP400_EN, "EN", m_en).mask(0xf);
state_add(COP400_G, "G", m_g).mask(0xf);
- if (m_featuremask & COP440_FEATURE)
- {
- state_add(COP400_H, "H", m_h).mask(0xf);
- }
state_add(COP400_Q, "Q", m_q);
- if (m_featuremask & COP440_FEATURE)
- {
- state_add(COP400_R, "R", m_r);
- }
state_add(COP400_SIO, "SIO", m_sio).mask(0xf);
state_add(COP400_SKL, "SKL", m_skl).mask(0x1);
- if (m_featuremask & (COP444_FEATURE | COP440_FEATURE))
+ if (m_featuremask & COP424C_FEATURE)
{
state_add(COP400_T, "T", m_t);
}
m_icountptr = &m_icount;
- m_n = 0;
m_q = 0;
m_sa = 0;
m_sb = 0;
m_sc = 0;
m_sio = 0;
- m_h = 0;
- m_r = 0;
m_flags = 0;
m_il = 0;
m_in[0] = m_in[1] = m_in[2] = m_in[3] = 0;
m_si = 0;
m_skip_lbi = 0;
- m_last_skip = 0;
- m_skip = 0;
+ m_last_skip = false;
+ m_skip = false;
}
@@ -1049,8 +1162,8 @@ void cop400_cpu_device::device_reset()
T = 0;
m_skt_latch = 1;
- m_halt = 0;
- m_idle = 0;
+ m_halt = false;
+ m_idle = false;
}
/***************************************************************************
@@ -1068,16 +1181,18 @@ void cop400_cpu_device::execute_run()
{
do
{
- // debugger hook
- m_prevpc = PC;
- debugger_instruction_hook(this, PC);
+ if (!m_skip) {
+ // debugger hook
+ m_prevpc = PC;
+ debugger_instruction_hook(this, PC);
+ }
// halt logic
if (m_cko == COP400_CKO_HALT_IO_PORT) {
m_halt = IN_CKO();
}
- if (m_halt) {
+ if (m_halt || m_idle) {
m_icount--;
continue;
}
@@ -1092,7 +1207,7 @@ void cop400_cpu_device::execute_run()
if ((function != OP(jp)) && (function != OP(jmp)) && (function != OP(jsr)) && !m_skip_lbi) {
// store skip logic
m_last_skip = m_skip;
- m_skip = 0;
+ m_skip = false;
// push next PC
PUSH(PC);
@@ -1114,7 +1229,7 @@ void cop400_cpu_device::execute_run()
opcode = fetch();
}
- m_skip = 0;
+ m_skip = false;
continue;
}
@@ -1174,8 +1289,14 @@ offs_t cop400_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, co
extern CPU_DISASSEMBLE( cop410 );
extern CPU_DISASSEMBLE( cop420 );
extern CPU_DISASSEMBLE( cop444 );
+ extern CPU_DISASSEMBLE( cop424 );
+
+ if ( m_featuremask & COP424C_FEATURE )
+ {
+ return CPU_DISASSEMBLE_NAME(cop424)(this, stream, pc, oprom, opram, options);
+ }
- if ( m_featuremask & COP444_FEATURE )
+ if ( m_featuremask & COP444L_FEATURE )
{
return CPU_DISASSEMBLE_NAME(cop444)(this, stream, pc, oprom, opram, options);
}
diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h
index 693210443b1..2db42811447 100644
--- a/src/devices/cpu/cop400/cop400.h
+++ b/src/devices/cpu/cop400/cop400.h
@@ -64,14 +64,11 @@ enum
COP400_SA,
COP400_SB,
COP400_SC,
- COP400_N,
COP400_A,
COP400_B,
COP400_C,
COP400_G,
- COP400_H,
COP400_Q,
- COP400_R,
COP400_EN,
COP400_SIO,
COP400_SKL,
@@ -87,7 +84,7 @@ enum
COP400_IN2,
COP400_IN3,
- /* COP404 */
+ /* COP404L */
COP400_MB,
COP400_DUAL,
COP400_SEL10,
@@ -194,13 +191,14 @@ protected:
enum {
COP410_FEATURE = 0x01,
COP420_FEATURE = 0x02,
- COP444_FEATURE = 0x04,
- COP440_FEATURE = 0x08
+ COP444L_FEATURE = 0x04,
+ COP424C_FEATURE = 0x08
};
enum {
TIMER_SERIAL,
TIMER_COUNTER,
+ TIMER_COUNTER_T,
TIMER_INIL
};
@@ -223,15 +221,12 @@ protected:
uint8_t m_a; /* 4-bit accumulator */
uint8_t m_b; /* 5/6/7-bit RAM address register */
int m_c; /* 1-bit carry register */
- uint8_t m_n; /* 2-bit stack pointer (COP440 only) */
uint8_t m_en; /* 4-bit enable register */
uint8_t m_g; /* 4-bit general purpose I/O port */
uint8_t m_q; /* 8-bit latch for L port */
- uint16_t m_sa, m_sb, m_sc; /* subroutine save registers (not present in COP440) */
+ uint16_t m_sa, m_sb, m_sc; /* subroutine save registers */
uint8_t m_sio; /* 4-bit shift register and counter */
int m_skl; /* 1-bit latch for SK output */
- uint8_t m_h; /* 4-bit general purpose I/O port (COP440 only) */
- uint8_t m_r; /* 8-bit general purpose I/O port (COP440 only) */
uint8_t m_flags; // used for I/O only
/* counter */
@@ -247,11 +242,11 @@ protected:
uint8_t m_si; /* serial input */
/* skipping logic */
- int m_skip; /* skip next instruction */
+ bool m_skip; /* skip next instruction */
int m_skip_lbi; /* skip until next non-LBI instruction */
- int m_last_skip; /* last value of skip */
- int m_halt; /* halt mode */
- int m_idle; /* idle mode */
+ bool m_last_skip; /* last value of skip */
+ bool m_halt; /* halt mode */
+ bool m_idle; /* idle mode */
/* execution logic */
int m_InstLen[256]; /* instruction length in bytes */
@@ -272,9 +267,12 @@ protected:
static const cop400_opcode_func COP420_OPCODE_23_MAP[256];
static const cop400_opcode_func COP420_OPCODE_33_MAP[256];
static const cop400_opcode_func COP420_OPCODE_MAP[256];
- static const cop400_opcode_func COP444_OPCODE_23_MAP[256];
- static const cop400_opcode_func COP444_OPCODE_33_MAP[256];
- static const cop400_opcode_func COP444_OPCODE_MAP[256];
+ static const cop400_opcode_func COP444L_OPCODE_23_MAP[256];
+ static const cop400_opcode_func COP444L_OPCODE_33_MAP[256];
+ static const cop400_opcode_func COP444L_OPCODE_MAP[256];
+ static const cop400_opcode_func COP424C_OPCODE_23_MAP[256];
+ static const cop400_opcode_func COP424C_OPCODE_33_MAP[256];
+ static const cop400_opcode_func COP424C_OPCODE_MAP[256];
void serial_tick();
void counter_tick();
@@ -333,7 +331,7 @@ protected:
void lbi(uint8_t opcode);
void lei(uint8_t opcode);
void xabr(uint8_t opcode);
- void cop444_xabr(uint8_t opcode);
+ void cop444l_xabr(uint8_t opcode);
void skc(uint8_t opcode);
void ske(uint8_t opcode);
void skgz(uint8_t opcode);
@@ -359,11 +357,12 @@ protected:
void cop410_op33(uint8_t opcode);
void cop420_op23(uint8_t opcode);
void cop420_op33(uint8_t opcode);
- void cop444_op23(uint8_t opcode);
- void cop444_op33(uint8_t opcode);
+ void cop444l_op23(uint8_t opcode);
+ void cop444l_op33(uint8_t opcode);
+ void cop424c_op23(uint8_t opcode);
+ void cop424c_op33(uint8_t opcode);
void skgbz(int bit);
void skmbz(int bit);
-
};
@@ -431,56 +430,92 @@ public:
/* COP444 family */
-// COP404 is a ROMless version of the COP444, which can emulate a COP410C/COP411C, COP424C/COP425C, or a COP444C/COP445C
-class cop404_cpu_device : public cop400_cpu_device
+// COP404L is a ROMless version of the COP444, which can emulate a COP410/COP411, COP424/COP425, or a COP444/COP445
+class cop404l_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop404l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// COP424 is functionally equivalent to COP444, with only 1K ROM and 64x4 bytes RAM
-class cop424_cpu_device : public cop400_cpu_device
+class cop444l_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop444l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// COP425 is a 24-pin package version of the COP424, lacking the IN ports
-class cop425_cpu_device : public cop400_cpu_device
+// COP445 is a 24-pin package version of the COP444, lacking the IN ports
+class cop445l_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop445l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// COP426 is a 20-pin package version of the COP424, with only L0-L7, G2-G3, D2-D3 ports
-class cop426_cpu_device : public cop400_cpu_device
+// COP404C
+class cop404c_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop404c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-class cop444_cpu_device : public cop400_cpu_device
+// COP424C is functionally equivalent to COP444C, with only 1K ROM and 64x4 bytes RAM
+class cop424c_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop424c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// COP445 is a 24-pin package version of the COP444, lacking the IN ports
-class cop445_cpu_device : public cop400_cpu_device
+// COP425C is a 24-pin package version of the COP424C, lacking the IN ports
+class cop425c_cpu_device : public cop400_cpu_device
+{
+public:
+ // construction/destruction
+ cop425c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// COP426C is a 20-pin package version of the COP424C, with only L0-L7, G2-G3, D2-D3 ports
+class cop426c_cpu_device : public cop400_cpu_device
+{
+public:
+ // construction/destruction
+ cop426c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// COP444C
+class cop444c_cpu_device : public cop400_cpu_device
+{
+public:
+ // construction/destruction
+ cop444c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// COP445C
+class cop445c_cpu_device : public cop400_cpu_device
{
public:
// construction/destruction
- cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ cop445c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// COP446C
+class cop446c_cpu_device : public cop400_cpu_device
+{
+public:
+ // construction/destruction
+ cop446c_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
@@ -491,12 +526,15 @@ extern const device_type COP402;
extern const device_type COP420;
extern const device_type COP421;
extern const device_type COP422;
-extern const device_type COP404;
-extern const device_type COP424;
-extern const device_type COP425;
-extern const device_type COP426;
-extern const device_type COP444;
-extern const device_type COP445;
-
+extern const device_type COP404L;
+extern const device_type COP444L;
+extern const device_type COP445L;
+extern const device_type COP404C;
+extern const device_type COP424C;
+extern const device_type COP425C;
+extern const device_type COP426C;
+extern const device_type COP444C;
+extern const device_type COP445C;
+extern const device_type COP446C;
#endif /* __COP400__ */
diff --git a/src/devices/cpu/cop400/cop400op.hxx b/src/devices/cpu/cop400/cop400op.hxx
index cf363be8ce6..17d72956828 100644
--- a/src/devices/cpu/cop400/cop400op.hxx
+++ b/src/devices/cpu/cop400/cop400op.hxx
@@ -35,7 +35,7 @@ INSTRUCTION( asc )
if (A > 0xF)
{
C = 1;
- m_skip = 1;
+ m_skip = true;
A &= 0xF;
}
else
@@ -86,7 +86,7 @@ INSTRUCTION( aisc )
if (A > 0x0f)
{
- m_skip = 1;
+ m_skip = true;
A &= 0xF;
}
}
@@ -238,7 +238,7 @@ INSTRUCTION( casc )
if (A > 0xF)
{
C = 1;
- m_skip = 1;
+ m_skip = true;
A &= 0xF;
}
else
@@ -413,7 +413,7 @@ INSTRUCTION( cop420_ret )
INSTRUCTION( retsk )
{
POP();
- m_skip = 1;
+ m_skip = true;
}
/*
@@ -431,7 +431,7 @@ INSTRUCTION( retsk )
INSTRUCTION( halt )
{
- m_halt = 1;
+ m_halt = true;
}
/*
@@ -447,8 +447,8 @@ INSTRUCTION( halt )
INSTRUCTION( it )
{
- m_halt = 1;
- m_idle = 1;
+ m_halt = true;
+ m_idle = true;
}
/***************************************************************************
@@ -732,7 +732,7 @@ INSTRUCTION( xds )
B = B ^ r;
- if (Bd == 0x0f) m_skip = 1;
+ if (Bd == 0x0f) m_skip = true;
}
/*
@@ -767,7 +767,7 @@ INSTRUCTION( xis )
B = B ^ r;
- if (Bd == 0x00) m_skip = 1;
+ if (Bd == 0x00) m_skip = true;
}
/*
@@ -979,7 +979,7 @@ INSTRUCTION( xabr )
/*
- Processor: COP444
+ Processor: COP444L
Mnemonic: XABR
@@ -992,7 +992,7 @@ INSTRUCTION( xabr )
*/
-INSTRUCTION( cop444_xabr )
+INSTRUCTION( cop444l_xabr )
{
uint8_t Br = A & 0x07;
uint8_t Bd = B & 0x0f;
@@ -1020,7 +1020,7 @@ INSTRUCTION( cop444_xabr )
INSTRUCTION( skc )
{
- if (C == 1) m_skip = 1;
+ if (C == 1) m_skip = true;
}
/*
@@ -1038,7 +1038,7 @@ INSTRUCTION( skc )
INSTRUCTION( ske )
{
- if (A == RAM_R(B)) m_skip = 1;
+ if (A == RAM_R(B)) m_skip = true;
}
/*
@@ -1056,7 +1056,7 @@ INSTRUCTION( ske )
INSTRUCTION( skgz )
{
- if (IN_G() == 0) m_skip = 1;
+ if (IN_G() == 0) m_skip = true;
}
/*
@@ -1081,7 +1081,7 @@ INSTRUCTION( skgz )
void cop400_cpu_device::skgbz(int bit)
{
- if (!BIT(IN_G(), bit)) m_skip = 1;
+ if (!BIT(IN_G(), bit)) m_skip = true;
}
INSTRUCTION( skgbz0 ) { skgbz(0); }
@@ -1111,7 +1111,7 @@ INSTRUCTION( skgbz3 ) { skgbz(3); }
void cop400_cpu_device::skmbz(int bit)
{
- if (!BIT(RAM_R(B), bit)) m_skip = 1;
+ if (!BIT(RAM_R(B), bit)) m_skip = true;
}
INSTRUCTION( skmbz0 ) { skmbz(0); }
@@ -1137,7 +1137,7 @@ INSTRUCTION( skt )
if (m_skt_latch)
{
m_skt_latch = 0;
- m_skip = 1;
+ m_skip = true;
}
}
diff --git a/src/devices/cpu/cop400/cop440ds.cpp b/src/devices/cpu/cop400/cop424ds.cpp
index 14489f05ab5..bb16858e81a 100644
--- a/src/devices/cpu/cop400/cop440ds.cpp
+++ b/src/devices/cpu/cop400/cop424ds.cpp
@@ -2,15 +2,15 @@
// copyright-holders:Curt Coder
/***************************************************************************
- cop440ds.c
+ cop424ds.c
- National Semiconductor COP440 Emulator.
+ National Semiconductor COP424C/COP444C Emulator.
***************************************************************************/
#include "emu.h"
-CPU_DISASSEMBLE(cop444)
+CPU_DISASSEMBLE(cop424)
{
uint8_t opcode = oprom[0];
uint8_t next_opcode = oprom[1];
@@ -62,15 +62,15 @@ CPU_DISASSEMBLE(cop444)
{
util::stream_format(stream, "AISC %u", opcode & 0xF);
}
- else if (opcode >= 0x60 && opcode <= 0x63)
+ else if (opcode >= 0x60 && opcode <= 0x67)
{
- address = ((opcode & 0x03) << 8) | next_opcode;
+ address = ((opcode & 0x07) << 8) | next_opcode;
util::stream_format(stream, "JMP %03x", address);
bytes = 2;
}
- else if (opcode >= 0x68 && opcode <= 0x6B)
+ else if (opcode >= 0x68 && opcode <= 0x6f)
{
- address = ((opcode & 0x03) << 8) | next_opcode;
+ address = ((opcode & 0x07) << 8) | next_opcode;
util::stream_format(stream, "JSR %03x", address);
flags = DASMFLAG_STEP_OVER;
bytes = 2;
@@ -162,19 +162,15 @@ CPU_DISASSEMBLE(cop444)
case 0x23:
bytes = 2;
- if (next_opcode <= 0x3f)
+ if (next_opcode <= 0x7f)
{
- address = (uint16_t)(next_opcode & 0x3F);
- util::stream_format(stream, "LDD %u,%u", ((address & 0x30) >> 4),address & 0x0F);
+ address = (uint16_t)(next_opcode & 0x7F);
+ util::stream_format(stream, "LDD %u,%u", address >> 4, address & 0x0F);
}
- else if (next_opcode >= 0x80 && next_opcode <= 0xbf)
+ else if (next_opcode >= 0x80)
{
- address = (uint16_t)(next_opcode & 0x3F);
- util::stream_format(stream, "XAD %u,%u", ((address & 0x30) >> 4),address & 0x0F);
- }
- else
- {
- util::stream_format(stream, "Invalid");
+ address = (uint16_t)(next_opcode & 0x7f);
+ util::stream_format(stream, "XAD %u,%u", address >> 4, address & 0x0F);
}
break;
@@ -217,21 +213,9 @@ CPU_DISASSEMBLE(cop444)
{
util::stream_format(stream, "LEI %u", next_opcode & 0xF);
}
- else if (next_opcode >= 0x80 && next_opcode <= 0x8F)
- {
- util::stream_format(stream, "LBI 0,%u", next_opcode & 0xF);
- }
- else if (next_opcode >= 0x90 && next_opcode <= 0x9F)
- {
- util::stream_format(stream, "LBI 1,%u", next_opcode & 0xF);
- }
- else if (next_opcode >= 0xA0 && next_opcode <= 0xAF)
- {
- util::stream_format(stream, "LBI 2,%u", next_opcode & 0xF);
- }
- else if (next_opcode >= 0xB0 && next_opcode <= 0xBF)
+ else if (next_opcode >= 0x80)
{
- util::stream_format(stream, "LBI 3,%u", next_opcode & 0xF);
+ util::stream_format(stream, "LBI %u,%u", (next_opcode >> 4) & 0x07, next_opcode & 0xF);
}
else
{
diff --git a/src/devices/cpu/cop400/cop444ds.cpp b/src/devices/cpu/cop400/cop444ds.cpp
new file mode 100644
index 00000000000..434197b42a3
--- /dev/null
+++ b/src/devices/cpu/cop400/cop444ds.cpp
@@ -0,0 +1,384 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/***************************************************************************
+
+ cop444ds.c
+
+ National Semiconductor COP444L Emulator.
+
+***************************************************************************/
+
+#include "emu.h"
+
+CPU_DISASSEMBLE(cop444)
+{
+ uint8_t opcode = oprom[0];
+ uint8_t next_opcode = oprom[1];
+ uint16_t address;
+ uint32_t flags = 0;
+ int bytes = 1;
+
+ if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE))
+ {
+ int page = pc >> 6;
+
+ if (page == 2 || page == 3) //JP pages 2,3
+ {
+ address = (uint16_t)((pc & 0x780) | (opcode & 0x7F));
+ util::stream_format(stream, "JP %03x", address);
+ }
+ else
+ {
+ if ((opcode & 0xC0) == 0xC0) //JP other pages
+ {
+ address = (uint16_t)((pc & 0x7C0) | (opcode & 0x3F));
+ util::stream_format(stream, "JP %03x", address);
+ }
+ else //JSRP
+ {
+ address = (uint16_t)(0x80 | (opcode & 0x3F));
+ util::stream_format(stream, "JSRP %03x", address);
+ flags = DASMFLAG_STEP_OVER;
+ }
+ }
+ }
+ else if (opcode >= 0x08 && opcode <= 0x0F)
+ {
+ util::stream_format(stream, "LBI 0,%u", ((opcode & 0xF) + 1) & 0xF);
+ }
+ else if (opcode >= 0x18 && opcode <= 0x1F)
+ {
+ util::stream_format(stream, "LBI 1,%u", ((opcode & 0xF) + 1) & 0xF);
+ }
+ else if (opcode >= 0x28 && opcode <= 0x2F)
+ {
+ util::stream_format(stream, "LBI 2,%u", ((opcode & 0xF) + 1) & 0xF);
+ }
+ else if (opcode >= 0x38 && opcode <= 0x3F)
+ {
+ util::stream_format(stream, "LBI 3,%u", ((opcode & 0xF) + 1) & 0xF);
+ }
+ else if (opcode >= 0x51 && opcode <= 0x5F)
+ {
+ util::stream_format(stream, "AISC %u", opcode & 0xF);
+ }
+ else if (opcode >= 0x60 && opcode <= 0x67)
+ {
+ address = ((opcode & 0x07) << 8) | next_opcode;
+ util::stream_format(stream, "JMP %03x", address);
+ bytes = 2;
+ }
+ else if (opcode >= 0x68 && opcode <= 0x6f)
+ {
+ address = ((opcode & 0x07) << 8) | next_opcode;
+ util::stream_format(stream, "JSR %03x", address);
+ flags = DASMFLAG_STEP_OVER;
+ bytes = 2;
+ }
+ else if (opcode >= 0x70 && opcode <= 0x7F)
+ {
+ util::stream_format(stream, "STII %u", opcode & 0xF);
+ }
+ else
+ {
+ switch (opcode)
+ {
+ case 0:
+ util::stream_format(stream, "CLRA");
+ break;
+
+ case 1:
+ util::stream_format(stream, "SKMBZ 0");
+ break;
+
+ case 2:
+ util::stream_format(stream, "XOR");
+ break;
+
+ case 3:
+ util::stream_format(stream, "SKMBZ 2");
+ break;
+
+ case 4:
+ util::stream_format(stream, "XIS 0");
+ break;
+
+ case 5:
+ util::stream_format(stream, "LD 0");
+ break;
+
+ case 6:
+ util::stream_format(stream, "X 0");
+ break;
+
+ case 7:
+ util::stream_format(stream, "XDS 0");
+ break;
+
+ case 0x10:
+ util::stream_format(stream, "CASC");
+ break;
+
+ case 0x11:
+ util::stream_format(stream, "SKMBZ 1");
+ break;
+
+ case 0x12:
+ util::stream_format(stream, "XABR");
+ break;
+
+ case 0x13:
+ util::stream_format(stream, "SKMBZ 3");
+ break;
+
+ case 0x14:
+ util::stream_format(stream, "XIS 1");
+ break;
+
+ case 0x15:
+ util::stream_format(stream, "LD 1");
+ break;
+
+ case 0x16:
+ util::stream_format(stream, "X 1");
+ break;
+
+ case 0x17:
+ util::stream_format(stream, "XDS 1");
+ break;
+
+ case 0x20:
+ util::stream_format(stream, "SKC");
+ break;
+
+ case 0x21:
+ util::stream_format(stream, "SKE");
+ break;
+
+ case 0x22:
+ util::stream_format(stream, "SC");
+ break;
+
+ case 0x23:
+ bytes = 2;
+
+ if (next_opcode <= 0x7f)
+ {
+ address = (uint16_t)(next_opcode & 0x7F);
+ util::stream_format(stream, "LDD %u,%u", address >> 4, address & 0x0F);
+ }
+ else if (next_opcode >= 0x80)
+ {
+ address = (uint16_t)(next_opcode & 0x7f);
+ util::stream_format(stream, "XAD %u,%u", address >> 4, address & 0x0F);
+ }
+ break;
+
+ case 0x24:
+ util::stream_format(stream, "XIS 2");
+ break;
+
+ case 0x25:
+ util::stream_format(stream, "LD 2");
+ break;
+
+ case 0x26:
+ util::stream_format(stream, "X 2");
+ break;
+
+ case 0x27:
+ util::stream_format(stream, "XDS 2");
+ break;
+
+ case 0x30:
+ util::stream_format(stream, "ASC");
+ break;
+
+ case 0x31:
+ util::stream_format(stream, "ADD");
+ break;
+
+ case 0x32:
+ util::stream_format(stream, "RC");
+ break;
+
+ case 0x33:
+ bytes = 2;
+
+ if (next_opcode >= 0x50 && next_opcode <= 0x5F)
+ {
+ util::stream_format(stream, "OGI %u", next_opcode & 0xF);
+ }
+ else if (next_opcode >= 0x60 && next_opcode <= 0x6F)
+ {
+ util::stream_format(stream, "LEI %u", next_opcode & 0xF);
+ }
+ else if (next_opcode >= 0x80)
+ {
+ util::stream_format(stream, "LBI %u,%u", (next_opcode >> 4) & 0x07, next_opcode & 0xF);
+ }
+ else
+ {
+ switch (next_opcode)
+ {
+ case 0x01:
+ util::stream_format(stream, "SKGBZ 0");
+ break;
+
+ case 0x03:
+ util::stream_format(stream, "SKGBZ 2");
+ break;
+
+ case 0x11:
+ util::stream_format(stream, "SKGBZ 1");
+ break;
+
+ case 0x13:
+ util::stream_format(stream, "SKGBZ 3");
+ break;
+
+ case 0x21:
+ util::stream_format(stream, "SKGZ");
+ break;
+
+ case 0x28:
+ util::stream_format(stream, "ININ");
+ break;
+
+ case 0x29:
+ util::stream_format(stream, "INIL");
+ break;
+
+ case 0x2A:
+ util::stream_format(stream, "ING");
+ break;
+
+ case 0x2C:
+ util::stream_format(stream, "CQMA");
+ break;
+
+ case 0x2E:
+ util::stream_format(stream, "INL");
+ break;
+
+ case 0x3A:
+ util::stream_format(stream, "OMG");
+ break;
+
+ case 0x3C:
+ util::stream_format(stream, "CAMQ");
+ break;
+
+ case 0x3E:
+ util::stream_format(stream, "OBD");
+ break;
+
+ default:
+ util::stream_format(stream, "Invalid");
+ break;
+ }
+ }
+ break;
+
+ case 0x34:
+ util::stream_format(stream, "XIS 3");
+ break;
+
+ case 0x35:
+ util::stream_format(stream, "LD 3");
+ break;
+
+ case 0x36:
+ util::stream_format(stream, "X 3");
+ break;
+
+ case 0x37:
+ util::stream_format(stream, "XDS 3");
+ break;
+
+ case 0x40:
+ util::stream_format(stream, "COMP");
+ break;
+
+ case 0x41:
+ util::stream_format(stream, "SKT");
+ break;
+
+ case 0x42:
+ util::stream_format(stream, "RMB 2");
+ break;
+
+ case 0x43:
+ util::stream_format(stream, "RMB 3");
+ break;
+
+ case 0x44:
+ util::stream_format(stream, "NOP");
+ break;
+
+ case 0x45:
+ util::stream_format(stream, "RMB 1");
+ break;
+
+ case 0x46:
+ util::stream_format(stream, "SMB 2");
+ break;
+
+ case 0x47:
+ util::stream_format(stream, "SMB 1");
+ break;
+
+ case 0x48:
+ util::stream_format(stream, "RET");
+ flags = DASMFLAG_STEP_OUT;
+ break;
+
+ case 0x49:
+ util::stream_format(stream, "RETSK");
+ flags = DASMFLAG_STEP_OUT;
+ break;
+
+ case 0x4A:
+ util::stream_format(stream, "ADT");
+ break;
+
+ case 0x4B:
+ util::stream_format(stream, "SMB 3");
+ break;
+
+ case 0x4C:
+ util::stream_format(stream, "RMB 0");
+ break;
+
+ case 0x4D:
+ util::stream_format(stream, "SMB 0");
+ break;
+
+ case 0x4E:
+ util::stream_format(stream, "CBA");
+ break;
+
+ case 0x4F:
+ util::stream_format(stream, "XAS");
+ break;
+
+ case 0x50:
+ util::stream_format(stream, "CAB");
+ break;
+
+ case 0xBF:
+ util::stream_format(stream, "LQID");
+ break;
+
+ case 0xFF:
+ util::stream_format(stream, "JID");
+ break;
+
+ default:
+ util::stream_format(stream, "Invalid");
+ break;
+ }
+ }
+
+ return bytes | flags | DASMFLAG_SUPPORTED;
+}
diff --git a/src/devices/cpu/e0c6200/e0c6200.cpp b/src/devices/cpu/e0c6200/e0c6200.cpp
index a7ccf514438..e78351b19aa 100644
--- a/src/devices/cpu/e0c6200/e0c6200.cpp
+++ b/src/devices/cpu/e0c6200/e0c6200.cpp
@@ -40,7 +40,7 @@ void e0c6200_cpu_device::state_string_export(const device_state_entry &entry, st
}
}
-offs_t e0c6200_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t e0c6200_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(e0c6200);
return CPU_DISASSEMBLE_NAME(e0c6200)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/e0c6200/e0c6200.h b/src/devices/cpu/e0c6200/e0c6200.h
index bf43c80ad2b..4a38ae8fbf8 100644
--- a/src/devices/cpu/e0c6200/e0c6200.h
+++ b/src/devices/cpu/e0c6200/e0c6200.h
@@ -16,7 +16,7 @@ class e0c6200_cpu_device : public cpu_device
{
public:
// construction/destruction
- e0c6200_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program, address_map_constructor data, const char *shortname, const char *source)
+ e0c6200_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, address_map_constructor program, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, 16, 13, -1, program)
, m_data_config("data", ENDIANNESS_BIG, 8, 12, 0, data), m_program(nullptr), m_data(nullptr), m_op(0), m_prev_op(0), m_irq_vector(0), m_irq_id(0), m_possible_irq(false), m_halt(false),
@@ -29,9 +29,9 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint32_t execute_min_cycles() const override { return 5; }
- virtual uint32_t execute_max_cycles() const override { return 14; } // longest opcode is 12 cycles, but interrupt service takes up to 14
- virtual uint32_t execute_input_lines() const override { return 1; }
+ virtual u32 execute_min_cycles() const override { return 5; }
+ virtual u32 execute_max_cycles() const override { return 14; } // longest opcode is 12 cycles, but interrupt service takes up to 14
+ virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_run() override;
virtual void execute_one();
virtual bool check_interrupt() { return false; } // nothing to do by default
@@ -41,9 +41,9 @@ protected:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 2; }
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual u32 disasm_min_opcode_bytes() const override { return 2; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 2; }
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
address_space_config m_program_config;
@@ -51,27 +51,27 @@ protected:
address_space *m_program;
address_space *m_data;
- uint16_t m_op;
- uint16_t m_prev_op;
- uint8_t m_irq_vector; // low 4 bits for new programcounter after interrupt
- int m_irq_id; // for standard_irq_callback(id)
- bool m_possible_irq; // indicates interrupts need to be re-checked
- bool m_halt; // cpu halt state
- bool m_sleep; // cpu sleep state
+ u16 m_op;
+ u16 m_prev_op;
+ u8 m_irq_vector; // low 4 bits for new programcounter after interrupt
+ int m_irq_id; // for standard_irq_callback(id)
+ bool m_possible_irq; // indicates interrupts need to be re-checked
+ bool m_halt; // cpu halt state
+ bool m_sleep; // cpu sleep state
int m_icount;
- uint16_t m_pc; // 13-bit programcounter: 1-bit bank, 4-bit page, 8-bit 'step'
- uint16_t m_prev_pc;
- uint16_t m_npc; // new bank/page prepared by pset
- uint16_t m_jpc; // actual bank/page destination for jumps
+ u16 m_pc; // 13-bit programcounter: 1-bit bank, 4-bit page, 8-bit 'step'
+ u16 m_prev_pc;
+ u16 m_npc; // new bank/page prepared by pset
+ u16 m_jpc; // actual bank/page destination for jumps
// all work registers are 4-bit
- uint8_t m_a; // accumulator
- uint8_t m_b; // generic
- uint8_t m_xp, m_xh, m_xl; // 12-bit index register when combined
- uint8_t m_yp, m_yh, m_yl; // "
- uint8_t m_sp; // stackpointer (SPH, SPL)
- uint8_t m_f; // flags
+ u8 m_a; // accumulator
+ u8 m_b; // generic
+ u8 m_xp, m_xh, m_xl; // 12-bit index register when combined
+ u8 m_yp, m_yh, m_yl; // "
+ u8 m_sp; // stackpointer (SPH, SPL)
+ u8 m_f; // flags
enum
{
C_FLAG = 1,
@@ -81,39 +81,39 @@ protected:
};
// internal data memory read/write
- uint8_t read_mx();
- uint8_t read_my();
- uint8_t read_mn();
- void write_mx(uint8_t data);
- void write_my(uint8_t data);
- void write_mn(uint8_t data);
+ u8 read_mx();
+ u8 read_my();
+ u8 read_mn();
+ void write_mx(u8 data);
+ void write_my(u8 data);
+ void write_mn(u8 data);
// common stack ops
- void push(uint8_t data);
- uint8_t pop();
+ void push(u8 data);
+ u8 pop();
void push_pc();
void pop_pc();
// misc internal helpers
- void set_cf(uint8_t data);
- void set_zf(uint8_t data);
+ void set_cf(u8 data);
+ void set_zf(u8 data);
void inc_x();
void inc_y();
void do_branch(int condition = 1);
// opcode handlers
- uint8_t op_inc(uint8_t x);
- uint8_t op_dec(uint8_t x);
- uint8_t op_add(uint8_t x, uint8_t y, int decimal = 0);
- uint8_t op_adc(uint8_t x, uint8_t y, int decimal = 0);
- uint8_t op_sub(uint8_t x, uint8_t y, int decimal = 0);
- uint8_t op_sbc(uint8_t x, uint8_t y, int decimal = 0);
-
- uint8_t op_and(uint8_t x, uint8_t y);
- uint8_t op_or(uint8_t x, uint8_t y);
- uint8_t op_xor(uint8_t x, uint8_t y);
- uint8_t op_rlc(uint8_t x);
- uint8_t op_rrc(uint8_t x);
+ u8 op_inc(u8 x);
+ u8 op_dec(u8 x);
+ u8 op_add(u8 x, u8 y, int decimal = 0);
+ u8 op_adc(u8 x, u8 y, int decimal = 0);
+ u8 op_sub(u8 x, u8 y, int decimal = 0);
+ u8 op_sbc(u8 x, u8 y, int decimal = 0);
+
+ u8 op_and(u8 x, u8 y);
+ u8 op_or(u8 x, u8 y);
+ u8 op_xor(u8 x, u8 y);
+ u8 op_rlc(u8 x);
+ u8 op_rrc(u8 x);
};
diff --git a/src/devices/cpu/e0c6200/e0c6200d.cpp b/src/devices/cpu/e0c6200/e0c6200d.cpp
index eb8c4d55091..fde754ef051 100644
--- a/src/devices/cpu/e0c6200/e0c6200d.cpp
+++ b/src/devices/cpu/e0c6200/e0c6200d.cpp
@@ -34,7 +34,7 @@ static const char *const em_name[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t em_flags[] =
+static const u32 em_flags[] =
{
0, _OUT, _OVER, _OVER,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -56,7 +56,7 @@ enum e_params
// 0-digit is number of bits per opcode parameter, 0 bits is literal,
// 0x10-digit is for shift-right, 0x100-digit is special flag for r/q param
-static const uint16_t ep_bits[] =
+static const u16 ep_bits[] =
{
8, 8, 4, 0x102, 0x122, 0x142, 0x102,
0, 0, 0, 0,
@@ -65,7 +65,7 @@ static const uint16_t ep_bits[] =
};
// redirect for r/q param
-static const uint8_t ep_redirect_r[4] = { ep_A, ep_B, ep_MX, ep_MY };
+static const u8 ep_redirect_r[4] = { ep_A, ep_B, ep_MX, ep_MY };
// literal opcode parameter
static const char *const ep_name[] =
@@ -77,11 +77,11 @@ static const char *const ep_name[] =
};
-static char* decode_param(uint16_t opcode, int param, char* buffer)
+static char* decode_param(u16 opcode, int param, char* buffer)
{
int bits = ep_bits[param] & 0xf;
int shift = ep_bits[param] >> 4 & 0xf;
- uint16_t opmask = opcode >> shift & ((1 << bits) - 1);
+ u16 opmask = opcode >> shift & ((1 << bits) - 1);
// redirect r/q to A/B/MX/MY
if (ep_bits[param] & 0x100)
@@ -112,7 +112,7 @@ static char* decode_param(uint16_t opcode, int param, char* buffer)
CPU_DISASSEMBLE(e0c6200)
{
- uint16_t op = (oprom[1] | oprom[0] << 8) & 0xfff;
+ u16 op = (oprom[1] | oprom[0] << 8) & 0xfff;
int m;
int p1 = -1;
diff --git a/src/devices/cpu/e0c6200/e0c6200op.cpp b/src/devices/cpu/e0c6200/e0c6200op.cpp
index ed2d4a06031..94295e43889 100644
--- a/src/devices/cpu/e0c6200/e0c6200op.cpp
+++ b/src/devices/cpu/e0c6200/e0c6200op.cpp
@@ -10,38 +10,38 @@
// MX/MY
-uint8_t e0c6200_cpu_device::read_mx()
+u8 e0c6200_cpu_device::read_mx()
{
- uint16_t address = m_xp << 8 | m_xh << 4 | m_xl;
+ u16 address = m_xp << 8 | m_xh << 4 | m_xl;
return m_data->read_byte(address) & 0xf;
}
-uint8_t e0c6200_cpu_device::read_my()
+u8 e0c6200_cpu_device::read_my()
{
- uint16_t address = m_yp << 8 | m_yh << 4 | m_yl;
+ u16 address = m_yp << 8 | m_yh << 4 | m_yl;
return m_data->read_byte(address) & 0xf;
}
-void e0c6200_cpu_device::write_mx(uint8_t data)
+void e0c6200_cpu_device::write_mx(u8 data)
{
- uint16_t address = m_xp << 8 | m_xh << 4 | m_xl;
+ u16 address = m_xp << 8 | m_xh << 4 | m_xl;
m_data->write_byte(address, data);
}
-void e0c6200_cpu_device::write_my(uint8_t data)
+void e0c6200_cpu_device::write_my(u8 data)
{
- uint16_t address = m_yp << 8 | m_yh << 4 | m_yl;
+ u16 address = m_yp << 8 | m_yh << 4 | m_yl;
m_data->write_byte(address, data);
}
// Mn(RP)
-uint8_t e0c6200_cpu_device::read_mn()
+u8 e0c6200_cpu_device::read_mn()
{
return m_data->read_byte(m_op & 0xf) & 0xf;
}
-void e0c6200_cpu_device::write_mn(uint8_t data)
+void e0c6200_cpu_device::write_mn(u8 data)
{
m_data->write_byte(m_op & 0xf, data);
}
@@ -49,12 +49,12 @@ void e0c6200_cpu_device::write_mn(uint8_t data)
// common stack ops
-void e0c6200_cpu_device::push(uint8_t data)
+void e0c6200_cpu_device::push(u8 data)
{
m_data->write_byte(--m_sp, data);
}
-uint8_t e0c6200_cpu_device::pop()
+u8 e0c6200_cpu_device::pop()
{
return m_data->read_byte(m_sp++) & 0xf;
}
@@ -70,7 +70,7 @@ void e0c6200_cpu_device::push_pc()
void e0c6200_cpu_device::pop_pc()
{
// the highest bit(bank bit) is unchanged
- uint16_t bank = m_pc & 0x1000;
+ u16 bank = m_pc & 0x1000;
m_pc = pop();
m_pc |= pop() << 4;
m_pc |= pop() << 8;
@@ -80,13 +80,13 @@ void e0c6200_cpu_device::pop_pc()
// misc internal helpers
-void e0c6200_cpu_device::set_cf(uint8_t data)
+void e0c6200_cpu_device::set_cf(u8 data)
{
// set carry flag if bit 4 is set, reset otherwise
m_f = (m_f & ~C_FLAG) | ((data & 0x10) ? C_FLAG : 0);
}
-void e0c6200_cpu_device::set_zf(uint8_t data)
+void e0c6200_cpu_device::set_zf(u8 data)
{
// set zero flag if 4-bit data is 0, reset otherwise
m_f = (m_f & ~Z_FLAG) | ((data & 0xf) ? 0 : Z_FLAG);
@@ -121,7 +121,7 @@ void e0c6200_cpu_device::do_branch(int condition)
// arithmetic instructions
-uint8_t e0c6200_cpu_device::op_inc(uint8_t x)
+u8 e0c6200_cpu_device::op_inc(u8 x)
{
// INC x: increment x (flags: C, Z)
m_icount -= 2;
@@ -130,7 +130,7 @@ uint8_t e0c6200_cpu_device::op_inc(uint8_t x)
return x & 0xf;
}
-uint8_t e0c6200_cpu_device::op_dec(uint8_t x)
+u8 e0c6200_cpu_device::op_dec(u8 x)
{
// DEC x: decrement x (flags: C, Z)
m_icount -= 2;
@@ -139,7 +139,7 @@ uint8_t e0c6200_cpu_device::op_dec(uint8_t x)
return x & 0xf;
}
-uint8_t e0c6200_cpu_device::op_add(uint8_t x, uint8_t y, int decimal)
+u8 e0c6200_cpu_device::op_add(u8 x, u8 y, int decimal)
{
// ADD x,y: add y to x (flags: C, Z)
m_icount -= 2;
@@ -157,13 +157,13 @@ uint8_t e0c6200_cpu_device::op_add(uint8_t x, uint8_t y, int decimal)
return x & 0xf;
}
-uint8_t e0c6200_cpu_device::op_adc(uint8_t x, uint8_t y, int decimal)
+u8 e0c6200_cpu_device::op_adc(u8 x, u8 y, int decimal)
{
// ADC x,y: add with carry y to x (flags: C, Z)
return op_add(x, y + (m_f & 1), decimal);
}
-uint8_t e0c6200_cpu_device::op_sub(uint8_t x, uint8_t y, int decimal)
+u8 e0c6200_cpu_device::op_sub(u8 x, u8 y, int decimal)
{
// SUB x,y: subtract y from x (flags: C, Z)
m_icount -= 2;
@@ -178,7 +178,7 @@ uint8_t e0c6200_cpu_device::op_sub(uint8_t x, uint8_t y, int decimal)
return x & 0xf;
}
-uint8_t e0c6200_cpu_device::op_sbc(uint8_t x, uint8_t y, int decimal)
+u8 e0c6200_cpu_device::op_sbc(u8 x, u8 y, int decimal)
{
// SBC x,y: subtract with carry y from x (flags: C, Z)
return op_sub(x, y + (m_f & 1), decimal);
@@ -187,7 +187,7 @@ uint8_t e0c6200_cpu_device::op_sbc(uint8_t x, uint8_t y, int decimal)
// logical instructions
-uint8_t e0c6200_cpu_device::op_and(uint8_t x, uint8_t y)
+u8 e0c6200_cpu_device::op_and(u8 x, u8 y)
{
// AND x,y: logical AND x with y (flags: Z)
m_icount -= 2;
@@ -196,7 +196,7 @@ uint8_t e0c6200_cpu_device::op_and(uint8_t x, uint8_t y)
return x;
}
-uint8_t e0c6200_cpu_device::op_or(uint8_t x, uint8_t y)
+u8 e0c6200_cpu_device::op_or(u8 x, u8 y)
{
// OR x,y: logical OR x with y (flags: Z)
m_icount -= 2;
@@ -205,7 +205,7 @@ uint8_t e0c6200_cpu_device::op_or(uint8_t x, uint8_t y)
return x;
}
-uint8_t e0c6200_cpu_device::op_xor(uint8_t x, uint8_t y)
+u8 e0c6200_cpu_device::op_xor(u8 x, u8 y)
{
// XOR x,y: exclusive-OR x with y (flags: Z)
m_icount -= 2;
@@ -214,7 +214,7 @@ uint8_t e0c6200_cpu_device::op_xor(uint8_t x, uint8_t y)
return x;
}
-uint8_t e0c6200_cpu_device::op_rlc(uint8_t x)
+u8 e0c6200_cpu_device::op_rlc(u8 x)
{
// RLC x: rotate x left through carry (flags: C, Z)
m_icount -= 2;
@@ -223,7 +223,7 @@ uint8_t e0c6200_cpu_device::op_rlc(uint8_t x)
return x & 0xf;
}
-uint8_t e0c6200_cpu_device::op_rrc(uint8_t x)
+u8 e0c6200_cpu_device::op_rrc(u8 x)
{
// RRC x: rotate x right through carry (flags: C, Z)
// note: RRC only takes 5 clock cycles
diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp
index 4feed3f4e32..49a754adf33 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.cpp
+++ b/src/devices/cpu/e0c6200/e0c6s46.cpp
@@ -45,7 +45,7 @@ ADDRESS_MAP_END
// device definitions
-e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: e0c6200_cpu_device(mconfig, E0C6S46, "E0C6S46", tag, owner, clock, ADDRESS_MAP_NAME(e0c6s46_program), ADDRESS_MAP_NAME(e0c6s46_data), "e0c6s46", __FILE__)
, m_vram1(*this, "vram1")
, m_vram2(*this, "vram2"), m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0)
@@ -279,7 +279,7 @@ void e0c6s46_device::execute_set_input(int line, int state)
state = (state) ? 1 : 0;
int port = line >> 2 & 1;
- uint8_t bit = 1 << (line & 3);
+ u8 bit = 1 << (line & 3);
m_port_k[port] = (m_port_k[port] & ~bit) | (state ? bit : 0);
}
@@ -292,13 +292,13 @@ void e0c6s46_device::execute_set_input(int line, int state)
// R output ports
-void e0c6s46_device::write_r(uint8_t port, uint8_t data)
+void e0c6s46_device::write_r(u8 port, u8 data)
{
data &= 0xf;
m_port_r[port] = data;
// ports R0x-R3x can be high-impedance
- uint8_t out = data;
+ u8 out = data;
if (port < 4 && !(m_r_dir >> port & 1))
out = 0xf;
@@ -327,14 +327,14 @@ void e0c6s46_device::write_r4_out()
// R40: _FOUT(clock inverted output)
// R42: FOUT or _BZ
// R43: BZ(buzzer)
- uint8_t out = (m_port_r[4] & 2) | (m_bz_pulse << 3) | (m_bz_pulse << 2 ^ 4);
+ u8 out = (m_port_r[4] & 2) | (m_bz_pulse << 3) | (m_bz_pulse << 2 ^ 4);
m_write_r4(4, out, 0xff);
}
// P I/O ports
-void e0c6s46_device::write_p(uint8_t port, uint8_t data)
+void e0c6s46_device::write_p(u8 port, u8 data)
{
data &= 0xf;
m_port_p[port] = data;
@@ -352,7 +352,7 @@ void e0c6s46_device::write_p(uint8_t port, uint8_t data)
}
}
-uint8_t e0c6s46_device::read_p(uint8_t port)
+u8 e0c6s46_device::read_p(u8 port)
{
// return written value if port direction is set to output
if (m_p_dir >> port & 1)
@@ -416,7 +416,7 @@ void e0c6s46_device::clock_clktimer()
m_clktimer_count++;
// irq on falling edge of 32, 8, 2, 1hz
- uint8_t flag = 0;
+ u8 flag = 0;
if ((m_clktimer_count & 0x07) == 0)
flag |= 1;
if ((m_clktimer_count & 0x1f) == 0)
@@ -488,7 +488,7 @@ void e0c6s46_device::clock_prgtimer()
bool e0c6s46_device::prgtimer_reset_prescaler()
{
// only 2 to 7 are clock dividers
- uint8_t sel = m_prgtimer_select & 7;
+ u8 sel = m_prgtimer_select & 7;
if (sel >= 2)
m_prgtimer_handle->adjust(attotime::from_ticks(2 << (sel ^ 7), unscaled_clock()));
@@ -572,12 +572,12 @@ void e0c6s46_device::clock_bz_1shot()
// LCD Driver
//-------------------------------------------------
-uint32_t e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+u32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// call this 32 times per second (osc1/1024: 32hz at default clock of 32768hz)
for (int bank = 0; bank < 2; bank++)
{
- const uint8_t* vram = bank ? m_vram2 : m_vram1;
+ const u8* vram = bank ? m_vram2 : m_vram1;
// determine operating mode
bool lcd_on = false;
@@ -626,7 +626,7 @@ READ8_MEMBER(e0c6s46_device::io_r)
case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05:
{
// irq flags are reset(acked) when read
- uint8_t flag = m_irqflag[offset];
+ u8 flag = m_irqflag[offset];
if (!space.debugger_access())
m_irqflag[offset] = 0;
return flag;
@@ -719,7 +719,7 @@ WRITE8_MEMBER(e0c6s46_device::io_w)
// irq masks
case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15:
{
- static const uint8_t maskmask[6] = { 0xf, 3, 1, 1, 0xf, 0xf };
+ static const u8 maskmask[6] = { 0xf, 3, 1, 1, 0xf, 0xf };
m_irqmask[offset-0x10] = data & maskmask[offset-0x10];
m_possible_irq = true;
break;
diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h
index 0d3ad7c250c..53de2dab486 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.h
+++ b/src/devices/cpu/e0c6200/e0c6s46.h
@@ -66,7 +66,7 @@ typedef void (*e0c6s46_pixel_update_func)(device_t &device, bitmap_ind16 &bitmap
class e0c6s46_device : public e0c6200_cpu_device
{
public:
- e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// static configuration helpers
template<class _Object> static devcb_base &set_write_r0_callback(device_t &device, _Object object) { return downcast<e0c6s46_device &>(device).m_write_r0.set_callback(object); }
@@ -89,7 +89,7 @@ public:
DECLARE_READ8_MEMBER(io_r);
DECLARE_WRITE8_MEMBER(io_w);
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
// device-level overrides
@@ -97,40 +97,40 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint32_t execute_input_lines() const override { return 8; }
+ virtual u32 execute_input_lines() const override { return 8; }
virtual void execute_set_input(int line, int state) override;
virtual void execute_one() override;
virtual bool check_interrupt() override;
private:
- required_shared_ptr<uint8_t> m_vram1;
- required_shared_ptr<uint8_t> m_vram2;
+ required_shared_ptr<u8> m_vram1;
+ required_shared_ptr<u8> m_vram2;
- uint8_t m_irqflag[6];
- uint8_t m_irqmask[6];
- uint8_t m_osc;
- uint8_t m_svd;
+ u8 m_irqflag[6];
+ u8 m_irqmask[6];
+ u8 m_osc;
+ u8 m_svd;
- uint8_t m_lcd_control;
- uint8_t m_lcd_contrast;
+ u8 m_lcd_control;
+ u8 m_lcd_contrast;
e0c6s46_pixel_update_func m_pixel_update_handler;
// i/o ports
devcb_write8 m_write_r0, m_write_r1, m_write_r2, m_write_r3, m_write_r4;
devcb_read8 m_read_p0, m_read_p1, m_read_p2, m_read_p3;
devcb_write8 m_write_p0, m_write_p1, m_write_p2, m_write_p3;
- void write_r(uint8_t port, uint8_t data);
+ void write_r(u8 port, u8 data);
void write_r4_out();
- void write_p(uint8_t port, uint8_t data);
- uint8_t read_p(uint8_t port);
+ void write_p(u8 port, u8 data);
+ u8 read_p(u8 port);
- uint8_t m_port_r[5];
- uint8_t m_r_dir;
- uint8_t m_port_p[4];
- uint8_t m_p_dir;
- uint8_t m_p_pullup;
- uint8_t m_port_k[2];
- uint8_t m_dfk0;
+ u8 m_port_r[5];
+ u8 m_r_dir;
+ u8 m_port_p[4];
+ u8 m_p_dir;
+ u8 m_p_pullup;
+ u8 m_port_k[2];
+ u8 m_dfk0;
// timers
int m_256_src_pulse;
@@ -139,34 +139,34 @@ private:
int m_watchdog_count;
void clock_watchdog();
- uint8_t m_clktimer_count;
+ u8 m_clktimer_count;
void clock_clktimer();
- uint8_t m_stopwatch_on;
+ u8 m_stopwatch_on;
int m_swl_cur_pulse;
int m_swl_slice;
int m_swl_count;
int m_swh_count;
void clock_stopwatch();
- uint8_t m_prgtimer_select;
- uint8_t m_prgtimer_on;
+ u8 m_prgtimer_select;
+ u8 m_prgtimer_on;
int m_prgtimer_src_pulse;
int m_prgtimer_cur_pulse;
- uint8_t m_prgtimer_count;
- uint8_t m_prgtimer_reload;
+ u8 m_prgtimer_count;
+ u8 m_prgtimer_reload;
emu_timer *m_prgtimer_handle;
TIMER_CALLBACK_MEMBER(prgtimer_cb);
bool prgtimer_reset_prescaler();
void clock_prgtimer();
- uint8_t m_bz_43_on;
- uint8_t m_bz_freq;
- uint8_t m_bz_envelope;
- uint8_t m_bz_duty_ratio;
- uint8_t m_bz_1shot_on;
+ u8 m_bz_43_on;
+ u8 m_bz_freq;
+ u8 m_bz_envelope;
+ u8 m_bz_duty_ratio;
+ u8 m_bz_1shot_on;
bool m_bz_1shot_running;
- uint8_t m_bz_1shot_count;
+ u8 m_bz_1shot_count;
int m_bz_pulse;
emu_timer *m_buzzer_handle;
TIMER_CALLBACK_MEMBER(buzzer_cb);
diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp
index a15b7cc907c..fcc61b40fe7 100644
--- a/src/devices/cpu/hmcs40/hmcs40.cpp
+++ b/src/devices/cpu/hmcs40/hmcs40.cpp
@@ -78,56 +78,56 @@ ADDRESS_MAP_END
// device definitions
-hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname)
+hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname)
: hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS43, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1k), 7 /* data width */, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__)
{ }
-hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs43_cpu_device(mconfig, HD38750, "HD38750", tag, owner, clock, IS_PMOS, "hd38750")
{ }
-hd38755_device::hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38755_device::hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs43_cpu_device(mconfig, HD38755, "HD38755", tag, owner, clock, IS_PMOS, "hd38755")
{ }
-hd44750_device::hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44750_device::hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs43_cpu_device(mconfig, HD44750, "HD44750", tag, owner, clock, IS_CMOS, "hd44750")
{ }
-hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs43_cpu_device(mconfig, HD44758, "HD44758", tag, owner, clock, IS_CMOS, "hd44758")
{ }
-hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname)
+hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname)
: hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS44, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
{ }
-hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs44_cpu_device(mconfig, HD38800, "HD38800", tag, owner, clock, IS_PMOS, "hd38800")
{ }
-hd38805_device::hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38805_device::hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs44_cpu_device(mconfig, HD38805, "HD38805", tag, owner, clock, IS_PMOS, "hd38805")
{ }
-hd44801_device::hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44801_device::hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs44_cpu_device(mconfig, HD44801, "HD44801", tag, owner, clock, IS_CMOS, "hd44801")
{ }
-hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs44_cpu_device(mconfig, HD44808, "HD44808", tag, owner, clock, IS_CMOS, "hd44808")
{ }
-hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname)
+hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname)
: hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS45, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
{ }
-hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs45_cpu_device(mconfig, HD38820, "HD38820", tag, owner, clock, IS_PMOS, "hd38820")
{ }
-hd38825_device::hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd38825_device::hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs45_cpu_device(mconfig, HD38825, "HD38825", tag, owner, clock, IS_PMOS, "hd38825")
{ }
-hd44820_device::hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44820_device::hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs45_cpu_device(mconfig, HD44820, "HD44820", tag, owner, clock, IS_CMOS, "hd44820")
{ }
-hd44828_device::hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+hd44828_device::hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: hmcs45_cpu_device(mconfig, HD44828, "HD44828", tag, owner, clock, IS_CMOS, "hd44828")
{ }
@@ -148,7 +148,7 @@ void hmcs40_cpu_device::state_string_export(const device_state_entry &entry, std
}
}
-offs_t hmcs40_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t hmcs40_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(hmcs40);
return CPU_DISASSEMBLE_NAME(hmcs40)(this, stream, pc, oprom, opram, options);
@@ -306,10 +306,10 @@ void hmcs40_cpu_device::device_reset()
// i/o handling
//-------------------------------------------------
-uint8_t hmcs40_cpu_device::read_r(int index)
+u8 hmcs40_cpu_device::read_r(int index)
{
index &= 7;
- uint8_t inp = 0;
+ u8 inp = 0;
switch (index)
{
@@ -329,7 +329,7 @@ uint8_t hmcs40_cpu_device::read_r(int index)
return (inp | m_r[index]) & 0xf;
}
-void hmcs40_cpu_device::write_r(int index, uint8_t data)
+void hmcs40_cpu_device::write_r(int index, u8 data)
{
index &= 7;
data &= 0xf;
@@ -371,7 +371,7 @@ void hmcs40_cpu_device::write_d(int index, int state)
// R0 is input-only, R1 is i/o, R2,R3 are output-only, no R4-R7
// D0-D3 are i/o, D4-D15 are output-only
-uint8_t hmcs43_cpu_device::read_r(int index)
+u8 hmcs43_cpu_device::read_r(int index)
{
index &= 7;
@@ -381,7 +381,7 @@ uint8_t hmcs43_cpu_device::read_r(int index)
return hmcs40_cpu_device::read_r(index);
}
-void hmcs43_cpu_device::write_r(int index, uint8_t data)
+void hmcs43_cpu_device::write_r(int index, u8 data)
{
index &= 7;
@@ -405,7 +405,7 @@ int hmcs43_cpu_device::read_d(int index)
// R0-R3 are i/o, R4,R5 are extra registers, no R6,R7
// D0-D15 are i/o
-uint8_t hmcs44_cpu_device::read_r(int index)
+u8 hmcs44_cpu_device::read_r(int index)
{
index &= 7;
@@ -415,7 +415,7 @@ uint8_t hmcs44_cpu_device::read_r(int index)
return hmcs40_cpu_device::read_r(index);
}
-void hmcs44_cpu_device::write_r(int index, uint8_t data)
+void hmcs44_cpu_device::write_r(int index, u8 data)
{
index &= 7;
@@ -429,7 +429,7 @@ void hmcs44_cpu_device::write_r(int index, uint8_t data)
// R0-R5 are i/o, R6 is output-only, no R7
// D0-D15 are i/o
-uint8_t hmcs45_cpu_device::read_r(int index)
+u8 hmcs45_cpu_device::read_r(int index)
{
index &= 7;
@@ -439,7 +439,7 @@ uint8_t hmcs45_cpu_device::read_r(int index)
return hmcs40_cpu_device::read_r(index);
}
-void hmcs45_cpu_device::write_r(int index, uint8_t data)
+void hmcs45_cpu_device::write_r(int index, u8 data)
{
index &= 7;
@@ -553,8 +553,8 @@ void hmcs40_cpu_device::increment_tc()
inline void hmcs40_cpu_device::increment_pc()
{
// PC lower bits is a LFSR identical to TI TMS1000
- uint8_t mask = 0x3f;
- uint8_t low = m_pc & mask;
+ u8 mask = 0x3f;
+ u8 low = m_pc & mask;
int fb = (low << 1 & 0x20) == (low & 0x20);
if (low == (mask >> 1))
diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h
index 38a6d20169d..43ea2035ad4 100644
--- a/src/devices/cpu/hmcs40/hmcs40.h
+++ b/src/devices/cpu/hmcs40/hmcs40.h
@@ -116,7 +116,7 @@ class hmcs40_cpu_device : public cpu_device
{
public:
// construction/destruction
- hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int family, uint16_t polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int family, u16 polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program)
, m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data)
@@ -160,11 +160,11 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // "
- virtual uint32_t execute_min_cycles() const override { return 1; }
- virtual uint32_t execute_max_cycles() const override { return 2; }
- virtual uint32_t execute_input_lines() const override { return 2+1; } // 3rd one is internal
+ virtual u64 execute_clocks_to_cycles(u64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
+ virtual u64 execute_cycles_to_clocks(u64 cycles) const override { return (cycles * 4); } // "
+ virtual u32 execute_min_cycles() const override { return 1; }
+ virtual u32 execute_max_cycles() const override { return 2; }
+ virtual u32 execute_input_lines() const override { return 2+1; } // 3rd one is internal
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
@@ -172,9 +172,9 @@ protected:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 2; }
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual u32 disasm_min_opcode_bytes() const override { return 2; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 2; }
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
address_space_config m_program_config;
@@ -182,46 +182,46 @@ protected:
address_space *m_program;
address_space *m_data;
- int m_pcwidth; // Program Counter bit-width
+ int m_pcwidth; // Program Counter bit-width
int m_prgwidth;
int m_datawidth;
int m_pcmask;
int m_prgmask;
int m_datamask;
- int m_family; // MCU family (42-47)
- uint16_t m_polarity; // i/o polarity (pmos vs cmos)
- int m_stack_levels; // number of callstack levels
- uint16_t m_stack[4]; // max 4
- uint16_t m_op; // current opcode
- uint16_t m_prev_op;
- uint8_t m_i; // 4-bit immediate opcode param
- int m_eint_line; // which input_line caused an interrupt
+ int m_family; // MCU family (42-47)
+ u16 m_polarity; // i/o polarity (pmos vs cmos)
+ int m_stack_levels; // number of callstack levels
+ u16 m_stack[4]; // max 4
+ u16 m_op; // current opcode
+ u16 m_prev_op;
+ u8 m_i; // 4-bit immediate opcode param
+ int m_eint_line; // which input_line caused an interrupt
emu_timer *m_timer;
- int m_halt; // internal HLT state
+ int m_halt; // internal HLT state
attotime m_timer_halted_remain;
int m_icount;
- uint16_t m_pc; // Program Counter
- uint16_t m_prev_pc;
- uint8_t m_page; // LPU prepared page
- uint8_t m_a; // 4-bit Accumulator
- uint8_t m_b; // 4-bit B register
- uint8_t m_x; // 1/3/4-bit X register
- uint8_t m_spx; // 1/3/4-bit SPX register
- uint8_t m_y; // 4-bit Y register
- uint8_t m_spy; // 4-bit SPY register
- uint8_t m_s; // Status F/F (F/F = flip-flop)
- uint8_t m_c; // Carry F/F
- uint8_t m_tc; // Timer/Counter
- uint8_t m_cf; // CF F/F (timer mode or counter mode)
- uint8_t m_ie; // I/E(Interrupt Enable) F/F
- uint8_t m_iri; // external interrupt pending I/RI F/F
- uint8_t m_irt; // timer interrupt pending I/RT F/F
- uint8_t m_if[2]; // external interrupt mask IF0,1 F/F
- uint8_t m_tf; // timer interrupt mask TF F/F
- uint8_t m_int[2]; // INT0/1 pins state
- uint8_t m_r[8]; // R outputs state
- uint16_t m_d; // D pins state
+ u16 m_pc; // Program Counter
+ u16 m_prev_pc;
+ u8 m_page; // LPU prepared page
+ u8 m_a; // 4-bit Accumulator
+ u8 m_b; // 4-bit B register
+ u8 m_x; // 1/3/4-bit X register
+ u8 m_spx; // 1/3/4-bit SPX register
+ u8 m_y; // 4-bit Y register
+ u8 m_spy; // 4-bit SPY register
+ u8 m_s; // Status F/F (F/F = flip-flop)
+ u8 m_c; // Carry F/F
+ u8 m_tc; // Timer/Counter
+ u8 m_cf; // CF F/F (timer mode or counter mode)
+ u8 m_ie; // I/E(Interrupt Enable) F/F
+ u8 m_iri; // external interrupt pending I/RI F/F
+ u8 m_irt; // timer interrupt pending I/RT F/F
+ u8 m_if[2]; // external interrupt mask IF0,1 F/F
+ u8 m_tf; // timer interrupt mask TF F/F
+ u8 m_int[2]; // INT0/1 pins state
+ u8 m_r[8]; // R outputs state
+ u16 m_d; // D pins state
// i/o handlers
devcb_read8 m_read_r0, m_read_r1, m_read_r2, m_read_r3, m_read_r4, m_read_r5, m_read_r6, m_read_r7;
@@ -232,13 +232,13 @@ protected:
// misc internal helpers
void increment_pc();
- uint8_t ram_r();
- void ram_w(uint8_t data);
+ u8 ram_r();
+ void ram_w(u8 data);
void pop_stack();
void push_stack();
- virtual uint8_t read_r(int index);
- virtual void write_r(int index, uint8_t data);
+ virtual u8 read_r(int index);
+ virtual void write_r(int index, u8 data);
virtual int read_d(int index);
virtual void write_d(int index, int state);
@@ -349,109 +349,109 @@ protected:
class hmcs43_cpu_device : public hmcs40_cpu_device
{
public:
- hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname);
+ hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname);
protected:
// overrides
- virtual uint8_t read_r(int index) override;
- virtual void write_r(int index, uint8_t data) override;
+ virtual u8 read_r(int index) override;
+ virtual void write_r(int index, u8 data) override;
virtual int read_d(int index) override;
};
class hd38750_device : public hmcs43_cpu_device
{
public:
- hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd38755_device : public hmcs43_cpu_device
{
public:
- hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44750_device : public hmcs43_cpu_device
{
public:
- hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44758_device : public hmcs43_cpu_device
{
public:
- hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hmcs44_cpu_device : public hmcs40_cpu_device
{
public:
- hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname);
+ hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname);
protected:
// overrides
- virtual uint8_t read_r(int index) override;
- virtual void write_r(int index, uint8_t data) override;
+ virtual u8 read_r(int index) override;
+ virtual void write_r(int index, u8 data) override;
};
class hd38800_device : public hmcs44_cpu_device
{
public:
- hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd38805_device : public hmcs44_cpu_device
{
public:
- hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44801_device : public hmcs44_cpu_device
{
public:
- hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44808_device : public hmcs44_cpu_device
{
public:
- hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hmcs45_cpu_device : public hmcs40_cpu_device
{
public:
- hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname);
+ hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u16 polarity, const char *shortname);
protected:
// overrides
- virtual uint8_t read_r(int index) override;
- virtual void write_r(int index, uint8_t data) override;
+ virtual u8 read_r(int index) override;
+ virtual void write_r(int index, u8 data) override;
};
class hd38820_device : public hmcs45_cpu_device
{
public:
- hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd38825_device : public hmcs45_cpu_device
{
public:
- hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44820_device : public hmcs45_cpu_device
{
public:
- hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class hd44828_device : public hmcs45_cpu_device
{
public:
- hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/hmcs40/hmcs40d.cpp b/src/devices/cpu/hmcs40/hmcs40d.cpp
index 867972d82db..0b05d8b3f76 100644
--- a/src/devices/cpu/hmcs40/hmcs40d.cpp
+++ b/src/devices/cpu/hmcs40/hmcs40d.cpp
@@ -46,7 +46,7 @@ static const char *const s_mnemonics[] =
};
// number of bits per opcode parameter, 99 means (XY) parameter, negative means reversed bit-order
-static const int8_t s_bits[] =
+static const s8 s_bits[] =
{
0,
0, 0, 0, 0, 0, 4,
@@ -65,7 +65,7 @@ static const int8_t s_bits[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t s_flags[] =
+static const u32 s_flags[] =
{
0,
0, 0, 0, 0, 0, 0,
@@ -82,7 +82,7 @@ static const uint32_t s_flags[] =
};
// next program counter in sequence (relative)
-static const int8_t s_next_pc[0x40] =
+static const s8 s_next_pc[0x40] =
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32+0x40 /* rollback */,
@@ -91,7 +91,7 @@ static const int8_t s_next_pc[0x40] =
};
-static const uint8_t hmcs40_mnemonic[0x400] =
+static const u8 hmcs40_mnemonic[0x400] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/* 0x000 */
@@ -186,9 +186,9 @@ static const uint8_t hmcs40_mnemonic[0x400] =
CPU_DISASSEMBLE(hmcs40)
{
- uint16_t op = (oprom[0] | oprom[1] << 8) & 0x3ff;
- uint8_t instr = hmcs40_mnemonic[op];
- int8_t bits = s_bits[instr];
+ u16 op = (oprom[0] | oprom[1] << 8) & 0x3ff;
+ u8 instr = hmcs40_mnemonic[op];
+ s8 bits = s_bits[instr];
// special case for (XY) opcode
if (bits == 99)
@@ -207,7 +207,7 @@ CPU_DISASSEMBLE(hmcs40)
// opcode parameter
if (bits != 0)
{
- uint8_t param = op;
+ u8 param = op;
// reverse bits
if (bits < 0)
diff --git a/src/devices/cpu/hmcs40/hmcs40op.cpp b/src/devices/cpu/hmcs40/hmcs40op.cpp
index 31a74d76905..da89ff44fe7 100644
--- a/src/devices/cpu/hmcs40/hmcs40op.cpp
+++ b/src/devices/cpu/hmcs40/hmcs40op.cpp
@@ -8,15 +8,15 @@
// internal helpers
-inline uint8_t hmcs40_cpu_device::ram_r()
+inline u8 hmcs40_cpu_device::ram_r()
{
- uint8_t address = (m_x << 4 | m_y) & m_datamask;
+ u8 address = (m_x << 4 | m_y) & m_datamask;
return m_data->read_byte(address) & 0xf;
}
-inline void hmcs40_cpu_device::ram_w(uint8_t data)
+inline void hmcs40_cpu_device::ram_w(u8 data)
{
- uint8_t address = (m_x << 4 | m_y) & m_datamask;
+ u8 address = (m_x << 4 | m_y) & m_datamask;
m_data->write_byte(address, data & 0xf);
}
@@ -81,7 +81,7 @@ void hmcs40_cpu_device::op_xamr()
// XAMR m: Exchange A and MR(m)
// determine MR(Memory Register) location
- uint8_t address = m_op & 0xf;
+ u8 address = m_op & 0xf;
// HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3)
// HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4
@@ -93,7 +93,7 @@ void hmcs40_cpu_device::op_xamr()
address |= 0xf0;
address &= m_datamask;
- uint8_t old_a = m_a;
+ u8 old_a = m_a;
m_a = m_data->read_byte(address) & 0xf;
m_data->write_byte(address, old_a & 0xf);
}
@@ -160,13 +160,13 @@ void hmcs40_cpu_device::op_xsp()
// XSP (XY): Exchange X and SPX, Y and SPY, or NOP if 0
if (m_op & 1)
{
- uint8_t old_x = m_x;
+ u8 old_x = m_x;
m_x = m_spx;
m_spx = old_x;
}
if (m_op & 2)
{
- uint8_t old_y = m_y;
+ u8 old_y = m_y;
m_y = m_spy;
m_spy = old_y;
}
@@ -192,7 +192,7 @@ void hmcs40_cpu_device::op_lbm()
void hmcs40_cpu_device::op_xma()
{
// XMA (XY): Exchange Memory and A
- uint8_t old_a = m_a;
+ u8 old_a = m_a;
m_a = ram_r();
ram_w(old_a);
op_xsp();
@@ -201,7 +201,7 @@ void hmcs40_cpu_device::op_xma()
void hmcs40_cpu_device::op_xmb()
{
// XMB (XY): Exchange Memory and B
- uint8_t old_b = m_b;
+ u8 old_b = m_b;
m_b = ram_r();
ram_w(old_b);
op_xsp();
@@ -357,7 +357,7 @@ void hmcs40_cpu_device::op_rotl()
void hmcs40_cpu_device::op_rotr()
{
// ROTR: Rotate Right A with Carry
- uint8_t c = m_a & 1;
+ u8 c = m_a & 1;
m_a = m_a >> 1 | m_c << 3;
m_c = c;
}
@@ -470,7 +470,7 @@ void hmcs40_cpu_device::op_lpu()
void hmcs40_cpu_device::op_tbr()
{
// TBR p: Table Branch
- uint16_t address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f);
+ u16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f);
m_pc = address & m_pcmask;
}
@@ -661,8 +661,8 @@ void hmcs40_cpu_device::op_p()
{
// P p: Pattern Generation
m_icount--;
- uint16_t address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f);
- uint16_t o = m_program->read_word((address & m_prgmask) << 1);
+ u16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f);
+ u16 o = m_program->read_word((address & m_prgmask) << 1);
// destination is determined by the 2 highest bits
if (o & 0x100)
diff --git a/src/devices/cpu/m6805/m6805.cpp b/src/devices/cpu/m6805/m6805.cpp
index fbd99f7e82f..bc1844f5bbf 100644
--- a/src/devices/cpu/m6805/m6805.cpp
+++ b/src/devices/cpu/m6805/m6805.cpp
@@ -235,6 +235,7 @@ void m6805_base_device::interrupt()
m_pending_interrupts &= ~(1 << HD63705_INT_NMI);
m_icount -= 11;
+ burn_cycles(11);
}
else if((m_pending_interrupts & ((1 << M6805_IRQ_LINE) | HD63705_INT_MASK)) != 0)
{
@@ -254,6 +255,7 @@ void m6805_base_device::interrupt()
m_pending_interrupts &= ~(1 << M6805_IRQ_LINE);
}
m_icount -= 11;
+ burn_cycles(11);
}
}
@@ -498,9 +500,9 @@ void m6805_base_device::execute_run()
debugger_instruction_hook(this, PC);
- ireg=M_RDOP(PC++);
+ ireg = M_RDOP(PC++);
- switch( ireg )
+ switch (ireg)
{
case 0x00: brset(0x01); break;
case 0x01: brclr(0x01); break;
@@ -764,7 +766,9 @@ void m6805_base_device::execute_run()
case 0xff: stx_ix(); break;
}
m_icount -= m_cycles1[ireg];
- } while( m_icount > 0 );
+ burn_cycles(m_cycles1[ireg]);
+ }
+ while (m_icount > 0);
}
/****************************************************************************
diff --git a/src/devices/cpu/m6805/m6805.h b/src/devices/cpu/m6805/m6805.h
index 6a65920c6d9..5d0dfede083 100644
--- a/src/devices/cpu/m6805/m6805.h
+++ b/src/devices/cpu/m6805/m6805.h
@@ -52,6 +52,9 @@ protected:
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
+ // for devices with timing-sensitive peripherals
+ virtual void burn_cycles(unsigned count) { }
+
private:
// opcode/condition tables
static const uint8_t m_flags8i[256];
diff --git a/src/devices/cpu/m6805/m68705.cpp b/src/devices/cpu/m6805/m68705.cpp
index 3e273102442..b678954e386 100644
--- a/src/devices/cpu/m6805/m68705.cpp
+++ b/src/devices/cpu/m6805/m68705.cpp
@@ -244,6 +244,9 @@ m68705_new_device::m68705_new_device(
, m_port_ddr{ 0x00, 0x00, 0x00, 0x00 }
, m_port_cb_r{ { *this }, { *this }, { *this }, { *this } }
, m_port_cb_w{ { *this }, { *this }, { *this }, { *this } }
+ , m_prescaler(0x7f)
+ , m_tdr(0xff)
+ , m_tcr(0x7f)
, m_vihtp(CLEAR_LINE)
, m_pcr(0xff)
, m_pl_data(0xff)
@@ -254,15 +257,15 @@ m68705_new_device::m68705_new_device(
template <offs_t B> READ8_MEMBER(m68705_new_device::eprom_r)
{
// read locked out when /VPON and /PLE are asserted
- return (BIT(m_pcr, 2) || BIT(m_pcr, 0)) ? m_user_rom[B + offset] : 0xff;
+ return (!pcr_vpon() || !pcr_ple()) ? m_user_rom[B + offset] : 0xff;
}
template <offs_t B> WRITE8_MEMBER(m68705_new_device::eprom_w)
{
// programming latch enabled when /VPON and /PLE are asserted
- if (!BIT(m_pcr, 2) && !BIT(m_pcr, 0))
+ if (pcr_vpon() && pcr_ple())
{
- if (BIT(m_pcr, 1))
+ if (!pcr_pge())
{
m_pl_data = data;
m_pl_addr = B + offset;
@@ -317,6 +320,65 @@ template <std::size_t N> void m68705_new_device::port_cb_w()
m_port_cb_w[N](space(AS_PROGRAM), 0, data, mask);
}
+READ8_MEMBER(m68705_new_device::tdr_r)
+{
+ return m_tdr;
+}
+
+WRITE8_MEMBER(m68705_new_device::tdr_w)
+{
+ m_tdr = data;
+}
+
+READ8_MEMBER(m68705_new_device::tcr_r)
+{
+ // in MOR controlled mode, only TIR, TIM and TOPT are visible
+ return m_tcr | (tcr_topt() ? 0x37 : 0x00);
+}
+
+WRITE8_MEMBER(m68705_new_device::tcr_w)
+{
+ // 7 TIR RW Timer Interrupt Request Status
+ // 6 TIM RW Timer Interrupt Mask
+ // 5 TIN RW Timer Input Select
+ // 4 TIE RW Timer External Input Enable
+ // 3 TOPT R Timer Mask/Programmable Option
+ // 3 PSC W Prescaler Clear
+ // 2 PS2 RW Prescaler Option
+ // 1 PS1 RW Prescaler Option
+ // 0 PS0 RW Prescaler Option
+
+ // TIN TIE CLOCK
+ // 0 0 Internal Clock (phase 2)
+ // 0 1 Gated (AND) of External and Internal Clocks
+ // 1 0 No Clock
+ // 1 1 External Clock
+
+ // in MOR controlled mode, TIN/PS2/PS1/PS0 are loaded from MOR on reset and TIE is always 1
+ // in MOR controlled mode, TIN, TIE, PS2, PS1, and PS0 always read as 1
+
+ // TOPT isn't a real bit in this register, it's a pass-through to the MOR register
+ // it's theoretically possible to get into a weird state by writing to the MOR while running
+ // for simplicity, we don't emulate this - we just check the MOR on initialisation and reset
+
+ if (tcr_topt())
+ {
+ m_tcr = (m_tcr & 0x3f) | (data & 0xc0);
+ }
+ else
+ {
+ if (BIT(data, 3))
+ m_prescaler = 0;
+ m_tcr = (m_tcr & 0x08) | (data & 0xf7);
+ }
+
+ // TODO: this is tied up with /INT2 on R/U devices
+ if (tcr_tir() && !tcr_tim())
+ set_input_line(M68705_INT_TIMER, ASSERT_LINE);
+ else
+ set_input_line(M68705_INT_TIMER, CLEAR_LINE);
+}
+
READ8_MEMBER(m68705_new_device::misc_r)
{
logerror("unsupported read MISC\n");
@@ -348,7 +410,7 @@ WRITE8_MEMBER(m68705_new_device::pcr_w)
data |= ((data & 0x01) << 1);
// write EPROM if /PGE is asserted (erase requires UV so don't clear bits)
- if (!BIT(m_pcr, 2) && (0x20 & ((m_pcr ^ data) & ~data)))
+ if (pcr_vpon() && !pcr_pge() && !BIT(data, 1))
m_user_rom[m_pl_addr] |= m_pl_data;
m_pcr = (m_pcr & 0xfc) | (data & 0x03);
@@ -399,132 +461,62 @@ WRITE8_MEMBER(m68705_new_device::arr_w)
logerror("unsupported write ARR = %02X\n", data);
}
-READ8_MEMBER(m68705_new_device::internal_68705_tdr_r)
-{
- //logerror("internal_68705 TDR read, returning %02X\n", m_tdr);
- return m_tdr;
-}
-
-WRITE8_MEMBER(m68705_new_device::internal_68705_tdr_w)
-{
- //logerror("internal_68705 TDR written with %02X, was %02X\n", data, m_tdr);
- m_tdr = data;
-}
-
-
-READ8_MEMBER(m68705_new_device::internal_68705_tcr_r)
-{
- //logerror("internal_68705 TCR read, returning %02X\n", (m_tcr&0xF7));
- return (m_tcr & 0xF7);
-}
-
-WRITE8_MEMBER(m68705_new_device::internal_68705_tcr_w)
-{
-/*
- logerror("internal_68705 TCR written with %02X\n", data);
- if (data&0x80) logerror(" TIR=1, Timer Interrupt state is set\n"); else logerror(" TIR=0; Timer Interrupt state is cleared\n");
- if (data&0x40) logerror(" TIM=1, Timer Interrupt is now masked\n"); else logerror(" TIM=0, Timer Interrupt is now unmasked\n");
- if (data&0x20) logerror(" TIN=1, Timer Clock source is set to external\n"); else logerror(" TIN=0, Timer Clock source is set to internal\n");
- if (data&0x10) logerror(" TIE=1, Timer External pin is enabled\n"); else logerror(" TIE=0, Timer External pin is disabled\n");
- if (data&0x08) logerror(" PSC=1, Prescaler counter cleared\n"); else logerror(" PSC=0, Prescaler counter left alone\n");
- logerror(" Prescaler: %d\n", (1<<(data&0x7)));
-*/
- // if timer was enabled but now isn't, shut it off.
- // below is a hack assuming the TIMER pin isn't going anywhere except tied to +5v, so basically TIN is acting as an active-low timer enable, and TIE is ignored even in the case where TIE=1, the timer will end up being 5v ANDED against the internal timer clock which == the internal timer clock.
- // Note this hack is incorrect; the timer pin actually does connect somewhere (vblank or maybe one of the V counter bits?), but the game never actually uses the timer pin in external clock mode, so the TIMER connection must be left over from development. We can apparently safely ignore it.
- if ((m_tcr^data)&0x20)// check if TIN state changed
- {
- /* logerror("timer enable state changed!\n"); */
- if (data&0x20) m_68705_timer->adjust(attotime::never, TIMER_68705_PRESCALER_EXPIRED);
- else m_68705_timer->adjust(attotime::from_hz(((clock())/4)/(1<<(data&0x7))), TIMER_68705_PRESCALER_EXPIRED);
- }
- // prescaler check: if timer prescaler has changed, or the PSC bit is set, adjust the timer length for the prescaler expired timer, but only if the timer would be running
- if ( (((m_tcr&0x07)!=(data&0x07))||(data&0x08)) && ((data&0x20)==0) )
- {
- /* logerror("timer reset due to PSC or prescaler change!\n"); */
- m_68705_timer->adjust(attotime::from_hz(((clock())/4)/(1<<(data&0x7))), TIMER_68705_PRESCALER_EXPIRED);
- }
- m_tcr = data;
- // if int state is set, and TIM is unmasked, assert an interrupt. otherwise clear it.
- if ((m_tcr&0xC0) == 0x80)
- set_input_line(M68705_INT_TIMER, ASSERT_LINE);
- else
- set_input_line(M68705_INT_TIMER, CLEAR_LINE);
-
-}
-
-TIMER_CALLBACK_MEMBER(m68705_new_device::timer_68705_increment)
-{
- m_tdr++;
- if (m_tdr == 0x00) m_tcr |= 0x80; // if we overflowed, set the int bit
- if ((m_tcr&0xC0) == 0x80)
- set_input_line(M68705_INT_TIMER, ASSERT_LINE);
- else
- set_input_line(M68705_INT_TIMER, CLEAR_LINE);
- m_68705_timer->adjust(attotime::from_hz((clock() / 4) / (1 << (m_tcr & 0x07))), TIMER_68705_PRESCALER_EXPIRED);
-}
-
-void m68705_new_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (id)
- {
- case TIMER_68705_PRESCALER_EXPIRED:
- timer_68705_increment(ptr, param);
- break;
- default:
- m68705_device::device_timer(timer, id, param, ptr);
- }
-}
-
void m68705_new_device::device_start()
{
m68705_device::device_start();
- save_item(NAME(m_tdr));
- save_item(NAME(m_tcr));
-
save_item(NAME(m_port_input));
save_item(NAME(m_port_latch));
save_item(NAME(m_port_ddr));
+ save_item(NAME(m_prescaler));
+ save_item(NAME(m_tdr));
+ save_item(NAME(m_tcr));
+
save_item(NAME(m_vihtp));
save_item(NAME(m_pcr));
save_item(NAME(m_pl_data));
save_item(NAME(m_pl_addr));
+ // initialise digital I/O
for (u8 &input : m_port_input) input = 0xff;
for (devcb_read8 &cb : m_port_cb_r) cb.resolve();
for (devcb_write8 &cb : m_port_cb_w) cb.resolve_safe();
+ // initialise timer/counter
+ u8 const options(get_mask_options());
+ m_tcr = 0x40 | (options & 0x37);
+ if (BIT(options, 6))
+ m_tcr |= 0x18;
+
+ // initialise EPROM control
m_vihtp = CLEAR_LINE;
m_pcr = 0xff;
m_pl_data = 0xff;
m_pl_addr = 0xffff;
-
- // allocate the MCU timer, and set it to fire NEVER.
- m_68705_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68705_new_device::timer_68705_increment),this));
- m_68705_timer->adjust(attotime::never);
}
void m68705_new_device::device_reset()
{
m68705_device::device_reset();
- if (CLEAR_LINE != m_vihtp)
- RM16(0xfff6, &m_pc);
-
+ // reset digital I/O
port_ddr_w<0>(space(AS_PROGRAM), 0, 0x00, 0xff);
port_ddr_w<1>(space(AS_PROGRAM), 0, 0x00, 0xff);
port_ddr_w<2>(space(AS_PROGRAM), 0, 0x00, 0xff);
port_ddr_w<3>(space(AS_PROGRAM), 0, 0x00, 0xff);
- m_pcr |= 0xfb; // b2 (/VPON) is driven by external input and hence unaffected by reset
-
+ // reset timer/counter
+ u8 const options(get_mask_options());
+ m_prescaler = 0x7f;
m_tdr = 0xff;
- m_tcr = 0xff;
+ m_tcr = BIT(options, 6) ? (0x58 | (options & 0x27)) : (0x40 | (m_tcr & 0x37));
- //set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
- m_68705_timer->adjust(attotime::from_hz((clock() / 4) / (1 << 7)));
+ // reset EPROM control
+ m_pcr |= 0xfb; // b2 (/VPON) is driven by external input and hence unaffected by reset
+
+ if (CLEAR_LINE != m_vihtp)
+ RM16(0xfff6, &m_pc);
}
void m68705_new_device::execute_set_input(int inputnum, int state)
@@ -532,10 +524,7 @@ void m68705_new_device::execute_set_input(int inputnum, int state)
switch (inputnum)
{
case M68705_VPP_LINE:
- if (ASSERT_LINE == state)
- m_pcr &= 0xfb;
- else
- m_pcr |= 0x04;
+ m_pcr = (m_pcr & 0xfb) | ((ASSERT_LINE == state) ? 0x00 : 0x04);
break;
case M68705_VIHTP_LINE:
// TODO: this is actually the same physical pin as the timer input, so they should be tied up
@@ -560,6 +549,26 @@ void m68705_new_device::nvram_write(emu_file &file)
file.write(&m_user_rom[0], m_user_rom.bytes());
}
+void m68705_new_device::burn_cycles(unsigned count)
+{
+ // handle internal timer/counter source
+ if (!tcr_tin()) // TODO: check tcr_tie() and gate on TIMER if appropriate
+ {
+ unsigned const ps_opt(tcr_ps());
+ unsigned const ps_mask((1 << ps_opt) - 1);
+ unsigned const decrements((count + (m_prescaler & ps_mask)) >> ps_opt);
+
+ if (decrements && (decrements >= m_tdr))
+ {
+ m_tcr |= 0x80;
+ if (!tcr_tim())
+ set_input_line(M68705_INT_TIMER, ASSERT_LINE);
+ }
+ m_prescaler = (count + m_prescaler) & 0x7f;
+ m_tdr = (m_tdr - decrements) & 0xff;
+ }
+}
+
/****************************************************************************
* M68705Px family
@@ -577,8 +586,8 @@ DEVICE_ADDRESS_MAP_START( p_map, 8, m68705p_device )
AM_RANGE(0x0005, 0x0005) AM_WRITE(port_ddr_w<1>)
AM_RANGE(0x0006, 0x0006) AM_WRITE(port_ddr_w<2>)
// 0x0007 not used (no port D)
- AM_RANGE(0x0008, 0x0008) AM_READWRITE(internal_68705_tdr_r, internal_68705_tdr_w)
- AM_RANGE(0x0009, 0x0009) AM_READWRITE(internal_68705_tcr_r, internal_68705_tcr_w)
+ AM_RANGE(0x0008, 0x0008) AM_READWRITE(tdr_r, tdr_w)
+ AM_RANGE(0x0009, 0x0009) AM_READWRITE(tcr_r, tcr_w)
// 0x000a not used
AM_RANGE(0x000b, 0x000b) AM_READWRITE(pcr_r, pcr_w)
// 0x000c-0x000f not used
@@ -631,8 +640,8 @@ DEVICE_ADDRESS_MAP_START( u_map, 8, m68705u_device )
AM_RANGE(0x0005, 0x0005) AM_WRITE(port_ddr_w<1>)
AM_RANGE(0x0006, 0x0006) AM_WRITE(port_ddr_w<2>)
// 0x0007 not used (port D is input only)
- AM_RANGE(0x0008, 0x0008) AM_READWRITE(internal_68705_tdr_r, internal_68705_tdr_w)
- AM_RANGE(0x0009, 0x0009) AM_READWRITE(internal_68705_tcr_r, internal_68705_tcr_w)
+ AM_RANGE(0x0008, 0x0008) AM_READWRITE(tdr_r, tdr_w)
+ AM_RANGE(0x0009, 0x0009) AM_READWRITE(tcr_r, tcr_w)
AM_RANGE(0x000a, 0x000a) AM_READWRITE(misc_r, misc_w)
AM_RANGE(0x000b, 0x000b) AM_READWRITE(pcr_r, pcr_w)
// 0x000c-0x000f not used
@@ -698,8 +707,8 @@ DEVICE_ADDRESS_MAP_START( r_map, 8, m68705r_device )
AM_RANGE(0x0005, 0x0005) AM_WRITE(port_ddr_w<1>)
AM_RANGE(0x0006, 0x0006) AM_WRITE(port_ddr_w<2>)
// 0x0007 not used (port D is input only)
- AM_RANGE(0x0008, 0x0008) AM_READWRITE(internal_68705_tdr_r, internal_68705_tdr_w)
- AM_RANGE(0x0009, 0x0009) AM_READWRITE(internal_68705_tcr_r, internal_68705_tcr_w)
+ AM_RANGE(0x0008, 0x0008) AM_READWRITE(tdr_r, tdr_w)
+ AM_RANGE(0x0009, 0x0009) AM_READWRITE(tcr_r, tcr_w)
AM_RANGE(0x000a, 0x000a) AM_READWRITE(misc_r, misc_w)
AM_RANGE(0x000b, 0x000b) AM_READWRITE(pcr_r, pcr_w)
// 0x000c-0x000d not used
@@ -750,6 +759,11 @@ tiny_rom_entry const *m68705p3_device::device_rom_region() const
return ROM_NAME(m68705p3);
}
+u8 m68705p3_device::get_mask_options() const
+{
+ return get_user_rom()[0x0784] & 0xf7; // no SNM bit
+}
+
/****************************************************************************
* M68705P5 device
@@ -765,6 +779,11 @@ tiny_rom_entry const *m68705p5_device::device_rom_region() const
return ROM_NAME(m68705p5);
}
+u8 m68705p5_device::get_mask_options() const
+{
+ return get_user_rom()[0x0784];
+}
+
/****************************************************************************
* M68705R3 device
@@ -780,6 +799,11 @@ tiny_rom_entry const *m68705r3_device::device_rom_region() const
return ROM_NAME(m68705r3);
}
+u8 m68705r3_device::get_mask_options() const
+{
+ return get_user_rom()[0x0784] & 0xf7; // no SNM bit
+}
+
/****************************************************************************
* M68705U3 device
@@ -794,3 +818,8 @@ tiny_rom_entry const *m68705u3_device::device_rom_region() const
{
return ROM_NAME(m68705u3);
}
+
+u8 m68705u3_device::get_mask_options() const
+{
+ return get_user_rom()[0x0784] & 0xf7; // no SNM bit
+}
diff --git a/src/devices/cpu/m6805/m68705.h b/src/devices/cpu/m6805/m68705.h
index 09a0c872539..e89517e5735 100644
--- a/src/devices/cpu/m6805/m68705.h
+++ b/src/devices/cpu/m6805/m68705.h
@@ -97,11 +97,6 @@ protected:
PORT_COUNT = 4
};
- enum
- {
- TIMER_68705_PRESCALER_EXPIRED,
- };
-
m68705_new_device(
machine_config const &mconfig,
char const *tag,
@@ -125,10 +120,10 @@ protected:
template <std::size_t N> DECLARE_WRITE8_MEMBER(port_ddr_w);
template <std::size_t N> void port_cb_w();
- DECLARE_READ8_MEMBER(internal_68705_tdr_r);
- DECLARE_WRITE8_MEMBER(internal_68705_tdr_w);
- DECLARE_READ8_MEMBER(internal_68705_tcr_r);
- DECLARE_WRITE8_MEMBER(internal_68705_tcr_w);
+ DECLARE_READ8_MEMBER(tdr_r);
+ DECLARE_WRITE8_MEMBER(tdr_w);
+ DECLARE_READ8_MEMBER(tcr_r);
+ DECLARE_WRITE8_MEMBER(tcr_w);
DECLARE_READ8_MEMBER(misc_r);
DECLARE_WRITE8_MEMBER(misc_w);
@@ -141,11 +136,6 @@ protected:
DECLARE_READ8_MEMBER(arr_r);
DECLARE_WRITE8_MEMBER(arr_w);
- TIMER_CALLBACK_MEMBER(timer_68705_increment);
-
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
-
- // device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void execute_set_input(int inputnum, int state) override;
@@ -153,27 +143,44 @@ protected:
virtual void nvram_read(emu_file &file) override;
virtual void nvram_write(emu_file &file) override;
- u8 m_tdr;
- u8 m_tcr;
+ virtual void burn_cycles(unsigned count) override;
- /* Timers */
- emu_timer *m_68705_timer;
+ u8 *const get_user_rom() const { return &m_user_rom[0]; }
+ virtual u8 get_mask_options() const = 0;
private:
+ bool tcr_tir() const { return BIT(m_tcr, 7); }
+ bool tcr_tim() const { return BIT(m_tcr, 6); }
+ bool tcr_tin() const { return BIT(m_tcr, 5); }
+ bool tcr_tie() const { return BIT(m_tcr, 4); }
+ bool tcr_topt() const { return BIT(m_tcr, 3); }
+ u8 tcr_ps() const { return m_tcr & 0x07; }
+
+ bool pcr_vpon() const { return !BIT(m_pcr, 2); }
+ bool pcr_pge() const { return !BIT(m_pcr, 1); }
+ bool pcr_ple() const { return !BIT(m_pcr, 0); }
+
required_region_ptr<u8> m_user_rom;
- bool m_port_open_drain[PORT_COUNT];
- u8 m_port_mask[PORT_COUNT];
- u8 m_port_input[PORT_COUNT];
- u8 m_port_latch[PORT_COUNT];
- u8 m_port_ddr[PORT_COUNT];
- devcb_read8 m_port_cb_r[PORT_COUNT];
- devcb_write8 m_port_cb_w[PORT_COUNT];
-
- u8 m_vihtp;
- u8 m_pcr;
- u8 m_pl_data;
- u16 m_pl_addr;
+ // digital I/O
+ bool m_port_open_drain[PORT_COUNT];
+ u8 m_port_mask[PORT_COUNT];
+ u8 m_port_input[PORT_COUNT];
+ u8 m_port_latch[PORT_COUNT];
+ u8 m_port_ddr[PORT_COUNT];
+ devcb_read8 m_port_cb_r[PORT_COUNT];
+ devcb_write8 m_port_cb_w[PORT_COUNT];
+
+ // timer/counter
+ u8 m_prescaler;
+ u8 m_tdr;
+ u8 m_tcr;
+
+ // EPROM control
+ u8 m_vihtp;
+ u8 m_pcr;
+ u8 m_pl_data;
+ u16 m_pl_addr;
};
@@ -288,6 +295,8 @@ public:
protected:
virtual tiny_rom_entry const *device_rom_region() const override;
+
+ virtual u8 get_mask_options() const override;
};
@@ -300,6 +309,8 @@ public:
protected:
virtual tiny_rom_entry const *device_rom_region() const override;
+
+ virtual u8 get_mask_options() const override;
};
@@ -312,6 +323,8 @@ public:
protected:
virtual tiny_rom_entry const *device_rom_region() const override;
+
+ virtual u8 get_mask_options() const override;
};
@@ -324,6 +337,8 @@ public:
protected:
virtual tiny_rom_entry const *device_rom_region() const override;
+
+ virtual u8 get_mask_options() const override;
};
diff --git a/src/devices/cpu/sm510/kb1013vk1-2.h b/src/devices/cpu/sm510/kb1013vk1-2.h
index 56896c940ac..031fa1d6bcf 100644
--- a/src/devices/cpu/sm510/kb1013vk1-2.h
+++ b/src/devices/cpu/sm510/kb1013vk1-2.h
@@ -23,10 +23,10 @@
class kb1013vk12_device : public sm500_device
{
public:
- kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void execute_one() override;
// opcode handlers
diff --git a/src/devices/cpu/sm510/kb1013vk1-2core.cpp b/src/devices/cpu/sm510/kb1013vk1-2core.cpp
index b7286e97401..a6848bb7696 100644
--- a/src/devices/cpu/sm510/kb1013vk1-2core.cpp
+++ b/src/devices/cpu/sm510/kb1013vk1-2core.cpp
@@ -28,13 +28,13 @@ static ADDRESS_MAP_START(data_5x13x4, AS_DATA, 8, sm510_base_device)
ADDRESS_MAP_END
// device definitions
-kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: sm500_device(mconfig, KB1013VK12, "KB1013VK1-2", tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1_8k), 7 /* data width */, ADDRESS_MAP_NAME(data_5x13x4), "kb1013vk1-2", __FILE__)
{ }
// disasm
-offs_t kb1013vk12_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t kb1013vk12_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(kb1013vk12);
return CPU_DISASSEMBLE_NAME(kb1013vk12)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/sm510/sm500.h b/src/devices/cpu/sm510/sm500.h
index 262c75fc29b..8c6cc5bd4e5 100644
--- a/src/devices/cpu/sm510/sm500.h
+++ b/src/devices/cpu/sm510/sm500.h
@@ -46,11 +46,11 @@ O36 48 | * | 13 K2
class sm500_device : public sm510_base_device
{
public:
- sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void execute_one() override;
virtual void get_opcode_param() override;
diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp
index 84c1c557eb6..370a4c14ebd 100644
--- a/src/devices/cpu/sm510/sm500core.cpp
+++ b/src/devices/cpu/sm510/sm500core.cpp
@@ -28,17 +28,17 @@ ADDRESS_MAP_END
// device definitions
-sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: sm510_base_device(mconfig, SM500, "SM500", tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1_2k), 6 /* data width */, ADDRESS_MAP_NAME(data_4x10x4), "sm500", __FILE__)
{ }
-sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: sm510_base_device(mconfig, type, name, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data, shortname, source)
{ }
// disasm
-offs_t sm500_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t sm500_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(sm500);
return CPU_DISASSEMBLE_NAME(sm500)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp
index decfcce4e56..6fcd0fe21b5 100644
--- a/src/devices/cpu/sm510/sm510.cpp
+++ b/src/devices/cpu/sm510/sm510.cpp
@@ -148,13 +148,13 @@ void sm510_base_device::device_reset()
// lcd driver
//-------------------------------------------------
-inline uint16_t sm510_base_device::get_lcd_row(int column, uint8_t* ram)
+inline u16 sm510_base_device::get_lcd_row(int column, u8* ram)
{
// output 0 if lcd blackpate/bleeder is off, or in case row doesn't exist
if (ram == nullptr || m_bc || !m_bp)
return 0;
- uint16_t rowdata = 0;
+ u16 rowdata = 0;
for (int i = 0; i < 0x10; i++)
rowdata |= (ram[i] >> column & 1) << i;
@@ -172,7 +172,7 @@ TIMER_CALLBACK_MEMBER(sm510_base_device::lcd_timer_cb)
m_write_segc(h | SM510_PORT_SEGC, get_lcd_row(h, m_lcd_ram_c), 0xffff);
// bs output from L/X and Y regs
- uint8_t bs = (m_l >> h & 1) | ((m_x*2) >> h & 2);
+ u8 bs = (m_l >> h & 1) | ((m_x*2) >> h & 2);
m_write_segbs(h | SM510_PORT_SEGBS, (m_bc || !m_bp) ? 0 : bs, 0xffff);
}
@@ -200,7 +200,7 @@ void sm510_base_device::clock_melody()
// tone cycle table (SM511/SM512 datasheet fig.5)
// cmd 0 = cmd, 1 = stop, > 13 = illegal(unknown)
- static const uint8_t lut_tone_cycles[4*16] =
+ static const u8 lut_tone_cycles[4*16] =
{
0, 0, 7, 8, 8, 9, 9, 10,11,11,12,13,14,14, 7*2, 8*2,
0, 0, 8, 8, 9, 9, 10,11,11,12,13,13,14,15, 8*2, 8*2,
@@ -208,8 +208,8 @@ void sm510_base_device::clock_melody()
0, 0, 8, 9, 9, 10,10,11,11,12,13,14,14,15, 8*2, 9*2
};
- uint8_t cmd = m_melody_rom[m_melody_address] & 0x3f;
- uint8_t out = 0;
+ u8 cmd = m_melody_rom[m_melody_address] & 0x3f;
+ u8 out = 0;
// clock duty cycle if tone is active
if ((cmd & 0xf) > 1)
@@ -234,7 +234,7 @@ void sm510_base_device::clock_melody()
// clock time base on F8(d7)
if ((m_div & 0x7f) == 0)
{
- uint8_t mask = (cmd & 0x20) ? 0x1f : 0x0f;
+ u8 mask = (cmd & 0x20) ? 0x1f : 0x0f;
m_melody_step_count = (m_melody_step_count + 1) & mask;
if (m_melody_step_count == 0)
@@ -257,7 +257,7 @@ void sm510_base_device::init_melody()
// verify melody rom
for (int i = 0; i < 0x100; i++)
{
- uint8_t data = m_melody_rom[i];
+ u8 data = m_melody_rom[i];
if (data & 0xc0 || (data & 0x0f) > 13)
logerror("%s unknown melody ROM data $%02X at $%02X\n", tag(), data, i);
}
diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h
index c60b0395af2..2bfab3f2284 100644
--- a/src/devices/cpu/sm510/sm510.h
+++ b/src/devices/cpu/sm510/sm510.h
@@ -92,7 +92,7 @@ class sm510_base_device : public cpu_device
{
public:
// construction/destruction
- sm510_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ sm510_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program)
, m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data)
@@ -126,11 +126,11 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } // default 2 cycles per machine cycle
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // "
- virtual uint32_t execute_min_cycles() const override { return 1; }
- virtual uint32_t execute_max_cycles() const override { return 2; }
- virtual uint32_t execute_input_lines() const override { return 1; }
+ virtual u64 execute_clocks_to_cycles(u64 clocks) const override { return (clocks + 2 - 1) / 2; } // default 2 cycles per machine cycle
+ virtual u64 execute_cycles_to_clocks(u64 cycles) const override { return (cycles * 2); } // "
+ virtual u32 execute_min_cycles() const override { return 1; }
+ virtual u32 execute_max_cycles() const override { return 2; }
+ virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
virtual void execute_one() { } // -> child class
@@ -139,8 +139,8 @@ protected:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 1; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 0x40; } // actually 2, but debugger doesn't like non-linear pc
+ virtual u32 disasm_min_opcode_bytes() const override { return 1; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 0x40; } // actually 2, but debugger doesn't like non-linear pc
address_space_config m_program_config;
address_space_config m_data_config;
@@ -152,51 +152,51 @@ protected:
int m_prgmask;
int m_datamask;
- uint16_t m_pc, m_prev_pc;
- uint16_t m_op, m_prev_op;
- uint8_t m_param;
+ u16 m_pc, m_prev_pc;
+ u16 m_op, m_prev_op;
+ u8 m_param;
int m_stack_levels;
- uint16_t m_stack[2];
+ u16 m_stack[2];
int m_icount;
- uint8_t m_acc;
- uint8_t m_bl;
- uint8_t m_bm;
+ u8 m_acc;
+ u8 m_bl;
+ u8 m_bm;
bool m_sbm;
- uint8_t m_c;
+ u8 m_c;
bool m_skip;
- uint8_t m_w;
- uint8_t m_r;
+ u8 m_w;
+ u8 m_r;
bool m_k_active;
bool m_halt;
// lcd driver
- optional_shared_ptr<uint8_t> m_lcd_ram_a, m_lcd_ram_b, m_lcd_ram_c;
+ optional_shared_ptr<u8> m_lcd_ram_a, m_lcd_ram_b, m_lcd_ram_c;
devcb_write16 m_write_sega, m_write_segb, m_write_segc, m_write_segbs;
emu_timer *m_lcd_timer;
- uint8_t m_l, m_x;
- uint8_t m_y;
+ u8 m_l, m_x;
+ u8 m_y;
bool m_bp;
bool m_bc;
- uint16_t get_lcd_row(int column, uint8_t* ram);
+ u16 get_lcd_row(int column, u8* ram);
TIMER_CALLBACK_MEMBER(lcd_timer_cb);
virtual void init_lcd_driver();
// melody controller
- optional_region_ptr<uint8_t> m_melody_rom;
- uint8_t m_melody_rd;
- uint8_t m_melody_step_count;
- uint8_t m_melody_duty_count;
- uint8_t m_melody_duty_index;
- uint8_t m_melody_address;
+ optional_region_ptr<u8> m_melody_rom;
+ u8 m_melody_rd;
+ u8 m_melody_step_count;
+ u8 m_melody_duty_count;
+ u8 m_melody_duty_index;
+ u8 m_melody_address;
void clock_melody();
void init_melody();
// interrupt/divider
emu_timer *m_div_timer;
- uint16_t m_div;
+ u16 m_div;
bool m_1s;
bool wake_me_up();
@@ -215,12 +215,12 @@ protected:
virtual void get_opcode_param() { }
virtual void update_w_latch() { }
- uint8_t ram_r();
- void ram_w(uint8_t data);
+ u8 ram_r();
+ void ram_w(u8 data);
void pop_stack();
void push_stack();
- void do_branch(uint8_t pu, uint8_t pm, uint8_t pl);
- uint8_t bitmask(uint16_t param);
+ void do_branch(u8 pu, u8 pm, u8 pl);
+ u8 bitmask(u16 param);
// opcode handlers
virtual void op_lb();
@@ -295,10 +295,10 @@ protected:
class sm510_device : public sm510_base_device
{
public:
- sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void execute_one() override;
virtual void get_opcode_param() override;
@@ -309,11 +309,11 @@ protected:
class sm511_device : public sm510_base_device
{
public:
- sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void execute_one() override;
virtual void get_opcode_param() override;
};
@@ -321,7 +321,7 @@ protected:
class sm512_device : public sm511_device
{
public:
- sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/sm510/sm510core.cpp b/src/devices/cpu/sm510/sm510core.cpp
index de503fcbc54..c886c178cfa 100644
--- a/src/devices/cpu/sm510/sm510core.cpp
+++ b/src/devices/cpu/sm510/sm510core.cpp
@@ -30,13 +30,13 @@ ADDRESS_MAP_END
// device definitions
-sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: sm510_base_device(mconfig, SM510, "SM510", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm510", __FILE__)
{ }
// disasm
-offs_t sm510_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t sm510_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(sm510);
return CPU_DISASSEMBLE_NAME(sm510)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/sm510/sm510d.cpp b/src/devices/cpu/sm510/sm510d.cpp
index 3929c52a82f..030b2157f63 100644
--- a/src/devices/cpu/sm510/sm510d.cpp
+++ b/src/devices/cpu/sm510/sm510d.cpp
@@ -69,7 +69,7 @@ static const char *const s_mnemonics[] =
};
// number of bits per opcode parameter, 8 or larger means 2-byte opcode
-static const uint8_t s_bits[] =
+static const u8 s_bits[] =
{
0, 8,
4, 8, 0, 0, 0, 0,
@@ -99,7 +99,7 @@ static const uint8_t s_bits[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t s_flags[] =
+static const u32 s_flags[] =
{
0, 0,
0, 0, 0, 0, 0, 0,
@@ -127,7 +127,7 @@ static const uint32_t s_flags[] =
};
// next program counter in sequence (relative)
-static const int8_t s_next_pc[0x40] =
+static const s8 s_next_pc[0x40] =
{
32, -1 /* rollback */, -1, 30, 30, -3, -3, 28, 28, -5, -5, 26, 26, -7, -7, 24,
24, -9, -9, 22, 22, -11, -11, 20, 20, -13, -13, 18, 18, -15, -15, 16,
@@ -139,16 +139,16 @@ static const int8_t s_next_pc[0x40] =
// common disasm
-static offs_t sm510_common_disasm(const uint8_t *lut_mnemonic, const uint8_t *lut_extended, std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram)
+static offs_t sm510_common_disasm(const u8 *lut_mnemonic, const u8 *lut_extended, std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram)
{
// get raw opcode
- uint8_t op = oprom[0];
- uint8_t instr = lut_mnemonic[op];
+ u8 op = oprom[0];
+ u8 instr = lut_mnemonic[op];
int len = 1;
int bits = s_bits[instr];
- uint8_t mask = op & ((1 << (bits & 7)) - 1);
- uint16_t param = mask;
+ u8 mask = op & ((1 << (bits & 7)) - 1);
+ u16 param = mask;
if (bits >= 8)
{
// note: disasm view shows correct parameter, but raw view does not
@@ -180,7 +180,7 @@ static offs_t sm510_common_disasm(const uint8_t *lut_mnemonic, const uint8_t *lu
}
else
{
- uint16_t address = (param << 4 & 0xc00) | (mask << 6 & 0x3c0) | (param & 0x03f);
+ u16 address = (param << 4 & 0xc00) | (mask << 6 & 0x3c0) | (param & 0x03f);
util::stream_format(stream, "$%03X", address);
}
@@ -195,7 +195,7 @@ static offs_t sm510_common_disasm(const uint8_t *lut_mnemonic, const uint8_t *lu
// SM510 disasm
-static const uint8_t sm510_mnemonic[0x100] =
+static const u8 sm510_mnemonic[0x100] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
mSKIP, mATBP, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0
@@ -227,7 +227,7 @@ CPU_DISASSEMBLE(sm510)
// SM511 disasm
-static const uint8_t sm511_mnemonic[0x100] =
+static const u8 sm511_mnemonic[0x100] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
mROT, mDTA, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0
@@ -251,7 +251,7 @@ static const uint8_t sm511_mnemonic[0x100] =
mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM // F
};
-static const uint8_t sm511_extended[0x10] =
+static const u8 sm511_extended[0x10] =
{
mRME, mSME, mTMEL, mATFC, mBDC, mATBP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 60 3
};
@@ -259,7 +259,7 @@ static const uint8_t sm511_extended[0x10] =
CPU_DISASSEMBLE(sm511)
{
// create extended opcode table
- uint8_t ext[0x100];
+ u8 ext[0x100];
memset(ext, 0, 0x100);
memcpy(ext + 0x30, sm511_extended, 0x10);
@@ -269,7 +269,7 @@ CPU_DISASSEMBLE(sm511)
// SM500 disasm
-static const uint8_t sm500_mnemonic[0x100] =
+static const u8 sm500_mnemonic[0x100] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
mSKIP, mATR, mEXKSA,mATBP, mRM, mRM, mRM, mRM, mADD, mADDC, mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0
@@ -293,7 +293,7 @@ static const uint8_t sm500_mnemonic[0x100] =
mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS // F
};
-static const uint8_t sm500_extended[0x10] =
+static const u8 sm500_extended[0x10] =
{
mCEND, 0, 0, 0, mDTA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 5E 0
};
@@ -301,7 +301,7 @@ static const uint8_t sm500_extended[0x10] =
CPU_DISASSEMBLE(sm500)
{
// create extended opcode table
- uint8_t ext[0x100];
+ u8 ext[0x100];
memset(ext, 0, 0x100);
memcpy(ext + 0x00, sm500_extended, 0x10);
@@ -311,7 +311,7 @@ CPU_DISASSEMBLE(sm500)
// KB1013VK1-2 disasm
-static const uint8_t kb1013vk12_mnemonic[0x100] =
+static const u8 kb1013vk12_mnemonic[0x100] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
mNOP, mOAR, mBS1, mEN, mBM0, mBM0, mBM0, mBM0, mAM, mAC, mCOM, mXL, mBM1, mBM1, mBM1, mBM1, // 0
@@ -335,7 +335,7 @@ static const uint8_t kb1013vk12_mnemonic[0x100] =
mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR // F
};
-static const uint8_t kb1013vk12_extended[0x10] =
+static const u8 kb1013vk12_extended[0x10] =
{
mHLT, 0, 0, 0, mLDF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 5E 0
};
@@ -343,7 +343,7 @@ static const uint8_t kb1013vk12_extended[0x10] =
CPU_DISASSEMBLE(kb1013vk12)
{
// create extended opcode table
- uint8_t ext[0x100];
+ u8 ext[0x100];
memset(ext, 0, 0x100);
memcpy(ext + 0x00, kb1013vk12_extended, 0x10);
diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp
index a18e39bac67..01ab9eee9d9 100644
--- a/src/devices/cpu/sm510/sm510op.cpp
+++ b/src/devices/cpu/sm510/sm510op.cpp
@@ -8,17 +8,17 @@
// internal helpers
-inline uint8_t sm510_base_device::ram_r()
+inline u8 sm510_base_device::ram_r()
{
int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM
- uint8_t address = (bmh | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (bmh | m_bm << 4 | m_bl) & m_datamask;
return m_data->read_byte(address) & 0xf;
}
-inline void sm510_base_device::ram_w(uint8_t data)
+inline void sm510_base_device::ram_w(u8 data)
{
int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM
- uint8_t address = (bmh | m_bm << 4 | m_bl) & m_datamask;
+ u8 address = (bmh | m_bm << 4 | m_bl) & m_datamask;
m_data->write_byte(address, data & 0xf);
}
@@ -36,13 +36,13 @@ void sm510_base_device::push_stack()
m_stack[0] = m_pc;
}
-void sm510_base_device::do_branch(uint8_t pu, uint8_t pm, uint8_t pl)
+void sm510_base_device::do_branch(u8 pu, u8 pm, u8 pl)
{
// set new PC(Pu/Pm/Pl)
m_pc = ((pu << 10 & 0xc00) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask;
}
-inline uint8_t sm510_base_device::bitmask(uint16_t param)
+inline u8 sm510_base_device::bitmask(u16 param)
{
// bitmask from immediate opcode param
return 1 << (param & 3);
@@ -64,7 +64,7 @@ void sm510_base_device::op_lb()
m_bl = (m_op >> 2 & 3);
// bl(high) is still unclear, official doc is confusing
- uint8_t hi = 0;
+ u8 hi = 0;
switch (m_bl)
{
case 0: hi = 0; break;
@@ -90,7 +90,7 @@ void sm510_base_device::op_sbm()
void sm510_base_device::op_exbla()
{
// EXBLA: exchange BL with ACC
- uint8_t a = m_acc;
+ u8 a = m_acc;
m_acc = m_bl;
m_bl = a;
}
@@ -155,7 +155,7 @@ void sm510_base_device::op_tm()
// TM x: indirect subroutine call, pointers(IDX) are in page 0
m_icount--;
push_stack();
- uint8_t idx = m_program->read_byte(m_op & 0x3f);
+ u8 idx = m_program->read_byte(m_op & 0x3f);
do_branch(idx >> 6 & 3, 4, idx & 0x3f);
}
@@ -166,7 +166,7 @@ void sm510_base_device::op_tm()
void sm510_base_device::op_exc()
{
// EXC x: exchange ACC with RAM, xor BM with x
- uint8_t a = m_acc;
+ u8 a = m_acc;
m_acc = ram_r();
ram_w(a);
m_bm ^= (m_op & 3);
@@ -304,7 +304,7 @@ void sm510_base_device::op_coma()
void sm510_base_device::op_rot()
{
// ROT: rotate ACC right through carry
- uint8_t c = m_acc & 1;
+ u8 c = m_acc & 1;
m_acc = m_acc >> 1 | m_c << 3;
m_c = c;
}
diff --git a/src/devices/cpu/sm510/sm511core.cpp b/src/devices/cpu/sm510/sm511core.cpp
index ce134b24588..a241ef09b52 100644
--- a/src/devices/cpu/sm510/sm511core.cpp
+++ b/src/devices/cpu/sm510/sm511core.cpp
@@ -35,7 +35,7 @@ ADDRESS_MAP_END
// disasm
-offs_t sm511_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t sm511_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(sm511);
return CPU_DISASSEMBLE_NAME(sm511)(this, stream, pc, oprom, opram, options);
@@ -43,15 +43,15 @@ offs_t sm511_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u
// device definitions
-sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: sm510_base_device(mconfig, SM511, "SM511", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_4k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm511", __FILE__)
{ }
-sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: sm510_base_device(mconfig, type, name, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data, shortname, source)
{ }
-sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: sm511_device(mconfig, SM512, "SM512", tag, owner, clock, 2, 12, ADDRESS_MAP_NAME(program_4k), 7, ADDRESS_MAP_NAME(data_80_48x4), "sm512", __FILE__)
{ }
diff --git a/src/devices/cpu/tms1000/tms0270.cpp b/src/devices/cpu/tms1000/tms0270.cpp
index edb9512518d..8c09fa49bea 100644
--- a/src/devices/cpu/tms1000/tms0270.cpp
+++ b/src/devices/cpu/tms1000/tms0270.cpp
@@ -32,7 +32,7 @@ ADDRESS_MAP_END
// device definitions
-tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0270", __FILE__)
, m_read_ctl(*this)
, m_write_ctl(*this)
@@ -145,14 +145,14 @@ void tms0270_cpu_device::dynamic_output()
}
}
-uint8_t tms0270_cpu_device::read_k_input()
+u8 tms0270_cpu_device::read_k_input()
{
// external: TMS5100 CTL port via SEG G,B,C,D
if (m_chipsel)
return (m_ctl_dir) ? m_ctl_out : m_read_ctl(0, 0xff) & 0xf;
// standard K-input otherwise
- uint8_t k = m_read_k(0, 0xff) & 0x1f;
+ u8 k = m_read_k(0, 0xff) & 0x1f;
return (k & 0x10) ? 0xf : k; // the TMS0270 KF line asserts all K-inputs
}
diff --git a/src/devices/cpu/tms1000/tms0270.h b/src/devices/cpu/tms1000/tms0270.h
index 77f596cda84..3d0a8c06098 100644
--- a/src/devices/cpu/tms1000/tms0270.h
+++ b/src/devices/cpu/tms1000/tms0270.h
@@ -26,7 +26,7 @@
class tms0270_cpu_device : public tms0980_cpu_device
{
public:
- tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// static configuration helpers
template<class _Object> static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_read_ctl.set_callback(object); }
@@ -40,8 +40,8 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual void write_o_output(uint8_t index) override { tms1k_base_device::write_o_output(index); }
- virtual uint8_t read_k_input() override;
+ virtual void write_o_output(u8 index) override { tms1k_base_device::write_o_output(index); }
+ virtual u8 read_k_input() override;
virtual void dynamic_output() override;
virtual void op_setr() override;
@@ -50,15 +50,15 @@ protected:
private:
// state specific to interface with TMS5100
- uint16_t m_r_prev;
- uint8_t m_chipsel;
- uint8_t m_ctl_out;
- uint8_t m_ctl_dir;
- int m_pdc;
-
- uint8_t m_o_latch_low;
- uint8_t m_o_latch;
- uint8_t m_o_latch_prev;
+ u16 m_r_prev;
+ u8 m_chipsel;
+ u8 m_ctl_out;
+ u8 m_ctl_dir;
+ int m_pdc;
+
+ u8 m_o_latch_low;
+ u8 m_o_latch;
+ u8 m_o_latch_prev;
devcb_read8 m_read_ctl;
devcb_write8 m_write_ctl;
diff --git a/src/devices/cpu/tms1000/tms0970.cpp b/src/devices/cpu/tms1000/tms0970.cpp
index b24f1ba6774..116c197e996 100644
--- a/src/devices/cpu/tms1000/tms0970.cpp
+++ b/src/devices/cpu/tms1000/tms0970.cpp
@@ -36,19 +36,19 @@ ADDRESS_MAP_END
// device definitions
-tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__)
{ }
-tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0970_cpu_device(mconfig, TMS0950, "TMS0950", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0950", __FILE__)
{ }
-tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__)
{ }
@@ -97,9 +97,9 @@ void tms0970_cpu_device::device_reset()
// pre-decode instructionset
m_fixed_decode.resize(0x100);
- memset(&m_fixed_decode[0], 0, 0x100*sizeof(uint32_t));
+ memset(&m_fixed_decode[0], 0, 0x100*sizeof(u32));
m_micro_decode.resize(0x100);
- memset(&m_micro_decode[0], 0, 0x100*sizeof(uint32_t));
+ memset(&m_micro_decode[0], 0, 0x100*sizeof(u32));
for (int op = 0; op < 0x100; op++)
{
@@ -108,26 +108,26 @@ void tms0970_cpu_device::device_reset()
m_fixed_decode[op] = (op & 0x40) ? F_CALL: F_BR;
// 5 output bits select a microinstruction index
- uint32_t imask = m_ipla->read(op);
- uint8_t msel = imask & 0x1f;
+ u32 imask = m_ipla->read(op);
+ u8 msel = imask & 0x1f;
// but if (from bottom to top) term 1 is active and output bit 5 is 0, R2,R4-R7 directly select a microinstruction index
if (imask & 0x40 && (imask & 0x20) == 0)
msel = (op & 0xf) | (op >> 1 & 0x10);
msel = BITSWAP8(msel,7,6,5,0,1,2,3,4); // lines are reversed
- uint32_t mmask = m_mpla->read(msel);
+ u32 mmask = m_mpla->read(msel);
mmask ^= 0x09fe; // invert active-negative
- // _____ _____ _____ _____ ______ _____ ______ _____ _____
- const uint32_t md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO };
+ // _____ _____ _____ _____ ______ _____ ______ _____ _____
+ const u32 md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO };
for (int bit = 0; bit < 15; bit++)
if (mmask & (1 << bit))
m_micro_decode[op] |= md[bit];
// the other ipla terms each select a fixed instruction
- const uint32_t id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN };
+ const u32 id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN };
for (int bit = 0; bit < 8; bit++)
if (imask & (0x80 << bit))
@@ -137,7 +137,7 @@ void tms0970_cpu_device::device_reset()
// i/o handling
-void tms0970_cpu_device::write_o_output(uint8_t index)
+void tms0970_cpu_device::write_o_output(u8 index)
{
m_o_index = index;
m_o = m_spla->read(index);
diff --git a/src/devices/cpu/tms1000/tms0970.h b/src/devices/cpu/tms1000/tms0970.h
index 360e30a42cb..ca436163374 100644
--- a/src/devices/cpu/tms1000/tms0970.h
+++ b/src/devices/cpu/tms1000/tms0970.h
@@ -15,15 +15,15 @@
class tms0970_cpu_device : public tms1000_cpu_device
{
public:
- tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
// overrides
virtual void device_reset() override;
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual void write_o_output(uint8_t index) override;
+ virtual void write_o_output(u8 index) override;
virtual void op_setr() override;
virtual void op_tdo() override;
@@ -32,7 +32,7 @@ protected:
class tms0950_cpu_device : public tms0970_cpu_device
{
public:
- tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// overrides
@@ -46,7 +46,7 @@ protected:
class tms1990_cpu_device : public tms0970_cpu_device
{
public:
- tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp
index 5e9ea00d178..cb4a00adbde 100644
--- a/src/devices/cpu/tms1000/tms0980.cpp
+++ b/src/devices/cpu/tms1000/tms0980.cpp
@@ -40,15 +40,15 @@ ADDRESS_MAP_END
// device definitions
-tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8 /* o pins */, 9 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0980", __FILE__)
{ }
-tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_144x4), "tms1980", __FILE__)
{ }
@@ -90,7 +90,7 @@ machine_config_constructor tms1980_cpu_device::device_mconfig_additions() const
// disasm
-offs_t tms0980_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t tms0980_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(tms0980);
return CPU_DISASSEMBLE_NAME(tms0980)(this, stream, pc, oprom, opram, options);
@@ -98,13 +98,13 @@ offs_t tms0980_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, c
// device_reset
-uint32_t tms0980_cpu_device::decode_fixed(uint16_t op)
+u32 tms0980_cpu_device::decode_fixed(u16 op)
{
- uint32_t decode = 0;
- uint32_t mask = m_ipla->read(op);
+ u32 decode = 0;
+ u32 mask = m_ipla->read(op);
// 1 line per PLA row, no OR-mask
- const uint32_t id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC };
+ const u32 id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC };
for (int bit = 0; bit < 15; bit++)
if (mask & (0x80 << bit))
@@ -113,17 +113,17 @@ uint32_t tms0980_cpu_device::decode_fixed(uint16_t op)
return decode;
}
-uint32_t tms0980_cpu_device::decode_micro(uint8_t sel)
+u32 tms0980_cpu_device::decode_micro(u8 sel)
{
- uint32_t decode = 0;
+ u32 decode = 0;
sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed
- uint32_t mask = m_mpla->read(sel);
+ u32 mask = m_mpla->read(sel);
mask ^= 0x43fc3; // invert active-negative
// M_RSTR is specific to TMS02x0/TMS1980, it redirects to F_RSTR
// M_UNK1 is specific to TMS0270, unknown/unused yet and apparently not connected on every TMS0270
- // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____
- const uint32_t md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 };
+ // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____
+ const u32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 };
for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++)
if (mask & (1 << bit))
@@ -139,11 +139,11 @@ void tms0980_cpu_device::device_reset()
// pre-decode instructionset
m_fixed_decode.resize(0x200);
- memset(&m_fixed_decode[0], 0, 0x200*sizeof(uint32_t));
+ memset(&m_fixed_decode[0], 0, 0x200*sizeof(u32));
m_micro_decode.resize(0x200);
- memset(&m_micro_decode[0], 0, 0x200*sizeof(uint32_t));
+ memset(&m_micro_decode[0], 0, 0x200*sizeof(u32));
- for (uint16_t op = 0; op < 0x200; op++)
+ for (u16 op = 0; op < 0x200; op++)
{
// upper half of the opcodes is always branch/call
if (op & 0x100)
@@ -159,7 +159,7 @@ void tms0980_cpu_device::device_reset()
// like on TMS0970, one of the terms directly select a microinstruction index (via R4-R8),
// but it can't be pre-determined when it's active
m_micro_direct.resize(0x40);
- memset(&m_micro_decode[0], 0, 0x40*sizeof(uint32_t));
+ memset(&m_micro_decode[0], 0, 0x40*sizeof(u32));
for (int op = 0; op < 0x40; op++)
m_micro_direct[op] = decode_micro(op);
@@ -167,7 +167,7 @@ void tms0980_cpu_device::device_reset()
// program counter/opcode decode
-uint32_t tms0980_cpu_device::read_micro()
+u32 tms0980_cpu_device::read_micro()
{
// if ipla term 0 is active, R4-R8 directly select a microinstruction index when R0 or R0^BL is 0
int r0 = m_opcode >> 8 & 1;
@@ -195,10 +195,10 @@ void tms0980_cpu_device::read_opcode()
// i/o handling
-uint8_t tms0980_cpu_device::read_k_input()
+u8 tms0980_cpu_device::read_k_input()
{
- uint8_t k = m_read_k(0, 0xff) & 0x1f;
- uint8_t k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2
+ u8 k = m_read_k(0, 0xff) & 0x1f;
+ u8 k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2
return (k & 0xf) | k3;
}
diff --git a/src/devices/cpu/tms1000/tms0980.h b/src/devices/cpu/tms1000/tms0980.h
index afbcaa3647d..24ef6c000ad 100644
--- a/src/devices/cpu/tms1000/tms0980.h
+++ b/src/devices/cpu/tms1000/tms0980.h
@@ -15,24 +15,24 @@
class tms0980_cpu_device : public tms0970_cpu_device
{
public:
- tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
// overrides
- virtual uint32_t decode_fixed(uint16_t op);
- virtual uint32_t decode_micro(uint8_t sel);
+ virtual u32 decode_fixed(u16 op);
+ virtual u32 decode_micro(u8 sel);
virtual void device_reset() override;
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 2; }
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual u32 disasm_min_opcode_bytes() const override { return 2; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 2; }
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
- virtual uint8_t read_k_input() override;
+ virtual u8 read_k_input() override;
virtual void set_cki_bus() override;
- virtual uint32_t read_micro();
+ virtual u32 read_micro();
virtual void read_opcode() override;
virtual void op_comx() override;
@@ -41,14 +41,14 @@ protected:
class tms1980_cpu_device : public tms0980_cpu_device
{
public:
- tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// overrides
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual void write_o_output(uint8_t index) override { tms1k_base_device::write_o_output(index); }
- virtual uint8_t read_k_input() override { return tms1k_base_device::read_k_input(); }
+ virtual void write_o_output(u8 index) override { tms1k_base_device::write_o_output(index); }
+ virtual u8 read_k_input() override { return tms1k_base_device::read_k_input(); }
virtual void op_setr() override { tms1k_base_device::op_setr(); }
virtual void op_tdo() override;
diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp
index 05ff12e03c6..a971b3e01b8 100644
--- a/src/devices/cpu/tms1000/tms1000.cpp
+++ b/src/devices/cpu/tms1000/tms1000.cpp
@@ -47,31 +47,31 @@ ADDRESS_MAP_END
// device definitions
-tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1k_base_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__)
{ }
-tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms1k_base_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__)
{ }
-tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1040, "TMS1040", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1040", __FILE__)
{ }
-tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__)
{ }
-tms1700_cpu_device::tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1700_cpu_device::tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1700, "TMS1700", tag, owner, clock, 8, 9, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_9bit_8), 6, ADDRESS_MAP_NAME(data_32x4), "tms1700", __FILE__)
{ }
-tms1730_cpu_device::tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1730_cpu_device::tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1730, "TMS1730", tag, owner, clock, 8, 9, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_9bit_8), 6, ADDRESS_MAP_NAME(data_32x4), "tms1730", __FILE__)
{ }
@@ -93,7 +93,7 @@ machine_config_constructor tms1000_cpu_device::device_mconfig_additions() const
// disasm
-offs_t tms1000_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t tms1000_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(tms1000);
return CPU_DISASSEMBLE_NAME(tms1000)(this, stream, pc, oprom, opram, options);
@@ -108,15 +108,15 @@ void tms1000_cpu_device::device_reset()
// pre-decode instructionset
m_fixed_decode.resize(0x100);
- memset(&m_fixed_decode[0], 0, 0x100*sizeof(uint32_t));
+ memset(&m_fixed_decode[0], 0, 0x100*sizeof(u32));
m_micro_decode.resize(0x100);
- memset(&m_micro_decode[0], 0, 0x100*sizeof(uint32_t));
+ memset(&m_micro_decode[0], 0, 0x100*sizeof(u32));
for (int op = 0; op < 0x100; op++)
{
- // _____ _____ ______ _____ ______ _____ _____ _____ _____
- const uint32_t md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO };
- uint16_t mask = m_mpla->read(op);
+ // _____ _____ ______ _____ ______ _____ _____ _____ _____
+ const u32 md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO };
+ u16 mask = m_mpla->read(op);
mask ^= 0x3fc8; // invert active-negative
for (int bit = 0; bit < 16; bit++)
diff --git a/src/devices/cpu/tms1000/tms1000.h b/src/devices/cpu/tms1000/tms1000.h
index 049b24873fd..7e2ac9c0822 100644
--- a/src/devices/cpu/tms1000/tms1000.h
+++ b/src/devices/cpu/tms1000/tms1000.h
@@ -15,8 +15,8 @@
class tms1000_cpu_device : public tms1k_base_device
{
public:
- tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
// overrides
@@ -24,39 +24,39 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
};
class tms1070_cpu_device : public tms1000_cpu_device
{
public:
- tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1040_cpu_device : public tms1000_cpu_device
{
public:
- tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1200_cpu_device : public tms1000_cpu_device
{
public:
- tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1700_cpu_device : public tms1000_cpu_device
{
public:
- tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1730_cpu_device : public tms1000_cpu_device
{
public:
- tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/tms1000/tms1100.cpp b/src/devices/cpu/tms1000/tms1100.cpp
index 93c7c07a69c..f896f60d9eb 100644
--- a/src/devices/cpu/tms1000/tms1100.cpp
+++ b/src/devices/cpu/tms1000/tms1100.cpp
@@ -27,29 +27,29 @@ ADDRESS_MAP_END
// device definitions
-tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_11bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__)
{ }
-tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1100_cpu_device(mconfig, TMS1170, "TMS1170", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1170", __FILE__)
{ }
-tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1100_cpu_device(mconfig, TMS1300, "TMS1300", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__)
{ }
-tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1100_cpu_device(mconfig, TMS1370, "TMS1370", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1370", __FILE__)
{ }
// disasm
-offs_t tms1100_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t tms1100_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(tms1100);
return CPU_DISASSEMBLE_NAME(tms1100)(this, stream, pc, oprom, opram, options);
diff --git a/src/devices/cpu/tms1000/tms1100.h b/src/devices/cpu/tms1000/tms1100.h
index b5df68e40cc..be0b6a70f10 100644
--- a/src/devices/cpu/tms1000/tms1100.h
+++ b/src/devices/cpu/tms1000/tms1100.h
@@ -15,14 +15,14 @@
class tms1100_cpu_device : public tms1000_cpu_device
{
public:
- tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
// overrides
virtual void device_reset() override;
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual void op_setr() override;
virtual void op_rstr() override;
@@ -31,19 +31,19 @@ protected:
class tms1170_cpu_device : public tms1100_cpu_device
{
public:
- tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1300_cpu_device : public tms1100_cpu_device
{
public:
- tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1370_cpu_device : public tms1100_cpu_device
{
public:
- tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/tms1000/tms1400.cpp b/src/devices/cpu/tms1000/tms1400.cpp
index 550911a9752..d8f12700289 100644
--- a/src/devices/cpu/tms1000/tms1400.cpp
+++ b/src/devices/cpu/tms1000/tms1400.cpp
@@ -36,28 +36,28 @@ ADDRESS_MAP_END
// device definitions
-tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1100_cpu_device(mconfig, TMS1400, "TMS1400", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_12bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1400", __FILE__)
{ }
-tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms1100_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1400_cpu_device(mconfig, TMS1470, "TMS1470", tag, owner, clock, 8, 10, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1470", __FILE__)
{ }
-tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1400_cpu_device(mconfig, TMS1600, "TMS1600", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1600", __FILE__)
{ }
-tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: tms1400_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source)
{ }
-tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1600_cpu_device(mconfig, TMS1670, "TMS1670", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1670", __FILE__)
{ }
diff --git a/src/devices/cpu/tms1000/tms1400.h b/src/devices/cpu/tms1000/tms1400.h
index 1bfb59a821e..af8498ad28b 100644
--- a/src/devices/cpu/tms1000/tms1400.h
+++ b/src/devices/cpu/tms1000/tms1400.h
@@ -15,8 +15,8 @@
class tms1400_cpu_device : public tms1100_cpu_device
{
public:
- tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
protected:
// overrides
@@ -34,21 +34,21 @@ protected:
class tms1470_cpu_device : public tms1400_cpu_device
{
public:
- tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class tms1600_cpu_device : public tms1400_cpu_device
{
public:
- tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+ tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
};
class tms1670_cpu_device : public tms1600_cpu_device
{
public:
- tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp
index b8afaa75246..43d86a49fae 100644
--- a/src/devices/cpu/tms1000/tms1k_base.cpp
+++ b/src/devices/cpu/tms1000/tms1k_base.cpp
@@ -274,7 +274,7 @@ void tms1k_base_device::read_opcode()
// i/o handling
//-------------------------------------------------
-void tms1k_base_device::write_o_output(uint8_t index)
+void tms1k_base_device::write_o_output(u8 index)
{
// a hardcoded table is supported if the output pla is unknown
m_o_index = index;
@@ -282,7 +282,7 @@ void tms1k_base_device::write_o_output(uint8_t index)
m_write_o(0, m_o & m_o_mask, 0xffff);
}
-uint8_t tms1k_base_device::read_k_input()
+u8 tms1k_base_device::read_k_input()
{
// K1,2,4,8 (KC test pin is not emulated)
return m_read_k(0, 0xff) & 0xf;
@@ -343,7 +343,7 @@ void tms1k_base_device::op_call()
// CALL/CALLL: conditional call
if (m_status)
{
- uint8_t prev_pa = m_pa;
+ u8 prev_pa = m_pa;
if (m_clatch == 0)
{
diff --git a/src/devices/cpu/tms1000/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h
index 39ccbf31ea1..42b2cb4c1b8 100644
--- a/src/devices/cpu/tms1000/tms1k_base.h
+++ b/src/devices/cpu/tms1000/tms1k_base.h
@@ -84,7 +84,7 @@ class tms1k_base_device : public cpu_device
{
public:
// construction/destruction
- tms1k_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ tms1k_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, u8 o_pins, u8 r_pins, u8 pc_bits, u8 byte_bits, u8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, byte_bits > 8 ? 16 : 8, prgwidth, 0, program)
, m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data)
@@ -109,9 +109,9 @@ public:
template<class _Object> static devcb_base &set_write_o_callback(device_t &device, _Object object) { return downcast<tms1k_base_device &>(device).m_write_o.set_callback(object); }
template<class _Object> static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast<tms1k_base_device &>(device).m_write_r.set_callback(object); }
template<class _Object> static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast<tms1k_base_device &>(device).m_power_off.set_callback(object); }
- static void set_output_pla(device_t &device, const uint16_t *output_pla) { downcast<tms1k_base_device &>(device).m_output_pla_table = output_pla; }
+ static void set_output_pla(device_t &device, const u16 *output_pla) { downcast<tms1k_base_device &>(device).m_output_pla_table = output_pla; }
- uint8_t debug_peek_o_index() { return m_o_index; } // get output PLA index, for debugging (don't use in emulation)
+ u8 debug_peek_o_index() { return m_o_index; } // get output PLA index, for debugging (don't use in emulation)
// microinstructions
enum
@@ -177,25 +177,25 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint32_t execute_min_cycles() const override { return 1; }
- virtual uint32_t execute_max_cycles() const override { return 6; }
- virtual uint32_t execute_input_lines() const override { return 1; }
+ virtual u32 execute_min_cycles() const override { return 1; }
+ virtual u32 execute_max_cycles() const override { return 6; }
+ virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_run() override;
// device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 1; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 1; }
+ virtual u32 disasm_min_opcode_bytes() const override { return 1; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 1; }
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
void next_pc();
- virtual void write_o_output(uint8_t index);
- virtual uint8_t read_k_input();
+ virtual void write_o_output(u8 index);
+ virtual u8 read_k_input();
virtual void set_cki_bus();
virtual void dynamic_output() { ; } // not used by default
virtual void read_opcode();
@@ -232,70 +232,70 @@ protected:
optional_device<pla_device> m_opla;
optional_device<pla_device> m_spla;
- uint8_t m_pc; // 6 or 7-bit program counter
- uint32_t m_sr; // 6 or 7-bit subroutine return register(s)
- uint8_t m_pa; // 4-bit page address register
- uint8_t m_pb; // 4-bit page buffer register
- uint16_t m_ps; // 4-bit page subroutine register(s)
- uint8_t m_a; // 4-bit accumulator
- uint8_t m_x; // 2,3,or 4-bit RAM X register
- uint8_t m_y; // 4-bit RAM Y register
- uint8_t m_ca; // chapter address register
- uint8_t m_cb; // chapter buffer register
- uint16_t m_cs; // chapter subroutine register(s)
- uint16_t m_r;
- uint16_t m_o;
- uint8_t m_cki_bus;
- uint8_t m_c4;
- uint8_t m_p; // 4-bit adder p(lus)-input
- uint8_t m_n; // 4-bit adder n(egative)-input
- uint8_t m_adder_out; // adder result
- uint8_t m_carry_in; // adder carry-in bit
- uint8_t m_carry_out; // adder carry-out bit
- uint8_t m_status;
- uint8_t m_status_latch;
- uint8_t m_eac; // end around carry bit
- uint8_t m_clatch; // call latch bit(s)
- uint8_t m_add; // add latch bit
- uint8_t m_bl; // branch latch bit
-
- uint8_t m_ram_in;
- uint8_t m_dam_in;
- int m_ram_out; // signed!
- uint8_t m_ram_address;
- uint16_t m_rom_address;
- uint16_t m_opcode;
- uint32_t m_fixed;
- uint32_t m_micro;
- int m_subcycle;
- int m_icount;
- uint8_t m_o_index;
-
- uint8_t m_o_pins; // how many O pins
- uint8_t m_r_pins; // how many R pins
- uint8_t m_pc_bits; // how many program counter bits
- uint8_t m_byte_bits; // how many bits per 'byte'
- uint8_t m_x_bits; // how many X register bits
+ u8 m_pc; // 6 or 7-bit program counter
+ u32 m_sr; // 6 or 7-bit subroutine return register(s)
+ u8 m_pa; // 4-bit page address register
+ u8 m_pb; // 4-bit page buffer register
+ u16 m_ps; // 4-bit page subroutine register(s)
+ u8 m_a; // 4-bit accumulator
+ u8 m_x; // 2,3,or 4-bit RAM X register
+ u8 m_y; // 4-bit RAM Y register
+ u8 m_ca; // chapter address register
+ u8 m_cb; // chapter buffer register
+ u16 m_cs; // chapter subroutine register(s)
+ u16 m_r;
+ u16 m_o;
+ u8 m_cki_bus;
+ u8 m_c4;
+ u8 m_p; // 4-bit adder p(lus)-input
+ u8 m_n; // 4-bit adder n(egative)-input
+ u8 m_adder_out; // adder result
+ u8 m_carry_in; // adder carry-in bit
+ u8 m_carry_out; // adder carry-out bit
+ u8 m_status;
+ u8 m_status_latch;
+ u8 m_eac; // end around carry bit
+ u8 m_clatch; // call latch bit(s)
+ u8 m_add; // add latch bit
+ u8 m_bl; // branch latch bit
+
+ u8 m_ram_in;
+ u8 m_dam_in;
+ int m_ram_out; // signed!
+ u8 m_ram_address;
+ u16 m_rom_address;
+ u16 m_opcode;
+ u32 m_fixed;
+ u32 m_micro;
+ int m_subcycle;
+ int m_icount;
+ u8 m_o_index;
+
+ u8 m_o_pins; // how many O pins
+ u8 m_r_pins; // how many R pins
+ u8 m_pc_bits; // how many program counter bits
+ u8 m_byte_bits; // how many bits per 'byte'
+ u8 m_x_bits; // how many X register bits
address_space *m_program;
address_space *m_data;
- const uint16_t *m_output_pla_table;
+ const u16 *m_output_pla_table;
devcb_read8 m_read_k;
devcb_write16 m_write_o;
devcb_write16 m_write_r;
devcb_write_line m_power_off;
- uint32_t m_o_mask;
- uint32_t m_r_mask;
- uint32_t m_k_mask;
- uint32_t m_pc_mask;
- uint32_t m_x_mask;
+ u32 m_o_mask;
+ u32 m_r_mask;
+ u32 m_k_mask;
+ u32 m_pc_mask;
+ u32 m_x_mask;
// lookup tables
- std::vector<uint32_t> m_fixed_decode;
- std::vector<uint32_t> m_micro_decode;
- std::vector<uint32_t> m_micro_direct;
+ std::vector<u32> m_fixed_decode;
+ std::vector<u32> m_micro_decode;
+ std::vector<u32> m_micro_direct;
};
diff --git a/src/devices/cpu/tms1000/tms1k_dasm.cpp b/src/devices/cpu/tms1000/tms1k_dasm.cpp
index 8987a666726..f0afd660470 100644
--- a/src/devices/cpu/tms1000/tms1k_dasm.cpp
+++ b/src/devices/cpu/tms1000/tms1k_dasm.cpp
@@ -39,7 +39,7 @@ static const char *const s_mnemonic[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t s_flags[] =
+static const u32 s_flags[] =
{
0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OVER, 0,
@@ -57,7 +57,7 @@ enum e_addressing
zB0 = 0, zI2, zI3, zI4, zB7
};
-static const uint8_t s_addressing[] =
+static const u8 s_addressing[] =
{
zB0,
zB0, zB0, zB0, zI4, zI4, zI4, zI4, zB0, zB0, zB7, zB7, zB0,
@@ -73,7 +73,7 @@ static const uint8_t s_addressing[] =
// opcode luts
-static const uint8_t tms1000_mnemonic[256] =
+static const u8 tms1000_mnemonic[256] =
{
/* 0x00 */
zCOMX, zA8AAC, zYNEA, zTAM, zTAMZA, zA10AAC, zA6AAC, zDAN, zTKA, zKNEZ, zTDO, zCLO, zRSTR, zSETR, zIA, zRETN, // 0
@@ -97,7 +97,7 @@ static const uint8_t tms1000_mnemonic[256] =
};
-static const uint8_t tms1100_mnemonic[256] =
+static const u8 tms1100_mnemonic[256] =
{
/* 0x00 */
zMNEA, zALEM, zYNEA, zXMA, zDYN, zIYC, zAMAAC, zDMAN, zTKA, zCOMX, zTDO, zCOMC, zRSTR, zSETR, zKNEZ, zRETN, // 0
@@ -121,7 +121,7 @@ static const uint8_t tms1100_mnemonic[256] =
};
-static const uint8_t tms0980_mnemonic[512] =
+static const u8 tms0980_mnemonic[512] =
{
/* 0x000 */
zCOMX, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0
@@ -163,7 +163,7 @@ static const uint8_t tms0980_mnemonic[512] =
};
-static const uint8_t tp0320_mnemonic[512] =
+static const u8 tp0320_mnemonic[512] =
{
/* 0x000 */
0, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0
@@ -208,31 +208,31 @@ static const uint8_t tp0320_mnemonic[512] =
// disasm
-static const uint8_t i2_value[4] =
+static const u8 i2_value[4] =
{
0, 2, 1, 3
};
-static const uint8_t i3_value[8] =
+static const u8 i3_value[8] =
{
0, 4, 2, 6, 1, 5, 3, 7
};
-static const uint8_t i4_value[16] =
+static const u8 i4_value[16] =
{
0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
};
-static offs_t tms1k_dasm(std::ostream &stream, const uint8_t *oprom, const uint8_t *lut_mnemonic, uint16_t opcode_mask)
+static offs_t tms1k_dasm(std::ostream &stream, const u8 *oprom, const u8 *lut_mnemonic, u16 opcode_mask)
{
// get current opcode
int pos = 0;
- uint16_t op = oprom[pos++];
+ u16 op = oprom[pos++];
if (opcode_mask & 0x100)
op = (op << 8 | oprom[pos++]) & 0x1ff;
// convert to mnemonic/param
- uint16_t instr = lut_mnemonic[op];
+ u16 instr = lut_mnemonic[op];
util::stream_format(stream, "%-8s ", s_mnemonic[instr]);
switch( s_addressing[instr] )
diff --git a/src/devices/cpu/tms1000/tp0320.cpp b/src/devices/cpu/tms1000/tp0320.cpp
index cf427cda589..03c66c87e7f 100644
--- a/src/devices/cpu/tms1000/tp0320.cpp
+++ b/src/devices/cpu/tms1000/tp0320.cpp
@@ -36,7 +36,7 @@ ADDRESS_MAP_END
// device definitions
-tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7 /* o pins */, 10 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_192x4), "tp0320", __FILE__)
{ }
@@ -58,7 +58,7 @@ machine_config_constructor tp0320_cpu_device::device_mconfig_additions() const
// disasm
-offs_t tp0320_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t tp0320_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(tp0320);
return CPU_DISASSEMBLE_NAME(tp0320)(this, stream, pc, oprom, opram, options);
@@ -66,16 +66,16 @@ offs_t tp0320_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, co
// device_reset
-uint32_t tp0320_cpu_device::decode_micro(uint8_t sel)
+u32 tp0320_cpu_device::decode_micro(u8 sel)
{
- uint32_t decode = 0;
+ u32 decode = 0;
sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed
- uint32_t mask = m_mpla->read(sel);
+ u32 mask = m_mpla->read(sel);
mask ^= 0x0bff0; // invert active-negative
- // _____ _______ ______ _____ _____ ______ _____ _____ ______ _____ _____
- const uint32_t md[22] = { M_AUTA, M_AUTY, M_SSS, M_STO, M_YTP, M_NDMTP, M_DMTP, M_MTP, M_CKP, M_15TN, M_CKN, M_MTN, M_NATN, M_ATN, M_CME, M_CIN, M_SSE, M_CKM, M_NE, M_C8, M_SETR, M_RSTR };
+ // _____ _______ ______ _____ _____ ______ _____ _____ ______ _____ _____
+ const u32 md[22] = { M_AUTA, M_AUTY, M_SSS, M_STO, M_YTP, M_NDMTP, M_DMTP, M_MTP, M_CKP, M_15TN, M_CKN, M_MTN, M_NATN, M_ATN, M_CME, M_CIN, M_SSE, M_CKM, M_NE, M_C8, M_SETR, M_RSTR };
for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++)
if (mask & (1 << bit))
diff --git a/src/devices/cpu/tms1000/tp0320.h b/src/devices/cpu/tms1000/tp0320.h
index fcff112a900..d5675f0e011 100644
--- a/src/devices/cpu/tms1000/tp0320.h
+++ b/src/devices/cpu/tms1000/tp0320.h
@@ -15,16 +15,16 @@
class tp0320_cpu_device : public tms0980_cpu_device
{
public:
- tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// overrides
//virtual void device_start() override;
- virtual uint32_t decode_fixed(uint16_t op) override { return 0; } // not yet
- virtual uint32_t decode_micro(uint8_t sel) override;
+ virtual u32 decode_fixed(u16 op) override { return 0; } // not yet
+ virtual u32 decode_micro(u8 sel) override;
virtual void device_reset() override;
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
virtual machine_config_constructor device_mconfig_additions() const override;
};
diff --git a/src/devices/cpu/ucom4/ucom4.cpp b/src/devices/cpu/ucom4/ucom4.cpp
index 7b804c4c4f3..aca4996b5fa 100644
--- a/src/devices/cpu/ucom4/ucom4.cpp
+++ b/src/devices/cpu/ucom4/ucom4.cpp
@@ -58,19 +58,19 @@ ADDRESS_MAP_END
// device definitions
-upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_2k), 7 /* data width */, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__)
{ }
-upd557l_cpu_device::upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+upd557l_cpu_device::upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ucom4_cpu_device(mconfig, NEC_D557L, "uPD557L", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd557l", __FILE__)
{ }
-upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ucom4_cpu_device(mconfig, NEC_D650, "uPD650", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd650", __FILE__)
{ }
-upd552_cpu_device::upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+upd552_cpu_device::upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: ucom4_cpu_device(mconfig, NEC_D552, "uPD552", tag, owner, clock, NEC_UCOM44, 1, 10, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "upd552", __FILE__)
{ }
@@ -95,7 +95,7 @@ void ucom4_cpu_device::state_string_export(const device_state_entry &entry, std:
}
}
-offs_t ucom4_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
+offs_t ucom4_cpu_device::disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
{
extern CPU_DISASSEMBLE(ucom4);
return CPU_DISASSEMBLE_NAME(ucom4)(this, stream, pc, oprom, opram, options);
@@ -220,10 +220,10 @@ void ucom4_cpu_device::device_reset()
// default:
// A,B are inputs, C,D are input/output, E,F,G,H,I are output
-uint8_t ucom4_cpu_device::input_r(int index)
+u8 ucom4_cpu_device::input_r(int index)
{
index &= 0xf;
- uint8_t inp = 0;
+ u8 inp = 0;
switch (index)
{
@@ -240,7 +240,7 @@ uint8_t ucom4_cpu_device::input_r(int index)
return inp & 0xf;
}
-void ucom4_cpu_device::output_w(int index, uint8_t data)
+void ucom4_cpu_device::output_w(int index, u8 data)
{
index &= 0xf;
data &= 0xf;
@@ -266,7 +266,7 @@ void ucom4_cpu_device::output_w(int index, uint8_t data)
// uPD557L:
// ports B,H,I are stripped, port G is reduced to 1 pin
-uint8_t upd557l_cpu_device::input_r(int index)
+u8 upd557l_cpu_device::input_r(int index)
{
index &= 0xf;
@@ -278,7 +278,7 @@ uint8_t upd557l_cpu_device::input_r(int index)
return 0;
}
-void upd557l_cpu_device::output_w(int index, uint8_t data)
+void upd557l_cpu_device::output_w(int index, u8 data)
{
index &= 0xf;
data &= 0xf;
diff --git a/src/devices/cpu/ucom4/ucom4.h b/src/devices/cpu/ucom4/ucom4.h
index ca0701734fb..1fb5af93b5a 100644
--- a/src/devices/cpu/ucom4/ucom4.h
+++ b/src/devices/cpu/ucom4/ucom4.h
@@ -100,7 +100,7 @@ class ucom4_cpu_device : public cpu_device
{
public:
// construction/destruction
- ucom4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int family, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ ucom4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, int family, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program)
, m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data)
@@ -141,11 +141,11 @@ protected:
virtual void device_reset() override;
// device_execute_interface overrides
- virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
- virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // "
- virtual uint32_t execute_min_cycles() const override { return 1; }
- virtual uint32_t execute_max_cycles() const override { return 2; }
- virtual uint32_t execute_input_lines() const override { return 1; }
+ virtual u64 execute_clocks_to_cycles(u64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle
+ virtual u64 execute_cycles_to_clocks(u64 cycles) const override { return (cycles * 4); } // "
+ virtual u32 execute_min_cycles() const override { return 1; }
+ virtual u32 execute_max_cycles() const override { return 2; }
+ virtual u32 execute_input_lines() const override { return 1; }
virtual void execute_set_input(int line, int state) override;
virtual void execute_run() override;
@@ -153,9 +153,9 @@ protected:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); }
// device_disasm_interface overrides
- virtual uint32_t disasm_min_opcode_bytes() const override { return 1; }
- virtual uint32_t disasm_max_opcode_bytes() const override { return 2; }
- virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
+ virtual u32 disasm_min_opcode_bytes() const override { return 1; }
+ virtual u32 disasm_max_opcode_bytes() const override { return 2; }
+ virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) override;
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
@@ -169,30 +169,30 @@ protected:
int m_datawidth;
int m_prgmask;
int m_datamask;
- int m_family; // MCU family (43/44/45)
- int m_stack_levels; // number of callstack levels
- uint16_t m_stack[3]; // max 3
- uint8_t m_port_out[0x10]; // last value written to output port
- uint8_t m_op;
- uint8_t m_prev_op; // previous opcode
- uint8_t m_arg; // opcode argument for 2-byte opcodes
- uint8_t m_bitmask; // opcode bit argument
- bool m_skip; // skip next opcode
+ int m_family; // MCU family (43/44/45)
+ int m_stack_levels; // number of callstack levels
+ u16 m_stack[3]; // max 3
+ u8 m_port_out[0x10]; // last value written to output port
+ u8 m_op;
+ u8 m_prev_op; // previous opcode
+ u8 m_arg; // opcode argument for 2-byte opcodes
+ u8 m_bitmask; // opcode bit argument
+ bool m_skip; // skip next opcode
int m_icount;
emu_timer *m_timer;
- uint16_t m_pc; // program counter
- uint16_t m_prev_pc;
- uint8_t m_acc; // 4-bit accumulator
- uint8_t m_dpl; // 4-bit data pointer low (RAM x)
- uint8_t m_dph; // 4-bit(?) data pointer high (RAM y)
- uint8_t m_dph_mask;
- uint8_t m_carry_f; // carry flag
- uint8_t m_carry_s_f; // carry save flag
- uint8_t m_timer_f; // timer out flag
- uint8_t m_int_f; // interrupt flag
- uint8_t m_inte_f; // interrupt enable flag
- int m_int_line; // interrupt pin state
+ u16 m_pc; // program counter
+ u16 m_prev_pc;
+ u8 m_acc; // 4-bit accumulator
+ u8 m_dpl; // 4-bit data pointer low (RAM x)
+ u8 m_dph; // 4-bit(?) data pointer high (RAM y)
+ u8 m_dph_mask;
+ u8 m_carry_f; // carry flag
+ u8 m_carry_s_f; // carry save flag
+ u8 m_timer_f; // timer out flag
+ u8 m_int_f; // interrupt flag
+ u8 m_inte_f; // interrupt enable flag
+ int m_int_line; // interrupt pin state
// i/o handlers
devcb_read8 m_read_a;
@@ -208,23 +208,23 @@ protected:
devcb_write8 m_write_h;
devcb_write8 m_write_i;
- virtual uint8_t input_r(int index);
- virtual void output_w(int index, uint8_t data);
+ virtual u8 input_r(int index);
+ virtual void output_w(int index, u8 data);
// misc internal helpers
void increment_pc();
void fetch_arg();
void do_interrupt();
- uint8_t ram_r();
- void ram_w(uint8_t data);
+ u8 ram_r();
+ void ram_w(u8 data);
void pop_stack();
void push_stack();
bool check_op_43();
TIMER_CALLBACK_MEMBER( simple_timer_cb );
- uint8_t ucom43_reg_r(int index);
- void ucom43_reg_w(int index, uint8_t data);
+ u8 ucom43_reg_r(int index);
+ void ucom43_reg_w(int index, u8 data);
// opcode handlers
void op_illegal();
@@ -316,32 +316,32 @@ protected:
class upd553_cpu_device : public ucom4_cpu_device
{
public:
- upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class upd557l_cpu_device : public ucom4_cpu_device
{
public:
- upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
- virtual uint8_t input_r(int index) override;
- virtual void output_w(int index, uint8_t data) override;
+ virtual u8 input_r(int index) override;
+ virtual void output_w(int index, u8 data) override;
};
class upd650_cpu_device : public ucom4_cpu_device
{
public:
- upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
class upd552_cpu_device : public ucom4_cpu_device
{
public:
- upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/cpu/ucom4/ucom4d.cpp b/src/devices/cpu/ucom4/ucom4d.cpp
index 4b29439b5e9..f83801813ee 100644
--- a/src/devices/cpu/ucom4/ucom4d.cpp
+++ b/src/devices/cpu/ucom4/ucom4d.cpp
@@ -38,7 +38,7 @@ static const char *const s_mnemonics[] =
};
// number of bits per opcode parameter, 2 digits means opcode is 2 bytes
-static const uint8_t s_bits[] =
+static const u8 s_bits[] =
{
4, 0, 2, 80, 4, 0, 0, 0,
0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0,
@@ -54,7 +54,7 @@ static const uint8_t s_bits[] =
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const uint32_t s_flags[] =
+static const u32 s_flags[] =
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -68,7 +68,7 @@ static const uint32_t s_flags[] =
};
-static const uint8_t ucom4_mnemonic[0x100] =
+static const u8 ucom4_mnemonic[0x100] =
{
/* 0x00 */
mNOP, mDI, mS, mTIT, mTC, mTTM, mDAA, mTAL,
@@ -116,8 +116,8 @@ static const uint8_t ucom4_mnemonic[0x100] =
CPU_DISASSEMBLE(ucom4)
{
int pos = 0;
- uint8_t op = oprom[pos++];
- uint8_t instr = ucom4_mnemonic[op];
+ u8 op = oprom[pos++];
+ u8 instr = ucom4_mnemonic[op];
util::stream_format(stream,"%-4s ", s_mnemonics[instr]);
@@ -125,10 +125,10 @@ CPU_DISASSEMBLE(ucom4)
int bits = s_bits[instr];
if (bits)
{
- uint16_t param = op & ((1 << (bits % 10)) - 1);
+ u16 param = op & ((1 << (bits % 10)) - 1);
if (bits / 10)
{
- uint8_t op2 = oprom[pos++];
+ u8 op2 = oprom[pos++];
param = (param << (bits / 10)) | (op2 & ((1 << (bits / 10)) - 1));
bits = (bits % 10) + (bits / 10);
}
diff --git a/src/devices/cpu/ucom4/ucom4op.cpp b/src/devices/cpu/ucom4/ucom4op.cpp
index 8c8e69f9ed4..67d12a95dad 100644
--- a/src/devices/cpu/ucom4/ucom4op.cpp
+++ b/src/devices/cpu/ucom4/ucom4op.cpp
@@ -8,15 +8,15 @@
// internal helpers
-inline uint8_t ucom4_cpu_device::ram_r()
+inline u8 ucom4_cpu_device::ram_r()
{
- uint16_t address = m_dph << 4 | m_dpl;
+ u16 address = m_dph << 4 | m_dpl;
return m_data->read_byte(address & m_datamask) & 0xf;
}
-inline void ucom4_cpu_device::ram_w(uint8_t data)
+inline void ucom4_cpu_device::ram_w(u8 data)
{
- uint16_t address = m_dph << 4 | m_dpl;
+ u16 address = m_dph << 4 | m_dpl;
m_data->write_byte(address & m_datamask, data & 0xf);
}
@@ -105,7 +105,7 @@ void ucom4_cpu_device::op_tla()
void ucom4_cpu_device::op_xm()
{
// XM X: Exchange ACC with RAM, xor DPh with X
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = ram_r();
ram_w(old_acc);
m_dph ^= (m_op & 0x03);
@@ -468,12 +468,12 @@ enum
UCOM43_F
};
-inline uint8_t ucom4_cpu_device::ucom43_reg_r(int index)
+inline u8 ucom4_cpu_device::ucom43_reg_r(int index)
{
return m_data->read_byte(m_datamask - index) & 0xf;
}
-inline void ucom4_cpu_device::ucom43_reg_w(int index, uint8_t data)
+inline void ucom4_cpu_device::ucom43_reg_w(int index, u8 data)
{
m_data->write_byte(m_datamask - index, data & 0xf);
}
@@ -527,7 +527,7 @@ void ucom4_cpu_device::op_xaw()
// XAW: Exchange ACC with W
m_icount--;
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = ucom43_reg_r(UCOM43_W);
ucom43_reg_w(UCOM43_W, old_acc);
}
@@ -538,7 +538,7 @@ void ucom4_cpu_device::op_xaz()
// XAZ: Exchange ACC with Z
m_icount--;
- uint8_t old_acc = m_acc;
+ u8 old_acc = m_acc;
m_acc = ucom43_reg_r(UCOM43_Z);
ucom43_reg_w(UCOM43_Z, old_acc);
}
@@ -549,7 +549,7 @@ void ucom4_cpu_device::op_xhr()
// XHR: Exchange DPh with R
m_icount--;
- uint8_t old_dph = m_dph;
+ u8 old_dph = m_dph;
m_dph = ucom43_reg_r(UCOM43_R);
ucom43_reg_w(UCOM43_R, old_dph);
}
@@ -560,7 +560,7 @@ void ucom4_cpu_device::op_xhx()
// XHX: Exchange DPh with X
m_icount--;
- uint8_t old_dph = m_dph;
+ u8 old_dph = m_dph;
m_dph = ucom43_reg_r(UCOM43_X);
ucom43_reg_w(UCOM43_X, old_dph);
}
@@ -571,7 +571,7 @@ void ucom4_cpu_device::op_xls()
// XLS: Exchange DPl with S
m_icount--;
- uint8_t old_dpl = m_dpl;
+ u8 old_dpl = m_dpl;
m_dpl = ucom43_reg_r(UCOM43_S);
ucom43_reg_w(UCOM43_S, old_dpl);
}
@@ -582,7 +582,7 @@ void ucom4_cpu_device::op_xly()
// XLY: Exchange DPl with Y
m_icount--;
- uint8_t old_dpl = m_dpl;
+ u8 old_dpl = m_dpl;
m_dpl = ucom43_reg_r(UCOM43_Y);
ucom43_reg_w(UCOM43_Y, old_dpl);
}
@@ -592,7 +592,7 @@ void ucom4_cpu_device::op_xc()
if (!check_op_43()) return;
// XC: Exchange Carry F/F with Carry Save F/F
- uint8_t c = m_carry_f;
+ u8 c = m_carry_f;
m_carry_f = m_carry_s_f;
m_carry_s_f = c;
}
@@ -644,7 +644,7 @@ void ucom4_cpu_device::op_rar()
if (!check_op_43()) return;
// RAR: Rotate ACC Right through Carry F/F
- uint8_t c = m_acc & 1;
+ u8 c = m_acc & 1;
m_acc = m_acc >> 1 | m_carry_f << 3;
m_carry_f = c;
}
@@ -657,7 +657,7 @@ void ucom4_cpu_device::op_inm()
if (!check_op_43()) return;
// INM: Increment RAM, skip next on carry
- uint8_t val = (ram_r() + 1) & 0xf;
+ u8 val = (ram_r() + 1) & 0xf;
ram_w(val);
m_skip = (val == 0);
}
@@ -667,7 +667,7 @@ void ucom4_cpu_device::op_dem()
if (!check_op_43()) return;
// DEM: Decrement RAM, skip next on carry
- uint8_t val = (ram_r() - 1) & 0xf;
+ u8 val = (ram_r() - 1) & 0xf;
ram_w(val);
m_skip = (val == 0xf);
}
diff --git a/src/devices/machine/tms1024.cpp b/src/devices/machine/tms1024.cpp
index d9a268a1280..a1d4cd551db 100644
--- a/src/devices/machine/tms1024.cpp
+++ b/src/devices/machine/tms1024.cpp
@@ -24,19 +24,19 @@ const device_type TMS1025 = &device_creator<tms1025_device>;
// constructor
//-------------------------------------------------
-tms1024_device::tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1024_device::tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TMS1024, "TMS1024 I/O Expander", tag, owner, clock, "tms1024", __FILE__), m_h(0), m_s(0), m_std(0),
m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this)
{
}
-tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
+tms1024_device::tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_h(0), m_s(0), m_std(0),
m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this)
{
}
-tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms1024_device(mconfig, TMS1025, "TMS1025 I/O Expander", tag, owner, clock, "tms1025", __FILE__)
{
}
diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h
index 323b083e841..af1a428d9f1 100644
--- a/src/devices/machine/tms1024.h
+++ b/src/devices/machine/tms1024.h
@@ -64,8 +64,8 @@ enum
class tms1024_device : public device_t
{
public:
- tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms1024_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source);
// static configuration helpers
template<class _Object> static devcb_base &set_write_port1_callback(device_t &device, _Object object) { return downcast<tms1024_device &>(device).m_write_port1.set_callback(object); }
@@ -85,9 +85,9 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
- uint8_t m_h; // 4-bit data latch
- uint8_t m_s; // 3-bit port select
- uint8_t m_std; // strobe pin
+ u8 m_h; // 4-bit data latch
+ u8 m_s; // 3-bit port select
+ u8 m_std; // strobe pin
// callbacks
devcb_write8 m_write_port1, m_write_port2, m_write_port3, m_write_port4, m_write_port5, m_write_port6, m_write_port7;
@@ -98,7 +98,7 @@ protected:
class tms1025_device : public tms1024_device
{
public:
- tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};
diff --git a/src/devices/machine/tms6100.cpp b/src/devices/machine/tms6100.cpp
index fd28ffeae2d..6068a5865aa 100644
--- a/src/devices/machine/tms6100.cpp
+++ b/src/devices/machine/tms6100.cpp
@@ -27,7 +27,7 @@
const device_type TMS6100 = &device_creator<tms6100_device>;
-tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
+tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
m_rom(*this, DEVICE_SELF),
m_reverse_bits(false),
@@ -35,7 +35,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, device_type type,
{
}
-tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock, "tms6100", __FILE__),
m_rom(*this, DEVICE_SELF),
m_reverse_bits(false),
@@ -45,7 +45,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, d
const device_type M58819 = &device_creator<m58819_device>;
-m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: tms6100_device(mconfig, M58819, "M58819S", tag, owner, clock, "m58819s", __FILE__)
{
}
@@ -144,7 +144,7 @@ WRITE_LINE_MEMBER(tms6100_device::clk_w)
if (m_cs)
{
// new command enabled on rising edge of m0/m1
- uint8_t m = m_m1 << 1 | m_m0;
+ u8 m = m_m1 << 1 | m_m0;
if ((m & ~m_prev_m & 1) || (m & ~m_prev_m & 2))
handle_command(m);
@@ -158,7 +158,7 @@ WRITE_LINE_MEMBER(tms6100_device::clk_w)
// m0/m1 commands
-void tms6100_device::handle_command(uint8_t cmd)
+void tms6100_device::handle_command(u8 cmd)
{
enum
{
@@ -229,7 +229,7 @@ void tms6100_device::handle_command(uint8_t cmd)
// the 8-step counter PLA is shared between LA and TB
if (m_count < 4)
{
- const uint8_t shift = 4 * (m_count+1);
+ const u8 shift = 4 * (m_count+1);
m_address = (m_address & ~(0xf << shift)) | (m_add << shift);
}
@@ -245,7 +245,7 @@ void tms6100_device::handle_command(uint8_t cmd)
m_count = 0;
// load new address bits (14 bits on TMS6100)
- uint16_t rb = m_rom[m_address & m_rommask];
+ u16 rb = m_rom[m_address & m_rommask];
m_address++;
rb |= (m_rom[m_address & m_rommask] << 8);
m_address = (m_address & ~0x3fff) | (rb & 0x3fff);
diff --git a/src/devices/machine/tms6100.h b/src/devices/machine/tms6100.h
index 93a4f06826f..e36cf12615e 100644
--- a/src/devices/machine/tms6100.h
+++ b/src/devices/machine/tms6100.h
@@ -94,8 +94,8 @@
class tms6100_device : public device_t
{
public:
- tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source);
static void enable_4bit_mode(device_t &device) { downcast<tms6100_device &>(device).m_4bit_mode = true; }
@@ -113,34 +113,34 @@ protected:
// device-level overrides
virtual void device_start() override;
- void handle_command(uint8_t cmd);
+ void handle_command(u8 cmd);
// internal state
- required_region_ptr<uint8_t> m_rom;
+ required_region_ptr<u8> m_rom;
bool m_reverse_bits;
bool m_4bit_mode;
- uint32_t m_rommask;
- uint32_t m_address; // internal address + chipselect
- uint8_t m_sa; // romdata shift register
- uint8_t m_count; // TB/LA counter (-> PLA)
- uint8_t m_prev_cmd; // previous handled command
- uint8_t m_prev_m; // previous valid m0/m1 state
+ u32 m_rommask;
+ u32 m_address; // internal address + chipselect
+ u8 m_sa; // romdata shift register
+ u8 m_count; // TB/LA counter (-> PLA)
+ u8 m_prev_cmd; // previous handled command
+ u8 m_prev_m; // previous valid m0/m1 state
- uint8_t m_add; // ADD/DATA pins input
- uint8_t m_data; // ADD/DATA pins output
+ u8 m_add; // ADD/DATA pins input
+ u8 m_data; // ADD/DATA pins output
int m_m0;
int m_m1;
- int m_cs; // chipselect pin
- int m_clk; // CLK pin
- int m_rck; // RCK pin (mask/gate to CLK?)
+ int m_cs; // chipselect pin
+ int m_clk; // CLK pin
+ int m_rck; // RCK pin (mask/gate to CLK?)
};
class m58819_device : public tms6100_device
{
public:
- m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// device-level overrides
diff --git a/src/emu/main.cpp b/src/emu/main.cpp
index e8e07ea52b1..ea77d976b00 100644
--- a/src/emu/main.cpp
+++ b/src/emu/main.cpp
@@ -182,7 +182,7 @@ void machine_manager::start_http_server()
endpoint.on_open = [&](auto connection) {
auto send_stream = std::make_shared<webpp::ws_server::SendStream>();
*send_stream << "update_machine";
- m_wsserver->send(connection, send_stream, [](const std::error_code& ec) { });
+ m_wsserver->send(connection, send_stream);
};
m_server->on_upgrade = [this](auto socket, auto request) {
diff --git a/src/lib/formats/apd_dsk.cpp b/src/lib/formats/apd_dsk.cpp
new file mode 100644
index 00000000000..cd5de8ad206
--- /dev/null
+++ b/src/lib/formats/apd_dsk.cpp
@@ -0,0 +1,124 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/*********************************************************************
+
+ formats/apd_dsk.c
+
+ Archimedes Protected Disk Image format
+
+*********************************************************************/
+
+#include <zlib.h>
+#include "formats/apd_dsk.h"
+
+static const uint8_t APD_HEADER[8] = { 0x41, 0x50, 0x44, 0x58, 0x30, 0x30, 0x30, 0x31 };
+static const uint8_t GZ_HEADER[2] = { 0x1f, 0x8b };
+
+apd_format::apd_format()
+{
+}
+
+const char *apd_format::name() const
+{
+ return "apd";
+}
+
+const char *apd_format::description() const
+{
+ return "Archimedes Protected Disk Image";
+}
+
+const char *apd_format::extensions() const
+{
+ return "apd";
+}
+
+int apd_format::identify(io_generic *io, uint32_t form_factor)
+{
+ char h[8];
+
+ io_generic_read(io, h, 0, 8);
+ if (!memcmp(h, GZ_HEADER, sizeof(GZ_HEADER)) || !memcmp(h, APD_HEADER, sizeof(APD_HEADER))) {
+ return 100;
+ }
+
+ return 0;
+}
+
+bool apd_format::load(io_generic *io, uint32_t form_factor, floppy_image *image)
+{
+ uint64_t size = io_generic_size(io);
+ std::vector<uint8_t> img(size);
+ io_generic_read(io, &img[0], 0, size);
+
+ int err;
+ std::vector<uint8_t> gz_ptr;
+ z_stream d_stream;
+ int inflate_size = (img[size - 1] << 24) | (img[size - 2] << 16) | (img[size - 3] << 8) | img[size - 4];
+ uint8_t *in_ptr = &img[0];
+
+ gz_ptr.resize(inflate_size);
+
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
+ d_stream.next_in = in_ptr;
+ d_stream.avail_in = size;
+ d_stream.next_out = &gz_ptr[0];
+ d_stream.avail_out = inflate_size;
+
+ err = inflateInit2(&d_stream, MAX_WBITS | 16);
+ if (err != Z_OK) {
+ LOG_FORMATS("inflateInit2 error: %d\n", err);
+ return false;
+ }
+ err = inflate(&d_stream, Z_FINISH);
+ if (err != Z_STREAM_END && err != Z_OK) {
+ LOG_FORMATS("inflate error: %d\n", err);
+ return false;
+ }
+ err = inflateEnd(&d_stream);
+ if (err != Z_OK) {
+ LOG_FORMATS("inflateEnd error: %d\n", err);
+ return false;
+ }
+ size = inflate_size;
+ img = gz_ptr;
+
+ if (memcmp(&img[0], APD_HEADER, sizeof(APD_HEADER))) {
+ LOG_FORMATS("apd_dsk: floppy image has incorrect header\n");
+ return false;
+ }
+
+ int data = 0x7d0;
+ for (int track = 0; track < 83; track++) {
+ for (int side = 0; side < 2; side++) {
+ uint32_t sdlen = little_endianize_int32(*(uint32_t *)(&img[(track * 2 + side) * 12 + 8 + 0x0]));
+ uint32_t ddlen = little_endianize_int32(*(uint32_t *)(&img[(track * 2 + side) * 12 + 8 + 0x4]));
+ uint32_t qdlen = little_endianize_int32(*(uint32_t *)(&img[(track * 2 + side) * 12 + 8 + 0x8]));
+
+ if (sdlen > 0) {
+ generate_track_from_bitstream(track, side, &img[data], sdlen, image);
+ data += (sdlen + 7) >> 3;
+ }
+ if (ddlen > 0) {
+ generate_track_from_bitstream(track, side, &img[data], ddlen, image);
+ data += (ddlen + 7) >> 3;
+ }
+ if (qdlen > 0) {
+ generate_track_from_bitstream(track, side, &img[data], qdlen, image);
+ data += (qdlen + 7) >> 3;
+ }
+ }
+ }
+ image->set_variant(floppy_image::DSDD);
+
+ return true;
+}
+
+bool apd_format::supports_save() const
+{
+ return false;
+}
+
+const floppy_format_type FLOPPY_APD_FORMAT = &floppy_image_format_creator<apd_format>;
diff --git a/src/lib/formats/apd_dsk.h b/src/lib/formats/apd_dsk.h
new file mode 100644
index 00000000000..3bf40055a7b
--- /dev/null
+++ b/src/lib/formats/apd_dsk.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/*********************************************************************
+
+ formats/apd_dsk.h
+
+ Archimedes Protected Disk Image format
+
+*********************************************************************/
+
+#ifndef APD_DSK_H_
+#define APD_DSK_H_
+
+#include "flopimg.h"
+
+class apd_format : public floppy_image_format_t {
+public:
+ apd_format();
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, uint32_t form_factor) override;
+ virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override;
+ virtual bool supports_save() const override;
+};
+
+extern const floppy_format_type FLOPPY_APD_FORMAT;
+
+#endif
diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp
index 897c242b3e8..fe40f47eeba 100644
--- a/src/lib/netlist/analog/nld_bjt.cpp
+++ b/src/lib/netlist/analog/nld_bjt.cpp
@@ -11,7 +11,7 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
class diode
{
@@ -82,9 +82,9 @@ NETLIB_UPDATE(QBJT_switch)
NETLIB_UPDATE_PARAM(QBJT_switch)
{
- nl_double IS = m_model.model_value("IS");
- nl_double BF = m_model.model_value("BF");
- nl_double NF = m_model.model_value("NF");
+ nl_double IS = m_model.m_IS;
+ nl_double BF = m_model.m_BF;
+ nl_double NF = m_model.m_NF;
//nl_double VJE = m_model.dValue("VJE", 0.75);
set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
@@ -176,11 +176,11 @@ NETLIB_UPDATE_TERMINALS(QBJT_EB)
NETLIB_UPDATE_PARAM(QBJT_EB)
{
- nl_double IS = m_model.model_value("IS");
- nl_double BF = m_model.model_value("BF");
- nl_double NF = m_model.model_value("NF");
- nl_double BR = m_model.model_value("BR");
- nl_double NR = m_model.model_value("NR");
+ nl_double IS = m_model.m_IS;
+ nl_double BF = m_model.m_BF;
+ nl_double NF = m_model.m_NF;
+ nl_double BR = m_model.m_BR;
+ nl_double NR = m_model.m_NR;
//nl_double VJE = m_model.dValue("VJE", 0.75);
set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
@@ -192,5 +192,11 @@ NETLIB_UPDATE_PARAM(QBJT_EB)
m_gD_BC.set_param(IS / m_alpha_r, NR, netlist().gmin());
}
- } //namespace devices
+ } //namespace analog
+
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, QBJT_EB)
+ NETLIB_DEVICE_IMPL_NS(analog, QBJT_switch)
+ }
+
} // namespace netlist
diff --git a/src/lib/netlist/analog/nld_bjt.h b/src/lib/netlist/analog/nld_bjt.h
index 7d137249b21..14b6b2ba484 100644
--- a/src/lib/netlist/analog/nld_bjt.h
+++ b/src/lib/netlist/analog/nld_bjt.h
@@ -15,6 +15,8 @@
// Macros
// -----------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
+
#define QBJT_SW(name, model) \
NET_REGISTER_DEV(QBJT_SW, name) \
NETDEV_PARAMI(name, MODEL, model)
@@ -23,16 +25,88 @@
NET_REGISTER_DEV(QBJT_EB, name) \
NETDEV_PARAMI(name, MODEL, model)
+#endif
namespace netlist
{
- namespace devices
+ namespace analog
{
// -----------------------------------------------------------------------------
// nld_Q - Base classes
// -----------------------------------------------------------------------------
-// Have a common start for transistors
+ /* FIXME: Make table pretty */
+
+ /*! Class representing the bjt model paramers.
+ * This is the model representation of the bjt model. Typically, SPICE uses
+ * the following parameters. A "Y" in the first column indicates that the
+ * parameter is actually used in netlist.
+ *
+ * |NL? |name |parameter |units|default| example|area |
+ * |:--:|:-----|:--------------------------------|:----|------:|-------:|:----:|
+ * | Y |IS |transport saturation current|A |1E-016|1E-015|* |
+ * | Y |BF |ideal maximum forward beta|- |100|100| |
+ * | Y |NF |forward current emission coefficient|- |1|1| |
+ * | |VAF |forward Early voltage|V |infinite |200| |
+ * | |IKF |corner for forward beta high current roll-off|A |infinite |0.01|* |
+ * | |ISE |B-E leakage saturation current|A |0|0.0000000000001|* |
+ * | |NE |B-E leakage emission coefficient|- |1.5|2| |
+ * | Y |BR |ideal maximum reverse beta |- |1|0.1| |
+ * | Y |NR |reverse current emission coefficient|- |1|1| |
+ * | |VAR |reverse Early voltage|V |infinite |200| |
+ * | |IKR |corner for reverse beta high current roll-off|A |infinite |0.01|* |
+ * | |ISC |leakage saturation current|A |0|8| |
+ * | |NC |leakage emission coefficient|- |2|1.5| |
+ * | |RB |zero bias base resistance| |0|100|* |
+ * | |IRB |current where base resistance falls halfway to its min value|A |infinte |0.1|* |
+ * | |RBM |minimum base resistance at high currents| |RB |10|* |
+ * | |RE |emitter resistance| |0|1|* |
+ * | |RC |collector resistance | |0|10|* |
+ * | |CJE |B-E zero-bias depletion capacitance|F |0|2pF |* |
+ * | |VJE |B-E built-in potential|V |0.75|0.6| |
+ * | |MJE |B-E junction exponential factor |- |0.33|0.33| |
+ * | |TF |ideal forward transit time |sec |0|0.1ns | |
+ * | |XTF|coefficient for bias dependence of TF |- |0| | |
+ * | |VTF |voltage describing VBC dependence of TF |V |infinite | | |
+ * | |ITF |high-current parameter for effect on TF |A |0| |* |
+ * | |PTF |excess phase at freq=1.0/(TF*2PI) Hz |deg |0| | |
+ * | |CJC |B-C zero-bias depletion capacitance |F |0|2pF |* |
+ * | |VJC |B-C built-in potential |V |0.75|0.5| |
+ * | |MJC |B-C junction exponential factor |- |0.33|0.5| |
+ * | |XCJC |fraction of B-C depletion capacitance connected to internal base node |- |1| | |
+ * | |TR |ideal reverse transit time |sec |0|10ns | |
+ * | |CJS |zero-bias collector-substrate capacitance |F |0|2pF |* |
+ * | |VJS |substrate junction built-in potential |V |0.75| | |
+ * | |MJS |substrate junction exponential factor |- |0|0.5| |
+ * | |XTB |forward and reverse beta temperature exponent |- |0| | |
+ * | |EG|energy gap for temperature effect on IS |eV |1.11| | |
+ * | |XTI|temperature exponent for effect on IS |- |3| | |
+ * | |KF |flicker-noise coefficient |- |0| | |
+ * | |AF |flicker-noise exponent |- |1| | |
+ * | |FC |coefficient for forward-bias depletion capacitance formula |- |0.5| | |
+ * | |TNOM |Parameter measurement temperature |C |27|50| |
+ */
+
+ class bjt_model_t : public param_model_t
+ {
+ public:
+ bjt_model_t(device_t &device, const pstring name, const pstring val)
+ : param_model_t(device, name, val)
+ , m_IS(*this, "IS")
+ , m_BF(*this, "BF")
+ , m_NF(*this, "NF")
+ , m_BR(*this, "BR")
+ , m_NR(*this, "NR")
+ {}
+
+ value_t m_IS; //!< transport saturation current
+ value_t m_BF; //!< ideal maximum forward beta
+ value_t m_NF; //!< forward current emission coefficient
+ value_t m_BR; //!< ideal maximum reverse beta
+ value_t m_NR; //!< reverse current emission coefficient
+ };
+
+ // Have a common start for transistors
NETLIB_OBJECT(Q)
{
@@ -58,7 +132,7 @@ public:
inline void set_qtype(q_type atype) { m_qtype = atype; }
protected:
- param_model_t m_model;
+ bjt_model_t m_model;
private:
q_type m_qtype;
};
diff --git a/src/lib/netlist/analog/nld_fourterm.cpp b/src/lib/netlist/analog/nld_fourterm.cpp
index 31ea09339cf..c97707bf382 100644
--- a/src/lib/netlist/analog/nld_fourterm.cpp
+++ b/src/lib/netlist/analog/nld_fourterm.cpp
@@ -11,7 +11,7 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
// ----------------------------------------------------------------------------------------
// nld_VCCS
@@ -119,5 +119,12 @@ NETLIB_RESET(VCVS)
m_ON2.set(NL_FCONST(1.0) / m_RO());
}
- } //namespace devices
+ } //namespace analog
+
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, VCVS)
+ NETLIB_DEVICE_IMPL_NS(analog, VCCS)
+ NETLIB_DEVICE_IMPL_NS(analog, CCCS)
+ NETLIB_DEVICE_IMPL_NS(analog, LVCCS)
+ }
} // namespace netlist
diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h
index e1170eb010d..3861d57f6ad 100644
--- a/src/lib/netlist/analog/nld_fourterm.h
+++ b/src/lib/netlist/analog/nld_fourterm.h
@@ -15,6 +15,7 @@
// ----------------------------------------------------------------------------------------
// Macros
// ----------------------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
#define VCCS(name) \
NET_REGISTER_DEV(VCCS, name)
@@ -28,9 +29,11 @@
#define LVCCS(name) \
NET_REGISTER_DEV(LVCCS, name)
+#endif
+
namespace netlist
{
- namespace devices
+ namespace analog
{
// ----------------------------------------------------------------------------------------
// nld_VCCS
diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp
index b081f922696..ff64516186b 100644
--- a/src/lib/netlist/analog/nld_opamps.cpp
+++ b/src/lib/netlist/analog/nld_opamps.cpp
@@ -5,102 +5,182 @@
*
*/
-#include "nld_opamps.h"
#include "devices/net_lib.h"
+#include "nld_opamps.h"
+
namespace netlist
{
- namespace devices
+ namespace analog
{
-/*
- * Type = 0: Impedance changer
- * 1; Idealized opamp
- * 2; opamp with first pole
- * 3: opamp with first pole + output limit
- * 4: opamp with input stage, first pole + output limit
- *
- * Type 1 parameters:
- * FPF = frequency of first pole in Hz (ony used for open-loop gain)
- * UGF = unity gain frequency in Hz (only used for open-loop gain)
- * RI = input resistance in Ohms
- * RO = output resistance in Ohms
- *
- * Type 3 parameters:
- * VLH = high supply rail minus high output swing in V
- * VLL = low output swing minus low supply rail in V
- * FPF = frequency of first pole in Hz
- * UGF = unity gain frequency (transition frequency) in Hz
- * SLEW = unity gain slew rate in V/s
- * RI = input resistance in Ohms
- * RO = output resistance in Ohms
- * DAB = Differential Amp Bias ~ op amp's total quiescent current.
- *
- * .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002)
- *
- * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
- *
- * */
+ /*
+ * Type = 0: Impedance changer
+ * 1; Idealized opamp
+ * 2; opamp with first pole
+ * 3: opamp with first pole + output limit
+ * 4: opamp with input stage, first pole + output limit
+ *
+ * Type 1 parameters:
+ * FPF = frequency of first pole in Hz (ony used for open-loop gain)
+ * UGF = unity gain frequency in Hz (only used for open-loop gain)
+ * RI = input resistance in Ohms
+ * RO = output resistance in Ohms
+ *
+ * Type 3 parameters:
+ * VLH = high supply rail minus high output swing in V
+ * VLL = low output swing minus low supply rail in V
+ * FPF = frequency of first pole in Hz
+ * UGF = unity gain frequency (transition frequency) in Hz
+ * SLEW = unity gain slew rate in V/s
+ * RI = input resistance in Ohms
+ * RO = output resistance in Ohms
+ * DAB = Differential Amp Bias ~ op amp's total quiescent current.
+ *
+ * .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002)
+ *
+ * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
+ *
+ * */
-NETLIB_UPDATE(OPAMP)
-{
- const double cVt = 0.0258 * 1.0; // * m_n;
- const double cId = m_model.model_value("DAB"); // 3 mA
- const double cVd = cVt * std::log(cId / 1e-15 + 1.0);
- m_VH.push(m_VCC() - m_model.model_value("VLH") - cVd);
- m_VL.push(m_GND() + m_model.model_value("VLL") + cVd);
- m_VREF.push((m_VCC() + m_GND()) / 2.0);
-}
-
-NETLIB_RESET(OPAMP)
-{
- m_G1.do_reset();
- m_G1.m_RI.setTo(m_model.model_value("RI"));
- if (m_type == 1)
+ NETLIB_OBJECT(opamp)
{
- double RO = m_model.model_value("RO");
- double G = m_model.model_value("UGF") / m_model.model_value("FPF") / RO;
- m_RP.set_R(RO);
- m_G1.m_G.setTo(G);
+ NETLIB_CONSTRUCTOR(opamp)
+ , m_RP(*this, "RP1")
+ , m_G1(*this, "G1")
+ , m_VCC(*this, "VCC")
+ , m_GND(*this, "GND")
+ , m_model(*this, "MODEL", "LM324")
+ , m_VH(*this, "VH")
+ , m_VL(*this, "VL")
+ , m_VREF(*this, "VREF")
+ {
+ m_type = static_cast<int>(m_model.m_TYPE);
+
+ if (m_type == 1)
+ {
+ register_subalias("PLUS", "G1.IP");
+ register_subalias("MINUS", "G1.IN");
+ register_subalias("OUT", "G1.OP");
+
+ connect("G1.ON", "VREF");
+ connect("RP1.2", "VREF");
+ connect("RP1.1", "G1.OP");
+
+ }
+ else if (m_type == 3)
+ {
+ register_sub("CP1", m_CP);
+ register_sub("EBUF", m_EBUF);
+ register_sub("DN", m_DN, "D(IS=1e-15 N=1)");
+ register_sub("DP", m_DP, "D(IS=1e-15 N=1)");
+
+ //m_DP->m_model.setTo("D(IS=1e-15 N=1)");
+ //m_DN->m_model.setTo("D(IS=1e-15 N=1)");
+
+ register_subalias("PLUS", "G1.IP");
+ register_subalias("MINUS", "G1.IN");
+ register_subalias("OUT", "EBUF.OP");
+
+ connect("EBUF.ON", "VREF");
+
+ connect("G1.ON", "VREF");
+ connect("RP1.2", "VREF");
+ connect("CP1.2", "VREF");
+ connect("EBUF.IN", "VREF");
+
+ connect("RP1.1", "G1.OP");
+ connect("CP1.1", "RP1.1");
+
+ connect("DP.K", "VH");
+ connect("VL", "DN.A");
+ connect("DP.A", "DN.K");
+ connect("DN.K", "RP1.1");
+ connect("EBUF.IP", "RP1.1");
+ }
+ else
+ netlist().log().fatal("Unknown opamp type: {1}", m_type);
+
+ }
+
+ NETLIB_UPDATEI();
+ NETLIB_RESETI();
+ NETLIB_UPDATE_PARAMI()
+ {
+ }
+
+ private:
+
+ analog::NETLIB_SUB(R_base) m_RP;
+ analog::NETLIB_SUB(VCCS) m_G1;
+ NETLIB_SUBXX(analog, C) m_CP;
+ NETLIB_SUBXX(analog, VCVS) m_EBUF;
+ NETLIB_SUBXX(analog, D) m_DP;
+ NETLIB_SUBXX(analog, D) m_DN;
+
+ analog_input_t m_VCC;
+ analog_input_t m_GND;
+
+ opamp_model_t m_model;
+ analog_output_t m_VH;
+ analog_output_t m_VL;
+ analog_output_t m_VREF;
+
+ /* state */
+ int m_type;
+ };
+
+ NETLIB_UPDATE(opamp)
+ {
+ const double cVt = 0.0258 * 1.0; // * m_n;
+ const double cId = m_model.m_DAB; // 3 mA
+ const double cVd = cVt * std::log(cId / 1e-15 + 1.0);
+ m_VH.push(m_VCC() - m_model.m_VLH - cVd);
+ m_VL.push(m_GND() + m_model.m_VLL + cVd);
+ m_VREF.push((m_VCC() + m_GND()) / 2.0);
}
- else if (m_type == 3)
+
+ NETLIB_RESET(opamp)
{
- m_EBUF->do_reset();
- m_DP->do_reset();
- m_DN->do_reset();
- m_CP->do_reset();
- m_RP.do_reset();
+ m_G1.do_reset();
+ m_G1.m_RI.setTo(m_model.m_RI);
+
+ if (m_type == 1)
+ {
+ double RO = m_model.m_RO;
+ double G = m_model.m_UGF / m_model.m_FPF / RO;
+ m_RP.set_R(RO);
+ m_G1.m_G.setTo(G);
+ }
+ else if (m_type == 3)
+ {
+ m_EBUF->do_reset();
+ m_DP->do_reset();
+ m_DN->do_reset();
+ m_CP->do_reset();
+ m_RP.do_reset();
- m_EBUF->m_G.setTo(1.0);
- m_EBUF->m_RO.setTo(m_model.model_value("RO"));
+ m_EBUF->m_G.setTo(1.0);
+ m_EBUF->m_RO.setTo(m_model.m_RO);
- double CP = m_model.model_value("DAB") / m_model.model_value("SLEW");
- double RP = 0.5 / 3.1459 / CP / m_model.model_value("FPF");
- double G = m_model.model_value("UGF") / m_model.model_value("FPF") / RP;
+ double CP = m_model.m_DAB / m_model.m_SLEW;
+ double RP = 0.5 / 3.1459 / CP / m_model.m_FPF;
+ double G = m_model.m_UGF / m_model.m_FPF / RP;
- //printf("Min Freq %s: %f\n", name().c_str(), 1.0 / (CP*RP / (G*RP)));
+ //printf("Min Freq %s: %f\n", name().c_str(), 1.0 / (CP*RP / (G*RP)));
- m_CP->m_C.setTo(CP);
- m_RP.set_R(RP);
- m_G1.m_G.setTo(G);
+ m_CP->m_C.setTo(CP);
+ m_RP.set_R(RP);
+ m_G1.m_G.setTo(G);
+ }
}
-}
-/*
-NETLIB_DEVICE_WITH_PARAMS(OPAMPx,
- NETLIB_NAME(R) m_RP;
- NETLIB_NAME(C) m_CP;
- NETLIB_NAME(VCCS) m_G1;
- NETLIB_NAME(VCVS) m_EBUF;
-
- param_model_t m_model;
- analog_input_t m_VH;
- analog_input_t m_VL;
- analog_input_t m_VREF;
-);
-*/
-
- } //namespace devices
+
+ } //namespace analog
+
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, opamp)
+ }
} // namespace netlist
diff --git a/src/lib/netlist/analog/nld_opamps.h b/src/lib/netlist/analog/nld_opamps.h
index f02a64a2347..0218649b542 100644
--- a/src/lib/netlist/analog/nld_opamps.h
+++ b/src/lib/netlist/analog/nld_opamps.h
@@ -19,106 +19,79 @@
// Macros
// ----------------------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
+
#define OPAMP(name, model) \
NET_REGISTER_DEV(OPAMP, name) \
NETDEV_PARAMI(name, MODEL, model)
+#endif
// ----------------------------------------------------------------------------------------
// Devices ...
// ----------------------------------------------------------------------------------------
namespace netlist
{
- namespace devices
- {
-NETLIB_OBJECT(OPAMP)
-{
- NETLIB_CONSTRUCTOR(OPAMP)
- , m_RP(*this, "RP1")
- , m_G1(*this, "G1")
- , m_VCC(*this, "VCC")
- , m_GND(*this, "GND")
- , m_model(*this, "MODEL", "LM324")
- , m_VH(*this, "VH")
- , m_VL(*this, "VL")
- , m_VREF(*this, "VREF")
+ namespace analog
{
- m_type = static_cast<int>(m_model.model_value("TYPE"));
-
- if (m_type == 1)
- {
- register_subalias("PLUS", "G1.IP");
- register_subalias("MINUS", "G1.IN");
- register_subalias("OUT", "G1.OP");
-
- connect("G1.ON", "VREF");
- connect("RP1.2", "VREF");
- connect("RP1.1", "G1.OP");
-
- }
- else if (m_type == 3)
- {
- register_sub("CP1", m_CP);
- register_sub("EBUF", m_EBUF);
- register_sub("DN", m_DN);
- register_sub("DP", m_DP);
-
- m_DP->m_model.setTo("D(IS=1e-15 N=1)");
- m_DN->m_model.setTo("D(IS=1e-15 N=1)");
-
- register_subalias("PLUS", "G1.IP");
- register_subalias("MINUS", "G1.IN");
- register_subalias("OUT", "EBUF.OP");
-
- connect("EBUF.ON", "VREF");
-
- connect("G1.ON", "VREF");
- connect("RP1.2", "VREF");
- connect("CP1.2", "VREF");
- connect("EBUF.IN", "VREF");
- connect("RP1.1", "G1.OP");
- connect("CP1.1", "RP1.1");
-
- connect("DP.K", "VH");
- connect("VL", "DN.A");
- connect("DP.A", "DN.K");
- connect("DN.K", "RP1.1");
- connect("EBUF.IP", "RP1.1");
- }
- else
- netlist().log().fatal("Unknown opamp type: {1}", m_type);
-
- }
-
- NETLIB_UPDATEI();
- NETLIB_RESETI();
- NETLIB_UPDATE_PARAMI()
+ /*! Class representing the opamp model parameters.
+ * The opamp model was designed based on designs from
+ * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm.
+ * Currently 2 different types are supported: Type 1 and Type 3. Type 1
+ * is less complex and should run faster than Type 3.
+ *
+ * This is an extension to the traditional SPICE approach which
+ * assumes that you will be using an manufacturer model. These models may
+ * have copyrights incompatible with the netlist license. Thus they may not
+ * be suitable for certain implementations of netlist.
+ *
+ * For the typical use cases in low frequency (< 100 KHz) applications at
+ * which netlist is targeted, this model is certainly suitable. All parameters
+ * can be determined from a typical opamp datasheet.
+ *
+ * |Type|name |parameter |units|default| example|
+ * |:--:|:-----|:----------------------------------------------|:----|------:|-------:|
+ * | 3 |TYPE |Model Type, 1 and 3 are supported | | | |
+ * |1,3 |FPF |frequency of first pole |Hz | |100 |
+ * | 3 |SLEW |unity gain slew rate |V/s | | 1|
+ * |1,3 |RI |input resistance |Ohm | |1M |
+ * |1,3 |RO |output resistance |Ohm | |50 |
+ * |1,3 |UGF |unity gain frequency (transition frequency) |Hz | |1000 |
+ * | 3 |VLL |low output swing minus low supply rail |V | |1.5 |
+ * | 3 |VLH |high supply rail minus high output swing |V | |1.5 |
+ * | 3 |DAB |Differential Amp Bias - total quiescent current|A | |0.001 |
+ */
+
+ class opamp_model_t : public param_model_t
{
- }
-
-private:
-
- NETLIB_SUB(R_base) m_RP;
- NETLIB_SUB(VCCS) m_G1;
- NETLIB_SUBXX(C) m_CP;
- NETLIB_SUBXX(VCVS) m_EBUF;
- NETLIB_SUBXX(D) m_DP;
- NETLIB_SUBXX(D) m_DN;
-
- analog_input_t m_VCC;
- analog_input_t m_GND;
-
- param_model_t m_model;
- analog_output_t m_VH;
- analog_output_t m_VL;
- analog_output_t m_VREF;
-
- /* state */
- int m_type;
-};
-
- } //namespace devices
+ public:
+ opamp_model_t(device_t &device, const pstring name, const pstring val)
+ : param_model_t(device, name, val)
+ , m_TYPE(*this, "TYPE")
+ , m_FPF(*this, "FPF")
+ , m_SLEW(*this, "SLEW")
+ , m_RI(*this, "RI")
+ , m_RO(*this, "RO")
+ , m_UGF(*this, "UGF")
+ , m_VLL(*this, "VLL")
+ , m_VLH(*this, "VLH")
+ , m_DAB(*this, "DAB")
+ {}
+
+ value_t m_TYPE; //!< Model Type, 1 and 3 are supported
+ value_t m_FPF; //!< frequency of first pole
+ value_t m_SLEW; //!< unity gain slew rate
+ value_t m_RI; //!< input resistance
+ value_t m_RO; //!< output resistance
+ value_t m_UGF; //!< unity gain frequency (transition frequency)
+ value_t m_VLL; //!< low output swing minus low supply rail
+ value_t m_VLH; //!< high supply rail minus high output swing
+ value_t m_DAB; //!< Differential Amp Bias - total quiescent current
+ };
+
+
+ } //namespace analog
} // namespace netlist
#endif /* NLD_OPAMPS_H_ */
diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp
index 0bfc4b50512..92afa752e86 100644
--- a/src/lib/netlist/analog/nld_switches.cpp
+++ b/src/lib/netlist/analog/nld_switches.cpp
@@ -13,68 +13,115 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
-// ----------------------------------------------------------------------------------------
-// SWITCH
-// ----------------------------------------------------------------------------------------
+ // ----------------------------------------------------------------------------------------
+ // SWITCH
+ // ----------------------------------------------------------------------------------------
-NETLIB_RESET(switch1)
-{
- m_R.set_R(R_OFF);
-}
+ NETLIB_OBJECT(switch1)
+ {
+ NETLIB_CONSTRUCTOR(switch1)
+ , m_R(*this, "R")
+ , m_POS(*this, "POS", 0)
+ {
+ register_subalias("1", m_R.m_P);
+ register_subalias("2", m_R.m_N);
+ }
-NETLIB_UPDATE(switch1)
-{
- if (!m_POS())
+ NETLIB_RESETI();
+ NETLIB_UPDATEI();
+ NETLIB_UPDATE_PARAMI();
+
+ analog::NETLIB_SUB(R_base) m_R;
+ param_logic_t m_POS;
+ };
+
+
+ NETLIB_RESET(switch1)
{
m_R.set_R(R_OFF);
}
- else
+
+ NETLIB_UPDATE(switch1)
{
- m_R.set_R(R_ON);
- }
+ if (!m_POS())
+ {
+ m_R.set_R(R_OFF);
+ }
+ else
+ {
+ m_R.set_R(R_ON);
+ }
- m_R.update_dev();
-}
+ m_R.update_dev();
+ }
-NETLIB_UPDATE_PARAM(switch1)
-{
- update();
-}
+ NETLIB_UPDATE_PARAM(switch1)
+ {
+ update();
+ }
// ----------------------------------------------------------------------------------------
// SWITCH2
// ----------------------------------------------------------------------------------------
+ NETLIB_OBJECT(switch2)
+ {
+ NETLIB_CONSTRUCTOR(switch2)
+ , m_R1(*this, "R1")
+ , m_R2(*this, "R2")
+ , m_POS(*this, "POS", 0)
+ {
+ connect(m_R1.m_N, m_R2.m_N);
-NETLIB_RESET(switch2)
-{
- m_R1.set_R(R_ON);
- m_R2.set_R(R_OFF);
-}
+ register_subalias("1", m_R1.m_P);
+ register_subalias("2", m_R2.m_P);
-NETLIB_UPDATE(switch2)
-{
- if (!m_POS())
+ register_subalias("Q", m_R1.m_N);
+ }
+
+ NETLIB_RESETI();
+ NETLIB_UPDATEI();
+ NETLIB_UPDATE_PARAMI();
+
+ analog::NETLIB_SUB(R_base) m_R1;
+ analog::NETLIB_SUB(R_base) m_R2;
+ param_logic_t m_POS;
+ };
+
+ NETLIB_RESET(switch2)
{
m_R1.set_R(R_ON);
m_R2.set_R(R_OFF);
}
- else
+
+ NETLIB_UPDATE(switch2)
{
- m_R1.set_R(R_OFF);
- m_R2.set_R(R_ON);
+ if (!m_POS())
+ {
+ m_R1.set_R(R_ON);
+ m_R2.set_R(R_OFF);
+ }
+ else
+ {
+ m_R1.set_R(R_OFF);
+ m_R2.set_R(R_ON);
+ }
+
+ m_R1.update_dev();
+ m_R2.update_dev();
}
- m_R1.update_dev();
- m_R2.update_dev();
-}
+ NETLIB_UPDATE_PARAM(switch2)
+ {
+ update();
+ }
-NETLIB_UPDATE_PARAM(switch2)
-{
- update();
-}
+ } //namespace analog
- } //namespace devices
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, switch1)
+ NETLIB_DEVICE_IMPL_NS(analog, switch2)
+ }
} // namespace netlist
diff --git a/src/lib/netlist/analog/nld_switches.h b/src/lib/netlist/analog/nld_switches.h
index 11bf0242f4d..e557b67c0fe 100644
--- a/src/lib/netlist/analog/nld_switches.h
+++ b/src/lib/netlist/analog/nld_switches.h
@@ -17,63 +17,14 @@
// Macros
// ----------------------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
+
#define SWITCH(name) \
NET_REGISTER_DEV(SWITCH, name)
#define SWITCH2(name) \
NET_REGISTER_DEV(SWITCH2, name)
-// ----------------------------------------------------------------------------------------
-// Devices ...
-// ----------------------------------------------------------------------------------------
-
-namespace netlist
-{
- namespace devices
- {
-NETLIB_OBJECT(switch1)
-{
- NETLIB_CONSTRUCTOR(switch1)
- , m_R(*this, "R")
- , m_POS(*this, "POS", 0)
- {
- register_subalias("1", m_R.m_P);
- register_subalias("2", m_R.m_N);
- }
-
- NETLIB_RESETI();
- NETLIB_UPDATEI();
- NETLIB_UPDATE_PARAMI();
-
- NETLIB_SUB(R_base) m_R;
- param_logic_t m_POS;
-};
-
-NETLIB_OBJECT(switch2)
-{
- NETLIB_CONSTRUCTOR(switch2)
- , m_R1(*this, "R1")
- , m_R2(*this, "R2")
- , m_POS(*this, "POS", 0)
- {
- connect(m_R1.m_N, m_R2.m_N);
-
- register_subalias("1", m_R1.m_P);
- register_subalias("2", m_R2.m_P);
-
- register_subalias("Q", m_R1.m_N);
- }
-
- NETLIB_RESETI();
- NETLIB_UPDATEI();
- NETLIB_UPDATE_PARAMI();
-
- NETLIB_SUB(R_base) m_R1;
- NETLIB_SUB(R_base) m_R2;
- param_logic_t m_POS;
-};
-
- } //namespace devices
-} // namespace netlist
+#endif
#endif /* NLD_SWITCHES_H_ */
diff --git a/src/lib/netlist/analog/nld_twoterm.cpp b/src/lib/netlist/analog/nld_twoterm.cpp
index 484c951eefe..e160e669079 100644
--- a/src/lib/netlist/analog/nld_twoterm.cpp
+++ b/src/lib/netlist/analog/nld_twoterm.cpp
@@ -12,7 +12,7 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
// ----------------------------------------------------------------------------------------
// generic_diode
@@ -255,8 +255,8 @@ NETLIB_TIMESTEP(L)
NETLIB_RESET(D)
{
- nl_double Is = m_model.model_value("IS");
- nl_double n = m_model.model_value("N");
+ nl_double Is = m_model.m_IS;
+ nl_double n = m_model.m_N;
m_D.set_param(Is, n, netlist().gmin());
set(m_D.G(), 0.0, m_D.Ieq());
@@ -264,8 +264,8 @@ NETLIB_RESET(D)
NETLIB_UPDATE_PARAM(D)
{
- nl_double Is = m_model.model_value("IS");
- nl_double n = m_model.model_value("N");
+ nl_double Is = m_model.m_IS;
+ nl_double n = m_model.m_N;
m_D.set_param(Is, n, netlist().gmin());
}
@@ -319,5 +319,17 @@ NETLIB_UPDATE(CS)
NETLIB_NAME(twoterm)::update();
}
- } //namespace devices
+ } //namespace analog
+
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, R)
+ NETLIB_DEVICE_IMPL_NS(analog, POT)
+ NETLIB_DEVICE_IMPL_NS(analog, POT2)
+ NETLIB_DEVICE_IMPL_NS(analog, C)
+ NETLIB_DEVICE_IMPL_NS(analog, L)
+ NETLIB_DEVICE_IMPL_NS(analog, D)
+ NETLIB_DEVICE_IMPL_NS(analog, VS)
+ NETLIB_DEVICE_IMPL_NS(analog, CS)
+ }
+
} // namespace netlist
diff --git a/src/lib/netlist/analog/nld_twoterm.h b/src/lib/netlist/analog/nld_twoterm.h
index 377de1aec50..8de5aedbfc9 100644
--- a/src/lib/netlist/analog/nld_twoterm.h
+++ b/src/lib/netlist/analog/nld_twoterm.h
@@ -39,6 +39,8 @@
// Macros
// -----------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
+
#define RES(name, p_R) \
NET_REGISTER_DEV(RES, name) \
NETDEV_PARAMI(name, R, p_R)
@@ -74,6 +76,8 @@
NET_REGISTER_DEV(CS, name) \
NETDEV_PARAMI(name, I, pI)
+#endif
+
// -----------------------------------------------------------------------------
// Generic macros
// -----------------------------------------------------------------------------
@@ -101,7 +105,7 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
// -----------------------------------------------------------------------------
// nld_twoterm
@@ -358,6 +362,45 @@ private:
nl_double m_Vcrit;
};
+/*! Class representing the diode model paramers.
+ * This is the model representation of the diode model. Typically, SPICE uses
+ * the following parameters. A "Y" in the first column indicates that the
+ * parameter is actually used in netlist.
+ *
+ * |NL? |name |parameter |units|default| example|area |
+ * |:--:|:-----|:--------------------------------|:----|------:|-------:|:----:|
+ * | Y |IS |saturation current |A |1.0e-14| 1.0e-14| * |
+ * | |RS |ohmic resistanc |Ohm | 0| 10| * |
+ * | Y |N |emission coefficient |- | 1| 1| |
+ * | |TT |transit-time |sec | 0| 0.1ns| |
+ * | |CJO |zero-bias junction capacitance |F | 0| 2pF| * |
+ * | |VJ |junction potential |V | 1| 0.6| |
+ * | |M |grading coefficient |- | 0.5| 0.5| |
+ * | |EG |band-gap energy |eV | 1.11| 1.11 Si| |
+ * | |XTI |saturation-current temp.exp |- | 3|3.0 pn. 2.0 Schottky| |
+ * | |KF |flicker noise coefficient |- | 0| | |
+ * | |AF |flicker noise exponent |- | 1| | |
+ * | |FC |coefficient for forward-bias depletion capacitance formula|-|0.5|| |
+ * | |BV |reverse breakdown voltage |V |infinite| 40| |
+ * | |IBV |current at breakdown voltage |V | 0.001| | |
+ * | |TNOM |parameter measurement temperature|deg C| 27| 50| |
+ *
+ */
+
+class diode_model_t : public param_model_t
+{
+public:
+ diode_model_t(device_t &device, const pstring name, const pstring val)
+ : param_model_t(device, name, val)
+ , m_IS(*this, "IS")
+ , m_N(*this, "N")
+ {}
+
+ value_t m_IS; //!< saturation current.
+ value_t m_N; //!< emission coefficient.
+};
+
+
// -----------------------------------------------------------------------------
// nld_D
// -----------------------------------------------------------------------------
@@ -373,11 +416,22 @@ public:
register_subalias("K", m_N);
}
+ template <class CLASS>
+ NETLIB_NAME(D)(CLASS &owner, const pstring name, const pstring model)
+ : NETLIB_NAME(twoterm)(owner, name)
+ , m_model(*this, "MODEL", model)
+ , m_D(*this, "m_D")
+ {
+ register_subalias("A", m_P);
+ register_subalias("K", m_N);
+ }
+
+
NETLIB_IS_DYNAMIC()
NETLIB_UPDATE_TERMINALSI();
- param_model_t m_model;
+ diode_model_t m_model;
protected:
NETLIB_RESETI();
diff --git a/src/lib/netlist/build/doxygen.conf b/src/lib/netlist/build/doxygen.conf
index 9f0ff127793..adf69b30e54 100644
--- a/src/lib/netlist/build/doxygen.conf
+++ b/src/lib/netlist/build/doxygen.conf
@@ -771,7 +771,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = ".." "../documentation"
+INPUT = ".." "../analog" "../documentation"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp
index bbdf1b8f1b1..47464132aad 100644
--- a/src/lib/netlist/devices/net_lib.cpp
+++ b/src/lib/netlist/devices/net_lib.cpp
@@ -9,13 +9,16 @@
****************************************************************************/
#include "net_lib.h"
-#include "nld_system.h"
#include "nl_factory.h"
#include "solver/nld_solver.h"
+
#define xstr(s) # s
+
+#if 0
#define ENTRY1(nic, name, defparam) factory.register_device<nic>( # name, xstr(nic), defparam );
#define ENTRY(nic, name, defparam) ENTRY1(NETLIB_NAME(nic), name, defparam)
+#endif
#define NETLIB_DEVICE_DECL(chip) extern factory::constructor_ptr_t decl_ ## chip;
@@ -24,43 +27,45 @@
namespace netlist
{
+ using namespace netlist::analog;
+
namespace devices
{
static void initialize_factory(factory::list_t &factory)
{
- ENTRY(R, RES, "R")
- ENTRY(POT, POT, "R")
- ENTRY(POT2, POT2, "R")
- ENTRY(C, CAP, "C")
- ENTRY(L, IND, "L")
- ENTRY(D, DIODE, "MODEL")
- ENTRY(VCVS, VCVS, "")
- ENTRY(VCCS, VCCS, "")
- ENTRY(CCCS, CCCS, "")
- ENTRY(LVCCS, LVCCS, "")
- ENTRY(VS, VS, "V")
- ENTRY(CS, CS, "I")
- ENTRY(OPAMP, OPAMP, "MODEL")
+ ENTRYX(R, RES, "R")
+ ENTRYX(POT, POT, "R")
+ ENTRYX(POT2, POT2, "R")
+ ENTRYX(C, CAP, "C")
+ ENTRYX(L, IND, "L")
+ ENTRYX(D, DIODE, "MODEL")
+ ENTRYX(VS, VS, "V")
+ ENTRYX(CS, CS, "I")
+ ENTRYX(VCVS, VCVS, "")
+ ENTRYX(VCCS, VCCS, "")
+ ENTRYX(CCCS, CCCS, "")
+ ENTRYX(LVCCS, LVCCS, "")
+ ENTRYX(opamp, OPAMP, "MODEL")
ENTRYX(dummy_input, DUMMY_INPUT, "")
ENTRYX(frontier, FRONTIER_DEV, "+I,+G,+Q") // not intended to be used directly
ENTRYX(function, AFUNC, "N,FUNC") // only for macro devices - NO FEEDBACK loops
- ENTRY(QBJT_EB, QBJT_EB, "MODEL")
- ENTRY(QBJT_switch, QBJT_SW, "MODEL")
+ ENTRYX(QBJT_EB, QBJT_EB, "MODEL")
+ ENTRYX(QBJT_switch, QBJT_SW, "MODEL")
ENTRYX(logic_input, TTL_INPUT, "IN")
ENTRYX(logic_input, LOGIC_INPUT, "IN,FAMILY")
ENTRYX(analog_input, ANALOG_INPUT, "IN")
ENTRYX(log, LOG, "+I")
ENTRYX(logD, LOGD, "+I,+I2")
ENTRYX(clock, CLOCK, "FREQ")
- ENTRYX(extclock, EXTCLOCK, "FREQ")
+ ENTRYX(extclock, EXTCLOCK, "FREQ,PATTERN")
ENTRYX(mainclock, MAINCLOCK, "FREQ")
ENTRYX(gnd, GND, "")
ENTRYX(netlistparams, PARAMETER, "")
- ENTRY(solver, SOLVER, "FREQ")
+ ENTRYX(solver, SOLVER, "FREQ")
ENTRYX(res_sw, RES_SWITCH, "+IN,+P1,+P2")
- ENTRY(switch1, SWITCH, "")
- ENTRY(switch2, SWITCH2, "")
- ENTRYX(nicRSFF, NETDEV_RSFF, "+S,+R")
+ ENTRYX(switch1, SWITCH, "")
+ ENTRYX(switch2, SWITCH2, "")
+ ENTRYX(nicRSFF, NETDEV_RSFF, "")
ENTRYX(nicDelay, NETDEV_DELAY, "")
ENTRYX(2716, EPROM_2716, "+GQ,+EPQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10")
ENTRYX(2102A, RAM_2102A, "+CEQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+RWQ,+DI")
diff --git a/src/lib/netlist/devices/net_lib.h b/src/lib/netlist/devices/net_lib.h
index 9bbd9db744a..d12d7fcceb2 100644
--- a/src/lib/netlist/devices/net_lib.h
+++ b/src/lib/netlist/devices/net_lib.h
@@ -12,6 +12,27 @@
#define NET_LIB_H
#include "nl_base.h"
+
+//#define NL_AUTO_DEVICES 1
+
+#ifdef NL_AUTO_DEVICES
+#include "nld_devinc.h"
+
+#include "analog/nld_bjt.h"
+#include "analog/nld_fourterm.h"
+#include "analog/nld_switches.h"
+#include "analog/nld_twoterm.h"
+#include "analog/nld_opamps.h"
+#include "solver/nld_solver.h"
+
+#include "macro/nlm_cd4xxx.h"
+#include "macro/nlm_ttl74xx.h"
+#include "macro/nlm_opamp.h"
+#include "macro/nlm_other.h"
+
+#include "nld_7448.h"
+
+#else
#include "nld_system.h"
#include "nld_2102A.h"
@@ -75,6 +96,7 @@
#include "solver/nld_solver.h"
#include "nld_legacy.h"
+#endif
namespace netlist {
void initialize_factory(factory::list_t &factory);
diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp
index 2936c692786..f33688b73b7 100644
--- a/src/lib/netlist/devices/nld_4066.cpp
+++ b/src/lib/netlist/devices/nld_4066.cpp
@@ -28,11 +28,11 @@ namespace netlist
NETLIB_UPDATEI();
public:
- NETLIB_SUB(vdd_vss) m_supply;
- NETLIB_SUB(R_base) m_R;
+ NETLIB_SUB(vdd_vss) m_supply;
+ analog::NETLIB_SUB(R_base) m_R;
- analog_input_t m_control;
- param_double_t m_base_r;
+ analog_input_t m_control;
+ param_double_t m_base_r;
};
NETLIB_RESET(CD4066_GATE)
diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp
index 467786de3d1..8b9cb0d46ad 100644
--- a/src/lib/netlist/devices/nld_4316.cpp
+++ b/src/lib/netlist/devices/nld_4316.cpp
@@ -27,11 +27,12 @@ namespace netlist { namespace devices {
NETLIB_UPDATEI();
public:
- NETLIB_SUB(vdd_vss) m_supply;
- NETLIB_SUB(R_base) m_R;
+ NETLIB_SUB(vdd_vss) m_supply;
+ analog::NETLIB_SUB(R_base) m_R;
- logic_input_t m_S, m_E;
- param_double_t m_base_r;
+ logic_input_t m_S;
+ logic_input_t m_E;
+ param_double_t m_base_r;
};
NETLIB_RESET(CD4316_GATE)
diff --git a/src/lib/netlist/devices/nld_7448.h b/src/lib/netlist/devices/nld_7448.h
index 199b46343a8..c45a3cbe56a 100644
--- a/src/lib/netlist/devices/nld_7448.h
+++ b/src/lib/netlist/devices/nld_7448.h
@@ -34,6 +34,8 @@
#define USE_TRUTHTABLE_7448 (0)
+#ifndef NL_AUTO_DEVICES
+
#define TTL_7448(name, cA0, cA1, cA2, cA3, cLTQ, cBIQ, cRBIQ) \
NET_REGISTER_DEV(TTL_7448, name) \
NET_CONNECT(name, A, cA0) \
@@ -47,4 +49,6 @@
#define TTL_7448_DIP(name) \
NET_REGISTER_DEV(TTL_7448_DIP, name)
+#endif
+
#endif /* NLD_7448_H_ */
diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp
index ee7ad9d4837..07eee6f5a57 100644
--- a/src/lib/netlist/devices/nld_74ls629.cpp
+++ b/src/lib/netlist/devices/nld_74ls629.cpp
@@ -108,8 +108,8 @@ namespace netlist
public:
NETLIB_SUB(SN74LS629clk) m_clock;
- NETLIB_SUB(R_base) m_R_FC;
- NETLIB_SUB(R_base) m_R_RNG;
+ analog::NETLIB_SUB(R_base) m_R_FC;
+ analog::NETLIB_SUB(R_base) m_R_RNG;
logic_input_t m_ENQ;
analog_input_t m_RNG;
diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp
index 85dfdb010bb..7650538997b 100644
--- a/src/lib/netlist/devices/nld_mm5837.cpp
+++ b/src/lib/netlist/devices/nld_mm5837.cpp
@@ -47,7 +47,7 @@ namespace netlist
NETLIB_UPDATE_PARAMI();
protected:
- NETLIB_SUB(twoterm) m_RV;
+ analog::NETLIB_SUB(twoterm) m_RV;
analog_input_t m_VDD;
analog_input_t m_VGG;
analog_input_t m_VSS;
diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp
index 3db95e41161..3cfd120be30 100644
--- a/src/lib/netlist/devices/nld_ne555.cpp
+++ b/src/lib/netlist/devices/nld_ne555.cpp
@@ -44,10 +44,10 @@ namespace netlist
NETLIB_RESETI();
protected:
- NETLIB_SUB(R_base) m_R1;
- NETLIB_SUB(R_base) m_R2;
- NETLIB_SUB(R_base) m_R3;
- NETLIB_SUB(R_base) m_RDIS;
+ analog::NETLIB_SUB(R_base) m_R1;
+ analog::NETLIB_SUB(R_base) m_R2;
+ analog::NETLIB_SUB(R_base) m_R3;
+ analog::NETLIB_SUB(R_base) m_RDIS;
logic_input_t m_RESET;
analog_input_t m_THRES;
diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp
index fa5b89fff46..8a6d811f2d4 100644
--- a/src/lib/netlist/devices/nld_r2r_dac.cpp
+++ b/src/lib/netlist/devices/nld_r2r_dac.cpp
@@ -10,7 +10,7 @@
namespace netlist
{
- namespace devices
+ namespace analog
{
NETLIB_OBJECT_DERIVED(r2r_dac, twoterm)
{
@@ -45,8 +45,10 @@ namespace netlist
this->set(1.0 / m_R(), V, 0.0);
}
+ } //namespace analog
- NETLIB_DEVICE_IMPL(r2r_dac)
+ namespace devices {
+ NETLIB_DEVICE_IMPL_NS(analog, r2r_dac)
+ }
- } //namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/devices/nld_system.h b/src/lib/netlist/devices/nld_system.h
index 738ceb2a171..46781fe2884 100644
--- a/src/lib/netlist/devices/nld_system.h
+++ b/src/lib/netlist/devices/nld_system.h
@@ -54,9 +54,6 @@
NET_C(cG, name.G) \
NET_C(cOUT, name.Q)
-#define OPTIMIZE_FRONTIER(attach, r_in, r_out) \
- setup.register_frontier(# attach, r_in, r_out);
-
#define RES_SWITCH(name, cIN, cP1, cP2) \
NET_REGISTER_DEV(RES_SWITCH, name) \
NET_C(cIN, name.I) \
@@ -72,4 +69,5 @@
PARAM(name.N, p_N) \
PARAM(name.FUNC, p_F)
+
#endif /* NLD_SYSTEM_H_ */
diff --git a/src/lib/netlist/devices/nld_truthtable.cpp b/src/lib/netlist/devices/nld_truthtable.cpp
index 9030f6b8801..67acc61f9ef 100644
--- a/src/lib/netlist/devices/nld_truthtable.cpp
+++ b/src/lib/netlist/devices/nld_truthtable.cpp
@@ -19,8 +19,8 @@ namespace netlist
P_PREVENT_COPYING(netlist_factory_truthtable_t)
public:
netlist_factory_truthtable_t(const pstring &name, const pstring &classname,
- const pstring &def_param)
- : netlist_base_factory_truthtable_t(name, classname, def_param)
+ const pstring &def_param, const pstring &sourcefile)
+ : netlist_base_factory_truthtable_t(name, classname, def_param, sourcefile)
{ }
plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) override
@@ -260,8 +260,8 @@ void truthtable_desc_t::setup(const plib::pstring_vector_t &truthtable, uint_lea
}
netlist_base_factory_truthtable_t::netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname,
- const pstring &def_param)
-: factory::element_t(name, classname, def_param), m_family(family_TTL())
+ const pstring &def_param, const pstring &sourcefile)
+: factory::element_t(name, classname, def_param, sourcefile), m_family(family_TTL())
{
}
@@ -270,28 +270,29 @@ netlist_base_factory_truthtable_t::~netlist_base_factory_truthtable_t()
}
-#define ENTRYY(n, m) case (n * 100 + m): \
+#define ENTRYY(n, m, s) case (n * 100 + m): \
{ using xtype = netlist_factory_truthtable_t<n, m>; \
- ret = new xtype(desc.name, desc.classname, desc.def_param); } break
+ ret = new xtype(desc.name, desc.classname, desc.def_param, s); } break
-#define ENTRY(n) ENTRYY(n, 1); ENTRYY(n, 2); ENTRYY(n, 3); ENTRYY(n, 4); ENTRYY(n, 5); ENTRYY(n, 6)
+#define ENTRY(n, s) ENTRYY(n, 1, s); ENTRYY(n, 2, s); ENTRYY(n, 3, s); \
+ ENTRYY(n, 4, s); ENTRYY(n, 5, s); ENTRYY(n, 6, s)
-void tt_factory_create(setup_t &setup, tt_desc &desc)
+void tt_factory_create(setup_t &setup, tt_desc &desc, const pstring &sourcefile)
{
netlist_base_factory_truthtable_t *ret;
switch (desc.ni * 100 + desc.no)
{
- ENTRY(1);
- ENTRY(2);
- ENTRY(3);
- ENTRY(4);
- ENTRY(5);
- ENTRY(6);
- ENTRY(7);
- ENTRY(8);
- ENTRY(9);
- ENTRY(10);
+ ENTRY(1, sourcefile);
+ ENTRY(2, sourcefile);
+ ENTRY(3, sourcefile);
+ ENTRY(4, sourcefile);
+ ENTRY(5, sourcefile);
+ ENTRY(6, sourcefile);
+ ENTRY(7, sourcefile);
+ ENTRY(8, sourcefile);
+ ENTRY(9, sourcefile);
+ ENTRY(10, sourcefile);
default:
pstring msg = plib::pfmt("unable to create truthtable<{1},{2}>")(desc.ni)(desc.no);
nl_assert_always(false, msg);
diff --git a/src/lib/netlist/devices/nld_truthtable.h b/src/lib/netlist/devices/nld_truthtable.h
index 990afc45dd7..d4a9f4ea441 100644
--- a/src/lib/netlist/devices/nld_truthtable.h
+++ b/src/lib/netlist/devices/nld_truthtable.h
@@ -371,7 +371,7 @@ namespace netlist
P_PREVENT_COPYING(netlist_base_factory_truthtable_t)
public:
netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname,
- const pstring &def_param);
+ const pstring &def_param, const pstring &sourcefile);
virtual ~netlist_base_factory_truthtable_t();
@@ -379,7 +379,7 @@ namespace netlist
const logic_family_desc_t *m_family;
};
- void tt_factory_create(setup_t &setup, tt_desc &desc);
+ void tt_factory_create(setup_t &setup, tt_desc &desc, const pstring &sourcefile);
} //namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/devices/nlid_proxy.h b/src/lib/netlist/devices/nlid_proxy.h
index eced07f8356..77a8d52026c 100644
--- a/src/lib/netlist/devices/nlid_proxy.h
+++ b/src/lib/netlist/devices/nlid_proxy.h
@@ -124,7 +124,7 @@ namespace netlist
private:
analog_output_t m_GNDHack; // FIXME: Long term, we need to connect proxy gnd to device gnd
- NETLIB_SUB(twoterm) m_RV;
+ analog::NETLIB_SUB(twoterm) m_RV;
state_var<int> m_last_state;
bool m_is_timestep;
};
diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h
index c375f742e2c..8d2cd8162f8 100644
--- a/src/lib/netlist/devices/nlid_system.h
+++ b/src/lib/netlist/devices/nlid_system.h
@@ -286,9 +286,9 @@ namespace netlist
}
private:
- NETLIB_NAME(twoterm) m_RIN;
+ analog::NETLIB_NAME(twoterm) m_RIN;
/* Fixme: only works if the device is time-stepped - need to rework */
- NETLIB_NAME(twoterm) m_ROUT;
+ analog::NETLIB_NAME(twoterm) m_ROUT;
analog_input_t m_I;
analog_output_t m_Q;
@@ -367,7 +367,7 @@ namespace netlist
register_subalias("2", m_R.m_N);
}
- NETLIB_SUB(R_base) m_R;
+ analog::NETLIB_SUB(R_base) m_R;
logic_input_t m_I;
param_double_t m_RON;
param_double_t m_ROFF;
diff --git a/src/lib/netlist/macro/nlm_cd4xxx.h b/src/lib/netlist/macro/nlm_cd4xxx.h
index de10ff7a64d..446c2d6e435 100644
--- a/src/lib/netlist/macro/nlm_cd4xxx.h
+++ b/src/lib/netlist/macro/nlm_cd4xxx.h
@@ -22,6 +22,8 @@
* Netlist Macros
* ---------------------------------------------------------------------------*/
+#ifndef NL_AUTO_DEVICES
+
#define CD4001_NOR(name) \
NET_REGISTER_DEV(CD4001_NOR, name)
@@ -44,6 +46,7 @@
#define CD4316_DIP(name) \
NET_REGISTER_DEV(CD4016_DIP, name)
+#endif
/* ----------------------------------------------------------------------------
* External declarations
* ---------------------------------------------------------------------------*/
diff --git a/src/lib/netlist/macro/nlm_opamp.h b/src/lib/netlist/macro/nlm_opamp.h
index 6e3c1f615e7..ec717fdb2dc 100644
--- a/src/lib/netlist/macro/nlm_opamp.h
+++ b/src/lib/netlist/macro/nlm_opamp.h
@@ -11,6 +11,8 @@
* Netlist Macros
* ---------------------------------------------------------------------------*/
+#ifndef NL_AUTO_DEVICES
+
#define MB3614_DIP(name) \
NET_REGISTER_DEV(MB3614_DIP, name)
@@ -23,6 +25,8 @@
#define LM3900(name) \
NET_REGISTER_DEV(LM3900, name)
+#endif
+
/* ----------------------------------------------------------------------------
* External declarations
* ---------------------------------------------------------------------------*/
diff --git a/src/lib/netlist/macro/nlm_other.h b/src/lib/netlist/macro/nlm_other.h
index bb73d0105d2..f0e8ca05af0 100644
--- a/src/lib/netlist/macro/nlm_other.h
+++ b/src/lib/netlist/macro/nlm_other.h
@@ -11,12 +11,15 @@
* Netlist Macros
* ---------------------------------------------------------------------------*/
+#ifndef NL_AUTO_DEVICES
+
#define MC14584B_GATE(name) \
NET_REGISTER_DEV(MC14584B_GATE, name)
#define MC14584B_DIP(name) \
NET_REGISTER_DEV(MC14584B_DIP, name)
+#endif
/* ----------------------------------------------------------------------------
* External declarations
diff --git a/src/lib/netlist/macro/nlm_ttl74xx.h b/src/lib/netlist/macro/nlm_ttl74xx.h
index 44b3db63bd3..526fbf395da 100644
--- a/src/lib/netlist/macro/nlm_ttl74xx.h
+++ b/src/lib/netlist/macro/nlm_ttl74xx.h
@@ -11,6 +11,8 @@
* Netlist Macros
* ---------------------------------------------------------------------------*/
+#ifndef NL_AUTO_DEVICES
+
#define TTL_7400_GATE(name) \
NET_REGISTER_DEV(TTL_7400_GATE, name)
@@ -200,6 +202,8 @@
#define TTL_74260_DIP(name) \
NET_REGISTER_DEV(TTL_74260_DIP, name)
+#endif
+
/* ----------------------------------------------------------------------------
* External declarations
* ---------------------------------------------------------------------------*/
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index fa6ac936ce3..3e000cb5a08 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -433,7 +433,8 @@ void netlist_t::stop()
log().debug("Printing statistics ...\n");
print_stats();
log().debug("Stopping solver device ...\n");
- m_solver->stop();
+ if (m_solver != nullptr)
+ m_solver->stop();
}
detail::net_t *netlist_t::find_net(const pstring &name)
@@ -1173,6 +1174,7 @@ param_ptr_t::~param_ptr_t()
void param_model_t::changed()
{
+ netlist().log().fatal("Models can not be changed at runtime");
m_map.clear();
}
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index da8cb14401b..171a81292ae 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -132,7 +132,7 @@ class NETLIB_NAME(name) : public device_t
#define NETLIB_TIMESTEP(chip) void NETLIB_NAME(chip) :: timestep(const nl_double step)
#define NETLIB_SUB(chip) nld_ ## chip
-#define NETLIB_SUBXX(chip) std::unique_ptr< nld_ ## chip >
+#define NETLIB_SUBXX(ns, chip) std::unique_ptr< ns :: nld_ ## chip >
#define NETLIB_UPDATE(chip) void NETLIB_NAME(chip) :: update(void) NL_NOEXCEPT
#define NETLIB_PARENT_UPDATE(chip) NETLIB_NAME(chip) :: update();
@@ -951,22 +951,40 @@ namespace netlist
pstring m_param;
};
- class param_model_t final : public param_str_t
+ class param_model_t : public param_str_t
{
public:
+
+ class value_t
+ {
+ public:
+ value_t(param_model_t &param, const pstring name)
+ {
+ m_value = param.model_value(name);
+ }
+ double operator()() const { return m_value; }
+ operator double() const { return m_value; }
+ private:
+ double m_value;
+ };
+
+ friend class value_t;
+
param_model_t(device_t &device, const pstring name, const pstring val)
: param_str_t(device, name, val) { }
- /* these should be cached! */
- nl_double model_value(const pstring &entity);
- const pstring model_value_str(const pstring &entity);
- const pstring model_type();
+ const pstring model_value_str(const pstring &entity) /*const*/;
+ const pstring model_type() /*const*/;
protected:
virtual void changed() override;
+ nl_double model_value(const pstring &entity) /*const*/;
private:
+ /* hide this */
+ void setTo(const pstring &param) = delete;
model_map_t m_map;
};
+
class param_data_t : public param_str_t
{
public:
@@ -1082,10 +1100,10 @@ namespace netlist
setup_t &setup();
- template<class C>
- void register_sub(const pstring &name, std::unique_ptr<C> &dev)
+ template<class C, typename... Args>
+ void register_sub(const pstring &name, std::unique_ptr<C> &dev, const Args&... args)
{
- dev.reset(new C(*this, name));
+ dev.reset(new C(*this, name, args...));
}
void register_subalias(const pstring &name, detail::core_terminal_t &term);
diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp
index 50dc2ef9c8d..98740945e6c 100644
--- a/src/lib/netlist/nl_factory.cpp
+++ b/src/lib/netlist/nl_factory.cpp
@@ -17,8 +17,16 @@ namespace netlist { namespace factory
{
element_t::element_t(const pstring &name, const pstring &classname,
+ const pstring &def_param, const pstring &sourcefile)
+ : m_name(name), m_classname(classname), m_def_param(def_param),
+ m_sourcefile(sourcefile)
+{
+}
+
+element_t::element_t(const pstring &name, const pstring &classname,
const pstring &def_param)
- : m_name(name), m_classname(classname), m_def_param(def_param)
+ : m_name(name), m_classname(classname), m_def_param(def_param),
+ m_sourcefile("<unknown>")
{
}
diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h
index e1ea6727cce..8c911e2a0bd 100644
--- a/src/lib/netlist/nl_factory.h
+++ b/src/lib/netlist/nl_factory.h
@@ -17,7 +17,28 @@
#include "plib/putil.h"
#include "nl_base.h"
+#if 1
+#define NETLIB_DEVICE_IMPL(chip) \
+ static std::unique_ptr<factory::element_t> NETLIB_NAME(chip ## _c)( \
+ const pstring &name, const pstring &classname, const pstring &def_param) \
+ { \
+ return std::unique_ptr<factory::element_t>(new factory::device_element_t<NETLIB_NAME(chip)>(name, classname, def_param, pstring(__FILE__))); \
+ } \
+ factory::constructor_ptr_t decl_ ## chip = NETLIB_NAME(chip ## _c);
+
+#define NETLIB_DEVICE_IMPL_NS(ns, chip) \
+ static std::unique_ptr<factory::element_t> NETLIB_NAME(chip ## _c)( \
+ const pstring &name, const pstring &classname, const pstring &def_param) \
+ { \
+ return std::unique_ptr<factory::element_t>(new factory::device_element_t<ns :: NETLIB_NAME(chip)>(name, classname, def_param, pstring(__FILE__))); \
+ } \
+ factory::constructor_ptr_t decl_ ## chip = NETLIB_NAME(chip ## _c);
+
+#else
#define NETLIB_DEVICE_IMPL(chip) factory::constructor_ptr_t decl_ ## chip = factory::constructor_t< NETLIB_NAME(chip) >;
+#define NETLIB_DEVICE_IMPL_NS(ns, chip) factory::constructor_ptr_t decl_ ## chip = factory::constructor_t< ns :: NETLIB_NAME(chip) >;
+#endif
+
namespace netlist { namespace factory
{
@@ -31,6 +52,8 @@ namespace netlist { namespace factory
public:
element_t(const pstring &name, const pstring &classname,
const pstring &def_param);
+ element_t(const pstring &name, const pstring &classname,
+ const pstring &def_param, const pstring &sourcefile);
virtual ~element_t();
virtual plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) = 0;
@@ -39,11 +62,13 @@ namespace netlist { namespace factory
const pstring &name() const { return m_name; }
const pstring &classname() const { return m_classname; }
const pstring &param_desc() const { return m_def_param; }
+ const pstring &sourcefile() const { return m_sourcefile; }
protected:
pstring m_name; /* device name */
pstring m_classname; /* device class name */
pstring m_def_param; /* default parameter */
+ pstring m_sourcefile; /* source file */
};
template <class C>
@@ -54,6 +79,9 @@ namespace netlist { namespace factory
device_element_t(const pstring &name, const pstring &classname,
const pstring &def_param)
: element_t(name, classname, def_param) { }
+ device_element_t(const pstring &name, const pstring &classname,
+ const pstring &def_param, const pstring &sourcefile)
+ : element_t(name, classname, def_param, sourcefile) { }
plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) override
{
@@ -124,8 +152,8 @@ namespace netlist { namespace factory
public:
library_element_t(setup_t &setup, const pstring &name, const pstring &classname,
- const pstring &def_param)
- : element_t(name, classname, def_param), m_setup(setup) { }
+ const pstring &def_param, const pstring &source)
+ : element_t(name, classname, def_param, source), m_setup(setup) { }
plib::owned_ptr<device_t> Create(netlist_t &anetlist, const pstring &name) override;
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp
index 6dee211ce56..365054fc7d0 100644
--- a/src/lib/netlist/nl_parser.cpp
+++ b/src/lib/netlist/nl_parser.cpp
@@ -99,7 +99,7 @@ bool parser_t::parse(const pstring nlname)
}
}
-void parser_t::parse_netlist(ATTR_UNUSED const pstring &nlname)
+void parser_t::parse_netlist(const pstring &nlname)
{
while (true)
{
@@ -132,10 +132,10 @@ void parser_t::parse_netlist(ATTR_UNUSED const pstring &nlname)
else if (token.is(m_tok_LOCAL_SOURCE))
net_local_source();
else if (token.is(m_tok_TRUTHTABLE_START))
- net_truthtable_start();
+ net_truthtable_start(nlname);
else if (token.is(m_tok_LOCAL_LIB_ENTRY))
{
- m_setup.register_lib_entry(get_identifier());
+ m_setup.register_lib_entry(get_identifier(), "parser: " + nlname);
require_token(m_tok_param_right);
}
else if (token.is(m_tok_NETLIST_END))
@@ -148,7 +148,7 @@ void parser_t::parse_netlist(ATTR_UNUSED const pstring &nlname)
}
}
-void parser_t::net_truthtable_start()
+void parser_t::net_truthtable_start(const pstring &nlname)
{
pstring name = get_identifier();
require_token(m_tok_comma);
@@ -194,7 +194,7 @@ void parser_t::net_truthtable_start()
require_token(token, m_tok_TRUTHTABLE_END);
require_token(m_tok_param_left);
require_token(m_tok_param_right);
- netlist::devices::tt_factory_create(m_setup, desc);
+ netlist::devices::tt_factory_create(m_setup, desc, nlname);
return;
}
}
diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h
index 5c915e69997..a023a7cbbab 100644
--- a/src/lib/netlist/nl_parser.h
+++ b/src/lib/netlist/nl_parser.h
@@ -37,7 +37,7 @@ namespace netlist
void net_submodel();
void net_include();
void net_local_source();
- void net_truthtable_start();
+ void net_truthtable_start(const pstring &nlname);
/* for debugging messages */
netlist_t &netlist() { return m_setup.netlist(); }
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 8dcb28bea01..cf090c68dbe 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -7,8 +7,6 @@
#include <cstdio>
-#include "solver/nld_solver.h"
-
#include "plib/palloc.h"
#include "plib/putil.h"
#include "nl_base.h"
@@ -73,9 +71,9 @@ void setup_t::namespace_pop()
m_namespace_stack.pop();
}
-void setup_t::register_lib_entry(const pstring &name)
+void setup_t::register_lib_entry(const pstring &name, const pstring &sourcefile)
{
- factory().register_device(plib::make_unique_base<factory::element_t, factory::library_element_t>(*this, name, name, ""));
+ factory().register_device(plib::make_unique_base<factory::element_t, factory::library_element_t>(*this, name, name, "", sourcefile));
}
void setup_t::register_dev(const pstring &classname, const pstring &name)
@@ -754,7 +752,7 @@ void setup_t::resolve_inputs()
log().verbose("looking for two terms connected to rail nets ...");
- for (auto & t : netlist().get_device_list<devices::NETLIB_NAME(twoterm)>())
+ for (auto & t : netlist().get_device_list<analog::NETLIB_NAME(twoterm)>())
{
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
{
@@ -894,9 +892,9 @@ nl_double setup_t::model_value(model_map_t &map, const pstring &entity)
return tmp.as_double() * factor;
}
-void setup_t::tt_factory_create(tt_desc &desc)
+void setup_t::tt_factory_create(tt_desc &desc, const pstring &sourcefile)
{
- devices::tt_factory_create(*this, desc);
+ devices::tt_factory_create(*this, desc, sourcefile);
}
diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h
index 798ba8f4140..1ce715a9fdf 100644
--- a/src/lib/netlist/nl_setup.h
+++ b/src/lib/netlist/nl_setup.h
@@ -71,7 +71,7 @@ void NETLIST_NAME(name)(netlist::setup_t &setup) \
#define LOCAL_LIB_ENTRY(name) \
LOCAL_SOURCE(name) \
- setup.register_lib_entry(# name);
+ setup.register_lib_entry(# name, __FILE__);
#define INCLUDE(name) \
setup.include(# name);
@@ -81,6 +81,9 @@ void NETLIST_NAME(name)(netlist::setup_t &setup) \
NETLIST_NAME(model)(setup); \
setup.namespace_pop();
+#define OPTIMIZE_FRONTIER(attach, r_in, r_out) \
+ setup.register_frontier(# attach, r_in, r_out);
+
// -----------------------------------------------------------------------------
// truthtable defines
// -----------------------------------------------------------------------------
@@ -105,7 +108,7 @@ void NETLIST_NAME(name)(netlist::setup_t &setup) \
desc.family = x;
#define TRUTHTABLE_END() \
- netlist::devices::tt_factory_create(setup, desc); \
+ netlist::devices::tt_factory_create(setup, desc, __FILE__); \
}
@@ -202,7 +205,7 @@ namespace netlist
void register_dev(const pstring &classname, const pstring &name);
- void register_lib_entry(const pstring &name);
+ void register_lib_entry(const pstring &name, const pstring &sourcefile);
void register_model(const pstring &model_in);
void register_alias(const pstring &alias, const pstring &out);
@@ -265,7 +268,7 @@ namespace netlist
/* FIXME: truth table trampoline */
- void tt_factory_create(tt_desc &desc);
+ void tt_factory_create(tt_desc &desc, const pstring &sourcefile);
/* helper - also used by nltool */
const pstring resolve_alias(const pstring &name) const;
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index 91f9fc7c1ae..1d796201fd9 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -30,7 +30,7 @@ public:
tool_options_t() :
plib::options(),
opt_grp1(*this, "General options", "The following options apply to all commands."),
- opt_cmd (*this, "c", "cmd", "run", "run:convert:listdevices:static", "run|convert|listdevices|static"),
+ opt_cmd (*this, "c", "cmd", "run", "run:convert:listdevices:static:header", "run|convert|listdevices|static|header"),
opt_file(*this, "f", "file", "-", "file to process (default is stdin)"),
opt_defines(*this, "D", "define", "predefine value as macro, e.g. -Dname=value. If '=value' is omitted predefine it as 1. This option may be specified repeatedly."),
opt_rfolders(*this, "r", "rom", "where to look for files"),
@@ -325,6 +325,81 @@ static void static_compile(tool_options_t &opts)
}
+static void mac_out(const pstring s, const bool cont = true)
+{
+ static const unsigned RIGHT = 72;
+ if (cont)
+ {
+ unsigned adj = 0;
+ for (auto x : s)
+ adj += (x == '\t' ? 3 : 0);
+ pout("{1}\\\n", s.rpad(" ", RIGHT-1-adj));
+ }
+ else
+ pout("{1}\n", s);
+}
+
+static void create_header(tool_options_t &opts)
+{
+ netlist_tool_t nt("netlist");
+
+ nt.init();
+
+ nt.log().verbose.set_enabled(false);
+ nt.log().warning.set_enabled(false);
+
+ nt.setup().register_source(plib::make_unique_base<netlist::source_t,
+ netlist::source_proc_t>(nt.setup(), "dummy", &netlist_dummy));
+ nt.setup().include("dummy");
+
+ pout("// license:GPL-2.0+\n");
+ pout("// copyright-holders:Couriersud\n");
+ pout("#ifndef NLD_DEVINC_H\n");
+ pout("#define NLD_DEVINC_H\n");
+ pout("\n");
+ pout("#include \"nl_setup.h\"\n");
+ pout("#ifndef __PLIB_PREPROCESSOR__\n");
+ pout("\n");
+ pout("/* ----------------------------------------------------------------------------\n");
+ pout(" * Netlist Macros\n");
+ pout(" * ---------------------------------------------------------------------------*/\n");
+ pout("\n");
+
+ pstring last_source("");
+
+ for (auto &e : nt.setup().factory())
+ {
+ if (last_source != e->sourcefile())
+ {
+ last_source = e->sourcefile();
+ pout("{1}\n", pstring("// ").rpad("-", 72));
+ pout("{1}\n", pstring("// Source: ").cat(e->sourcefile().replace("../","")));
+ pout("{1}\n", pstring("// ").rpad("-", 72));
+ }
+ auto v = plib::pstring_vector_t(e->param_desc(), ",");
+ pstring vs;
+ for (auto s : v)
+ vs += ", p" + s.replace("+","").replace(".","_");
+ mac_out("#define " + e->name() + "(name" + vs + ")");
+ mac_out("\tNET_REGISTER_DEV(" + e->name() +", name)"); \
+
+ for (auto s : v)
+ {
+ pstring r(s.replace("+","").replace(".","_"));
+ if (s.startsWith("+"))
+ mac_out("\tNET_CONNECT(name, " + r + ", p" + r + ")");
+ else
+ mac_out("\tNETDEV_PARAMI(name, " + r + ", p" + r + ")");
+ }
+ mac_out("", false);
+ }
+ pout("#endif // __PLIB_PREPROCESSOR__\n");
+ pout("#endif\n");
+ nt.stop();
+
+}
+
+
/*-------------------------------------------------
listdevices - list all known devices
-------------------------------------------------*/
@@ -472,6 +547,8 @@ int main(int argc, char *argv[])
run(opts);
else if (cmd == "static")
static_compile(opts);
+ else if (cmd == "header")
+ create_header(opts);
else if (cmd == "convert")
{
pstring contents;
diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp
index 52cccfd8419..5ea6bc2e993 100644
--- a/src/lib/netlist/solver/nld_solver.cpp
+++ b/src/lib/netlist/solver/nld_solver.cpp
@@ -402,6 +402,7 @@ void NETLIB_NAME(solver)::create_solver_code(plib::postream &strm)
s->create_solver_code(strm);
}
+ NETLIB_DEVICE_IMPL(solver)
} //namespace devices
} // namespace netlist
diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h
index e3ba6419f8b..637e7d56b89 100644
--- a/src/lib/netlist/solver/nld_solver.h
+++ b/src/lib/netlist/solver/nld_solver.h
@@ -20,10 +20,13 @@
// Macros
// ----------------------------------------------------------------------------------------
+#ifndef NL_AUTO_DEVICES
+
#define SOLVER(name, freq) \
NET_REGISTER_DEV(SOLVER, name) \
PARAM(name.FREQ, freq)
+#endif
// ----------------------------------------------------------------------------------------
// solver
// ----------------------------------------------------------------------------------------
diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp
index f62ebc51a4b..00e468750b5 100644
--- a/src/mame/drivers/aa310.cpp
+++ b/src/mame/drivers/aa310.cpp
@@ -87,6 +87,7 @@
#include "cpu/arm/arm.h"
#include "includes/archimds.h"
#include "formats/acorn_dsk.h"
+#include "formats/apd_dsk.h"
#include "machine/i2cmem.h"
#include "machine/ram.h"
#include "machine/wd_fdc.h"
@@ -351,7 +352,8 @@ INPUT_PORTS_END
FLOPPY_FORMATS_MEMBER( aa310_state::floppy_formats )
FLOPPY_ACORN_ADFS_NEW_FORMAT,
- FLOPPY_ACORN_ADFS_OLD_FORMAT
+ FLOPPY_ACORN_ADFS_OLD_FORMAT,
+ FLOPPY_APD_FORMAT
FLOPPY_FORMATS_END
static SLOT_INTERFACE_START( aa310_floppies )
diff --git a/src/mame/drivers/atvtrack.cpp b/src/mame/drivers/atvtrack.cpp
index 303a37db79c..914ea4ac667 100644
--- a/src/mame/drivers/atvtrack.cpp
+++ b/src/mame/drivers/atvtrack.cpp
@@ -85,7 +85,9 @@ write - enable slave CPU, gpu, etc most of bits is unclear
SH4 XTAL is 33MHz, SH4 MD0-2 pins is 001 or 011 (CPU core clk = XTAL*6, preipheral clk = XTAL, bus clk is XTAL or XTAL*2)
TODO:
- currently ATV Track dies during texture data upload to GPU RAM, most likely due to some SH4 core bugs
+ devicify NAND
+ somehow hook PVR2 renderer here
+ add sound
*/
@@ -211,89 +213,76 @@ WRITE64_MEMBER(atvtrack_state::control_w)
READ64_MEMBER(atvtrack_state::nand_data_r)
{
- uint32_t addr, dat;
- int c;
-
- addr = 0;
- dat = decode64_32(offset, 0, mem_mask, addr);
- if (addr == 0) {
- dat = 0;
- for (c = 3;c >= 0;c--) {
- if (m_nandcommand[c] <= 0x50) {
- addr = m_nandaddress[c]+m_nandoffset[c];
- dat = (dat << 8) | m_nandregion->as_u8(addr+c);
- m_nandoffset[c] += 4;
- } else
- dat = (dat << 8) | 0xc0;
+ u32 dat = 0;
+ for (int c = 3; c >= 0; c--) {
+ if (m_nandcommand[c] <= 0x50) {
+ u32 addr = m_nandaddress[c] + m_nandoffset[c];
+ dat = (dat << 8) | m_nandregion->as_u8(addr + c);
+ m_nandoffset[c] += 4;
}
- return dat;
- } else {
- /* nothing */
+ else
+ dat = (dat << 8) | 0xc0;
}
- return 0;
+ return dat;
}
WRITE64_MEMBER(atvtrack_state::nand_data_w)
{
- // not implemented
+ for (int c = 0; c < 4; c++) {
+ if (m_nandcommand[c] == 0x80) {
+ u8 *ptr = m_nandregion->base();
+ u32 addr = m_nandaddress[c] + m_nandoffset[c] + c;
+ ptr[addr] &= data & 0xff;
+ m_nandoffset[c] += 4;
+ }
+ data >>= 8;
+ }
}
WRITE64_MEMBER(atvtrack_state::nand_cmd_w)
{
- uint32_t addr; //, dat;
- int c;
-
- addr = 0;
-// dat = decode64_32(offset, data, mem_mask, addr);
- if (addr == 0) {
- for (c = 0;c < 4;c++) {
- m_nandcommand[c] = data & 0xff;
- if (m_nandcommand[c] == 0x00) {
- m_nandoffset[c] = 0;
- } else if (m_nandcommand[c] == 0x01) {
- m_nandoffset[c] = 256*4;
- } else if (m_nandcommand[c] == 0x50) {
- m_nandoffset[c] = 512*4;
- } else if (m_nandcommand[c] == 0x90) {
- } else if (m_nandcommand[c] == 0xff) {
- } else if (m_nandcommand[c] == 0x80) {
- } else if (m_nandcommand[c] == 0x60) {
- } else if (m_nandcommand[c] == 0x70) {
- } else if (m_nandcommand[c] == 0x10) {
- } else if (m_nandcommand[c] == 0xd0) {
- } else {
- m_nandcommand[c] = 0xff;
- }
- data=data >> 8;
+ m_nandaddressstep = 0;
+ for (int c = 0;c < 4;c++) {
+ m_nandcommand[c] = data & 0xff;
+ if (m_nandcommand[c] == 0x00) {
+ m_nandoffset[c] = 0;
+ } else if (m_nandcommand[c] == 0x01) {
+ m_nandoffset[c] = 256*4;
+ } else if (m_nandcommand[c] == 0x50) {
+ m_nandoffset[c] = 512*4;
+ } else if (m_nandcommand[c] == 0x90) {
+ } else if (m_nandcommand[c] == 0xff) {
+ } else if (m_nandcommand[c] == 0x80) {
+ } else if (m_nandcommand[c] == 0x60) {
+ m_nandaddressstep = 1;
+ m_nandaddress[c] = 0;
+ } else if (m_nandcommand[c] == 0x70) {
+ } else if (m_nandcommand[c] == 0x10) {
+ } else if (m_nandcommand[c] == 0xd0) {
+ u8 *ptr = m_nandregion->base();
+ u32 addr = m_nandaddress[c] + c;
+ for (int i = 0; i < 32 * 528; i++)
+ ptr[addr + i * 4] = 0xff;
+ } else {
+ m_nandcommand[c] = 0xff;
}
- m_nandaddressstep = 0;
- } else {
- /* nothing */
+ data=data >> 8;
}
}
WRITE64_MEMBER(atvtrack_state::nand_addr_w)
{
- uint32_t addr; //, dat;
- int c;
-
- addr = 0;
-// dat = decode64_32(offset, data, mem_mask, addr);
- if (addr == 0) {
- for (c = 0;c < 4;c++) {
- if (m_nandaddressstep == 0) {
- m_nandaddress[c] = (data & 0xff)*4;
- } else if (m_nandaddressstep == 1) {
- m_nandaddress[c] = m_nandaddress[c]+(data & 0xff)*0x840;
- } else if (m_nandaddressstep == 2) {
- m_nandaddress[c] = m_nandaddress[c]+(data & 0xff)*0x84000;
- }
- data = data >> 8;
+ for (int c = 0;c < 4;c++) {
+ if (m_nandaddressstep == 0) {
+ m_nandaddress[c] = (data & 0xff)*4;
+ } else if (m_nandaddressstep == 1) {
+ m_nandaddress[c] = m_nandaddress[c]+(data & 0xff)*0x840;
+ } else if (m_nandaddressstep == 2) {
+ m_nandaddress[c] = m_nandaddress[c]+(data & 0xff)*0x84000;
}
- m_nandaddressstep++;
- } else {
- /* nothing */
+ data = data >> 8;
}
+ m_nandaddressstep++;
}
void atvtrack_state::gpu_irq_test()
@@ -329,7 +318,7 @@ WRITE32_MEMBER(atvtrack_state::gpu_w)
switch (offset)
{
case 0x00/4:
- // not really required, game code will go even if GPU CPU shows no sings of live
+ // not really required, game code will go even if GPU CPU shows no signs of live
if (data) // internal CPU start ?
m_subcpu->space(AS_PROGRAM).write_byte(0x18001350, 1); // simulate GPUs internal CPU reply to skip busy loop
break;
@@ -347,7 +336,7 @@ WRITE32_MEMBER(atvtrack_state::gpu_w)
// GPU render happens here
gpu_irq_set(7);
}
- // not really required, game code will go even if GPU CPU shows no sings of live
+ // not really required, game code will go even if GPU CPU shows no signs of live
if (data == 0x8001)
m_subcpu->space(AS_PROGRAM).write_byte(0x18814804, 1); // simulate GPUs internal CPU reply to skip busy loop
break;
@@ -387,7 +376,7 @@ WRITE64_MEMBER(atvtrack_state::ioport_w)
// bit 0 O - unk (SD: FPGA config clock)
// ADC and DAC is 4-channel SPI devices
// Switch inputs is active low, *1 - game specific inputs
- // All above IO multiplexig, ADC and DAC implemented in FPGA
+ // All above IO multiplexing, ADC and DAC implemented in FPGA
#ifdef SPECIALMODE
uint64_t d;
diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp
index d17b7ffca90..e6b97398ebd 100644
--- a/src/mame/drivers/cc40.cpp
+++ b/src/mame/drivers/cc40.cpp
@@ -108,21 +108,21 @@ public:
memory_region *m_cart_rom;
- uint8_t m_bus_control;
- uint8_t m_power;
- uint8_t m_banks;
- uint8_t m_clock_control;
- uint8_t m_clock_divider;
- uint8_t m_key_select;
-
- std::unique_ptr<uint8_t[]> m_sysram[2];
- uint16_t m_sysram_size[2];
- uint16_t m_sysram_end[2];
- uint16_t m_sysram_mask[2];
+ u8 m_bus_control;
+ u8 m_power;
+ u8 m_banks;
+ u8 m_clock_control;
+ u8 m_clock_divider;
+ u8 m_key_select;
+
+ std::unique_ptr<u8[]> m_sysram[2];
+ u16 m_sysram_size[2];
+ u16 m_sysram_end[2];
+ u16 m_sysram_mask[2];
void postload();
- void init_sysram(int chip, uint16_t size);
- void update_lcd_indicator(uint8_t y, uint8_t x, int state);
+ void init_sysram(int chip, u16 size);
+ void update_lcd_indicator(u8 y, u8 x, int state);
void update_clock_divider();
DECLARE_READ8_MEMBER(sysram_r);
@@ -156,7 +156,7 @@ public:
DEVICE_IMAGE_LOAD_MEMBER(cc40_state, cc40_cartridge)
{
- uint32_t size = m_cart->common_get_size("rom");
+ u32 size = m_cart->common_get_size("rom");
// max size is 4*32KB
if (size > 0x20000)
@@ -186,7 +186,7 @@ PALETTE_INIT_MEMBER(cc40_state, cc40)
palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off
}
-void cc40_state::update_lcd_indicator(uint8_t y, uint8_t x, int state)
+void cc40_state::update_lcd_indicator(u8 y, u8 x, int state)
{
// reference _________________...
// output# |10 11 12 13 14 0 1 2 3 4
@@ -336,7 +336,7 @@ WRITE8_MEMBER(cc40_state::clock_control_w)
READ8_MEMBER(cc40_state::keyboard_r)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected keyboard rows
for (int i = 0; i < 8; i++)
@@ -510,12 +510,12 @@ void cc40_state::machine_reset()
bankswitch_w(space, 0, 0);
}
-void cc40_state::init_sysram(int chip, uint16_t size)
+void cc40_state::init_sysram(int chip, u16 size)
{
if (m_sysram[chip] == nullptr)
{
// init to largest possible
- m_sysram[chip] = std::make_unique<uint8_t[]>(0x2000);
+ m_sysram[chip] = std::make_unique<u8[]>(0x2000);
save_pointer(NAME(m_sysram[chip].get()), 0x2000, chip);
save_item(NAME(m_sysram_size[chip]), chip);
diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp
index 00b93ff2efa..0ceccf6eec9 100644
--- a/src/mame/drivers/ddragon.cpp
+++ b/src/mame/drivers/ddragon.cpp
@@ -55,7 +55,6 @@ Dip locations verified with manual for ddragon & ddragon2
#include "emu.h"
#include "cpu/m6809/hd6309.h"
#include "cpu/m6800/m6800.h"
-#include "cpu/m6805/m68705.h"
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "sound/ym2151.h"
@@ -183,7 +182,7 @@ WRITE8_MEMBER(ddragon_state::ddragon_bankswitch_w)
}
-WRITE8_MEMBER(ddragon_state::toffy_bankswitch_w)
+WRITE8_MEMBER(toffy_state::toffy_bankswitch_w)
{
m_scrollx_hi = data & 0x01;
m_scrolly_hi = (data & 0x02) >> 1;
@@ -195,7 +194,7 @@ WRITE8_MEMBER(ddragon_state::toffy_bankswitch_w)
}
-READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
+READ8_MEMBER(darktowr_state::darktowr_mcu_bank_r)
{
// logerror("BankRead %05x %08x\n",space.device().safe_pc(),offset);
@@ -216,26 +215,27 @@ READ8_MEMBER(ddragon_state::darktowr_mcu_bank_r)
}
if (offset == 0x1401 || offset == 1)
- return m_darktowr_mcu_ports[0];
+ return m_mcu_port_a_out;
logerror("Unmapped mcu bank read %04x\n",offset);
return 0xff;
}
-WRITE8_MEMBER(ddragon_state::darktowr_mcu_bank_w)
+WRITE8_MEMBER(darktowr_state::darktowr_mcu_bank_w)
{
logerror("BankWrite %05x %08x %08x\n", space.device().safe_pc(), offset, data);
if (offset == 0x1400 || offset == 0)
{
- m_darktowr_mcu_ports[1] = BITSWAP8(data,0,1,2,3,4,5,6,7);
- logerror("MCU PORT 1 -> %04x (from %04x)\n", BITSWAP8(data,0,1,2,3,4,5,6,7), data);
+ uint8_t const value(BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7));
+ m_mcu->pb_w(space, 0, value);
+ logerror("MCU PORT 1 -> %04x (from %04x)\n", value, data);
}
}
-WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w)
+WRITE8_MEMBER(darktowr_state::darktowr_bankswitch_w)
{
m_scrollx_hi = (data & 0x01);
m_scrolly_hi = ((data & 0x02) >> 1);
@@ -250,7 +250,7 @@ WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w)
membank("bank1")->set_entry(newbank);
if (newbank == 4 && oldbank != 4)
- space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(ddragon_state::darktowr_mcu_bank_r),this), write8_delegate(FUNC(ddragon_state::darktowr_mcu_bank_w),this));
+ space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(darktowr_state::darktowr_mcu_bank_r),this), write8_delegate(FUNC(darktowr_state::darktowr_mcu_bank_w),this));
else if (newbank != 4 && oldbank == 4)
space.install_readwrite_bank(0x4000, 0x7fff, "bank1");
}
@@ -351,10 +351,10 @@ CUSTOM_INPUT_MEMBER(ddragon_state::subcpu_bus_free)
}
-WRITE8_MEMBER(ddragon_state::darktowr_mcu_w)
+WRITE8_MEMBER(darktowr_state::mcu_port_a_w)
{
- logerror("McuWrite %05x %08x %08x\n",space.device().safe_pc(), offset, data);
- m_darktowr_mcu_ports[offset] = data;
+ logerror("McuWrite %05x %08x %08x\n", space.device().safe_pc(), offset, data);
+ m_mcu_port_a_out = data;
}
@@ -594,21 +594,6 @@ ADDRESS_MAP_END
/*************************************
*
- * MCU memory maps
- *
- *************************************/
-
-static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, ddragon_state )
- ADDRESS_MAP_GLOBAL_MASK(0x7ff)
- AM_RANGE(0x0000, 0x0007) AM_RAM_WRITE(darktowr_mcu_w) AM_SHARE("darktowr_mcu")
- AM_RANGE(0x0008, 0x007f) AM_RAM
- AM_RANGE(0x0080, 0x07ff) AM_ROM
-ADDRESS_MAP_END
-
-
-
-/*************************************
- *
* Input ports
*
*************************************/
@@ -1104,17 +1089,17 @@ static MACHINE_CONFIG_START( ddragon2, ddragon_state )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( darktowr, ddragon )
+static MACHINE_CONFIG_DERIVED_CLASS( darktowr, ddragon, darktowr_state )
/* basic machine hardware */
- MCFG_CPU_ADD("mcu", M68705,XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(mcu_map)
+ MCFG_CPU_ADD("mcu", M68705P3, XTAL_4MHz)
+ MCFG_M68705_PORTA_W_CB(WRITE8(darktowr_state, mcu_port_a_w))
/* video hardware */
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( toffy, ddragon )
+static MACHINE_CONFIG_DERIVED_CLASS( toffy, ddragon, toffy_state )
/* basic machine hardware */
MCFG_DEVICE_REMOVE("sub")
@@ -1809,7 +1794,7 @@ ROM_START( tstrike )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) )
- ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
+ ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 )
@@ -1853,7 +1838,7 @@ ROM_START( tstrikea )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "tstrike.30", 0x08000, 0x08000, CRC(3f3f04a1) SHA1(45d2b4542ec783c1c4122616606be6c160f76c06) )
- ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
+ ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 )
@@ -1897,7 +1882,7 @@ ROM_START( ddungeon )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "dd30.30", 0x08000, 0x08000, CRC(ef1af99a) SHA1(7ced695b81ca9efbb7b28b78013e112edac85672) )
- ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
+ ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "dd_mcu.bin", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x10000, "gfx1", 0 ) /* GFX? */
@@ -1936,7 +1921,7 @@ ROM_START( ddungeone )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "21j-0-1", 0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) ) /* from ddragon */
- ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
+ ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "dd_mcu.bin", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x10000, "gfx1", 0 ) /* GFX? */
@@ -1973,7 +1958,7 @@ ROM_START( darktowr )
ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
ROM_LOAD( "21j-0-1", 0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) ) /* from ddragon */
- ROM_REGION( 0x0800, "mcu", 0 ) /* 8k for the microcontroller */
+ ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
ROM_LOAD( "68705prt.mcu", 0x00000, 0x0800, CRC(34cbb2d3) SHA1(8e0c3b13c636012d88753d547c639b1a8af85680) )
ROM_REGION( 0x08000, "gfx1", 0 ) /* chars */
@@ -2090,23 +2075,26 @@ DRIVER_INIT_MEMBER(ddragon_state,ddragon2)
}
-DRIVER_INIT_MEMBER(ddragon_state,darktowr)
+DRIVER_INIT_MEMBER(darktowr_state, darktowr)
{
+ save_item(NAME(m_mcu_port_a_out));
+
m_sprite_irq = INPUT_LINE_NMI;
m_ym_irq = M6809_FIRQ_LINE;
m_technos_video_hw = 0;
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::darktowr_bankswitch_w),this));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(darktowr_state::darktowr_bankswitch_w), this));
+ m_mcu_port_a_out = 0xff;
}
-DRIVER_INIT_MEMBER(ddragon_state,toffy)
+DRIVER_INIT_MEMBER(toffy_state, toffy)
{
int i, length;
uint8_t *rom;
m_ym_irq = M6809_FIRQ_LINE;
m_technos_video_hw = 0;
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(ddragon_state::toffy_bankswitch_w),this));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x3808, 0x3808, write8_delegate(FUNC(toffy_state::toffy_bankswitch_w), this));
/* the program rom has a simple bitswap encryption */
rom = memregion("maincpu")->base();
@@ -2170,32 +2158,32 @@ DRIVER_INIT_MEMBER(ddragon_state,ddragon6809)
*
*************************************/
-GAME( 1987, ddragon, 0, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan", "Double Dragon (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonw, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonw1, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonu, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonua, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonub, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 3)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonb2, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", MACHINE_SUPPORTS_SAVE ) // according to dump notes
-GAME( 1987, ddragonba, ddragon, ddragonba, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", MACHINE_SUPPORTS_SAVE )
-GAME( 1987, ddragon6809, ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", MACHINE_NOT_WORKING )
-GAME( 1987, ddragon6809a,ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", MACHINE_NOT_WORKING )
-
-GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, ddragon2u, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", MACHINE_SUPPORTS_SAVE )
-GAME( 1988, ddragon2j, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump
-GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "bootleg", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragon, 0, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan", "Double Dragon (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonw, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonw1, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito license)", "Double Dragon (World set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonu, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonua, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonub, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "Technos Japan (Taito America license)", "Double Dragon (US set 3)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonb2, ddragon, ddragon, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragonb, ddragon, ddragonb, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with HD6309)", MACHINE_SUPPORTS_SAVE ) // according to dump notes
+GAME( 1987, ddragonba, ddragon, ddragonba, ddragon, ddragon_state, ddragon, ROT0, "bootleg", "Double Dragon (bootleg with M6803)", MACHINE_SUPPORTS_SAVE )
+GAME( 1987, ddragon6809, ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", MACHINE_NOT_WORKING )
+GAME( 1987, ddragon6809a,ddragon, ddragon6809, ddragon, ddragon_state, ddragon6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", MACHINE_NOT_WORKING )
+
+GAME( 1988, ddragon2, 0, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (World)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, ddragon2u, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, ddragon2j, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "Technos Japan", "Double Dragon II - The Revenge (Japan)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // bad dump
+GAME( 1988, ddragon2b, ddragon2, ddragon2, ddragon2, ddragon_state, ddragon2, ROT0, "bootleg", "Double Dragon II - The Revenge (US, bootleg)", MACHINE_SUPPORTS_SAVE )
/* these were conversions of double dragon */
-GAME( 1991, tstrike, 0, darktowr, tstrike, ddragon_state, darktowr, ROT0, "East Coast Coin Company", "Thunder Strike (set 1)", MACHINE_SUPPORTS_SAVE ) // same manufacturer as The Game Room?
-GAME( 1991, tstrikea, tstrike, darktowr, tstrike, ddragon_state, darktowr, ROT0, "The Game Room", "Thunder Strike (set 2, older)", MACHINE_SUPPORTS_SAVE )
-GAME( 1992, ddungeon, 0, darktowr, ddungeon, ddragon_state, darktowr, ROT0, "The Game Room", "Dangerous Dungeons (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1992, ddungeone,ddungeon, darktowr, ddungeon, ddragon_state, darktowr, ROT0, "East Coast Coin Company", "Dangerous Dungeons (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1992, darktowr, 0, darktowr, darktowr, ddragon_state, darktowr, ROT0, "The Game Room", "Dark Tower", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, tstrike, 0, darktowr, tstrike, darktowr_state, darktowr, ROT0, "East Coast Coin Company", "Thunder Strike (set 1)", MACHINE_SUPPORTS_SAVE ) // same manufacturer as The Game Room?
+GAME( 1991, tstrikea, tstrike, darktowr, tstrike, darktowr_state, darktowr, ROT0, "The Game Room", "Thunder Strike (set 2, older)", MACHINE_SUPPORTS_SAVE )
+GAME( 1992, ddungeon, 0, darktowr, ddungeon, darktowr_state, darktowr, ROT0, "The Game Room", "Dangerous Dungeons (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1992, ddungeone, ddungeon, darktowr, ddungeon, darktowr_state, darktowr, ROT0, "East Coast Coin Company", "Dangerous Dungeons (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1992, darktowr, 0, darktowr, darktowr, darktowr_state, darktowr, ROT0, "The Game Room", "Dark Tower", MACHINE_SUPPORTS_SAVE )
/* these run on their own board, but are basically the same game. Toffy even has 'dangerous dungeons' text in it */
-GAME( 1993, toffy, 0, toffy, toffy, ddragon_state, toffy, ROT0, "Midas", "Toffy", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, toffy, 0, toffy, toffy, toffy_state, toffy, ROT0, "Midas", "Toffy", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, stoffy, 0, toffy, toffy, ddragon_state, toffy, ROT0, "Midas", "Super Toffy", MACHINE_SUPPORTS_SAVE )
-GAME( 1994, stoffyu, stoffy, toffy, toffy, ddragon_state, toffy, ROT0, "Midas (Unico license)", "Super Toffy (Unico license)", MACHINE_SUPPORTS_SAVE )
+GAME( 1994, stoffy, 0, toffy, toffy, toffy_state, toffy, ROT0, "Midas", "Super Toffy", MACHINE_SUPPORTS_SAVE )
+GAME( 1994, stoffyu, stoffy, toffy, toffy, toffy_state, toffy, ROT0, "Midas (Unico license)", "Super Toffy (Unico license)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp
index 08b725beed3..eabaefaaceb 100644
--- a/src/mame/drivers/fidel6502.cpp
+++ b/src/mame/drivers/fidel6502.cpp
@@ -383,8 +383,7 @@ I/O is via TTL, very similar to Designer Display
******************************************************************************/
-#include "emu.h"
-#include "includes/fidelz80.h"
+#include "includes/fidelbase.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6502/r65c02.h"
#include "cpu/m6502/m65sc02.h"
@@ -409,11 +408,11 @@ I/O is via TTL, very similar to Designer Display
#include "fidel_su9.lh" // clickable
-class fidel6502_state : public fidelz80base_state
+class fidel6502_state : public fidelbase_state
{
public:
fidel6502_state(const machine_config &mconfig, device_type type, const char *tag)
- : fidelz80base_state(mconfig, type, tag),
+ : fidelbase_state(mconfig, type, tag),
m_ppi8255(*this, "ppi8255"),
m_cart(*this, "cartslot")
{ }
@@ -535,7 +534,7 @@ WRITE8_MEMBER(fidel6502_state::csc_pia0_pb_w)
READ8_MEMBER(fidel6502_state::csc_pia0_pb_r)
{
// d2: printer?
- uint8_t data = 0x04;
+ u8 data = 0x04;
// d3: TSI BUSY line
if (m_speech->busy_r())
@@ -679,7 +678,7 @@ WRITE8_MEMBER(fidel6502_state::eas_ppi_portc_w)
READ8_MEMBER(fidel6502_state::eas_ppi_portb_r)
{
// d0: printer? white wire from LED pcb
- uint8_t data = 1;
+ u8 data = 1;
// d1: TSI BUSY line
data |= (m_speech->busy_r()) ? 2 : 0;
@@ -712,7 +711,7 @@ WRITE8_MEMBER(fidel6502_state::sc9_control_w)
{
// d0-d3: 74245 P0-P3
// 74245 Q0-Q8: input mux, led select
- uint16_t sel = 1 << (data & 0xf) & 0x3ff;
+ u16 sel = 1 << (data & 0xf) & 0x3ff;
m_inp_mux = sel & 0x1ff;
sc9_prepare_display();
@@ -748,7 +747,7 @@ WRITE8_MEMBER(fidel6502_state::sc12_control_w)
{
// d0-d3: 7442 a0-a3
// 7442 0-8: led data, input mux
- uint16_t sel = 1 << (data & 0xf) & 0x3ff;
+ u16 sel = 1 << (data & 0xf) & 0x3ff;
m_inp_mux = sel & 0x1ff;
// 7442 9: speaker out
@@ -803,24 +802,24 @@ READ8_MEMBER(fidel6502_state::fexcelv_speech_r)
WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w)
{
// a0-a2,d0: 74259(1)
- uint8_t mask = 1 << offset;
+ u8 mask = 1 << offset;
m_led_select = (m_led_select & ~mask) | ((data & 1) ? mask : 0);
// 74259 Q0-Q3: 7442 a0-a3
// 7442 0-8: led data, input mux
- uint16_t sel = 1 << (m_led_select & 0xf) & 0x3ff;
- uint8_t led_data = sel & 0xff;
+ u16 sel = 1 << (m_led_select & 0xf) & 0x3ff;
+ u8 led_data = sel & 0xff;
m_inp_mux = sel & 0x1ff;
// 7442 9: speaker out
m_dac->write(BIT(sel, 9));
// 74259 Q4-Q7,Q2,Q1: digit/led select (active low)
- uint8_t led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f;
+ u8 led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f;
// a0-a2,d1: digit segment data (model 6093)
m_7seg_data = (m_7seg_data & ~mask) | ((data & 2) ? mask : 0);
- uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);
+ u8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);
// update display: 4 7seg leds, 2*8 chessboard leds
for (int i = 0; i < 6; i++)
@@ -850,7 +849,7 @@ WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w)
READ8_MEMBER(fidel6502_state::fexcelb_ttl_r)
{
// a0-a2,d6: from speech board: language switches and TSI BUSY line, otherwise tied to VCC
- uint8_t d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0;
+ u8 d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0;
// a0-a2,d7: multiplexed inputs (active low)
return d6 | ((read_inputs(9) >> offset & 1) ? 0 : 0x80);
@@ -858,7 +857,7 @@ READ8_MEMBER(fidel6502_state::fexcelb_ttl_r)
READ8_MEMBER(fidel6502_state::fexcel_ttl_r)
{
- uint8_t d7 = 0x80;
+ u8 d7 = 0x80;
// 74259(1) Q7 + 74251 I0: battery status
if (m_inp_mux == 1 && ~m_led_select & 0x80)
@@ -878,15 +877,15 @@ READ8_MEMBER(fidel6502_state::fexcel_ttl_r)
WRITE8_MEMBER(fidel6502_state::fdesdis_control_w)
{
- uint8_t q3_old = m_led_select & 8;
+ u8 q3_old = m_led_select & 8;
// a0-a2,d7: 74259
- uint8_t mask = 1 << offset;
+ u8 mask = 1 << offset;
m_led_select = (m_led_select & ~mask) | ((data & 0x80) ? mask : 0);
// 74259 Q4-Q7: 7442 a0-a3
// 7442 0-8: led data, input mux
- uint16_t sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff;
+ u16 sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff;
m_inp_mux = sel & 0x1ff;
// 7442 9: speaker out
@@ -913,7 +912,7 @@ WRITE8_MEMBER(fidel6502_state::fdesdis_control_w)
WRITE8_MEMBER(fidel6502_state::fdesdis_lcd_w)
{
// a0-a2,d0-d3: 4*74259 to lcd digit segments
- uint32_t mask = BITSWAP8(1 << offset,3,7,6,0,1,2,4,5);
+ u32 mask = BITSWAP8(1 << offset,3,7,6,0,1,2,4,5);
for (int i = 0; i < 4; i++)
{
m_7seg_data = (m_7seg_data & ~mask) | ((data >> i & 1) ? 0 : mask);
@@ -943,12 +942,12 @@ DRIVER_INIT_MEMBER(fidel6502_state, fdesdis)
WRITE8_MEMBER(fidel6502_state::chesster_control_w)
{
// a0-a2,d7: 74259(1)
- uint8_t mask = 1 << offset;
+ u8 mask = 1 << offset;
m_led_select = (m_led_select & ~mask) | ((data & 0x80) ? mask : 0);
// 74259 Q4-Q7: 7442 a0-a3
// 7442 0-8: led data, input mux
- uint16_t sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff;
+ u16 sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff;
m_inp_mux = sel & 0x1ff;
// 74259 Q0,Q1: led select (active low)
@@ -1554,7 +1553,7 @@ static MACHINE_CONFIG_START( rsc, fidel6502_state )
MCFG_PIA_CA2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_cb2_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_rsc_v2)
/* sound hardware */
@@ -1569,7 +1568,7 @@ static MACHINE_CONFIG_START( csc, fidel6502_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, 3900000/2) // from 3.9MHz resonator
MCFG_CPU_PROGRAM_MAP(csc_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // 38400kHz/64
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // 38400kHz/64
MCFG_DEVICE_ADD("pia0", PIA6821, 0)
MCFG_PIA_READPB_HANDLER(READ8(fidel6502_state, csc_pia0_pb_r))
@@ -1586,7 +1585,7 @@ static MACHINE_CONFIG_START( csc, fidel6502_state )
MCFG_PIA_CA2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_ca2_w))
MCFG_PIA_CB2_HANDLER(WRITELINE(fidel6502_state, csc_pia1_cb2_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_csc)
/* sound hardware */
@@ -1614,7 +1613,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", R65C02, XTAL_3MHz)
MCFG_CPU_PROGRAM_MAP(eas_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // guessed
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // guessed
MCFG_DEVICE_ADD("ppi8255", I8255, 0) // port B: input, port A & C: output
MCFG_I8255_OUT_PORTA_CB(WRITE8(fidel6502_state, eas_ppi_porta_w))
@@ -1623,7 +1622,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state )
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_eas)
/* sound hardware */
@@ -1639,7 +1638,7 @@ static MACHINE_CONFIG_START( eas, fidel6502_state )
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
+ MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
MACHINE_CONFIG_END
@@ -1648,7 +1647,7 @@ static MACHINE_CONFIG_DERIVED( eag, eas )
/* basic machine hardware */
MCFG_CPU_REPLACE("maincpu", R65C02, XTAL_5MHz) // R65C02P4
MCFG_CPU_PROGRAM_MAP(eag_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq0_line_hold, 600) // guessed
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel6502_state, irq0_line_hold, 600) // guessed
MCFG_DEFAULT_LAYOUT(layout_fidel_eag)
MACHINE_CONFIG_END
@@ -1662,7 +1661,7 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(610) - attotime::from_usec(41)) // active for 41us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(610))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_sc9)
/* sound hardware */
@@ -1674,7 +1673,7 @@ static MACHINE_CONFIG_START( sc9, fidel6502_state )
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
+ MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
MACHINE_CONFIG_END
@@ -1703,7 +1702,7 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(596) - attotime::from_nsec(15250)) // active for 15.25us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(596))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_sc12)
/* sound hardware */
@@ -1715,7 +1714,7 @@ static MACHINE_CONFIG_START( sc12, fidel6502_state )
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
+ MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
MACHINE_CONFIG_END
@@ -1728,7 +1727,7 @@ static MACHINE_CONFIG_START( fexcel, fidel6502_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(630) - attotime::from_nsec(15250)) // active for 15.25us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(630))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_ex)
/* sound hardware */
@@ -1791,7 +1790,7 @@ static MACHINE_CONFIG_START( fdes2100d, fidel6502_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(630) - attotime::from_nsec(15250)) // active for 15.25us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(630))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_desdis)
/* sound hardware */
@@ -1817,7 +1816,7 @@ static MACHINE_CONFIG_START( chesster, fidel6502_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(9615) - attotime::from_nsec(2600)) // active for 2.6us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel6502_state, irq_off, attotime::from_hz(9615))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_chesster)
/* sound hardware */
diff --git a/src/mame/drivers/fidel68k.cpp b/src/mame/drivers/fidel68k.cpp
index fd59a10968c..c93ca62df41 100644
--- a/src/mame/drivers/fidel68k.cpp
+++ b/src/mame/drivers/fidel68k.cpp
@@ -153,8 +153,7 @@ B0000x-xxxxxx: see V7, -800000
******************************************************************************/
-#include "emu.h"
-#include "includes/fidelz80.h"
+#include "includes/fidelbase.h"
#include "cpu/m68000/m68000.h"
#include "machine/ram.h"
#include "machine/nvram.h"
@@ -165,11 +164,11 @@ B0000x-xxxxxx: see V7, -800000
#include "fidel_eag_68k.lh" // clickable
-class fidel68k_state : public fidelz80base_state
+class fidel68k_state : public fidelbase_state
{
public:
fidel68k_state(const machine_config &mconfig, device_type type, const char *tag)
- : fidelz80base_state(mconfig, type, tag),
+ : fidelbase_state(mconfig, type, tag),
m_ram(*this, "ram")
{ }
@@ -203,7 +202,7 @@ public:
WRITE8_MEMBER(fidel68k_state::fexcel68k_mux_w)
{
// a1-a3,d0: 74259
- uint8_t mask = 1 << offset;
+ u8 mask = 1 << offset;
m_led_select = (m_led_select & ~mask) | ((data & 1) ? mask : 0);
// 74259 Q0-Q3: 74145 A-D (Q4-Q7 N/C)
@@ -222,7 +221,7 @@ void fidel68k_state::eag_prepare_display()
{
// Excel 68000: 4*7seg leds, 8*8 chessboard leds
// EAG: 8*7seg leds(2 panels), (8+1)*8 chessboard leds
- uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);
+ u8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);
set_display_segmask(0x1ff, 0x7f);
display_matrix(16, 9, m_led_data << 8 | seg_data, m_inp_mux);
}
@@ -258,7 +257,7 @@ WRITE8_MEMBER(fidel68k_state::eag_mux_w)
// d0-d3: 74145 A-D
// 74145 0-8: input mux, digit/led select
// 74145 9: speaker out
- uint16_t sel = 1 << (data & 0xf);
+ u16 sel = 1 << (data & 0xf);
m_dac->write(BIT(sel, 9));
m_inp_mux = sel & 0x1ff;
eag_prepare_display();
@@ -561,7 +560,7 @@ static MACHINE_CONFIG_START( fexcel68k, fidel68k_state )
MCFG_TIMER_START_DELAY(attotime::from_hz(618) - attotime::from_nsec(1525)) // active for 1.525us
MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_off", fidel68k_state, irq_off, attotime::from_hz(618))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_ex_68k)
/* sound hardware */
@@ -582,7 +581,7 @@ static MACHINE_CONFIG_START( eag, fidel68k_state )
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_eag_68k)
MCFG_RAM_ADD("ram")
@@ -598,7 +597,7 @@ static MACHINE_CONFIG_START( eag, fidel68k_state )
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "fidel_scc")
MCFG_GENERIC_EXTENSIONS("bin,dat")
- MCFG_GENERIC_LOAD(fidelz80base_state, scc_cartridge)
+ MCFG_GENERIC_LOAD(fidelbase_state, scc_cartridge)
MCFG_SOFTWARE_LIST_ADD("cart_list", "fidel_scc")
MACHINE_CONFIG_END
@@ -631,7 +630,7 @@ static MACHINE_CONFIG_DERIVED( eagv11, eagv7 )
MCFG_CPU_REPLACE("maincpu", M68EC040, XTAL_36MHz*2*2) // wrong! should be M68EC060 @ 72MHz
MCFG_CPU_PROGRAM_MAP(eagv11_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, irq2_line_hold, 600)
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600)
MCFG_DEVICE_REMOVE("irq_on") // 8.25us is too long
MCFG_DEVICE_REMOVE("irq_off")
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index c468c229d32..6b15a1ee86d 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -489,8 +489,7 @@ expect that the software reads these once on startup only.
******************************************************************************/
-#include "emu.h"
-#include "includes/fidelz80.h"
+#include "includes/fidelbase.h"
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/i8255.h"
@@ -507,11 +506,11 @@ expect that the software reads these once on startup only.
#include "fidel_vsc.lh" // clickable
-class fidelz80_state : public fidelz80base_state
+class fidelz80_state : public fidelbase_state
{
public:
fidelz80_state(const machine_config &mconfig, device_type type, const char *tag)
- : fidelz80base_state(mconfig, type, tag),
+ : fidelbase_state(mconfig, type, tag),
m_mcu(*this, "mcu"),
m_z80pio(*this, "z80pio"),
m_ppi8255(*this, "ppi8255"),
@@ -570,7 +569,7 @@ public:
// machine start/reset
-void fidelz80base_state::machine_start()
+void fidelbase_state::machine_start()
{
// zerofill
memset(m_display_state, 0, sizeof(m_display_state));
@@ -603,7 +602,7 @@ void fidelz80base_state::machine_start()
save_item(NAME(m_speech_bank));
}
-void fidelz80base_state::machine_reset()
+void fidelbase_state::machine_reset()
{
}
@@ -618,9 +617,9 @@ void fidelz80base_state::machine_reset()
// The device may strobe the outputs very fast, it is unnoticeable to the user.
// To prevent flickering here, we need to simulate a decay.
-void fidelz80base_state::display_update()
+void fidelbase_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -633,7 +632,7 @@ void fidelz80base_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -671,7 +670,7 @@ void fidelz80base_state::display_update()
memcpy(m_display_cache, active_state, sizeof(m_display_cache));
}
-TIMER_DEVICE_CALLBACK_MEMBER(fidelz80base_state::display_decay_tick)
+TIMER_DEVICE_CALLBACK_MEMBER(fidelbase_state::display_decay_tick)
{
// slowly turn off unpowered segments
for (int y = 0; y < m_display_maxy; y++)
@@ -682,13 +681,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(fidelz80base_state::display_decay_tick)
display_update();
}
-void fidelz80base_state::set_display_size(int maxx, int maxy)
+void fidelbase_state::set_display_size(int maxx, int maxy)
{
m_display_maxx = maxx;
m_display_maxy = maxy;
}
-void fidelz80base_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void fidelbase_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -699,12 +698,12 @@ void fidelz80base_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void fidelz80base_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void fidelbase_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -715,9 +714,9 @@ void fidelz80base_state::display_matrix(int maxx, int maxy, uint32_t setx, uint3
// generic input handlers
-uint16_t fidelz80base_state::read_inputs(int columns)
+u16 fidelbase_state::read_inputs(int columns)
{
- uint16_t ret = 0;
+ u16 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -739,9 +738,9 @@ INPUT_CHANGED_MEMBER(fidelz80_state::reset_button)
// cartridge
-DEVICE_IMAGE_LOAD_MEMBER(fidelz80base_state, scc_cartridge)
+DEVICE_IMAGE_LOAD_MEMBER(fidelbase_state, scc_cartridge)
{
- uint32_t size = m_cart->common_get_size("rom");
+ u32 size = m_cart->common_get_size("rom");
// max size is 16KB?
if (size > 0x4000)
@@ -769,7 +768,7 @@ DEVICE_IMAGE_LOAD_MEMBER(fidelz80base_state, scc_cartridge)
void fidelz80_state::vcc_prepare_display()
{
// 4 7seg leds (note: sel d0 for extra leds)
- uint8_t outdata = (m_7seg_data & 0x7f) | (m_led_select << 7 & 0x80);
+ u8 outdata = (m_7seg_data & 0x7f) | (m_led_select << 7 & 0x80);
set_display_segmask(0xf, 0x7f);
display_matrix(8, 4, outdata, m_led_select >> 2 & 0xf);
}
@@ -836,7 +835,7 @@ WRITE8_MEMBER(fidelz80_state::vcc_ppi_portb_w)
READ8_MEMBER(fidelz80_state::vcc_ppi_portc_r)
{
// d0-d3: multiplexed inputs (active low), also language switches
- uint8_t lan = (~m_led_select & 0x40) ? m_inp_matrix[4]->read() : 0;
+ u8 lan = (~m_led_select & 0x40) ? m_inp_matrix[4]->read() : 0;
return ~(lan | read_inputs(4)) & 0xf;
}
@@ -879,7 +878,7 @@ WRITE8_MEMBER(fidelz80_state::cc10_ppi_porta_w)
WRITE8_MEMBER(fidelz80_state::bcc_control_w)
{
// a0-a2,d7: digit segment data via NE591, Q7 is speaker out
- uint8_t mask = 1 << (offset & 7);
+ u8 mask = 1 << (offset & 7);
m_7seg_data = (m_7seg_data & ~mask) | ((data & 0x80) ? mask : 0);
m_dac->write(BIT(m_7seg_data, 7));
@@ -951,7 +950,7 @@ READ8_MEMBER(fidelz80_state::vsc_pio_porta_r)
READ8_MEMBER(fidelz80_state::vsc_pio_portb_r)
{
- uint8_t data = 0;
+ u8 data = 0;
// d4: TSI BUSY line
data |= (m_speech->busy_r()) ? 0 : 0x10;
@@ -987,7 +986,7 @@ WRITE8_MEMBER(fidelz80_state::vsc_pio_portb_w)
void fidelz80_state::vbrc_prepare_display()
{
// 14seg led segments, d15 is extra led, d14 is unused (tone on prototype?)
- uint16_t outdata = BITSWAP16(m_7seg_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8);
+ u16 outdata = BITSWAP16(m_7seg_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8);
set_display_segmask(0xff, 0x3fff);
display_matrix(16, 8, outdata, m_led_select);
}
@@ -1093,7 +1092,7 @@ ADDRESS_MAP_END
// VSC io: A2 is 8255 _CE, A3 is Z80 PIO _CE - in theory, both chips can be accessed simultaneously
READ8_MEMBER(fidelz80_state::vsc_io_trampoline_r)
{
- uint8_t data = 0xff; // open bus
+ u8 data = 0xff; // open bus
if (~offset & 4)
data &= m_ppi8255->read(space, offset & 3);
if (~offset & 8)
@@ -1452,7 +1451,7 @@ static MACHINE_CONFIG_START( bcc, fidelz80_state )
MCFG_CPU_PROGRAM_MAP(bcc_map)
MCFG_CPU_IO_MAP(bcc_io)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_bcc)
/* sound hardware */
@@ -1476,7 +1475,7 @@ static MACHINE_CONFIG_START( cc10, fidelz80_state )
MCFG_I8255_IN_PORTC_CB(READ8(fidelz80_state, vcc_ppi_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(fidelz80_state, vcc_ppi_portc_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_cc)
/* sound hardware */
@@ -1500,7 +1499,7 @@ static MACHINE_CONFIG_START( vcc, fidelz80_state )
MCFG_I8255_IN_PORTC_CB(READ8(fidelz80_state, vcc_ppi_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(fidelz80_state, vcc_ppi_portc_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_vcc)
MCFG_MACHINE_START_OVERRIDE(fidelz80_state,vcc)
@@ -1518,7 +1517,7 @@ static MACHINE_CONFIG_START( vsc, fidelz80_state )
MCFG_CPU_ADD("maincpu", Z80, 3900000) // 3.9MHz resonator
MCFG_CPU_PROGRAM_MAP(vsc_map)
MCFG_CPU_IO_MAP(vsc_io)
- MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80base_state, nmi_line_pulse, 600) // 555 timer, approx 600hz
+ MCFG_CPU_PERIODIC_INT_DRIVER(fidelz80_state, nmi_line_pulse, 600) // 555 timer, approx 600hz
MCFG_DEVICE_ADD("ppi8255", I8255, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(fidelz80_state, vsc_ppi_porta_w))
@@ -1530,7 +1529,7 @@ static MACHINE_CONFIG_START( vsc, fidelz80_state )
MCFG_Z80PIO_IN_PB_CB(READ8(fidelz80_state, vsc_pio_portb_r))
MCFG_Z80PIO_OUT_PB_CB(WRITE8(fidelz80_state, vsc_pio_portb_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_vsc)
/* sound hardware */
@@ -1553,7 +1552,7 @@ static MACHINE_CONFIG_START( vbrc, fidelz80_state )
MCFG_I8243_ADD("i8243", NOOP, WRITE8(fidelz80_state, vbrc_ioexp_port_w))
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_fidel_vbrc)
/* sound hardware */
diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp
index 09aa44712f0..bf75c1ca50f 100644
--- a/src/mame/drivers/goldstar.cpp
+++ b/src/mame/drivers/goldstar.cpp
@@ -8474,6 +8474,9 @@ static MACHINE_CONFIG_DERIVED( mbstar, lucky8 )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(mbstar_map)
+
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_UPDATE_DRIVER(wingco_state, screen_update_mbstar)
MACHINE_CONFIG_END
@@ -11327,23 +11330,59 @@ ROM_END
/*
- Mega Bonus Star II
+ Mega Bonus Star II (Millennium Edition, Euro)
Auto-Data Graz, 2002.
W4 derivative hardware...
-
+
PCB has a daughterboard with:
- Z80.
- Unknown DIP40 IC
- - M48T12 NVRAM.
+ - M48T12 Timekeeper NVRAM.
- HM6116L-70
- GAL16V8D.
- DS1232.
- 74LS374N
- - SN74LS0xx
- - Unknown Xtal.
+ - SN74LS08N
+ - 8 MHz Xtal.
+
+ Here the DB layout...
+ +-----------------------------+
+ | +-----------+ +----+ |
+ | +-+ |MBGEU_OR | |U | |
+ | | | |V.3.5.5 | |N | |
+ |+-+ |B| +-----------+ |K | |
+ || | | | +----+ +----+ |O | |
+ || | +-+ |HM61| |M48T| |W | |
+ ||A| +-+ |16L-| |12 | |N Z| |
+ || | | | |70 | | | | I| |
+ || | |C| | | |TIME| | L| |
+ || | | | | | |KEEP| | O| |
+ |+-+ | | | | |RAM | | G| |
+ | +-+ +----+ +----+ +----+ |
+ | +----------------+ |
+ | |ZILOG | XTAL |
+ |+-+ |Z0840006P | 8.000 |
+ ||D| +----------------+ |
+ |+-+ |
+ +-----------------------------+
+
+ A: GAL16V8D
+ B: SN74LS08N
+ C: DM74LS374N
+ D: DS1232
+
+
+ BASE Board (based on WING W4):
- Dumped by Team Europe.
+ XTAL: 11.98135MHZ
+ 4x DIP-SWITCH
+
+ 1x YAMAHA YM2149F
+ 3x NEC D8255AC-2
+ 6x HY6116ALP-12
+
+ Daughterboard is inserted in the Z80 Socket of the main board...
*/
ROM_START( mbs2euro )
@@ -11372,13 +11411,19 @@ ROM_START( mbs2euro )
ROM_LOAD( "am27s21.g14", 0x0100, 0x0100, CRC(0dcaa791) SHA1(69c68a22002b57d03b90e82b5a33d1df66c39362) )
ROM_REGION( 0x20, "proms2", 0 )
- ROM_LOAD( "82s123.d13", 0x0000, 0x0020, CRC(eacb8b76) SHA1(30cdd169a45b87c4262eea03ae28f910b091b100) )
+ ROM_LOAD( "82s123.d13", 0x0000, 0x0020, CRC(eacb8b76) SHA1(30cdd169a45b87c4262eea03ae28f910b091b100) )
ROM_REGION( 0x100, "unkprom", 0 )
ROM_LOAD( "am27s21.f3", 0x0000, 0x0100, CRC(169cbb68) SHA1(1062e84c4b4208be9aa400e236579dc5b83e9f83) )
ROM_REGION( 0x20, "unkprom2", 0 )
- ROM_LOAD( "82s123.d12", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
+ ROM_LOAD( "82s123.d12", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
+
+ ROM_REGION( 0x800, "timekeeper", 0 ) // just for preservation and further analysis...
+ ROM_LOAD( "m48t12.bin", 0x0000, 0x07f8, CRC(11e61f97) SHA1(57d4744747b9d75b3ac31da8fc621f1a00ff1de3) ) // shouldn't be 0x800?
+
+ ROM_REGION( 0x1000, "plds", 0 )
+ ROM_LOAD( "gal16v8d.bin", 0x0000, 0x0892, CRC(1687b8da) SHA1(63c0bd119ec67c8033d08e03a6e6c86e0cab2884) ) // protected?... the first 0x800 are 1's
ROM_END
diff --git a/src/mame/drivers/hh_amis2k.cpp b/src/mame/drivers/hh_amis2k.cpp
index 92ddc8343df..c08b8a0f448 100644
--- a/src/mame/drivers/hh_amis2k.cpp
+++ b/src/mame/drivers/hh_amis2k.cpp
@@ -48,14 +48,14 @@ public:
required_device<speaker_sound_device> m_speaker;
required_device<timer_device> m_a12_decay_timer;
- uint8_t m_d;
- uint16_t m_a;
- uint8_t m_q2;
- uint8_t m_q3;
+ u8 m_d;
+ u16 m_a;
+ u8 m_q2;
+ u8 m_q3;
- uint16_t m_display_state[0x10];
- uint16_t m_display_cache[0x10];
- uint8_t m_display_decay[0x100];
+ u16 m_display_state[0x10];
+ u16 m_display_cache[0x10];
+ u8 m_display_decay[0x100];
DECLARE_WRITE8_MEMBER(write_d);
DECLARE_WRITE16_MEMBER(write_a);
@@ -110,7 +110,7 @@ inline bool wildfire_state::index_is_7segled(int index)
void wildfire_state::display_update()
{
- uint16_t active_state[0x10];
+ u16 active_state[0x10];
for (int i = 0; i < 0x10; i++)
{
@@ -292,7 +292,7 @@ enum
lG = 0x01
};
-static const uint8_t wildfire_7seg_table[0x10] =
+static const u8 wildfire_7seg_table[0x10] =
{
0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, // 0-9 unaltered
0x77, // A -> unused?
diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp
index 1795c35e368..87bc0196431 100644
--- a/src/mame/drivers/hh_cop400.cpp
+++ b/src/mame/drivers/hh_cop400.cpp
@@ -23,6 +23,7 @@
#include "funrlgl.lh"
#include "h2hbaskb.lh"
#include "lightfgt.lh" // clickable
+#include "mdallas.lh"
#include "qkracer.lh"
//#include "hh_cop400_test.lh" // common test-layout - use external artwork
@@ -45,30 +46,30 @@ public:
optional_ioport_array<5> m_inp_matrix; // max 5
// misc common
- uint8_t m_l; // MCU port L write data
- uint8_t m_g; // MCU port G write data
- uint8_t m_d; // MCU port D write data
- int m_so; // MCU SO line state
- int m_sk; // MCU SK line state
- uint16_t m_inp_mux; // multiplexed inputs mask
+ u8 m_l; // MCU port L write data
+ u8 m_g; // MCU port G write data
+ u8 m_d; // MCU port D write data
+ int m_so; // MCU SO line state
+ int m_sk; // MCU SK line state
+ u16 m_inp_mux; // multiplexed inputs mask
- uint16_t read_inputs(int columns);
+ u16 read_inputs(int columns);
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -128,7 +129,7 @@ void hh_cop400_state::machine_reset()
void hh_cop400_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -141,7 +142,7 @@ void hh_cop400_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -196,7 +197,7 @@ void hh_cop400_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_cop400_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void hh_cop400_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -207,12 +208,12 @@ void hh_cop400_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void hh_cop400_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void hh_cop400_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -223,10 +224,10 @@ void hh_cop400_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t
// generic input handlers
-uint16_t hh_cop400_state::read_inputs(int columns)
+u16 hh_cop400_state::read_inputs(int columns)
{
// active low
- uint16_t ret = 0xffff;
+ u16 ret = 0xffff;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -379,8 +380,8 @@ WRITE8_MEMBER(h2hbaskb_state::write_g)
WRITE8_MEMBER(h2hbaskb_state::write_l)
{
// D2,D3 double as multiplexer
- uint16_t mask = ((m_d >> 2 & 1) * 0x00ff) | ((m_d >> 3 & 1) * 0xff00);
- uint16_t sel = (m_g | m_d << 4 | m_g << 8 | m_d << 12) & mask;
+ u16 mask = ((m_d >> 2 & 1) * 0x00ff) | ((m_d >> 3 & 1) * 0xff00);
+ u16 sel = (m_g | m_d << 4 | m_g << 8 | m_d << 12) & mask;
// D2+G0,G1 are 7segs
set_display_segmask(3, 0x7f);
@@ -498,8 +499,8 @@ void einvaderc_state::prepare_display()
set_display_segmask(7, 0x7f);
// update display
- uint8_t l = BITSWAP8(m_l,7,6,0,1,2,3,4,5);
- uint16_t grid = (m_d | m_g << 4 | m_sk << 8 | m_so << 9) ^ 0x0ff;
+ u8 l = BITSWAP8(m_l,7,6,0,1,2,3,4,5);
+ u16 grid = (m_d | m_g << 4 | m_sk << 8 | m_so << 9) ^ 0x0ff;
display_matrix(8, 10, l, grid);
}
@@ -555,7 +556,7 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( einvaderc, einvaderc_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", COP444, 1000000) // approximation - RC osc. R=47K, C=100pf
+ MCFG_CPU_ADD("maincpu", COP444L, 1000000) // approximation - RC osc. R=47K, C=100pf
MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed
MCFG_COP400_READ_IN_CB(IOPORT("IN.0"))
MCFG_COP400_WRITE_D_CB(WRITE8(einvaderc_state, write_d))
@@ -770,7 +771,7 @@ static MACHINE_CONFIG_START( funrlgl, funrlgl_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", COP410, 1000000) // approximation - RC osc. R=51K, C=91pf
- MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, true) // guessed
+ MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_8, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed
MCFG_COP400_WRITE_D_CB(WRITE8(funrlgl_state, write_d))
MCFG_COP400_WRITE_L_CB(WRITE8(funrlgl_state, write_l))
MCFG_COP400_READ_L_TRISTATE_CB(READ8(funrlgl_state, read_l_tristate))
@@ -793,6 +794,81 @@ MACHINE_CONFIG_END
/***************************************************************************
+ Mattel Dalla$
+ * x
+
+***************************************************************************/
+
+class mdallas_state : public hh_cop400_state
+{
+public:
+ mdallas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_cop400_state(mconfig, type, tag),
+ m_dac(*this, "dac")
+ { }
+
+ required_device<dac_bit_interface> m_dac;
+
+ DECLARE_WRITE8_MEMBER(write_d);
+ DECLARE_WRITE8_MEMBER(write_l);
+ DECLARE_WRITE8_MEMBER(write_g);
+ DECLARE_READ8_MEMBER(read_in);
+};
+
+// handlers
+
+WRITE8_MEMBER(mdallas_state::write_d)
+{
+}
+
+WRITE8_MEMBER(mdallas_state::write_l)
+{
+}
+
+WRITE8_MEMBER(mdallas_state::write_g)
+{
+}
+
+READ8_MEMBER(mdallas_state::read_in)
+{
+ // IN: multiplexed inputs
+ return 0;
+}
+
+
+// config
+
+static INPUT_PORTS_START( mdallas )
+ PORT_START("IN.0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( mdallas, mdallas_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", COP444L, 1000000) // approximation - RC osc. R=57K, C=101pf
+ MCFG_COP400_CONFIG(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false) // guessed
+ MCFG_COP400_WRITE_D_CB(WRITE8(mdallas_state, write_d))
+ MCFG_COP400_WRITE_L_CB(WRITE8(mdallas_state, write_l))
+ MCFG_COP400_WRITE_G_CB(WRITE8(mdallas_state, write_g))
+ MCFG_COP400_WRITE_SO_CB(DEVWRITELINE("dac", dac_bit_interface, write))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_cop400_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_mdallas)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("speaker")
+ MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
+ MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
+ MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
Milton Bradley Plus One
* COP410L MCU in 8-pin DIP, label ~/029 MM 57405 (die label COP410L/B NNE)
* 4 sensors(1 on each die side), 1-bit sound
@@ -898,7 +974,7 @@ public:
void lightfgt_state::prepare_display()
{
- uint8_t grid = (m_so | m_d << 1) ^ 0x1f;
+ u8 grid = (m_so | m_d << 1) ^ 0x1f;
display_matrix(5, 5, m_l, grid);
}
@@ -1310,6 +1386,12 @@ ROM_START( funrlgl )
ROM_END
+ROM_START( mdallas )
+ ROM_REGION( 0x0800, "maincpu", 0 )
+ ROM_LOAD( "copl444l-htn_n", 0x0000, 0x0800, CRC(7848b78c) SHA1(778d24512180892f58c49df3c72ca77b2618d63b) )
+ROM_END
+
+
ROM_START( plus1 )
ROM_REGION( 0x0200, "maincpu", 0 )
ROM_LOAD( "cop410l_b_nne", 0x0000, 0x0200, BAD_DUMP CRC(8626fdb8) SHA1(fd241b6dde0e4e86b439cb2c5bb3a82fb257d7e1) ) // still need to verify
@@ -1344,6 +1426,7 @@ CONS( 1981, einvaderc, einvader, 0, einvaderc, einvaderc, driver_device, 0, "Ent
CONS( 1979, funjacks, 0, 0, funjacks, funjacks, driver_device, 0, "Mattel", "Funtronics Jacks", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
CONS( 1979, funrlgl, 0, 0, funrlgl, funrlgl, driver_device, 0, "Mattel", "Funtronics Red Light Green Light", MACHINE_SUPPORTS_SAVE )
+CONS( 1981, mdallas, 0, 0, mdallas, mdallas, driver_device, 0, "Mattel", "Dalla$ (J.R. handheld)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // ***
CONS( 1980, plus1, 0, 0, plus1, plus1, driver_device, 0, "Milton Bradley", "Plus One", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) // ***
CONS( 1981, lightfgt, 0, 0, lightfgt, lightfgt, driver_device, 0, "Milton Bradley", "Lightfight", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp
index 4cd7736585a..4f6f357d1f3 100644
--- a/src/mame/drivers/hh_hmcs40.cpp
+++ b/src/mame/drivers/hh_hmcs40.cpp
@@ -122,34 +122,34 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint8_t m_r[8]; // MCU R ports write data (optional)
- uint16_t m_d; // MCU D port write data (optional)
- uint8_t m_int[2]; // MCU INT0/1 pins state
- uint16_t m_inp_mux; // multiplexed inputs mask
+ u8 m_r[8]; // MCU R ports write data (optional)
+ u16 m_d; // MCU D port write data (optional)
+ u8 m_int[2]; // MCU INT0/1 pins state
+ u16 m_inp_mux; // multiplexed inputs mask
- uint16_t read_inputs(int columns);
+ u16 read_inputs(int columns);
void refresh_interrupts(void);
void set_interrupt(int line, int state);
DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line);
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 47 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 47 for now)
- uint32_t m_grid; // VFD current row data
- uint64_t m_plate; // VFD current column data
+ u32 m_grid; // VFD current row data
+ u64 m_plate; // VFD current column data
- uint64_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint64_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x40]; // (internal use)
+ u64 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u64 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x40]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint64_t setx, uint32_t sety, bool update = true);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u64 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -210,7 +210,7 @@ void hh_hmcs40_state::machine_reset()
void hh_hmcs40_state::display_update()
{
- uint64_t active_state[0x20];
+ u64 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -223,7 +223,7 @@ void hh_hmcs40_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint64_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u64 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -278,7 +278,7 @@ void hh_hmcs40_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_hmcs40_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void hh_hmcs40_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -289,12 +289,12 @@ void hh_hmcs40_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void hh_hmcs40_state::display_matrix(int maxx, int maxy, uint64_t setx, uint32_t sety, bool update)
+void hh_hmcs40_state::display_matrix(int maxx, int maxy, u64 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint64_t mask = (u64(1) << maxx) - 1;
+ u64 mask = (u64(1) << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (u64(1) << maxx)) : 0;
@@ -305,9 +305,9 @@ void hh_hmcs40_state::display_matrix(int maxx, int maxy, uint64_t setx, uint32_t
// generic input handlers
-uint16_t hh_hmcs40_state::read_inputs(int columns)
+u16 hh_hmcs40_state::read_inputs(int columns)
{
- uint16_t ret = 0;
+ u16 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -382,7 +382,7 @@ WRITE8_MEMBER(bambball_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t plate = BITSWAP16(m_plate,13,8,4,12,9,10,14,1,7,0,15,11,6,3,5,2);
+ u16 plate = BITSWAP16(m_plate,13,8,4,12,9,10,14,1,7,0,15,11,6,3,5,2);
display_matrix(16, 9, plate, m_grid);
}
@@ -491,8 +491,8 @@ public:
void bmboxing_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
- uint32_t plate = BITSWAP16(m_plate,15,14,13,12,1,2,0,3,11,4,10,7,5,6,9,8);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
+ u32 plate = BITSWAP16(m_plate,15,14,13,12,1,2,0,3,11,4,10,7,5,6,9,8);
display_matrix(12, 9, plate, grid);
}
@@ -630,8 +630,8 @@ public:
void bfriskyt_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP24(m_plate,23,22,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP24(m_plate,23,22,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
display_matrix(22, 8, plate, grid);
}
@@ -649,7 +649,7 @@ WRITE16_MEMBER(bfriskyt_state::grid_w)
m_speaker->level_w(data >> 6 & 1);
// D11-D15: input mux
- uint8_t inp_mux = data >> 11 & 0x1f;
+ u8 inp_mux = data >> 11 & 0x1f;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -763,8 +763,8 @@ WRITE8_MEMBER(packmon_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,0,1,2,3,4,5,6,19,18,17,16,15,14,13,12,11,10,9,8,7);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,0,1,2,3,4,5,6,19,18,17,16,15,14,13,12,11,10,9,8,7);
display_matrix(20, 10, plate, grid);
}
@@ -873,8 +873,8 @@ public:
void msthawk_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,19,20,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
+ u32 plate = BITSWAP24(m_plate,23,22,21,19,20,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
display_matrix(21, 10, plate, grid);
}
@@ -892,7 +892,7 @@ WRITE16_MEMBER(msthawk_state::grid_w)
m_speaker->level_w(data >> 5 & 1);
// D10-D15: input mux
- uint8_t inp_mux = data >> 10 & 0x3f;
+ u8 inp_mux = data >> 10 & 0x3f;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -1006,8 +1006,8 @@ WRITE8_MEMBER(bzaxxon_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,6,7,8,9,10,5,4,3,2,1,0);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,5,7,0,1,2,3,4,6,19,16,17,18,15,14,13,12,10,8,9,11) | 0x800;
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,6,7,8,9,10,5,4,3,2,1,0);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,5,7,0,1,2,3,4,6,19,16,17,18,15,14,13,12,10,8,9,11) | 0x800;
display_matrix(20, 11, plate, grid);
}
@@ -1017,7 +1017,7 @@ WRITE16_MEMBER(bzaxxon_state::grid_w)
m_speaker->level_w(data >> 4 & 1);
// D7-D10: input mux
- uint8_t inp_mux = data >> 7 & 0xf;
+ u8 inp_mux = data >> 7 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -1127,8 +1127,8 @@ WRITE8_MEMBER(zackman_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP32(m_plate,31,30,27,0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,29,28,23,22,21,20,19,18,17,16,15,14,13,12);
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP32(m_plate,31,30,27,0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,29,28,23,22,21,20,19,18,17,16,15,14,13,12);
display_matrix(29, 8, plate, grid);
}
@@ -1138,7 +1138,7 @@ WRITE16_MEMBER(zackman_state::grid_w)
m_speaker->level_w(data >> 2 & 1);
// D11-D14: input mux
- uint8_t inp_mux = data >> 11 & 0xf;
+ u8 inp_mux = data >> 11 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -1243,8 +1243,8 @@ public:
void bpengo_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP32(m_plate,31,30,29,28,23,22,21,16,17,18,19,20,27,26,25,24,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP32(m_plate,31,30,29,28,23,22,21,16,17,18,19,20,27,26,25,24,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
display_matrix(25, 8, plate, grid);
}
@@ -1262,7 +1262,7 @@ WRITE16_MEMBER(bpengo_state::grid_w)
m_speaker->level_w(data >> 10 & 1);
// D12-D15: input mux
- uint8_t inp_mux = data >> 12 & 0xf;
+ u8 inp_mux = data >> 12 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -1372,8 +1372,8 @@ public:
void bbtime_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5);
- uint32_t plate = BITSWAP32(m_plate,31,30,29,28,25,24,26,27,22,23,15,14,12,11,10,8,7,6,4,1,5,9,13,3,2,16,17,18,19,20,0,21) | 0x1;
+ u8 grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5);
+ u32 plate = BITSWAP32(m_plate,31,30,29,28,25,24,26,27,22,23,15,14,12,11,10,8,7,6,4,1,5,9,13,3,2,16,17,18,19,20,0,21) | 0x1;
display_matrix(28, 6, plate, grid);
}
@@ -1391,7 +1391,7 @@ WRITE16_MEMBER(bbtime_state::grid_w)
m_speaker->level_w(data >> 3 & 1);
// D10-D14: input mux
- uint8_t inp_mux = data >> 10 & 0x1f;
+ u8 inp_mux = data >> 10 & 0x1f;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -1498,8 +1498,8 @@ WRITE8_MEMBER(bdoramon_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,7,6);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,11,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1,0);
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,7,6);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,11,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1,0);
display_matrix(19, 8, plate, grid);
}
@@ -1597,8 +1597,8 @@ WRITE8_MEMBER(bultrman_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,0,18,17,16,15,14,13,12,3,11,10,9,8,7,6,5,4,1,2);
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,0,18,17,16,15,14,13,12,3,11,10,9,8,7,6,5,4,1,2);
display_matrix(18, 8, plate, grid);
}
@@ -1684,7 +1684,7 @@ public:
void machiman_state::prepare_display()
{
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);
display_matrix(19, 5, plate, m_grid);
}
@@ -1938,7 +1938,7 @@ WRITE8_MEMBER(alnattck_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,16,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,16,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15);
display_matrix(20, 10, plate, m_grid);
}
@@ -2065,7 +2065,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(cdkong_state::speaker_decay_sim)
void cdkong_state::prepare_display()
{
- uint32_t plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4) | 0x800800;
+ u32 plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4) | 0x800800;
display_matrix(29, 11, plate, m_grid);
}
@@ -2183,8 +2183,8 @@ public:
void cgalaxn_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,1,2,0,11,10,9,8,7,6,5,4,3);
- uint16_t plate = BITSWAP16(m_plate,15,14,6,5,4,3,2,1,7,8,9,10,11,0,12,13);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,1,2,0,11,10,9,8,7,6,5,4,3);
+ u16 plate = BITSWAP16(m_plate,15,14,6,5,4,3,2,1,7,8,9,10,11,0,12,13);
display_matrix(15, 12, plate, grid);
}
@@ -2319,8 +2319,8 @@ WRITE8_MEMBER(cpacman_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10);
- uint32_t plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10);
+ u32 plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7);
display_matrix(27, 11, plate, grid);
}
@@ -2436,8 +2436,8 @@ WRITE8_MEMBER(cmspacmn_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,0,1);
- uint64_t plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16) | 0x1004080;
+ u16 grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,0,1);
+ u64 plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16) | 0x1004080;
display_matrix(33, 12, plate, grid);
}
@@ -2552,7 +2552,7 @@ void sag_state::prepare_display()
// grid 8-11 are 7segs
set_display_segmask(0xf00, 0x7f);
- uint8_t seg = BITSWAP8(m_plate,3,4,5,6,7,8,9,10);
+ u8 seg = BITSWAP8(m_plate,3,4,5,6,7,8,9,10);
for (int y = 8; y < 12; y++)
m_display_state[y] = (m_grid >> y & 1) ? seg : 0;
@@ -2682,8 +2682,8 @@ public:
void egalaxn2_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8);
+ u16 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8);
display_matrix(24, 15, plate, grid);
}
@@ -2865,7 +2865,7 @@ public:
DECLARE_WRITE8_MEMBER(plate_w);
DECLARE_WRITE16_MEMBER(grid_w);
- uint8_t m_cop_irq;
+ u8 m_cop_irq;
DECLARE_WRITE_LINE_MEMBER(speaker_w);
DECLARE_WRITE8_MEMBER(cop_irq_w);
DECLARE_READ8_MEMBER(cop_latch_r);
@@ -2882,8 +2882,8 @@ protected:
void eturtles_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,1,14,13,12,11,10,9,8,7,6,5,4,3,2,0);
- uint32_t plate = BITSWAP32(m_plate,31,30,11,12,18,19,16,17,22,15,20,21,27,26,23,25,24,2,3,1,0,6,4,5,10,9,2,8,7,14,1,13);
+ u16 grid = BITSWAP16(m_grid,15,1,14,13,12,11,10,9,8,7,6,5,4,3,2,0);
+ u32 plate = BITSWAP32(m_plate,31,30,11,12,18,19,16,17,22,15,20,21,27,26,23,25,24,2,3,1,0,6,4,5,10,9,2,8,7,14,1,13);
display_matrix(30, 15, plate | (grid >> 5 & 8), grid); // grid 8 also forces plate 3 high
}
@@ -2902,7 +2902,7 @@ WRITE16_MEMBER(eturtles_state::grid_w)
m_d = data;
// D1-D6: input mux
- uint8_t inp_mux = data >> 1 & 0x3f;
+ u8 inp_mux = data >> 1 & 0x3f;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -2917,7 +2917,7 @@ WRITE16_MEMBER(eturtles_state::grid_w)
void eturtles_state::update_int()
{
// INT0/1 on multiplexed inputs, and from COP D0
- uint8_t inp = read_inputs(6);
+ u8 inp = read_inputs(6);
set_interrupt(0, (inp & 1) | m_cop_irq);
set_interrupt(1, inp & 2);
}
@@ -3062,8 +3062,8 @@ public:
void estargte_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1);
- uint32_t plate = BITSWAP32(m_plate,31,30,29,15,17,19,21,23,25,27,26,24,3,22,20,18,16,14,12,10,8,6,4,2,0,1,3,5,7,9,11,13);
+ u16 grid = BITSWAP16(m_grid,15,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1);
+ u32 plate = BITSWAP32(m_plate,31,30,29,15,17,19,21,23,25,27,26,24,3,22,20,18,16,14,12,10,8,6,4,2,0,1,3,5,7,9,11,13);
display_matrix(29, 14, plate, grid);
}
@@ -3179,8 +3179,8 @@ WRITE8_MEMBER(ghalien_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,14,12,10,8,9,13,15,2,0,1,3,11,7,5,4,6,19,17,16,18);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,14,12,10,8,9,13,15,2,0,1,3,11,7,5,4,6,19,17,16,18);
display_matrix(20, 10, plate, grid);
}
@@ -3298,8 +3298,8 @@ WRITE8_MEMBER(gckong_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10);
- uint32_t plate = BITSWAP32(m_plate,31,30,29,28,27,26,25,6,7,8,12,13,14,15,16,17,18,17,16,12,11,10,9,8,7,6,5,4,3,2,1,0) | 0x8000;
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10);
+ u32 plate = BITSWAP32(m_plate,31,30,29,28,27,26,25,6,7,8,12,13,14,15,16,17,18,17,16,12,11,10,9,8,7,6,5,4,3,2,1,0) | 0x8000;
display_matrix(32, 11, plate, grid);
}
@@ -3309,7 +3309,7 @@ WRITE16_MEMBER(gckong_state::grid_w)
m_speaker->level_w(data >> 2 & 1);
// D5-D8: input mux
- uint8_t inp_mux = data >> 5 & 0xf;
+ u8 inp_mux = data >> 5 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -3422,7 +3422,7 @@ WRITE8_MEMBER(gdigdug_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint32_t plate = BITSWAP32(m_plate,30,31,0,1,2,3,4,5,6,7,20,21,22,27,26,25,28,29,24,23,15,14,13,12,8,9,10,11,19,18,17,16);
+ u32 plate = BITSWAP32(m_plate,30,31,0,1,2,3,4,5,6,7,20,21,22,27,26,25,28,29,24,23,15,14,13,12,8,9,10,11,19,18,17,16);
display_matrix(32, 9, plate, m_grid);
}
@@ -3432,7 +3432,7 @@ WRITE16_MEMBER(gdigdug_state::grid_w)
m_speaker->level_w(data >> 6 & 1);
// D11-D15: input mux
- uint8_t inp_mux = data >> 11 & 0x1f;
+ u8 inp_mux = data >> 11 & 0x1f;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -3543,7 +3543,7 @@ public:
void mwcbaseb_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
display_matrix(16, 8, m_plate, grid);
}
@@ -3641,7 +3641,7 @@ static INPUT_PORTS_START( mwcbaseb )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("P1 1")
INPUT_PORTS_END
-static const int16_t mwcbaseb_speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 };
+static const s16 mwcbaseb_speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 };
static MACHINE_CONFIG_START( mwcbaseb, mwcbaseb_state )
@@ -3703,7 +3703,7 @@ WRITE8_MEMBER(pbqbert_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint32_t plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23) | 0x400000;
+ u32 plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23) | 0x400000;
display_matrix(30, 8, plate, m_grid);
}
@@ -3791,8 +3791,8 @@ public:
void kingman_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
- uint32_t plate = BITSWAP24(m_plate,23,6,7,5,4,3,2,1,0,13,12,20,19,18,17,16,10,11,9,8,14,15,13,12);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
+ u32 plate = BITSWAP24(m_plate,23,6,7,5,4,3,2,1,0,13,12,20,19,18,17,16,10,11,9,8,14,15,13,12);
display_matrix(23, 9, plate, grid);
}
@@ -3810,7 +3810,7 @@ WRITE16_MEMBER(kingman_state::grid_w)
m_speaker->level_w(data >> 6 & 1);
// D12-D15: input mux
- uint8_t inp_mux = data >> 12 & 0xf;
+ u8 inp_mux = data >> 12 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -3913,8 +3913,8 @@ public:
void tmtron_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,1,2,3,4,5,6,7,8,9,0);
- uint32_t plate = BITSWAP24(m_plate,23,5,2,21,1,6,7,9,10,11,21,0,19,3,4,8,3,18,17,16,12,13,14,15);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,1,2,3,4,5,6,7,8,9,0);
+ u32 plate = BITSWAP24(m_plate,23,5,2,21,1,6,7,9,10,11,21,0,19,3,4,8,3,18,17,16,12,13,14,15);
display_matrix(23, 10, plate, grid);
}
@@ -3932,7 +3932,7 @@ WRITE16_MEMBER(tmtron_state::grid_w)
m_speaker->level_w(data >> 4 & 1);
// D12-D15: input mux
- uint8_t inp_mux = data >> 12 & 0xf;
+ u8 inp_mux = data >> 12 & 0xf;
if (inp_mux != m_inp_mux)
{
m_inp_mux = inp_mux;
@@ -4040,7 +4040,7 @@ WRITE8_MEMBER(vinvader_state::plate_w)
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
// update display
- uint16_t plate = BITSWAP16(m_plate,15,11,7,3,10,6,14,2,9,5,13,1,8,4,12,0);
+ u16 plate = BITSWAP16(m_plate,15,11,7,3,10,6,14,2,9,5,13,1,8,4,12,0);
display_matrix(12, 9, plate, m_grid);
}
diff --git a/src/mame/drivers/hh_melps4.cpp b/src/mame/drivers/hh_melps4.cpp
index 0e557ee6b58..f337c6def02 100644
--- a/src/mame/drivers/hh_melps4.cpp
+++ b/src/mame/drivers/hh_melps4.cpp
@@ -34,28 +34,28 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint16_t m_inp_mux; // multiplexed inputs mask
+ u16 m_inp_mux; // multiplexed inputs mask
- uint8_t read_inputs(int columns);
+ u8 read_inputs(int columns);
DECLARE_INPUT_CHANGED_MEMBER(reset_button);
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_grid; // VFD current row data
- uint32_t m_plate; // VFD current column data
+ u32 m_grid; // VFD current row data
+ u32 m_plate; // VFD current column data
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -109,7 +109,7 @@ void hh_melps4_state::machine_reset()
void hh_melps4_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -122,7 +122,7 @@ void hh_melps4_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -177,12 +177,12 @@ void hh_melps4_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_melps4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void hh_melps4_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -193,9 +193,9 @@ void hh_melps4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t
// generic input handlers
-uint8_t hh_melps4_state::read_inputs(int columns)
+u8 hh_melps4_state::read_inputs(int columns)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -246,8 +246,8 @@ public:
void cfrogger_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11);
- uint16_t plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11);
+ u16 plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8);
display_matrix(16, 12, plate, grid);
}
@@ -362,8 +362,8 @@ public:
void gjungler_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0,1);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,8,9,10,11,13,16,15,14,13,12,7,0,6,1,5,2,4,3) | 0x2000;
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0,1);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,8,9,10,11,13,16,15,14,13,12,7,0,6,1,5,2,4,3) | 0x2000;
display_matrix(18, 12, plate, grid);
}
diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp
index c8b013ecd12..8d50186f349 100644
--- a/src/mame/drivers/hh_pic16.cpp
+++ b/src/mame/drivers/hh_pic16.cpp
@@ -50,23 +50,23 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint8_t m_b; // MCU port B data
- uint8_t m_c; // MCU port C data
+ u8 m_b; // MCU port B data
+ u8 m_c; // MCU port C data
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
@@ -118,7 +118,7 @@ void hh_pic16_state::machine_reset()
void hh_pic16_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -131,7 +131,7 @@ void hh_pic16_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -186,12 +186,12 @@ void hh_pic16_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_pic16_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void hh_pic16_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -258,7 +258,7 @@ static INPUT_PORTS_START( maniac )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) // upper-left
INPUT_PORTS_END
-static const int16_t maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( maniac, maniac_state )
diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp
index 92fc2c56e06..a0edf5bc8b8 100644
--- a/src/mame/drivers/hh_sm510.cpp
+++ b/src/mame/drivers/hh_sm510.cpp
@@ -34,11 +34,11 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint16_t m_inp_mux; // multiplexed inputs mask
- int m_inp_lines; // number of input mux columns
- uint8_t m_lcd_output_cache[0x100];
+ u16 m_inp_mux; // multiplexed inputs mask
+ int m_inp_lines; // number of input mux columns
+ u8 m_lcd_output_cache[0x100];
- uint8_t read_inputs(int columns);
+ u8 read_inputs(int columns);
virtual void update_k_line();
virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed);
@@ -87,7 +87,7 @@ WRITE16_MEMBER(hh_sm510_state::lcd_segment_w)
for (int seg = 0; seg < 0x10; seg++)
{
int index = offset << 4 | seg;
- uint8_t state = data >> seg & 1;
+ u8 state = data >> seg & 1;
if (state != m_lcd_output_cache[index])
{
@@ -107,9 +107,9 @@ WRITE16_MEMBER(hh_sm510_state::lcd_segment_w)
// generic input handlers - usually S output is input mux, and K input for buttons
-uint8_t hh_sm510_state::read_inputs(int columns)
+u8 hh_sm510_state::read_inputs(int columns)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index e14282582f9..5c908fdbb50 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -250,7 +250,7 @@ void hh_tms1k_state::machine_reset()
void hh_tms1k_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -263,7 +263,7 @@ void hh_tms1k_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -325,7 +325,7 @@ void hh_tms1k_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_tms1k_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void hh_tms1k_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -336,12 +336,12 @@ void hh_tms1k_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void hh_tms1k_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void hh_tms1k_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -352,9 +352,9 @@ void hh_tms1k_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t
// generic input handlers
-uint8_t hh_tms1k_state::read_inputs(int columns)
+u8 hh_tms1k_state::read_inputs(int columns)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -364,10 +364,10 @@ uint8_t hh_tms1k_state::read_inputs(int columns)
return ret;
}
-uint8_t hh_tms1k_state::read_rotated_inputs(int columns, uint8_t rowmask)
+u8 hh_tms1k_state::read_rotated_inputs(int columns, u8 rowmask)
{
- uint8_t ret = 0;
- uint16_t colmask = (1 << columns) - 1;
+ u8 ret = 0;
+ u16 colmask = (1 << columns) - 1;
// read selected input columns
for (int i = 0; i < 8; i++)
@@ -510,7 +510,7 @@ static INPUT_PORTS_START( matchnum )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square 1")
INPUT_PORTS_END
-static const int16_t matchnum_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 matchnum_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( matchnum, matchnum_state )
@@ -656,7 +656,7 @@ static INPUT_PORTS_START( mathmagi )
INPUT_PORTS_END
// output PLA is not decapped
-static const uint16_t mathmagi_output_pla[0x20] =
+static const u16 mathmagi_output_pla[0x20] =
{
lA+lB+lC+lD+lE+lF, // 0
lB+lC, // 1
@@ -873,7 +873,7 @@ WRITE16_MEMBER(amaztron_state::write_o)
READ8_MEMBER(amaztron_state::read_k)
{
// K: multiplexed inputs
- uint8_t k = read_inputs(6);
+ u8 k = read_inputs(6);
// the 5th column is tied to K4+K8
if (k & 0x10) k |= 0xc;
@@ -1066,7 +1066,7 @@ static INPUT_PORTS_START( zodiac )
INPUT_PORTS_END
// output PLA is not decapped
-static const uint16_t zodiac_output_pla[0x20] =
+static const u16 zodiac_output_pla[0x20] =
{
0x80, // empty/led 1/7
lC, // i/led 2/8
@@ -1154,7 +1154,7 @@ public:
void cqback_state::prepare_display()
{
// R9 selects between segments B/C or A'/D'
- uint16_t seg = m_o;
+ u16 seg = m_o;
if (m_r & 0x200)
seg = (m_o << 7 & 0x300) | (m_o & 0xf9);
@@ -2087,7 +2087,7 @@ static INPUT_PORTS_START( cnfball )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
INPUT_PORTS_END
-static const int16_t cnfball_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 cnfball_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( cnfball, cnfball_state )
@@ -2143,7 +2143,7 @@ public:
void cnfball2_state::prepare_display()
{
// R1 selects between segments B/C or A'/D'
- uint16_t seg = m_o;
+ u16 seg = m_o;
if (~m_r & 2)
seg = (m_o << 7 & 0x300) | (m_o & 0xf9);
@@ -2205,7 +2205,7 @@ static INPUT_PORTS_START( cnfball2 )
INPUT_PORTS_END
// output PLA is not decapped
-static const uint16_t cnfball2_output_pla[0x20] =
+static const u16 cnfball2_output_pla[0x20] =
{
// first half was dumped electronically
0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x40, 0x01, 0x08, 0x02, 0x04, 0x00,
@@ -3346,7 +3346,7 @@ void raisedvl_state::set_clock()
// 0: R=47K -> ~350kHz
// 2,3: R=35K8 -> ~425kHz (combined)
// 4: R=32K -> ~465kHz (combined)
- uint8_t inp = m_inp_matrix[1]->read();
+ u8 inp = m_inp_matrix[1]->read();
m_maincpu->set_unscaled_clock((inp & 0x20) ? 465000 : ((inp & 0x10) ? 425000 : 350000));
}
@@ -3665,8 +3665,8 @@ public:
void ginv1000_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,9,8,7);
- uint16_t plate = BITSWAP16(m_plate,15,14,13,12,3,4,7,8,9,10,11,2,6,5,1,0);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,9,8,7);
+ u16 plate = BITSWAP16(m_plate,15,14,13,12,3,4,7,8,9,10,11,2,6,5,1,0);
display_matrix(12, 10, plate, grid);
}
@@ -3987,7 +3987,7 @@ static INPUT_PORTS_START( elecdet )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false)
INPUT_PORTS_END
-static const int16_t elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff };
+static const s16 elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff };
static MACHINE_CONFIG_START( elecdet, elecdet_state )
@@ -4313,8 +4313,8 @@ void elecbowl_state::prepare_display()
}
// lamp muxes
- uint8_t mask = 1 << (m_o & 7);
- uint8_t d = (m_r & 2) ? mask : 0;
+ u8 mask = 1 << (m_o & 7);
+ u8 d = (m_r & 2) ? mask : 0;
if (~m_r & 1)
m_display_state[5] = (m_display_state[5] & ~mask) | d;
if (~m_r & 4)
@@ -4391,7 +4391,7 @@ static INPUT_PORTS_START( elecbowl )
INPUT_PORTS_END
// output PLA is not decapped
-static const uint16_t elecbowl_output_pla[0x20] =
+static const u16 elecbowl_output_pla[0x20] =
{
lA+lB+lC+lD+lE+lF, // 0
lB+lC, // 1
@@ -5197,7 +5197,7 @@ void ssimon_state::set_clock()
// 0 Simple: R=51K -> ~200kHz
// 1 Normal: R=37K -> ~275kHz
// 2 Super: R=22K -> ~400kHz
- uint8_t inp = m_inp_matrix[6]->read();
+ u8 inp = m_inp_matrix[6]->read();
m_maincpu->set_unscaled_clock((inp & 2) ? 400000 : ((inp & 1) ? 275000 : 200000));
}
@@ -5385,7 +5385,7 @@ void bigtrak_state::machine_start()
save_item(NAME(m_gearbox_pos));
}
-static const int16_t bigtrak_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
+static const s16 bigtrak_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
static MACHINE_CONFIG_START( bigtrak, bigtrak_state )
@@ -5509,7 +5509,7 @@ void mbdtower_state::prepare_display()
// update current state
if (~m_r & 0x10)
{
- uint8_t o = BITSWAP8(m_o,7,0,4,3,2,1,6,5) & 0x7f;
+ u8 o = BITSWAP8(m_o,7,0,4,3,2,1,6,5) & 0x7f;
m_display_state[2] = (m_o & 0x80) ? o : 0;
m_display_state[1] = (m_o & 0x80) ? 0 : o;
m_display_state[0] = (m_r >> 8 & 1) | (m_r >> 4 & 0xe);
@@ -5851,7 +5851,7 @@ static INPUT_PORTS_START( merlin )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("New Game")
INPUT_PORTS_END
-static const int16_t merlin_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
+static const s16 merlin_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff };
static MACHINE_CONFIG_START( merlin, merlin_state )
@@ -6030,7 +6030,7 @@ static INPUT_PORTS_START( stopthief )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false)
INPUT_PORTS_END
-static const int16_t stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff };
+static const s16 stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff };
static MACHINE_CONFIG_START( stopthief, stopthief_state )
@@ -6364,7 +6364,7 @@ static INPUT_PORTS_START( lostreas )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Up")
INPUT_PORTS_END
-static const int16_t lostreas_speaker_levels[16] =
+static const s16 lostreas_speaker_levels[16] =
{
0, 0x7fff/15, 0x7fff/14, 0x7fff/13, 0x7fff/12, 0x7fff/11, 0x7fff/10, 0x7fff/9,
0x7fff/8, 0x7fff/7, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff/1
@@ -6422,8 +6422,8 @@ public:
void tcfball_state::prepare_display()
{
// R8 enables leds, R9 enables digits
- uint16_t mask = ((m_r >> 9 & 1) * 0x7f) | ((m_r >> 8 & 1) * 0x780);
- uint16_t sel = ((m_r & 0x7f) | (m_r << 7 & 0x780)) & mask;
+ u16 mask = ((m_r >> 9 & 1) * 0x7f) | ((m_r >> 8 & 1) * 0x780);
+ u16 sel = ((m_r & 0x7f) | (m_r << 7 & 0x780)) & mask;
set_display_segmask(0x77, 0x7f);
set_display_segmask(0x08, 0xff); // R3 has DP
@@ -6538,7 +6538,7 @@ static INPUT_PORTS_START( tcfballa )
INPUT_PORTS_END
// output PLA is not decapped, dumped electronically
-static const uint16_t tcfballa_output_pla[0x20] =
+static const u16 tcfballa_output_pla[0x20] =
{
0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x00, 0x46, 0x70, 0x00, 0x00, 0x00,
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
@@ -6696,7 +6696,7 @@ static INPUT_PORTS_START( tandy12 )
INPUT_PORTS_END
// output PLA is not decapped
-static const uint16_t tandy12_output_pla[0x20] =
+static const u16 tandy12_output_pla[0x20] =
{
// these are certain
0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40,
@@ -7069,7 +7069,7 @@ static INPUT_PORTS_START( copycat )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
-static const int16_t copycat_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 copycat_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( copycat, copycat_state )
@@ -7398,7 +7398,7 @@ public:
{ }
required_device<tms1024_device> m_expander;
- uint8_t m_exp_port[7];
+ u8 m_exp_port[7];
DECLARE_WRITE8_MEMBER(expander_w);
void prepare_display();
@@ -7787,7 +7787,7 @@ static INPUT_PORTS_START( ssports4 )
INPUT_PORTS_END
// output PLA is not decapped, dumped electronically
-static const uint16_t ssports4_output_pla[0x20] =
+static const u16 ssports4_output_pla[0x20] =
{
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40
diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp
index 7d96935a0e1..6a537bec409 100644
--- a/src/mame/drivers/hh_ucom4.cpp
+++ b/src/mame/drivers/hh_ucom4.cpp
@@ -129,7 +129,7 @@ void hh_ucom4_state::machine_reset()
void hh_ucom4_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -142,7 +142,7 @@ void hh_ucom4_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -197,12 +197,12 @@ void hh_ucom4_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void hh_ucom4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void hh_ucom4_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -213,9 +213,9 @@ void hh_ucom4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t
// generic input handlers
-uint8_t hh_ucom4_state::read_inputs(int columns)
+u8 hh_ucom4_state::read_inputs(int columns)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -294,8 +294,8 @@ public:
void ufombs_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,3,2,1,0,4,5,6,7,8);
- uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,6,9,5,8,4,0,1,2,3);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,3,2,1,0,4,5,6,7,8);
+ u16 plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,6,9,5,8,4,0,1,2,3);
display_matrix(10, 9, plate, grid);
}
@@ -339,7 +339,7 @@ static INPUT_PORTS_START( ufombs )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
-static const int16_t ufombs_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 ufombs_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( ufombs, ufombs_state )
@@ -406,7 +406,7 @@ public:
void ssfball_state::prepare_display()
{
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,10,9,8,0,1,2,4,5,6);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,10,9,8,0,1,2,4,5,6);
display_matrix(16, 9, plate, m_grid);
}
@@ -485,7 +485,7 @@ static INPUT_PORTS_START( ssfball )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
INPUT_PORTS_END
-static const int16_t ssfball_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 ssfball_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( ssfball, ssfball_state )
@@ -550,7 +550,7 @@ public:
void bmsoccer_state::prepare_display()
{
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,8,4,0,9,5,1,10,6,2);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,8,4,0,9,5,1,10,6,2);
display_matrix(16, 9, plate, m_grid);
}
@@ -673,8 +673,8 @@ public:
void bmsafari_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
- uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,2,9,5,8,4,0,1,6,3);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8);
+ u16 plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,2,9,5,8,4,0,1,6,3);
display_matrix(10, 9, plate, grid);
}
@@ -783,7 +783,7 @@ public:
void splasfgt_state::prepare_display()
{
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,13,1,0,8,6,0,10,11,14,15,16,9,5,7,4,2,3);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,13,1,0,8,6,0,10,11,14,15,16,9,5,7,4,2,3);
display_matrix(16, 9, plate, m_grid);
}
@@ -871,7 +871,7 @@ static INPUT_PORTS_START( splasfgt )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
-static const int16_t splasfgt_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
+static const s16 splasfgt_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 };
static MACHINE_CONFIG_START( splasfgt, splasfgt_state )
@@ -935,8 +935,8 @@ public:
void bcclimbr_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,16,17,18,19,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
+ u8 grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,16,17,18,19,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0);
display_matrix(20, 6, plate, grid);
}
@@ -1153,8 +1153,8 @@ public:
void invspace_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,8,9,7,6,5,4,3,2,1,0);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,9,14,13,8,15,11,10,7,11,3,2,6,10,1,5,9,0,4,8);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,8,9,7,6,5,4,3,2,1,0);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,9,14,13,8,15,11,10,7,11,3,2,6,10,1,5,9,0,4,8);
display_matrix(19, 9, plate, grid);
}
@@ -1257,7 +1257,7 @@ public:
void efball_state::prepare_display()
{
- uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,4,3,0,2,1,6,10,9,5,8,7);
+ u16 plate = BITSWAP16(m_plate,15,14,13,12,11,4,3,0,2,1,6,10,9,5,8,7);
display_matrix(11, 10, plate, m_grid);
}
@@ -1370,8 +1370,8 @@ public:
void galaxy2_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
- uint16_t plate = BITSWAP16(m_plate,15,3,2,6,1,5,4,0,11,10,7,12,14,13,8,9);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
+ u16 plate = BITSWAP16(m_plate,15,3,2,6,1,5,4,0,11,10,7,12,14,13,8,9);
display_matrix(15, 10, plate, grid);
}
@@ -1481,8 +1481,8 @@ public:
void astrocmd_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,3,2,12,13,14,15,16,17,18,0,1,4,8,5,9,7,11,6,10);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,3,2,12,13,14,15,16,17,18,0,1,4,8,5,9,7,11,6,10);
display_matrix(17, 9, plate, grid);
}
@@ -1759,8 +1759,8 @@ public:
void mvbfree_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
- uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
+ u16 grid = BITSWAP16(m_grid,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
+ u16 plate = BITSWAP16(m_plate,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9);
display_matrix(10, 14, plate, grid);
}
@@ -1980,8 +1980,8 @@ public:
void tccombat_state::prepare_display()
{
- uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,3,2,1,0,7,6,5,4);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,11,15,3,10,14,2,9,13,1,0,12,8,15,1,5,0,3,7,2,6);
+ u16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,3,2,1,0,7,6,5,4);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,11,15,3,10,14,2,9,13,1,0,12,8,15,1,5,0,3,7,2,6);
display_matrix(20, 9, plate, grid);
}
@@ -2243,8 +2243,8 @@ public:
void tmpacman_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15) | 0x100;
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15) | 0x100;
display_matrix(19, 8, plate, grid);
}
@@ -2348,7 +2348,7 @@ public:
void tmscramb_state::prepare_display()
{
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,3,15,2,14,1,13,16,0,12,8,4,9,5,10,6,11,7) | 0x400;
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,3,15,2,14,1,13,16,0,12,8,4,9,5,10,6,11,7) | 0x400;
display_matrix(17, 10, plate, m_grid);
}
@@ -2450,8 +2450,8 @@ public:
void tcaveman_state::prepare_display()
{
- uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
- uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,10,11,5,6,7,8,0,9,2,18,17,16,3,15,14,13,12,4,1) | 0x40;
+ u8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7);
+ u32 plate = BITSWAP24(m_plate,23,22,21,20,19,10,11,5,6,7,8,0,9,2,18,17,16,3,15,14,13,12,4,1) | 0x40;
display_matrix(19, 8, plate, grid);
}
diff --git a/src/mame/drivers/jollyjgr.cpp b/src/mame/drivers/jollyjgr.cpp
index debd0ca52c0..cc2039a7fe6 100644
--- a/src/mame/drivers/jollyjgr.cpp
+++ b/src/mame/drivers/jollyjgr.cpp
@@ -2,8 +2,7 @@
// copyright-holders:Pierpaolo Prazzoli
/*
-Jolly Jogger
-Taito, 1982
+Guru-Readme for Jolly Jogger (Taito, 1982)
PCB Layout
----------
@@ -35,6 +34,14 @@ KDK00502
| |-|
| VOL AY3-8910 3.579545MHz |
|----------------------------------------------------------|
+Notes:
+ AY3-8910 - Clock 1.7897725MHz [3.579545/2]
+ KD13.1F - 82S123 Bipolar PROM
+ TMM416 - Toshiba TMM416 16k x1-bit Page Mode DRAM
+ MB14241 - Fujitsu MB14241 Video Shifter
+ VSync - 59.1864Hz
+ HSync - 15.0835kHz
+
FGO70008
KDN00007
@@ -56,12 +63,19 @@ KDN00007
| | |
| KD15.8B | |
| | |
-| KD14.8A | |
+| 8216 8216 KD14.8A | |
| | |
| | |
| |-|
| |
|----------------------------------------------------------|
+Notes:
+ Z80 - Clock 3.000MHz [18/6]
+ D2125 - Intel D2125 1k x1-bit SRAM
+ 8216 - 4 Bit Parallel Bi-directional Bus Driver
+ 6116 - 2k x8-bit SRAM
+ KD* - 2732 EPROM
+
FGO70009
KDN00006
@@ -70,25 +84,29 @@ KDN00006
| |-|
| | |
| | |
-| | |
+| [E]| |
| | |
| | |
| KD11.5H KD12.7H | |
| |-|
|1 |
|8 |
-|W |
+|W [T] |
|A |
|Y |-|
| | |
| | |
| | |
-| KD09.1C KD10.2C | |
+| KD09.1C KD10.2C 8216 8216 8216 8216 8216 8216 [F]| |
| | |
| | |
| 2114 2114 2114 2114 2114 2114 |-|
| |
|----------------------------------------------------------|
+Notes:
+ KD* - 2716 EPROM
+ 2114 - 1k x4-bit SRAM
+ 8216 - 4 Bit Parallel Bi-directional Bus Driver
driver by Pierpaolo Prazzoli
@@ -651,13 +669,13 @@ void jollyjgr_state::machine_reset()
static MACHINE_CONFIG_START( jollyjgr, jollyjgr_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", Z80, 3579545) /* 3,579545 MHz */
+ MCFG_CPU_ADD("maincpu", Z80, XTAL_18MHz/6) /* 3MHz verified */
MCFG_CPU_PROGRAM_MAP(jollyjgr_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", jollyjgr_state, jollyjgr_interrupt)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_REFRESH_RATE(59.18) /* 59.1864Hz measured */
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
@@ -671,7 +689,7 @@ static MACHINE_CONFIG_START( jollyjgr, jollyjgr_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("aysnd", AY8910, 3579545)
+ MCFG_SOUND_ADD("aysnd", AY8910, XTAL_3_579545MHz/2) /* 1.7897725MHz verified */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/k28.cpp b/src/mame/drivers/k28.cpp
index c68620e1d1c..50420033dde 100644
--- a/src/mame/drivers/k28.cpp
+++ b/src/mame/drivers/k28.cpp
@@ -50,30 +50,30 @@ public:
required_ioport_array<7> m_inp_matrix;
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
bool m_power_on;
- uint8_t m_inp_mux;
- uint8_t m_phoneme;
+ u8 m_inp_mux;
+ u8 m_phoneme;
int m_speech_strobe;
int m_vfd_data_enable;
int m_vfd_data_in;
int m_vfd_clock;
- uint64_t m_vfd_shiftreg;
- uint64_t m_vfd_shiftreg_out;
+ u64 m_vfd_shiftreg;
+ u64 m_vfd_shiftreg_out;
int m_vfd_shiftcount;
DECLARE_WRITE8_MEMBER(mcu_p0_w);
@@ -168,7 +168,7 @@ void k28_state::power_off()
void k28_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -181,7 +181,7 @@ void k28_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -236,7 +236,7 @@ void k28_state::set_display_size(int maxx, int maxy)
m_display_maxy = maxy;
}
-void k28_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void k28_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -247,12 +247,12 @@ void k28_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void k28_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void k28_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -297,7 +297,7 @@ WRITE8_MEMBER(k28_state::mcu_p0_w)
READ8_MEMBER(k28_state::mcu_p1_r)
{
- uint8_t data = 0;
+ u8 data = 0;
// multiplexed inputs (active low)
for (int i = 0; i < 7; i++)
@@ -352,11 +352,11 @@ WRITE8_MEMBER(k28_state::mcu_prog_w)
m_vfd_shiftcount = 0;
// output 0-15: digit segment data
- uint16_t seg_data = (uint16_t)(m_vfd_shiftreg >> 19);
+ u16 seg_data = (u16)(m_vfd_shiftreg >> 19);
seg_data = BITSWAP16(seg_data,0,1,13,9,10,12,14,8,3,4,5,2,15,11,6,7);
// output 16-24: digit select
- uint16_t digit_sel = (uint16_t)(m_vfd_shiftreg >> 10) & 0x1ff;
+ u16 digit_sel = (u16)(m_vfd_shiftreg >> 10) & 0x1ff;
set_display_segmask(0x1ff, 0x3fff);
display_matrix(16, 9, seg_data, digit_sel);
diff --git a/src/mame/drivers/m68705prg.cpp b/src/mame/drivers/m68705prg.cpp
index 16d7da89c8c..965fa9bb8cf 100644
--- a/src/mame/drivers/m68705prg.cpp
+++ b/src/mame/drivers/m68705prg.cpp
@@ -22,7 +22,8 @@
* When programming is complete, the "Programmed" LED will be lit. When
* verification is complete, the "Verified" LED will be lit. If
* verification fails, the program stops and the "Address" digits show
- * the address one past the location that failed.
+ * the address one past the location that failed for P3/P5, or the
+ * location that failed for R3/U3.
*/
#include "emu.h"
diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp
index 038ecbeba7f..be32aecb1a1 100644
--- a/src/mame/drivers/microvsn.cpp
+++ b/src/mame/drivers/microvsn.cpp
@@ -481,7 +481,7 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r )
}
-static const uint16_t microvision_output_pla_0[0x20] =
+static const u16 microvision_output_pla_0[0x20] =
{
/* O output PLA configuration currently unknown */
0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E,
@@ -491,7 +491,7 @@ static const uint16_t microvision_output_pla_0[0x20] =
};
-static const uint16_t microvision_output_pla_1[0x20] =
+static const u16 microvision_output_pla_1[0x20] =
{
/* O output PLA configuration currently unknown */
/* Reversed bit order */
diff --git a/src/mame/drivers/mmodular.cpp b/src/mame/drivers/mmodular.cpp
index 15450bad8a8..0c9a576d708 100644
--- a/src/mame/drivers/mmodular.cpp
+++ b/src/mame/drivers/mmodular.cpp
@@ -27,10 +27,6 @@
Academy 65C02 4.9152mhz
Monte Carlo IV, Mega IV and any others not listed above have correct ROM/RAM and maybe LCD, not much else for now
- Novag boards: (should go in different .c eventually)
- Super Forte and Super Expert are the same, except one is touch board, other is magnetic.
- The Diablo 68000 is Super Expert board but 68K based
-
Notes by Cowering (2011)
TODO: add Bavaria sensor support (unknown1,2,3 handlers in current driver)
@@ -105,8 +101,6 @@ static uint8_t montecivtopnew = 0, montecivbotnew = 0;
//Mephisto Mega IV latch
uint8_t latch2400 = 0;
-uint8_t diablo68_3c0000 = 0;
-
INPUT_PORTS_EXTERN( chessboard );
@@ -133,10 +127,6 @@ public:
DECLARE_WRITE8_MEMBER(write_polgar_IO);
DECLARE_WRITE8_MEMBER(write_LCD_polgar);
DECLARE_WRITE8_MEMBER(write_LCD_academy);
-// DECLARE_WRITE16_MEMBER(diablo68_aciawrite);
-// DECLARE_READ16_MEMBER(diablo68_aciaread);
- DECLARE_WRITE16_MEMBER(diablo68_reg_select);
- DECLARE_WRITE16_MEMBER(diablo68_write_LCD);
DECLARE_WRITE8_MEMBER(milano_write_LED);
DECLARE_WRITE8_MEMBER(megaiv_write_LED);
DECLARE_WRITE8_MEMBER(academy_write_LED);
@@ -178,7 +168,6 @@ public:
DECLARE_MACHINE_START(van32);
DECLARE_MACHINE_RESET(van16);
DECLARE_MACHINE_RESET(monteciv);
- DECLARE_MACHINE_START(diablo68);
DECLARE_MACHINE_START(van16);
DECLARE_MACHINE_RESET(academy);
DECLARE_PALETTE_INIT(chess_lcd);
@@ -266,60 +255,6 @@ WRITE8_MEMBER(polgar_state::write_LCD_academy)
m_lcdc->write(space, offset & 1, data);
}
-// AM_RANGE( 0x3a0000,0x3a0000 ) AM_READ(diablo68_write_LCD)
-// AM_RANGE( 0x3c0000,0x3c0000 ) AM_READ(diablo68_reg_select)
-
-/*WRITE16_MEMBER(polgar_state::diablo68_aciawrite)
-{
-// device_t *acia = machine().device("acia65c51");
-// acia_6551_w(acia, offset & 0x03, data >> 8);
-// printf("ACIA write data %04x offset %02x\n",data,offset);
- logerror("ACIA write data %04x offset %02x\n",data,offset);
-}
-
-READ16_MEMBER(polgar_state::diablo68_aciaread)
-{
-// device_t *acia = machine().device("acia65c51");
- uint16_t result;
-// result = acia_6551_r(acia, offset & 0x03);
-// logerror("ACIA read offset %02x\n",offset);
-// printf("ACIA read offset %02x\n",offset);
-
- result <<= 8;
-
- return result;
-}
-*/
-
-WRITE16_MEMBER(polgar_state::diablo68_reg_select)
-{
- diablo68_3c0000 = data >> 8;
- //printf("3c0000 = %04x\n",data>>8);
- logerror("3c0000 = %04x\n",data>>8);
-
-}
-
-
-WRITE16_MEMBER(polgar_state::diablo68_write_LCD)
-{
- data >>= 8;
- if (!(diablo68_3c0000 & 0x02)) {
- if (BIT(data,7)) {
- if ((data & 0x7f) >= 0x40) data -= 56; // adjust for 16x1 display as 2 sets of 8
- }
- m_lcdc->control_write(space, 0, data);
-// logerror("Control %02x\n", data);
-// printf("Control %02x\n", data);
- } else {
- m_lcdc->data_write(space, 0, data);
-// printf("LCDdata %04x [%c]\n", data,data);
-// logerror("LCDdata %04x [%c]\n", data,data);
- }
-
- //logerror("LCD Status Data = %d\n",data);
-
-}
-
WRITE8_MEMBER(polgar_state::milano_write_LED)
{
uint8_t LED_offset = 100;
@@ -923,11 +858,6 @@ MACHINE_START_MEMBER(polgar_state,polgar)
common_chess_start();
}
-MACHINE_START_MEMBER(polgar_state,diablo68)
-{
- common_chess_start();
-}
-
MACHINE_START_MEMBER(polgar_state,van16)
{
}
@@ -1166,19 +1096,6 @@ static ADDRESS_MAP_START(megaiv_mem , AS_PROGRAM, 8, polgar_state )
AM_RANGE( 0x8000, 0xffff ) AM_ROM
ADDRESS_MAP_END
-static ADDRESS_MAP_START(diablo68_mem , AS_PROGRAM, 16, polgar_state )
- AM_RANGE( 0x00000000, 0x0000ffff ) AM_ROM // OS
-// AM_RANGE( 0x00200000, 0x0020ffff ) AM_ROM AM_REGION("maincpu", 0)
- AM_RANGE( 0x00ff0000, 0x00ff7fff ) AM_ROM AM_REGION("maincpu",10000) // Opening Book
-// AM_RANGE( 0x00300000, 0x00300007 ) AM_READ(diablo68_aciaread)
-// AM_RANGE( 0x00300000, 0x00300007 ) AM_READ(diablo68_aciawrite)
-// AM_RANGE( 0x00300002, 0x00300003 ) AM_READ(diablo68_flags)
- AM_RANGE( 0x003a0000, 0x003a0001 ) AM_WRITE(diablo68_write_LCD)
- AM_RANGE( 0x003c0000, 0x003c0001 ) AM_WRITE(diablo68_reg_select)
- AM_RANGE( 0x00280000, 0x0028ffff ) AM_RAM // hash tables
- AM_RANGE( 0x00ff8000, 0x00ffffff ) AM_RAM
-ADDRESS_MAP_END
-
/* Input ports */
@@ -1205,39 +1122,6 @@ static INPUT_PORTS_START( polgar )
INPUT_PORTS_END
-static INPUT_PORTS_START( sfortea )
- PORT_START("BUTTONS_SFOR1")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_1)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_2)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_3)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_4)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_5)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_6)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST1") PORT_CODE(KEYCODE_7)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST2") PORT_CODE(KEYCODE_8)
-
- PORT_START("BUTTONS_SFOR2")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_F1)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_F2)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_F3)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_F4)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_F5)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_F6)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST1") PORT_CODE(KEYCODE_F7)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST2") PORT_CODE(KEYCODE_F8)
-
-/* PORT_START("BUTTONS_SFOR3")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_1)
- PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_2)
- PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("UP") PORT_CODE(KEYCODE_3)
- PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DOWN") PORT_CODE(KEYCODE_4)
- PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_5)
- PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_6)
- PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST1") PORT_CODE(KEYCODE_7)
- PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RST2") PORT_CODE(KEYCODE_8)
-*/
-INPUT_PORTS_END
-
static INPUT_PORTS_START( academy )
PORT_START("BUTTONS_ACAD")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(" Trn") PORT_CODE(KEYCODE_F1)
@@ -1457,22 +1341,6 @@ static MACHINE_CONFIG_DERIVED( megaiv, monteciv )
MCFG_CPU_PROGRAM_MAP(megaiv_mem)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_START( diablo68, polgar_state )
- MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
- MCFG_CPU_PROGRAM_MAP(diablo68_mem)
- MCFG_MACHINE_START_OVERRIDE(polgar_state,diablo68)
- MCFG_FRAGMENT_ADD( chess_common )
-
- /* acia */
-// MCFG_MOS6551_ADD("acia65c51", XTAL_1_8432MHz, nullptr)
-
- MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq2, attotime::from_hz(60))
- MCFG_TIMER_START_DELAY(attotime::from_hz(30))
- //MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
-
-
-MACHINE_CONFIG_END
-
static MACHINE_CONFIG_START( van16, polgar_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz)
MCFG_CPU_PROGRAM_MAP(van16_mem)
@@ -1589,13 +1457,6 @@ ROM_START(monteciv)
ROM_END
-ROM_START( diablo68 )
- ROM_REGION16_BE( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE("evenurom.bin", 0x00000, 0x8000,CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9))
- ROM_LOAD16_BYTE("oddlrom.bin", 0x00001, 0x8000,CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5))
- ROM_LOAD16_BYTE("book.bin", 0x10000, 0x8000,CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108))
-ROM_END
-
ROM_START( van16 )
ROM_REGION16_BE( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE("va16even.bin", 0x00000, 0x20000,CRC(E87602D5) SHA1(90CB2767B4AE9E1B265951EB2569B9956B9F7F44))
@@ -1655,7 +1516,6 @@ DRIVER_INIT_MEMBER(polgar_state,polgar)
CONS( 1990, lyon16, van16, 0, alm16, van16, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Lyon 68000", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, lyon32, van16, 0, alm32, van32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Lyon 68020", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1990, monteciv, 0, 0, monteciv, monteciv, driver_device, 0, "Hegener & Glaser", "Mephisto Monte Carlo IV LE Schachcomputer", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
- CONS( 1991, diablo68, 0, 0, diablo68, sfortea, driver_device, 0, "Novag", "Novag Diablo 68000 Chess Computer", MACHINE_NO_SOUND|MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, van16, 0, 0, van16, van16, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Vancouver 68000", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1991, van32, van16, 0, van32, van32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Vancouver 68020", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
CONS( 1993, gen32, van16, 0, gen32, gen32, driver_device, 0, "Hegener & Glaser Muenchen", "Mephisto Genius030 V4.00", MACHINE_NOT_WORKING|MACHINE_REQUIRES_ARTWORK | MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp
index 435748e73be..f0c4ed02faa 100644
--- a/src/mame/drivers/naomi.cpp
+++ b/src/mame/drivers/naomi.cpp
@@ -336,7 +336,8 @@ House of the Dead 2 (prototype) no cart A1E2 21 (64Mb) pre
Inu No Osanpo / Dog Walking (Rev A) 840-0073C 22294A 16 (64Mb) present 315-6206 317-0316-JPN requires 837-13844 JVS IO with DIPSW 1 ON
Samba de Amigo (prototype) no cart * 21*(64Mb) present 315-6206 317-0270-COM * only first 14 flash roms contain game data, instead of EPROM have tiny PCB with 2 flashroms on it
Soul Surfer (Rev A) 840-0095C 23838C 21 (64Mb) present 315-6206 not present
-Star Horse (server) 840-0055C 23626 17 (64Mb) present 315-6206 not present requires 837-13785 ARCNET&IO BD
+Star Horse (live and backup) 840-0055B 23626 17 (64Mb) present 315-6206 not present requires 837-13785 ARCNET&IO BD
+Star Horse Data 840-0034B - 2 (64Mb) present 315-6206 not present not contain game data, used in stack with 840-0121(sound&backup) ROM board as player saves storage, have JP3 and JP4 in position 2-3
The King of Route 66 (Rev A) 840-0087C 23819A 20 (64Mb) present 315-6206 not present content is the same as regular 171-8132A cart
The Maze of the Kings (prototype) no cart * 21 (64Mb) present 315-6206 FRI * flash-PCB, not dumped but known to exist
Tokyo Bus Guide (Rev A) 840-0045C 23468A 18 (64Mb) present 315-6206 317-0290-COM requires 837-13844 JVS IO
@@ -597,11 +598,15 @@ Giga Wing 2 841-0014C 22270 5 (128Mb) 3
Mobile Suit Gundam: Federation Vs. Zeon 841-0017C 23638 10 (128Mb) 315-6319A 315-6213 317-5070-COM not present
Moero! Justice Gakuen / Project Justice (Rev A) 841-0015C 23548A 11 (128Mb) 315-6319A 315-6213 317-5065-COM present
MushiKing - The King Of Beetle 2K5 1ST 840-0158C 24286 7 (128Mb) 315-6319A 315-6213 not present not present requires 610-0669 barcode reader
-Oinori-daimyoujin Matsuri 840-0126C 24053 5 (128Mb) 315-6319A 315-6213 not present not present requires 837-14274 "G2 EXPANSION BD" (similar to hopper 837-14381 but with ARC NET chip)
+Oinori-daimyoujin Matsuri 840-0126B 24053 5 (128Mb) 315-6319A 315-6213 not present not present requires 837-14274 "G2 EXPANSION BD" (similar to hopper 837-14381 but with ARC NET chip)
Samba de Amigo Ver. 2000 840-0047C 23600 11 (128Mb) 315-6319A 315-6213 317-0295-COM ?
Star Horse (big screens) 840-0054C 23625 4 (128Mb) 315-6319 315-6213 not present present requires 837-13785 ARCNET&IO BD
Star Horse (satellite) 840-0056C 23627 6 (128Mb)* 315-6319 315-6213 not present present * +1 (64Mb), requires 837-13785 ARCNET&IO BD
-Star Horse Progress (satellite) (Rev A) 840-0123C 24122A 7 (128Mb) 315-6319A 315-6213 not present not present requires 837-13785 ARCNET&IO BD
+Star Horse 2001 (satellite) (Rev B) 840-0078B 23739B 7 (128Mb) 315-6319 315-6213 not present present requires 837-13785 ARCNET&IO BD
+Star Horse Progress (main screen) (Rev B) 840-0120B 24087B 6 (128Mb) 315-6319A 315-6213 not present not present requires 837-13785 ARCNET&IO BD
+Star Horse Progress (sound & backup) (Rev A) 840-0121B 24097A 6 (128Mb) 315-6319A 315-6213 not present not present requires 837-13785 ARCNET&IO BD
+Star Horse Progress (live) (Rev A) 840-0122B 24107A 11 (128Mb) 315-6319A 315-6213 not present not present requires 837-13785 ARCNET&IO BD
+Star Horse Progress (satellite) (Rev A) 840-0123B 24122A 7 (128Mb) 315-6319A 315-6213 not present not present requires 837-13785 ARCNET&IO BD
The King of Route 66 (Rev A) 840-0087C 23819A 10 (128Mb) 315-6319A 315-6213 not present present
Virtua Fighter 4 840-0080C 23785 11 (128Mb) ? ? 317-0324-COM ?
Virtua Striker 3 840-0061C 23663 11 (128Mb) 315-6319A 315-6213 317-0310-COM ?
@@ -716,7 +721,7 @@ Notes:
/Shin Nihon Prowrestling Toukon /FL0 & FL1 have pin55 raised from PCB.
\Retsuden 4 Arcade Edition (Japan, Ver.A) F2X 25349801 2 (64Mb) 15 (128Mb) not present NAODEC2A NAODEC1B 317-5040-COM TRF1 \They are connected together and go to pin89 on 2K.
World Kicks PCB (Japan, WKC1 Ver.A) F2 25509801 2 (64Mb) 9 (128Mb) not present NAODEC2A NAODEC1B 317-5040-COM WKC1 uses Namco V226 JVS I/O (not dumped)
-World Kicks (Japan, WK1 Ver.A) F2 25209801 2 (64Mb) 9 (128Mb) not present NAODEC2A NAODEC1A 317-5040-COM WK1 not dumped, FL1.2D sums E8F1 B057
+World Kicks (Japan, WK1 Ver.A) F2 25209801 2 (64Mb) 9 (128Mb) not present NAODEC2A NAODEC1A 317-5040-COM WK1
World Kicks (Asia, WK2 Ver.A) F2 25209801 2 (64Mb) 9 (128Mb) not present NAODEC2A NAODEC1A 317-5040-COM WK2
World Kicks (US, WK3 Ver.A) F2 25209801 2 (64Mb) 9 (128Mb) not present NAODEC2A NAODEC1A 317-5040-COM WK3
@@ -6299,6 +6304,28 @@ ROM_START( gunsur2 )
ROM_PARAMETER( ":rom_board:segam2crypt:key", "000680d0" )
ROM_END
+ROM_START( wldkicksj )
+ NAOMI_BIOS
+ NAOMI_DEFAULT_EEPROM
+
+ ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
+ ROM_LOAD( "wk1vera.2d", 0x0800000, 0x800000, CRC(eb4d7fe1) SHA1(14378c3f6926b7709902a3073ed4274c7ac5ead8) )
+ ROM_LOAD( "wk2vera.2c", 0x1000000, 0x800000, CRC(ad2577d5) SHA1(f7b6bab001c5f5cf0b33a70cd0dfdca8f7d25921) )
+
+ ROM_LOAD( "wk1ma2.4m", 0x2000000, 0x1000000, CRC(3b340dc0) SHA1(2412e41d5bd74d1233fb91f8ce2276a318bfc53d) )
+ ROM_LOAD( "wk1ma3.4l", 0x3000000, 0x1000000, CRC(263fbb16) SHA1(b5d3a3d085f9623d70030ca3c49afb84e25549e3) )
+ ROM_LOAD( "wk1ma4.4k", 0x4000000, 0x1000000, CRC(9697db68) SHA1(7926e2acff0519403afcba9bdb5f68de28b06c79) )
+ ROM_LOAD( "wk1ma5.4j", 0x5000000, 0x1000000, CRC(65017db3) SHA1(a66cd73cdfc9355df63da781a46aa832889f583a) )
+ ROM_LOAD( "wk1ma6.4h", 0x6000000, 0x1000000, CRC(902eea85) SHA1(aa7964eb85b468d4fe112f9f0faaf2fa3f1aa96b) )
+ ROM_LOAD( "wk1ma7.4f", 0x7000000, 0x1000000, CRC(90e917ed) SHA1(53d32ce0ae2b05fa55a95b8697927045d07f4e8a) )
+ ROM_LOAD( "wk1ma8.4e", 0x8000000, 0x1000000, CRC(1d227a05) SHA1(9f816bcdf0279785e0b37ab2f3c5eb5912114dd5) )
+ ROM_LOAD( "wk1ma9.4d", 0x9000000, 0x1000000, CRC(29635a54) SHA1(a3109d0f8f271e2183316846df2a6a819f6a9b20) )
+ ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) )
+
+ // 25209801 2000 317-5040-COM Naomi
+ ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" )
+ROM_END
+
ROM_START( wldkicksa )
NAOMI_BIOS
NAOMI_DEFAULT_EEPROM
@@ -6343,7 +6370,7 @@ ROM_START( wldkicks )
ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" )
ROM_END
-ROM_START( wldkicksj )
+ROM_START( wldkickspj )
NAOMI_BIOS
NAOMI_DEFAULT_EEPROM
@@ -9733,18 +9760,19 @@ GAME( 2003, puyofevp, naomi, naomim1, naomi, naomi_state, naomi, ROT0, "Sega", "
/* HMG016007 */ GAME( 2001, hmgeo, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Capcom", "Heavy Metal Geomatrix (Rev B)", GAME_FLAGS )
/* Cart games on Namco custom ROM board */
-/* 25209801 */ GAME( 2000, wldkicksa,wldkicks,naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks (Asia, WK2 Ver.A)", GAME_FLAGS )
-/* 25209801 */ GAME( 2000, wldkicks, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks (US, WK3 Ver.A)", GAME_FLAGS )
-/* 25349801 */ GAME( 2000, toukon4, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Shin Nihon Pro Wrestling Toukon Retsuden 4 Arcade Edition (Japan, TRF1 Ver.A)", GAME_FLAGS )
-/* 25469801 */ GAME( 2000, ninjasltj,ninjaslt,naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (Japan, NJA1 Ver.A)", GAME_FLAGS )
-/* 25469801 */ GAME( 2000, ninjaslta,ninjaslt,naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (Asia, NJA2 Ver.A)", GAME_FLAGS )
-/* 25469801 */ GAME( 2000, ninjasltu,ninjaslt,naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (US, NJA3 Ver.A)", GAME_FLAGS )
-/* 25469801 */ GAME( 2000, ninjaslt, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (World, NJA4 Ver.A)", GAME_FLAGS )
-/* 25509801 */ GAME( 2000, wldkicksj,wldkicks,naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks PCB (Japan, WKC1 Ver.A)", GAME_FLAGS ) // "PCB" means upright version, uses analog button on control panel to kick the ball
-/* 25709801 */ GAME( 2001, gunsur2j, gunsur2, naomim2,naomi, naomi_state, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2 Biohazard Code: Veronica (Japan, BHF1 Ver.E)", GAME_FLAGS )
-/* 25709801 */ GAME( 2001, gunsur2, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2 Biohazard Code: Veronica (Asia, BHF2 Ver.E)", GAME_FLAGS )
-/* 25869812 */ GAME( 2002, mazana, mazan, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Mazan: Flash of the Blade (Asia, MAZ2 Ver.A)", GAME_FLAGS )
-/* 25869812 */ GAME( 2002, mazan, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Mazan: Flash of the Blade (US, MAZ3 Ver.A)", GAME_FLAGS )
+/* 25209801 */ GAME( 2000, wldkicksj, wldkicks, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks (Japan, WK1 Ver.A)", GAME_FLAGS )
+/* 25209801 */ GAME( 2000, wldkicksa, wldkicks, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks (Asia, WK2 Ver.A)", GAME_FLAGS )
+/* 25209801 */ GAME( 2000, wldkicks, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks (US, WK3 Ver.A)", GAME_FLAGS )
+/* 25349801 */ GAME( 2000, toukon4, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Shin Nihon Pro Wrestling Toukon Retsuden 4 Arcade Edition (Japan, TRF1 Ver.A)", GAME_FLAGS )
+/* 25469801 */ GAME( 2000, ninjasltj, ninjaslt, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (Japan, NJA1 Ver.A)", GAME_FLAGS )
+/* 25469801 */ GAME( 2000, ninjaslta, ninjaslt, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (Asia, NJA2 Ver.A)", GAME_FLAGS )
+/* 25469801 */ GAME( 2000, ninjasltu, ninjaslt, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (US, NJA3 Ver.A)", GAME_FLAGS )
+/* 25469801 */ GAME( 2000, ninjaslt, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Ninja Assault (World, NJA4 Ver.A)", GAME_FLAGS )
+/* 25509801 */ GAME( 2000, wldkickspj, wldkicks, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "World Kicks PCB (Japan, WKC1 Ver.A)", GAME_FLAGS ) // "PCB" means upright version, uses analog button on control panel to kick the ball
+/* 25709801 */ GAME( 2001, gunsur2j, gunsur2, naomim2,naomi, naomi_state, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2 Biohazard Code: Veronica (Japan, BHF1 Ver.E)", GAME_FLAGS )
+/* 25709801 */ GAME( 2001, gunsur2, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2 Biohazard Code: Veronica (Asia, BHF2 Ver.E)", GAME_FLAGS )
+/* 25869812 */ GAME( 2002, mazana, mazan, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Mazan: Flash of the Blade (Asia, MAZ2 Ver.A)", GAME_FLAGS )
+/* 25869812 */ GAME( 2002, mazan, naomi, naomim2,naomi, naomi_state, naomi, ROT0, "Namco", "Mazan: Flash of the Blade (US, MAZ3 Ver.A)", GAME_FLAGS )
/* GDS-xxxx (Sega GD-ROM games) */
/* 0001 */ GAME( 2000, confmiss, naomigd, naomigd, hotd2, naomi_state, naomigd, ROT0, "Sega", "Confidential Mission (GDS-0001)", GAME_FLAGS )
diff --git a/src/mame/drivers/novag6502.cpp b/src/mame/drivers/novag6502.cpp
index 2aff0a8543b..9c38552d1db 100644
--- a/src/mame/drivers/novag6502.cpp
+++ b/src/mame/drivers/novag6502.cpp
@@ -51,7 +51,7 @@ instead of magnet sensors.
******************************************************************************/
-#include "emu.h"
+#include "includes/novagbase.h"
#include "cpu/m6502/m6502.h"
#include "cpu/m6502/m65c02.h"
#include "bus/rs232/rs232.h"
@@ -66,54 +66,20 @@ instead of magnet sensors.
#include "novag_supercon.lh" // clickable
-class novag6502_state : public driver_device
+class novag6502_state : public novagbase_state
{
public:
novag6502_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_beeper(*this, "beeper"),
- m_lcd(*this, "hd44780"),
- m_inp_matrix(*this, "IN.%u", 0),
- m_display_wait(33),
- m_display_maxy(1),
- m_display_maxx(0)
+ : novagbase_state(mconfig, type, tag),
+ m_lcd(*this, "hd44780")
{ }
// devices/pointers
- required_device<cpu_device> m_maincpu;
- optional_device<beep_device> m_beeper;
optional_device<hd44780_device> m_lcd;
- optional_ioport_array<8> m_inp_matrix;
TIMER_DEVICE_CALLBACK_MEMBER(irq_on) { m_maincpu->set_input_line(M6502_IRQ_LINE, ASSERT_LINE); }
TIMER_DEVICE_CALLBACK_MEMBER(irq_off) { m_maincpu->set_input_line(M6502_IRQ_LINE, CLEAR_LINE); }
- // misc common
- uint16_t m_inp_mux; // multiplexed keypad mask
- uint16_t m_led_select;
- uint16_t m_led_data;
-
- uint16_t read_inputs(int columns);
-
- // display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
-
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
-
- uint8_t m_lcd_control;
-
- TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
- void display_update();
- void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
-
// Super Constellation
DECLARE_WRITE8_MEMBER(supercon_mux_w);
DECLARE_WRITE8_MEMBER(supercon_control_w);
@@ -137,16 +103,12 @@ public:
// Super Forte
DECLARE_WRITE8_MEMBER(sforte_lcd_control_w);
DECLARE_WRITE8_MEMBER(sforte_lcd_data_w);
-
-protected:
- virtual void machine_start() override;
- virtual void machine_reset() override;
};
// machine start/reset
-void novag6502_state::machine_start()
+void novagbase_state::machine_start()
{
// zerofill
memset(m_display_state, 0, sizeof(m_display_state));
@@ -175,7 +137,7 @@ void novag6502_state::machine_start()
save_item(NAME(m_lcd_control));
}
-void novag6502_state::machine_reset()
+void novagbase_state::machine_reset()
{
}
@@ -190,9 +152,9 @@ void novag6502_state::machine_reset()
// The device may strobe the outputs very fast, it is unnoticeable to the user.
// To prevent flickering here, we need to simulate a decay.
-void novag6502_state::display_update()
+void novagbase_state::display_update()
{
- uint32_t active_state[0x20];
+ u32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
@@ -205,7 +167,7 @@ void novag6502_state::display_update()
m_display_decay[y][x] = m_display_wait;
// determine active state
- uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0;
+ u32 ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
@@ -243,7 +205,7 @@ void novag6502_state::display_update()
memcpy(m_display_cache, active_state, sizeof(m_display_cache));
}
-TIMER_DEVICE_CALLBACK_MEMBER(novag6502_state::display_decay_tick)
+TIMER_DEVICE_CALLBACK_MEMBER(novagbase_state::display_decay_tick)
{
// slowly turn off unpowered segments
for (int y = 0; y < m_display_maxy; y++)
@@ -254,13 +216,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(novag6502_state::display_decay_tick)
display_update();
}
-void novag6502_state::set_display_size(int maxx, int maxy)
+void novagbase_state::set_display_size(int maxx, int maxy)
{
m_display_maxx = maxx;
m_display_maxy = maxy;
}
-void novag6502_state::set_display_segmask(uint32_t digits, uint32_t mask)
+void novagbase_state::set_display_segmask(u32 digits, u32 mask)
{
// set a segment mask per selected digit, but leave unselected ones alone
for (int i = 0; i < 0x20; i++)
@@ -271,12 +233,12 @@ void novag6502_state::set_display_segmask(uint32_t digits, uint32_t mask)
}
}
-void novag6502_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update)
+void novagbase_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
{
set_display_size(maxx, maxy);
// update current state
- uint32_t mask = (1 << maxx) - 1;
+ u32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0;
@@ -287,9 +249,9 @@ void novag6502_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t
// generic input handlers
-uint16_t novag6502_state::read_inputs(int columns)
+u16 novagbase_state::read_inputs(int columns)
{
- uint16_t ret = 0;
+ u16 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
@@ -427,7 +389,7 @@ void novag6502_state::sexpert_set_cpu_freq()
MACHINE_RESET_MEMBER(novag6502_state, sexpert)
{
membank("bank1")->set_entry(0);
- novag6502_state::machine_reset();
+ novagbase_state::machine_reset();
}
DRIVER_INIT_MEMBER(novag6502_state, sexpert)
@@ -804,7 +766,7 @@ static MACHINE_CONFIG_START( supercon, novag6502_state )
MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novag6502_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novagbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_novag_supercon)
/* sound hardware */
@@ -822,7 +784,7 @@ static MACHINE_CONFIG_START( cforte, novag6502_state )
//MCFG_NVRAM_ADD_1FILL("nvram")
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novag6502_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novagbase_state, display_decay_tick, attotime::from_msec(1))
//MCFG_DEFAULT_LAYOUT(layout_novag_cforte)
/* sound hardware */
@@ -869,7 +831,7 @@ static MACHINE_CONFIG_START( sexpert, novag6502_state )
MCFG_HD44780_LCD_SIZE(2, 8)
MCFG_HD44780_PIXEL_UPDATE_CB(novag6502_state, sexpert_pixel_update)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novag6502_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novagbase_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_novag_sexpert)
/* sound hardware */
@@ -902,8 +864,8 @@ ROM_END
ROM_START( cforteb )
ROM_REGION( 0x18000, "maincpu", 0 )
- ROM_LOAD("forte_b_l.u3", 0x0000, 0x8000, CRC(e3d194a1) SHA1(80457580d7c57e07895fd14bfdaf14b30952afca) )
- ROM_LOAD("forte_b_h.u1", 0x8000, 0x8000, CRC(dd824be8) SHA1(cd8666b6b525887f9fc48a730b71ceabcf07f3b9) )
+ ROM_LOAD("forte_b_l.bin", 0x0000, 0x8000, CRC(e3d194a1) SHA1(80457580d7c57e07895fd14bfdaf14b30952afca) )
+ ROM_LOAD("forte_b_h.bin", 0x8000, 0x8000, CRC(dd824be8) SHA1(cd8666b6b525887f9fc48a730b71ceabcf07f3b9) )
ROM_END
diff --git a/src/mame/drivers/novag68k.cpp b/src/mame/drivers/novag68k.cpp
new file mode 100644
index 00000000000..e76b6e79863
--- /dev/null
+++ b/src/mame/drivers/novag68k.cpp
@@ -0,0 +1,236 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/******************************************************************************
+
+ Novag generic 68000 based chess computer driver
+
+ NOTE: MAME doesn't include a generalized implementation for boardpieces yet,
+ greatly affecting user playability of emulated electronic board games.
+ As workaround for the chess games, use an external chess GUI on the side,
+ such as Arena(in editmode).
+
+ TODO:
+ - x
+
+******************************************************************************
+
+Diablo 68000:
+- x
+
+******************************************************************************/
+
+#include "includes/novagbase.h"
+#include "cpu/m68000/m68000.h"
+
+// internal artwork
+#include "novag_diablo68k.lh" // clickable
+
+
+class novag68k_state : public novagbase_state
+{
+public:
+ novag68k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : novagbase_state(mconfig, type, tag)
+ { }
+
+ // devices/pointers
+
+ // Diablo 68000
+};
+
+
+
+// Devices, I/O
+
+/******************************************************************************
+ Diablo 68000
+******************************************************************************/
+
+
+/******************************************************************************
+ Address Maps
+******************************************************************************/
+
+// Diablo 68000
+
+static ADDRESS_MAP_START( diablo68k_map, AS_PROGRAM, 16, novag68k_state )
+ AM_RANGE( 0x000000, 0x00ffff ) AM_ROM
+ AM_RANGE( 0xff8000, 0xffffff ) AM_RAM
+ADDRESS_MAP_END
+
+
+
+/******************************************************************************
+ Input Ports
+******************************************************************************/
+
+static INPUT_PORTS_START( cb_magnets )
+ PORT_START("IN.0")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.1")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.2")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.3")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.4")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.5")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.6")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+
+ PORT_START("IN.7")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_TOGGLE PORT_NAME("Board Sensor")
+INPUT_PORTS_END
+
+
+static INPUT_PORTS_START( diablo68k )
+ PORT_INCLUDE( cb_magnets )
+
+ PORT_MODIFY("IN.0")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Go")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Take Back / Analyze Games")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("->")
+
+ PORT_MODIFY("IN.1")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Set Level")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Flip Display / Time Control")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("<-")
+
+ PORT_MODIFY("IN.2")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Hint / Next Best")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Priority / Tournament Book / Pawn")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Yes/Start / Start of Game")
+
+ PORT_MODIFY("IN.3")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Trace Forward / AutoPlay")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Pro-Op / Restore Game / Rook")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("No/End / End of Game")
+
+ PORT_MODIFY("IN.4")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Clear Board / Delete Pro-Op")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Best Move/Random / Review / Knight")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Print Book / Store Game")
+
+ PORT_MODIFY("IN.5")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Change Color")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_NAME("Sound / Info / Bishop")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Print Moves / Print Evaluations")
+
+ PORT_MODIFY("IN.6")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_J) PORT_NAME("Verify/Set Up / Pro-Op Book/Both Books")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) PORT_NAME("Solve Mate / Infinite / Queen")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Print List / Acc. Time")
+
+ PORT_MODIFY("IN.7")
+ PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_K) PORT_NAME("New Game")
+ PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) PORT_NAME("Player/Player / Gambit Book / King")
+ PORT_BIT(0x400, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Print Board / Interface")
+INPUT_PORTS_END
+
+
+
+/******************************************************************************
+ Machine Drivers
+******************************************************************************/
+
+static MACHINE_CONFIG_START( diablo68k, novag68k_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz/2)
+ MCFG_CPU_PERIODIC_INT_DRIVER(novag68k_state, irq2_line_hold, 250) // guessed
+ MCFG_CPU_PROGRAM_MAP(diablo68k_map)
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", novagbase_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_novag_diablo68k)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("beeper", BEEP, 1000) // guessed
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+/******************************************************************************
+ ROM Definitions
+******************************************************************************/
+
+ROM_START( diablo68 )
+ ROM_REGION16_BE( 0x20000, "maincpu", 0 )
+ ROM_LOAD16_BYTE("evenurom.bin", 0x00000, 0x8000, CRC(03477746) SHA1(8bffcb159a61e59bfc45411e319aea6501ebe2f9) )
+ ROM_LOAD16_BYTE("oddlrom.bin", 0x00001, 0x8000, CRC(e182dbdd) SHA1(24dacbef2173fa737636e4729ff22ec1e6623ca5) )
+ ROM_LOAD16_BYTE("book.bin", 0x10000, 0x8000, CRC(553a5c8c) SHA1(ccb5460ff10766a5ca8008ae2cffcff794318108) )
+ROM_END
+
+
+
+/******************************************************************************
+ Drivers
+******************************************************************************/
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
+CONS( 1991, diablo68, 0, 0, diablo68k, diablo68k, driver_device, 0, "Novag", "Diablo 68000", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK )
diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp
index e2a6cc74c12..99790e35523 100644
--- a/src/mame/drivers/pacman.cpp
+++ b/src/mame/drivers/pacman.cpp
@@ -6583,6 +6583,56 @@ ROM_START( woodpeca )
ROM_END
+/*
+Guru-Readme for Number Crash (Hanshin Goraku 1983)
+
+|----------------------------------------------------------------------|
+| 74107 Z80A LS157 MB7052.4A LS158 |
+| LS368 18.432MHz LS377 LS157 |
+| LS16 LS367 DIP28A LS194 LS00 7475 93422 |
+| LS367 LS194 LS273 LS20 |
+| DSW(8) LS367 P1.7E NC-1.6E NC-9.5E LS157 7489 7461 LS161 |
+|2 LS367 LS08 NC-2.6F NC-10.5F LS86 7489 LS283 LS283 |
+|2 LS138 NC-3.6H NC-11.5H LS174 |
+|W 4099 NC-12.5J LS245 LS158 LS86 |
+|A LS02 NC-4.6K LS157 LS283|
+|Y LS139 NC-5.6L LS139 AM27S03.2K LS174|
+| LS42 2114 P2.3M AM27S03.2L P3.1M|
+| LS367 NC-6.6M LS74 2114 LS74 |
+| MB3713 LS08 2114 LS273 4066 |
+| NC-7.6N 2114 LS10 LS02 |
+| NC-8.6P DIP28B 2114 7416 |
+| VOLUME LS367 2114 7416 7416 7416 |
+|----------------------------------------------------------------------|
+Notes: (All IC's shown)
+ Z80A - Clock input 3.072MHz [18.432/6]
+ 7489 - Texas Instruments 7489 64-bit Random Access Read-Write Memory
+ 2114 - 1k x 4-bit SRAM
+ AM27S03- AMD AM27S03 (74S189 / 3101 compatible) 64-bit (16word x 4-bit) Inverting-Output Bipolar RAM
+ 93422 - AMD 93422 256 x 4-bit TTL Bipolar RAM
+ NC-* - 2716 EPROM
+ P1 - Fujitsu MB7051 Bipolar PROM
+ P2/3 - Harris 7611 Bipolar PROM
+ MB7052 - Fujitsu MB7052 Bipolar PROM
+ DIP28A - Plug-in daughterboard containing logic
+ |----------|
+ | LS373 |
+ | LS245 |
+ |LS02 LS00|
+ |LS74 LS04|
+ |----------|
+
+ DIP28B - Plug-in daughterboard containing logic
+ |----------------------------|
+ |LS257 LS253 LS253 LS253 LS00|
+ | |
+ |LS86 LS86 LS86 LS02 LS368 |
+ |----------------------------|
+
+ VSync - 60.5721Hz
+ HSync - 15.3892kHz
+*/
+
ROM_START( numcrash )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "nc-1.6e", 0x0000, 0x0800, CRC(c85a79ba) SHA1(938b6b2920b14a4f0fbcd09fe25873bfd8ddc245) )
diff --git a/src/mame/drivers/pse.cpp b/src/mame/drivers/pse.cpp
index 830c9493e18..0f9edfa6000 100644
--- a/src/mame/drivers/pse.cpp
+++ b/src/mame/drivers/pse.cpp
@@ -124,24 +124,24 @@ ROM_START( bazooka )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
ROM_REGION( 0x0840, "roms", ROMREGION_ERASE00 )
- ROM_LOAD( "bd2.k1", 0x0000, 0x0200, CRC(c9e9ed15) SHA1(624bbc10942a386040aef161b96d64021a842c9f) ) // 6341-1 - gfx: tank, truck, jeep motorcycle
- ROM_LOAD( "bd2.k4", 0x0200, 0x0200, CRC(c5a74df9) SHA1(2846a039e9bf372f3aa0b88ed89f9029eb7f797c) ) // 6341-1 - gfx: ambulance, stretcher, explosion
- ROM_LOAD( "bd1.d2", 0x0400, 0x0200, CRC(4fc10886) SHA1(b1c6f890994ba2182a4e7fc17582d6797dbd6ce9) ) // 6341-1 or 82s115
- ROM_LOAD( "bd1.e2", 0x0600, 0x0200, CRC(00179936) SHA1(e5417b8d3814dafe1278179b307a1b563a378cbe) ) // 6341-1 or 82s115
- ROM_LOAD( "bd2.e6", 0x0800, 0x0020, CRC(14b84564) SHA1(69cdd14e23094678c4b280f60cec963609181b00) ) // 82123
- ROM_LOAD( "bd2.e7", 0x0820, 0x0020, CRC(1bfb073f) SHA1(f6b26dcece71b2cf2ed4a537434edbe31cb10399) ) // 82123
+ ROM_LOAD( "bd2.k1", 0x0000, 0x0200, CRC(c9e9ed15) SHA1(624bbc10942a386040aef161b96d64021a842c9f) ) // 6341-1 - gfx: tank, truck, jeep motorcycle
+ ROM_LOAD( "bd2.k4", 0x0200, 0x0200, CRC(c5a74df9) SHA1(2846a039e9bf372f3aa0b88ed89f9029eb7f797c) ) // 6341-1 - gfx: ambulance, stretcher, explosion
+ ROM_LOAD( "bd1.d2", 0x0400, 0x0200, CRC(4fc10886) SHA1(b1c6f890994ba2182a4e7fc17582d6797dbd6ce9) ) // 6341-1 or 82s115
+ ROM_LOAD( "bd1.e2", 0x0600, 0x0200, CRC(00179936) SHA1(e5417b8d3814dafe1278179b307a1b563a378cbe) ) // 6341-1 or 82s115
+ ROM_LOAD( "bd2.e6", 0x0800, 0x0020, CRC(14b84564) SHA1(69cdd14e23094678c4b280f60cec963609181b00) ) // 82123
+ ROM_LOAD( "bd2.e7", 0x0820, 0x0020, CRC(1bfb073f) SHA1(f6b26dcece71b2cf2ed4a537434edbe31cb10399) ) // 82123
ROM_END
ROM_START( bazookabr )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
ROM_REGION( 0x0840, "roms", ROMREGION_ERASE00 )
- ROM_LOAD( "1", 0x0000, 0x0200, CRC(edc34cb0) SHA1(f76a81833b015784e55b33189e9058cd24922f9b) )
- ROM_LOAD( "2", 0x0200, 0x0200, CRC(3e78e4c2) SHA1(814509eb773bfa87f1df933214f079e7dd2a8fa2) )
- ROM_LOAD( "3", 0x0400, 0x0200, CRC(4fc10886) SHA1(b1c6f890994ba2182a4e7fc17582d6797dbd6ce9) )
- ROM_LOAD( "4", 0x0600, 0x0200, CRC(00179936) SHA1(e5417b8d3814dafe1278179b307a1b563a378cbe) )
- ROM_LOAD( "bd2.e6", 0x0800, 0x0020, BAD_DUMP CRC(14b84564) SHA1(69cdd14e23094678c4b280f60cec963609181b00) ) // not dumped, taken from PSE set
- ROM_LOAD( "bd2.e7", 0x0820, 0x0020, BAD_DUMP CRC(1bfb073f) SHA1(f6b26dcece71b2cf2ed4a537434edbe31cb10399) ) // not dumped, taken from PSE set
+ ROM_LOAD( "bk01.1l", 0x0000, 0x0200, CRC(edc34cb0) SHA1(f76a81833b015784e55b33189e9058cd24922f9b) ) // 74S473
+ ROM_LOAD( "bk02.4l", 0x0200, 0x0200, CRC(3e78e4c2) SHA1(814509eb773bfa87f1df933214f079e7dd2a8fa2) ) // 74S473
+ ROM_LOAD( "bk03.8j", 0x0400, 0x0200, CRC(4fc10886) SHA1(b1c6f890994ba2182a4e7fc17582d6797dbd6ce9) ) // 74S473
+ ROM_LOAD( "bk04.8h", 0x0600, 0x0200, CRC(00179936) SHA1(e5417b8d3814dafe1278179b307a1b563a378cbe) ) // 74S473
+ ROM_LOAD( "bk05.6c", 0x0800, 0x0020, CRC(4193d32e) SHA1(d9e3392a8681198e110cfcd68ef20ae3dc366527) ) // 82S123 or 6331-1J
+ ROM_LOAD( "bk06.6d", 0x0820, 0x0020, CRC(1bfb073f) SHA1(f6b26dcece71b2cf2ed4a537434edbe31cb10399) ) // 82S123 or 6331-1J
ROM_END
ROM_START( dpatrol )
diff --git a/src/mame/drivers/quizpun2.cpp b/src/mame/drivers/quizpun2.cpp
index a22e4677284..4f6b61ed3a5 100644
--- a/src/mame/drivers/quizpun2.cpp
+++ b/src/mame/drivers/quizpun2.cpp
@@ -82,12 +82,16 @@ Notes:
***************************************************************************/
#include "emu.h"
-#include "cpu/z80/z80.h"
+
#include "cpu/m6805/m68705.h"
-#include "machine/gen_latch.h"
+#include "cpu/z80/z80.h"
+
#include "machine/eepromser.h"
+#include "machine/gen_latch.h"
+
#include "sound/2203intf.h"
+
// very preliminary quizpun2 protection simulation
#define VERBOSE_PROTECTION_LOG 0
@@ -150,7 +154,7 @@ public:
DECLARE_WRITE8_MEMBER(quizpun2_protection_w);
// quizpun
- uint8_t m_port_a, m_port_b, m_port_c;
+ uint8_t m_port_a, m_port_b;
bool m_quizpun_pending;
bool m_quizpun_written;
bool m_quizpun_repeat;
@@ -269,7 +273,7 @@ void quizpun2_state::machine_reset()
m_prot.addr = 0;
// quizpun
- m_port_a = m_port_b = m_port_c = 0;
+ m_port_a = m_port_b = 0;
m_quizpun_pending = m_quizpun_written = m_quizpun_repeat = false;
}
@@ -529,10 +533,11 @@ READ8_MEMBER(quizpun2_state::quizpun_68705_port_b_r)
// bit 1: 0 = main cpu has written
// bit 0: 0 = main cpu is reading
- uint8_t ret = m_port_b & 0xf4;
- ret |= ( m_quizpun_pending ? 0 : (1 << 3)) |
- ( (m_quizpun_pending && m_quizpun_written) ? 0 : (1 << 1)) |
- ( (m_quizpun_pending && !m_quizpun_written) ? 0 : (1 << 0)) ;
+ uint8_t const ret =
+ 0xf4 |
+ ( m_quizpun_pending ? 0 : (1 << 3)) |
+ ((m_quizpun_pending && m_quizpun_written) ? 0 : (1 << 1)) |
+ ((m_quizpun_pending && !m_quizpun_written) ? 0 : (1 << 0));
// logerror("%s: port B read %02x\n", machine().describe_context(), ret);
return ret;
@@ -544,7 +549,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun_68705_port_b_w)
// bit 2: 0->1 run main cpu
- if (!(m_port_b & 0x04) && (data & 0x04))
+ if (!BIT(m_port_b, 2) && BIT(data, 2))
{
m_quizpun_pending = false;
m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
@@ -556,8 +561,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun_68705_port_b_w)
READ8_MEMBER(quizpun2_state::quizpun_68705_port_c_r)
{
- uint8_t ret = m_port_c & 0xf7;
- ret |= m_eeprom->do_read() ? 0x08 : 0;
+ uint8_t const ret = 0xf7 | (m_eeprom->do_read() ? 0x08 : 0x00);
// logerror("%s: port C read %02x\n", machine().describe_context(), ret);
return ret;
}
@@ -565,33 +569,17 @@ READ8_MEMBER(quizpun2_state::quizpun_68705_port_c_r)
WRITE8_MEMBER(quizpun2_state::quizpun_68705_port_c_w)
{
// latch the bit
- m_eeprom->di_write((data & 0x04) >> 2);
+ m_eeprom->di_write(BIT(data, 2));
// reset line asserted: reset.
- m_eeprom->cs_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
+ m_eeprom->cs_write(BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
// clock line asserted: write latch or select next bit to read
- m_eeprom->clk_write((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
+ m_eeprom->clk_write(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE);
// logerror("%s: port C write %02x\n", machine().describe_context(), data);
- m_port_c = data;
}
-static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, quizpun2_state )
- ADDRESS_MAP_GLOBAL_MASK(0x7ff)
-
- AM_RANGE(0x000, 0x000) AM_READWRITE(quizpun_68705_port_a_r, quizpun_68705_port_a_w)
- AM_RANGE(0x001, 0x001) AM_READWRITE(quizpun_68705_port_b_r, quizpun_68705_port_b_w)
- AM_RANGE(0x002, 0x002) AM_READWRITE(quizpun_68705_port_c_r, quizpun_68705_port_c_w)
-
- AM_RANGE(0x004, 0x004) AM_NOP // DDR A
- AM_RANGE(0x005, 0x005) AM_NOP // DDR B
- AM_RANGE(0x006, 0x006) AM_NOP // DDR C
-
- AM_RANGE(0x010, 0x07f) AM_RAM
- AM_RANGE(0x080, 0x7ff) AM_ROM
-ADDRESS_MAP_END
-
/***************************************************************************
Memory Maps - Sound CPU
***************************************************************************/
@@ -731,8 +719,13 @@ static MACHINE_CONFIG_DERIVED( quizpun, quizpun2 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(quizpun_io_map)
- MCFG_CPU_ADD("mcu", M68705, XTAL_4MHz) // xtal is 4MHz, divided by 4 internally
- MCFG_CPU_PROGRAM_MAP(mcu_map)
+ MCFG_CPU_ADD("mcu", M68705P5, XTAL_4MHz) // xtal is 4MHz, divided by 4 internally
+ MCFG_M68705_PORTA_R_CB(READ8(quizpun2_state, quizpun_68705_port_a_r))
+ MCFG_M68705_PORTB_R_CB(READ8(quizpun2_state, quizpun_68705_port_b_r))
+ MCFG_M68705_PORTC_R_CB(READ8(quizpun2_state, quizpun_68705_port_c_r))
+ MCFG_M68705_PORTA_W_CB(WRITE8(quizpun2_state, quizpun_68705_port_a_w))
+ MCFG_M68705_PORTB_W_CB(WRITE8(quizpun2_state, quizpun_68705_port_b_w))
+ MCFG_M68705_PORTC_W_CB(WRITE8(quizpun2_state, quizpun_68705_port_c_w))
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mame/drivers/skyarmy.cpp b/src/mame/drivers/skyarmy.cpp
index 1494ee5f209..32a25ee6349 100644
--- a/src/mame/drivers/skyarmy.cpp
+++ b/src/mame/drivers/skyarmy.cpp
@@ -7,10 +7,8 @@
- Updated memory map to partially handle screen flipping
05/01/2003 Ryan Holtz
- - Corrected second AY (shouldn't have been there)
- Added first AY's status read
- Added coinage DIP
- - What are those unmapped port writes!? Not AY...
2003.01.01. Tomasz Slanina
@@ -60,6 +58,7 @@ public:
DECLARE_WRITE8_MEMBER(flip_screen_y_w);
DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(colorram_w);
+ DECLARE_WRITE8_MEMBER(coin_counter_w);
DECLARE_WRITE8_MEMBER(nmi_enable_w);
TILE_GET_INFO_MEMBER(get_tile_info);
@@ -163,6 +162,17 @@ uint32_t skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
flipy = (m_spriteram[offs+1]&0x80)>>7;
flipx = (m_spriteram[offs+1]&0x40)>>6;
+ if (flip_screen_x())
+ {
+ sx = 240 - sx;
+ flipx = !flipx;
+ }
+ if (flip_screen_y())
+ {
+ sy = 240 - sy;
+ flipy = !flipy;
+ }
+
m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
m_spriteram[offs+1]&0x3f,
pal,
@@ -175,13 +185,22 @@ uint32_t skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
INTERRUPT_GEN_MEMBER(skyarmy_state::nmi_source)
{
- if(m_nmi) device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (m_nmi)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+}
+
+
+WRITE8_MEMBER(skyarmy_state::coin_counter_w)
+{
+ machine().bookkeeping().coin_counter_w(0, data & 1);
}
WRITE8_MEMBER(skyarmy_state::nmi_enable_w)
{
m_nmi=data & 1;
+ if (!m_nmi)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -192,20 +211,22 @@ static ADDRESS_MAP_START( skyarmy_map, AS_PROGRAM, 8, skyarmy_state )
AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") /* Color RAM */
AM_RANGE(0x9800, 0x983f) AM_RAM AM_SHARE("spriteram") /* Sprites */
AM_RANGE(0x9840, 0x985f) AM_RAM AM_SHARE("scrollram") /* Scroll RAM */
- AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW")
+ AM_RANGE(0xa000, 0xa000) AM_READ_PORT("DSW") AM_WRITE(coin_counter_w)
AM_RANGE(0xa001, 0xa001) AM_READ_PORT("P1")
AM_RANGE(0xa002, 0xa002) AM_READ_PORT("P2")
AM_RANGE(0xa003, 0xa003) AM_READ_PORT("SYSTEM")
AM_RANGE(0xa004, 0xa004) AM_WRITE(nmi_enable_w) // ???
AM_RANGE(0xa005, 0xa005) AM_WRITE(flip_screen_x_w)
AM_RANGE(0xa006, 0xa006) AM_WRITE(flip_screen_y_w)
- AM_RANGE(0xa007, 0xa007) AM_WRITENOP
+ AM_RANGE(0xa007, 0xa007) AM_WRITENOP // video RAM buffering?
ADDRESS_MAP_END
static ADDRESS_MAP_START( skyarmy_io_map, AS_IO, 8, skyarmy_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
- AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
+ AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay0", ay8910_device, address_data_w)
+ AM_RANGE(0x02, 0x02) AM_DEVREAD("ay0", ay8910_device, data_r)
+ AM_RANGE(0x04, 0x05) AM_DEVWRITE("ay1", ay8910_device, address_data_w)
+ AM_RANGE(0x06, 0x06) AM_DEVREAD("ay1", ay8910_device, data_r)
ADDRESS_MAP_END
@@ -317,7 +338,9 @@ static MACHINE_CONFIG_START( skyarmy, skyarmy_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("aysnd", AY8910, 2500000)
+ MCFG_SOUND_ADD("ay0", AY8910, 2500000)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
+ MCFG_SOUND_ADD("ay1", AY8910, 2500000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
MACHINE_CONFIG_END
@@ -341,4 +364,4 @@ ROM_START( skyarmy )
ROM_LOAD( "a6.bin", 0x0000, 0x0020, CRC(c721220b) SHA1(61b3320fb616c0600d56840cb6438616c7e0c6eb) )
ROM_END
-GAME( 1982, skyarmy, 0, skyarmy, skyarmy, driver_device, 0, ROT90, "Shoei", "Sky Army", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE )
+GAME( 1982, skyarmy, 0, skyarmy, skyarmy, driver_device, 0, ROT90, "Shoei", "Sky Army", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/stadhero.cpp b/src/mame/drivers/stadhero.cpp
index 61d04c0fc2d..0b96752214f 100644
--- a/src/mame/drivers/stadhero.cpp
+++ b/src/mame/drivers/stadhero.cpp
@@ -6,8 +6,6 @@
Emulation by Bryan McPhail, mish@tendril.co.uk
- Are the colours correct on the scoreboard screen? they look strange
-
=== PCB Info ===
The OSC on the CPU board(DE-0303-3) is 20MHz
@@ -263,8 +261,8 @@ ROM_START( stadhero )
ROM_LOAD( "ef09.4j", 0x10000, 0x08000, CRC(2ade874d) SHA1(5c884535214438a4ea79fd262700a346bc12ad81) )
ROM_REGION( 0x30000, "gfx2", 0 )
- ROM_LOAD( "ef10.11j", 0x00000, 0x10000, CRC(dca3d599) SHA1(2b97a70065f3065e7fbb54fb53cb120d9e5013b3) ) /* tiles */
- ROM_LOAD( "ef11.13j", 0x10000, 0x10000, CRC(af563e96) SHA1(c88eaff4a1ea133d708f4511bb1dbc99ef066eed) )
+ ROM_LOAD( "ef11.13j", 0x00000, 0x10000, CRC(af563e96) SHA1(c88eaff4a1ea133d708f4511bb1dbc99ef066eed) ) /* tiles */
+ ROM_LOAD( "ef10.11j", 0x10000, 0x10000, CRC(dca3d599) SHA1(2b97a70065f3065e7fbb54fb53cb120d9e5013b3) )
ROM_LOAD( "ef12.14j", 0x20000, 0x10000, CRC(9a1bf51c) SHA1(e733c193b305496878551fc6eefc21587ba75c82) )
ROM_REGION( 0x80000, "gfx3", 0 )
diff --git a/src/mame/drivers/tb303.cpp b/src/mame/drivers/tb303.cpp
index f76c39e5dc0..c15c61e1dab 100644
--- a/src/mame/drivers/tb303.cpp
+++ b/src/mame/drivers/tb303.cpp
@@ -26,8 +26,8 @@ public:
: hh_ucom4_state(mconfig, type, tag)
{ }
- uint8_t m_ram[0xc00];
- uint16_t m_ram_address;
+ u8 m_ram[0xc00];
+ u16 m_ram_address;
bool m_ram_ce;
bool m_ram_we;
@@ -67,7 +67,7 @@ void tb303_state::refresh_ram()
// MCU E2,E3 goes through a 4556 IC(pin 14,13) to one of uPD444 _CE:
// _Q0: N/C, _Q1: IC-5, _Q2: IC-3, _Q3: IC-4
m_ram_ce = true;
- uint8_t hi = 0;
+ u8 hi = 0;
switch (m_port[NEC_UCOM4_PORTE] >> 2 & 3)
{
case 0: m_ram_ce = false; break;
diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp
index 3b978e2d41f..afee324b8c6 100644
--- a/src/mame/drivers/thayers.cpp
+++ b/src/mame/drivers/thayers.cpp
@@ -4,6 +4,7 @@
TODO:
+ - keyboard
- LDV1000 mode
- PR7820 INT/_EXT line
- coin counter
@@ -19,6 +20,7 @@
#include "cpu/cop400/cop400.h"
#include "thayers.lh"
+#define LOG 0
struct ssi263_t
{
@@ -56,6 +58,8 @@ public:
uint8_t m_laserdisc_data;
int m_rx_bit;
int m_keylatch;
+ uint8_t m_keydata;
+ bool m_kbclk;
uint8_t m_cop_data_latch;
int m_cop_data_latch_enable;
uint8_t m_cop_l;
@@ -78,8 +82,8 @@ public:
DECLARE_READ8_MEMBER(cop_g_r);
DECLARE_WRITE8_MEMBER(control_w);
DECLARE_WRITE8_MEMBER(cop_g_w);
- DECLARE_READ_LINE_MEMBER(cop_si_r);
- DECLARE_WRITE_LINE_MEMBER(cop_so_w);
+ DECLARE_READ_LINE_MEMBER(kbdata_r);
+ DECLARE_WRITE_LINE_MEMBER(kbclk_w);
DECLARE_WRITE8_MEMBER(control2_w);
DECLARE_READ8_MEMBER(dsw_b_r);
DECLARE_READ8_MEMBER(laserdsc_data_r);
@@ -125,7 +129,7 @@ void thayers_state::check_interrupt()
{
if (!m_timer_int || !m_data_rdy_int || !m_ssi_data_request)
{
- m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
}
else
{
@@ -137,7 +141,7 @@ WRITE8_MEMBER(thayers_state::intrq_w)
{
// T = 1.1 * R30 * C53 = 1.1 * 750K * 0.01uF = 8.25 ms
- m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
timer_set(attotime::from_usec(8250), TIMER_INTRQ_TICK);
}
@@ -164,6 +168,8 @@ READ8_MEMBER(thayers_state::irqstate_r)
WRITE8_MEMBER(thayers_state::timer_int_ack_w)
{
+ if (LOG) logerror("%s %s TIMER INT ACK\n", machine().time().as_string(), machine().describe_context());
+
m_timer_int = 1;
check_interrupt();
@@ -171,6 +177,8 @@ WRITE8_MEMBER(thayers_state::timer_int_ack_w)
WRITE8_MEMBER(thayers_state::data_rdy_int_ack_w)
{
+ if (LOG) logerror("%s %s DATA RDY INT ACK\n", machine().time().as_string(), machine().describe_context());
+
m_data_rdy_int = 1;
check_interrupt();
@@ -191,11 +199,13 @@ WRITE8_MEMBER(thayers_state::cop_d_w)
if (!BIT(data, 0))
{
+ if (LOG) logerror("%s %s TIMER INT\n", machine().time().as_string(), machine().describe_context());
m_timer_int = 0;
}
if (!BIT(data, 1))
{
+ if (LOG) logerror("%s %s DATA RDY INT\n", machine().time().as_string(), machine().describe_context());
m_data_rdy_int = 0;
}
@@ -219,6 +229,7 @@ READ8_MEMBER(thayers_state::cop_data_r)
WRITE8_MEMBER(thayers_state::cop_data_w)
{
m_cop_data_latch = data;
+ if (LOG) logerror("COP DATA %02x\n", m_cop_data_latch);
}
READ8_MEMBER(thayers_state::cop_l_r)
@@ -236,6 +247,7 @@ READ8_MEMBER(thayers_state::cop_l_r)
WRITE8_MEMBER(thayers_state::cop_l_w)
{
m_cop_l = data;
+ if (LOG) logerror("COP L %02x\n", m_cop_l);
}
READ8_MEMBER(thayers_state::cop_g_r)
@@ -272,6 +284,7 @@ WRITE8_MEMBER(thayers_state::control_w)
*/
m_cop_cmd_latch = (data >> 5) & 0x07;
+ if (LOG) logerror("COP G0..2 %u\n", m_cop_cmd_latch);
}
WRITE8_MEMBER(thayers_state::cop_g_w)
@@ -288,63 +301,52 @@ WRITE8_MEMBER(thayers_state::cop_g_w)
*/
m_cop_data_latch_enable = BIT(data, 3);
+ if (LOG) logerror("U17 enable %u\n", m_cop_data_latch_enable);
}
/* Keyboard */
-READ_LINE_MEMBER(thayers_state::cop_si_r)
+READ_LINE_MEMBER(thayers_state::kbdata_r)
{
- /* keyboard data */
-
- /*
-
- Serial communications format
-
- 1, 1, 0, 1, Q8, P0, P1, P2, P3, 0
-
- */
-
- switch (m_rx_bit)
- {
- case 0:
- case 1:
- case 3:
- return 1;
-
- case 4:
- return (m_keylatch == 9);
-
- case 5:
- case 6:
- case 7:
- case 8:
- return BIT(m_row[m_keylatch]->read(), m_rx_bit - 5);
-
- default:
- return 0;
- }
+ if (LOG) logerror("%s KBDATA %u BIT %u\n",machine().time().as_string(),BIT(m_keydata,7),m_rx_bit);
+ return BIT(m_keydata, 7);
}
-WRITE_LINE_MEMBER(thayers_state::cop_so_w)
+WRITE_LINE_MEMBER(thayers_state::kbclk_w)
{
- /* keyboard clock */
+ if (m_kbclk != state) {
+ if (LOG) logerror("%s %s KBCLK %u\n", machine().time().as_string(), machine().describe_context(),state);
+ }
- if (state)
- {
+ if (!m_kbclk && state) {
m_rx_bit++;
- if (m_rx_bit == 10)
- {
+ if (m_rx_bit == 10) {
m_rx_bit = 0;
m_keylatch++;
- if (m_keylatch == 10)
- {
+ if (m_keylatch == 10) {
m_keylatch = 0;
}
+
+ if (LOG) logerror("keylatch %u\n",m_keylatch);
+ }
+
+ if (LOG) logerror("rx bit %u\n",m_rx_bit);
+
+ if (BIT(m_rx_bit, 3)) {
+ // 1, 0, 1, Q9, P3, P2, P1, P0, 1, 1
+ bool q9 = (m_keylatch == 9);
+ m_keydata = 0xa0 | q9 << 4 | m_row[m_keylatch]->read();
+ if (LOG) logerror("keydata %02x keylatch %u\n",m_keydata,m_keylatch);
+ } else if (m_rx_bit) {
+ m_keydata <<= 1;
+ if (LOG) logerror("keydata %02x shift\n",m_keydata);
}
}
+
+ m_kbclk = state;
}
/* I/O Board */
@@ -677,64 +679,64 @@ static INPUT_PORTS_START( thayers )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, thayers_state,laserdisc_ready_r, nullptr)
PORT_START("ROW.0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "2" ) PORT_CODE( KEYCODE_F2 )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "1 - Clear" ) PORT_CODE( KEYCODE_BACKSPACE )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Q" ) PORT_CODE( KEYCODE_Q )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE( KEYCODE_0_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "2" ) PORT_CODE( KEYCODE_F2 )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "1 - Clear" ) PORT_CODE( KEYCODE_BACKSPACE )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Q" ) PORT_CODE( KEYCODE_Q )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE( KEYCODE_0_PAD )
PORT_START("ROW.1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Z - Spell of Release" ) PORT_CODE( KEYCODE_Z )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "A" ) PORT_CODE( KEYCODE_A )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "W - Amulet" ) PORT_CODE( KEYCODE_W )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Items" ) PORT_CODE( KEYCODE_1_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Z - Spell of Release" ) PORT_CODE( KEYCODE_Z )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "A" ) PORT_CODE( KEYCODE_A )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "W - Amulet" ) PORT_CODE( KEYCODE_W )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Items" ) PORT_CODE( KEYCODE_1_PAD )
PORT_START("ROW.2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "X - Scepter" ) PORT_CODE( KEYCODE_X )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "S - Dagger" ) PORT_CODE( KEYCODE_S )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "E - Black Mace" ) PORT_CODE( KEYCODE_E )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Drop Item" ) PORT_CODE( KEYCODE_2_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "X - Scepter" ) PORT_CODE( KEYCODE_X )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "S - Dagger" ) PORT_CODE( KEYCODE_S )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "E - Black Mace" ) PORT_CODE( KEYCODE_E )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Drop Item" ) PORT_CODE( KEYCODE_2_PAD )
PORT_START("ROW.3")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "C - Spell of Seeing" ) PORT_CODE( KEYCODE_C )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "D - Great Circlet" ) PORT_CODE( KEYCODE_D )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "R - Blood Sword" ) PORT_CODE( KEYCODE_R )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Give Score" ) PORT_CODE( KEYCODE_3_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "C - Spell of Seeing" ) PORT_CODE( KEYCODE_C )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "D - Great Circlet" ) PORT_CODE( KEYCODE_D )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "R - Blood Sword" ) PORT_CODE( KEYCODE_R )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Give Score" ) PORT_CODE( KEYCODE_3_PAD )
PORT_START("ROW.4")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "V - Shield" ) PORT_CODE( KEYCODE_V )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "F - Hunting Horn" ) PORT_CODE( KEYCODE_F )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "T - Chalice" ) PORT_CODE( KEYCODE_T )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Replay" ) PORT_CODE( KEYCODE_4_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "V - Shield" ) PORT_CODE( KEYCODE_V )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "F - Hunting Horn" ) PORT_CODE( KEYCODE_F )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "T - Chalice" ) PORT_CODE( KEYCODE_T )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Replay" ) PORT_CODE( KEYCODE_4_PAD )
PORT_START("ROW.5")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "B - Silver Wheat" ) PORT_CODE( KEYCODE_B )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "G - Long Bow" ) PORT_CODE( KEYCODE_G )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Y - Coins" ) PORT_CODE( KEYCODE_Y )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Combine Action" ) PORT_CODE( KEYCODE_6_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "B - Silver Wheat" ) PORT_CODE( KEYCODE_B )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "G - Long Bow" ) PORT_CODE( KEYCODE_G )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Y - Coins" ) PORT_CODE( KEYCODE_Y )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Combine Action" ) PORT_CODE( KEYCODE_6_PAD )
PORT_START("ROW.6")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "N - Staff" ) PORT_CODE( KEYCODE_N )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "H - Medallion" ) PORT_CODE( KEYCODE_H )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "U - Cold Fire" ) PORT_CODE( KEYCODE_U )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Save Game" ) PORT_CODE( KEYCODE_7_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "N - Staff" ) PORT_CODE( KEYCODE_N )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "H - Medallion" ) PORT_CODE( KEYCODE_H )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "U - Cold Fire" ) PORT_CODE( KEYCODE_U )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Save Game" ) PORT_CODE( KEYCODE_7_PAD )
PORT_START("ROW.7")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "M - Spell of Understanding" ) PORT_CODE( KEYCODE_M )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "J - Onyx Seal" ) PORT_CODE( KEYCODE_J )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "I - Crown" ) PORT_CODE( KEYCODE_I )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Update" ) PORT_CODE( KEYCODE_8_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "M - Spell of Understanding" ) PORT_CODE( KEYCODE_M )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "J - Onyx Seal" ) PORT_CODE( KEYCODE_J )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "I - Crown" ) PORT_CODE( KEYCODE_I )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Update" ) PORT_CODE( KEYCODE_8_PAD )
PORT_START("ROW.8")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "3 - Enter" ) PORT_CODE( KEYCODE_ENTER )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "K - Orb of Quoid" ) PORT_CODE( KEYCODE_K )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "O - Crystal" ) PORT_CODE( KEYCODE_O )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Hint" ) PORT_CODE( KEYCODE_9_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "3 - Enter" ) PORT_CODE( KEYCODE_ENTER )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "K - Orb of Quoid" ) PORT_CODE( KEYCODE_K )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "O - Crystal" ) PORT_CODE( KEYCODE_O )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "Hint" ) PORT_CODE( KEYCODE_9_PAD )
PORT_START("ROW.9")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "4 - Space" ) PORT_CODE( KEYCODE_SPACE )
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "L" ) PORT_CODE( KEYCODE_L )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "P" ) PORT_CODE( KEYCODE_P )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( DEF_STR( No ) ) PORT_CODE( KEYCODE_0_PAD )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "4 - Space" ) PORT_CODE( KEYCODE_SPACE )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "L" ) PORT_CODE( KEYCODE_L )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( "P" ) PORT_CODE( KEYCODE_P )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME( DEF_STR( No ) ) PORT_CODE( KEYCODE_0_PAD )
INPUT_PORTS_END
/* Machine Initialization */
@@ -750,6 +752,7 @@ void thayers_state::machine_reset()
m_rx_bit = 0;
m_keylatch = 0;
+ m_keydata = 0xb0;
m_cop_data_latch = 0;
m_cop_data_latch_enable = 0;
@@ -783,8 +786,8 @@ static MACHINE_CONFIG_START( thayers, thayers_state )
MCFG_COP400_READ_G_CB(READ8(thayers_state, cop_g_r))
MCFG_COP400_WRITE_G_CB(WRITE8(thayers_state, cop_g_w))
MCFG_COP400_WRITE_D_CB(WRITE8(thayers_state, cop_d_w))
- MCFG_COP400_READ_SI_CB(READLINE(thayers_state, cop_si_r))
- MCFG_COP400_WRITE_SO_CB(WRITELINE(thayers_state, cop_so_w))
+ MCFG_COP400_READ_SI_CB(READLINE(thayers_state, kbdata_r))
+ MCFG_COP400_WRITE_SO_CB(WRITELINE(thayers_state, kbclk_w))
MCFG_LASERDISC_PR7820_ADD("laserdisc")
diff --git a/src/mame/drivers/ti74.cpp b/src/mame/drivers/ti74.cpp
index 3307a0d3473..7ae4ab0b623 100644
--- a/src/mame/drivers/ti74.cpp
+++ b/src/mame/drivers/ti74.cpp
@@ -97,10 +97,10 @@ public:
required_ioport_array<8> m_key_matrix;
required_ioport m_battery_inp;
- uint8_t m_key_select;
- uint8_t m_power;
+ u8 m_key_select;
+ u8 m_power;
- void update_lcd_indicator(uint8_t y, uint8_t x, int state);
+ void update_lcd_indicator(u8 y, u8 x, int state);
void update_battery_status(int state);
DECLARE_READ8_MEMBER(keyboard_r);
@@ -126,7 +126,7 @@ public:
DEVICE_IMAGE_LOAD_MEMBER(ti74_state, ti74_cartridge)
{
- uint32_t size = m_cart->common_get_size("rom");
+ u32 size = m_cart->common_get_size("rom");
// max size is 32KB
if (size > 0x8000)
@@ -156,7 +156,7 @@ PALETTE_INIT_MEMBER(ti74_state, ti74)
palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off
}
-void ti74_state::update_lcd_indicator(uint8_t y, uint8_t x, int state)
+void ti74_state::update_lcd_indicator(u8 y, u8 x, int state)
{
// TI-74 ref._________________...
// output# |10 11 12 13 14 2 3 4
@@ -229,7 +229,7 @@ HD44780_PIXEL_UPDATE(ti74_state::ti95_pixel_update)
READ8_MEMBER(ti74_state::keyboard_r)
{
- uint8_t ret = 0;
+ u8 ret = 0;
// read selected keyboard rows
for (int i = 0; i < 8; i++)
@@ -266,7 +266,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, ti74_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("hd44780", hd44780_device, read, write)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("sysram.ic3")
- //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
+ //AM_RANGE(0x4000, 0xbfff) // mapped by the cartslot
AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("sysbank")
ADDRESS_MAP_END
diff --git a/src/mame/drivers/ticalc1x.cpp b/src/mame/drivers/ticalc1x.cpp
index 5a56e557238..2eec28f1d22 100644
--- a/src/mame/drivers/ticalc1x.cpp
+++ b/src/mame/drivers/ticalc1x.cpp
@@ -76,11 +76,11 @@ void cmulti8_state::prepare_display()
set_display_segmask(0xfffff, 0xff);
// M-digit is on in memory mode, upper row is off in single mode
- uint32_t m = (m_inp_matrix[10]->read() & 0x10) ? 0x100000 : 0;
- uint32_t mask = (m_inp_matrix[10]->read() & 0x20) ? 0xfffff : 0xffc00;
+ u32 m = (m_inp_matrix[10]->read() & 0x10) ? 0x100000 : 0;
+ u32 mask = (m_inp_matrix[10]->read() & 0x20) ? 0xfffff : 0xffc00;
// R10 selects display row
- uint32_t sel = (m_r & 0x400) ? (m_r & 0x3ff) : (m_r << 10 & 0xffc00);
+ u32 sel = (m_r & 0x400) ? (m_r & 0x3ff) : (m_r << 10 & 0xffc00);
display_matrix(8, 21, m_o, (sel & mask) | m);
}
@@ -865,8 +865,8 @@ public:
WRITE16_MEMBER(lilprof78_state::write_r)
{
// update leds state
- uint8_t seg = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f;
- uint16_t r = (data & 7) | (data << 1 & 0x1f0);
+ u8 seg = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f;
+ u16 r = (data & 7) | (data << 1 & 0x1f0);
set_display_segmask(0x1ff, 0x7f);
display_matrix(7, 9, seg, r, false);
diff --git a/src/mame/drivers/tigeroad.cpp b/src/mame/drivers/tigeroad.cpp
index ae4d234dfac..f9f0a1bc04d 100644
--- a/src/mame/drivers/tigeroad.cpp
+++ b/src/mame/drivers/tigeroad.cpp
@@ -84,9 +84,18 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tigeroad_state )
AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE("ram16")
ADDRESS_MAP_END
-static ADDRESS_MAP_START( bballs_map, AS_PROGRAM, 16, tigeroad_state )
+static ADDRESS_MAP_START( pushman_map, AS_PROGRAM, 16, pushman_state )
+ AM_IMPORT_FROM(main_map)
+
+ AM_RANGE(0x060000, 0x060007) AM_READ(mcu_comm_r)
+ AM_RANGE(0x060000, 0x060003) AM_WRITE(mcu_comm_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( bballs_map, AS_PROGRAM, 16, bballs_state )
ADDRESS_MAP_GLOBAL_MASK(0xfffff)
AM_RANGE(0x00000, 0x3ffff) AM_ROM
+ AM_RANGE(0x60000, 0x60007) AM_READ(bballs_68705_r)
+ AM_RANGE(0x60000, 0x60003) AM_WRITE(bballs_68705_w)
// are these mirror addresses or does this PCB have a different addressing?
AM_RANGE(0xe0800, 0xe17ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe4000, 0xe4001) AM_READ_PORT("P1_P2") AM_WRITE(tigeroad_videoctrl_w)
@@ -125,13 +134,6 @@ static ADDRESS_MAP_START( sample_port_map, AS_IO, 8, tigeroad_state )
AM_RANGE(0x01, 0x01) AM_WRITE(msm5205_w)
ADDRESS_MAP_END
-/* Pushman ONLY */
-static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, tigeroad_state )
- AM_RANGE(0x0000, 0x0007) AM_READWRITE(pushman_68000_r, pushman_68000_w)
- AM_RANGE(0x0010, 0x007f) AM_RAM
- AM_RANGE(0x0080, 0x0fff) AM_ROM
-ADDRESS_MAP_END
-
/* Pushman / Bouncing Balls */
static ADDRESS_MAP_START( comad_sound_map, AS_PROGRAM, 8, tigeroad_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
@@ -570,25 +572,6 @@ static GFXDECODE_START( tigeroad )
GFXDECODE_ENTRY( "sprites", 0, sprite_layout, 0x200, 16 )
GFXDECODE_END
-void tigeroad_state::machine_start()
-{
- save_item(NAME(m_control));
- save_item(NAME(m_shared_ram));
- save_item(NAME(m_latch));
- save_item(NAME(m_new_latch));
-}
-
-MACHINE_RESET_MEMBER(tigeroad_state,pushman)
-{
- // todo, move to an MCU sim reset function in machine/tigeroad.c
- m_latch = 0;
- m_new_latch = 0;
- m_control[0] = 0;
- m_control[1] = 0;
-
- memset(m_shared_ram, 0, ARRAY_LENGTH(m_shared_ram));
-}
-
static MACHINE_CONFIG_START( tigeroad, tigeroad_state )
/* basic machine hardware */
@@ -699,25 +682,45 @@ static MACHINE_CONFIG_START( f1dream_comad, tigeroad_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( pushman, f1dream_comad )
- MCFG_CPU_ADD("mcu", M68705, 4000000) /* No idea */
- MCFG_CPU_PROGRAM_MAP(mcu_map)
- MCFG_MACHINE_RESET_OVERRIDE(tigeroad_state,pushman)
+
+void pushman_state::machine_start()
+{
+ save_item(NAME(m_host_semaphore));
+ save_item(NAME(m_mcu_semaphore));
+ save_item(NAME(m_host_latch));
+ save_item(NAME(m_mcu_latch));
+ save_item(NAME(m_mcu_output));
+ save_item(NAME(m_mcu_latch_ctl));
+}
+
+static MACHINE_CONFIG_DERIVED_CLASS(pushman, f1dream_comad, pushman_state)
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(pushman_map)
+
+ MCFG_CPU_ADD("mcu", M68705R3, 4000000) /* No idea */
+ MCFG_M68705_PORTA_W_CB(WRITE8(pushman_state, mcu_pa_w))
+ MCFG_M68705_PORTB_W_CB(WRITE8(pushman_state, mcu_pb_w))
+ MCFG_M68705_PORTC_W_CB(WRITE8(pushman_state, mcu_pc_w))
MACHINE_CONFIG_END
-MACHINE_RESET_MEMBER(tigeroad_state,bballs)
+MACHINE_RESET_MEMBER(bballs_state, bballs)
{
- MACHINE_RESET_CALL_MEMBER(pushman);
+ m_mcu_semaphore = false;
+ m_mcu_latch = 0x0400;
+}
- m_latch = 0x400;
+void bballs_state::machine_start()
+{
+ save_item(NAME(m_mcu_semaphore));
+ save_item(NAME(m_mcu_latch));
}
-static MACHINE_CONFIG_DERIVED( bballs, f1dream_comad )
+static MACHINE_CONFIG_DERIVED_CLASS(bballs, f1dream_comad, bballs_state)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(bballs_map)
- MCFG_MACHINE_RESET_OVERRIDE(tigeroad_state,bballs)
+ MCFG_MACHINE_RESET_OVERRIDE(bballs_state, bballs)
MACHINE_CONFIG_END
@@ -1179,41 +1182,29 @@ ROM_START( bballsa )
ROM_END
-DRIVER_INIT_MEMBER(tigeroad_state,f1dream)
+DRIVER_INIT_MEMBER(tigeroad_state, f1dream)
{
m_maincpu->space(AS_PROGRAM).install_write_handler(0xfe4002, 0xfe4003, write16_delegate(FUNC(tigeroad_state::f1dream_control_w),this));
}
-DRIVER_INIT_MEMBER(tigeroad_state,pushman)
-{
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x060000, 0x060007, read16_delegate(FUNC(tigeroad_state::pushman_68705_r),this), write16_delegate(FUNC(tigeroad_state::pushman_68705_w),this) );
- m_has_coinlock = 0;
-}
-
-DRIVER_INIT_MEMBER(tigeroad_state,bballs)
-{
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x060000, 0x060007, read16_delegate(FUNC(tigeroad_state::bballs_68705_r),this), write16_delegate(FUNC(tigeroad_state::bballs_68705_w),this) );
- m_has_coinlock = 0;
-}
-
/***************************************************************************/
-GAME( 1987, tigeroad, 0, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom", "Tiger Road (US)", 0 )
-GAME( 1987, tigeroadu,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom (Romstar license)", "Tiger Road (US, Romstar license)", 0 )
-GAME( 1987, toramich, tigeroad, toramich, toramich, driver_device, 0, ROT0, "Capcom", "Tora e no Michi (Japan)", 0 )
-GAME( 1987, tigeroadb,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "bootleg", "Tiger Road (US bootleg)", 0 )
+GAME( 1987, tigeroad, 0, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom", "Tiger Road (US)", 0 )
+GAME( 1987, tigeroadu,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "Capcom (Romstar license)", "Tiger Road (US, Romstar license)", 0 )
+GAME( 1987, toramich, tigeroad, toramich, toramich, driver_device, 0, ROT0, "Capcom", "Tora e no Michi (Japan)", 0 )
+GAME( 1987, tigeroadb,tigeroad, tigeroad, tigeroad, driver_device, 0, ROT0, "bootleg", "Tiger Road (US bootleg)", 0 )
/* F1 Dream has an Intel 8751 microcontroller for protection */
-GAME( 1988, f1dream, 0, tigeroad, f1dream, tigeroad_state, f1dream, ROT0, "Capcom (Romstar license)", "F-1 Dream", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // collisions are wrong
-GAME( 1988, f1dreamb, f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 1)", 0 )
-GAME( 1988, f1dreamba,f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 2)", 0 )
+GAME( 1988, f1dream, 0, tigeroad, f1dream, tigeroad_state, f1dream, ROT0, "Capcom (Romstar license)", "F-1 Dream", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // collisions are wrong
+GAME( 1988, f1dreamb, f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 1)", 0 )
+GAME( 1988, f1dreamba,f1dream, tigeroad, f1dream, driver_device, 0, ROT0, "bootleg", "F-1 Dream (bootleg, set 2)", 0 )
/* This Comad hardware is based around the F1 Dream design */
-GAME( 1990, pushman, 0, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad", "Pushman (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, pushmana, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad", "Pushman (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, pushmans, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, pushmant, pushman, pushman, pushman, tigeroad_state, pushman, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, pushman, 0, pushman, pushman, driver_device, 0, ROT0, "Comad", "Pushman (Korea, set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, pushmana, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad", "Pushman (Korea, set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, pushmans, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad (American Sammy license)", "Pushman (American Sammy license)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, pushmant, pushman, pushman, pushman, driver_device, 0, ROT0, "Comad (Top Tronic license)", "Pushman (Top Tronic license)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, bballs, 0, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, bballsa, bballs, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls (Adult)", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, bballs, 0, bballs, bballs, driver_device, 0, ROT0, "Comad", "Bouncing Balls", MACHINE_SUPPORTS_SAVE )
+GAME( 1991, bballsa, bballs, bballs, bballs, driver_device, 0, ROT0, "Comad", "Bouncing Balls (Adult)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp
index d51c44dee0e..e5fe4410109 100644
--- a/src/mame/drivers/tispeak.cpp
+++ b/src/mame/drivers/tispeak.cpp
@@ -452,21 +452,21 @@ public:
DECLARE_WRITE16_MEMBER(snspellc_write_r);
DECLARE_READ8_MEMBER(tntell_read_k);
- void k28_prepare_display(uint8_t old, uint8_t data);
+ void k28_prepare_display(u8 old, u8 data);
DECLARE_READ8_MEMBER(k28_read_k);
DECLARE_WRITE16_MEMBER(k28_write_o);
DECLARE_WRITE16_MEMBER(k28_write_r);
// cartridge
- uint32_t m_cart_max_size;
- uint8_t* m_cart_base;
+ u32 m_cart_max_size;
+ u8* m_cart_base;
void init_cartridge();
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tispeak_cartridge);
DECLARE_DRIVER_INIT(snspell);
DECLARE_DRIVER_INIT(tntell);
DECLARE_DRIVER_INIT(lantutor);
- uint8_t m_overlay;
+ u8 m_overlay;
TIMER_DEVICE_CALLBACK_MEMBER(tntell_get_overlay);
protected:
@@ -504,7 +504,7 @@ void tispeak_state::init_cartridge()
DEVICE_IMAGE_LOAD_MEMBER(tispeak_state, tispeak_cartridge)
{
- uint32_t size = m_cart->common_get_size("rom");
+ u32 size = m_cart->common_get_size("rom");
if (size > m_cart_max_size)
{
@@ -549,7 +549,7 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor)
void tispeak_state::prepare_display()
{
- uint16_t gridmask = vfd_filament_on() ? 0xffff : 0x8000;
+ u16 gridmask = vfd_filament_on() ? 0xffff : 0x8000;
set_display_segmask(0x21ff, 0x3fff);
display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask);
}
@@ -640,7 +640,7 @@ WRITE16_MEMBER(tispeak_state::snspellc_write_o)
READ8_MEMBER(tispeak_state::snspellc_read_k)
{
// K4: TMS5100 CTL1
- uint8_t k4 = m_tms5100->ctl_r(space, 0) << 2 & 4;
+ u8 k4 = m_tms5100->ctl_r(space, 0) << 2 & 4;
// K: multiplexed inputs (note: the Vss row is always on)
return k4 | m_inp_matrix[9]->read() | read_inputs(9);
@@ -652,7 +652,7 @@ READ8_MEMBER(tispeak_state::snspellc_read_k)
READ8_MEMBER(tispeak_state::tntell_read_k)
{
// K8: overlay code from R5,O4-O7
- uint8_t k8 = (((m_r >> 1 & 0x10) | (m_o >> 4 & 0xf)) & m_overlay) ? 8 : 0;
+ u8 k8 = (((m_r >> 1 & 0x10) | (m_o >> 4 & 0xf)) & m_overlay) ? 8 : 0;
// rest is same as snpellc
return k8 | snspellc_read_k(space, offset);
@@ -678,7 +678,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay)
// k28 specific
-void tispeak_state::k28_prepare_display(uint8_t old, uint8_t data)
+void tispeak_state::k28_prepare_display(u8 old, u8 data)
{
// ?
}
diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp
index 40936b78e14..dfe0439207c 100644
--- a/src/mame/drivers/tispellb.cpp
+++ b/src/mame/drivers/tispellb.cpp
@@ -76,9 +76,9 @@ public:
optional_device<cpu_device> m_subcpu;
optional_device<tms6100_device> m_tms6100;
- uint8_t m_rev1_ctl;
- uint16_t m_sub_o;
- uint16_t m_sub_r;
+ u8 m_rev1_ctl;
+ u16 m_sub_o;
+ u16 m_sub_r;
virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override;
void power_off();
@@ -140,7 +140,7 @@ void tispellb_state::power_off()
void tispellb_state::prepare_display()
{
// almost same as snspell
- uint16_t gridmask = vfd_filament_on() ? 0xffff : 0x8000;
+ u16 gridmask = vfd_filament_on() ? 0xffff : 0x8000;
set_display_segmask(0xff, 0x3fff);
display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask);
}
diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h
index 775c4bd3e55..caf4cce2bd4 100644
--- a/src/mame/includes/ddragon.h
+++ b/src/mame/includes/ddragon.h
@@ -6,31 +6,34 @@
*************************************************************************/
+#include "cpu/m6805/m68705.h"
#include "machine/gen_latch.h"
#include "sound/msm5205.h"
+
class ddragon_state : public driver_device
{
public:
ddragon_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_rambase(*this, "rambase"),
- m_bgvideoram(*this, "bgvideoram"),
- m_fgvideoram(*this, "fgvideoram"),
- m_comram(*this, "comram"),
- m_spriteram(*this, "spriteram"),
- m_scrollx_lo(*this, "scrollx_lo"),
- m_scrolly_lo(*this, "scrolly_lo"),
- m_darktowr_mcu_ports(*this, "darktowr_mcu"),
- m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu"),
- m_subcpu(*this, "sub"),
- m_adpcm1(*this, "adpcm1"),
- m_adpcm2(*this, "adpcm2"),
- m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch") { }
+ : driver_device(mconfig, type, tag)
+ , m_rambase(*this, "rambase")
+ , m_bgvideoram(*this, "bgvideoram")
+ , m_fgvideoram(*this, "fgvideoram")
+ , m_comram(*this, "comram")
+ , m_spriteram(*this, "spriteram")
+ , m_scrollx_lo(*this, "scrollx_lo")
+ , m_scrolly_lo(*this, "scrolly_lo")
+ , m_maincpu(*this, "maincpu")
+ , m_soundcpu(*this, "soundcpu")
+ , m_subcpu(*this, "sub")
+ , m_adpcm1(*this, "adpcm1")
+ , m_adpcm2(*this, "adpcm2")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_screen(*this, "screen")
+ , m_palette(*this, "palette")
+ , m_soundlatch(*this, "soundlatch")
+ {
+ }
/* memory pointers */
optional_shared_ptr<uint8_t> m_rambase;
@@ -40,7 +43,6 @@ public:
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_scrollx_lo;
required_shared_ptr<uint8_t> m_scrolly_lo;
- optional_shared_ptr<uint8_t> m_darktowr_mcu_ports;
/* video-related */
tilemap_t *m_fg_tilemap;
@@ -105,15 +107,10 @@ public:
DECLARE_WRITE8_MEMBER(ddragon_fgvideoram_w);
DECLARE_CUSTOM_INPUT_MEMBER(subcpu_bus_free);
DECLARE_WRITE8_MEMBER(ddragon_bankswitch_w);
- DECLARE_WRITE8_MEMBER(toffy_bankswitch_w);
- DECLARE_READ8_MEMBER(darktowr_mcu_bank_r);
- DECLARE_WRITE8_MEMBER(darktowr_mcu_bank_w);
- DECLARE_WRITE8_MEMBER(darktowr_bankswitch_w);
DECLARE_READ8_MEMBER(ddragon_interrupt_r);
DECLARE_WRITE8_MEMBER(ddragon_interrupt_w);
DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_ack_w);
DECLARE_WRITE8_MEMBER(ddragon2_sub_irq_w);
- DECLARE_WRITE8_MEMBER(darktowr_mcu_w);
DECLARE_READ8_MEMBER(ddragon_hd63701_internal_registers_r);
DECLARE_WRITE8_MEMBER(ddragon_hd63701_internal_registers_w);
DECLARE_READ8_MEMBER(ddragon_comram_r);
@@ -124,9 +121,45 @@ public:
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_1);
DECLARE_WRITE_LINE_MEMBER(dd_adpcm_int_2);
- DECLARE_DRIVER_INIT(toffy);
- DECLARE_DRIVER_INIT(darktowr);
DECLARE_DRIVER_INIT(ddragon2);
DECLARE_DRIVER_INIT(ddragon);
DECLARE_DRIVER_INIT(ddragon6809);
};
+
+
+class darktowr_state : public ddragon_state
+{
+public:
+ darktowr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : ddragon_state(mconfig, type, tag)
+ , m_mcu(*this, "mcu")
+ , m_mcu_port_a_out(0xff)
+ {
+ }
+
+ DECLARE_READ8_MEMBER(darktowr_mcu_bank_r);
+ DECLARE_WRITE8_MEMBER(darktowr_mcu_bank_w);
+ DECLARE_WRITE8_MEMBER(darktowr_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(mcu_port_a_w);
+
+ DECLARE_DRIVER_INIT(darktowr);
+
+protected:
+ required_device<m68705p_device> m_mcu;
+
+ uint8_t m_mcu_port_a_out;;
+};
+
+
+class toffy_state : public ddragon_state
+{
+public:
+ toffy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : ddragon_state(mconfig, type, tag)
+ {
+ }
+
+ DECLARE_WRITE8_MEMBER(toffy_bankswitch_w);
+
+ DECLARE_DRIVER_INIT(toffy);
+};
diff --git a/src/mame/includes/fidelbase.h b/src/mame/includes/fidelbase.h
new file mode 100644
index 00000000000..1f36fdc490b
--- /dev/null
+++ b/src/mame/includes/fidelbase.h
@@ -0,0 +1,70 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/******************************************************************************
+*
+* Fidelity Electronics chess machines base class
+*
+******************************************************************************/
+
+#include "emu.h"
+#include "sound/dac.h"
+#include "sound/s14001a.h"
+#include "bus/generic/slot.h"
+#include "bus/generic/carts.h"
+#include "softlist.h"
+
+class fidelbase_state : public driver_device
+{
+public:
+ fidelbase_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_inp_matrix(*this, "IN.%u", 0),
+ m_speech(*this, "speech"),
+ m_speech_rom(*this, "speech"),
+ m_dac(*this, "dac"),
+ m_cart(*this, "cartslot"),
+ m_display_wait(33),
+ m_display_maxy(1),
+ m_display_maxx(0)
+ { }
+
+ // devices/pointers
+ required_device<cpu_device> m_maincpu;
+ optional_ioport_array<11> m_inp_matrix; // max 11
+ optional_device<s14001a_device> m_speech;
+ optional_region_ptr<u8> m_speech_rom;
+ optional_device<dac_bit_interface> m_dac;
+ optional_device<generic_slot_device> m_cart;
+
+ // misc common
+ u16 m_inp_mux; // multiplexed keypad/leds mask
+ u16 m_led_select;
+ u32 m_7seg_data; // data for seg leds
+ u16 m_led_data;
+ u8 m_speech_data;
+ u8 m_speech_bank; // speech rom higher address bits
+
+ u16 read_inputs(int columns);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER(scc_cartridge);
+
+ // display common
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
+
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
+
+ TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
+ void display_update();
+ void set_display_size(int maxx, int maxy);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+};
diff --git a/src/mame/includes/fidelz80.h b/src/mame/includes/fidelz80.h
deleted file mode 100644
index 1fe4e19cb6b..00000000000
--- a/src/mame/includes/fidelz80.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Kevin Horton,Jonathan Gevaryahu,Sandro Ronco,hap
-// thanks-to:Berger
-/******************************************************************************
-*
-* Fidelity Electronics Z80 based board driver
-*
-******************************************************************************/
-
-#include "emu.h"
-#include "sound/dac.h"
-#include "sound/s14001a.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
-#include "softlist.h"
-
-class fidelz80base_state : public driver_device
-{
-public:
- fidelz80base_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_inp_matrix(*this, "IN.%u", 0),
- m_speech(*this, "speech"),
- m_speech_rom(*this, "speech"),
- m_dac(*this, "dac"),
- m_cart(*this, "cartslot"),
- m_display_wait(33),
- m_display_maxy(1),
- m_display_maxx(0)
- { }
-
- // devices/pointers
- required_device<cpu_device> m_maincpu;
- optional_ioport_array<11> m_inp_matrix; // max 11
- optional_device<s14001a_device> m_speech;
- optional_region_ptr<uint8_t> m_speech_rom;
- optional_device<dac_bit_interface> m_dac;
- optional_device<generic_slot_device> m_cart;
-
- // misc common
- uint16_t m_inp_mux; // multiplexed keypad/leds mask
- uint16_t m_led_select;
- uint32_t m_7seg_data; // data for seg leds
- uint16_t m_led_data;
- uint8_t m_speech_data;
- uint8_t m_speech_bank; // speech rom higher address bits
-
- uint16_t read_inputs(int columns);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER(scc_cartridge);
-
- // display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
-
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
-
- TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
- void display_update();
- void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
-
-protected:
- virtual void machine_start() override;
- virtual void machine_reset() override;
-};
diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h
index 28500b4cc33..22a3876b7ad 100644
--- a/src/mame/includes/goldstar.h
+++ b/src/mame/includes/goldstar.h
@@ -177,6 +177,7 @@ public:
DECLARE_PALETTE_INIT(magodds);
uint32_t screen_update_bingowng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_magical(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update_mbstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(masked_irq);
diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h
index b24642aa789..35b27a579ab 100644
--- a/src/mame/includes/hh_tms1k.h
+++ b/src/mame/includes/hh_tms1k.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:hap, Sean Riddle, Kevin Horton
+// copyright-holders:hap
/*
TMS1000 MCU series tabletops/handhelds or other simple devices.
@@ -39,35 +39,35 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint16_t m_r; // MCU R-pins data
- uint16_t m_o; // MCU O-pins data
- uint32_t m_inp_mux; // multiplexed inputs mask
+ u16 m_r; // MCU R-pins data
+ u16 m_o; // MCU O-pins data
+ u32 m_inp_mux; // multiplexed inputs mask
bool m_power_on;
bool m_power_led;
- uint8_t read_inputs(int columns);
- uint8_t read_rotated_inputs(int columns, uint8_t rowmask = 0xf);
+ u8 read_inputs(int columns);
+ u8 read_rotated_inputs(int columns, u8 rowmask = 0xf);
virtual DECLARE_INPUT_CHANGED_MEMBER(power_button);
virtual DECLARE_WRITE_LINE_MEMBER(auto_power_off);
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_grid; // VFD/LED current row data
- uint32_t m_plate; // VFD/LED current column data
+ u32 m_grid; // VFD/LED current row data
+ u32 m_plate; // VFD/LED current column data
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void set_display_segmask(uint32_t digits, uint32_t mask);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/hh_ucom4.h b/src/mame/includes/hh_ucom4.h
index 4a0194e3cb0..8328809c09a 100644
--- a/src/mame/includes/hh_ucom4.h
+++ b/src/mame/includes/hh_ucom4.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:hap, Kevin Horton
+// copyright-holders:hap
/*
NEC uCOM4 MCU tabletops/handhelds or other simple devices,
@@ -35,32 +35,32 @@ public:
optional_device<speaker_sound_device> m_speaker;
// misc common
- uint8_t m_port[9]; // MCU port A-I write data (optional)
- uint8_t m_int; // MCU INT pin state
- uint16_t m_inp_mux; // multiplexed inputs mask
+ u8 m_port[9]; // MCU port A-I write data (optional)
+ u8 m_int; // MCU INT pin state
+ u16 m_inp_mux; // multiplexed inputs mask
- uint8_t read_inputs(int columns);
+ u8 read_inputs(int columns);
void refresh_interrupts(void);
void set_interrupt(int state);
DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line);
// display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
- uint32_t m_grid; // VFD current row data
- uint32_t m_plate; // VFD current column data
+ u32 m_grid; // VFD current row data
+ u32 m_plate; // VFD current column data
- uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- uint32_t m_display_cache[0x20]; // (internal use)
- uint8_t m_display_decay[0x20][0x20]; // (internal use)
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
protected:
virtual void machine_start() override;
diff --git a/src/mame/includes/novagbase.h b/src/mame/includes/novagbase.h
new file mode 100644
index 00000000000..102956fa22c
--- /dev/null
+++ b/src/mame/includes/novagbase.h
@@ -0,0 +1,57 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/******************************************************************************
+*
+* Novag chess machines base class
+*
+******************************************************************************/
+
+#include "emu.h"
+#include "sound/beep.h"
+
+class novagbase_state : public driver_device
+{
+public:
+ novagbase_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_beeper(*this, "beeper"),
+ m_inp_matrix(*this, "IN.%u", 0),
+ m_display_wait(33),
+ m_display_maxy(1),
+ m_display_maxx(0)
+ { }
+
+ // devices/pointers
+ required_device<cpu_device> m_maincpu;
+ optional_device<beep_device> m_beeper;
+ optional_ioport_array<8> m_inp_matrix;
+
+ // misc common
+ u16 m_inp_mux; // multiplexed keypad mask
+ u16 m_led_select;
+ u16 m_led_data;
+ u8 m_lcd_control;
+
+ u16 read_inputs(int columns);
+
+ // display common
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
+
+ u32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ u16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ u32 m_display_cache[0x20]; // (internal use)
+ u8 m_display_decay[0x20][0x20]; // (internal use)
+
+ TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
+ void display_update();
+ void set_display_size(int maxx, int maxy);
+ void set_display_segmask(u32 digits, u32 mask);
+ void display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update = true);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+};
diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h
index 4a41ebcd907..a969b7f6949 100644
--- a/src/mame/includes/tigeroad.h
+++ b/src/mame/includes/tigeroad.h
@@ -1,22 +1,26 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
-#include "video/bufsprite.h"
-#include "sound/msm5205.h"
+#include "video/tigeroad_spr.h"
+
#include "cpu/m68000/m68000.h"
+#include "cpu/m6805/m68705.h"
#include "cpu/z80/z80.h"
+
#include "machine/gen_latch.h"
+
#include "sound/2203intf.h"
#include "sound/msm5205.h"
-#include "cpu/m6805/m68705.h"
-#include "video/tigeroad_spr.h"
+
+#include "video/bufsprite.h"
+
class tigeroad_state : public driver_device
{
public:
tigeroad_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_spriteram(*this, "spriteram") ,
+ m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_ram16(*this, "ram16"),
m_maincpu(*this, "maincpu"),
@@ -24,10 +28,9 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_mcu(*this, "mcu"),
m_spritegen(*this, "spritegen"),
m_soundlatch(*this, "soundlatch"),
- m_has_coinlock(1)
+ m_has_coinlock(true)
{ }
required_device<buffered_spriteram16_device> m_spriteram;
@@ -43,8 +46,6 @@ public:
DECLARE_WRITE16_MEMBER(tigeroad_scroll_w);
DECLARE_WRITE8_MEMBER(msm5205_w);
DECLARE_DRIVER_INIT(f1dream);
- DECLARE_DRIVER_INIT(pushman);
- DECLARE_DRIVER_INIT(bballs);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILEMAP_MAPPER_MEMBER(tigeroad_tilemap_scan);
@@ -56,28 +57,69 @@ public:
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- optional_device<cpu_device> m_mcu;
required_device<tigeroad_spr_device> m_spritegen;
required_device<generic_latch_8_device> m_soundlatch;
- uint16_t m_control[2];
-
+protected:
/* misc */
- uint8_t m_shared_ram[8];
- uint16_t m_latch;
- uint16_t m_new_latch;
- int m_has_coinlock;
-
- /* protection handling */
- DECLARE_READ16_MEMBER(pushman_68705_r);
- DECLARE_WRITE16_MEMBER(pushman_68705_w);
+ bool m_has_coinlock;
+};
+
+
+class pushman_state : public tigeroad_state
+{
+public:
+ pushman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tigeroad_state(mconfig, type, tag)
+ , m_mcu(*this, "mcu")
+ , m_host_semaphore(false)
+ , m_mcu_semaphore(false)
+ , m_host_latch(0xffff)
+ , m_mcu_latch(0xffff)
+ , m_mcu_output(0xffff)
+ , m_mcu_latch_ctl(0xff)
+ {
+ m_has_coinlock = false;
+ }
+
+ DECLARE_READ16_MEMBER(mcu_comm_r);
+ DECLARE_WRITE16_MEMBER(mcu_comm_w);
+
+ DECLARE_WRITE8_MEMBER(mcu_pa_w);
+ DECLARE_WRITE8_MEMBER(mcu_pb_w);
+ DECLARE_WRITE8_MEMBER(mcu_pc_w);
+
+protected:
+ virtual void machine_start() override;
+
+ required_device<m68705u_device> m_mcu;
+
+ bool m_host_semaphore, m_mcu_semaphore;
+ u16 m_host_latch, m_mcu_latch;
+ u16 m_mcu_output;
+ u8 m_mcu_latch_ctl;
+};
+
+
+class bballs_state : public tigeroad_state
+{
+public:
+ bballs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tigeroad_state(mconfig, type, tag)
+ , m_mcu_semaphore(false)
+ , m_mcu_latch(0xffff)
+ {
+ m_has_coinlock = false;
+ }
+
DECLARE_READ16_MEMBER(bballs_68705_r);
DECLARE_WRITE16_MEMBER(bballs_68705_w);
- DECLARE_READ8_MEMBER(pushman_68000_r);
- DECLARE_WRITE8_MEMBER(pushman_68000_w);
- DECLARE_MACHINE_RESET(pushman);
+
DECLARE_MACHINE_RESET(bballs);
+protected:
virtual void machine_start() override;
+ bool m_mcu_semaphore;
+ u16 m_mcu_latch;
};
diff --git a/src/mame/layout/mdallas.lay b/src/mame/layout/mdallas.lay
new file mode 100644
index 00000000000..b34eca393fb
--- /dev/null
+++ b/src/mame/layout/mdallas.lay
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.15" blue="0.08" /></led7seg>
+ </element>
+
+ <view name="Internal Layout">
+ <bounds left="0" right="80" top="0" bottom="15" />
+
+ <bezel name="digit0" element="digit">
+ <bounds x="0" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit1" element="digit">
+ <bounds x="10" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit2" element="digit">
+ <bounds x="20" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit3" element="digit">
+ <bounds x="30" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit4" element="digit">
+ <bounds x="40" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit5" element="digit">
+ <bounds x="50" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit6" element="digit">
+ <bounds x="60" y="0" width="10" height="15" />
+ </bezel>
+ <bezel name="digit7" element="digit">
+ <bounds x="70" y="0" width="10" height="15" />
+ </bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/layout/novag_diablo68k.lay b/src/mame/layout/novag_diablo68k.lay
new file mode 100644
index 00000000000..dbbd38dab55
--- /dev/null
+++ b/src/mame/layout/novag_diablo68k.lay
@@ -0,0 +1,435 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_lcd"><rect><color red="0.5412" green="0.57255" blue="0.5804" /></rect></element>
+
+ <element name="led" defstate="0">
+ <disk state="1"><color red="1.0" green="0.1" blue="0.15" /></disk>
+ <disk state="0"><color red="0.1" green="0.01" blue="0.015" /></disk>
+ </element>
+
+ <element name="hl" defstate="0">
+ <text string=" ">
+ <bounds x="0.0" y="0.0" width="1.0" height="1.0" />
+ <color red="0.0" green="0.0" blue="0.0" />
+ </text>
+ <disk state="1">
+ <bounds x="0.12" y="0.12" width="0.76" height="0.76" />
+ <color red="1.0" green="1.0" blue="1.0" />
+ </disk>
+ </element>
+ <element name="but" defstate="0">
+ <disk state="0"><color red="0.17" green="0.15" blue="0.15" /></disk>
+ <disk state="1"><color red="0.34" green="0.3" blue="0.3" /></disk>
+ </element>
+
+ <element name="black"><rect><color red="0.17" green="0.15" blue="0.15" /></rect></element>
+ <element name="white"><rect><color red="0.81" green="0.8" blue="0.79" /></rect></element>
+
+ <element name="text_1"><text string="1"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_2"><text string="2"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_3"><text string="3"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_4"><text string="4"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_5"><text string="5"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_6"><text string="6"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_7"><text string="7"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_8"><text string="8"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+
+ <element name="text_a"><text string="A"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_b"><text string="B"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_c"><text string="C"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_d"><text string="D"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_e"><text string="E"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_f"><text string="F"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_g"><text string="G"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+ <element name="text_h"><text string="H"><color red="0.9" green="0.9" blue="0.9" /></text></element>
+
+ <element name="text_l1a"><text string="Print Board"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l1b"><text string="Interface"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l2a"><text string="Print List"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l2b"><text string="Acc. Time"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l3a"><text string="Print Moves"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l3b"><text string="Print"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l3bx"><text string="Evaluations"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l4a"><text string="Print Book"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l4b"><text string="Store Game"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l5a"><text string="No/End"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l5b"><text string="End of Game"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l6a"><text string="Yes/Start"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l6b"><text string="Start of Game"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l7a"><text string="&lt;-"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l7b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l8a"><text string="-&gt;"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_l8b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+
+ <element name="text_m1ax"><text string="Player/"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m1a"><text string="Player"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m1b"><text string="Gambit Book"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m2a"><text string="Solve Mate"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m2b"><text string="Infinite"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m3a"><text string="Sound"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m3b"><text string="Info"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m4ax"><text string="Best Move/"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m4a"><text string="Random"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m4b"><text string="Review"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m5a"><text string="Pro-Op"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m5b"><text string="Restore Game"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m6a"><text string="Priority"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m6b"><text string="Tournament"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m6bx"><text string="Book"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m7a"><text string="Flip Display"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m7b"><text string="Time Control"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m8a"><text string="Take Back"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_m8b"><text string="Analyze Games"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+
+ <element name="text_r1a"><text string="New Game"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r1b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r2a"><text string="Verify/Set Up"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r2b"><text string="Pro-Op Book/"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r2bx"><text string="Both Books"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r3a"><text string="Change Color"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r3b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r4a"><text string="Clear Board"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r4b"><text string="Delete Pro-Op"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r5a"><text string="Trace Forward"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r5b"><text string="AutoPlay"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r6a"><text string="Hint"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r6b"><text string="Next Best"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r7a"><text string="Set Level"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r7b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r8a"><text string="Go"><color red="0.51" green="0.5" blue="0.49" /></text></element>
+ <element name="text_r8b"><text string=" "><color red="0.51" green="0.5" blue="0.49" /></text></element>
+
+ <element name="text_king"><text string="&#x265a;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_queen"><text string="&#x265b;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_rook"><text string="&#x265c;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_bishop"><text string="&#x265d;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_knight"><text string="&#x265e;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+ <element name="text_pawn"><text string="&#x265f;"><color red="0.61" green="0.6" blue="0.59" /></text></element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-3" right="114" top="-2" bottom="89" />
+
+ <!-- chessboard coords -->
+
+ <bezel element="text_8"><bounds x="-0.8" y="7" width="2" height="2" /></bezel>
+ <bezel element="text_7"><bounds x="-0.8" y="17" width="2" height="2" /></bezel>
+ <bezel element="text_6"><bounds x="-0.8" y="27" width="2" height="2" /></bezel>
+ <bezel element="text_5"><bounds x="-0.8" y="37" width="2" height="2" /></bezel>
+ <bezel element="text_4"><bounds x="-0.8" y="47" width="2" height="2" /></bezel>
+ <bezel element="text_3"><bounds x="-0.8" y="57" width="2" height="2" /></bezel>
+ <bezel element="text_2"><bounds x="-0.8" y="67" width="2" height="2" /></bezel>
+ <bezel element="text_1"><bounds x="-0.8" y="77" width="2" height="2" /></bezel>
+
+ <bezel element="text_a"><bounds x="7" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_b"><bounds x="17" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_c"><bounds x="27" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_d"><bounds x="37" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_e"><bounds x="47" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_f"><bounds x="57" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_g"><bounds x="67" y="85" width="2" height="2" /></bezel>
+ <bezel element="text_h"><bounds x="77" y="85" width="2" height="2" /></bezel>
+
+ <!-- chessboard bezel -->
+
+ <bezel element="black"><bounds x="2" y="2" width="82" height="82" /></bezel>
+ <bezel element="white"><bounds x="3" y="3" width="80" height="80" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="33" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="53" y="2.5" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="73" y="2.5" width="10.5" height="10.5" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="13" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="13" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="13" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="13" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="23" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="23" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="33" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="33" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="33" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="33" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="43" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="43" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="53" width="10.5" height="10" /></bezel>
+ <bezel element="black"><bounds x="23" y="53" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="43" y="53" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="63" y="53" width="10" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="13" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="33" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="53" y="63" width="10" height="10" /></bezel>
+ <bezel element="black"><bounds x="73" y="63" width="10.5" height="10" /></bezel>
+
+ <bezel element="black"><bounds x="2.5" y="73" width="10.5" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="23" y="73" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="43" y="73" width="10" height="10.5" /></bezel>
+ <bezel element="black"><bounds x="63" y="73" width="10" height="10.5" /></bezel>
+
+ <!-- chessboard leds -->
+
+ <bezel name="7.7" element="led"><bounds x=" 3.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.6" element="led"><bounds x="13.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.5" element="led"><bounds x="23.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.4" element="led"><bounds x="33.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.3" element="led"><bounds x="43.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.2" element="led"><bounds x="53.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.1" element="led"><bounds x="63.2" y="11.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="7.0" element="led"><bounds x="73.2" y="11.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="6.7" element="led"><bounds x=" 3.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.6" element="led"><bounds x="13.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.5" element="led"><bounds x="23.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.4" element="led"><bounds x="33.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.3" element="led"><bounds x="43.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.2" element="led"><bounds x="53.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.1" element="led"><bounds x="63.2" y="21.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="6.0" element="led"><bounds x="73.2" y="21.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="5.7" element="led"><bounds x=" 3.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.6" element="led"><bounds x="13.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.5" element="led"><bounds x="23.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.4" element="led"><bounds x="33.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.3" element="led"><bounds x="43.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.2" element="led"><bounds x="53.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.1" element="led"><bounds x="63.2" y="31.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="5.0" element="led"><bounds x="73.2" y="31.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="4.7" element="led"><bounds x=" 3.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.6" element="led"><bounds x="13.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.5" element="led"><bounds x="23.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.4" element="led"><bounds x="33.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.3" element="led"><bounds x="43.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="53.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.1" element="led"><bounds x="63.2" y="41.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="4.0" element="led"><bounds x="73.2" y="41.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="3.7" element="led"><bounds x=" 3.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.6" element="led"><bounds x="13.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.5" element="led"><bounds x="23.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.4" element="led"><bounds x="33.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.3" element="led"><bounds x="43.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.2" element="led"><bounds x="53.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.1" element="led"><bounds x="63.2" y="51.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="3.0" element="led"><bounds x="73.2" y="51.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="2.7" element="led"><bounds x=" 3.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.6" element="led"><bounds x="13.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.5" element="led"><bounds x="23.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.4" element="led"><bounds x="33.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.3" element="led"><bounds x="43.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.2" element="led"><bounds x="53.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.1" element="led"><bounds x="63.2" y="61.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="2.0" element="led"><bounds x="73.2" y="61.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="1.7" element="led"><bounds x=" 3.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.6" element="led"><bounds x="13.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.5" element="led"><bounds x="23.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.4" element="led"><bounds x="33.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.3" element="led"><bounds x="43.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.2" element="led"><bounds x="53.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.1" element="led"><bounds x="63.2" y="71.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="1.0" element="led"><bounds x="73.2" y="71.3" width="1.5" height="1.5" /></bezel>
+
+ <bezel name="0.7" element="led"><bounds x=" 3.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.6" element="led"><bounds x="13.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.5" element="led"><bounds x="23.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.4" element="led"><bounds x="33.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.3" element="led"><bounds x="43.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.2" element="led"><bounds x="53.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.1" element="led"><bounds x="63.2" y="81.3" width="1.5" height="1.5" /></bezel>
+ <bezel name="0.0" element="led"><bounds x="73.2" y="81.3" width="1.5" height="1.5" /></bezel>
+
+ <!-- chessboard sensors -->
+
+ <bezel element="hl" inputtag="IN.7" inputmask="0x80"><bounds x="3" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x40"><bounds x="13" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x20"><bounds x="23" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x10"><bounds x="33" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x08"><bounds x="43" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x04"><bounds x="53" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x02"><bounds x="63" y="3" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.7" inputmask="0x01"><bounds x="73" y="3" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.6" inputmask="0x80"><bounds x="3" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x40"><bounds x="13" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x20"><bounds x="23" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x10"><bounds x="33" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x08"><bounds x="43" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x04"><bounds x="53" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x02"><bounds x="63" y="13" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.6" inputmask="0x01"><bounds x="73" y="13" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.5" inputmask="0x80"><bounds x="3" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x40"><bounds x="13" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x20"><bounds x="23" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x10"><bounds x="33" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x08"><bounds x="43" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x04"><bounds x="53" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x02"><bounds x="63" y="23" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.5" inputmask="0x01"><bounds x="73" y="23" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.4" inputmask="0x80"><bounds x="3" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x40"><bounds x="13" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x20"><bounds x="23" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x10"><bounds x="33" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x08"><bounds x="43" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x04"><bounds x="53" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x02"><bounds x="63" y="33" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.4" inputmask="0x01"><bounds x="73" y="33" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.3" inputmask="0x80"><bounds x="3" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x40"><bounds x="13" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x20"><bounds x="23" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x10"><bounds x="33" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x08"><bounds x="43" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x04"><bounds x="53" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x02"><bounds x="63" y="43" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.3" inputmask="0x01"><bounds x="73" y="43" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.2" inputmask="0x80"><bounds x="3" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x40"><bounds x="13" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x20"><bounds x="23" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x10"><bounds x="33" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x08"><bounds x="43" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x04"><bounds x="53" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x02"><bounds x="63" y="53" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.2" inputmask="0x01"><bounds x="73" y="53" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <bezel element="hl" inputtag="IN.1" inputmask="0x80"><bounds x="3" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x40"><bounds x="13" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x20"><bounds x="23" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x10"><bounds x="33" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x08"><bounds x="43" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x04"><bounds x="53" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x02"><bounds x="63" y="63" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.1" inputmask="0x01"><bounds x="73" y="63" width="10" height="10" /><color alpha="0.2" /></bezel>
+
+ <bezel element="hl" inputtag="IN.0" inputmask="0x80"><bounds x="3" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x40"><bounds x="13" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x20"><bounds x="23" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x10"><bounds x="33" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x08"><bounds x="43" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x04"><bounds x="53" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x02"><bounds x="63" y="73" width="10" height="10" /><color alpha="0.2" /></bezel>
+ <bezel element="hl" inputtag="IN.0" inputmask="0x01"><bounds x="73" y="73" width="10" height="10" /><color alpha="0.4" /></bezel>
+
+ <!-- lcd panel -->
+<!--
+ <screen index="0">
+ <bounds x="86.5" y="9.5" width="24.25" height="2.5" />
+ </screen>
+
+ <bezel element="static_lcd"><bounds x="86" y="8.5" width="25.25" height="1.1" /></bezel>
+ <bezel element="static_lcd"><bounds x="86" y="11.9" width="25.25" height="1.1" /></bezel>
+ <bezel element="static_lcd"><bounds x="86" y="8.5" width="0.6" height="3.5" /></bezel>
+ <bezel element="static_lcd"><bounds x="110.65" y="8.5" width="0.6" height="3.5" /></bezel>
+-->
+ <!-- right side buttons -->
+
+ <bezel element="but" inputtag="IN.7" inputmask="0x400"><bounds x="87.75" y="24.00" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.6" inputmask="0x400"><bounds x="87.75" y="31.71" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.5" inputmask="0x400"><bounds x="87.75" y="39.43" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.4" inputmask="0x400"><bounds x="87.75" y="47.14" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.3" inputmask="0x400"><bounds x="87.75" y="54.86" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.2" inputmask="0x400"><bounds x="87.75" y="62.57" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.1" inputmask="0x400"><bounds x="87.75" y="70.29" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.0" inputmask="0x400"><bounds x="87.75" y="78.00" width="2.5" height="2.5" /></bezel>
+
+ <bezel element="but" inputtag="IN.7" inputmask="0x200"><bounds x="97.38" y="24.00" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.6" inputmask="0x200"><bounds x="97.38" y="31.71" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.5" inputmask="0x200"><bounds x="97.38" y="39.43" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.4" inputmask="0x200"><bounds x="97.38" y="47.14" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.3" inputmask="0x200"><bounds x="97.38" y="54.86" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.2" inputmask="0x200"><bounds x="97.38" y="62.57" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.1" inputmask="0x200"><bounds x="97.38" y="70.29" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.0" inputmask="0x200"><bounds x="97.38" y="78.00" width="2.5" height="2.5" /></bezel>
+
+ <bezel element="but" inputtag="IN.7" inputmask="0x100"><bounds x="107.00" y="24.00" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.6" inputmask="0x100"><bounds x="107.00" y="31.71" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.5" inputmask="0x100"><bounds x="107.00" y="39.43" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.4" inputmask="0x100"><bounds x="107.00" y="47.14" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.3" inputmask="0x100"><bounds x="107.00" y="54.86" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.2" inputmask="0x100"><bounds x="107.00" y="62.57" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.1" inputmask="0x100"><bounds x="107.00" y="70.29" width="2.5" height="2.5" /></bezel>
+ <bezel element="but" inputtag="IN.0" inputmask="0x100"><bounds x="107.00" y="78.00" width="2.5" height="2.5" /></bezel>
+
+ <bezel element="text_king"><bounds x="100.38" y="23.50" width="3" height="3" /></bezel>
+ <bezel element="text_queen"><bounds x="100.38" y="31.21" width="3" height="3" /></bezel>
+ <bezel element="text_bishop"><bounds x="100.38" y="38.93" width="3" height="3" /></bezel>
+ <bezel element="text_knight"><bounds x="100.38" y="46.64" width="3" height="3" /></bezel>
+ <bezel element="text_rook"><bounds x="100.38" y="54.36" width="3" height="3" /></bezel>
+ <bezel element="text_pawn"><bounds x="100.38" y="62.07" width="3" height="3" /></bezel>
+
+ <bezel element="text_l1a"><bounds x="82" y="22.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_l1b"><bounds x="82" y="26.70" width="14" height="1.4" /></bezel>
+ <bezel element="text_l2a"><bounds x="82" y="30.06" width="14" height="1.4" /></bezel>
+ <bezel element="text_l2b"><bounds x="82" y="34.41" width="14" height="1.4" /></bezel>
+ <bezel element="text_l3a"><bounds x="82" y="37.78" width="14" height="1.4" /></bezel>
+ <bezel element="text_l3b"><bounds x="82" y="42.13" width="14" height="1.4" /></bezel>
+ <bezel element="text_l3bx"><bounds x="82" y="43.53" width="14" height="1.4" /></bezel>
+ <bezel element="text_l4a"><bounds x="82" y="45.49" width="14" height="1.4" /></bezel>
+ <bezel element="text_l4b"><bounds x="82" y="49.84" width="14" height="1.4" /></bezel>
+ <bezel element="text_l5a"><bounds x="82" y="53.21" width="14" height="1.4" /></bezel>
+ <bezel element="text_l5b"><bounds x="82" y="57.56" width="14" height="1.4" /></bezel>
+ <bezel element="text_l6a"><bounds x="82" y="60.92" width="14" height="1.4" /></bezel>
+ <bezel element="text_l6b"><bounds x="82" y="65.27" width="14" height="1.4" /></bezel>
+ <bezel element="text_l7a"><bounds x="82" y="68.64" width="14" height="1.4" /></bezel>
+ <bezel element="text_l7b"><bounds x="82" y="72.99" width="14" height="1.4" /></bezel>
+ <bezel element="text_l8a"><bounds x="82" y="76.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_l8b"><bounds x="82" y="80.70" width="14" height="1.4" /></bezel>
+
+ <bezel element="text_m1ax"><bounds x="91.63" y="20.95" width="14" height="1.4" /></bezel>
+ <bezel element="text_m1a"><bounds x="91.63" y="22.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_m1b"><bounds x="91.63" y="26.70" width="14" height="1.4" /></bezel>
+ <bezel element="text_m2a"><bounds x="91.63" y="30.06" width="14" height="1.4" /></bezel>
+ <bezel element="text_m2b"><bounds x="91.63" y="34.41" width="14" height="1.4" /></bezel>
+ <bezel element="text_m3a"><bounds x="91.63" y="37.78" width="14" height="1.4" /></bezel>
+ <bezel element="text_m3b"><bounds x="91.63" y="42.13" width="14" height="1.4" /></bezel>
+ <bezel element="text_m4ax"><bounds x="91.63" y="44.09" width="14" height="1.4" /></bezel>
+ <bezel element="text_m4a"><bounds x="91.63" y="45.49" width="14" height="1.4" /></bezel>
+ <bezel element="text_m4b"><bounds x="91.63" y="49.84" width="14" height="1.4" /></bezel>
+ <bezel element="text_m5a"><bounds x="91.63" y="53.21" width="14" height="1.4" /></bezel>
+ <bezel element="text_m5b"><bounds x="91.63" y="57.56" width="14" height="1.4" /></bezel>
+ <bezel element="text_m6a"><bounds x="91.63" y="60.92" width="14" height="1.4" /></bezel>
+ <bezel element="text_m6b"><bounds x="91.63" y="65.27" width="14" height="1.4" /></bezel>
+ <bezel element="text_m6bx"><bounds x="91.63" y="66.67" width="14" height="1.4" /></bezel>
+ <bezel element="text_m7a"><bounds x="91.63" y="68.64" width="14" height="1.4" /></bezel>
+ <bezel element="text_m7b"><bounds x="91.63" y="72.99" width="14" height="1.4" /></bezel>
+ <bezel element="text_m8a"><bounds x="91.63" y="76.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_m8b"><bounds x="91.63" y="80.70" width="14" height="1.4" /></bezel>
+
+ <bezel element="text_r1a"><bounds x="101.25" y="22.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_r1b"><bounds x="101.25" y="26.70" width="14" height="1.4" /></bezel>
+ <bezel element="text_r2a"><bounds x="101.25" y="30.06" width="14" height="1.4" /></bezel>
+ <bezel element="text_r2b"><bounds x="101.25" y="34.41" width="14" height="1.4" /></bezel>
+ <bezel element="text_r2bx"><bounds x="101.25" y="35.81" width="14" height="1.4" /></bezel>
+ <bezel element="text_r3a"><bounds x="101.25" y="37.78" width="14" height="1.4" /></bezel>
+ <bezel element="text_r3b"><bounds x="101.25" y="42.13" width="14" height="1.4" /></bezel>
+ <bezel element="text_r4a"><bounds x="101.25" y="45.49" width="14" height="1.4" /></bezel>
+ <bezel element="text_r4b"><bounds x="101.25" y="49.84" width="14" height="1.4" /></bezel>
+ <bezel element="text_r5a"><bounds x="101.25" y="53.21" width="14" height="1.4" /></bezel>
+ <bezel element="text_r5b"><bounds x="101.25" y="57.56" width="14" height="1.4" /></bezel>
+ <bezel element="text_r6a"><bounds x="101.25" y="60.92" width="14" height="1.4" /></bezel>
+ <bezel element="text_r6b"><bounds x="101.25" y="65.27" width="14" height="1.4" /></bezel>
+ <bezel element="text_r7a"><bounds x="101.25" y="68.64" width="14" height="1.4" /></bezel>
+ <bezel element="text_r7b"><bounds x="101.25" y="72.99" width="14" height="1.4" /></bezel>
+ <bezel element="text_r8a"><bounds x="101.25" y="76.35" width="14" height="1.4" /></bezel>
+ <bezel element="text_r8b"><bounds x="101.25" y="80.70" width="14" height="1.4" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/machine/alpha8201.cpp b/src/mame/machine/alpha8201.cpp
index 852d4eaadd0..1acaf966405 100644
--- a/src/mame/machine/alpha8201.cpp
+++ b/src/mame/machine/alpha8201.cpp
@@ -282,7 +282,7 @@ const device_type ALPHA_8201 = &device_creator<alpha_8201_device>;
// alpha_8201_device - constructor
//-------------------------------------------------
-alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, ALPHA_8201, "ALPHA-8201", tag, owner, clock, "alpha8201", __FILE__),
m_mcu(*this, "mcu")
{
@@ -295,7 +295,7 @@ alpha_8201_device::alpha_8201_device(const machine_config &mconfig, const char *
void alpha_8201_device::device_start()
{
- m_shared_ram = make_unique_clear<uint8_t[]>(0x400);
+ m_shared_ram = make_unique_clear<u8[]>(0x400);
// zerofill
m_bus = 0;
@@ -364,7 +364,7 @@ void alpha_8201_device::mcu_update_address()
READ8_MEMBER(alpha_8201_device::mcu_data_r)
{
- uint8_t ret = 0;
+ u8 ret = 0;
if (m_bus && ~m_mcu_d & 4)
ret = m_shared_ram[m_mcu_address];
diff --git a/src/mame/machine/alpha8201.h b/src/mame/machine/alpha8201.h
index 241a6d1c3bb..9d13dba6d96 100644
--- a/src/mame/machine/alpha8201.h
+++ b/src/mame/machine/alpha8201.h
@@ -14,7 +14,7 @@
class alpha_8201_device : public device_t
{
public:
- alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ alpha_8201_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
~alpha_8201_device() {}
DECLARE_READ8_MEMBER(mcu_data_r);
@@ -38,11 +38,11 @@ private:
required_device<cpu_device> m_mcu;
// internal state
- int m_bus; // shared RAM bus direction
- uint16_t m_mcu_address; // MCU side RAM address
- uint16_t m_mcu_d; // MCU D output data
- uint8_t m_mcu_r[4]; // MCU R0-R3 output data
- std::unique_ptr<uint8_t[]> m_shared_ram; // 1KB RAM
+ int m_bus; // shared RAM bus direction
+ u16 m_mcu_address; // MCU side RAM address
+ u16 m_mcu_d; // MCU D output data
+ u8 m_mcu_r[4]; // MCU R0-R3 output data
+ std::unique_ptr<u8[]> m_shared_ram; // 1KB RAM
void mcu_update_address();
void mcu_writeram();
diff --git a/src/mame/machine/nl_pongd.cpp b/src/mame/machine/nl_pongd.cpp
index 545b7a1c5f5..e04fb89e304 100644
--- a/src/mame/machine/nl_pongd.cpp
+++ b/src/mame/machine/nl_pongd.cpp
@@ -87,6 +87,7 @@ CIRCUIT_LAYOUT( pongdoubles )
ANALOG_INPUT(V5, 5)
#define VCC "V5", Q
+#undef GND
#define GND "GND", Q
CHIP("F9", 7493)
diff --git a/src/mame/machine/tigeroad.cpp b/src/mame/machine/tigeroad.cpp
index d19b4e11dba..d433c60f52c 100644
--- a/src/mame/machine/tigeroad.cpp
+++ b/src/mame/machine/tigeroad.cpp
@@ -124,91 +124,105 @@ WRITE16_MEMBER(tigeroad_state::f1dream_control_w)
}
-READ16_MEMBER(tigeroad_state::pushman_68705_r)
+READ16_MEMBER(pushman_state::mcu_comm_r)
{
- if (offset == 0)
- return m_latch;
-
- if (offset == 3 && m_new_latch)
+ switch (offset & 0x03)
{
- m_new_latch = 0;
- return 0;
+ case 0: // read and acknowledge MCU reply
+ if (!space.debugger_access())
+ m_mcu_semaphore = false;
+ return m_mcu_latch;
+ case 2: // expects bit 0 to be high when MCU has accepted command (other bits ignored)
+ return m_host_semaphore ? 0x0000 : 0x0001;
+ case 3: // expects bit 0 to be low when MCU has sent response (other bits ignored)
+ return m_mcu_semaphore ? 0x0000 : 0x0001;
}
- if (offset == 3 && !m_new_latch)
- return 0xff;
-
- return (m_shared_ram[2 * offset + 1] << 8) + m_shared_ram[2 * offset];
+ logerror("unknown MCU read offset %X & %04X\n", offset, mem_mask);
+ return 0x0000;
}
-WRITE16_MEMBER(tigeroad_state::pushman_68705_w)
+WRITE16_MEMBER(pushman_state::mcu_comm_w)
{
- if (ACCESSING_BITS_8_15)
- m_shared_ram[2 * offset] = data >> 8;
- if (ACCESSING_BITS_0_7)
- m_shared_ram[2 * offset + 1] = data & 0xff;
-
- if (offset == 1)
+ switch (offset & 0x01)
{
- m_mcu->set_input_line(M68705_IRQ_LINE, HOLD_LINE);
- space.device().execute().spin();
- m_new_latch = 0;
+ case 0:
+ COMBINE_DATA(&m_host_latch);
+ break;
+ case 1:
+ m_mcu->pd_w(space, 0, data & 0x00ff);
+ m_host_semaphore = true;
+ m_mcu->set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
+ break;
}
}
-/* ElSemi - Bouncing balls protection. */
-READ16_MEMBER(tigeroad_state::bballs_68705_r)
+WRITE8_MEMBER(pushman_state::mcu_pa_w)
{
- if (offset == 0)
- return m_latch;
- if (offset == 3 && m_new_latch)
- {
- m_new_latch = 0;
- return 0;
- }
- if (offset == 3 && !m_new_latch)
- return 0xff;
+ m_mcu_output = (m_mcu_output & 0xff00) | (u16(data) & 0x00ff);
+}
- return (m_shared_ram[2 * offset + 1] << 8) + m_shared_ram[2 * offset];
+WRITE8_MEMBER(pushman_state::mcu_pb_w)
+{
+ m_mcu_output = (m_mcu_output & 0x00ff) | (u16(data) << 8);
}
-WRITE16_MEMBER(tigeroad_state::bballs_68705_w)
+WRITE8_MEMBER(pushman_state::mcu_pc_w)
{
- if (ACCESSING_BITS_8_15)
- m_shared_ram[2 * offset] = data >> 8;
- if (ACCESSING_BITS_0_7)
- m_shared_ram[2 * offset + 1] = data & 0xff;
+ if (BIT(data, 0))
+ {
+ m_mcu->pa_w(space, 0, 0xff);
+ m_mcu->pb_w(space, 0, 0xff);
+ }
+ else
+ {
+ m_host_semaphore = false;
+ m_mcu->set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
+ m_mcu->pa_w(space, 0, (m_host_latch >> 8) & 0x00ff);
+ m_mcu->pb_w(space, 0, (m_host_latch >> 0) & 0x00ff);
+ }
- if (offset == 0)
+ if (BIT(m_mcu_latch_ctl, 1) && !BIT(data, 1))
{
- m_latch = 0;
- if (m_shared_ram[0] <= 0xf)
- {
- m_latch = m_shared_ram[0] << 2;
- if (m_shared_ram[1])
- m_latch |= 2;
- m_new_latch = 1;
- }
- else if (m_shared_ram[0])
- {
- if (m_shared_ram[1])
- m_latch |= 2;
- m_new_latch = 1;
- }
+ m_mcu_latch = m_mcu_output & (BIT(m_mcu_latch_ctl, 0) ? 0xffff : m_host_latch);
+ m_mcu_semaphore = true;
}
+
+ m_mcu_latch_ctl = data;
}
-READ8_MEMBER(tigeroad_state::pushman_68000_r)
+/* ElSemi - Bouncing balls protection. */
+READ16_MEMBER(bballs_state::bballs_68705_r)
{
- return m_shared_ram[offset];
+ switch (offset)
+ {
+ case 0: // read and acknowledge MCU reply
+ if (!space.debugger_access())
+ m_mcu_semaphore = false;
+ return m_mcu_latch;
+ case 2: // pretend MCU accepts command instantly
+ return 0x0001;
+ case 3: // expects bit 0 to be low when MCU has sent response (other bits ignored)
+ return m_mcu_semaphore ? 0x0000 : 0x0001;
+ }
+ logerror("unknown 68705 read offset %X & %04X\n", offset, mem_mask);
+ return 0x0000;
}
-WRITE8_MEMBER(tigeroad_state::pushman_68000_w)
+WRITE16_MEMBER(bballs_state::bballs_68705_w)
{
- if (offset == 2 && (m_shared_ram[2] & 2) == 0 && data & 2)
+ m_mcu_latch = 0;
+ if ((data >> 8) <= 0x0f)
+ {
+ m_mcu_latch = (data >> 6) & 0x03fc;
+ if (data & 0x00ff)
+ m_mcu_latch |= 2;
+ m_mcu_semaphore = true;
+ }
+ else if (data >> 8)
{
- m_latch = (m_shared_ram[1] << 8) | m_shared_ram[0];
- m_new_latch = 1;
+ if (data & 0x00ff)
+ m_mcu_latch |= 2;
+ m_mcu_semaphore = true;
}
- m_shared_ram[offset] = data;
}
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 0e4f922f41d..814e9ed6883 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -14201,6 +14201,7 @@ funjacks // Mattel
funrlgl // Mattel
h2hbaskb // Coleco
lightfgt // Milton Bradley
+mdallas // Mattel
plus1 // Milton Bradley
qkracer // National Semiconductor
@@ -20497,7 +20498,6 @@ alm16 // 1988 Mephisto Almeria 68000
alm32 // 1988 Mephisto Alimera 68020
berlinp // 1994 Mephisto Berlin Pro 68020
bpl32 // 1996 Mephisto Berlin Pro London Upgrade V5.00
-diablo68 // 1991 Novag Diablo 68000 Chess Computer
gen32 // 1993 Mephisto Genius030 V4.00
gen32_41 // 1993 Mephisto Genius030 V4.01
lond020 // 1996 Mephisto London 68020 32 Bit
@@ -28487,7 +28487,8 @@ wccf331e // 2005.06 World Club Champion Football European
wccf420e // 2006.08 World Club Champion Football European Clubs 2005-2006
wldkicks // 2000.03 World Kicks (US, WK3 Ver.A)
wldkicksa // 2000.03 World Kicks (Asia, WK2 Ver.A)
-wldkicksj // 2000.03 World Kicks PCB (Japan, WKC1 Ver.A)
+wldkicksj // 2000.03 World Kicks (Japan, WK1 Ver.A)
+wldkickspj // 2000.03 World Kicks PCB (Japan, WKC1 Ver.A)
wldrider // 2001.05 Wild Riders
wrungp // 2001.08 Wave Runner GP
wrungpo // 2001.?? Wave Runner GP (USA, Rev A)
@@ -29220,6 +29221,9 @@ sforteb //
sfortec //
supercon //
+@source:novag68k.cpp
+diablo68 //
+
@source:nsm.cpp
firebird //
diff --git a/src/mame/mess.flt b/src/mame/mess.flt
index 66b57c88741..7864f2ec890 100644
--- a/src/mame/mess.flt
+++ b/src/mame/mess.flt
@@ -398,6 +398,7 @@ ngp.cpp
nokia_3310.cpp
notetaker.cpp
novag6502.cpp
+novag68k.cpp
ob68k1a.cpp
octopus.cpp
odyssey2.cpp
diff --git a/src/mame/video/goldstar.cpp b/src/mame/video/goldstar.cpp
index b3b57f5f280..f7c4477e57e 100644
--- a/src/mame/video/goldstar.cpp
+++ b/src/mame/video/goldstar.cpp
@@ -466,6 +466,39 @@ uint32_t wingco_state::screen_update_magical(screen_device &screen, bitmap_ind16
}
+uint32_t wingco_state::screen_update_mbstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ bitmap.fill(m_palette->black_pen(), cliprect);
+
+ if (!(m_cm_enable_reg & 0x01))
+ return 0;
+
+ if (m_cm_enable_reg & 0x08)
+ {
+ for (int i = 0; i < 64; i++)
+ {
+ m_reel1_tilemap->set_scrolly(i, m_reel1_scroll[i]);
+ m_reel2_tilemap->set_scrolly(i, m_reel2_scroll[i]);
+ m_reel3_tilemap->set_scrolly(i, m_reel3_scroll[i]);
+ }
+
+ // are these hardcoded, or registers?
+ const rectangle visible1(0*8, (14+48)*8-1, 4*8, (4+7)*8-1);
+ const rectangle visible2(0*8, (14+48)*8-1, 14*8, (36+7)*8-1); // seems to be the one used...
+ const rectangle visible3(0*8, (14+48)*8-1, 4*8, (4+7)*8-1);
+
+// m_reel1_tilemap->draw(screen, bitmap, visible1, 0, 0);
+ m_reel2_tilemap->draw(screen, bitmap, visible2, 0, 0);
+// m_reel3_tilemap->draw(screen, bitmap, visible3, 0, 0);
+ }
+
+ if (m_cm_enable_reg & 0x02)
+ m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+
+ return 0;
+}
+
+
WRITE8_MEMBER(sanghopm_state::fg_vidram_w)
{
diff --git a/src/tools/imgtool/formats/coco_dsk.cpp b/src/tools/imgtool/formats/coco_dsk.cpp
index 5e4a855e3f3..6f509c92767 100644
--- a/src/tools/imgtool/formats/coco_dsk.cpp
+++ b/src/tools/imgtool/formats/coco_dsk.cpp
@@ -723,7 +723,6 @@ static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, in
uint8_t *track_data;
void *track_data_v;
uint32_t max_track_size;
- std::vector<int> sector_map;
sectors = params->lookup_int(PARAM_SECTORS);
sector_length = params->lookup_int(PARAM_SECTOR_LENGTH);
@@ -733,24 +732,18 @@ static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, in
max_track_size = get_dmk_tag(floppy)->track_size;
if (sectors > DMK_TOC_LEN)
- {
- err = FLOPPY_ERROR_INTERNAL;
- goto done;
- }
+ return FLOPPY_ERROR_INTERNAL;
if (max_track_size < coco_dmk_min_track_size(sectors, sector_length))
- {
- err = FLOPPY_ERROR_NOSPACE;
- goto done;
- }
+ return FLOPPY_ERROR_NOSPACE;
err = floppy_load_track(floppy, head, track, true, &track_data_v, NULL);
if (err)
- goto done;
+ return err;
track_data = (uint8_t *) track_data_v;
- /* set up sector map */
- memset(&sector_map[0], 0xff, sectors*sizeof(int));
+ // set up sector map
+ std::vector<int> sector_map(sectors, -1);
physical_sector = 0;
for (logical_sector = 0; logical_sector < sectors; logical_sector++)
@@ -766,22 +759,22 @@ static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, in
physical_sector %= sectors;
}
- /* set up track table of contents */
+ // set up track table of contents
physical_sector = 0;
track_position = DMK_TOC_LEN * 2 + DMK_LEAD_IN;
while(physical_sector < DMK_TOC_LEN)
{
if (physical_sector >= sectors)
{
- /* no more sectors */
+ // no more sectors
idam_offset = 0;
}
else
{
- /* this is a sector */
+ // this is a sector
logical_sector = sector_map[physical_sector];
- /* write the sector */
+ // write the sector
memset(&track_data[track_position], 0x00, 8);
track_position += 8;
@@ -807,7 +800,7 @@ static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, in
memset(&track_data[track_position], 0xA1, 3);
track_position += 3;
- /* write sector body */
+ // write sector body
track_data[track_position] = 0xFB;
memset(&track_data[track_position + 1], floppy_get_filler(floppy), sector_length);
crc = ccitt_crc16(0xcdb4, &track_data[track_position], sector_length + 1);
@@ -815,27 +808,26 @@ static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, in
track_data[track_position + sector_length + 2] = (uint8_t) (crc >> 0);
track_position += sector_length + 3;
- /* write sector footer */
+ // write sector footer
memset(&track_data[track_position], 0x4E, 24);
track_position += 24;
}
- /* write the TOC entry */
+ // write the TOC entry
track_data[physical_sector * 2 + 0] = (uint8_t) (idam_offset >> 0);
track_data[physical_sector * 2 + 1] = (uint8_t) (idam_offset >> 8);
physical_sector++;
}
- /* write track lead in */
+ // write track lead in
memset(&track_data[physical_sector * 2], 0x4e, DMK_LEAD_IN);
- /* write track footer */
+ // write track footer
assert(max_track_size >= (uint32_t)track_position);
memset(&track_data[track_position], 0x4e, max_track_size - track_position);
-done:
- return err;
+ return FLOPPY_ERROR_SUCCESS;
}
diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp
index 28029fe0358..895f96145b1 100644
--- a/src/tools/imgtool/main.cpp
+++ b/src/tools/imgtool/main.cpp
@@ -245,7 +245,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
L"%*s %*s %*s %*s\n",
-columnwidth_filename, wstring_from_utf8(ent.filename),
columnwidth_filesize, wstring_from_utf8(filesize_string),
- columnwidth_attributes, ent.attr,
+ columnwidth_attributes, wstring_from_utf8(ent.attr),
columnwidth_lastmodified, wstring_from_utf8(last_modified));
if (ent.softlink && ent.softlink[0] != '\0')
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index 2c6e58a0f74..e1667a9b9e7 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -83,6 +83,7 @@ CPU_DISASSEMBLE( coldfire );
CPU_DISASSEMBLE( cop410 );
CPU_DISASSEMBLE( cop420 );
CPU_DISASSEMBLE( cop444 );
+CPU_DISASSEMBLE( cop424 );
CPU_DISASSEMBLE( cp1610 );
CPU_DISASSEMBLE( cquestlin );
CPU_DISASSEMBLE( cquestrot );
@@ -251,6 +252,7 @@ static const dasm_table_entry dasm_table[] =
{ "cop410", _8bit, 0, CPU_DISASSEMBLE_NAME(cop410) },
{ "cop420", _8bit, 0, CPU_DISASSEMBLE_NAME(cop420) },
{ "cop444", _8bit, 0, CPU_DISASSEMBLE_NAME(cop444) },
+ { "cop424", _8bit, 0, CPU_DISASSEMBLE_NAME(cop424) },
{ "cp1610", _16be, -1, CPU_DISASSEMBLE_NAME(cp1610) },
{ "cquestlin", _64be, -3, CPU_DISASSEMBLE_NAME(cquestlin) },
{ "cquestrot", _64be, -3, CPU_DISASSEMBLE_NAME(cquestrot) },