mirror of
https://github.com/holub/mame
synced 2025-07-01 00:09:18 +03:00
saitek_corona: add IO 2/2 (nw)
This commit is contained in:
parent
360b6bf9d1
commit
f2ae7d8207
@ -3169,7 +3169,7 @@ static INPUT_PORTS_START( gnw_bsweep )
|
||||
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
|
||||
|
||||
PORT_START("B")
|
||||
PORT_CONFNAME( 0x01, 0x01, "Level skip (Cheat)") // " -- Controller keys skips level when activated
|
||||
PORT_CONFNAME( 0x01, 0x01, "Level Skip (Cheat)") // " -- Controller keys skips level when activated
|
||||
PORT_CONFSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
@ -3323,7 +3323,7 @@ ROM_END
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Nintendo Game & Watch: Gold Cliff (model MV-64)
|
||||
Nintendo Game & Watch: Gold Cliff (model MV-64)
|
||||
* PCB label MV-64
|
||||
* Sharp SM512 label MV-64 9027 A (no decap)
|
||||
* vertical dual lcd screens with custom segments, 1-bit sound
|
||||
@ -3368,7 +3368,7 @@ static INPUT_PORTS_START( gnw_gcliff )
|
||||
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
|
||||
|
||||
PORT_START("B")
|
||||
PORT_CONFNAME( 0x01, 0x01, "Level skip (Cheat)") // " -- Left or right skips level when activated
|
||||
PORT_CONFNAME( 0x01, 0x01, "Level Skip (Cheat)") // " -- Left or right skips level when activated
|
||||
PORT_CONFSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_CONFSETTING( 0x00, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
@ -2,8 +2,7 @@
|
||||
// copyright-holders:hap
|
||||
/***************************************************************************
|
||||
|
||||
Saitek Corona. This is a subclass of saitek_stratos_state.
|
||||
Please refer to saitek_stratos.cpp for driver notes.
|
||||
Saitek Corona. Please refer to saitek_stratos.cpp for driver notes.
|
||||
|
||||
To be brief, Saitek Corona has two "HELIOS" chips, I/O addressing is completely
|
||||
different compared to Stratos/Turbo King.
|
||||
@ -14,6 +13,7 @@ different compared to Stratos/Turbo King.
|
||||
#include "includes/saitek_stratos.h"
|
||||
|
||||
#include "cpu/m6502/m65c02.h"
|
||||
#include "machine/bankdev.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/sensorboard.h"
|
||||
#include "sound/dac.h"
|
||||
@ -26,13 +26,19 @@ different compared to Stratos/Turbo King.
|
||||
#include "saitek_corona.lh" // clickable
|
||||
|
||||
|
||||
class saitek_corona_state : public saitek_stratos_state
|
||||
namespace {
|
||||
|
||||
// note: sub-class of saitek_stratos_state (see mame/includes/saitek_stratos.h, mame/drivers/saitek_stratos.cpp)
|
||||
|
||||
class corona_state : public saitek_stratos_state
|
||||
{
|
||||
public:
|
||||
saitek_corona_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
corona_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
saitek_stratos_state(mconfig, type, tag),
|
||||
m_rombank(*this, "rombank"),
|
||||
m_board(*this, "board"),
|
||||
m_dac(*this, "dac")
|
||||
m_dac(*this, "dac"),
|
||||
m_inputs(*this, "IN.%u", 0)
|
||||
{ }
|
||||
|
||||
// machine drivers
|
||||
@ -44,20 +50,60 @@ protected:
|
||||
|
||||
private:
|
||||
// devices/pointers
|
||||
required_device<address_map_bank_device> m_rombank;
|
||||
required_device<sensorboard_device> m_board;
|
||||
required_device<dac_bit_interface> m_dac;
|
||||
required_ioport_array<8+1> m_inputs;
|
||||
|
||||
void main_map(address_map &map);
|
||||
void rombank_map(address_map &map);
|
||||
|
||||
// I/O handlers
|
||||
void update_leds();
|
||||
DECLARE_WRITE8_MEMBER(leds1_w);
|
||||
DECLARE_WRITE8_MEMBER(leds2_w);
|
||||
DECLARE_WRITE8_MEMBER(select1_w);
|
||||
DECLARE_WRITE8_MEMBER(select2_w);
|
||||
DECLARE_WRITE8_MEMBER(control1_w);
|
||||
DECLARE_WRITE8_MEMBER(control2_w);
|
||||
DECLARE_READ8_MEMBER(control1_r);
|
||||
DECLARE_READ8_MEMBER(control2_r);
|
||||
DECLARE_READ8_MEMBER(chessboard_r);
|
||||
|
||||
u8 m_control1;
|
||||
u8 m_control2;
|
||||
u8 m_select1;
|
||||
u8 m_select2;
|
||||
u8 m_led_data1;
|
||||
u8 m_led_data2;
|
||||
};
|
||||
|
||||
void saitek_corona_state::machine_start()
|
||||
void corona_state::machine_start()
|
||||
{
|
||||
saitek_stratos_state::machine_start();
|
||||
|
||||
// zerofill
|
||||
m_control1 = 0;
|
||||
m_control2 = 0;
|
||||
m_select1 = 0;
|
||||
m_select2 = 0;
|
||||
m_led_data1 = 0;
|
||||
m_led_data2 = 0;
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_control1));
|
||||
save_item(NAME(m_control2));
|
||||
save_item(NAME(m_select1));
|
||||
save_item(NAME(m_select2));
|
||||
save_item(NAME(m_led_data1));
|
||||
save_item(NAME(m_led_data2));
|
||||
}
|
||||
|
||||
void saitek_corona_state::machine_reset()
|
||||
void corona_state::machine_reset()
|
||||
{
|
||||
saitek_stratos_state::machine_reset();
|
||||
|
||||
m_rombank->set_bank(0);
|
||||
}
|
||||
|
||||
|
||||
@ -68,15 +114,129 @@ void saitek_corona_state::machine_reset()
|
||||
|
||||
// HELIOS
|
||||
|
||||
void corona_state::update_leds()
|
||||
{
|
||||
// button leds
|
||||
m_display->matrix_partial(0, 2, 1 << (m_control1 >> 5 & 1), (~m_led_data1 & 0xff), false);
|
||||
m_display->write_row(2, ~m_select1 >> 4 & 0xf);
|
||||
|
||||
// chessboard leds
|
||||
m_display->matrix_partial(3, 8, 1 << (m_select1 & 0xf), m_led_data2);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::leds1_w)
|
||||
{
|
||||
// d0-d7: button led data
|
||||
m_led_data1 = data;
|
||||
update_leds();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::leds2_w)
|
||||
{
|
||||
// d0-d7: chessboard led data
|
||||
m_led_data2 = data;
|
||||
update_leds();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::select1_w)
|
||||
{
|
||||
// d0-d3: chessboard led select
|
||||
// d4-d7: black/white leds
|
||||
m_select1 = data;
|
||||
update_leds();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::select2_w)
|
||||
{
|
||||
// d0-d3: input mux
|
||||
// d4-d7: lcd data
|
||||
m_select2 = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::control1_w)
|
||||
{
|
||||
// d5: button led select
|
||||
m_control1 = data;
|
||||
update_leds();
|
||||
|
||||
// d6: speaker out
|
||||
m_dac->write(data >> 6 & 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(corona_state::control2_w)
|
||||
{
|
||||
// d0,d1: rombank
|
||||
m_rombank->set_bank(data & 3);
|
||||
|
||||
// d2 rising edge: write to lcd
|
||||
if (~m_control2 & data & 4)
|
||||
lcd_data_w(m_select2 >> 4);
|
||||
|
||||
// d6 rising edge: power-off request
|
||||
if (~m_control2 & data & 0x40)
|
||||
power_off();
|
||||
|
||||
m_control2 = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(corona_state::control1_r)
|
||||
{
|
||||
u8 data = 0;
|
||||
|
||||
// d5: lcd status flag?
|
||||
if (m_lcd_ready)
|
||||
data |= 0x20;
|
||||
|
||||
// d6: FREQ. SEL related?
|
||||
|
||||
// d7: battery low
|
||||
data |= m_inputs[8]->read();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(corona_state::control2_r)
|
||||
{
|
||||
u8 data = 0;
|
||||
u8 sel = m_select2 & 0xf;
|
||||
|
||||
// d5-d7: read button panel
|
||||
if (sel < 8)
|
||||
data |= m_inputs[sel]->read() << 5;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(corona_state::chessboard_r)
|
||||
{
|
||||
// d0-d7: chessboard sensors
|
||||
return ~m_board->read_file(m_select2 & 0xf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
Address Maps
|
||||
******************************************************************************/
|
||||
|
||||
void saitek_corona_state::main_map(address_map &map)
|
||||
void corona_state::main_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).ram();
|
||||
map(0x8000, 0xffff).rom();
|
||||
map(0x0000, 0x1fff).ram().share("nvram");
|
||||
map(0x2000, 0x2000).w(FUNC(corona_state::select1_w));
|
||||
map(0x2400, 0x2400).rw(FUNC(corona_state::chessboard_r), FUNC(corona_state::leds1_w));
|
||||
map(0x2600, 0x2600).rw(FUNC(corona_state::control1_r), FUNC(corona_state::control1_w));
|
||||
map(0x6000, 0x6000).w(FUNC(corona_state::select2_w));
|
||||
map(0x6200, 0x6200).w(FUNC(corona_state::lcd_reset_w));
|
||||
map(0x6400, 0x6400).w(FUNC(corona_state::leds2_w));
|
||||
map(0x6600, 0x6600).rw(FUNC(corona_state::control2_r), FUNC(corona_state::control2_w));
|
||||
map(0x8000, 0xffff).m(m_rombank, FUNC(address_map_bank_device::amap8));
|
||||
}
|
||||
|
||||
void corona_state::rombank_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x00000, 0x0ffff).rom().region("maincpu", 0);
|
||||
map(0x10000, 0x17fff).r(m_extrom, FUNC(generic_slot_device::read_rom));
|
||||
}
|
||||
|
||||
|
||||
@ -88,8 +248,8 @@ void saitek_corona_state::main_map(address_map &map)
|
||||
static INPUT_PORTS_START( corona )
|
||||
PORT_INCLUDE( saitek_stratos )
|
||||
|
||||
PORT_MODIFY("IN.6")
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM)
|
||||
PORT_MODIFY("IN.5")
|
||||
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CODE(KEYCODE_G) PORT_NAME("LCD Scroll")
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -98,23 +258,25 @@ INPUT_PORTS_END
|
||||
Machine Drivers
|
||||
******************************************************************************/
|
||||
|
||||
void saitek_corona_state::corona(machine_config &config)
|
||||
void corona_state::corona(machine_config &config)
|
||||
{
|
||||
/* basic machine hardware */
|
||||
M65C02(config, m_maincpu, 5_MHz_XTAL); // see set_cpu_freq
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &saitek_corona_state::main_map);
|
||||
m_maincpu->set_periodic_int(FUNC(saitek_corona_state::irq0_line_hold), attotime::from_hz(100));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &corona_state::main_map);
|
||||
m_maincpu->set_periodic_int(FUNC(corona_state::irq0_line_hold), attotime::from_hz(175));
|
||||
|
||||
ADDRESS_MAP_BANK(config, "rombank").set_map(&corona_state::rombank_map).set_options(ENDIANNESS_LITTLE, 8, 17, 0x8000);
|
||||
|
||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
||||
|
||||
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
|
||||
m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess));
|
||||
m_board->set_delay(attotime::from_msec(200));
|
||||
|
||||
/* video hardware */
|
||||
PWM_DISPLAY(config, m_display).set_size(2+4, 8+1);
|
||||
PWM_DISPLAY(config, m_display).set_size(3+8, 8);
|
||||
config.set_default_layout(layout_saitek_corona);
|
||||
|
||||
TIMER(config, "lcd_busy").configure_generic(timer_device::expired_delegate());
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
|
||||
@ -122,7 +284,7 @@ void saitek_corona_state::corona(machine_config &config)
|
||||
|
||||
/* extension rom */
|
||||
GENERIC_CARTSLOT(config, m_extrom, generic_plain_slot, "saitek_egr", "bin");
|
||||
m_extrom->set_device_load(FUNC(saitek_corona_state::extrom_load), this);
|
||||
m_extrom->set_device_load(FUNC(corona_state::extrom_load), this);
|
||||
|
||||
SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr");
|
||||
}
|
||||
@ -145,6 +307,8 @@ ROM_START( coronaa )
|
||||
ROM_LOAD("bw2_a14_u3.u3", 0x8000, 0x8000, CRC(abe87285) SHA1(b15f7ddeac78d252cf413ba4085523e44c6d15df) )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@ -152,5 +316,5 @@ ROM_END
|
||||
******************************************************************************/
|
||||
|
||||
/* YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS */
|
||||
CONS( 1988, corona, 0, 0, corona, corona, saitek_corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II
|
||||
CONS( 1988, coronaa, corona, 0, corona, corona, saitek_corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
|
||||
CONS( 1988, corona, 0, 0, corona, corona, corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D+)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK ) // aka Corona II
|
||||
CONS( 1988, coronaa, corona, 0, corona, corona, corona_state, empty_init, "Saitek", "Kasparov Corona (ver. D)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_CLICKABLE_ARTWORK )
|
||||
|
Loading…
Reference in New Issue
Block a user