mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
added novag base class (nw)
This commit is contained in:
parent
af0805d848
commit
b72848be49
@ -2379,6 +2379,7 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/mk1.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/mk2.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/novag6502.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/novagbase.h",
|
||||
MAME_DIR .. "src/mame/drivers/ssystem3.cpp",
|
||||
MAME_DIR .. "src/mame/includes/ssystem3.h",
|
||||
MAME_DIR .. "src/mame/video/ssystem3.cpp",
|
||||
|
@ -383,7 +383,6 @@ I/O is via TTL, very similar to Designer Display
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/fidelbase.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "cpu/m6502/r65c02.h"
|
||||
@ -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(fidelbase_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))
|
||||
@ -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(fidelbase_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))
|
||||
@ -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(fidelbase_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
|
||||
|
@ -153,7 +153,6 @@ B0000x-xxxxxx: see V7, -800000
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/fidelbase.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/ram.h"
|
||||
@ -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(fidelbase_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
|
||||
|
@ -489,7 +489,6 @@ expect that the software reads these once on startup only.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/fidelbase.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
@ -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(fidelbase_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))
|
||||
|
@ -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
|
||||
u16 m_inp_mux; // multiplexed keypad mask
|
||||
u16 m_led_select;
|
||||
u16 m_led_data;
|
||||
|
||||
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)
|
||||
|
||||
u8 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(u32 digits, u32 mask);
|
||||
void display_matrix(int maxx, int maxy, u32 setx, u32 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,7 +152,7 @@ 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()
|
||||
{
|
||||
u32 active_state[0x20];
|
||||
|
||||
@ -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(u32 digits, u32 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,7 +233,7 @@ void novag6502_state::set_display_segmask(u32 digits, u32 mask)
|
||||
}
|
||||
}
|
||||
|
||||
void novag6502_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
|
||||
void novagbase_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, bool update)
|
||||
{
|
||||
set_display_size(maxx, maxy);
|
||||
|
||||
@ -287,7 +249,7 @@ void novag6502_state::display_matrix(int maxx, int maxy, u32 setx, u32 sety, boo
|
||||
|
||||
// generic input handlers
|
||||
|
||||
u16 novag6502_state::read_inputs(int columns)
|
||||
u16 novagbase_state::read_inputs(int columns)
|
||||
{
|
||||
u16 ret = 0;
|
||||
|
||||
@ -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)
|
||||
@ -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 */
|
||||
|
57
src/mame/includes/novagbase.h
Normal file
57
src/mame/includes/novagbase.h
Normal file
@ -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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user